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
37/// Describes an autoscaling policy for Dataproc cluster autoscaler.
38#[serde_with::serde_as]
39#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
40#[serde(default, rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct AutoscalingPolicy {
43    /// Required. The policy id.
44    ///
45    /// The id must contain only letters (a-z, A-Z), numbers (0-9),
46    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
47    /// or hyphen. Must consist of between 3 and 50 characters.
48    #[serde(skip_serializing_if = "std::string::String::is_empty")]
49    pub id: std::string::String,
50
51    /// Output only. The "resource name" of the autoscaling policy, as described
52    /// in <https://cloud.google.com/apis/design/resource_names>.
53    ///
54    /// * For `projects.regions.autoscalingPolicies`, the resource name of the
55    ///   policy has the following format:
56    ///   `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
57    ///
58    /// * For `projects.locations.autoscalingPolicies`, the resource name of the
59    ///   policy has the following format:
60    ///   `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
61    ///
62    #[serde(skip_serializing_if = "std::string::String::is_empty")]
63    pub name: std::string::String,
64
65    /// Required. Describes how the autoscaler will operate for primary workers.
66    #[serde(skip_serializing_if = "std::option::Option::is_none")]
67    pub worker_config: std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
68
69    /// Optional. Describes how the autoscaler will operate for secondary workers.
70    #[serde(skip_serializing_if = "std::option::Option::is_none")]
71    pub secondary_worker_config:
72        std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
73
74    /// Optional. The labels to associate with this autoscaling policy.
75    /// Label **keys** must contain 1 to 63 characters, and must conform to
76    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
77    /// Label **values** may be empty, but, if present, must contain 1 to 63
78    /// characters, and must conform to [RFC
79    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
80    /// associated with an autoscaling policy.
81    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
82    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
83
84    /// Autoscaling algorithm for policy.
85    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
86    pub algorithm: std::option::Option<crate::model::autoscaling_policy::Algorithm>,
87
88    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
89    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
90}
91
92impl AutoscalingPolicy {
93    pub fn new() -> Self {
94        std::default::Default::default()
95    }
96
97    /// Sets the value of [id][crate::model::AutoscalingPolicy::id].
98    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.id = v.into();
100        self
101    }
102
103    /// Sets the value of [name][crate::model::AutoscalingPolicy::name].
104    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105        self.name = v.into();
106        self
107    }
108
109    /// Sets the value of [worker_config][crate::model::AutoscalingPolicy::worker_config].
110    pub fn set_worker_config<
111        T: std::convert::Into<std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>>,
112    >(
113        mut self,
114        v: T,
115    ) -> Self {
116        self.worker_config = v.into();
117        self
118    }
119
120    /// Sets the value of [secondary_worker_config][crate::model::AutoscalingPolicy::secondary_worker_config].
121    pub fn set_secondary_worker_config<
122        T: std::convert::Into<std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>>,
123    >(
124        mut self,
125        v: T,
126    ) -> Self {
127        self.secondary_worker_config = v.into();
128        self
129    }
130
131    /// Sets the value of [labels][crate::model::AutoscalingPolicy::labels].
132    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
133    where
134        T: std::iter::IntoIterator<Item = (K, V)>,
135        K: std::convert::Into<std::string::String>,
136        V: std::convert::Into<std::string::String>,
137    {
138        use std::iter::Iterator;
139        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
140        self
141    }
142
143    /// Sets the value of [algorithm][crate::model::AutoscalingPolicy::algorithm].
144    ///
145    /// Note that all the setters affecting `algorithm` are mutually
146    /// exclusive.
147    pub fn set_algorithm<
148        T: std::convert::Into<std::option::Option<crate::model::autoscaling_policy::Algorithm>>,
149    >(
150        mut self,
151        v: T,
152    ) -> Self {
153        self.algorithm = v.into();
154        self
155    }
156
157    /// The value of [algorithm][crate::model::AutoscalingPolicy::algorithm]
158    /// if it holds a `BasicAlgorithm`, `None` if the field is not set or
159    /// holds a different branch.
160    pub fn basic_algorithm(
161        &self,
162    ) -> std::option::Option<&std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>> {
163        #[allow(unreachable_patterns)]
164        self.algorithm.as_ref().and_then(|v| match v {
165            crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v) => {
166                std::option::Option::Some(v)
167            }
168            _ => std::option::Option::None,
169        })
170    }
171
172    /// Sets the value of [algorithm][crate::model::AutoscalingPolicy::algorithm]
173    /// to hold a `BasicAlgorithm`.
174    ///
175    /// Note that all the setters affecting `algorithm` are
176    /// mutually exclusive.
177    pub fn set_basic_algorithm<
178        T: std::convert::Into<std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>>,
179    >(
180        mut self,
181        v: T,
182    ) -> Self {
183        self.algorithm = std::option::Option::Some(
184            crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v.into()),
185        );
186        self
187    }
188}
189
190impl wkt::message::Message for AutoscalingPolicy {
191    fn typename() -> &'static str {
192        "type.googleapis.com/google.cloud.dataproc.v1.AutoscalingPolicy"
193    }
194}
195
196/// Defines additional types related to [AutoscalingPolicy].
197pub mod autoscaling_policy {
198    #[allow(unused_imports)]
199    use super::*;
200
201    /// Autoscaling algorithm for policy.
202    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
203    #[serde(rename_all = "camelCase")]
204    #[non_exhaustive]
205    pub enum Algorithm {
206        BasicAlgorithm(std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>),
207    }
208}
209
210/// Basic algorithm for autoscaling.
211#[serde_with::serde_as]
212#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
213#[serde(default, rename_all = "camelCase")]
214#[non_exhaustive]
215pub struct BasicAutoscalingAlgorithm {
216    /// Optional. Duration between scaling events. A scaling period starts after
217    /// the update operation from the previous event has completed.
218    ///
219    /// Bounds: [2m, 1d]. Default: 2m.
220    #[serde(skip_serializing_if = "std::option::Option::is_none")]
221    pub cooldown_period: std::option::Option<wkt::Duration>,
222
223    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
224    pub config: std::option::Option<crate::model::basic_autoscaling_algorithm::Config>,
225
226    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
227    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
228}
229
230impl BasicAutoscalingAlgorithm {
231    pub fn new() -> Self {
232        std::default::Default::default()
233    }
234
235    /// Sets the value of [cooldown_period][crate::model::BasicAutoscalingAlgorithm::cooldown_period].
236    pub fn set_cooldown_period<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
237        mut self,
238        v: T,
239    ) -> Self {
240        self.cooldown_period = v.into();
241        self
242    }
243
244    /// Sets the value of [config][crate::model::BasicAutoscalingAlgorithm::config].
245    ///
246    /// Note that all the setters affecting `config` are mutually
247    /// exclusive.
248    pub fn set_config<
249        T: std::convert::Into<std::option::Option<crate::model::basic_autoscaling_algorithm::Config>>,
250    >(
251        mut self,
252        v: T,
253    ) -> Self {
254        self.config = v.into();
255        self
256    }
257
258    /// The value of [config][crate::model::BasicAutoscalingAlgorithm::config]
259    /// if it holds a `YarnConfig`, `None` if the field is not set or
260    /// holds a different branch.
261    pub fn yarn_config(
262        &self,
263    ) -> std::option::Option<&std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>> {
264        #[allow(unreachable_patterns)]
265        self.config.as_ref().and_then(|v| match v {
266            crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v) => {
267                std::option::Option::Some(v)
268            }
269            _ => std::option::Option::None,
270        })
271    }
272
273    /// Sets the value of [config][crate::model::BasicAutoscalingAlgorithm::config]
274    /// to hold a `YarnConfig`.
275    ///
276    /// Note that all the setters affecting `config` are
277    /// mutually exclusive.
278    pub fn set_yarn_config<
279        T: std::convert::Into<std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>>,
280    >(
281        mut self,
282        v: T,
283    ) -> Self {
284        self.config = std::option::Option::Some(
285            crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v.into()),
286        );
287        self
288    }
289}
290
291impl wkt::message::Message for BasicAutoscalingAlgorithm {
292    fn typename() -> &'static str {
293        "type.googleapis.com/google.cloud.dataproc.v1.BasicAutoscalingAlgorithm"
294    }
295}
296
297/// Defines additional types related to [BasicAutoscalingAlgorithm].
298pub mod basic_autoscaling_algorithm {
299    #[allow(unused_imports)]
300    use super::*;
301
302    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
303    #[serde(rename_all = "camelCase")]
304    #[non_exhaustive]
305    pub enum Config {
306        /// Required. YARN autoscaling configuration.
307        YarnConfig(std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>),
308    }
309}
310
311/// Basic autoscaling configurations for YARN.
312#[serde_with::serde_as]
313#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
314#[serde(default, rename_all = "camelCase")]
315#[non_exhaustive]
316pub struct BasicYarnAutoscalingConfig {
317    /// Required. Timeout for YARN graceful decommissioning of Node Managers.
318    /// Specifies the duration to wait for jobs to complete before forcefully
319    /// removing workers (and potentially interrupting jobs). Only applicable to
320    /// downscaling operations.
321    ///
322    /// Bounds: [0s, 1d].
323    #[serde(skip_serializing_if = "std::option::Option::is_none")]
324    pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
325
326    /// Required. Fraction of average YARN pending memory in the last cooldown
327    /// period for which to add workers. A scale-up factor of 1.0 will result in
328    /// scaling up so that there is no pending memory remaining after the update
329    /// (more aggressive scaling). A scale-up factor closer to 0 will result in a
330    /// smaller magnitude of scaling up (less aggressive scaling). See [How
331    /// autoscaling
332    /// works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works)
333    /// for more information.
334    ///
335    /// Bounds: [0.0, 1.0].
336    pub scale_up_factor: f64,
337
338    /// Required. Fraction of average YARN pending memory in the last cooldown
339    /// period for which to remove workers. A scale-down factor of 1 will result in
340    /// scaling down so that there is no available memory remaining after the
341    /// update (more aggressive scaling). A scale-down factor of 0 disables
342    /// removing workers, which can be beneficial for autoscaling a single job.
343    /// See [How autoscaling
344    /// works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works)
345    /// for more information.
346    ///
347    /// Bounds: [0.0, 1.0].
348    pub scale_down_factor: f64,
349
350    /// Optional. Minimum scale-up threshold as a fraction of total cluster size
351    /// before scaling occurs. For example, in a 20-worker cluster, a threshold of
352    /// 0.1 means the autoscaler must recommend at least a 2-worker scale-up for
353    /// the cluster to scale. A threshold of 0 means the autoscaler will scale up
354    /// on any recommended change.
355    ///
356    /// Bounds: [0.0, 1.0]. Default: 0.0.
357    pub scale_up_min_worker_fraction: f64,
358
359    /// Optional. Minimum scale-down threshold as a fraction of total cluster size
360    /// before scaling occurs. For example, in a 20-worker cluster, a threshold of
361    /// 0.1 means the autoscaler must recommend at least a 2 worker scale-down for
362    /// the cluster to scale. A threshold of 0 means the autoscaler will scale down
363    /// on any recommended change.
364    ///
365    /// Bounds: [0.0, 1.0]. Default: 0.0.
366    pub scale_down_min_worker_fraction: f64,
367
368    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
369    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
370}
371
372impl BasicYarnAutoscalingConfig {
373    pub fn new() -> Self {
374        std::default::Default::default()
375    }
376
377    /// Sets the value of [graceful_decommission_timeout][crate::model::BasicYarnAutoscalingConfig::graceful_decommission_timeout].
378    pub fn set_graceful_decommission_timeout<
379        T: std::convert::Into<std::option::Option<wkt::Duration>>,
380    >(
381        mut self,
382        v: T,
383    ) -> Self {
384        self.graceful_decommission_timeout = v.into();
385        self
386    }
387
388    /// Sets the value of [scale_up_factor][crate::model::BasicYarnAutoscalingConfig::scale_up_factor].
389    pub fn set_scale_up_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
390        self.scale_up_factor = v.into();
391        self
392    }
393
394    /// Sets the value of [scale_down_factor][crate::model::BasicYarnAutoscalingConfig::scale_down_factor].
395    pub fn set_scale_down_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
396        self.scale_down_factor = v.into();
397        self
398    }
399
400    /// Sets the value of [scale_up_min_worker_fraction][crate::model::BasicYarnAutoscalingConfig::scale_up_min_worker_fraction].
401    pub fn set_scale_up_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
402        self.scale_up_min_worker_fraction = v.into();
403        self
404    }
405
406    /// Sets the value of [scale_down_min_worker_fraction][crate::model::BasicYarnAutoscalingConfig::scale_down_min_worker_fraction].
407    pub fn set_scale_down_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
408        self.scale_down_min_worker_fraction = v.into();
409        self
410    }
411}
412
413impl wkt::message::Message for BasicYarnAutoscalingConfig {
414    fn typename() -> &'static str {
415        "type.googleapis.com/google.cloud.dataproc.v1.BasicYarnAutoscalingConfig"
416    }
417}
418
419/// Configuration for the size bounds of an instance group, including its
420/// proportional size to other groups.
421#[serde_with::serde_as]
422#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
423#[serde(default, rename_all = "camelCase")]
424#[non_exhaustive]
425pub struct InstanceGroupAutoscalingPolicyConfig {
426    /// Optional. Minimum number of instances for this group.
427    ///
428    /// Primary workers - Bounds: [2, max_instances]. Default: 2.
429    /// Secondary workers - Bounds: [0, max_instances]. Default: 0.
430    pub min_instances: i32,
431
432    /// Required. Maximum number of instances for this group. Required for primary
433    /// workers. Note that by default, clusters will not use secondary workers.
434    /// Required for secondary workers if the minimum secondary instances is set.
435    ///
436    /// Primary workers - Bounds: [min_instances, ).
437    /// Secondary workers - Bounds: [min_instances, ). Default: 0.
438    pub max_instances: i32,
439
440    /// Optional. Weight for the instance group, which is used to determine the
441    /// fraction of total workers in the cluster from this instance group.
442    /// For example, if primary workers have weight 2, and secondary workers have
443    /// weight 1, the cluster will have approximately 2 primary workers for each
444    /// secondary worker.
445    ///
446    /// The cluster may not reach the specified balance if constrained
447    /// by min/max bounds or other autoscaling settings. For example, if
448    /// `max_instances` for secondary workers is 0, then only primary workers will
449    /// be added. The cluster can also be out of balance when created.
450    ///
451    /// If weight is not set on any instance group, the cluster will default to
452    /// equal weight for all groups: the cluster will attempt to maintain an equal
453    /// number of workers in each group within the configured size bounds for each
454    /// group. If weight is set for one group only, the cluster will default to
455    /// zero weight on the unset group. For example if weight is set only on
456    /// primary workers, the cluster will use primary workers only and no
457    /// secondary workers.
458    pub weight: i32,
459
460    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
461    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
462}
463
464impl InstanceGroupAutoscalingPolicyConfig {
465    pub fn new() -> Self {
466        std::default::Default::default()
467    }
468
469    /// Sets the value of [min_instances][crate::model::InstanceGroupAutoscalingPolicyConfig::min_instances].
470    pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
471        self.min_instances = v.into();
472        self
473    }
474
475    /// Sets the value of [max_instances][crate::model::InstanceGroupAutoscalingPolicyConfig::max_instances].
476    pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
477        self.max_instances = v.into();
478        self
479    }
480
481    /// Sets the value of [weight][crate::model::InstanceGroupAutoscalingPolicyConfig::weight].
482    pub fn set_weight<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
483        self.weight = v.into();
484        self
485    }
486}
487
488impl wkt::message::Message for InstanceGroupAutoscalingPolicyConfig {
489    fn typename() -> &'static str {
490        "type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig"
491    }
492}
493
494/// A request to create an autoscaling policy.
495#[serde_with::serde_as]
496#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
497#[serde(default, rename_all = "camelCase")]
498#[non_exhaustive]
499pub struct CreateAutoscalingPolicyRequest {
500    /// Required. The "resource name" of the region or location, as described
501    /// in <https://cloud.google.com/apis/design/resource_names>.
502    ///
503    /// * For `projects.regions.autoscalingPolicies.create`, the resource name
504    ///   of the region has the following format:
505    ///   `projects/{project_id}/regions/{region}`
506    ///
507    /// * For `projects.locations.autoscalingPolicies.create`, the resource name
508    ///   of the location has the following format:
509    ///   `projects/{project_id}/locations/{location}`
510    ///
511    #[serde(skip_serializing_if = "std::string::String::is_empty")]
512    pub parent: std::string::String,
513
514    /// Required. The autoscaling policy to create.
515    #[serde(skip_serializing_if = "std::option::Option::is_none")]
516    pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
517
518    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
519    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
520}
521
522impl CreateAutoscalingPolicyRequest {
523    pub fn new() -> Self {
524        std::default::Default::default()
525    }
526
527    /// Sets the value of [parent][crate::model::CreateAutoscalingPolicyRequest::parent].
528    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
529        self.parent = v.into();
530        self
531    }
532
533    /// Sets the value of [policy][crate::model::CreateAutoscalingPolicyRequest::policy].
534    pub fn set_policy<
535        T: std::convert::Into<std::option::Option<crate::model::AutoscalingPolicy>>,
536    >(
537        mut self,
538        v: T,
539    ) -> Self {
540        self.policy = v.into();
541        self
542    }
543}
544
545impl wkt::message::Message for CreateAutoscalingPolicyRequest {
546    fn typename() -> &'static str {
547        "type.googleapis.com/google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest"
548    }
549}
550
551/// A request to fetch an autoscaling policy.
552#[serde_with::serde_as]
553#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
554#[serde(default, rename_all = "camelCase")]
555#[non_exhaustive]
556pub struct GetAutoscalingPolicyRequest {
557    /// Required. The "resource name" of the autoscaling policy, as described
558    /// in <https://cloud.google.com/apis/design/resource_names>.
559    ///
560    /// * For `projects.regions.autoscalingPolicies.get`, the resource name
561    ///   of the policy has the following format:
562    ///   `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
563    ///
564    /// * For `projects.locations.autoscalingPolicies.get`, the resource name
565    ///   of the policy has the following format:
566    ///   `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
567    ///
568    #[serde(skip_serializing_if = "std::string::String::is_empty")]
569    pub name: std::string::String,
570
571    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
572    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
573}
574
575impl GetAutoscalingPolicyRequest {
576    pub fn new() -> Self {
577        std::default::Default::default()
578    }
579
580    /// Sets the value of [name][crate::model::GetAutoscalingPolicyRequest::name].
581    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
582        self.name = v.into();
583        self
584    }
585}
586
587impl wkt::message::Message for GetAutoscalingPolicyRequest {
588    fn typename() -> &'static str {
589        "type.googleapis.com/google.cloud.dataproc.v1.GetAutoscalingPolicyRequest"
590    }
591}
592
593/// A request to update an autoscaling policy.
594#[serde_with::serde_as]
595#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
596#[serde(default, rename_all = "camelCase")]
597#[non_exhaustive]
598pub struct UpdateAutoscalingPolicyRequest {
599    /// Required. The updated autoscaling policy.
600    #[serde(skip_serializing_if = "std::option::Option::is_none")]
601    pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
602
603    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
604    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
605}
606
607impl UpdateAutoscalingPolicyRequest {
608    pub fn new() -> Self {
609        std::default::Default::default()
610    }
611
612    /// Sets the value of [policy][crate::model::UpdateAutoscalingPolicyRequest::policy].
613    pub fn set_policy<
614        T: std::convert::Into<std::option::Option<crate::model::AutoscalingPolicy>>,
615    >(
616        mut self,
617        v: T,
618    ) -> Self {
619        self.policy = v.into();
620        self
621    }
622}
623
624impl wkt::message::Message for UpdateAutoscalingPolicyRequest {
625    fn typename() -> &'static str {
626        "type.googleapis.com/google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest"
627    }
628}
629
630/// A request to delete an autoscaling policy.
631///
632/// Autoscaling policies in use by one or more clusters will not be deleted.
633#[serde_with::serde_as]
634#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
635#[serde(default, rename_all = "camelCase")]
636#[non_exhaustive]
637pub struct DeleteAutoscalingPolicyRequest {
638    /// Required. The "resource name" of the autoscaling policy, as described
639    /// in <https://cloud.google.com/apis/design/resource_names>.
640    ///
641    /// * For `projects.regions.autoscalingPolicies.delete`, the resource name
642    ///   of the policy has the following format:
643    ///   `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
644    ///
645    /// * For `projects.locations.autoscalingPolicies.delete`, the resource name
646    ///   of the policy has the following format:
647    ///   `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
648    ///
649    #[serde(skip_serializing_if = "std::string::String::is_empty")]
650    pub name: std::string::String,
651
652    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
653    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
654}
655
656impl DeleteAutoscalingPolicyRequest {
657    pub fn new() -> Self {
658        std::default::Default::default()
659    }
660
661    /// Sets the value of [name][crate::model::DeleteAutoscalingPolicyRequest::name].
662    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
663        self.name = v.into();
664        self
665    }
666}
667
668impl wkt::message::Message for DeleteAutoscalingPolicyRequest {
669    fn typename() -> &'static str {
670        "type.googleapis.com/google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest"
671    }
672}
673
674/// A request to list autoscaling policies in a project.
675#[serde_with::serde_as]
676#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
677#[serde(default, rename_all = "camelCase")]
678#[non_exhaustive]
679pub struct ListAutoscalingPoliciesRequest {
680    /// Required. The "resource name" of the region or location, as described
681    /// in <https://cloud.google.com/apis/design/resource_names>.
682    ///
683    /// * For `projects.regions.autoscalingPolicies.list`, the resource name
684    ///   of the region has the following format:
685    ///   `projects/{project_id}/regions/{region}`
686    ///
687    /// * For `projects.locations.autoscalingPolicies.list`, the resource name
688    ///   of the location has the following format:
689    ///   `projects/{project_id}/locations/{location}`
690    ///
691    #[serde(skip_serializing_if = "std::string::String::is_empty")]
692    pub parent: std::string::String,
693
694    /// Optional. The maximum number of results to return in each response.
695    /// Must be less than or equal to 1000. Defaults to 100.
696    pub page_size: i32,
697
698    /// Optional. The page token, returned by a previous call, to request the
699    /// next page of results.
700    #[serde(skip_serializing_if = "std::string::String::is_empty")]
701    pub page_token: std::string::String,
702
703    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
704    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
705}
706
707impl ListAutoscalingPoliciesRequest {
708    pub fn new() -> Self {
709        std::default::Default::default()
710    }
711
712    /// Sets the value of [parent][crate::model::ListAutoscalingPoliciesRequest::parent].
713    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
714        self.parent = v.into();
715        self
716    }
717
718    /// Sets the value of [page_size][crate::model::ListAutoscalingPoliciesRequest::page_size].
719    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
720        self.page_size = v.into();
721        self
722    }
723
724    /// Sets the value of [page_token][crate::model::ListAutoscalingPoliciesRequest::page_token].
725    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
726        self.page_token = v.into();
727        self
728    }
729}
730
731impl wkt::message::Message for ListAutoscalingPoliciesRequest {
732    fn typename() -> &'static str {
733        "type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest"
734    }
735}
736
737/// A response to a request to list autoscaling policies in a project.
738#[serde_with::serde_as]
739#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
740#[serde(default, rename_all = "camelCase")]
741#[non_exhaustive]
742pub struct ListAutoscalingPoliciesResponse {
743    /// Output only. Autoscaling policies list.
744    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
745    pub policies: std::vec::Vec<crate::model::AutoscalingPolicy>,
746
747    /// Output only. This token is included in the response if there are more
748    /// results to fetch.
749    #[serde(skip_serializing_if = "std::string::String::is_empty")]
750    pub next_page_token: std::string::String,
751
752    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
753    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
754}
755
756impl ListAutoscalingPoliciesResponse {
757    pub fn new() -> Self {
758        std::default::Default::default()
759    }
760
761    /// Sets the value of [next_page_token][crate::model::ListAutoscalingPoliciesResponse::next_page_token].
762    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763        self.next_page_token = v.into();
764        self
765    }
766
767    /// Sets the value of [policies][crate::model::ListAutoscalingPoliciesResponse::policies].
768    pub fn set_policies<T, V>(mut self, v: T) -> Self
769    where
770        T: std::iter::IntoIterator<Item = V>,
771        V: std::convert::Into<crate::model::AutoscalingPolicy>,
772    {
773        use std::iter::Iterator;
774        self.policies = v.into_iter().map(|i| i.into()).collect();
775        self
776    }
777}
778
779impl wkt::message::Message for ListAutoscalingPoliciesResponse {
780    fn typename() -> &'static str {
781        "type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse"
782    }
783}
784
785#[doc(hidden)]
786impl gax::paginator::internal::PageableResponse for ListAutoscalingPoliciesResponse {
787    type PageItem = crate::model::AutoscalingPolicy;
788
789    fn items(self) -> std::vec::Vec<Self::PageItem> {
790        self.policies
791    }
792
793    fn next_page_token(&self) -> std::string::String {
794        use std::clone::Clone;
795        self.next_page_token.clone()
796    }
797}
798
799/// A request to create a batch workload.
800#[serde_with::serde_as]
801#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
802#[serde(default, rename_all = "camelCase")]
803#[non_exhaustive]
804pub struct CreateBatchRequest {
805    /// Required. The parent resource where this batch will be created.
806    #[serde(skip_serializing_if = "std::string::String::is_empty")]
807    pub parent: std::string::String,
808
809    /// Required. The batch to create.
810    #[serde(skip_serializing_if = "std::option::Option::is_none")]
811    pub batch: std::option::Option<crate::model::Batch>,
812
813    /// Optional. The ID to use for the batch, which will become the final
814    /// component of the batch's resource name.
815    ///
816    /// This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`.
817    #[serde(skip_serializing_if = "std::string::String::is_empty")]
818    pub batch_id: std::string::String,
819
820    /// Optional. A unique ID used to identify the request. If the service
821    /// receives two
822    /// [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s
823    /// with the same request_id, the second request is ignored and the
824    /// Operation that corresponds to the first Batch created and stored
825    /// in the backend is returned.
826    ///
827    /// Recommendation: Set this value to a
828    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
829    ///
830    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
831    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
832    #[serde(skip_serializing_if = "std::string::String::is_empty")]
833    pub request_id: std::string::String,
834
835    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
836    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
837}
838
839impl CreateBatchRequest {
840    pub fn new() -> Self {
841        std::default::Default::default()
842    }
843
844    /// Sets the value of [parent][crate::model::CreateBatchRequest::parent].
845    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846        self.parent = v.into();
847        self
848    }
849
850    /// Sets the value of [batch][crate::model::CreateBatchRequest::batch].
851    pub fn set_batch<T: std::convert::Into<std::option::Option<crate::model::Batch>>>(
852        mut self,
853        v: T,
854    ) -> Self {
855        self.batch = v.into();
856        self
857    }
858
859    /// Sets the value of [batch_id][crate::model::CreateBatchRequest::batch_id].
860    pub fn set_batch_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
861        self.batch_id = v.into();
862        self
863    }
864
865    /// Sets the value of [request_id][crate::model::CreateBatchRequest::request_id].
866    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
867        self.request_id = v.into();
868        self
869    }
870}
871
872impl wkt::message::Message for CreateBatchRequest {
873    fn typename() -> &'static str {
874        "type.googleapis.com/google.cloud.dataproc.v1.CreateBatchRequest"
875    }
876}
877
878/// A request to get the resource representation for a batch workload.
879#[serde_with::serde_as]
880#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
881#[serde(default, rename_all = "camelCase")]
882#[non_exhaustive]
883pub struct GetBatchRequest {
884    /// Required. The fully qualified name of the batch to retrieve
885    /// in the format
886    /// "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
887    #[serde(skip_serializing_if = "std::string::String::is_empty")]
888    pub name: std::string::String,
889
890    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
891    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
892}
893
894impl GetBatchRequest {
895    pub fn new() -> Self {
896        std::default::Default::default()
897    }
898
899    /// Sets the value of [name][crate::model::GetBatchRequest::name].
900    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
901        self.name = v.into();
902        self
903    }
904}
905
906impl wkt::message::Message for GetBatchRequest {
907    fn typename() -> &'static str {
908        "type.googleapis.com/google.cloud.dataproc.v1.GetBatchRequest"
909    }
910}
911
912/// A request to list batch workloads in a project.
913#[serde_with::serde_as]
914#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
915#[serde(default, rename_all = "camelCase")]
916#[non_exhaustive]
917pub struct ListBatchesRequest {
918    /// Required. The parent, which owns this collection of batches.
919    #[serde(skip_serializing_if = "std::string::String::is_empty")]
920    pub parent: std::string::String,
921
922    /// Optional. The maximum number of batches to return in each response.
923    /// The service may return fewer than this value.
924    /// The default page size is 20; the maximum page size is 1000.
925    pub page_size: i32,
926
927    /// Optional. A page token received from a previous `ListBatches` call.
928    /// Provide this token to retrieve the subsequent page.
929    #[serde(skip_serializing_if = "std::string::String::is_empty")]
930    pub page_token: std::string::String,
931
932    /// Optional. A filter for the batches to return in the response.
933    ///
934    /// A filter is a logical expression constraining the values of various fields
935    /// in each batch resource. Filters are case sensitive, and may contain
936    /// multiple clauses combined with logical operators (AND/OR).
937    /// Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`.
938    ///
939    /// e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"`
940    /// filters for batches in state RUNNING that were created before 2023-01-01
941    ///
942    /// See <https://google.aip.dev/assets/misc/ebnf-filtering.txt> for a detailed
943    /// description of the filter syntax and a list of supported comparisons.
944    #[serde(skip_serializing_if = "std::string::String::is_empty")]
945    pub filter: std::string::String,
946
947    /// Optional. Field(s) on which to sort the list of batches.
948    ///
949    /// Currently the only supported sort orders are unspecified (empty) and
950    /// `create_time desc` to sort by most recently created batches first.
951    ///
952    /// See <https://google.aip.dev/132#ordering> for more details.
953    #[serde(skip_serializing_if = "std::string::String::is_empty")]
954    pub order_by: std::string::String,
955
956    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
957    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
958}
959
960impl ListBatchesRequest {
961    pub fn new() -> Self {
962        std::default::Default::default()
963    }
964
965    /// Sets the value of [parent][crate::model::ListBatchesRequest::parent].
966    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
967        self.parent = v.into();
968        self
969    }
970
971    /// Sets the value of [page_size][crate::model::ListBatchesRequest::page_size].
972    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
973        self.page_size = v.into();
974        self
975    }
976
977    /// Sets the value of [page_token][crate::model::ListBatchesRequest::page_token].
978    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
979        self.page_token = v.into();
980        self
981    }
982
983    /// Sets the value of [filter][crate::model::ListBatchesRequest::filter].
984    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
985        self.filter = v.into();
986        self
987    }
988
989    /// Sets the value of [order_by][crate::model::ListBatchesRequest::order_by].
990    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
991        self.order_by = v.into();
992        self
993    }
994}
995
996impl wkt::message::Message for ListBatchesRequest {
997    fn typename() -> &'static str {
998        "type.googleapis.com/google.cloud.dataproc.v1.ListBatchesRequest"
999    }
1000}
1001
1002/// A list of batch workloads.
1003#[serde_with::serde_as]
1004#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1005#[serde(default, rename_all = "camelCase")]
1006#[non_exhaustive]
1007pub struct ListBatchesResponse {
1008    /// The batches from the specified collection.
1009    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1010    pub batches: std::vec::Vec<crate::model::Batch>,
1011
1012    /// A token, which can be sent as `page_token` to retrieve the next page.
1013    /// If this field is omitted, there are no subsequent pages.
1014    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1015    pub next_page_token: std::string::String,
1016
1017    /// Output only. List of Batches that could not be included in the response.
1018    /// Attempting to get one of these resources may indicate why it was not
1019    /// included in the list response.
1020    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1021    pub unreachable: std::vec::Vec<std::string::String>,
1022
1023    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1024    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1025}
1026
1027impl ListBatchesResponse {
1028    pub fn new() -> Self {
1029        std::default::Default::default()
1030    }
1031
1032    /// Sets the value of [next_page_token][crate::model::ListBatchesResponse::next_page_token].
1033    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1034        self.next_page_token = v.into();
1035        self
1036    }
1037
1038    /// Sets the value of [batches][crate::model::ListBatchesResponse::batches].
1039    pub fn set_batches<T, V>(mut self, v: T) -> Self
1040    where
1041        T: std::iter::IntoIterator<Item = V>,
1042        V: std::convert::Into<crate::model::Batch>,
1043    {
1044        use std::iter::Iterator;
1045        self.batches = v.into_iter().map(|i| i.into()).collect();
1046        self
1047    }
1048
1049    /// Sets the value of [unreachable][crate::model::ListBatchesResponse::unreachable].
1050    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1051    where
1052        T: std::iter::IntoIterator<Item = V>,
1053        V: std::convert::Into<std::string::String>,
1054    {
1055        use std::iter::Iterator;
1056        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1057        self
1058    }
1059}
1060
1061impl wkt::message::Message for ListBatchesResponse {
1062    fn typename() -> &'static str {
1063        "type.googleapis.com/google.cloud.dataproc.v1.ListBatchesResponse"
1064    }
1065}
1066
1067#[doc(hidden)]
1068impl gax::paginator::internal::PageableResponse for ListBatchesResponse {
1069    type PageItem = crate::model::Batch;
1070
1071    fn items(self) -> std::vec::Vec<Self::PageItem> {
1072        self.batches
1073    }
1074
1075    fn next_page_token(&self) -> std::string::String {
1076        use std::clone::Clone;
1077        self.next_page_token.clone()
1078    }
1079}
1080
1081/// A request to delete a batch workload.
1082#[serde_with::serde_as]
1083#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1084#[serde(default, rename_all = "camelCase")]
1085#[non_exhaustive]
1086pub struct DeleteBatchRequest {
1087    /// Required. The fully qualified name of the batch to retrieve
1088    /// in the format
1089    /// "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
1090    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1091    pub name: std::string::String,
1092
1093    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1094    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1095}
1096
1097impl DeleteBatchRequest {
1098    pub fn new() -> Self {
1099        std::default::Default::default()
1100    }
1101
1102    /// Sets the value of [name][crate::model::DeleteBatchRequest::name].
1103    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104        self.name = v.into();
1105        self
1106    }
1107}
1108
1109impl wkt::message::Message for DeleteBatchRequest {
1110    fn typename() -> &'static str {
1111        "type.googleapis.com/google.cloud.dataproc.v1.DeleteBatchRequest"
1112    }
1113}
1114
1115/// A representation of a batch workload in the service.
1116#[serde_with::serde_as]
1117#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1118#[serde(default, rename_all = "camelCase")]
1119#[non_exhaustive]
1120pub struct Batch {
1121    /// Output only. The resource name of the batch.
1122    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1123    pub name: std::string::String,
1124
1125    /// Output only. A batch UUID (Unique Universal Identifier). The service
1126    /// generates this value when it creates the batch.
1127    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1128    pub uuid: std::string::String,
1129
1130    /// Output only. The time when the batch was created.
1131    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1132    pub create_time: std::option::Option<wkt::Timestamp>,
1133
1134    /// Output only. Runtime information about batch execution.
1135    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1136    pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
1137
1138    /// Output only. The state of the batch.
1139    pub state: crate::model::batch::State,
1140
1141    /// Output only. Batch state details, such as a failure
1142    /// description if the state is `FAILED`.
1143    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1144    pub state_message: std::string::String,
1145
1146    /// Output only. The time when the batch entered a current state.
1147    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1148    pub state_time: std::option::Option<wkt::Timestamp>,
1149
1150    /// Output only. The email address of the user who created the batch.
1151    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1152    pub creator: std::string::String,
1153
1154    /// Optional. The labels to associate with this batch.
1155    /// Label **keys** must contain 1 to 63 characters, and must conform to
1156    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
1157    /// Label **values** may be empty, but, if present, must contain 1 to 63
1158    /// characters, and must conform to [RFC
1159    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
1160    /// associated with a batch.
1161    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1162    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1163
1164    /// Optional. Runtime configuration for the batch execution.
1165    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1166    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1167
1168    /// Optional. Environment configuration for the batch execution.
1169    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1170    pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
1171
1172    /// Output only. The resource name of the operation associated with this batch.
1173    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1174    pub operation: std::string::String,
1175
1176    /// Output only. Historical state information for the batch.
1177    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1178    pub state_history: std::vec::Vec<crate::model::batch::StateHistory>,
1179
1180    /// The application/framework-specific portion of the batch configuration.
1181    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1182    pub batch_config: std::option::Option<crate::model::batch::BatchConfig>,
1183
1184    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1185    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1186}
1187
1188impl Batch {
1189    pub fn new() -> Self {
1190        std::default::Default::default()
1191    }
1192
1193    /// Sets the value of [name][crate::model::Batch::name].
1194    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1195        self.name = v.into();
1196        self
1197    }
1198
1199    /// Sets the value of [uuid][crate::model::Batch::uuid].
1200    pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1201        self.uuid = v.into();
1202        self
1203    }
1204
1205    /// Sets the value of [create_time][crate::model::Batch::create_time].
1206    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1207        mut self,
1208        v: T,
1209    ) -> Self {
1210        self.create_time = v.into();
1211        self
1212    }
1213
1214    /// Sets the value of [runtime_info][crate::model::Batch::runtime_info].
1215    pub fn set_runtime_info<
1216        T: std::convert::Into<std::option::Option<crate::model::RuntimeInfo>>,
1217    >(
1218        mut self,
1219        v: T,
1220    ) -> Self {
1221        self.runtime_info = v.into();
1222        self
1223    }
1224
1225    /// Sets the value of [state][crate::model::Batch::state].
1226    pub fn set_state<T: std::convert::Into<crate::model::batch::State>>(mut self, v: T) -> Self {
1227        self.state = v.into();
1228        self
1229    }
1230
1231    /// Sets the value of [state_message][crate::model::Batch::state_message].
1232    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1233        self.state_message = v.into();
1234        self
1235    }
1236
1237    /// Sets the value of [state_time][crate::model::Batch::state_time].
1238    pub fn set_state_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1239        mut self,
1240        v: T,
1241    ) -> Self {
1242        self.state_time = v.into();
1243        self
1244    }
1245
1246    /// Sets the value of [creator][crate::model::Batch::creator].
1247    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1248        self.creator = v.into();
1249        self
1250    }
1251
1252    /// Sets the value of [runtime_config][crate::model::Batch::runtime_config].
1253    pub fn set_runtime_config<
1254        T: std::convert::Into<std::option::Option<crate::model::RuntimeConfig>>,
1255    >(
1256        mut self,
1257        v: T,
1258    ) -> Self {
1259        self.runtime_config = v.into();
1260        self
1261    }
1262
1263    /// Sets the value of [environment_config][crate::model::Batch::environment_config].
1264    pub fn set_environment_config<
1265        T: std::convert::Into<std::option::Option<crate::model::EnvironmentConfig>>,
1266    >(
1267        mut self,
1268        v: T,
1269    ) -> Self {
1270        self.environment_config = v.into();
1271        self
1272    }
1273
1274    /// Sets the value of [operation][crate::model::Batch::operation].
1275    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276        self.operation = v.into();
1277        self
1278    }
1279
1280    /// Sets the value of [state_history][crate::model::Batch::state_history].
1281    pub fn set_state_history<T, V>(mut self, v: T) -> Self
1282    where
1283        T: std::iter::IntoIterator<Item = V>,
1284        V: std::convert::Into<crate::model::batch::StateHistory>,
1285    {
1286        use std::iter::Iterator;
1287        self.state_history = v.into_iter().map(|i| i.into()).collect();
1288        self
1289    }
1290
1291    /// Sets the value of [labels][crate::model::Batch::labels].
1292    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1293    where
1294        T: std::iter::IntoIterator<Item = (K, V)>,
1295        K: std::convert::Into<std::string::String>,
1296        V: std::convert::Into<std::string::String>,
1297    {
1298        use std::iter::Iterator;
1299        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1300        self
1301    }
1302
1303    /// Sets the value of [batch_config][crate::model::Batch::batch_config].
1304    ///
1305    /// Note that all the setters affecting `batch_config` are mutually
1306    /// exclusive.
1307    pub fn set_batch_config<
1308        T: std::convert::Into<std::option::Option<crate::model::batch::BatchConfig>>,
1309    >(
1310        mut self,
1311        v: T,
1312    ) -> Self {
1313        self.batch_config = v.into();
1314        self
1315    }
1316
1317    /// The value of [batch_config][crate::model::Batch::batch_config]
1318    /// if it holds a `PysparkBatch`, `None` if the field is not set or
1319    /// holds a different branch.
1320    pub fn pyspark_batch(
1321        &self,
1322    ) -> std::option::Option<&std::boxed::Box<crate::model::PySparkBatch>> {
1323        #[allow(unreachable_patterns)]
1324        self.batch_config.as_ref().and_then(|v| match v {
1325            crate::model::batch::BatchConfig::PysparkBatch(v) => std::option::Option::Some(v),
1326            _ => std::option::Option::None,
1327        })
1328    }
1329
1330    /// The value of [batch_config][crate::model::Batch::batch_config]
1331    /// if it holds a `SparkBatch`, `None` if the field is not set or
1332    /// holds a different branch.
1333    pub fn spark_batch(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkBatch>> {
1334        #[allow(unreachable_patterns)]
1335        self.batch_config.as_ref().and_then(|v| match v {
1336            crate::model::batch::BatchConfig::SparkBatch(v) => std::option::Option::Some(v),
1337            _ => std::option::Option::None,
1338        })
1339    }
1340
1341    /// The value of [batch_config][crate::model::Batch::batch_config]
1342    /// if it holds a `SparkRBatch`, `None` if the field is not set or
1343    /// holds a different branch.
1344    pub fn spark_r_batch(
1345        &self,
1346    ) -> std::option::Option<&std::boxed::Box<crate::model::SparkRBatch>> {
1347        #[allow(unreachable_patterns)]
1348        self.batch_config.as_ref().and_then(|v| match v {
1349            crate::model::batch::BatchConfig::SparkRBatch(v) => std::option::Option::Some(v),
1350            _ => std::option::Option::None,
1351        })
1352    }
1353
1354    /// The value of [batch_config][crate::model::Batch::batch_config]
1355    /// if it holds a `SparkSqlBatch`, `None` if the field is not set or
1356    /// holds a different branch.
1357    pub fn spark_sql_batch(
1358        &self,
1359    ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlBatch>> {
1360        #[allow(unreachable_patterns)]
1361        self.batch_config.as_ref().and_then(|v| match v {
1362            crate::model::batch::BatchConfig::SparkSqlBatch(v) => std::option::Option::Some(v),
1363            _ => std::option::Option::None,
1364        })
1365    }
1366
1367    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1368    /// to hold a `PysparkBatch`.
1369    ///
1370    /// Note that all the setters affecting `batch_config` are
1371    /// mutually exclusive.
1372    pub fn set_pyspark_batch<T: std::convert::Into<std::boxed::Box<crate::model::PySparkBatch>>>(
1373        mut self,
1374        v: T,
1375    ) -> Self {
1376        self.batch_config =
1377            std::option::Option::Some(crate::model::batch::BatchConfig::PysparkBatch(v.into()));
1378        self
1379    }
1380
1381    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1382    /// to hold a `SparkBatch`.
1383    ///
1384    /// Note that all the setters affecting `batch_config` are
1385    /// mutually exclusive.
1386    pub fn set_spark_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkBatch>>>(
1387        mut self,
1388        v: T,
1389    ) -> Self {
1390        self.batch_config =
1391            std::option::Option::Some(crate::model::batch::BatchConfig::SparkBatch(v.into()));
1392        self
1393    }
1394
1395    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1396    /// to hold a `SparkRBatch`.
1397    ///
1398    /// Note that all the setters affecting `batch_config` are
1399    /// mutually exclusive.
1400    pub fn set_spark_r_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkRBatch>>>(
1401        mut self,
1402        v: T,
1403    ) -> Self {
1404        self.batch_config =
1405            std::option::Option::Some(crate::model::batch::BatchConfig::SparkRBatch(v.into()));
1406        self
1407    }
1408
1409    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1410    /// to hold a `SparkSqlBatch`.
1411    ///
1412    /// Note that all the setters affecting `batch_config` are
1413    /// mutually exclusive.
1414    pub fn set_spark_sql_batch<
1415        T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlBatch>>,
1416    >(
1417        mut self,
1418        v: T,
1419    ) -> Self {
1420        self.batch_config =
1421            std::option::Option::Some(crate::model::batch::BatchConfig::SparkSqlBatch(v.into()));
1422        self
1423    }
1424}
1425
1426impl wkt::message::Message for Batch {
1427    fn typename() -> &'static str {
1428        "type.googleapis.com/google.cloud.dataproc.v1.Batch"
1429    }
1430}
1431
1432/// Defines additional types related to [Batch].
1433pub mod batch {
1434    #[allow(unused_imports)]
1435    use super::*;
1436
1437    /// Historical state information.
1438    #[serde_with::serde_as]
1439    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1440    #[serde(default, rename_all = "camelCase")]
1441    #[non_exhaustive]
1442    pub struct StateHistory {
1443        /// Output only. The state of the batch at this point in history.
1444        pub state: crate::model::batch::State,
1445
1446        /// Output only. Details about the state at this point in history.
1447        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1448        pub state_message: std::string::String,
1449
1450        /// Output only. The time when the batch entered the historical state.
1451        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1452        pub state_start_time: std::option::Option<wkt::Timestamp>,
1453
1454        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1455        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456    }
1457
1458    impl StateHistory {
1459        pub fn new() -> Self {
1460            std::default::Default::default()
1461        }
1462
1463        /// 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: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1483            mut self,
1484            v: T,
1485        ) -> Self {
1486            self.state_start_time = v.into();
1487            self
1488        }
1489    }
1490
1491    impl wkt::message::Message for StateHistory {
1492        fn typename() -> &'static str {
1493            "type.googleapis.com/google.cloud.dataproc.v1.Batch.StateHistory"
1494        }
1495    }
1496
1497    /// The batch state.
1498    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1499    pub struct State(i32);
1500
1501    impl State {
1502        /// The batch state is unknown.
1503        pub const STATE_UNSPECIFIED: State = State::new(0);
1504
1505        /// The batch is created before running.
1506        pub const PENDING: State = State::new(1);
1507
1508        /// The batch is running.
1509        pub const RUNNING: State = State::new(2);
1510
1511        /// The batch is cancelling.
1512        pub const CANCELLING: State = State::new(3);
1513
1514        /// The batch cancellation was successful.
1515        pub const CANCELLED: State = State::new(4);
1516
1517        /// The batch completed successfully.
1518        pub const SUCCEEDED: State = State::new(5);
1519
1520        /// The batch is no longer running due to an error.
1521        pub const FAILED: State = State::new(6);
1522
1523        /// Creates a new State instance.
1524        pub(crate) const fn new(value: i32) -> Self {
1525            Self(value)
1526        }
1527
1528        /// Gets the enum value.
1529        pub fn value(&self) -> i32 {
1530            self.0
1531        }
1532
1533        /// Gets the enum value as a string.
1534        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1535            match self.0 {
1536                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1537                1 => std::borrow::Cow::Borrowed("PENDING"),
1538                2 => std::borrow::Cow::Borrowed("RUNNING"),
1539                3 => std::borrow::Cow::Borrowed("CANCELLING"),
1540                4 => std::borrow::Cow::Borrowed("CANCELLED"),
1541                5 => std::borrow::Cow::Borrowed("SUCCEEDED"),
1542                6 => std::borrow::Cow::Borrowed("FAILED"),
1543                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1544            }
1545        }
1546
1547        /// Creates an enum value from the value name.
1548        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1549            match name {
1550                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
1551                "PENDING" => std::option::Option::Some(Self::PENDING),
1552                "RUNNING" => std::option::Option::Some(Self::RUNNING),
1553                "CANCELLING" => std::option::Option::Some(Self::CANCELLING),
1554                "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
1555                "SUCCEEDED" => std::option::Option::Some(Self::SUCCEEDED),
1556                "FAILED" => std::option::Option::Some(Self::FAILED),
1557                _ => std::option::Option::None,
1558            }
1559        }
1560    }
1561
1562    impl std::convert::From<i32> for State {
1563        fn from(value: i32) -> Self {
1564            Self::new(value)
1565        }
1566    }
1567
1568    impl std::default::Default for State {
1569        fn default() -> Self {
1570            Self::new(0)
1571        }
1572    }
1573
1574    /// The application/framework-specific portion of the batch configuration.
1575    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1576    #[serde(rename_all = "camelCase")]
1577    #[non_exhaustive]
1578    pub enum BatchConfig {
1579        /// Optional. PySpark batch config.
1580        PysparkBatch(std::boxed::Box<crate::model::PySparkBatch>),
1581        /// Optional. Spark batch config.
1582        SparkBatch(std::boxed::Box<crate::model::SparkBatch>),
1583        /// Optional. SparkR batch config.
1584        SparkRBatch(std::boxed::Box<crate::model::SparkRBatch>),
1585        /// Optional. SparkSql batch config.
1586        SparkSqlBatch(std::boxed::Box<crate::model::SparkSqlBatch>),
1587    }
1588}
1589
1590/// A configuration for running an
1591/// [Apache
1592/// PySpark](https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html)
1593/// batch workload.
1594#[serde_with::serde_as]
1595#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1596#[serde(default, rename_all = "camelCase")]
1597#[non_exhaustive]
1598pub struct PySparkBatch {
1599    /// Required. The HCFS URI of the main Python file to use as the Spark driver.
1600    /// Must be a .py file.
1601    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1602    pub main_python_file_uri: std::string::String,
1603
1604    /// Optional. The arguments to pass to the driver. Do not include arguments
1605    /// that can be set as batch properties, such as `--conf`, since a collision
1606    /// can occur that causes an incorrect batch submission.
1607    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1608    pub args: std::vec::Vec<std::string::String>,
1609
1610    /// Optional. HCFS file URIs of Python files to pass to the PySpark
1611    /// framework. Supported file types: `.py`, `.egg`, and `.zip`.
1612    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1613    pub python_file_uris: std::vec::Vec<std::string::String>,
1614
1615    /// Optional. HCFS URIs of jar files to add to the classpath of the
1616    /// Spark driver and tasks.
1617    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1618    pub jar_file_uris: std::vec::Vec<std::string::String>,
1619
1620    /// Optional. HCFS URIs of files to be placed in the working directory of
1621    /// each executor.
1622    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1623    pub file_uris: std::vec::Vec<std::string::String>,
1624
1625    /// Optional. HCFS URIs of archives to be extracted into the working directory
1626    /// of each executor. Supported file types:
1627    /// `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`.
1628    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1629    pub archive_uris: std::vec::Vec<std::string::String>,
1630
1631    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1632    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl PySparkBatch {
1636    pub fn new() -> Self {
1637        std::default::Default::default()
1638    }
1639
1640    /// Sets the value of [main_python_file_uri][crate::model::PySparkBatch::main_python_file_uri].
1641    pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
1642        mut self,
1643        v: T,
1644    ) -> Self {
1645        self.main_python_file_uri = v.into();
1646        self
1647    }
1648
1649    /// Sets the value of [args][crate::model::PySparkBatch::args].
1650    pub fn set_args<T, V>(mut self, v: T) -> Self
1651    where
1652        T: std::iter::IntoIterator<Item = V>,
1653        V: std::convert::Into<std::string::String>,
1654    {
1655        use std::iter::Iterator;
1656        self.args = v.into_iter().map(|i| i.into()).collect();
1657        self
1658    }
1659
1660    /// Sets the value of [python_file_uris][crate::model::PySparkBatch::python_file_uris].
1661    pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
1662    where
1663        T: std::iter::IntoIterator<Item = V>,
1664        V: std::convert::Into<std::string::String>,
1665    {
1666        use std::iter::Iterator;
1667        self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
1668        self
1669    }
1670
1671    /// Sets the value of [jar_file_uris][crate::model::PySparkBatch::jar_file_uris].
1672    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
1673    where
1674        T: std::iter::IntoIterator<Item = V>,
1675        V: std::convert::Into<std::string::String>,
1676    {
1677        use std::iter::Iterator;
1678        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
1679        self
1680    }
1681
1682    /// Sets the value of [file_uris][crate::model::PySparkBatch::file_uris].
1683    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1684    where
1685        T: std::iter::IntoIterator<Item = V>,
1686        V: std::convert::Into<std::string::String>,
1687    {
1688        use std::iter::Iterator;
1689        self.file_uris = v.into_iter().map(|i| i.into()).collect();
1690        self
1691    }
1692
1693    /// Sets the value of [archive_uris][crate::model::PySparkBatch::archive_uris].
1694    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1695    where
1696        T: std::iter::IntoIterator<Item = V>,
1697        V: std::convert::Into<std::string::String>,
1698    {
1699        use std::iter::Iterator;
1700        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1701        self
1702    }
1703}
1704
1705impl wkt::message::Message for PySparkBatch {
1706    fn typename() -> &'static str {
1707        "type.googleapis.com/google.cloud.dataproc.v1.PySparkBatch"
1708    }
1709}
1710
1711/// A configuration for running an [Apache Spark](https://spark.apache.org/)
1712/// batch workload.
1713#[serde_with::serde_as]
1714#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1715#[serde(default, rename_all = "camelCase")]
1716#[non_exhaustive]
1717pub struct SparkBatch {
1718    /// Optional. The arguments to pass to the driver. Do not include arguments
1719    /// that can be set as batch properties, such as `--conf`, since a collision
1720    /// can occur that causes an incorrect batch submission.
1721    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1722    pub args: std::vec::Vec<std::string::String>,
1723
1724    /// Optional. HCFS URIs of jar files to add to the classpath of the
1725    /// Spark driver and tasks.
1726    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1727    pub jar_file_uris: std::vec::Vec<std::string::String>,
1728
1729    /// Optional. HCFS URIs of files to be placed in the working directory of
1730    /// each executor.
1731    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1732    pub file_uris: std::vec::Vec<std::string::String>,
1733
1734    /// Optional. HCFS URIs of archives to be extracted into the working directory
1735    /// of each executor. Supported file types:
1736    /// `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`.
1737    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1738    pub archive_uris: std::vec::Vec<std::string::String>,
1739
1740    /// The specification of the main method to call to drive the Spark
1741    /// workload. Specify either the jar file that contains the main class or the
1742    /// main class name. To pass both a main jar and a main class in that jar, add
1743    /// the jar to `jar_file_uris`, and then specify the main class
1744    /// name in `main_class`.
1745    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1746    pub driver: std::option::Option<crate::model::spark_batch::Driver>,
1747
1748    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1749    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1750}
1751
1752impl SparkBatch {
1753    pub fn new() -> Self {
1754        std::default::Default::default()
1755    }
1756
1757    /// Sets the value of [args][crate::model::SparkBatch::args].
1758    pub fn set_args<T, V>(mut self, v: T) -> Self
1759    where
1760        T: std::iter::IntoIterator<Item = V>,
1761        V: std::convert::Into<std::string::String>,
1762    {
1763        use std::iter::Iterator;
1764        self.args = v.into_iter().map(|i| i.into()).collect();
1765        self
1766    }
1767
1768    /// Sets the value of [jar_file_uris][crate::model::SparkBatch::jar_file_uris].
1769    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
1770    where
1771        T: std::iter::IntoIterator<Item = V>,
1772        V: std::convert::Into<std::string::String>,
1773    {
1774        use std::iter::Iterator;
1775        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
1776        self
1777    }
1778
1779    /// Sets the value of [file_uris][crate::model::SparkBatch::file_uris].
1780    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1781    where
1782        T: std::iter::IntoIterator<Item = V>,
1783        V: std::convert::Into<std::string::String>,
1784    {
1785        use std::iter::Iterator;
1786        self.file_uris = v.into_iter().map(|i| i.into()).collect();
1787        self
1788    }
1789
1790    /// Sets the value of [archive_uris][crate::model::SparkBatch::archive_uris].
1791    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1792    where
1793        T: std::iter::IntoIterator<Item = V>,
1794        V: std::convert::Into<std::string::String>,
1795    {
1796        use std::iter::Iterator;
1797        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1798        self
1799    }
1800
1801    /// Sets the value of [driver][crate::model::SparkBatch::driver].
1802    ///
1803    /// Note that all the setters affecting `driver` are mutually
1804    /// exclusive.
1805    pub fn set_driver<
1806        T: std::convert::Into<std::option::Option<crate::model::spark_batch::Driver>>,
1807    >(
1808        mut self,
1809        v: T,
1810    ) -> Self {
1811        self.driver = v.into();
1812        self
1813    }
1814
1815    /// The value of [driver][crate::model::SparkBatch::driver]
1816    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
1817    /// holds a different branch.
1818    pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
1819        #[allow(unreachable_patterns)]
1820        self.driver.as_ref().and_then(|v| match v {
1821            crate::model::spark_batch::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
1822            _ => std::option::Option::None,
1823        })
1824    }
1825
1826    /// The value of [driver][crate::model::SparkBatch::driver]
1827    /// if it holds a `MainClass`, `None` if the field is not set or
1828    /// holds a different branch.
1829    pub fn main_class(&self) -> std::option::Option<&std::string::String> {
1830        #[allow(unreachable_patterns)]
1831        self.driver.as_ref().and_then(|v| match v {
1832            crate::model::spark_batch::Driver::MainClass(v) => std::option::Option::Some(v),
1833            _ => std::option::Option::None,
1834        })
1835    }
1836
1837    /// Sets the value of [driver][crate::model::SparkBatch::driver]
1838    /// to hold a `MainJarFileUri`.
1839    ///
1840    /// Note that all the setters affecting `driver` are
1841    /// mutually exclusive.
1842    pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
1843        mut self,
1844        v: T,
1845    ) -> Self {
1846        self.driver =
1847            std::option::Option::Some(crate::model::spark_batch::Driver::MainJarFileUri(v.into()));
1848        self
1849    }
1850
1851    /// Sets the value of [driver][crate::model::SparkBatch::driver]
1852    /// to hold a `MainClass`.
1853    ///
1854    /// Note that all the setters affecting `driver` are
1855    /// mutually exclusive.
1856    pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1857        self.driver =
1858            std::option::Option::Some(crate::model::spark_batch::Driver::MainClass(v.into()));
1859        self
1860    }
1861}
1862
1863impl wkt::message::Message for SparkBatch {
1864    fn typename() -> &'static str {
1865        "type.googleapis.com/google.cloud.dataproc.v1.SparkBatch"
1866    }
1867}
1868
1869/// Defines additional types related to [SparkBatch].
1870pub mod spark_batch {
1871    #[allow(unused_imports)]
1872    use super::*;
1873
1874    /// The specification of the main method to call to drive the Spark
1875    /// workload. Specify either the jar file that contains the main class or the
1876    /// main class name. To pass both a main jar and a main class in that jar, add
1877    /// the jar to `jar_file_uris`, and then specify the main class
1878    /// name in `main_class`.
1879    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1880    #[serde(rename_all = "camelCase")]
1881    #[non_exhaustive]
1882    pub enum Driver {
1883        /// Optional. The HCFS URI of the jar file that contains the main class.
1884        MainJarFileUri(std::string::String),
1885        /// Optional. The name of the driver main class. The jar file that contains
1886        /// the class must be in the classpath or specified in `jar_file_uris`.
1887        MainClass(std::string::String),
1888    }
1889}
1890
1891/// A configuration for running an
1892/// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html)
1893/// batch workload.
1894#[serde_with::serde_as]
1895#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1896#[serde(default, rename_all = "camelCase")]
1897#[non_exhaustive]
1898pub struct SparkRBatch {
1899    /// Required. The HCFS URI of the main R file to use as the driver.
1900    /// Must be a `.R` or `.r` file.
1901    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1902    pub main_r_file_uri: std::string::String,
1903
1904    /// Optional. The arguments to pass to the Spark driver. Do not include
1905    /// arguments that can be set as batch properties, such as `--conf`, since a
1906    /// collision can occur that causes an incorrect batch submission.
1907    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1908    pub args: std::vec::Vec<std::string::String>,
1909
1910    /// Optional. HCFS URIs of files to be placed in the working directory of
1911    /// each executor.
1912    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1913    pub file_uris: std::vec::Vec<std::string::String>,
1914
1915    /// Optional. HCFS URIs of archives to be extracted into the working directory
1916    /// of each executor. Supported file types:
1917    /// `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`.
1918    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1919    pub archive_uris: std::vec::Vec<std::string::String>,
1920
1921    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1922    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1923}
1924
1925impl SparkRBatch {
1926    pub fn new() -> Self {
1927        std::default::Default::default()
1928    }
1929
1930    /// Sets the value of [main_r_file_uri][crate::model::SparkRBatch::main_r_file_uri].
1931    pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1932        self.main_r_file_uri = v.into();
1933        self
1934    }
1935
1936    /// Sets the value of [args][crate::model::SparkRBatch::args].
1937    pub fn set_args<T, V>(mut self, v: T) -> Self
1938    where
1939        T: std::iter::IntoIterator<Item = V>,
1940        V: std::convert::Into<std::string::String>,
1941    {
1942        use std::iter::Iterator;
1943        self.args = v.into_iter().map(|i| i.into()).collect();
1944        self
1945    }
1946
1947    /// Sets the value of [file_uris][crate::model::SparkRBatch::file_uris].
1948    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1949    where
1950        T: std::iter::IntoIterator<Item = V>,
1951        V: std::convert::Into<std::string::String>,
1952    {
1953        use std::iter::Iterator;
1954        self.file_uris = v.into_iter().map(|i| i.into()).collect();
1955        self
1956    }
1957
1958    /// Sets the value of [archive_uris][crate::model::SparkRBatch::archive_uris].
1959    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1960    where
1961        T: std::iter::IntoIterator<Item = V>,
1962        V: std::convert::Into<std::string::String>,
1963    {
1964        use std::iter::Iterator;
1965        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1966        self
1967    }
1968}
1969
1970impl wkt::message::Message for SparkRBatch {
1971    fn typename() -> &'static str {
1972        "type.googleapis.com/google.cloud.dataproc.v1.SparkRBatch"
1973    }
1974}
1975
1976/// A configuration for running
1977/// [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch
1978/// workload.
1979#[serde_with::serde_as]
1980#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1981#[serde(default, rename_all = "camelCase")]
1982#[non_exhaustive]
1983pub struct SparkSqlBatch {
1984    /// Required. The HCFS URI of the script that contains Spark SQL queries to
1985    /// execute.
1986    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1987    pub query_file_uri: std::string::String,
1988
1989    /// Optional. Mapping of query variable names to values (equivalent to the
1990    /// Spark SQL command: `SET name="value";`).
1991    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1992    pub query_variables: std::collections::HashMap<std::string::String, std::string::String>,
1993
1994    /// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
1995    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1996    pub jar_file_uris: std::vec::Vec<std::string::String>,
1997
1998    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1999    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2000}
2001
2002impl SparkSqlBatch {
2003    pub fn new() -> Self {
2004        std::default::Default::default()
2005    }
2006
2007    /// Sets the value of [query_file_uri][crate::model::SparkSqlBatch::query_file_uri].
2008    pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2009        self.query_file_uri = v.into();
2010        self
2011    }
2012
2013    /// Sets the value of [jar_file_uris][crate::model::SparkSqlBatch::jar_file_uris].
2014    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
2015    where
2016        T: std::iter::IntoIterator<Item = V>,
2017        V: std::convert::Into<std::string::String>,
2018    {
2019        use std::iter::Iterator;
2020        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
2021        self
2022    }
2023
2024    /// Sets the value of [query_variables][crate::model::SparkSqlBatch::query_variables].
2025    pub fn set_query_variables<T, K, V>(mut self, v: T) -> Self
2026    where
2027        T: std::iter::IntoIterator<Item = (K, V)>,
2028        K: std::convert::Into<std::string::String>,
2029        V: std::convert::Into<std::string::String>,
2030    {
2031        use std::iter::Iterator;
2032        self.query_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2033        self
2034    }
2035}
2036
2037impl wkt::message::Message for SparkSqlBatch {
2038    fn typename() -> &'static str {
2039        "type.googleapis.com/google.cloud.dataproc.v1.SparkSqlBatch"
2040    }
2041}
2042
2043/// Describes the identifying information, config, and status of
2044/// a Dataproc cluster
2045#[serde_with::serde_as]
2046#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2047#[serde(default, rename_all = "camelCase")]
2048#[non_exhaustive]
2049pub struct Cluster {
2050    /// Required. The Google Cloud Platform project ID that the cluster belongs to.
2051    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2052    pub project_id: std::string::String,
2053
2054    /// Required. The cluster name, which must be unique within a project.
2055    /// The name must start with a lowercase letter, and can contain
2056    /// up to 51 lowercase letters, numbers, and hyphens. It cannot end
2057    /// with a hyphen. The name of a deleted cluster can be reused.
2058    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2059    pub cluster_name: std::string::String,
2060
2061    /// Optional. The cluster config for a cluster of Compute Engine Instances.
2062    /// Note that Dataproc may set default values, and values may change
2063    /// when clusters are updated.
2064    ///
2065    /// Exactly one of ClusterConfig or VirtualClusterConfig must be specified.
2066    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2067    pub config: std::option::Option<crate::model::ClusterConfig>,
2068
2069    /// Optional. The virtual cluster config is used when creating a Dataproc
2070    /// cluster that does not directly control the underlying compute resources,
2071    /// for example, when creating a [Dataproc-on-GKE
2072    /// cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).
2073    /// Dataproc may set default values, and values may change when
2074    /// clusters are updated. Exactly one of
2075    /// [config][google.cloud.dataproc.v1.Cluster.config] or
2076    /// [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config]
2077    /// must be specified.
2078    ///
2079    /// [google.cloud.dataproc.v1.Cluster.config]: crate::model::Cluster::config
2080    /// [google.cloud.dataproc.v1.Cluster.virtual_cluster_config]: crate::model::Cluster::virtual_cluster_config
2081    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2082    pub virtual_cluster_config: std::option::Option<crate::model::VirtualClusterConfig>,
2083
2084    /// Optional. The labels to associate with this cluster.
2085    /// Label **keys** must contain 1 to 63 characters, and must conform to
2086    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
2087    /// Label **values** may be empty, but, if present, must contain 1 to 63
2088    /// characters, and must conform to [RFC
2089    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
2090    /// associated with a cluster.
2091    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2092    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2093
2094    /// Output only. Cluster status.
2095    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2096    pub status: std::option::Option<crate::model::ClusterStatus>,
2097
2098    /// Output only. The previous cluster status.
2099    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2100    pub status_history: std::vec::Vec<crate::model::ClusterStatus>,
2101
2102    /// Output only. A cluster UUID (Unique Universal Identifier). Dataproc
2103    /// generates this value when it creates the cluster.
2104    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2105    pub cluster_uuid: std::string::String,
2106
2107    /// Output only. Contains cluster daemon metrics such as HDFS and YARN stats.
2108    ///
2109    /// **Beta Feature**: This report is available for testing purposes only. It
2110    /// may be changed before final release.
2111    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2112    pub metrics: std::option::Option<crate::model::ClusterMetrics>,
2113
2114    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2115    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2116}
2117
2118impl Cluster {
2119    pub fn new() -> Self {
2120        std::default::Default::default()
2121    }
2122
2123    /// Sets the value of [project_id][crate::model::Cluster::project_id].
2124    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2125        self.project_id = v.into();
2126        self
2127    }
2128
2129    /// Sets the value of [cluster_name][crate::model::Cluster::cluster_name].
2130    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2131        self.cluster_name = v.into();
2132        self
2133    }
2134
2135    /// Sets the value of [config][crate::model::Cluster::config].
2136    pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::ClusterConfig>>>(
2137        mut self,
2138        v: T,
2139    ) -> Self {
2140        self.config = v.into();
2141        self
2142    }
2143
2144    /// Sets the value of [virtual_cluster_config][crate::model::Cluster::virtual_cluster_config].
2145    pub fn set_virtual_cluster_config<
2146        T: std::convert::Into<std::option::Option<crate::model::VirtualClusterConfig>>,
2147    >(
2148        mut self,
2149        v: T,
2150    ) -> Self {
2151        self.virtual_cluster_config = v.into();
2152        self
2153    }
2154
2155    /// Sets the value of [status][crate::model::Cluster::status].
2156    pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::ClusterStatus>>>(
2157        mut self,
2158        v: T,
2159    ) -> Self {
2160        self.status = v.into();
2161        self
2162    }
2163
2164    /// Sets the value of [cluster_uuid][crate::model::Cluster::cluster_uuid].
2165    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166        self.cluster_uuid = v.into();
2167        self
2168    }
2169
2170    /// Sets the value of [metrics][crate::model::Cluster::metrics].
2171    pub fn set_metrics<T: std::convert::Into<std::option::Option<crate::model::ClusterMetrics>>>(
2172        mut self,
2173        v: T,
2174    ) -> Self {
2175        self.metrics = v.into();
2176        self
2177    }
2178
2179    /// Sets the value of [status_history][crate::model::Cluster::status_history].
2180    pub fn set_status_history<T, V>(mut self, v: T) -> Self
2181    where
2182        T: std::iter::IntoIterator<Item = V>,
2183        V: std::convert::Into<crate::model::ClusterStatus>,
2184    {
2185        use std::iter::Iterator;
2186        self.status_history = v.into_iter().map(|i| i.into()).collect();
2187        self
2188    }
2189
2190    /// Sets the value of [labels][crate::model::Cluster::labels].
2191    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2192    where
2193        T: std::iter::IntoIterator<Item = (K, V)>,
2194        K: std::convert::Into<std::string::String>,
2195        V: std::convert::Into<std::string::String>,
2196    {
2197        use std::iter::Iterator;
2198        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2199        self
2200    }
2201}
2202
2203impl wkt::message::Message for Cluster {
2204    fn typename() -> &'static str {
2205        "type.googleapis.com/google.cloud.dataproc.v1.Cluster"
2206    }
2207}
2208
2209/// The cluster config.
2210#[serde_with::serde_as]
2211#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2212#[serde(default, rename_all = "camelCase")]
2213#[non_exhaustive]
2214pub struct ClusterConfig {
2215    /// Optional. A Cloud Storage bucket used to stage job
2216    /// dependencies, config files, and job driver console output.
2217    /// If you do not specify a staging bucket, Cloud
2218    /// Dataproc will determine a Cloud Storage location (US,
2219    /// ASIA, or EU) for your cluster's staging bucket according to the
2220    /// Compute Engine zone where your cluster is deployed, and then create
2221    /// and manage this project-level, per-location bucket (see
2222    /// [Dataproc staging and temp
2223    /// buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
2224    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
2225    /// a Cloud Storage bucket.**
2226    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2227    pub config_bucket: std::string::String,
2228
2229    /// Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs
2230    /// data, such as Spark and MapReduce history files. If you do not specify a
2231    /// temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or
2232    /// EU) for your cluster's temp bucket according to the Compute Engine zone
2233    /// where your cluster is deployed, and then create and manage this
2234    /// project-level, per-location bucket. The default bucket has a TTL of 90
2235    /// days, but you can use any TTL (or none) if you specify a bucket (see
2236    /// [Dataproc staging and temp
2237    /// buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
2238    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
2239    /// a Cloud Storage bucket.**
2240    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2241    pub temp_bucket: std::string::String,
2242
2243    /// Optional. The shared Compute Engine config settings for
2244    /// all instances in a cluster.
2245    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2246    pub gce_cluster_config: std::option::Option<crate::model::GceClusterConfig>,
2247
2248    /// Optional. The Compute Engine config settings for
2249    /// the cluster's master instance.
2250    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2251    pub master_config: std::option::Option<crate::model::InstanceGroupConfig>,
2252
2253    /// Optional. The Compute Engine config settings for
2254    /// the cluster's worker instances.
2255    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2256    pub worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2257
2258    /// Optional. The Compute Engine config settings for
2259    /// a cluster's secondary worker instances
2260    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2261    pub secondary_worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2262
2263    /// Optional. The config settings for cluster software.
2264    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2265    pub software_config: std::option::Option<crate::model::SoftwareConfig>,
2266
2267    /// Optional. Commands to execute on each node after config is
2268    /// completed. By default, executables are run on master and all worker nodes.
2269    /// You can test a node's `role` metadata to run an executable on
2270    /// a master or worker node, as shown below using `curl` (you can also use
2271    /// `wget`):
2272    ///
2273    /// ```norust
2274    /// ROLE=$(curl -H Metadata-Flavor:Google
2275    /// http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
2276    /// if [[ "${ROLE}" == 'Master' ]]; then
2277    ///   ... master specific actions ...
2278    /// else
2279    ///   ... worker specific actions ...
2280    /// fi
2281    /// ```
2282    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2283    pub initialization_actions: std::vec::Vec<crate::model::NodeInitializationAction>,
2284
2285    /// Optional. Encryption settings for the cluster.
2286    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2287    pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
2288
2289    /// Optional. Autoscaling config for the policy associated with the cluster.
2290    /// Cluster does not autoscale if this field is unset.
2291    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2292    pub autoscaling_config: std::option::Option<crate::model::AutoscalingConfig>,
2293
2294    /// Optional. Security settings for the cluster.
2295    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2296    pub security_config: std::option::Option<crate::model::SecurityConfig>,
2297
2298    /// Optional. Lifecycle setting for the cluster.
2299    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2300    pub lifecycle_config: std::option::Option<crate::model::LifecycleConfig>,
2301
2302    /// Optional. Port/endpoint configuration for this cluster
2303    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2304    pub endpoint_config: std::option::Option<crate::model::EndpointConfig>,
2305
2306    /// Optional. Metastore configuration.
2307    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2308    pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2309
2310    /// Optional. The config for Dataproc metrics.
2311    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2312    pub dataproc_metric_config: std::option::Option<crate::model::DataprocMetricConfig>,
2313
2314    /// Optional. The node group settings.
2315    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2316    pub auxiliary_node_groups: std::vec::Vec<crate::model::AuxiliaryNodeGroup>,
2317
2318    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2319    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2320}
2321
2322impl ClusterConfig {
2323    pub fn new() -> Self {
2324        std::default::Default::default()
2325    }
2326
2327    /// Sets the value of [config_bucket][crate::model::ClusterConfig::config_bucket].
2328    pub fn set_config_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2329        self.config_bucket = v.into();
2330        self
2331    }
2332
2333    /// Sets the value of [temp_bucket][crate::model::ClusterConfig::temp_bucket].
2334    pub fn set_temp_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2335        self.temp_bucket = v.into();
2336        self
2337    }
2338
2339    /// Sets the value of [gce_cluster_config][crate::model::ClusterConfig::gce_cluster_config].
2340    pub fn set_gce_cluster_config<
2341        T: std::convert::Into<std::option::Option<crate::model::GceClusterConfig>>,
2342    >(
2343        mut self,
2344        v: T,
2345    ) -> Self {
2346        self.gce_cluster_config = v.into();
2347        self
2348    }
2349
2350    /// Sets the value of [master_config][crate::model::ClusterConfig::master_config].
2351    pub fn set_master_config<
2352        T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
2353    >(
2354        mut self,
2355        v: T,
2356    ) -> Self {
2357        self.master_config = v.into();
2358        self
2359    }
2360
2361    /// Sets the value of [worker_config][crate::model::ClusterConfig::worker_config].
2362    pub fn set_worker_config<
2363        T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
2364    >(
2365        mut self,
2366        v: T,
2367    ) -> Self {
2368        self.worker_config = v.into();
2369        self
2370    }
2371
2372    /// Sets the value of [secondary_worker_config][crate::model::ClusterConfig::secondary_worker_config].
2373    pub fn set_secondary_worker_config<
2374        T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
2375    >(
2376        mut self,
2377        v: T,
2378    ) -> Self {
2379        self.secondary_worker_config = v.into();
2380        self
2381    }
2382
2383    /// Sets the value of [software_config][crate::model::ClusterConfig::software_config].
2384    pub fn set_software_config<
2385        T: std::convert::Into<std::option::Option<crate::model::SoftwareConfig>>,
2386    >(
2387        mut self,
2388        v: T,
2389    ) -> Self {
2390        self.software_config = v.into();
2391        self
2392    }
2393
2394    /// Sets the value of [encryption_config][crate::model::ClusterConfig::encryption_config].
2395    pub fn set_encryption_config<
2396        T: std::convert::Into<std::option::Option<crate::model::EncryptionConfig>>,
2397    >(
2398        mut self,
2399        v: T,
2400    ) -> Self {
2401        self.encryption_config = v.into();
2402        self
2403    }
2404
2405    /// Sets the value of [autoscaling_config][crate::model::ClusterConfig::autoscaling_config].
2406    pub fn set_autoscaling_config<
2407        T: std::convert::Into<std::option::Option<crate::model::AutoscalingConfig>>,
2408    >(
2409        mut self,
2410        v: T,
2411    ) -> Self {
2412        self.autoscaling_config = v.into();
2413        self
2414    }
2415
2416    /// Sets the value of [security_config][crate::model::ClusterConfig::security_config].
2417    pub fn set_security_config<
2418        T: std::convert::Into<std::option::Option<crate::model::SecurityConfig>>,
2419    >(
2420        mut self,
2421        v: T,
2422    ) -> Self {
2423        self.security_config = v.into();
2424        self
2425    }
2426
2427    /// Sets the value of [lifecycle_config][crate::model::ClusterConfig::lifecycle_config].
2428    pub fn set_lifecycle_config<
2429        T: std::convert::Into<std::option::Option<crate::model::LifecycleConfig>>,
2430    >(
2431        mut self,
2432        v: T,
2433    ) -> Self {
2434        self.lifecycle_config = v.into();
2435        self
2436    }
2437
2438    /// Sets the value of [endpoint_config][crate::model::ClusterConfig::endpoint_config].
2439    pub fn set_endpoint_config<
2440        T: std::convert::Into<std::option::Option<crate::model::EndpointConfig>>,
2441    >(
2442        mut self,
2443        v: T,
2444    ) -> Self {
2445        self.endpoint_config = v.into();
2446        self
2447    }
2448
2449    /// Sets the value of [metastore_config][crate::model::ClusterConfig::metastore_config].
2450    pub fn set_metastore_config<
2451        T: std::convert::Into<std::option::Option<crate::model::MetastoreConfig>>,
2452    >(
2453        mut self,
2454        v: T,
2455    ) -> Self {
2456        self.metastore_config = v.into();
2457        self
2458    }
2459
2460    /// Sets the value of [dataproc_metric_config][crate::model::ClusterConfig::dataproc_metric_config].
2461    pub fn set_dataproc_metric_config<
2462        T: std::convert::Into<std::option::Option<crate::model::DataprocMetricConfig>>,
2463    >(
2464        mut self,
2465        v: T,
2466    ) -> Self {
2467        self.dataproc_metric_config = v.into();
2468        self
2469    }
2470
2471    /// Sets the value of [initialization_actions][crate::model::ClusterConfig::initialization_actions].
2472    pub fn set_initialization_actions<T, V>(mut self, v: T) -> Self
2473    where
2474        T: std::iter::IntoIterator<Item = V>,
2475        V: std::convert::Into<crate::model::NodeInitializationAction>,
2476    {
2477        use std::iter::Iterator;
2478        self.initialization_actions = v.into_iter().map(|i| i.into()).collect();
2479        self
2480    }
2481
2482    /// Sets the value of [auxiliary_node_groups][crate::model::ClusterConfig::auxiliary_node_groups].
2483    pub fn set_auxiliary_node_groups<T, V>(mut self, v: T) -> Self
2484    where
2485        T: std::iter::IntoIterator<Item = V>,
2486        V: std::convert::Into<crate::model::AuxiliaryNodeGroup>,
2487    {
2488        use std::iter::Iterator;
2489        self.auxiliary_node_groups = v.into_iter().map(|i| i.into()).collect();
2490        self
2491    }
2492}
2493
2494impl wkt::message::Message for ClusterConfig {
2495    fn typename() -> &'static str {
2496        "type.googleapis.com/google.cloud.dataproc.v1.ClusterConfig"
2497    }
2498}
2499
2500/// The Dataproc cluster config for a cluster that does not directly control the
2501/// underlying compute resources, such as a [Dataproc-on-GKE
2502/// cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).
2503#[serde_with::serde_as]
2504#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2505#[serde(default, rename_all = "camelCase")]
2506#[non_exhaustive]
2507pub struct VirtualClusterConfig {
2508    /// Optional. A Cloud Storage bucket used to stage job
2509    /// dependencies, config files, and job driver console output.
2510    /// If you do not specify a staging bucket, Cloud
2511    /// Dataproc will determine a Cloud Storage location (US,
2512    /// ASIA, or EU) for your cluster's staging bucket according to the
2513    /// Compute Engine zone where your cluster is deployed, and then create
2514    /// and manage this project-level, per-location bucket (see
2515    /// [Dataproc staging and temp
2516    /// buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
2517    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
2518    /// a Cloud Storage bucket.**
2519    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2520    pub staging_bucket: std::string::String,
2521
2522    /// Optional. Configuration of auxiliary services used by this cluster.
2523    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2524    pub auxiliary_services_config: std::option::Option<crate::model::AuxiliaryServicesConfig>,
2525
2526    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2527    pub infrastructure_config:
2528        std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
2529
2530    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2531    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2532}
2533
2534impl VirtualClusterConfig {
2535    pub fn new() -> Self {
2536        std::default::Default::default()
2537    }
2538
2539    /// Sets the value of [staging_bucket][crate::model::VirtualClusterConfig::staging_bucket].
2540    pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2541        self.staging_bucket = v.into();
2542        self
2543    }
2544
2545    /// Sets the value of [auxiliary_services_config][crate::model::VirtualClusterConfig::auxiliary_services_config].
2546    pub fn set_auxiliary_services_config<
2547        T: std::convert::Into<std::option::Option<crate::model::AuxiliaryServicesConfig>>,
2548    >(
2549        mut self,
2550        v: T,
2551    ) -> Self {
2552        self.auxiliary_services_config = v.into();
2553        self
2554    }
2555
2556    /// Sets the value of [infrastructure_config][crate::model::VirtualClusterConfig::infrastructure_config].
2557    ///
2558    /// Note that all the setters affecting `infrastructure_config` are mutually
2559    /// exclusive.
2560    pub fn set_infrastructure_config<
2561        T: std::convert::Into<
2562                std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
2563            >,
2564    >(
2565        mut self,
2566        v: T,
2567    ) -> Self {
2568        self.infrastructure_config = v.into();
2569        self
2570    }
2571
2572    /// The value of [infrastructure_config][crate::model::VirtualClusterConfig::infrastructure_config]
2573    /// if it holds a `KubernetesClusterConfig`, `None` if the field is not set or
2574    /// holds a different branch.
2575    pub fn kubernetes_cluster_config(
2576        &self,
2577    ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesClusterConfig>> {
2578        #[allow(unreachable_patterns)]
2579        self.infrastructure_config.as_ref().and_then(|v| match v {
2580            crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
2581                v,
2582            ) => std::option::Option::Some(v),
2583            _ => std::option::Option::None,
2584        })
2585    }
2586
2587    /// Sets the value of [infrastructure_config][crate::model::VirtualClusterConfig::infrastructure_config]
2588    /// to hold a `KubernetesClusterConfig`.
2589    ///
2590    /// Note that all the setters affecting `infrastructure_config` are
2591    /// mutually exclusive.
2592    pub fn set_kubernetes_cluster_config<
2593        T: std::convert::Into<std::boxed::Box<crate::model::KubernetesClusterConfig>>,
2594    >(
2595        mut self,
2596        v: T,
2597    ) -> Self {
2598        self.infrastructure_config = std::option::Option::Some(
2599            crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
2600                v.into(),
2601            ),
2602        );
2603        self
2604    }
2605}
2606
2607impl wkt::message::Message for VirtualClusterConfig {
2608    fn typename() -> &'static str {
2609        "type.googleapis.com/google.cloud.dataproc.v1.VirtualClusterConfig"
2610    }
2611}
2612
2613/// Defines additional types related to [VirtualClusterConfig].
2614pub mod virtual_cluster_config {
2615    #[allow(unused_imports)]
2616    use super::*;
2617
2618    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2619    #[serde(rename_all = "camelCase")]
2620    #[non_exhaustive]
2621    pub enum InfrastructureConfig {
2622        /// Required. The configuration for running the Dataproc cluster on
2623        /// Kubernetes.
2624        KubernetesClusterConfig(std::boxed::Box<crate::model::KubernetesClusterConfig>),
2625    }
2626}
2627
2628/// Auxiliary services configuration for a Cluster.
2629#[serde_with::serde_as]
2630#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2631#[serde(default, rename_all = "camelCase")]
2632#[non_exhaustive]
2633pub struct AuxiliaryServicesConfig {
2634    /// Optional. The Hive Metastore configuration for this workload.
2635    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2636    pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2637
2638    /// Optional. The Spark History Server configuration for the workload.
2639    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2640    pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
2641
2642    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2643    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2644}
2645
2646impl AuxiliaryServicesConfig {
2647    pub fn new() -> Self {
2648        std::default::Default::default()
2649    }
2650
2651    /// Sets the value of [metastore_config][crate::model::AuxiliaryServicesConfig::metastore_config].
2652    pub fn set_metastore_config<
2653        T: std::convert::Into<std::option::Option<crate::model::MetastoreConfig>>,
2654    >(
2655        mut self,
2656        v: T,
2657    ) -> Self {
2658        self.metastore_config = v.into();
2659        self
2660    }
2661
2662    /// Sets the value of [spark_history_server_config][crate::model::AuxiliaryServicesConfig::spark_history_server_config].
2663    pub fn set_spark_history_server_config<
2664        T: std::convert::Into<std::option::Option<crate::model::SparkHistoryServerConfig>>,
2665    >(
2666        mut self,
2667        v: T,
2668    ) -> Self {
2669        self.spark_history_server_config = v.into();
2670        self
2671    }
2672}
2673
2674impl wkt::message::Message for AuxiliaryServicesConfig {
2675    fn typename() -> &'static str {
2676        "type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryServicesConfig"
2677    }
2678}
2679
2680/// Endpoint config for this cluster
2681#[serde_with::serde_as]
2682#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2683#[serde(default, rename_all = "camelCase")]
2684#[non_exhaustive]
2685pub struct EndpointConfig {
2686    /// Output only. The map of port descriptions to URLs. Will only be populated
2687    /// if enable_http_port_access is true.
2688    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2689    pub http_ports: std::collections::HashMap<std::string::String, std::string::String>,
2690
2691    /// Optional. If true, enable http access to specific ports on the cluster
2692    /// from external sources. Defaults to false.
2693    pub enable_http_port_access: bool,
2694
2695    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2696    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2697}
2698
2699impl EndpointConfig {
2700    pub fn new() -> Self {
2701        std::default::Default::default()
2702    }
2703
2704    /// Sets the value of [enable_http_port_access][crate::model::EndpointConfig::enable_http_port_access].
2705    pub fn set_enable_http_port_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2706        self.enable_http_port_access = v.into();
2707        self
2708    }
2709
2710    /// Sets the value of [http_ports][crate::model::EndpointConfig::http_ports].
2711    pub fn set_http_ports<T, K, V>(mut self, v: T) -> Self
2712    where
2713        T: std::iter::IntoIterator<Item = (K, V)>,
2714        K: std::convert::Into<std::string::String>,
2715        V: std::convert::Into<std::string::String>,
2716    {
2717        use std::iter::Iterator;
2718        self.http_ports = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2719        self
2720    }
2721}
2722
2723impl wkt::message::Message for EndpointConfig {
2724    fn typename() -> &'static str {
2725        "type.googleapis.com/google.cloud.dataproc.v1.EndpointConfig"
2726    }
2727}
2728
2729/// Autoscaling Policy config associated with the cluster.
2730#[serde_with::serde_as]
2731#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2732#[serde(default, rename_all = "camelCase")]
2733#[non_exhaustive]
2734pub struct AutoscalingConfig {
2735    /// Optional. The autoscaling policy used by the cluster.
2736    ///
2737    /// Only resource names including projectid and location (region) are valid.
2738    /// Examples:
2739    ///
2740    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]`
2741    /// * `projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]`
2742    ///
2743    /// Note that the policy must be in the same project and Dataproc region.
2744    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2745    pub policy_uri: std::string::String,
2746
2747    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2748    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749}
2750
2751impl AutoscalingConfig {
2752    pub fn new() -> Self {
2753        std::default::Default::default()
2754    }
2755
2756    /// Sets the value of [policy_uri][crate::model::AutoscalingConfig::policy_uri].
2757    pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2758        self.policy_uri = v.into();
2759        self
2760    }
2761}
2762
2763impl wkt::message::Message for AutoscalingConfig {
2764    fn typename() -> &'static str {
2765        "type.googleapis.com/google.cloud.dataproc.v1.AutoscalingConfig"
2766    }
2767}
2768
2769/// Encryption settings for the cluster.
2770#[serde_with::serde_as]
2771#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2772#[serde(default, rename_all = "camelCase")]
2773#[non_exhaustive]
2774pub struct EncryptionConfig {
2775    /// Optional. The Cloud KMS key resource name to use for persistent disk
2776    /// encryption for all instances in the cluster. See [Use CMEK with cluster
2777    /// data]
2778    /// (<https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data>)
2779    /// for more information.
2780    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2781    pub gce_pd_kms_key_name: std::string::String,
2782
2783    /// Optional. The Cloud KMS key resource name to use for cluster persistent
2784    /// disk and job argument encryption. See [Use CMEK with cluster data]
2785    /// (<https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data>)
2786    /// for more information.
2787    ///
2788    /// When this key resource name is provided, the following job arguments of
2789    /// the following job types submitted to the cluster are encrypted using CMEK:
2790    ///
2791    /// * [FlinkJob
2792    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob)
2793    /// * [HadoopJob
2794    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob)
2795    /// * [SparkJob
2796    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob)
2797    /// * [SparkRJob
2798    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob)
2799    /// * [PySparkJob
2800    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob)
2801    /// * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob)
2802    ///   scriptVariables and queryList.queries
2803    /// * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob)
2804    ///   scriptVariables and queryList.queries
2805    /// * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob)
2806    ///   scriptVariables and queryList.queries
2807    /// * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob)
2808    ///   scriptVariables and queryList.queries
2809    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2810    pub kms_key: std::string::String,
2811
2812    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2813    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2814}
2815
2816impl EncryptionConfig {
2817    pub fn new() -> Self {
2818        std::default::Default::default()
2819    }
2820
2821    /// Sets the value of [gce_pd_kms_key_name][crate::model::EncryptionConfig::gce_pd_kms_key_name].
2822    pub fn set_gce_pd_kms_key_name<T: std::convert::Into<std::string::String>>(
2823        mut self,
2824        v: T,
2825    ) -> Self {
2826        self.gce_pd_kms_key_name = v.into();
2827        self
2828    }
2829
2830    /// Sets the value of [kms_key][crate::model::EncryptionConfig::kms_key].
2831    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832        self.kms_key = v.into();
2833        self
2834    }
2835}
2836
2837impl wkt::message::Message for EncryptionConfig {
2838    fn typename() -> &'static str {
2839        "type.googleapis.com/google.cloud.dataproc.v1.EncryptionConfig"
2840    }
2841}
2842
2843/// Common config settings for resources of Compute Engine cluster
2844/// instances, applicable to all instances in the cluster.
2845#[serde_with::serde_as]
2846#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2847#[serde(default, rename_all = "camelCase")]
2848#[non_exhaustive]
2849pub struct GceClusterConfig {
2850    /// Optional. The Compute Engine zone where the Dataproc cluster will be
2851    /// located. If omitted, the service will pick a zone in the cluster's Compute
2852    /// Engine region. On a get request, zone will always be present.
2853    ///
2854    /// A full URL, partial URI, or short name are valid. Examples:
2855    ///
2856    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]`
2857    /// * `projects/[project_id]/zones/[zone]`
2858    /// * `[zone]`
2859    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2860    pub zone_uri: std::string::String,
2861
2862    /// Optional. The Compute Engine network to be used for machine
2863    /// communications. Cannot be specified with subnetwork_uri. If neither
2864    /// `network_uri` nor `subnetwork_uri` is specified, the "default" network of
2865    /// the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
2866    /// [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) for
2867    /// more information).
2868    ///
2869    /// A full URL, partial URI, or short name are valid. Examples:
2870    ///
2871    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/global/networks/default`
2872    /// * `projects/[project_id]/global/networks/default`
2873    /// * `default`
2874    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2875    pub network_uri: std::string::String,
2876
2877    /// Optional. The Compute Engine subnetwork to be used for machine
2878    /// communications. Cannot be specified with network_uri.
2879    ///
2880    /// A full URL, partial URI, or short name are valid. Examples:
2881    ///
2882    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/regions/[region]/subnetworks/sub0`
2883    /// * `projects/[project_id]/regions/[region]/subnetworks/sub0`
2884    /// * `sub0`
2885    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2886    pub subnetwork_uri: std::string::String,
2887
2888    /// Optional. This setting applies to subnetwork-enabled networks. It is set to
2889    /// `true` by default in clusters created with image versions 2.2.x.
2890    ///
2891    /// When set to `true`:
2892    ///
2893    /// * All cluster VMs have internal IP addresses.
2894    /// * [Google Private Access]
2895    ///   (<https://cloud.google.com/vpc/docs/private-google-access>)
2896    ///   must be enabled to access Dataproc and other Google Cloud APIs.
2897    /// * Off-cluster dependencies must be configured to be accessible
2898    ///   without external IP addresses.
2899    ///
2900    /// When set to `false`:
2901    ///
2902    /// * Cluster VMs are not restricted to internal IP addresses.
2903    /// * Ephemeral external IP addresses are assigned to each cluster VM.
2904    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2905    pub internal_ip_only: std::option::Option<bool>,
2906
2907    /// Optional. The type of IPv6 access for a cluster.
2908    pub private_ipv6_google_access: crate::model::gce_cluster_config::PrivateIpv6GoogleAccess,
2909
2910    /// Optional. The [Dataproc service
2911    /// account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc)
2912    /// (also see [VM Data Plane
2913    /// identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity))
2914    /// used by Dataproc cluster VM instances to access Google Cloud Platform
2915    /// services.
2916    ///
2917    /// If not specified, the
2918    /// [Compute Engine default service
2919    /// account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account)
2920    /// is used.
2921    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2922    pub service_account: std::string::String,
2923
2924    /// Optional. The URIs of service account scopes to be included in
2925    /// Compute Engine instances. The following base set of scopes is always
2926    /// included:
2927    ///
2928    /// * <https://www.googleapis.com/auth/cloud.useraccounts.readonly>
2929    /// * <https://www.googleapis.com/auth/devstorage.read_write>
2930    /// * <https://www.googleapis.com/auth/logging.write>
2931    ///
2932    /// If no scopes are specified, the following defaults are also provided:
2933    ///
2934    /// * <https://www.googleapis.com/auth/bigquery>
2935    /// * <https://www.googleapis.com/auth/bigtable.admin.table>
2936    /// * <https://www.googleapis.com/auth/bigtable.data>
2937    /// * <https://www.googleapis.com/auth/devstorage.full_control>
2938    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2939    pub service_account_scopes: std::vec::Vec<std::string::String>,
2940
2941    /// The Compute Engine network tags to add to all instances (see [Tagging
2942    /// instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)).
2943    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2944    pub tags: std::vec::Vec<std::string::String>,
2945
2946    /// Optional. The Compute Engine metadata entries to add to all instances (see
2947    /// [Project and instance
2948    /// metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
2949    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2950    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
2951
2952    /// Optional. Reservation Affinity for consuming Zonal reservation.
2953    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2954    pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
2955
2956    /// Optional. Node Group Affinity for sole-tenant clusters.
2957    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2958    pub node_group_affinity: std::option::Option<crate::model::NodeGroupAffinity>,
2959
2960    /// Optional. Shielded Instance Config for clusters using [Compute Engine
2961    /// Shielded
2962    /// VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm).
2963    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2964    pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
2965
2966    /// Optional. Confidential Instance Config for clusters using [Confidential
2967    /// VMs](https://cloud.google.com/compute/confidential-vm/docs).
2968    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2969    pub confidential_instance_config: std::option::Option<crate::model::ConfidentialInstanceConfig>,
2970
2971    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2972    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2973}
2974
2975impl GceClusterConfig {
2976    pub fn new() -> Self {
2977        std::default::Default::default()
2978    }
2979
2980    /// Sets the value of [zone_uri][crate::model::GceClusterConfig::zone_uri].
2981    pub fn set_zone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2982        self.zone_uri = v.into();
2983        self
2984    }
2985
2986    /// Sets the value of [network_uri][crate::model::GceClusterConfig::network_uri].
2987    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988        self.network_uri = v.into();
2989        self
2990    }
2991
2992    /// Sets the value of [subnetwork_uri][crate::model::GceClusterConfig::subnetwork_uri].
2993    pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2994        self.subnetwork_uri = v.into();
2995        self
2996    }
2997
2998    /// Sets the value of [internal_ip_only][crate::model::GceClusterConfig::internal_ip_only].
2999    pub fn set_internal_ip_only<T: std::convert::Into<std::option::Option<bool>>>(
3000        mut self,
3001        v: T,
3002    ) -> Self {
3003        self.internal_ip_only = v.into();
3004        self
3005    }
3006
3007    /// Sets the value of [private_ipv6_google_access][crate::model::GceClusterConfig::private_ipv6_google_access].
3008    pub fn set_private_ipv6_google_access<
3009        T: std::convert::Into<crate::model::gce_cluster_config::PrivateIpv6GoogleAccess>,
3010    >(
3011        mut self,
3012        v: T,
3013    ) -> Self {
3014        self.private_ipv6_google_access = v.into();
3015        self
3016    }
3017
3018    /// Sets the value of [service_account][crate::model::GceClusterConfig::service_account].
3019    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3020        self.service_account = v.into();
3021        self
3022    }
3023
3024    /// Sets the value of [reservation_affinity][crate::model::GceClusterConfig::reservation_affinity].
3025    pub fn set_reservation_affinity<
3026        T: std::convert::Into<std::option::Option<crate::model::ReservationAffinity>>,
3027    >(
3028        mut self,
3029        v: T,
3030    ) -> Self {
3031        self.reservation_affinity = v.into();
3032        self
3033    }
3034
3035    /// Sets the value of [node_group_affinity][crate::model::GceClusterConfig::node_group_affinity].
3036    pub fn set_node_group_affinity<
3037        T: std::convert::Into<std::option::Option<crate::model::NodeGroupAffinity>>,
3038    >(
3039        mut self,
3040        v: T,
3041    ) -> Self {
3042        self.node_group_affinity = v.into();
3043        self
3044    }
3045
3046    /// Sets the value of [shielded_instance_config][crate::model::GceClusterConfig::shielded_instance_config].
3047    pub fn set_shielded_instance_config<
3048        T: std::convert::Into<std::option::Option<crate::model::ShieldedInstanceConfig>>,
3049    >(
3050        mut self,
3051        v: T,
3052    ) -> Self {
3053        self.shielded_instance_config = v.into();
3054        self
3055    }
3056
3057    /// Sets the value of [confidential_instance_config][crate::model::GceClusterConfig::confidential_instance_config].
3058    pub fn set_confidential_instance_config<
3059        T: std::convert::Into<std::option::Option<crate::model::ConfidentialInstanceConfig>>,
3060    >(
3061        mut self,
3062        v: T,
3063    ) -> Self {
3064        self.confidential_instance_config = v.into();
3065        self
3066    }
3067
3068    /// Sets the value of [service_account_scopes][crate::model::GceClusterConfig::service_account_scopes].
3069    pub fn set_service_account_scopes<T, V>(mut self, v: T) -> Self
3070    where
3071        T: std::iter::IntoIterator<Item = V>,
3072        V: std::convert::Into<std::string::String>,
3073    {
3074        use std::iter::Iterator;
3075        self.service_account_scopes = v.into_iter().map(|i| i.into()).collect();
3076        self
3077    }
3078
3079    /// Sets the value of [tags][crate::model::GceClusterConfig::tags].
3080    pub fn set_tags<T, V>(mut self, v: T) -> Self
3081    where
3082        T: std::iter::IntoIterator<Item = V>,
3083        V: std::convert::Into<std::string::String>,
3084    {
3085        use std::iter::Iterator;
3086        self.tags = v.into_iter().map(|i| i.into()).collect();
3087        self
3088    }
3089
3090    /// Sets the value of [metadata][crate::model::GceClusterConfig::metadata].
3091    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
3092    where
3093        T: std::iter::IntoIterator<Item = (K, V)>,
3094        K: std::convert::Into<std::string::String>,
3095        V: std::convert::Into<std::string::String>,
3096    {
3097        use std::iter::Iterator;
3098        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3099        self
3100    }
3101}
3102
3103impl wkt::message::Message for GceClusterConfig {
3104    fn typename() -> &'static str {
3105        "type.googleapis.com/google.cloud.dataproc.v1.GceClusterConfig"
3106    }
3107}
3108
3109/// Defines additional types related to [GceClusterConfig].
3110pub mod gce_cluster_config {
3111    #[allow(unused_imports)]
3112    use super::*;
3113
3114    /// `PrivateIpv6GoogleAccess` controls whether and how Dataproc cluster nodes
3115    /// can communicate with Google Services through gRPC over IPv6.
3116    /// These values are directly mapped to corresponding values in the
3117    /// [Compute Engine Instance
3118    /// fields](https://cloud.google.com/compute/docs/reference/rest/v1/instances).
3119    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3120    pub struct PrivateIpv6GoogleAccess(i32);
3121
3122    impl PrivateIpv6GoogleAccess {
3123        /// If unspecified, Compute Engine default behavior will apply, which
3124        /// is the same as
3125        /// [INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK].
3126        ///
3127        /// [google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK]: crate::model::gce_cluster_config::private_ipv_6_google_access::INHERIT_FROM_SUBNETWORK
3128        pub const PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED: PrivateIpv6GoogleAccess =
3129            PrivateIpv6GoogleAccess::new(0);
3130
3131        /// Private access to and from Google Services configuration
3132        /// inherited from the subnetwork configuration. This is the
3133        /// default Compute Engine behavior.
3134        pub const INHERIT_FROM_SUBNETWORK: PrivateIpv6GoogleAccess =
3135            PrivateIpv6GoogleAccess::new(1);
3136
3137        /// Enables outbound private IPv6 access to Google Services from the Dataproc
3138        /// cluster.
3139        pub const OUTBOUND: PrivateIpv6GoogleAccess = PrivateIpv6GoogleAccess::new(2);
3140
3141        /// Enables bidirectional private IPv6 access between Google Services and the
3142        /// Dataproc cluster.
3143        pub const BIDIRECTIONAL: PrivateIpv6GoogleAccess = PrivateIpv6GoogleAccess::new(3);
3144
3145        /// Creates a new PrivateIpv6GoogleAccess instance.
3146        pub(crate) const fn new(value: i32) -> Self {
3147            Self(value)
3148        }
3149
3150        /// Gets the enum value.
3151        pub fn value(&self) -> i32 {
3152            self.0
3153        }
3154
3155        /// Gets the enum value as a string.
3156        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3157            match self.0 {
3158                0 => std::borrow::Cow::Borrowed("PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"),
3159                1 => std::borrow::Cow::Borrowed("INHERIT_FROM_SUBNETWORK"),
3160                2 => std::borrow::Cow::Borrowed("OUTBOUND"),
3161                3 => std::borrow::Cow::Borrowed("BIDIRECTIONAL"),
3162                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3163            }
3164        }
3165
3166        /// Creates an enum value from the value name.
3167        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3168            match name {
3169                "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" => {
3170                    std::option::Option::Some(Self::PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED)
3171                }
3172                "INHERIT_FROM_SUBNETWORK" => {
3173                    std::option::Option::Some(Self::INHERIT_FROM_SUBNETWORK)
3174                }
3175                "OUTBOUND" => std::option::Option::Some(Self::OUTBOUND),
3176                "BIDIRECTIONAL" => std::option::Option::Some(Self::BIDIRECTIONAL),
3177                _ => std::option::Option::None,
3178            }
3179        }
3180    }
3181
3182    impl std::convert::From<i32> for PrivateIpv6GoogleAccess {
3183        fn from(value: i32) -> Self {
3184            Self::new(value)
3185        }
3186    }
3187
3188    impl std::default::Default for PrivateIpv6GoogleAccess {
3189        fn default() -> Self {
3190            Self::new(0)
3191        }
3192    }
3193}
3194
3195/// Node Group Affinity for clusters using sole-tenant node groups.
3196/// **The Dataproc `NodeGroupAffinity` resource is not related to the
3197/// Dataproc [NodeGroup][google.cloud.dataproc.v1.NodeGroup] resource.**
3198///
3199/// [google.cloud.dataproc.v1.NodeGroup]: crate::model::NodeGroup
3200#[serde_with::serde_as]
3201#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3202#[serde(default, rename_all = "camelCase")]
3203#[non_exhaustive]
3204pub struct NodeGroupAffinity {
3205    /// Required. The URI of a
3206    /// sole-tenant [node group
3207    /// resource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups)
3208    /// that the cluster will be created on.
3209    ///
3210    /// A full URL, partial URI, or node group name are valid. Examples:
3211    ///
3212    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]/nodeGroups/node-group-1`
3213    /// * `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1`
3214    /// * `node-group-1`
3215    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3216    pub node_group_uri: std::string::String,
3217
3218    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3219    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3220}
3221
3222impl NodeGroupAffinity {
3223    pub fn new() -> Self {
3224        std::default::Default::default()
3225    }
3226
3227    /// Sets the value of [node_group_uri][crate::model::NodeGroupAffinity::node_group_uri].
3228    pub fn set_node_group_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3229        self.node_group_uri = v.into();
3230        self
3231    }
3232}
3233
3234impl wkt::message::Message for NodeGroupAffinity {
3235    fn typename() -> &'static str {
3236        "type.googleapis.com/google.cloud.dataproc.v1.NodeGroupAffinity"
3237    }
3238}
3239
3240/// Shielded Instance Config for clusters using [Compute Engine Shielded
3241/// VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm).
3242#[serde_with::serde_as]
3243#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3244#[serde(default, rename_all = "camelCase")]
3245#[non_exhaustive]
3246pub struct ShieldedInstanceConfig {
3247    /// Optional. Defines whether instances have Secure Boot enabled.
3248    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3249    pub enable_secure_boot: std::option::Option<bool>,
3250
3251    /// Optional. Defines whether instances have the vTPM enabled.
3252    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3253    pub enable_vtpm: std::option::Option<bool>,
3254
3255    /// Optional. Defines whether instances have integrity monitoring enabled.
3256    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3257    pub enable_integrity_monitoring: std::option::Option<bool>,
3258
3259    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3260    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3261}
3262
3263impl ShieldedInstanceConfig {
3264    pub fn new() -> Self {
3265        std::default::Default::default()
3266    }
3267
3268    /// Sets the value of [enable_secure_boot][crate::model::ShieldedInstanceConfig::enable_secure_boot].
3269    pub fn set_enable_secure_boot<T: std::convert::Into<std::option::Option<bool>>>(
3270        mut self,
3271        v: T,
3272    ) -> Self {
3273        self.enable_secure_boot = v.into();
3274        self
3275    }
3276
3277    /// Sets the value of [enable_vtpm][crate::model::ShieldedInstanceConfig::enable_vtpm].
3278    pub fn set_enable_vtpm<T: std::convert::Into<std::option::Option<bool>>>(
3279        mut self,
3280        v: T,
3281    ) -> Self {
3282        self.enable_vtpm = v.into();
3283        self
3284    }
3285
3286    /// Sets the value of [enable_integrity_monitoring][crate::model::ShieldedInstanceConfig::enable_integrity_monitoring].
3287    pub fn set_enable_integrity_monitoring<T: std::convert::Into<std::option::Option<bool>>>(
3288        mut self,
3289        v: T,
3290    ) -> Self {
3291        self.enable_integrity_monitoring = v.into();
3292        self
3293    }
3294}
3295
3296impl wkt::message::Message for ShieldedInstanceConfig {
3297    fn typename() -> &'static str {
3298        "type.googleapis.com/google.cloud.dataproc.v1.ShieldedInstanceConfig"
3299    }
3300}
3301
3302/// Confidential Instance Config for clusters using [Confidential
3303/// VMs](https://cloud.google.com/compute/confidential-vm/docs)
3304#[serde_with::serde_as]
3305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3306#[serde(default, rename_all = "camelCase")]
3307#[non_exhaustive]
3308pub struct ConfidentialInstanceConfig {
3309    /// Optional. Defines whether the instance should have confidential compute
3310    /// enabled.
3311    pub enable_confidential_compute: bool,
3312
3313    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3314    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3315}
3316
3317impl ConfidentialInstanceConfig {
3318    pub fn new() -> Self {
3319        std::default::Default::default()
3320    }
3321
3322    /// Sets the value of [enable_confidential_compute][crate::model::ConfidentialInstanceConfig::enable_confidential_compute].
3323    pub fn set_enable_confidential_compute<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3324        self.enable_confidential_compute = v.into();
3325        self
3326    }
3327}
3328
3329impl wkt::message::Message for ConfidentialInstanceConfig {
3330    fn typename() -> &'static str {
3331        "type.googleapis.com/google.cloud.dataproc.v1.ConfidentialInstanceConfig"
3332    }
3333}
3334
3335/// The config settings for Compute Engine resources in
3336/// an instance group, such as a master or worker group.
3337#[serde_with::serde_as]
3338#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3339#[serde(default, rename_all = "camelCase")]
3340#[non_exhaustive]
3341pub struct InstanceGroupConfig {
3342    /// Optional. The number of VM instances in the instance group.
3343    /// For [HA
3344    /// cluster](/dataproc/docs/concepts/configuring-clusters/high-availability)
3345    /// [master_config](#FIELDS.master_config) groups, **must be set to 3**.
3346    /// For standard cluster [master_config](#FIELDS.master_config) groups,
3347    /// **must be set to 1**.
3348    pub num_instances: i32,
3349
3350    /// Output only. The list of instance names. Dataproc derives the names
3351    /// from `cluster_name`, `num_instances`, and the instance group.
3352    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3353    pub instance_names: std::vec::Vec<std::string::String>,
3354
3355    /// Output only. List of references to Compute Engine instances.
3356    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3357    pub instance_references: std::vec::Vec<crate::model::InstanceReference>,
3358
3359    /// Optional. The Compute Engine image resource used for cluster instances.
3360    ///
3361    /// The URI can represent an image or image family.
3362    ///
3363    /// Image examples:
3364    ///
3365    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/global/images/[image-id]`
3366    /// * `projects/[project_id]/global/images/[image-id]`
3367    /// * `image-id`
3368    ///
3369    /// Image family examples. Dataproc will use the most recent
3370    /// image from the family:
3371    ///
3372    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/global/images/family/[custom-image-family-name]`
3373    /// * `projects/[project_id]/global/images/family/[custom-image-family-name]`
3374    ///
3375    /// If the URI is unspecified, it will be inferred from
3376    /// `SoftwareConfig.image_version` or the system default.
3377    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3378    pub image_uri: std::string::String,
3379
3380    /// Optional. The Compute Engine machine type used for cluster instances.
3381    ///
3382    /// A full URL, partial URI, or short name are valid. Examples:
3383    ///
3384    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]/machineTypes/n1-standard-2`
3385    /// * `projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2`
3386    /// * `n1-standard-2`
3387    ///
3388    /// **Auto Zone Exception**: If you are using the Dataproc
3389    /// [Auto Zone
3390    /// Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
3391    /// feature, you must use the short name of the machine type
3392    /// resource, for example, `n1-standard-2`.
3393    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3394    pub machine_type_uri: std::string::String,
3395
3396    /// Optional. Disk option config settings.
3397    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3398    pub disk_config: std::option::Option<crate::model::DiskConfig>,
3399
3400    /// Output only. Specifies that this instance group contains preemptible
3401    /// instances.
3402    pub is_preemptible: bool,
3403
3404    /// Optional. Specifies the preemptibility of the instance group.
3405    ///
3406    /// The default value for master and worker groups is
3407    /// `NON_PREEMPTIBLE`. This default cannot be changed.
3408    ///
3409    /// The default value for secondary instances is
3410    /// `PREEMPTIBLE`.
3411    pub preemptibility: crate::model::instance_group_config::Preemptibility,
3412
3413    /// Output only. The config for Compute Engine Instance Group
3414    /// Manager that manages this group.
3415    /// This is only used for preemptible instance groups.
3416    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3417    pub managed_group_config: std::option::Option<crate::model::ManagedGroupConfig>,
3418
3419    /// Optional. The Compute Engine accelerator configuration for these
3420    /// instances.
3421    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3422    pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
3423
3424    /// Optional. Specifies the minimum cpu platform for the Instance Group.
3425    /// See [Dataproc -> Minimum CPU
3426    /// Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu).
3427    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3428    pub min_cpu_platform: std::string::String,
3429
3430    /// Optional. The minimum number of primary worker instances to create.
3431    /// If `min_num_instances` is set, cluster creation will succeed if
3432    /// the number of primary workers created is at least equal to the
3433    /// `min_num_instances` number.
3434    ///
3435    /// Example: Cluster creation request with `num_instances` = `5` and
3436    /// `min_num_instances` = `3`:
3437    ///
3438    /// * If 4 VMs are created and 1 instance fails,
3439    ///   the failed VM is deleted. The cluster is
3440    ///   resized to 4 instances and placed in a `RUNNING` state.
3441    /// * If 2 instances are created and 3 instances fail,
3442    ///   the cluster in placed in an `ERROR` state. The failed VMs
3443    ///   are not deleted.
3444    pub min_num_instances: i32,
3445
3446    /// Optional. Instance flexibility Policy allowing a mixture of VM shapes and
3447    /// provisioning models.
3448    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3449    pub instance_flexibility_policy: std::option::Option<crate::model::InstanceFlexibilityPolicy>,
3450
3451    /// Optional. Configuration to handle the startup of instances during cluster
3452    /// create and update process.
3453    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3454    pub startup_config: std::option::Option<crate::model::StartupConfig>,
3455
3456    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3457    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3458}
3459
3460impl InstanceGroupConfig {
3461    pub fn new() -> Self {
3462        std::default::Default::default()
3463    }
3464
3465    /// Sets the value of [num_instances][crate::model::InstanceGroupConfig::num_instances].
3466    pub fn set_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3467        self.num_instances = v.into();
3468        self
3469    }
3470
3471    /// Sets the value of [image_uri][crate::model::InstanceGroupConfig::image_uri].
3472    pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473        self.image_uri = v.into();
3474        self
3475    }
3476
3477    /// Sets the value of [machine_type_uri][crate::model::InstanceGroupConfig::machine_type_uri].
3478    pub fn set_machine_type_uri<T: std::convert::Into<std::string::String>>(
3479        mut self,
3480        v: T,
3481    ) -> Self {
3482        self.machine_type_uri = v.into();
3483        self
3484    }
3485
3486    /// Sets the value of [disk_config][crate::model::InstanceGroupConfig::disk_config].
3487    pub fn set_disk_config<T: std::convert::Into<std::option::Option<crate::model::DiskConfig>>>(
3488        mut self,
3489        v: T,
3490    ) -> Self {
3491        self.disk_config = v.into();
3492        self
3493    }
3494
3495    /// Sets the value of [is_preemptible][crate::model::InstanceGroupConfig::is_preemptible].
3496    pub fn set_is_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3497        self.is_preemptible = v.into();
3498        self
3499    }
3500
3501    /// Sets the value of [preemptibility][crate::model::InstanceGroupConfig::preemptibility].
3502    pub fn set_preemptibility<
3503        T: std::convert::Into<crate::model::instance_group_config::Preemptibility>,
3504    >(
3505        mut self,
3506        v: T,
3507    ) -> Self {
3508        self.preemptibility = v.into();
3509        self
3510    }
3511
3512    /// Sets the value of [managed_group_config][crate::model::InstanceGroupConfig::managed_group_config].
3513    pub fn set_managed_group_config<
3514        T: std::convert::Into<std::option::Option<crate::model::ManagedGroupConfig>>,
3515    >(
3516        mut self,
3517        v: T,
3518    ) -> Self {
3519        self.managed_group_config = v.into();
3520        self
3521    }
3522
3523    /// Sets the value of [min_cpu_platform][crate::model::InstanceGroupConfig::min_cpu_platform].
3524    pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
3525        mut self,
3526        v: T,
3527    ) -> Self {
3528        self.min_cpu_platform = v.into();
3529        self
3530    }
3531
3532    /// Sets the value of [min_num_instances][crate::model::InstanceGroupConfig::min_num_instances].
3533    pub fn set_min_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3534        self.min_num_instances = v.into();
3535        self
3536    }
3537
3538    /// Sets the value of [instance_flexibility_policy][crate::model::InstanceGroupConfig::instance_flexibility_policy].
3539    pub fn set_instance_flexibility_policy<
3540        T: std::convert::Into<std::option::Option<crate::model::InstanceFlexibilityPolicy>>,
3541    >(
3542        mut self,
3543        v: T,
3544    ) -> Self {
3545        self.instance_flexibility_policy = v.into();
3546        self
3547    }
3548
3549    /// Sets the value of [startup_config][crate::model::InstanceGroupConfig::startup_config].
3550    pub fn set_startup_config<
3551        T: std::convert::Into<std::option::Option<crate::model::StartupConfig>>,
3552    >(
3553        mut self,
3554        v: T,
3555    ) -> Self {
3556        self.startup_config = v.into();
3557        self
3558    }
3559
3560    /// Sets the value of [instance_names][crate::model::InstanceGroupConfig::instance_names].
3561    pub fn set_instance_names<T, V>(mut self, v: T) -> Self
3562    where
3563        T: std::iter::IntoIterator<Item = V>,
3564        V: std::convert::Into<std::string::String>,
3565    {
3566        use std::iter::Iterator;
3567        self.instance_names = v.into_iter().map(|i| i.into()).collect();
3568        self
3569    }
3570
3571    /// Sets the value of [instance_references][crate::model::InstanceGroupConfig::instance_references].
3572    pub fn set_instance_references<T, V>(mut self, v: T) -> Self
3573    where
3574        T: std::iter::IntoIterator<Item = V>,
3575        V: std::convert::Into<crate::model::InstanceReference>,
3576    {
3577        use std::iter::Iterator;
3578        self.instance_references = v.into_iter().map(|i| i.into()).collect();
3579        self
3580    }
3581
3582    /// Sets the value of [accelerators][crate::model::InstanceGroupConfig::accelerators].
3583    pub fn set_accelerators<T, V>(mut self, v: T) -> Self
3584    where
3585        T: std::iter::IntoIterator<Item = V>,
3586        V: std::convert::Into<crate::model::AcceleratorConfig>,
3587    {
3588        use std::iter::Iterator;
3589        self.accelerators = v.into_iter().map(|i| i.into()).collect();
3590        self
3591    }
3592}
3593
3594impl wkt::message::Message for InstanceGroupConfig {
3595    fn typename() -> &'static str {
3596        "type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupConfig"
3597    }
3598}
3599
3600/// Defines additional types related to [InstanceGroupConfig].
3601pub mod instance_group_config {
3602    #[allow(unused_imports)]
3603    use super::*;
3604
3605    /// Controls the use of preemptible instances within the group.
3606    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3607    pub struct Preemptibility(i32);
3608
3609    impl Preemptibility {
3610        /// Preemptibility is unspecified, the system will choose the
3611        /// appropriate setting for each instance group.
3612        pub const PREEMPTIBILITY_UNSPECIFIED: Preemptibility = Preemptibility::new(0);
3613
3614        /// Instances are non-preemptible.
3615        ///
3616        /// This option is allowed for all instance groups and is the only valid
3617        /// value for Master and Worker instance groups.
3618        pub const NON_PREEMPTIBLE: Preemptibility = Preemptibility::new(1);
3619
3620        /// Instances are [preemptible]
3621        /// (<https://cloud.google.com/compute/docs/instances/preemptible>).
3622        ///
3623        /// This option is allowed only for [secondary worker]
3624        /// (<https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms>)
3625        /// groups.
3626        pub const PREEMPTIBLE: Preemptibility = Preemptibility::new(2);
3627
3628        /// Instances are [Spot VMs]
3629        /// (<https://cloud.google.com/compute/docs/instances/spot>).
3630        ///
3631        /// This option is allowed only for [secondary worker]
3632        /// (<https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms>)
3633        /// groups. Spot VMs are the latest version of [preemptible VMs]
3634        /// (<https://cloud.google.com/compute/docs/instances/preemptible>), and
3635        /// provide additional features.
3636        pub const SPOT: Preemptibility = Preemptibility::new(3);
3637
3638        /// Creates a new Preemptibility instance.
3639        pub(crate) const fn new(value: i32) -> Self {
3640            Self(value)
3641        }
3642
3643        /// Gets the enum value.
3644        pub fn value(&self) -> i32 {
3645            self.0
3646        }
3647
3648        /// Gets the enum value as a string.
3649        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3650            match self.0 {
3651                0 => std::borrow::Cow::Borrowed("PREEMPTIBILITY_UNSPECIFIED"),
3652                1 => std::borrow::Cow::Borrowed("NON_PREEMPTIBLE"),
3653                2 => std::borrow::Cow::Borrowed("PREEMPTIBLE"),
3654                3 => std::borrow::Cow::Borrowed("SPOT"),
3655                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3656            }
3657        }
3658
3659        /// Creates an enum value from the value name.
3660        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3661            match name {
3662                "PREEMPTIBILITY_UNSPECIFIED" => {
3663                    std::option::Option::Some(Self::PREEMPTIBILITY_UNSPECIFIED)
3664                }
3665                "NON_PREEMPTIBLE" => std::option::Option::Some(Self::NON_PREEMPTIBLE),
3666                "PREEMPTIBLE" => std::option::Option::Some(Self::PREEMPTIBLE),
3667                "SPOT" => std::option::Option::Some(Self::SPOT),
3668                _ => std::option::Option::None,
3669            }
3670        }
3671    }
3672
3673    impl std::convert::From<i32> for Preemptibility {
3674        fn from(value: i32) -> Self {
3675            Self::new(value)
3676        }
3677    }
3678
3679    impl std::default::Default for Preemptibility {
3680        fn default() -> Self {
3681            Self::new(0)
3682        }
3683    }
3684}
3685
3686/// Configuration to handle the startup of instances during cluster create and
3687/// update process.
3688#[serde_with::serde_as]
3689#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3690#[serde(default, rename_all = "camelCase")]
3691#[non_exhaustive]
3692pub struct StartupConfig {
3693    /// Optional. The config setting to enable cluster creation/ updation to be
3694    /// successful only after required_registration_fraction of instances are up
3695    /// and running. This configuration is applicable to only secondary workers for
3696    /// now. The cluster will fail if required_registration_fraction of instances
3697    /// are not available. This will include instance creation, agent registration,
3698    /// and service registration (if enabled).
3699    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3700    pub required_registration_fraction: std::option::Option<f64>,
3701
3702    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3703    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3704}
3705
3706impl StartupConfig {
3707    pub fn new() -> Self {
3708        std::default::Default::default()
3709    }
3710
3711    /// Sets the value of [required_registration_fraction][crate::model::StartupConfig::required_registration_fraction].
3712    pub fn set_required_registration_fraction<T: std::convert::Into<std::option::Option<f64>>>(
3713        mut self,
3714        v: T,
3715    ) -> Self {
3716        self.required_registration_fraction = v.into();
3717        self
3718    }
3719}
3720
3721impl wkt::message::Message for StartupConfig {
3722    fn typename() -> &'static str {
3723        "type.googleapis.com/google.cloud.dataproc.v1.StartupConfig"
3724    }
3725}
3726
3727/// A reference to a Compute Engine instance.
3728#[serde_with::serde_as]
3729#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3730#[serde(default, rename_all = "camelCase")]
3731#[non_exhaustive]
3732pub struct InstanceReference {
3733    /// The user-friendly name of the Compute Engine instance.
3734    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3735    pub instance_name: std::string::String,
3736
3737    /// The unique identifier of the Compute Engine instance.
3738    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3739    pub instance_id: std::string::String,
3740
3741    /// The public RSA key used for sharing data with this instance.
3742    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3743    pub public_key: std::string::String,
3744
3745    /// The public ECIES key used for sharing data with this instance.
3746    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3747    pub public_ecies_key: std::string::String,
3748
3749    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3750    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3751}
3752
3753impl InstanceReference {
3754    pub fn new() -> Self {
3755        std::default::Default::default()
3756    }
3757
3758    /// Sets the value of [instance_name][crate::model::InstanceReference::instance_name].
3759    pub fn set_instance_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3760        self.instance_name = v.into();
3761        self
3762    }
3763
3764    /// Sets the value of [instance_id][crate::model::InstanceReference::instance_id].
3765    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3766        self.instance_id = v.into();
3767        self
3768    }
3769
3770    /// Sets the value of [public_key][crate::model::InstanceReference::public_key].
3771    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3772        self.public_key = v.into();
3773        self
3774    }
3775
3776    /// Sets the value of [public_ecies_key][crate::model::InstanceReference::public_ecies_key].
3777    pub fn set_public_ecies_key<T: std::convert::Into<std::string::String>>(
3778        mut self,
3779        v: T,
3780    ) -> Self {
3781        self.public_ecies_key = v.into();
3782        self
3783    }
3784}
3785
3786impl wkt::message::Message for InstanceReference {
3787    fn typename() -> &'static str {
3788        "type.googleapis.com/google.cloud.dataproc.v1.InstanceReference"
3789    }
3790}
3791
3792/// Specifies the resources used to actively manage an instance group.
3793#[serde_with::serde_as]
3794#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3795#[serde(default, rename_all = "camelCase")]
3796#[non_exhaustive]
3797pub struct ManagedGroupConfig {
3798    /// Output only. The name of the Instance Template used for the Managed
3799    /// Instance Group.
3800    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3801    pub instance_template_name: std::string::String,
3802
3803    /// Output only. The name of the Instance Group Manager for this group.
3804    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3805    pub instance_group_manager_name: std::string::String,
3806
3807    /// Output only. The partial URI to the instance group manager for this group.
3808    /// E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm.
3809    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3810    pub instance_group_manager_uri: std::string::String,
3811
3812    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3813    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3814}
3815
3816impl ManagedGroupConfig {
3817    pub fn new() -> Self {
3818        std::default::Default::default()
3819    }
3820
3821    /// Sets the value of [instance_template_name][crate::model::ManagedGroupConfig::instance_template_name].
3822    pub fn set_instance_template_name<T: std::convert::Into<std::string::String>>(
3823        mut self,
3824        v: T,
3825    ) -> Self {
3826        self.instance_template_name = v.into();
3827        self
3828    }
3829
3830    /// Sets the value of [instance_group_manager_name][crate::model::ManagedGroupConfig::instance_group_manager_name].
3831    pub fn set_instance_group_manager_name<T: std::convert::Into<std::string::String>>(
3832        mut self,
3833        v: T,
3834    ) -> Self {
3835        self.instance_group_manager_name = v.into();
3836        self
3837    }
3838
3839    /// Sets the value of [instance_group_manager_uri][crate::model::ManagedGroupConfig::instance_group_manager_uri].
3840    pub fn set_instance_group_manager_uri<T: std::convert::Into<std::string::String>>(
3841        mut self,
3842        v: T,
3843    ) -> Self {
3844        self.instance_group_manager_uri = v.into();
3845        self
3846    }
3847}
3848
3849impl wkt::message::Message for ManagedGroupConfig {
3850    fn typename() -> &'static str {
3851        "type.googleapis.com/google.cloud.dataproc.v1.ManagedGroupConfig"
3852    }
3853}
3854
3855/// Instance flexibility Policy allowing a mixture of VM shapes and provisioning
3856/// models.
3857#[serde_with::serde_as]
3858#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3859#[serde(default, rename_all = "camelCase")]
3860#[non_exhaustive]
3861pub struct InstanceFlexibilityPolicy {
3862    /// Optional. Defines how the Group selects the provisioning model to ensure
3863    /// required reliability.
3864    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3865    pub provisioning_model_mix:
3866        std::option::Option<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
3867
3868    /// Optional. List of instance selection options that the group will use when
3869    /// creating new VMs.
3870    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3871    pub instance_selection_list:
3872        std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelection>,
3873
3874    /// Output only. A list of instance selection results in the group.
3875    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3876    pub instance_selection_results:
3877        std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
3878
3879    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3880    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3881}
3882
3883impl InstanceFlexibilityPolicy {
3884    pub fn new() -> Self {
3885        std::default::Default::default()
3886    }
3887
3888    /// Sets the value of [provisioning_model_mix][crate::model::InstanceFlexibilityPolicy::provisioning_model_mix].
3889    pub fn set_provisioning_model_mix<
3890        T: std::convert::Into<
3891                std::option::Option<
3892                    crate::model::instance_flexibility_policy::ProvisioningModelMix,
3893                >,
3894            >,
3895    >(
3896        mut self,
3897        v: T,
3898    ) -> Self {
3899        self.provisioning_model_mix = v.into();
3900        self
3901    }
3902
3903    /// Sets the value of [instance_selection_list][crate::model::InstanceFlexibilityPolicy::instance_selection_list].
3904    pub fn set_instance_selection_list<T, V>(mut self, v: T) -> Self
3905    where
3906        T: std::iter::IntoIterator<Item = V>,
3907        V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelection>,
3908    {
3909        use std::iter::Iterator;
3910        self.instance_selection_list = v.into_iter().map(|i| i.into()).collect();
3911        self
3912    }
3913
3914    /// Sets the value of [instance_selection_results][crate::model::InstanceFlexibilityPolicy::instance_selection_results].
3915    pub fn set_instance_selection_results<T, V>(mut self, v: T) -> Self
3916    where
3917        T: std::iter::IntoIterator<Item = V>,
3918        V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
3919    {
3920        use std::iter::Iterator;
3921        self.instance_selection_results = v.into_iter().map(|i| i.into()).collect();
3922        self
3923    }
3924}
3925
3926impl wkt::message::Message for InstanceFlexibilityPolicy {
3927    fn typename() -> &'static str {
3928        "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy"
3929    }
3930}
3931
3932/// Defines additional types related to [InstanceFlexibilityPolicy].
3933pub mod instance_flexibility_policy {
3934    #[allow(unused_imports)]
3935    use super::*;
3936
3937    /// Defines how Dataproc should create VMs with a mixture of provisioning
3938    /// models.
3939    #[serde_with::serde_as]
3940    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3941    #[serde(default, rename_all = "camelCase")]
3942    #[non_exhaustive]
3943    pub struct ProvisioningModelMix {
3944        /// Optional. The base capacity that will always use Standard VMs to avoid
3945        /// risk of more preemption than the minimum capacity you need. Dataproc will
3946        /// create only standard VMs until it reaches standard_capacity_base, then it
3947        /// will start using standard_capacity_percent_above_base to mix Spot with
3948        /// Standard VMs. eg. If 15 instances are requested and
3949        /// standard_capacity_base is 5, Dataproc will create 5 standard VMs and then
3950        /// start mixing spot and standard VMs for remaining 10 instances.
3951        #[serde(skip_serializing_if = "std::option::Option::is_none")]
3952        pub standard_capacity_base: std::option::Option<i32>,
3953
3954        /// Optional. The percentage of target capacity that should use Standard VM.
3955        /// The remaining percentage will use Spot VMs. The percentage applies only
3956        /// to the capacity above standard_capacity_base. eg. If 15 instances are
3957        /// requested and standard_capacity_base is 5 and
3958        /// standard_capacity_percent_above_base is 30, Dataproc will create 5
3959        /// standard VMs and then start mixing spot and standard VMs for remaining 10
3960        /// instances. The mix will be 30% standard and 70% spot.
3961        #[serde(skip_serializing_if = "std::option::Option::is_none")]
3962        pub standard_capacity_percent_above_base: std::option::Option<i32>,
3963
3964        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3965        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3966    }
3967
3968    impl ProvisioningModelMix {
3969        pub fn new() -> Self {
3970            std::default::Default::default()
3971        }
3972
3973        /// Sets the value of [standard_capacity_base][crate::model::instance_flexibility_policy::ProvisioningModelMix::standard_capacity_base].
3974        pub fn set_standard_capacity_base<T: std::convert::Into<std::option::Option<i32>>>(
3975            mut self,
3976            v: T,
3977        ) -> Self {
3978            self.standard_capacity_base = v.into();
3979            self
3980        }
3981
3982        /// Sets the value of [standard_capacity_percent_above_base][crate::model::instance_flexibility_policy::ProvisioningModelMix::standard_capacity_percent_above_base].
3983        pub fn set_standard_capacity_percent_above_base<
3984            T: std::convert::Into<std::option::Option<i32>>,
3985        >(
3986            mut self,
3987            v: T,
3988        ) -> Self {
3989            self.standard_capacity_percent_above_base = v.into();
3990            self
3991        }
3992    }
3993
3994    impl wkt::message::Message for ProvisioningModelMix {
3995        fn typename() -> &'static str {
3996            "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix"
3997        }
3998    }
3999
4000    /// Defines machines types and a rank to which the machines types belong.
4001    #[serde_with::serde_as]
4002    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4003    #[serde(default, rename_all = "camelCase")]
4004    #[non_exhaustive]
4005    pub struct InstanceSelection {
4006        /// Optional. Full machine-type names, e.g. "n1-standard-16".
4007        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4008        pub machine_types: std::vec::Vec<std::string::String>,
4009
4010        /// Optional. Preference of this instance selection. Lower number means
4011        /// higher preference. Dataproc will first try to create a VM based on the
4012        /// machine-type with priority rank and fallback to next rank based on
4013        /// availability. Machine types and instance selections with the same
4014        /// priority have the same preference.
4015        pub rank: i32,
4016
4017        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4018        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4019    }
4020
4021    impl InstanceSelection {
4022        pub fn new() -> Self {
4023            std::default::Default::default()
4024        }
4025
4026        /// Sets the value of [rank][crate::model::instance_flexibility_policy::InstanceSelection::rank].
4027        pub fn set_rank<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4028            self.rank = v.into();
4029            self
4030        }
4031
4032        /// Sets the value of [machine_types][crate::model::instance_flexibility_policy::InstanceSelection::machine_types].
4033        pub fn set_machine_types<T, V>(mut self, v: T) -> Self
4034        where
4035            T: std::iter::IntoIterator<Item = V>,
4036            V: std::convert::Into<std::string::String>,
4037        {
4038            use std::iter::Iterator;
4039            self.machine_types = v.into_iter().map(|i| i.into()).collect();
4040            self
4041        }
4042    }
4043
4044    impl wkt::message::Message for InstanceSelection {
4045        fn typename() -> &'static str {
4046            "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection"
4047        }
4048    }
4049
4050    /// Defines a mapping from machine types to the number of VMs that are created
4051    /// with each machine type.
4052    #[serde_with::serde_as]
4053    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4054    #[serde(default, rename_all = "camelCase")]
4055    #[non_exhaustive]
4056    pub struct InstanceSelectionResult {
4057        /// Output only. Full machine-type names, e.g. "n1-standard-16".
4058        #[serde(skip_serializing_if = "std::option::Option::is_none")]
4059        pub machine_type: std::option::Option<std::string::String>,
4060
4061        /// Output only. Number of VM provisioned with the machine_type.
4062        #[serde(skip_serializing_if = "std::option::Option::is_none")]
4063        pub vm_count: std::option::Option<i32>,
4064
4065        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4066        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4067    }
4068
4069    impl InstanceSelectionResult {
4070        pub fn new() -> Self {
4071            std::default::Default::default()
4072        }
4073
4074        /// Sets the value of [machine_type][crate::model::instance_flexibility_policy::InstanceSelectionResult::machine_type].
4075        pub fn set_machine_type<T: std::convert::Into<std::option::Option<std::string::String>>>(
4076            mut self,
4077            v: T,
4078        ) -> Self {
4079            self.machine_type = v.into();
4080            self
4081        }
4082
4083        /// Sets the value of [vm_count][crate::model::instance_flexibility_policy::InstanceSelectionResult::vm_count].
4084        pub fn set_vm_count<T: std::convert::Into<std::option::Option<i32>>>(
4085            mut self,
4086            v: T,
4087        ) -> Self {
4088            self.vm_count = v.into();
4089            self
4090        }
4091    }
4092
4093    impl wkt::message::Message for InstanceSelectionResult {
4094        fn typename() -> &'static str {
4095            "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult"
4096        }
4097    }
4098}
4099
4100/// Specifies the type and number of accelerator cards attached to the instances
4101/// of an instance. See [GPUs on Compute
4102/// Engine](https://cloud.google.com/compute/docs/gpus/).
4103#[serde_with::serde_as]
4104#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4105#[serde(default, rename_all = "camelCase")]
4106#[non_exhaustive]
4107pub struct AcceleratorConfig {
4108    /// Full URL, partial URI, or short name of the accelerator type resource to
4109    /// expose to this instance. See
4110    /// [Compute Engine
4111    /// AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
4112    ///
4113    /// Examples:
4114    ///
4115    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4`
4116    /// * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4`
4117    /// * `nvidia-tesla-t4`
4118    ///
4119    /// **Auto Zone Exception**: If you are using the Dataproc
4120    /// [Auto Zone
4121    /// Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
4122    /// feature, you must use the short name of the accelerator type
4123    /// resource, for example, `nvidia-tesla-t4`.
4124    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4125    pub accelerator_type_uri: std::string::String,
4126
4127    /// The number of the accelerator cards of this type exposed to this instance.
4128    pub accelerator_count: i32,
4129
4130    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4131    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4132}
4133
4134impl AcceleratorConfig {
4135    pub fn new() -> Self {
4136        std::default::Default::default()
4137    }
4138
4139    /// Sets the value of [accelerator_type_uri][crate::model::AcceleratorConfig::accelerator_type_uri].
4140    pub fn set_accelerator_type_uri<T: std::convert::Into<std::string::String>>(
4141        mut self,
4142        v: T,
4143    ) -> Self {
4144        self.accelerator_type_uri = v.into();
4145        self
4146    }
4147
4148    /// Sets the value of [accelerator_count][crate::model::AcceleratorConfig::accelerator_count].
4149    pub fn set_accelerator_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4150        self.accelerator_count = v.into();
4151        self
4152    }
4153}
4154
4155impl wkt::message::Message for AcceleratorConfig {
4156    fn typename() -> &'static str {
4157        "type.googleapis.com/google.cloud.dataproc.v1.AcceleratorConfig"
4158    }
4159}
4160
4161/// Specifies the config of disk options for a group of VM instances.
4162#[serde_with::serde_as]
4163#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4164#[serde(default, rename_all = "camelCase")]
4165#[non_exhaustive]
4166pub struct DiskConfig {
4167    /// Optional. Type of the boot disk (default is "pd-standard").
4168    /// Valid values: "pd-balanced" (Persistent Disk Balanced Solid State Drive),
4169    /// "pd-ssd" (Persistent Disk Solid State Drive),
4170    /// or "pd-standard" (Persistent Disk Hard Disk Drive).
4171    /// See [Disk types](https://cloud.google.com/compute/docs/disks#disk-types).
4172    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4173    pub boot_disk_type: std::string::String,
4174
4175    /// Optional. Size in GB of the boot disk (default is 500GB).
4176    pub boot_disk_size_gb: i32,
4177
4178    /// Optional. Number of attached SSDs, from 0 to 8 (default is 0).
4179    /// If SSDs are not attached, the boot disk is used to store runtime logs and
4180    /// [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data.
4181    /// If one or more SSDs are attached, this runtime bulk
4182    /// data is spread across them, and the boot disk contains only basic
4183    /// config and installed binaries.
4184    ///
4185    /// Note: Local SSD options may vary by machine type and number of vCPUs
4186    /// selected.
4187    pub num_local_ssds: i32,
4188
4189    /// Optional. Interface type of local SSDs (default is "scsi").
4190    /// Valid values: "scsi" (Small Computer System Interface),
4191    /// "nvme" (Non-Volatile Memory Express).
4192    /// See [local SSD
4193    /// performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance).
4194    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4195    pub local_ssd_interface: std::string::String,
4196
4197    /// Optional. Indicates how many IOPS to provision for the disk. This sets the
4198    /// number of I/O operations per second that the disk can handle. Note: This
4199    /// field is only supported if boot_disk_type is hyperdisk-balanced.
4200    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4201    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
4202    pub boot_disk_provisioned_iops: std::option::Option<i64>,
4203
4204    /// Optional. Indicates how much throughput to provision for the disk. This
4205    /// sets the number of throughput mb per second that the disk can handle.
4206    /// Values must be greater than or equal to 1. Note: This field is only
4207    /// supported if boot_disk_type is hyperdisk-balanced.
4208    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4209    #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
4210    pub boot_disk_provisioned_throughput: std::option::Option<i64>,
4211
4212    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4213    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4214}
4215
4216impl DiskConfig {
4217    pub fn new() -> Self {
4218        std::default::Default::default()
4219    }
4220
4221    /// Sets the value of [boot_disk_type][crate::model::DiskConfig::boot_disk_type].
4222    pub fn set_boot_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4223        self.boot_disk_type = v.into();
4224        self
4225    }
4226
4227    /// Sets the value of [boot_disk_size_gb][crate::model::DiskConfig::boot_disk_size_gb].
4228    pub fn set_boot_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4229        self.boot_disk_size_gb = v.into();
4230        self
4231    }
4232
4233    /// Sets the value of [num_local_ssds][crate::model::DiskConfig::num_local_ssds].
4234    pub fn set_num_local_ssds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4235        self.num_local_ssds = v.into();
4236        self
4237    }
4238
4239    /// Sets the value of [local_ssd_interface][crate::model::DiskConfig::local_ssd_interface].
4240    pub fn set_local_ssd_interface<T: std::convert::Into<std::string::String>>(
4241        mut self,
4242        v: T,
4243    ) -> Self {
4244        self.local_ssd_interface = v.into();
4245        self
4246    }
4247
4248    /// Sets the value of [boot_disk_provisioned_iops][crate::model::DiskConfig::boot_disk_provisioned_iops].
4249    pub fn set_boot_disk_provisioned_iops<T: std::convert::Into<std::option::Option<i64>>>(
4250        mut self,
4251        v: T,
4252    ) -> Self {
4253        self.boot_disk_provisioned_iops = v.into();
4254        self
4255    }
4256
4257    /// Sets the value of [boot_disk_provisioned_throughput][crate::model::DiskConfig::boot_disk_provisioned_throughput].
4258    pub fn set_boot_disk_provisioned_throughput<T: std::convert::Into<std::option::Option<i64>>>(
4259        mut self,
4260        v: T,
4261    ) -> Self {
4262        self.boot_disk_provisioned_throughput = v.into();
4263        self
4264    }
4265}
4266
4267impl wkt::message::Message for DiskConfig {
4268    fn typename() -> &'static str {
4269        "type.googleapis.com/google.cloud.dataproc.v1.DiskConfig"
4270    }
4271}
4272
4273/// Node group identification and configuration information.
4274#[serde_with::serde_as]
4275#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4276#[serde(default, rename_all = "camelCase")]
4277#[non_exhaustive]
4278pub struct AuxiliaryNodeGroup {
4279    /// Required. Node group configuration.
4280    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4281    pub node_group: std::option::Option<crate::model::NodeGroup>,
4282
4283    /// Optional. A node group ID. Generated if not specified.
4284    ///
4285    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
4286    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
4287    /// or hyphen. Must consist of from 3 to 33 characters.
4288    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4289    pub node_group_id: std::string::String,
4290
4291    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4292    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4293}
4294
4295impl AuxiliaryNodeGroup {
4296    pub fn new() -> Self {
4297        std::default::Default::default()
4298    }
4299
4300    /// Sets the value of [node_group][crate::model::AuxiliaryNodeGroup::node_group].
4301    pub fn set_node_group<T: std::convert::Into<std::option::Option<crate::model::NodeGroup>>>(
4302        mut self,
4303        v: T,
4304    ) -> Self {
4305        self.node_group = v.into();
4306        self
4307    }
4308
4309    /// Sets the value of [node_group_id][crate::model::AuxiliaryNodeGroup::node_group_id].
4310    pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4311        self.node_group_id = v.into();
4312        self
4313    }
4314}
4315
4316impl wkt::message::Message for AuxiliaryNodeGroup {
4317    fn typename() -> &'static str {
4318        "type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryNodeGroup"
4319    }
4320}
4321
4322/// Dataproc Node Group.
4323/// **The Dataproc `NodeGroup` resource is not related to the
4324/// Dataproc [NodeGroupAffinity][google.cloud.dataproc.v1.NodeGroupAffinity]
4325/// resource.**
4326///
4327/// [google.cloud.dataproc.v1.NodeGroupAffinity]: crate::model::NodeGroupAffinity
4328#[serde_with::serde_as]
4329#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4330#[serde(default, rename_all = "camelCase")]
4331#[non_exhaustive]
4332pub struct NodeGroup {
4333    /// The Node group [resource name](https://aip.dev/122).
4334    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4335    pub name: std::string::String,
4336
4337    /// Required. Node group roles.
4338    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4339    pub roles: std::vec::Vec<crate::model::node_group::Role>,
4340
4341    /// Optional. The node group instance group configuration.
4342    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4343    pub node_group_config: std::option::Option<crate::model::InstanceGroupConfig>,
4344
4345    /// Optional. Node group labels.
4346    ///
4347    /// * Label **keys** must consist of from 1 to 63 characters and conform to
4348    ///   [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
4349    /// * Label **values** can be empty. If specified, they must consist of from
4350    ///   1 to 63 characters and conform to [RFC 1035]
4351    ///   (<https://www.ietf.org/rfc/rfc1035.txt>).
4352    /// * The node group must have no more than 32 labels.
4353    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4354    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4355
4356    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4357    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4358}
4359
4360impl NodeGroup {
4361    pub fn new() -> Self {
4362        std::default::Default::default()
4363    }
4364
4365    /// Sets the value of [name][crate::model::NodeGroup::name].
4366    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4367        self.name = v.into();
4368        self
4369    }
4370
4371    /// Sets the value of [node_group_config][crate::model::NodeGroup::node_group_config].
4372    pub fn set_node_group_config<
4373        T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
4374    >(
4375        mut self,
4376        v: T,
4377    ) -> Self {
4378        self.node_group_config = v.into();
4379        self
4380    }
4381
4382    /// Sets the value of [roles][crate::model::NodeGroup::roles].
4383    pub fn set_roles<T, V>(mut self, v: T) -> Self
4384    where
4385        T: std::iter::IntoIterator<Item = V>,
4386        V: std::convert::Into<crate::model::node_group::Role>,
4387    {
4388        use std::iter::Iterator;
4389        self.roles = v.into_iter().map(|i| i.into()).collect();
4390        self
4391    }
4392
4393    /// Sets the value of [labels][crate::model::NodeGroup::labels].
4394    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4395    where
4396        T: std::iter::IntoIterator<Item = (K, V)>,
4397        K: std::convert::Into<std::string::String>,
4398        V: std::convert::Into<std::string::String>,
4399    {
4400        use std::iter::Iterator;
4401        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4402        self
4403    }
4404}
4405
4406impl wkt::message::Message for NodeGroup {
4407    fn typename() -> &'static str {
4408        "type.googleapis.com/google.cloud.dataproc.v1.NodeGroup"
4409    }
4410}
4411
4412/// Defines additional types related to [NodeGroup].
4413pub mod node_group {
4414    #[allow(unused_imports)]
4415    use super::*;
4416
4417    /// Node pool roles.
4418    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4419    pub struct Role(i32);
4420
4421    impl Role {
4422        /// Required unspecified role.
4423        pub const ROLE_UNSPECIFIED: Role = Role::new(0);
4424
4425        /// Job drivers run on the node pool.
4426        pub const DRIVER: Role = Role::new(1);
4427
4428        /// Creates a new Role instance.
4429        pub(crate) const fn new(value: i32) -> Self {
4430            Self(value)
4431        }
4432
4433        /// Gets the enum value.
4434        pub fn value(&self) -> i32 {
4435            self.0
4436        }
4437
4438        /// Gets the enum value as a string.
4439        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4440            match self.0 {
4441                0 => std::borrow::Cow::Borrowed("ROLE_UNSPECIFIED"),
4442                1 => std::borrow::Cow::Borrowed("DRIVER"),
4443                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4444            }
4445        }
4446
4447        /// Creates an enum value from the value name.
4448        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4449            match name {
4450                "ROLE_UNSPECIFIED" => std::option::Option::Some(Self::ROLE_UNSPECIFIED),
4451                "DRIVER" => std::option::Option::Some(Self::DRIVER),
4452                _ => std::option::Option::None,
4453            }
4454        }
4455    }
4456
4457    impl std::convert::From<i32> for Role {
4458        fn from(value: i32) -> Self {
4459            Self::new(value)
4460        }
4461    }
4462
4463    impl std::default::Default for Role {
4464        fn default() -> Self {
4465            Self::new(0)
4466        }
4467    }
4468}
4469
4470/// Specifies an executable to run on a fully configured node and a
4471/// timeout period for executable completion.
4472#[serde_with::serde_as]
4473#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4474#[serde(default, rename_all = "camelCase")]
4475#[non_exhaustive]
4476pub struct NodeInitializationAction {
4477    /// Required. Cloud Storage URI of executable file.
4478    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4479    pub executable_file: std::string::String,
4480
4481    /// Optional. Amount of time executable has to complete. Default is
4482    /// 10 minutes (see JSON representation of
4483    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
4484    ///
4485    /// Cluster creation fails with an explanatory error message (the
4486    /// name of the executable that caused the error and the exceeded timeout
4487    /// period) if the executable is not completed at end of the timeout period.
4488    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4489    pub execution_timeout: std::option::Option<wkt::Duration>,
4490
4491    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4492    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4493}
4494
4495impl NodeInitializationAction {
4496    pub fn new() -> Self {
4497        std::default::Default::default()
4498    }
4499
4500    /// Sets the value of [executable_file][crate::model::NodeInitializationAction::executable_file].
4501    pub fn set_executable_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4502        self.executable_file = v.into();
4503        self
4504    }
4505
4506    /// Sets the value of [execution_timeout][crate::model::NodeInitializationAction::execution_timeout].
4507    pub fn set_execution_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
4508        mut self,
4509        v: T,
4510    ) -> Self {
4511        self.execution_timeout = v.into();
4512        self
4513    }
4514}
4515
4516impl wkt::message::Message for NodeInitializationAction {
4517    fn typename() -> &'static str {
4518        "type.googleapis.com/google.cloud.dataproc.v1.NodeInitializationAction"
4519    }
4520}
4521
4522/// The status of a cluster and its instances.
4523#[serde_with::serde_as]
4524#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4525#[serde(default, rename_all = "camelCase")]
4526#[non_exhaustive]
4527pub struct ClusterStatus {
4528    /// Output only. The cluster's state.
4529    pub state: crate::model::cluster_status::State,
4530
4531    /// Optional. Output only. Details of cluster's state.
4532    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4533    pub detail: std::string::String,
4534
4535    /// Output only. Time when this state was entered (see JSON representation of
4536    /// [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)).
4537    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4538    pub state_start_time: std::option::Option<wkt::Timestamp>,
4539
4540    /// Output only. Additional state information that includes
4541    /// status reported by the agent.
4542    pub substate: crate::model::cluster_status::Substate,
4543
4544    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4545    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4546}
4547
4548impl ClusterStatus {
4549    pub fn new() -> Self {
4550        std::default::Default::default()
4551    }
4552
4553    /// Sets the value of [state][crate::model::ClusterStatus::state].
4554    pub fn set_state<T: std::convert::Into<crate::model::cluster_status::State>>(
4555        mut self,
4556        v: T,
4557    ) -> Self {
4558        self.state = v.into();
4559        self
4560    }
4561
4562    /// Sets the value of [detail][crate::model::ClusterStatus::detail].
4563    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4564        self.detail = v.into();
4565        self
4566    }
4567
4568    /// Sets the value of [state_start_time][crate::model::ClusterStatus::state_start_time].
4569    pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4570        mut self,
4571        v: T,
4572    ) -> Self {
4573        self.state_start_time = v.into();
4574        self
4575    }
4576
4577    /// Sets the value of [substate][crate::model::ClusterStatus::substate].
4578    pub fn set_substate<T: std::convert::Into<crate::model::cluster_status::Substate>>(
4579        mut self,
4580        v: T,
4581    ) -> Self {
4582        self.substate = v.into();
4583        self
4584    }
4585}
4586
4587impl wkt::message::Message for ClusterStatus {
4588    fn typename() -> &'static str {
4589        "type.googleapis.com/google.cloud.dataproc.v1.ClusterStatus"
4590    }
4591}
4592
4593/// Defines additional types related to [ClusterStatus].
4594pub mod cluster_status {
4595    #[allow(unused_imports)]
4596    use super::*;
4597
4598    /// The cluster state.
4599    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4600    pub struct State(i32);
4601
4602    impl State {
4603        /// The cluster state is unknown.
4604        pub const UNKNOWN: State = State::new(0);
4605
4606        /// The cluster is being created and set up. It is not ready for use.
4607        pub const CREATING: State = State::new(1);
4608
4609        /// The cluster is currently running and healthy. It is ready for use.
4610        ///
4611        /// **Note:** The cluster state changes from "creating" to "running" status
4612        /// after the master node(s), first two primary worker nodes (and the last
4613        /// primary worker node if primary workers > 2) are running.
4614        pub const RUNNING: State = State::new(2);
4615
4616        /// The cluster encountered an error. It is not ready for use.
4617        pub const ERROR: State = State::new(3);
4618
4619        /// The cluster has encountered an error while being updated. Jobs can
4620        /// be submitted to the cluster, but the cluster cannot be updated.
4621        pub const ERROR_DUE_TO_UPDATE: State = State::new(9);
4622
4623        /// The cluster is being deleted. It cannot be used.
4624        pub const DELETING: State = State::new(4);
4625
4626        /// The cluster is being updated. It continues to accept and process jobs.
4627        pub const UPDATING: State = State::new(5);
4628
4629        /// The cluster is being stopped. It cannot be used.
4630        pub const STOPPING: State = State::new(6);
4631
4632        /// The cluster is currently stopped. It is not ready for use.
4633        pub const STOPPED: State = State::new(7);
4634
4635        /// The cluster is being started. It is not ready for use.
4636        pub const STARTING: State = State::new(8);
4637
4638        /// The cluster is being repaired. It is not ready for use.
4639        pub const REPAIRING: State = State::new(10);
4640
4641        /// Creates a new State instance.
4642        pub(crate) const fn new(value: i32) -> Self {
4643            Self(value)
4644        }
4645
4646        /// Gets the enum value.
4647        pub fn value(&self) -> i32 {
4648            self.0
4649        }
4650
4651        /// Gets the enum value as a string.
4652        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4653            match self.0 {
4654                0 => std::borrow::Cow::Borrowed("UNKNOWN"),
4655                1 => std::borrow::Cow::Borrowed("CREATING"),
4656                2 => std::borrow::Cow::Borrowed("RUNNING"),
4657                3 => std::borrow::Cow::Borrowed("ERROR"),
4658                4 => std::borrow::Cow::Borrowed("DELETING"),
4659                5 => std::borrow::Cow::Borrowed("UPDATING"),
4660                6 => std::borrow::Cow::Borrowed("STOPPING"),
4661                7 => std::borrow::Cow::Borrowed("STOPPED"),
4662                8 => std::borrow::Cow::Borrowed("STARTING"),
4663                9 => std::borrow::Cow::Borrowed("ERROR_DUE_TO_UPDATE"),
4664                10 => std::borrow::Cow::Borrowed("REPAIRING"),
4665                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4666            }
4667        }
4668
4669        /// Creates an enum value from the value name.
4670        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4671            match name {
4672                "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
4673                "CREATING" => std::option::Option::Some(Self::CREATING),
4674                "RUNNING" => std::option::Option::Some(Self::RUNNING),
4675                "ERROR" => std::option::Option::Some(Self::ERROR),
4676                "ERROR_DUE_TO_UPDATE" => std::option::Option::Some(Self::ERROR_DUE_TO_UPDATE),
4677                "DELETING" => std::option::Option::Some(Self::DELETING),
4678                "UPDATING" => std::option::Option::Some(Self::UPDATING),
4679                "STOPPING" => std::option::Option::Some(Self::STOPPING),
4680                "STOPPED" => std::option::Option::Some(Self::STOPPED),
4681                "STARTING" => std::option::Option::Some(Self::STARTING),
4682                "REPAIRING" => std::option::Option::Some(Self::REPAIRING),
4683                _ => std::option::Option::None,
4684            }
4685        }
4686    }
4687
4688    impl std::convert::From<i32> for State {
4689        fn from(value: i32) -> Self {
4690            Self::new(value)
4691        }
4692    }
4693
4694    impl std::default::Default for State {
4695        fn default() -> Self {
4696            Self::new(0)
4697        }
4698    }
4699
4700    /// The cluster substate.
4701    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4702    pub struct Substate(i32);
4703
4704    impl Substate {
4705        /// The cluster substate is unknown.
4706        pub const UNSPECIFIED: Substate = Substate::new(0);
4707
4708        /// The cluster is known to be in an unhealthy state
4709        /// (for example, critical daemons are not running or HDFS capacity is
4710        /// exhausted).
4711        ///
4712        /// Applies to RUNNING state.
4713        pub const UNHEALTHY: Substate = Substate::new(1);
4714
4715        /// The agent-reported status is out of date (may occur if
4716        /// Dataproc loses communication with Agent).
4717        ///
4718        /// Applies to RUNNING state.
4719        pub const STALE_STATUS: Substate = Substate::new(2);
4720
4721        /// Creates a new Substate instance.
4722        pub(crate) const fn new(value: i32) -> Self {
4723            Self(value)
4724        }
4725
4726        /// Gets the enum value.
4727        pub fn value(&self) -> i32 {
4728            self.0
4729        }
4730
4731        /// Gets the enum value as a string.
4732        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4733            match self.0 {
4734                0 => std::borrow::Cow::Borrowed("UNSPECIFIED"),
4735                1 => std::borrow::Cow::Borrowed("UNHEALTHY"),
4736                2 => std::borrow::Cow::Borrowed("STALE_STATUS"),
4737                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4738            }
4739        }
4740
4741        /// Creates an enum value from the value name.
4742        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4743            match name {
4744                "UNSPECIFIED" => std::option::Option::Some(Self::UNSPECIFIED),
4745                "UNHEALTHY" => std::option::Option::Some(Self::UNHEALTHY),
4746                "STALE_STATUS" => std::option::Option::Some(Self::STALE_STATUS),
4747                _ => std::option::Option::None,
4748            }
4749        }
4750    }
4751
4752    impl std::convert::From<i32> for Substate {
4753        fn from(value: i32) -> Self {
4754            Self::new(value)
4755        }
4756    }
4757
4758    impl std::default::Default for Substate {
4759        fn default() -> Self {
4760            Self::new(0)
4761        }
4762    }
4763}
4764
4765/// Security related configuration, including encryption, Kerberos, etc.
4766#[serde_with::serde_as]
4767#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4768#[serde(default, rename_all = "camelCase")]
4769#[non_exhaustive]
4770pub struct SecurityConfig {
4771    /// Optional. Kerberos related configuration.
4772    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4773    pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,
4774
4775    /// Optional. Identity related configuration, including service account based
4776    /// secure multi-tenancy user mappings.
4777    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4778    pub identity_config: std::option::Option<crate::model::IdentityConfig>,
4779
4780    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4781    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4782}
4783
4784impl SecurityConfig {
4785    pub fn new() -> Self {
4786        std::default::Default::default()
4787    }
4788
4789    /// Sets the value of [kerberos_config][crate::model::SecurityConfig::kerberos_config].
4790    pub fn set_kerberos_config<
4791        T: std::convert::Into<std::option::Option<crate::model::KerberosConfig>>,
4792    >(
4793        mut self,
4794        v: T,
4795    ) -> Self {
4796        self.kerberos_config = v.into();
4797        self
4798    }
4799
4800    /// Sets the value of [identity_config][crate::model::SecurityConfig::identity_config].
4801    pub fn set_identity_config<
4802        T: std::convert::Into<std::option::Option<crate::model::IdentityConfig>>,
4803    >(
4804        mut self,
4805        v: T,
4806    ) -> Self {
4807        self.identity_config = v.into();
4808        self
4809    }
4810}
4811
4812impl wkt::message::Message for SecurityConfig {
4813    fn typename() -> &'static str {
4814        "type.googleapis.com/google.cloud.dataproc.v1.SecurityConfig"
4815    }
4816}
4817
4818/// Specifies Kerberos related configuration.
4819#[serde_with::serde_as]
4820#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4821#[serde(default, rename_all = "camelCase")]
4822#[non_exhaustive]
4823pub struct KerberosConfig {
4824    /// Optional. Flag to indicate whether to Kerberize the cluster (default:
4825    /// false). Set this field to true to enable Kerberos on a cluster.
4826    pub enable_kerberos: bool,
4827
4828    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the root
4829    /// principal password.
4830    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4831    pub root_principal_password_uri: std::string::String,
4832
4833    /// Optional. The URI of the KMS key used to encrypt sensitive
4834    /// files.
4835    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4836    pub kms_key_uri: std::string::String,
4837
4838    /// Optional. The Cloud Storage URI of the keystore file used for SSL
4839    /// encryption. If not provided, Dataproc will provide a self-signed
4840    /// certificate.
4841    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4842    pub keystore_uri: std::string::String,
4843
4844    /// Optional. The Cloud Storage URI of the truststore file used for SSL
4845    /// encryption. If not provided, Dataproc will provide a self-signed
4846    /// certificate.
4847    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4848    pub truststore_uri: std::string::String,
4849
4850    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
4851    /// password to the user provided keystore. For the self-signed certificate,
4852    /// this password is generated by Dataproc.
4853    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4854    pub keystore_password_uri: std::string::String,
4855
4856    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
4857    /// password to the user provided key. For the self-signed certificate, this
4858    /// password is generated by Dataproc.
4859    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4860    pub key_password_uri: std::string::String,
4861
4862    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
4863    /// password to the user provided truststore. For the self-signed certificate,
4864    /// this password is generated by Dataproc.
4865    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4866    pub truststore_password_uri: std::string::String,
4867
4868    /// Optional. The remote realm the Dataproc on-cluster KDC will trust, should
4869    /// the user enable cross realm trust.
4870    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4871    pub cross_realm_trust_realm: std::string::String,
4872
4873    /// Optional. The KDC (IP or hostname) for the remote trusted realm in a cross
4874    /// realm trust relationship.
4875    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4876    pub cross_realm_trust_kdc: std::string::String,
4877
4878    /// Optional. The admin server (IP or hostname) for the remote trusted realm in
4879    /// a cross realm trust relationship.
4880    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4881    pub cross_realm_trust_admin_server: std::string::String,
4882
4883    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
4884    /// shared password between the on-cluster Kerberos realm and the remote
4885    /// trusted realm, in a cross realm trust relationship.
4886    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4887    pub cross_realm_trust_shared_password_uri: std::string::String,
4888
4889    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
4890    /// master key of the KDC database.
4891    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4892    pub kdc_db_key_uri: std::string::String,
4893
4894    /// Optional. The lifetime of the ticket granting ticket, in hours.
4895    /// If not specified, or user specifies 0, then default value 10
4896    /// will be used.
4897    pub tgt_lifetime_hours: i32,
4898
4899    /// Optional. The name of the on-cluster Kerberos realm.
4900    /// If not specified, the uppercased domain of hostnames will be the realm.
4901    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4902    pub realm: std::string::String,
4903
4904    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4905    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4906}
4907
4908impl KerberosConfig {
4909    pub fn new() -> Self {
4910        std::default::Default::default()
4911    }
4912
4913    /// Sets the value of [enable_kerberos][crate::model::KerberosConfig::enable_kerberos].
4914    pub fn set_enable_kerberos<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4915        self.enable_kerberos = v.into();
4916        self
4917    }
4918
4919    /// Sets the value of [root_principal_password_uri][crate::model::KerberosConfig::root_principal_password_uri].
4920    pub fn set_root_principal_password_uri<T: std::convert::Into<std::string::String>>(
4921        mut self,
4922        v: T,
4923    ) -> Self {
4924        self.root_principal_password_uri = v.into();
4925        self
4926    }
4927
4928    /// Sets the value of [kms_key_uri][crate::model::KerberosConfig::kms_key_uri].
4929    pub fn set_kms_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4930        self.kms_key_uri = v.into();
4931        self
4932    }
4933
4934    /// Sets the value of [keystore_uri][crate::model::KerberosConfig::keystore_uri].
4935    pub fn set_keystore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4936        self.keystore_uri = v.into();
4937        self
4938    }
4939
4940    /// Sets the value of [truststore_uri][crate::model::KerberosConfig::truststore_uri].
4941    pub fn set_truststore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4942        self.truststore_uri = v.into();
4943        self
4944    }
4945
4946    /// Sets the value of [keystore_password_uri][crate::model::KerberosConfig::keystore_password_uri].
4947    pub fn set_keystore_password_uri<T: std::convert::Into<std::string::String>>(
4948        mut self,
4949        v: T,
4950    ) -> Self {
4951        self.keystore_password_uri = v.into();
4952        self
4953    }
4954
4955    /// Sets the value of [key_password_uri][crate::model::KerberosConfig::key_password_uri].
4956    pub fn set_key_password_uri<T: std::convert::Into<std::string::String>>(
4957        mut self,
4958        v: T,
4959    ) -> Self {
4960        self.key_password_uri = v.into();
4961        self
4962    }
4963
4964    /// Sets the value of [truststore_password_uri][crate::model::KerberosConfig::truststore_password_uri].
4965    pub fn set_truststore_password_uri<T: std::convert::Into<std::string::String>>(
4966        mut self,
4967        v: T,
4968    ) -> Self {
4969        self.truststore_password_uri = v.into();
4970        self
4971    }
4972
4973    /// Sets the value of [cross_realm_trust_realm][crate::model::KerberosConfig::cross_realm_trust_realm].
4974    pub fn set_cross_realm_trust_realm<T: std::convert::Into<std::string::String>>(
4975        mut self,
4976        v: T,
4977    ) -> Self {
4978        self.cross_realm_trust_realm = v.into();
4979        self
4980    }
4981
4982    /// Sets the value of [cross_realm_trust_kdc][crate::model::KerberosConfig::cross_realm_trust_kdc].
4983    pub fn set_cross_realm_trust_kdc<T: std::convert::Into<std::string::String>>(
4984        mut self,
4985        v: T,
4986    ) -> Self {
4987        self.cross_realm_trust_kdc = v.into();
4988        self
4989    }
4990
4991    /// Sets the value of [cross_realm_trust_admin_server][crate::model::KerberosConfig::cross_realm_trust_admin_server].
4992    pub fn set_cross_realm_trust_admin_server<T: std::convert::Into<std::string::String>>(
4993        mut self,
4994        v: T,
4995    ) -> Self {
4996        self.cross_realm_trust_admin_server = v.into();
4997        self
4998    }
4999
5000    /// Sets the value of [cross_realm_trust_shared_password_uri][crate::model::KerberosConfig::cross_realm_trust_shared_password_uri].
5001    pub fn set_cross_realm_trust_shared_password_uri<T: std::convert::Into<std::string::String>>(
5002        mut self,
5003        v: T,
5004    ) -> Self {
5005        self.cross_realm_trust_shared_password_uri = v.into();
5006        self
5007    }
5008
5009    /// Sets the value of [kdc_db_key_uri][crate::model::KerberosConfig::kdc_db_key_uri].
5010    pub fn set_kdc_db_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5011        self.kdc_db_key_uri = v.into();
5012        self
5013    }
5014
5015    /// Sets the value of [tgt_lifetime_hours][crate::model::KerberosConfig::tgt_lifetime_hours].
5016    pub fn set_tgt_lifetime_hours<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5017        self.tgt_lifetime_hours = v.into();
5018        self
5019    }
5020
5021    /// Sets the value of [realm][crate::model::KerberosConfig::realm].
5022    pub fn set_realm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5023        self.realm = v.into();
5024        self
5025    }
5026}
5027
5028impl wkt::message::Message for KerberosConfig {
5029    fn typename() -> &'static str {
5030        "type.googleapis.com/google.cloud.dataproc.v1.KerberosConfig"
5031    }
5032}
5033
5034/// Identity related configuration, including service account based
5035/// secure multi-tenancy user mappings.
5036#[serde_with::serde_as]
5037#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5038#[serde(default, rename_all = "camelCase")]
5039#[non_exhaustive]
5040pub struct IdentityConfig {
5041    /// Required. Map of user to service account.
5042    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5043    pub user_service_account_mapping:
5044        std::collections::HashMap<std::string::String, std::string::String>,
5045
5046    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5047    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5048}
5049
5050impl IdentityConfig {
5051    pub fn new() -> Self {
5052        std::default::Default::default()
5053    }
5054
5055    /// Sets the value of [user_service_account_mapping][crate::model::IdentityConfig::user_service_account_mapping].
5056    pub fn set_user_service_account_mapping<T, K, V>(mut self, v: T) -> Self
5057    where
5058        T: std::iter::IntoIterator<Item = (K, V)>,
5059        K: std::convert::Into<std::string::String>,
5060        V: std::convert::Into<std::string::String>,
5061    {
5062        use std::iter::Iterator;
5063        self.user_service_account_mapping =
5064            v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5065        self
5066    }
5067}
5068
5069impl wkt::message::Message for IdentityConfig {
5070    fn typename() -> &'static str {
5071        "type.googleapis.com/google.cloud.dataproc.v1.IdentityConfig"
5072    }
5073}
5074
5075/// Specifies the selection and config of software inside the cluster.
5076#[serde_with::serde_as]
5077#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5078#[serde(default, rename_all = "camelCase")]
5079#[non_exhaustive]
5080pub struct SoftwareConfig {
5081    /// Optional. The version of software inside the cluster. It must be one of the
5082    /// supported [Dataproc
5083    /// Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported-dataproc-image-versions),
5084    /// such as "1.2" (including a subminor version, such as "1.2.29"), or the
5085    /// ["preview"
5086    /// version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions).
5087    /// If unspecified, it defaults to the latest Debian version.
5088    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5089    pub image_version: std::string::String,
5090
5091    /// Optional. The properties to set on daemon config files.
5092    ///
5093    /// Property keys are specified in `prefix:property` format, for example
5094    /// `core:hadoop.tmp.dir`. The following are supported prefixes
5095    /// and their mappings:
5096    ///
5097    /// * capacity-scheduler: `capacity-scheduler.xml`
5098    /// * core:   `core-site.xml`
5099    /// * distcp: `distcp-default.xml`
5100    /// * hdfs:   `hdfs-site.xml`
5101    /// * hive:   `hive-site.xml`
5102    /// * mapred: `mapred-site.xml`
5103    /// * pig:    `pig.properties`
5104    /// * spark:  `spark-defaults.conf`
5105    /// * yarn:   `yarn-site.xml`
5106    ///
5107    /// For more information, see [Cluster
5108    /// properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
5109    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5110    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
5111
5112    /// Optional. The set of components to activate on the cluster.
5113    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5114    pub optional_components: std::vec::Vec<crate::model::Component>,
5115
5116    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5117    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5118}
5119
5120impl SoftwareConfig {
5121    pub fn new() -> Self {
5122        std::default::Default::default()
5123    }
5124
5125    /// Sets the value of [image_version][crate::model::SoftwareConfig::image_version].
5126    pub fn set_image_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5127        self.image_version = v.into();
5128        self
5129    }
5130
5131    /// Sets the value of [optional_components][crate::model::SoftwareConfig::optional_components].
5132    pub fn set_optional_components<T, V>(mut self, v: T) -> Self
5133    where
5134        T: std::iter::IntoIterator<Item = V>,
5135        V: std::convert::Into<crate::model::Component>,
5136    {
5137        use std::iter::Iterator;
5138        self.optional_components = v.into_iter().map(|i| i.into()).collect();
5139        self
5140    }
5141
5142    /// Sets the value of [properties][crate::model::SoftwareConfig::properties].
5143    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
5144    where
5145        T: std::iter::IntoIterator<Item = (K, V)>,
5146        K: std::convert::Into<std::string::String>,
5147        V: std::convert::Into<std::string::String>,
5148    {
5149        use std::iter::Iterator;
5150        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5151        self
5152    }
5153}
5154
5155impl wkt::message::Message for SoftwareConfig {
5156    fn typename() -> &'static str {
5157        "type.googleapis.com/google.cloud.dataproc.v1.SoftwareConfig"
5158    }
5159}
5160
5161/// Specifies the cluster auto-delete schedule configuration.
5162#[serde_with::serde_as]
5163#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5164#[serde(default, rename_all = "camelCase")]
5165#[non_exhaustive]
5166pub struct LifecycleConfig {
5167    /// Optional. The duration to keep the cluster alive while idling (when no jobs
5168    /// are running). Passing this threshold will cause the cluster to be
5169    /// deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON
5170    /// representation of
5171    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5172    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5173    pub idle_delete_ttl: std::option::Option<wkt::Duration>,
5174
5175    /// Output only. The time when cluster became idle (most recent job finished)
5176    /// and became eligible for deletion due to idleness (see JSON representation
5177    /// of
5178    /// [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5179    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5180    pub idle_start_time: std::option::Option<wkt::Timestamp>,
5181
5182    /// Either the exact time the cluster should be deleted at or
5183    /// the cluster maximum age.
5184    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
5185    pub ttl: std::option::Option<crate::model::lifecycle_config::Ttl>,
5186
5187    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5188    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5189}
5190
5191impl LifecycleConfig {
5192    pub fn new() -> Self {
5193        std::default::Default::default()
5194    }
5195
5196    /// Sets the value of [idle_delete_ttl][crate::model::LifecycleConfig::idle_delete_ttl].
5197    pub fn set_idle_delete_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
5198        mut self,
5199        v: T,
5200    ) -> Self {
5201        self.idle_delete_ttl = v.into();
5202        self
5203    }
5204
5205    /// Sets the value of [idle_start_time][crate::model::LifecycleConfig::idle_start_time].
5206    pub fn set_idle_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5207        mut self,
5208        v: T,
5209    ) -> Self {
5210        self.idle_start_time = v.into();
5211        self
5212    }
5213
5214    /// Sets the value of [ttl][crate::model::LifecycleConfig::ttl].
5215    ///
5216    /// Note that all the setters affecting `ttl` are mutually
5217    /// exclusive.
5218    pub fn set_ttl<
5219        T: std::convert::Into<std::option::Option<crate::model::lifecycle_config::Ttl>>,
5220    >(
5221        mut self,
5222        v: T,
5223    ) -> Self {
5224        self.ttl = v.into();
5225        self
5226    }
5227
5228    /// The value of [ttl][crate::model::LifecycleConfig::ttl]
5229    /// if it holds a `AutoDeleteTime`, `None` if the field is not set or
5230    /// holds a different branch.
5231    pub fn auto_delete_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
5232        #[allow(unreachable_patterns)]
5233        self.ttl.as_ref().and_then(|v| match v {
5234            crate::model::lifecycle_config::Ttl::AutoDeleteTime(v) => std::option::Option::Some(v),
5235            _ => std::option::Option::None,
5236        })
5237    }
5238
5239    /// The value of [ttl][crate::model::LifecycleConfig::ttl]
5240    /// if it holds a `AutoDeleteTtl`, `None` if the field is not set or
5241    /// holds a different branch.
5242    pub fn auto_delete_ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
5243        #[allow(unreachable_patterns)]
5244        self.ttl.as_ref().and_then(|v| match v {
5245            crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v) => std::option::Option::Some(v),
5246            _ => std::option::Option::None,
5247        })
5248    }
5249
5250    /// Sets the value of [ttl][crate::model::LifecycleConfig::ttl]
5251    /// to hold a `AutoDeleteTime`.
5252    ///
5253    /// Note that all the setters affecting `ttl` are
5254    /// mutually exclusive.
5255    pub fn set_auto_delete_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
5256        mut self,
5257        v: T,
5258    ) -> Self {
5259        self.ttl = std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTime(
5260            v.into(),
5261        ));
5262        self
5263    }
5264
5265    /// Sets the value of [ttl][crate::model::LifecycleConfig::ttl]
5266    /// to hold a `AutoDeleteTtl`.
5267    ///
5268    /// Note that all the setters affecting `ttl` are
5269    /// mutually exclusive.
5270    pub fn set_auto_delete_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
5271        mut self,
5272        v: T,
5273    ) -> Self {
5274        self.ttl =
5275            std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v.into()));
5276        self
5277    }
5278}
5279
5280impl wkt::message::Message for LifecycleConfig {
5281    fn typename() -> &'static str {
5282        "type.googleapis.com/google.cloud.dataproc.v1.LifecycleConfig"
5283    }
5284}
5285
5286/// Defines additional types related to [LifecycleConfig].
5287pub mod lifecycle_config {
5288    #[allow(unused_imports)]
5289    use super::*;
5290
5291    /// Either the exact time the cluster should be deleted at or
5292    /// the cluster maximum age.
5293    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5294    #[serde(rename_all = "camelCase")]
5295    #[non_exhaustive]
5296    pub enum Ttl {
5297        /// Optional. The time when cluster will be auto-deleted (see JSON
5298        /// representation of
5299        /// [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5300        AutoDeleteTime(std::boxed::Box<wkt::Timestamp>),
5301        /// Optional. The lifetime duration of cluster. The cluster will be
5302        /// auto-deleted at the end of this period. Minimum value is 10 minutes;
5303        /// maximum value is 14 days (see JSON representation of
5304        /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5305        AutoDeleteTtl(std::boxed::Box<wkt::Duration>),
5306    }
5307}
5308
5309/// Specifies a Metastore configuration.
5310#[serde_with::serde_as]
5311#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5312#[serde(default, rename_all = "camelCase")]
5313#[non_exhaustive]
5314pub struct MetastoreConfig {
5315    /// Required. Resource name of an existing Dataproc Metastore service.
5316    ///
5317    /// Example:
5318    ///
5319    /// * `projects/[project_id]/locations/[dataproc_region]/services/[service-name]`
5320    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5321    pub dataproc_metastore_service: std::string::String,
5322
5323    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5324    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5325}
5326
5327impl MetastoreConfig {
5328    pub fn new() -> Self {
5329        std::default::Default::default()
5330    }
5331
5332    /// Sets the value of [dataproc_metastore_service][crate::model::MetastoreConfig::dataproc_metastore_service].
5333    pub fn set_dataproc_metastore_service<T: std::convert::Into<std::string::String>>(
5334        mut self,
5335        v: T,
5336    ) -> Self {
5337        self.dataproc_metastore_service = v.into();
5338        self
5339    }
5340}
5341
5342impl wkt::message::Message for MetastoreConfig {
5343    fn typename() -> &'static str {
5344        "type.googleapis.com/google.cloud.dataproc.v1.MetastoreConfig"
5345    }
5346}
5347
5348/// Contains cluster daemon metrics, such as HDFS and YARN stats.
5349///
5350/// **Beta Feature**: This report is available for testing purposes only. It may
5351/// be changed before final release.
5352#[serde_with::serde_as]
5353#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5354#[serde(default, rename_all = "camelCase")]
5355#[non_exhaustive]
5356pub struct ClusterMetrics {
5357    /// The HDFS metrics.
5358    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5359    #[serde_as(as = "std::collections::HashMap<_, serde_with::DisplayFromStr>")]
5360    pub hdfs_metrics: std::collections::HashMap<std::string::String, i64>,
5361
5362    /// YARN metrics.
5363    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5364    #[serde_as(as = "std::collections::HashMap<_, serde_with::DisplayFromStr>")]
5365    pub yarn_metrics: std::collections::HashMap<std::string::String, i64>,
5366
5367    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5368    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5369}
5370
5371impl ClusterMetrics {
5372    pub fn new() -> Self {
5373        std::default::Default::default()
5374    }
5375
5376    /// Sets the value of [hdfs_metrics][crate::model::ClusterMetrics::hdfs_metrics].
5377    pub fn set_hdfs_metrics<T, K, V>(mut self, v: T) -> Self
5378    where
5379        T: std::iter::IntoIterator<Item = (K, V)>,
5380        K: std::convert::Into<std::string::String>,
5381        V: std::convert::Into<i64>,
5382    {
5383        use std::iter::Iterator;
5384        self.hdfs_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5385        self
5386    }
5387
5388    /// Sets the value of [yarn_metrics][crate::model::ClusterMetrics::yarn_metrics].
5389    pub fn set_yarn_metrics<T, K, V>(mut self, v: T) -> Self
5390    where
5391        T: std::iter::IntoIterator<Item = (K, V)>,
5392        K: std::convert::Into<std::string::String>,
5393        V: std::convert::Into<i64>,
5394    {
5395        use std::iter::Iterator;
5396        self.yarn_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5397        self
5398    }
5399}
5400
5401impl wkt::message::Message for ClusterMetrics {
5402    fn typename() -> &'static str {
5403        "type.googleapis.com/google.cloud.dataproc.v1.ClusterMetrics"
5404    }
5405}
5406
5407/// Dataproc metric config.
5408#[serde_with::serde_as]
5409#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5410#[serde(default, rename_all = "camelCase")]
5411#[non_exhaustive]
5412pub struct DataprocMetricConfig {
5413    /// Required. Metrics sources to enable.
5414    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5415    pub metrics: std::vec::Vec<crate::model::dataproc_metric_config::Metric>,
5416
5417    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5418    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5419}
5420
5421impl DataprocMetricConfig {
5422    pub fn new() -> Self {
5423        std::default::Default::default()
5424    }
5425
5426    /// Sets the value of [metrics][crate::model::DataprocMetricConfig::metrics].
5427    pub fn set_metrics<T, V>(mut self, v: T) -> Self
5428    where
5429        T: std::iter::IntoIterator<Item = V>,
5430        V: std::convert::Into<crate::model::dataproc_metric_config::Metric>,
5431    {
5432        use std::iter::Iterator;
5433        self.metrics = v.into_iter().map(|i| i.into()).collect();
5434        self
5435    }
5436}
5437
5438impl wkt::message::Message for DataprocMetricConfig {
5439    fn typename() -> &'static str {
5440        "type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig"
5441    }
5442}
5443
5444/// Defines additional types related to [DataprocMetricConfig].
5445pub mod dataproc_metric_config {
5446    #[allow(unused_imports)]
5447    use super::*;
5448
5449    /// A Dataproc custom metric.
5450    #[serde_with::serde_as]
5451    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5452    #[serde(default, rename_all = "camelCase")]
5453    #[non_exhaustive]
5454    pub struct Metric {
5455        /// Required. A standard set of metrics is collected unless `metricOverrides`
5456        /// are specified for the metric source (see [Custom metrics]
5457        /// (<https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics>)
5458        /// for more information).
5459        pub metric_source: crate::model::dataproc_metric_config::MetricSource,
5460
5461        /// Optional. Specify one or more [Custom metrics]
5462        /// (<https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics>)
5463        /// to collect for the metric course (for the `SPARK` metric source (any
5464        /// [Spark metric]
5465        /// (<https://spark.apache.org/docs/latest/monitoring.html#metrics>) can be
5466        /// specified).
5467        ///
5468        /// Provide metrics in the following format:
5469        /// \<code\>\<var\>METRIC_SOURCE\</var\>:\<var\>INSTANCE\</var\>:\<var\>GROUP\</var\>:\<var\>METRIC\</var\>\</code\>
5470        /// Use camelcase as appropriate.
5471        ///
5472        /// Examples:
5473        ///
5474        /// ```norust
5475        /// yarn:ResourceManager:QueueMetrics:AppsCompleted
5476        /// spark:driver:DAGScheduler:job.allJobs
5477        /// sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed
5478        /// hiveserver2:JVM:Memory:NonHeapMemoryUsage.used
5479        /// ```
5480        ///
5481        /// Notes:
5482        ///
5483        /// * Only the specified overridden metrics are collected for the
5484        ///   metric source. For example, if one or more `spark:executive` metrics
5485        ///   are listed as metric overrides, other `SPARK` metrics are not
5486        ///   collected. The collection of the metrics for other enabled custom
5487        ///   metric sources is unaffected. For example, if both `SPARK` andd `YARN`
5488        ///   metric sources are enabled, and overrides are provided for Spark
5489        ///   metrics only, all YARN metrics are collected.
5490        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5491        pub metric_overrides: std::vec::Vec<std::string::String>,
5492
5493        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5494        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5495    }
5496
5497    impl Metric {
5498        pub fn new() -> Self {
5499            std::default::Default::default()
5500        }
5501
5502        /// Sets the value of [metric_source][crate::model::dataproc_metric_config::Metric::metric_source].
5503        pub fn set_metric_source<
5504            T: std::convert::Into<crate::model::dataproc_metric_config::MetricSource>,
5505        >(
5506            mut self,
5507            v: T,
5508        ) -> Self {
5509            self.metric_source = v.into();
5510            self
5511        }
5512
5513        /// Sets the value of [metric_overrides][crate::model::dataproc_metric_config::Metric::metric_overrides].
5514        pub fn set_metric_overrides<T, V>(mut self, v: T) -> Self
5515        where
5516            T: std::iter::IntoIterator<Item = V>,
5517            V: std::convert::Into<std::string::String>,
5518        {
5519            use std::iter::Iterator;
5520            self.metric_overrides = v.into_iter().map(|i| i.into()).collect();
5521            self
5522        }
5523    }
5524
5525    impl wkt::message::Message for Metric {
5526        fn typename() -> &'static str {
5527            "type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig.Metric"
5528        }
5529    }
5530
5531    /// A source for the collection of Dataproc custom metrics (see [Custom
5532    /// metrics]
5533    /// (<https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics>)).
5534    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5535    pub struct MetricSource(i32);
5536
5537    impl MetricSource {
5538        /// Required unspecified metric source.
5539        pub const METRIC_SOURCE_UNSPECIFIED: MetricSource = MetricSource::new(0);
5540
5541        /// Monitoring agent metrics. If this source is enabled,
5542        /// Dataproc enables the monitoring agent in Compute Engine,
5543        /// and collects monitoring agent metrics, which are published
5544        /// with an `agent.googleapis.com` prefix.
5545        pub const MONITORING_AGENT_DEFAULTS: MetricSource = MetricSource::new(1);
5546
5547        /// HDFS metric source.
5548        pub const HDFS: MetricSource = MetricSource::new(2);
5549
5550        /// Spark metric source.
5551        pub const SPARK: MetricSource = MetricSource::new(3);
5552
5553        /// YARN metric source.
5554        pub const YARN: MetricSource = MetricSource::new(4);
5555
5556        /// Spark History Server metric source.
5557        pub const SPARK_HISTORY_SERVER: MetricSource = MetricSource::new(5);
5558
5559        /// Hiveserver2 metric source.
5560        pub const HIVESERVER2: MetricSource = MetricSource::new(6);
5561
5562        /// hivemetastore metric source
5563        pub const HIVEMETASTORE: MetricSource = MetricSource::new(7);
5564
5565        /// flink metric source
5566        pub const FLINK: MetricSource = MetricSource::new(8);
5567
5568        /// Creates a new MetricSource instance.
5569        pub(crate) const fn new(value: i32) -> Self {
5570            Self(value)
5571        }
5572
5573        /// Gets the enum value.
5574        pub fn value(&self) -> i32 {
5575            self.0
5576        }
5577
5578        /// Gets the enum value as a string.
5579        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5580            match self.0 {
5581                0 => std::borrow::Cow::Borrowed("METRIC_SOURCE_UNSPECIFIED"),
5582                1 => std::borrow::Cow::Borrowed("MONITORING_AGENT_DEFAULTS"),
5583                2 => std::borrow::Cow::Borrowed("HDFS"),
5584                3 => std::borrow::Cow::Borrowed("SPARK"),
5585                4 => std::borrow::Cow::Borrowed("YARN"),
5586                5 => std::borrow::Cow::Borrowed("SPARK_HISTORY_SERVER"),
5587                6 => std::borrow::Cow::Borrowed("HIVESERVER2"),
5588                7 => std::borrow::Cow::Borrowed("HIVEMETASTORE"),
5589                8 => std::borrow::Cow::Borrowed("FLINK"),
5590                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5591            }
5592        }
5593
5594        /// Creates an enum value from the value name.
5595        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5596            match name {
5597                "METRIC_SOURCE_UNSPECIFIED" => {
5598                    std::option::Option::Some(Self::METRIC_SOURCE_UNSPECIFIED)
5599                }
5600                "MONITORING_AGENT_DEFAULTS" => {
5601                    std::option::Option::Some(Self::MONITORING_AGENT_DEFAULTS)
5602                }
5603                "HDFS" => std::option::Option::Some(Self::HDFS),
5604                "SPARK" => std::option::Option::Some(Self::SPARK),
5605                "YARN" => std::option::Option::Some(Self::YARN),
5606                "SPARK_HISTORY_SERVER" => std::option::Option::Some(Self::SPARK_HISTORY_SERVER),
5607                "HIVESERVER2" => std::option::Option::Some(Self::HIVESERVER2),
5608                "HIVEMETASTORE" => std::option::Option::Some(Self::HIVEMETASTORE),
5609                "FLINK" => std::option::Option::Some(Self::FLINK),
5610                _ => std::option::Option::None,
5611            }
5612        }
5613    }
5614
5615    impl std::convert::From<i32> for MetricSource {
5616        fn from(value: i32) -> Self {
5617            Self::new(value)
5618        }
5619    }
5620
5621    impl std::default::Default for MetricSource {
5622        fn default() -> Self {
5623            Self::new(0)
5624        }
5625    }
5626}
5627
5628/// A request to create a cluster.
5629#[serde_with::serde_as]
5630#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5631#[serde(default, rename_all = "camelCase")]
5632#[non_exhaustive]
5633pub struct CreateClusterRequest {
5634    /// Required. The ID of the Google Cloud Platform project that the cluster
5635    /// belongs to.
5636    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5637    pub project_id: std::string::String,
5638
5639    /// Required. The Dataproc region in which to handle the request.
5640    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5641    pub region: std::string::String,
5642
5643    /// Required. The cluster to create.
5644    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5645    pub cluster: std::option::Option<crate::model::Cluster>,
5646
5647    /// Optional. A unique ID used to identify the request. If the server receives
5648    /// two
5649    /// [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s
5650    /// with the same id, then the second request will be ignored and the
5651    /// first [google.longrunning.Operation][google.longrunning.Operation] created
5652    /// and stored in the backend is returned.
5653    ///
5654    /// It is recommended to always set this value to a
5655    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
5656    ///
5657    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
5658    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
5659    ///
5660    /// [google.longrunning.Operation]: longrunning::model::Operation
5661    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5662    pub request_id: std::string::String,
5663
5664    /// Optional. Failure action when primary worker creation fails.
5665    pub action_on_failed_primary_workers: crate::model::FailureAction,
5666
5667    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5668    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5669}
5670
5671impl CreateClusterRequest {
5672    pub fn new() -> Self {
5673        std::default::Default::default()
5674    }
5675
5676    /// Sets the value of [project_id][crate::model::CreateClusterRequest::project_id].
5677    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678        self.project_id = v.into();
5679        self
5680    }
5681
5682    /// Sets the value of [region][crate::model::CreateClusterRequest::region].
5683    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5684        self.region = v.into();
5685        self
5686    }
5687
5688    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
5689    pub fn set_cluster<T: std::convert::Into<std::option::Option<crate::model::Cluster>>>(
5690        mut self,
5691        v: T,
5692    ) -> Self {
5693        self.cluster = v.into();
5694        self
5695    }
5696
5697    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
5698    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5699        self.request_id = v.into();
5700        self
5701    }
5702
5703    /// Sets the value of [action_on_failed_primary_workers][crate::model::CreateClusterRequest::action_on_failed_primary_workers].
5704    pub fn set_action_on_failed_primary_workers<
5705        T: std::convert::Into<crate::model::FailureAction>,
5706    >(
5707        mut self,
5708        v: T,
5709    ) -> Self {
5710        self.action_on_failed_primary_workers = v.into();
5711        self
5712    }
5713}
5714
5715impl wkt::message::Message for CreateClusterRequest {
5716    fn typename() -> &'static str {
5717        "type.googleapis.com/google.cloud.dataproc.v1.CreateClusterRequest"
5718    }
5719}
5720
5721/// A request to update a cluster.
5722#[serde_with::serde_as]
5723#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5724#[serde(default, rename_all = "camelCase")]
5725#[non_exhaustive]
5726pub struct UpdateClusterRequest {
5727    /// Required. The ID of the Google Cloud Platform project the
5728    /// cluster belongs to.
5729    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5730    pub project_id: std::string::String,
5731
5732    /// Required. The Dataproc region in which to handle the request.
5733    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5734    pub region: std::string::String,
5735
5736    /// Required. The cluster name.
5737    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5738    pub cluster_name: std::string::String,
5739
5740    /// Required. The changes to the cluster.
5741    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5742    pub cluster: std::option::Option<crate::model::Cluster>,
5743
5744    /// Optional. Timeout for graceful YARN decommissioning. Graceful
5745    /// decommissioning allows removing nodes from the cluster without
5746    /// interrupting jobs in progress. Timeout specifies how long to wait for jobs
5747    /// in progress to finish before forcefully removing nodes (and potentially
5748    /// interrupting jobs). Default timeout is 0 (for forceful decommission), and
5749    /// the maximum allowed timeout is 1 day. (see JSON representation of
5750    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5751    ///
5752    /// Only supported on Dataproc image versions 1.2 and higher.
5753    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5754    pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
5755
5756    /// Required. Specifies the path, relative to `Cluster`, of
5757    /// the field to update. For example, to change the number of workers
5758    /// in a cluster to 5, the `update_mask` parameter would be
5759    /// specified as `config.worker_config.num_instances`,
5760    /// and the `PATCH` request body would specify the new value, as follows:
5761    ///
5762    /// ```norust
5763    /// {
5764    ///   "config":{
5765    ///     "workerConfig":{
5766    ///       "numInstances":"5"
5767    ///     }
5768    ///   }
5769    /// }
5770    /// ```
5771    ///
5772    /// Similarly, to change the number of preemptible workers in a cluster to 5,
5773    /// the `update_mask` parameter would be
5774    /// `config.secondary_worker_config.num_instances`, and the `PATCH` request
5775    /// body would be set as follows:
5776    ///
5777    /// ```norust
5778    /// {
5779    ///   "config":{
5780    ///     "secondaryWorkerConfig":{
5781    ///       "numInstances":"5"
5782    ///     }
5783    ///   }
5784    /// }
5785    /// ```
5786    ///
5787    /// \<strong\>Note:\</strong\> Currently, only the following fields can be updated:
5788    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5789    pub update_mask: std::option::Option<wkt::FieldMask>,
5790
5791    /// Optional. A unique ID used to identify the request. If the server
5792    /// receives two
5793    /// [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s
5794    /// with the same id, then the second request will be ignored and the
5795    /// first [google.longrunning.Operation][google.longrunning.Operation] created
5796    /// and stored in the backend is returned.
5797    ///
5798    /// It is recommended to always set this value to a
5799    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
5800    ///
5801    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
5802    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
5803    ///
5804    /// [google.longrunning.Operation]: longrunning::model::Operation
5805    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5806    pub request_id: std::string::String,
5807
5808    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5809    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5810}
5811
5812impl UpdateClusterRequest {
5813    pub fn new() -> Self {
5814        std::default::Default::default()
5815    }
5816
5817    /// Sets the value of [project_id][crate::model::UpdateClusterRequest::project_id].
5818    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5819        self.project_id = v.into();
5820        self
5821    }
5822
5823    /// Sets the value of [region][crate::model::UpdateClusterRequest::region].
5824    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5825        self.region = v.into();
5826        self
5827    }
5828
5829    /// Sets the value of [cluster_name][crate::model::UpdateClusterRequest::cluster_name].
5830    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5831        self.cluster_name = v.into();
5832        self
5833    }
5834
5835    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
5836    pub fn set_cluster<T: std::convert::Into<std::option::Option<crate::model::Cluster>>>(
5837        mut self,
5838        v: T,
5839    ) -> Self {
5840        self.cluster = v.into();
5841        self
5842    }
5843
5844    /// Sets the value of [graceful_decommission_timeout][crate::model::UpdateClusterRequest::graceful_decommission_timeout].
5845    pub fn set_graceful_decommission_timeout<
5846        T: std::convert::Into<std::option::Option<wkt::Duration>>,
5847    >(
5848        mut self,
5849        v: T,
5850    ) -> Self {
5851        self.graceful_decommission_timeout = v.into();
5852        self
5853    }
5854
5855    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
5856    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5857        mut self,
5858        v: T,
5859    ) -> Self {
5860        self.update_mask = v.into();
5861        self
5862    }
5863
5864    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
5865    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5866        self.request_id = v.into();
5867        self
5868    }
5869}
5870
5871impl wkt::message::Message for UpdateClusterRequest {
5872    fn typename() -> &'static str {
5873        "type.googleapis.com/google.cloud.dataproc.v1.UpdateClusterRequest"
5874    }
5875}
5876
5877/// A request to stop a cluster.
5878#[serde_with::serde_as]
5879#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5880#[serde(default, rename_all = "camelCase")]
5881#[non_exhaustive]
5882pub struct StopClusterRequest {
5883    /// Required. The ID of the Google Cloud Platform project the
5884    /// cluster belongs to.
5885    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5886    pub project_id: std::string::String,
5887
5888    /// Required. The Dataproc region in which to handle the request.
5889    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5890    pub region: std::string::String,
5891
5892    /// Required. The cluster name.
5893    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5894    pub cluster_name: std::string::String,
5895
5896    /// Optional. Specifying the `cluster_uuid` means the RPC will fail
5897    /// (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
5898    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5899    pub cluster_uuid: std::string::String,
5900
5901    /// Optional. A unique ID used to identify the request. If the server
5902    /// receives two
5903    /// [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s
5904    /// with the same id, then the second request will be ignored and the
5905    /// first [google.longrunning.Operation][google.longrunning.Operation] created
5906    /// and stored in the backend is returned.
5907    ///
5908    /// Recommendation: Set this value to a
5909    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
5910    ///
5911    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
5912    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
5913    ///
5914    /// [google.longrunning.Operation]: longrunning::model::Operation
5915    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5916    pub request_id: std::string::String,
5917
5918    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5919    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5920}
5921
5922impl StopClusterRequest {
5923    pub fn new() -> Self {
5924        std::default::Default::default()
5925    }
5926
5927    /// Sets the value of [project_id][crate::model::StopClusterRequest::project_id].
5928    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5929        self.project_id = v.into();
5930        self
5931    }
5932
5933    /// Sets the value of [region][crate::model::StopClusterRequest::region].
5934    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5935        self.region = v.into();
5936        self
5937    }
5938
5939    /// Sets the value of [cluster_name][crate::model::StopClusterRequest::cluster_name].
5940    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5941        self.cluster_name = v.into();
5942        self
5943    }
5944
5945    /// Sets the value of [cluster_uuid][crate::model::StopClusterRequest::cluster_uuid].
5946    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5947        self.cluster_uuid = v.into();
5948        self
5949    }
5950
5951    /// Sets the value of [request_id][crate::model::StopClusterRequest::request_id].
5952    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5953        self.request_id = v.into();
5954        self
5955    }
5956}
5957
5958impl wkt::message::Message for StopClusterRequest {
5959    fn typename() -> &'static str {
5960        "type.googleapis.com/google.cloud.dataproc.v1.StopClusterRequest"
5961    }
5962}
5963
5964/// A request to start a cluster.
5965#[serde_with::serde_as]
5966#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5967#[serde(default, rename_all = "camelCase")]
5968#[non_exhaustive]
5969pub struct StartClusterRequest {
5970    /// Required. The ID of the Google Cloud Platform project the
5971    /// cluster belongs to.
5972    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5973    pub project_id: std::string::String,
5974
5975    /// Required. The Dataproc region in which to handle the request.
5976    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5977    pub region: std::string::String,
5978
5979    /// Required. The cluster name.
5980    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5981    pub cluster_name: std::string::String,
5982
5983    /// Optional. Specifying the `cluster_uuid` means the RPC will fail
5984    /// (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
5985    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5986    pub cluster_uuid: std::string::String,
5987
5988    /// Optional. A unique ID used to identify the request. If the server
5989    /// receives two
5990    /// [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s
5991    /// with the same id, then the second request will be ignored and the
5992    /// first [google.longrunning.Operation][google.longrunning.Operation] created
5993    /// and stored in the backend is returned.
5994    ///
5995    /// Recommendation: Set this value to a
5996    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
5997    ///
5998    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
5999    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6000    ///
6001    /// [google.longrunning.Operation]: longrunning::model::Operation
6002    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6003    pub request_id: std::string::String,
6004
6005    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6006    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6007}
6008
6009impl StartClusterRequest {
6010    pub fn new() -> Self {
6011        std::default::Default::default()
6012    }
6013
6014    /// Sets the value of [project_id][crate::model::StartClusterRequest::project_id].
6015    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6016        self.project_id = v.into();
6017        self
6018    }
6019
6020    /// Sets the value of [region][crate::model::StartClusterRequest::region].
6021    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6022        self.region = v.into();
6023        self
6024    }
6025
6026    /// Sets the value of [cluster_name][crate::model::StartClusterRequest::cluster_name].
6027    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6028        self.cluster_name = v.into();
6029        self
6030    }
6031
6032    /// Sets the value of [cluster_uuid][crate::model::StartClusterRequest::cluster_uuid].
6033    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6034        self.cluster_uuid = v.into();
6035        self
6036    }
6037
6038    /// Sets the value of [request_id][crate::model::StartClusterRequest::request_id].
6039    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040        self.request_id = v.into();
6041        self
6042    }
6043}
6044
6045impl wkt::message::Message for StartClusterRequest {
6046    fn typename() -> &'static str {
6047        "type.googleapis.com/google.cloud.dataproc.v1.StartClusterRequest"
6048    }
6049}
6050
6051/// A request to delete a cluster.
6052#[serde_with::serde_as]
6053#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6054#[serde(default, rename_all = "camelCase")]
6055#[non_exhaustive]
6056pub struct DeleteClusterRequest {
6057    /// Required. The ID of the Google Cloud Platform project that the cluster
6058    /// belongs to.
6059    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6060    pub project_id: std::string::String,
6061
6062    /// Required. The Dataproc region in which to handle the request.
6063    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6064    pub region: std::string::String,
6065
6066    /// Required. The cluster name.
6067    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6068    pub cluster_name: std::string::String,
6069
6070    /// Optional. Specifying the `cluster_uuid` means the RPC should fail
6071    /// (with error NOT_FOUND) if cluster with specified UUID does not exist.
6072    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6073    pub cluster_uuid: std::string::String,
6074
6075    /// Optional. A unique ID used to identify the request. If the server
6076    /// receives two
6077    /// [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s
6078    /// with the same id, then the second request will be ignored and the
6079    /// first [google.longrunning.Operation][google.longrunning.Operation] created
6080    /// and stored in the backend is returned.
6081    ///
6082    /// It is recommended to always set this value to a
6083    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
6084    ///
6085    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
6086    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6087    ///
6088    /// [google.longrunning.Operation]: longrunning::model::Operation
6089    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6090    pub request_id: std::string::String,
6091
6092    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6093    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6094}
6095
6096impl DeleteClusterRequest {
6097    pub fn new() -> Self {
6098        std::default::Default::default()
6099    }
6100
6101    /// Sets the value of [project_id][crate::model::DeleteClusterRequest::project_id].
6102    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6103        self.project_id = v.into();
6104        self
6105    }
6106
6107    /// Sets the value of [region][crate::model::DeleteClusterRequest::region].
6108    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6109        self.region = v.into();
6110        self
6111    }
6112
6113    /// Sets the value of [cluster_name][crate::model::DeleteClusterRequest::cluster_name].
6114    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6115        self.cluster_name = v.into();
6116        self
6117    }
6118
6119    /// Sets the value of [cluster_uuid][crate::model::DeleteClusterRequest::cluster_uuid].
6120    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6121        self.cluster_uuid = v.into();
6122        self
6123    }
6124
6125    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
6126    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6127        self.request_id = v.into();
6128        self
6129    }
6130}
6131
6132impl wkt::message::Message for DeleteClusterRequest {
6133    fn typename() -> &'static str {
6134        "type.googleapis.com/google.cloud.dataproc.v1.DeleteClusterRequest"
6135    }
6136}
6137
6138/// Request to get the resource representation for a cluster in a project.
6139#[serde_with::serde_as]
6140#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6141#[serde(default, rename_all = "camelCase")]
6142#[non_exhaustive]
6143pub struct GetClusterRequest {
6144    /// Required. The ID of the Google Cloud Platform project that the cluster
6145    /// belongs to.
6146    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6147    pub project_id: std::string::String,
6148
6149    /// Required. The Dataproc region in which to handle the request.
6150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6151    pub region: std::string::String,
6152
6153    /// Required. The cluster name.
6154    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6155    pub cluster_name: std::string::String,
6156
6157    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6158    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6159}
6160
6161impl GetClusterRequest {
6162    pub fn new() -> Self {
6163        std::default::Default::default()
6164    }
6165
6166    /// Sets the value of [project_id][crate::model::GetClusterRequest::project_id].
6167    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6168        self.project_id = v.into();
6169        self
6170    }
6171
6172    /// Sets the value of [region][crate::model::GetClusterRequest::region].
6173    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6174        self.region = v.into();
6175        self
6176    }
6177
6178    /// Sets the value of [cluster_name][crate::model::GetClusterRequest::cluster_name].
6179    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6180        self.cluster_name = v.into();
6181        self
6182    }
6183}
6184
6185impl wkt::message::Message for GetClusterRequest {
6186    fn typename() -> &'static str {
6187        "type.googleapis.com/google.cloud.dataproc.v1.GetClusterRequest"
6188    }
6189}
6190
6191/// A request to list the clusters in a project.
6192#[serde_with::serde_as]
6193#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6194#[serde(default, rename_all = "camelCase")]
6195#[non_exhaustive]
6196pub struct ListClustersRequest {
6197    /// Required. The ID of the Google Cloud Platform project that the cluster
6198    /// belongs to.
6199    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6200    pub project_id: std::string::String,
6201
6202    /// Required. The Dataproc region in which to handle the request.
6203    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6204    pub region: std::string::String,
6205
6206    /// Optional. A filter constraining the clusters to list. Filters are
6207    /// case-sensitive and have the following syntax:
6208    ///
6209    /// field = value [AND [field = value]] ...
6210    ///
6211    /// where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`,
6212    /// and `[KEY]` is a label key. **value** can be `*` to match all values.
6213    /// `status.state` can be one of the following: `ACTIVE`, `INACTIVE`,
6214    /// `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or
6215    /// `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING`
6216    /// states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and
6217    /// `STOPPED` states. `clusterName` is the name of the cluster provided at
6218    /// creation time. Only the logical `AND` operator is supported;
6219    /// space-separated items are treated as having an implicit `AND` operator.
6220    ///
6221    /// Example filter:
6222    ///
6223    /// status.state = ACTIVE AND clusterName = mycluster
6224    /// AND labels.env = staging AND labels.starred = *
6225    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6226    pub filter: std::string::String,
6227
6228    /// Optional. The standard List page size.
6229    pub page_size: i32,
6230
6231    /// Optional. The standard List page token.
6232    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6233    pub page_token: std::string::String,
6234
6235    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6236    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6237}
6238
6239impl ListClustersRequest {
6240    pub fn new() -> Self {
6241        std::default::Default::default()
6242    }
6243
6244    /// Sets the value of [project_id][crate::model::ListClustersRequest::project_id].
6245    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6246        self.project_id = v.into();
6247        self
6248    }
6249
6250    /// Sets the value of [region][crate::model::ListClustersRequest::region].
6251    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6252        self.region = v.into();
6253        self
6254    }
6255
6256    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
6257    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6258        self.filter = v.into();
6259        self
6260    }
6261
6262    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
6263    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6264        self.page_size = v.into();
6265        self
6266    }
6267
6268    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
6269    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6270        self.page_token = v.into();
6271        self
6272    }
6273}
6274
6275impl wkt::message::Message for ListClustersRequest {
6276    fn typename() -> &'static str {
6277        "type.googleapis.com/google.cloud.dataproc.v1.ListClustersRequest"
6278    }
6279}
6280
6281/// The list of all clusters in a project.
6282#[serde_with::serde_as]
6283#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6284#[serde(default, rename_all = "camelCase")]
6285#[non_exhaustive]
6286pub struct ListClustersResponse {
6287    /// Output only. The clusters in the project.
6288    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6289    pub clusters: std::vec::Vec<crate::model::Cluster>,
6290
6291    /// Output only. This token is included in the response if there are more
6292    /// results to fetch. To fetch additional results, provide this value as the
6293    /// `page_token` in a subsequent `ListClustersRequest`.
6294    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6295    pub next_page_token: std::string::String,
6296
6297    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6298    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6299}
6300
6301impl ListClustersResponse {
6302    pub fn new() -> Self {
6303        std::default::Default::default()
6304    }
6305
6306    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
6307    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308        self.next_page_token = v.into();
6309        self
6310    }
6311
6312    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
6313    pub fn set_clusters<T, V>(mut self, v: T) -> Self
6314    where
6315        T: std::iter::IntoIterator<Item = V>,
6316        V: std::convert::Into<crate::model::Cluster>,
6317    {
6318        use std::iter::Iterator;
6319        self.clusters = v.into_iter().map(|i| i.into()).collect();
6320        self
6321    }
6322}
6323
6324impl wkt::message::Message for ListClustersResponse {
6325    fn typename() -> &'static str {
6326        "type.googleapis.com/google.cloud.dataproc.v1.ListClustersResponse"
6327    }
6328}
6329
6330#[doc(hidden)]
6331impl gax::paginator::internal::PageableResponse for ListClustersResponse {
6332    type PageItem = crate::model::Cluster;
6333
6334    fn items(self) -> std::vec::Vec<Self::PageItem> {
6335        self.clusters
6336    }
6337
6338    fn next_page_token(&self) -> std::string::String {
6339        use std::clone::Clone;
6340        self.next_page_token.clone()
6341    }
6342}
6343
6344/// A request to collect cluster diagnostic information.
6345#[serde_with::serde_as]
6346#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6347#[serde(default, rename_all = "camelCase")]
6348#[non_exhaustive]
6349pub struct DiagnoseClusterRequest {
6350    /// Required. The ID of the Google Cloud Platform project that the cluster
6351    /// belongs to.
6352    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6353    pub project_id: std::string::String,
6354
6355    /// Required. The Dataproc region in which to handle the request.
6356    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6357    pub region: std::string::String,
6358
6359    /// Required. The cluster name.
6360    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6361    pub cluster_name: std::string::String,
6362
6363    /// Optional. (Optional) The output Cloud Storage directory for the diagnostic
6364    /// tarball. If not specified, a task-specific directory in the cluster's
6365    /// staging bucket will be used.
6366    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6367    pub tarball_gcs_dir: std::string::String,
6368
6369    /// Optional. (Optional) The access type to the diagnostic tarball. If not
6370    /// specified, falls back to default access of the bucket
6371    pub tarball_access: crate::model::diagnose_cluster_request::TarballAccess,
6372
6373    /// Optional. Time interval in which diagnosis should be carried out on the
6374    /// cluster.
6375    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6376    pub diagnosis_interval: std::option::Option<gtype::model::Interval>,
6377
6378    /// Optional. Specifies a list of jobs on which diagnosis is to be performed.
6379    /// Format: projects/{project}/regions/{region}/jobs/{job}
6380    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6381    pub jobs: std::vec::Vec<std::string::String>,
6382
6383    /// Optional. Specifies a list of yarn applications on which diagnosis is to be
6384    /// performed.
6385    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6386    pub yarn_application_ids: std::vec::Vec<std::string::String>,
6387
6388    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6389    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6390}
6391
6392impl DiagnoseClusterRequest {
6393    pub fn new() -> Self {
6394        std::default::Default::default()
6395    }
6396
6397    /// Sets the value of [project_id][crate::model::DiagnoseClusterRequest::project_id].
6398    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6399        self.project_id = v.into();
6400        self
6401    }
6402
6403    /// Sets the value of [region][crate::model::DiagnoseClusterRequest::region].
6404    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6405        self.region = v.into();
6406        self
6407    }
6408
6409    /// Sets the value of [cluster_name][crate::model::DiagnoseClusterRequest::cluster_name].
6410    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6411        self.cluster_name = v.into();
6412        self
6413    }
6414
6415    /// Sets the value of [tarball_gcs_dir][crate::model::DiagnoseClusterRequest::tarball_gcs_dir].
6416    pub fn set_tarball_gcs_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6417        self.tarball_gcs_dir = v.into();
6418        self
6419    }
6420
6421    /// Sets the value of [tarball_access][crate::model::DiagnoseClusterRequest::tarball_access].
6422    pub fn set_tarball_access<
6423        T: std::convert::Into<crate::model::diagnose_cluster_request::TarballAccess>,
6424    >(
6425        mut self,
6426        v: T,
6427    ) -> Self {
6428        self.tarball_access = v.into();
6429        self
6430    }
6431
6432    /// Sets the value of [diagnosis_interval][crate::model::DiagnoseClusterRequest::diagnosis_interval].
6433    pub fn set_diagnosis_interval<
6434        T: std::convert::Into<std::option::Option<gtype::model::Interval>>,
6435    >(
6436        mut self,
6437        v: T,
6438    ) -> Self {
6439        self.diagnosis_interval = v.into();
6440        self
6441    }
6442
6443    /// Sets the value of [jobs][crate::model::DiagnoseClusterRequest::jobs].
6444    pub fn set_jobs<T, V>(mut self, v: T) -> Self
6445    where
6446        T: std::iter::IntoIterator<Item = V>,
6447        V: std::convert::Into<std::string::String>,
6448    {
6449        use std::iter::Iterator;
6450        self.jobs = v.into_iter().map(|i| i.into()).collect();
6451        self
6452    }
6453
6454    /// Sets the value of [yarn_application_ids][crate::model::DiagnoseClusterRequest::yarn_application_ids].
6455    pub fn set_yarn_application_ids<T, V>(mut self, v: T) -> Self
6456    where
6457        T: std::iter::IntoIterator<Item = V>,
6458        V: std::convert::Into<std::string::String>,
6459    {
6460        use std::iter::Iterator;
6461        self.yarn_application_ids = v.into_iter().map(|i| i.into()).collect();
6462        self
6463    }
6464}
6465
6466impl wkt::message::Message for DiagnoseClusterRequest {
6467    fn typename() -> &'static str {
6468        "type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterRequest"
6469    }
6470}
6471
6472/// Defines additional types related to [DiagnoseClusterRequest].
6473pub mod diagnose_cluster_request {
6474    #[allow(unused_imports)]
6475    use super::*;
6476
6477    /// Defines who has access to the diagnostic tarball
6478    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6479    pub struct TarballAccess(i32);
6480
6481    impl TarballAccess {
6482        /// Tarball Access unspecified. Falls back to default access of the bucket
6483        pub const TARBALL_ACCESS_UNSPECIFIED: TarballAccess = TarballAccess::new(0);
6484
6485        /// Google Cloud Support group has read access to the
6486        /// diagnostic tarball
6487        pub const GOOGLE_CLOUD_SUPPORT: TarballAccess = TarballAccess::new(1);
6488
6489        /// Google Cloud Dataproc Diagnose service account has read access to the
6490        /// diagnostic tarball
6491        pub const GOOGLE_DATAPROC_DIAGNOSE: TarballAccess = TarballAccess::new(2);
6492
6493        /// Creates a new TarballAccess instance.
6494        pub(crate) const fn new(value: i32) -> Self {
6495            Self(value)
6496        }
6497
6498        /// Gets the enum value.
6499        pub fn value(&self) -> i32 {
6500            self.0
6501        }
6502
6503        /// Gets the enum value as a string.
6504        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
6505            match self.0 {
6506                0 => std::borrow::Cow::Borrowed("TARBALL_ACCESS_UNSPECIFIED"),
6507                1 => std::borrow::Cow::Borrowed("GOOGLE_CLOUD_SUPPORT"),
6508                2 => std::borrow::Cow::Borrowed("GOOGLE_DATAPROC_DIAGNOSE"),
6509                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
6510            }
6511        }
6512
6513        /// Creates an enum value from the value name.
6514        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
6515            match name {
6516                "TARBALL_ACCESS_UNSPECIFIED" => {
6517                    std::option::Option::Some(Self::TARBALL_ACCESS_UNSPECIFIED)
6518                }
6519                "GOOGLE_CLOUD_SUPPORT" => std::option::Option::Some(Self::GOOGLE_CLOUD_SUPPORT),
6520                "GOOGLE_DATAPROC_DIAGNOSE" => {
6521                    std::option::Option::Some(Self::GOOGLE_DATAPROC_DIAGNOSE)
6522                }
6523                _ => std::option::Option::None,
6524            }
6525        }
6526    }
6527
6528    impl std::convert::From<i32> for TarballAccess {
6529        fn from(value: i32) -> Self {
6530            Self::new(value)
6531        }
6532    }
6533
6534    impl std::default::Default for TarballAccess {
6535        fn default() -> Self {
6536            Self::new(0)
6537        }
6538    }
6539}
6540
6541/// The location of diagnostic output.
6542#[serde_with::serde_as]
6543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6544#[serde(default, rename_all = "camelCase")]
6545#[non_exhaustive]
6546pub struct DiagnoseClusterResults {
6547    /// Output only. The Cloud Storage URI of the diagnostic output.
6548    /// The output report is a plain text file with a summary of collected
6549    /// diagnostics.
6550    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6551    pub output_uri: std::string::String,
6552
6553    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6554    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6555}
6556
6557impl DiagnoseClusterResults {
6558    pub fn new() -> Self {
6559        std::default::Default::default()
6560    }
6561
6562    /// Sets the value of [output_uri][crate::model::DiagnoseClusterResults::output_uri].
6563    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6564        self.output_uri = v.into();
6565        self
6566    }
6567}
6568
6569impl wkt::message::Message for DiagnoseClusterResults {
6570    fn typename() -> &'static str {
6571        "type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterResults"
6572    }
6573}
6574
6575/// Reservation Affinity for consuming Zonal reservation.
6576#[serde_with::serde_as]
6577#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6578#[serde(default, rename_all = "camelCase")]
6579#[non_exhaustive]
6580pub struct ReservationAffinity {
6581    /// Optional. Type of reservation to consume
6582    pub consume_reservation_type: crate::model::reservation_affinity::Type,
6583
6584    /// Optional. Corresponds to the label key of reservation resource.
6585    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6586    pub key: std::string::String,
6587
6588    /// Optional. Corresponds to the label values of reservation resource.
6589    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6590    pub values: std::vec::Vec<std::string::String>,
6591
6592    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6593    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6594}
6595
6596impl ReservationAffinity {
6597    pub fn new() -> Self {
6598        std::default::Default::default()
6599    }
6600
6601    /// Sets the value of [consume_reservation_type][crate::model::ReservationAffinity::consume_reservation_type].
6602    pub fn set_consume_reservation_type<
6603        T: std::convert::Into<crate::model::reservation_affinity::Type>,
6604    >(
6605        mut self,
6606        v: T,
6607    ) -> Self {
6608        self.consume_reservation_type = v.into();
6609        self
6610    }
6611
6612    /// Sets the value of [key][crate::model::ReservationAffinity::key].
6613    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6614        self.key = v.into();
6615        self
6616    }
6617
6618    /// Sets the value of [values][crate::model::ReservationAffinity::values].
6619    pub fn set_values<T, V>(mut self, v: T) -> Self
6620    where
6621        T: std::iter::IntoIterator<Item = V>,
6622        V: std::convert::Into<std::string::String>,
6623    {
6624        use std::iter::Iterator;
6625        self.values = v.into_iter().map(|i| i.into()).collect();
6626        self
6627    }
6628}
6629
6630impl wkt::message::Message for ReservationAffinity {
6631    fn typename() -> &'static str {
6632        "type.googleapis.com/google.cloud.dataproc.v1.ReservationAffinity"
6633    }
6634}
6635
6636/// Defines additional types related to [ReservationAffinity].
6637pub mod reservation_affinity {
6638    #[allow(unused_imports)]
6639    use super::*;
6640
6641    /// Indicates whether to consume capacity from an reservation or not.
6642    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6643    pub struct Type(i32);
6644
6645    impl Type {
6646        pub const TYPE_UNSPECIFIED: Type = Type::new(0);
6647
6648        /// Do not consume from any allocated capacity.
6649        pub const NO_RESERVATION: Type = Type::new(1);
6650
6651        /// Consume any reservation available.
6652        pub const ANY_RESERVATION: Type = Type::new(2);
6653
6654        /// Must consume from a specific reservation. Must specify key value fields
6655        /// for specifying the reservations.
6656        pub const SPECIFIC_RESERVATION: Type = Type::new(3);
6657
6658        /// Creates a new Type instance.
6659        pub(crate) const fn new(value: i32) -> Self {
6660            Self(value)
6661        }
6662
6663        /// Gets the enum value.
6664        pub fn value(&self) -> i32 {
6665            self.0
6666        }
6667
6668        /// Gets the enum value as a string.
6669        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
6670            match self.0 {
6671                0 => std::borrow::Cow::Borrowed("TYPE_UNSPECIFIED"),
6672                1 => std::borrow::Cow::Borrowed("NO_RESERVATION"),
6673                2 => std::borrow::Cow::Borrowed("ANY_RESERVATION"),
6674                3 => std::borrow::Cow::Borrowed("SPECIFIC_RESERVATION"),
6675                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
6676            }
6677        }
6678
6679        /// Creates an enum value from the value name.
6680        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
6681            match name {
6682                "TYPE_UNSPECIFIED" => std::option::Option::Some(Self::TYPE_UNSPECIFIED),
6683                "NO_RESERVATION" => std::option::Option::Some(Self::NO_RESERVATION),
6684                "ANY_RESERVATION" => std::option::Option::Some(Self::ANY_RESERVATION),
6685                "SPECIFIC_RESERVATION" => std::option::Option::Some(Self::SPECIFIC_RESERVATION),
6686                _ => std::option::Option::None,
6687            }
6688        }
6689    }
6690
6691    impl std::convert::From<i32> for Type {
6692        fn from(value: i32) -> Self {
6693            Self::new(value)
6694        }
6695    }
6696
6697    impl std::default::Default for Type {
6698        fn default() -> Self {
6699            Self::new(0)
6700        }
6701    }
6702}
6703
6704/// The runtime logging config of the job.
6705#[serde_with::serde_as]
6706#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6707#[serde(default, rename_all = "camelCase")]
6708#[non_exhaustive]
6709pub struct LoggingConfig {
6710    /// The per-package log levels for the driver. This can include
6711    /// "root" package name to configure rootLogger.
6712    /// Examples:
6713    ///
6714    /// - 'com.google = FATAL'
6715    /// - 'root = INFO'
6716    /// - 'org.apache = DEBUG'
6717    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6718    pub driver_log_levels:
6719        std::collections::HashMap<std::string::String, crate::model::logging_config::Level>,
6720
6721    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6722    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6723}
6724
6725impl LoggingConfig {
6726    pub fn new() -> Self {
6727        std::default::Default::default()
6728    }
6729
6730    /// Sets the value of [driver_log_levels][crate::model::LoggingConfig::driver_log_levels].
6731    pub fn set_driver_log_levels<T, K, V>(mut self, v: T) -> Self
6732    where
6733        T: std::iter::IntoIterator<Item = (K, V)>,
6734        K: std::convert::Into<std::string::String>,
6735        V: std::convert::Into<crate::model::logging_config::Level>,
6736    {
6737        use std::iter::Iterator;
6738        self.driver_log_levels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6739        self
6740    }
6741}
6742
6743impl wkt::message::Message for LoggingConfig {
6744    fn typename() -> &'static str {
6745        "type.googleapis.com/google.cloud.dataproc.v1.LoggingConfig"
6746    }
6747}
6748
6749/// Defines additional types related to [LoggingConfig].
6750pub mod logging_config {
6751    #[allow(unused_imports)]
6752    use super::*;
6753
6754    /// The Log4j level for job execution. When running an
6755    /// [Apache Hive](https://hive.apache.org/) job, Cloud
6756    /// Dataproc configures the Hive client to an equivalent verbosity level.
6757    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6758    pub struct Level(i32);
6759
6760    impl Level {
6761        /// Level is unspecified. Use default level for log4j.
6762        pub const LEVEL_UNSPECIFIED: Level = Level::new(0);
6763
6764        /// Use ALL level for log4j.
6765        pub const ALL: Level = Level::new(1);
6766
6767        /// Use TRACE level for log4j.
6768        pub const TRACE: Level = Level::new(2);
6769
6770        /// Use DEBUG level for log4j.
6771        pub const DEBUG: Level = Level::new(3);
6772
6773        /// Use INFO level for log4j.
6774        pub const INFO: Level = Level::new(4);
6775
6776        /// Use WARN level for log4j.
6777        pub const WARN: Level = Level::new(5);
6778
6779        /// Use ERROR level for log4j.
6780        pub const ERROR: Level = Level::new(6);
6781
6782        /// Use FATAL level for log4j.
6783        pub const FATAL: Level = Level::new(7);
6784
6785        /// Turn off log4j.
6786        pub const OFF: Level = Level::new(8);
6787
6788        /// Creates a new Level instance.
6789        pub(crate) const fn new(value: i32) -> Self {
6790            Self(value)
6791        }
6792
6793        /// Gets the enum value.
6794        pub fn value(&self) -> i32 {
6795            self.0
6796        }
6797
6798        /// Gets the enum value as a string.
6799        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
6800            match self.0 {
6801                0 => std::borrow::Cow::Borrowed("LEVEL_UNSPECIFIED"),
6802                1 => std::borrow::Cow::Borrowed("ALL"),
6803                2 => std::borrow::Cow::Borrowed("TRACE"),
6804                3 => std::borrow::Cow::Borrowed("DEBUG"),
6805                4 => std::borrow::Cow::Borrowed("INFO"),
6806                5 => std::borrow::Cow::Borrowed("WARN"),
6807                6 => std::borrow::Cow::Borrowed("ERROR"),
6808                7 => std::borrow::Cow::Borrowed("FATAL"),
6809                8 => std::borrow::Cow::Borrowed("OFF"),
6810                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
6811            }
6812        }
6813
6814        /// Creates an enum value from the value name.
6815        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
6816            match name {
6817                "LEVEL_UNSPECIFIED" => std::option::Option::Some(Self::LEVEL_UNSPECIFIED),
6818                "ALL" => std::option::Option::Some(Self::ALL),
6819                "TRACE" => std::option::Option::Some(Self::TRACE),
6820                "DEBUG" => std::option::Option::Some(Self::DEBUG),
6821                "INFO" => std::option::Option::Some(Self::INFO),
6822                "WARN" => std::option::Option::Some(Self::WARN),
6823                "ERROR" => std::option::Option::Some(Self::ERROR),
6824                "FATAL" => std::option::Option::Some(Self::FATAL),
6825                "OFF" => std::option::Option::Some(Self::OFF),
6826                _ => std::option::Option::None,
6827            }
6828        }
6829    }
6830
6831    impl std::convert::From<i32> for Level {
6832        fn from(value: i32) -> Self {
6833            Self::new(value)
6834        }
6835    }
6836
6837    impl std::default::Default for Level {
6838        fn default() -> Self {
6839            Self::new(0)
6840        }
6841    }
6842}
6843
6844/// A Dataproc job for running
6845/// [Apache Hadoop
6846/// MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html)
6847/// jobs on [Apache Hadoop
6848/// YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
6849#[serde_with::serde_as]
6850#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6851#[serde(default, rename_all = "camelCase")]
6852#[non_exhaustive]
6853pub struct HadoopJob {
6854    /// Optional. The arguments to pass to the driver. Do not
6855    /// include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as
6856    /// job properties, since a collision might occur that causes an incorrect job
6857    /// submission.
6858    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6859    pub args: std::vec::Vec<std::string::String>,
6860
6861    /// Optional. Jar file URIs to add to the CLASSPATHs of the
6862    /// Hadoop driver and tasks.
6863    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6864    pub jar_file_uris: std::vec::Vec<std::string::String>,
6865
6866    /// Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied
6867    /// to the working directory of Hadoop drivers and distributed tasks. Useful
6868    /// for naively parallel tasks.
6869    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6870    pub file_uris: std::vec::Vec<std::string::String>,
6871
6872    /// Optional. HCFS URIs of archives to be extracted in the working directory of
6873    /// Hadoop drivers and tasks. Supported file types:
6874    /// .jar, .tar, .tar.gz, .tgz, or .zip.
6875    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6876    pub archive_uris: std::vec::Vec<std::string::String>,
6877
6878    /// Optional. A mapping of property names to values, used to configure Hadoop.
6879    /// Properties that conflict with values set by the Dataproc API might be
6880    /// overwritten. Can include properties set in `/etc/hadoop/conf/*-site` and
6881    /// classes in user code.
6882    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6883    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
6884
6885    /// Optional. The runtime log config for job execution.
6886    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6887    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
6888
6889    /// Required. Indicates the location of the driver's main class. Specify
6890    /// either the jar file that contains the main class or the main class name.
6891    /// To specify both, add the jar file to `jar_file_uris`, and then specify
6892    /// the main class name in this property.
6893    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6894    pub driver: std::option::Option<crate::model::hadoop_job::Driver>,
6895
6896    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6897    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6898}
6899
6900impl HadoopJob {
6901    pub fn new() -> Self {
6902        std::default::Default::default()
6903    }
6904
6905    /// Sets the value of [logging_config][crate::model::HadoopJob::logging_config].
6906    pub fn set_logging_config<
6907        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
6908    >(
6909        mut self,
6910        v: T,
6911    ) -> Self {
6912        self.logging_config = v.into();
6913        self
6914    }
6915
6916    /// Sets the value of [args][crate::model::HadoopJob::args].
6917    pub fn set_args<T, V>(mut self, v: T) -> Self
6918    where
6919        T: std::iter::IntoIterator<Item = V>,
6920        V: std::convert::Into<std::string::String>,
6921    {
6922        use std::iter::Iterator;
6923        self.args = v.into_iter().map(|i| i.into()).collect();
6924        self
6925    }
6926
6927    /// Sets the value of [jar_file_uris][crate::model::HadoopJob::jar_file_uris].
6928    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
6929    where
6930        T: std::iter::IntoIterator<Item = V>,
6931        V: std::convert::Into<std::string::String>,
6932    {
6933        use std::iter::Iterator;
6934        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
6935        self
6936    }
6937
6938    /// Sets the value of [file_uris][crate::model::HadoopJob::file_uris].
6939    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
6940    where
6941        T: std::iter::IntoIterator<Item = V>,
6942        V: std::convert::Into<std::string::String>,
6943    {
6944        use std::iter::Iterator;
6945        self.file_uris = v.into_iter().map(|i| i.into()).collect();
6946        self
6947    }
6948
6949    /// Sets the value of [archive_uris][crate::model::HadoopJob::archive_uris].
6950    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
6951    where
6952        T: std::iter::IntoIterator<Item = V>,
6953        V: std::convert::Into<std::string::String>,
6954    {
6955        use std::iter::Iterator;
6956        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
6957        self
6958    }
6959
6960    /// Sets the value of [properties][crate::model::HadoopJob::properties].
6961    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
6962    where
6963        T: std::iter::IntoIterator<Item = (K, V)>,
6964        K: std::convert::Into<std::string::String>,
6965        V: std::convert::Into<std::string::String>,
6966    {
6967        use std::iter::Iterator;
6968        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6969        self
6970    }
6971
6972    /// Sets the value of [driver][crate::model::HadoopJob::driver].
6973    ///
6974    /// Note that all the setters affecting `driver` are mutually
6975    /// exclusive.
6976    pub fn set_driver<
6977        T: std::convert::Into<std::option::Option<crate::model::hadoop_job::Driver>>,
6978    >(
6979        mut self,
6980        v: T,
6981    ) -> Self {
6982        self.driver = v.into();
6983        self
6984    }
6985
6986    /// The value of [driver][crate::model::HadoopJob::driver]
6987    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
6988    /// holds a different branch.
6989    pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
6990        #[allow(unreachable_patterns)]
6991        self.driver.as_ref().and_then(|v| match v {
6992            crate::model::hadoop_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
6993            _ => std::option::Option::None,
6994        })
6995    }
6996
6997    /// The value of [driver][crate::model::HadoopJob::driver]
6998    /// if it holds a `MainClass`, `None` if the field is not set or
6999    /// holds a different branch.
7000    pub fn main_class(&self) -> std::option::Option<&std::string::String> {
7001        #[allow(unreachable_patterns)]
7002        self.driver.as_ref().and_then(|v| match v {
7003            crate::model::hadoop_job::Driver::MainClass(v) => std::option::Option::Some(v),
7004            _ => std::option::Option::None,
7005        })
7006    }
7007
7008    /// Sets the value of [driver][crate::model::HadoopJob::driver]
7009    /// to hold a `MainJarFileUri`.
7010    ///
7011    /// Note that all the setters affecting `driver` are
7012    /// mutually exclusive.
7013    pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
7014        mut self,
7015        v: T,
7016    ) -> Self {
7017        self.driver =
7018            std::option::Option::Some(crate::model::hadoop_job::Driver::MainJarFileUri(v.into()));
7019        self
7020    }
7021
7022    /// Sets the value of [driver][crate::model::HadoopJob::driver]
7023    /// to hold a `MainClass`.
7024    ///
7025    /// Note that all the setters affecting `driver` are
7026    /// mutually exclusive.
7027    pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7028        self.driver =
7029            std::option::Option::Some(crate::model::hadoop_job::Driver::MainClass(v.into()));
7030        self
7031    }
7032}
7033
7034impl wkt::message::Message for HadoopJob {
7035    fn typename() -> &'static str {
7036        "type.googleapis.com/google.cloud.dataproc.v1.HadoopJob"
7037    }
7038}
7039
7040/// Defines additional types related to [HadoopJob].
7041pub mod hadoop_job {
7042    #[allow(unused_imports)]
7043    use super::*;
7044
7045    /// Required. Indicates the location of the driver's main class. Specify
7046    /// either the jar file that contains the main class or the main class name.
7047    /// To specify both, add the jar file to `jar_file_uris`, and then specify
7048    /// the main class name in this property.
7049    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7050    #[serde(rename_all = "camelCase")]
7051    #[non_exhaustive]
7052    pub enum Driver {
7053        /// The HCFS URI of the jar file containing the main class.
7054        /// Examples:
7055        /// 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
7056        /// 'hdfs:/tmp/test-samples/custom-wordcount.jar'
7057        /// 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
7058        MainJarFileUri(std::string::String),
7059        /// The name of the driver's main class. The jar file containing the class
7060        /// must be in the default CLASSPATH or specified in `jar_file_uris`.
7061        MainClass(std::string::String),
7062    }
7063}
7064
7065/// A Dataproc job for running [Apache Spark](https://spark.apache.org/)
7066/// applications on YARN.
7067#[serde_with::serde_as]
7068#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7069#[serde(default, rename_all = "camelCase")]
7070#[non_exhaustive]
7071pub struct SparkJob {
7072    /// Optional. The arguments to pass to the driver. Do not include arguments,
7073    /// such as `--conf`, that can be set as job properties, since a collision may
7074    /// occur that causes an incorrect job submission.
7075    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7076    pub args: std::vec::Vec<std::string::String>,
7077
7078    /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
7079    /// Spark driver and tasks.
7080    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7081    pub jar_file_uris: std::vec::Vec<std::string::String>,
7082
7083    /// Optional. HCFS URIs of files to be placed in the working directory of
7084    /// each executor. Useful for naively parallel tasks.
7085    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7086    pub file_uris: std::vec::Vec<std::string::String>,
7087
7088    /// Optional. HCFS URIs of archives to be extracted into the working directory
7089    /// of each executor. Supported file types:
7090    /// .jar, .tar, .tar.gz, .tgz, and .zip.
7091    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7092    pub archive_uris: std::vec::Vec<std::string::String>,
7093
7094    /// Optional. A mapping of property names to values, used to configure Spark.
7095    /// Properties that conflict with values set by the Dataproc API might be
7096    /// overwritten. Can include properties set in
7097    /// /etc/spark/conf/spark-defaults.conf and classes in user code.
7098    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7099    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7100
7101    /// Optional. The runtime log config for job execution.
7102    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7103    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7104
7105    /// Required. The specification of the main method to call to drive the job.
7106    /// Specify either the jar file that contains the main class or the main class
7107    /// name. To pass both a main jar and a main class in that jar, add the jar to
7108    /// [jarFileUris][google.cloud.dataproc.v1.SparkJob.jar_file_uris], and then
7109    /// specify the main class name in
7110    /// [mainClass][google.cloud.dataproc.v1.SparkJob.main_class].
7111    ///
7112    /// [google.cloud.dataproc.v1.SparkJob.jar_file_uris]: crate::model::SparkJob::jar_file_uris
7113    /// [google.cloud.dataproc.v1.SparkJob.main_class]: crate::model::SparkJob::driver
7114    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7115    pub driver: std::option::Option<crate::model::spark_job::Driver>,
7116
7117    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7118    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7119}
7120
7121impl SparkJob {
7122    pub fn new() -> Self {
7123        std::default::Default::default()
7124    }
7125
7126    /// Sets the value of [logging_config][crate::model::SparkJob::logging_config].
7127    pub fn set_logging_config<
7128        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7129    >(
7130        mut self,
7131        v: T,
7132    ) -> Self {
7133        self.logging_config = v.into();
7134        self
7135    }
7136
7137    /// Sets the value of [args][crate::model::SparkJob::args].
7138    pub fn set_args<T, V>(mut self, v: T) -> Self
7139    where
7140        T: std::iter::IntoIterator<Item = V>,
7141        V: std::convert::Into<std::string::String>,
7142    {
7143        use std::iter::Iterator;
7144        self.args = v.into_iter().map(|i| i.into()).collect();
7145        self
7146    }
7147
7148    /// Sets the value of [jar_file_uris][crate::model::SparkJob::jar_file_uris].
7149    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7150    where
7151        T: std::iter::IntoIterator<Item = V>,
7152        V: std::convert::Into<std::string::String>,
7153    {
7154        use std::iter::Iterator;
7155        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7156        self
7157    }
7158
7159    /// Sets the value of [file_uris][crate::model::SparkJob::file_uris].
7160    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
7161    where
7162        T: std::iter::IntoIterator<Item = V>,
7163        V: std::convert::Into<std::string::String>,
7164    {
7165        use std::iter::Iterator;
7166        self.file_uris = v.into_iter().map(|i| i.into()).collect();
7167        self
7168    }
7169
7170    /// Sets the value of [archive_uris][crate::model::SparkJob::archive_uris].
7171    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
7172    where
7173        T: std::iter::IntoIterator<Item = V>,
7174        V: std::convert::Into<std::string::String>,
7175    {
7176        use std::iter::Iterator;
7177        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
7178        self
7179    }
7180
7181    /// Sets the value of [properties][crate::model::SparkJob::properties].
7182    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7183    where
7184        T: std::iter::IntoIterator<Item = (K, V)>,
7185        K: std::convert::Into<std::string::String>,
7186        V: std::convert::Into<std::string::String>,
7187    {
7188        use std::iter::Iterator;
7189        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7190        self
7191    }
7192
7193    /// Sets the value of [driver][crate::model::SparkJob::driver].
7194    ///
7195    /// Note that all the setters affecting `driver` are mutually
7196    /// exclusive.
7197    pub fn set_driver<
7198        T: std::convert::Into<std::option::Option<crate::model::spark_job::Driver>>,
7199    >(
7200        mut self,
7201        v: T,
7202    ) -> Self {
7203        self.driver = v.into();
7204        self
7205    }
7206
7207    /// The value of [driver][crate::model::SparkJob::driver]
7208    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
7209    /// holds a different branch.
7210    pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
7211        #[allow(unreachable_patterns)]
7212        self.driver.as_ref().and_then(|v| match v {
7213            crate::model::spark_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
7214            _ => std::option::Option::None,
7215        })
7216    }
7217
7218    /// The value of [driver][crate::model::SparkJob::driver]
7219    /// if it holds a `MainClass`, `None` if the field is not set or
7220    /// holds a different branch.
7221    pub fn main_class(&self) -> std::option::Option<&std::string::String> {
7222        #[allow(unreachable_patterns)]
7223        self.driver.as_ref().and_then(|v| match v {
7224            crate::model::spark_job::Driver::MainClass(v) => std::option::Option::Some(v),
7225            _ => std::option::Option::None,
7226        })
7227    }
7228
7229    /// Sets the value of [driver][crate::model::SparkJob::driver]
7230    /// to hold a `MainJarFileUri`.
7231    ///
7232    /// Note that all the setters affecting `driver` are
7233    /// mutually exclusive.
7234    pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
7235        mut self,
7236        v: T,
7237    ) -> Self {
7238        self.driver =
7239            std::option::Option::Some(crate::model::spark_job::Driver::MainJarFileUri(v.into()));
7240        self
7241    }
7242
7243    /// Sets the value of [driver][crate::model::SparkJob::driver]
7244    /// to hold a `MainClass`.
7245    ///
7246    /// Note that all the setters affecting `driver` are
7247    /// mutually exclusive.
7248    pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7249        self.driver =
7250            std::option::Option::Some(crate::model::spark_job::Driver::MainClass(v.into()));
7251        self
7252    }
7253}
7254
7255impl wkt::message::Message for SparkJob {
7256    fn typename() -> &'static str {
7257        "type.googleapis.com/google.cloud.dataproc.v1.SparkJob"
7258    }
7259}
7260
7261/// Defines additional types related to [SparkJob].
7262pub mod spark_job {
7263    #[allow(unused_imports)]
7264    use super::*;
7265
7266    /// Required. The specification of the main method to call to drive the job.
7267    /// Specify either the jar file that contains the main class or the main class
7268    /// name. To pass both a main jar and a main class in that jar, add the jar to
7269    /// [jarFileUris][google.cloud.dataproc.v1.SparkJob.jar_file_uris], and then
7270    /// specify the main class name in
7271    /// [mainClass][google.cloud.dataproc.v1.SparkJob.main_class].
7272    ///
7273    /// [google.cloud.dataproc.v1.SparkJob.jar_file_uris]: crate::model::SparkJob::jar_file_uris
7274    /// [google.cloud.dataproc.v1.SparkJob.main_class]: crate::model::SparkJob::driver
7275    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7276    #[serde(rename_all = "camelCase")]
7277    #[non_exhaustive]
7278    pub enum Driver {
7279        /// The HCFS URI of the jar file that contains the main class.
7280        MainJarFileUri(std::string::String),
7281        /// The name of the driver's main class. The jar file that contains the class
7282        /// must be in the default CLASSPATH or specified in
7283        /// SparkJob.jar_file_uris.
7284        MainClass(std::string::String),
7285    }
7286}
7287
7288/// A Dataproc job for running
7289/// [Apache
7290/// PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
7291/// applications on YARN.
7292#[serde_with::serde_as]
7293#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7294#[serde(default, rename_all = "camelCase")]
7295#[non_exhaustive]
7296pub struct PySparkJob {
7297    /// Required. The HCFS URI of the main Python file to use as the driver. Must
7298    /// be a .py file.
7299    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7300    pub main_python_file_uri: std::string::String,
7301
7302    /// Optional. The arguments to pass to the driver.  Do not include arguments,
7303    /// such as `--conf`, that can be set as job properties, since a collision may
7304    /// occur that causes an incorrect job submission.
7305    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7306    pub args: std::vec::Vec<std::string::String>,
7307
7308    /// Optional. HCFS file URIs of Python files to pass to the PySpark
7309    /// framework. Supported file types: .py, .egg, and .zip.
7310    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7311    pub python_file_uris: std::vec::Vec<std::string::String>,
7312
7313    /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
7314    /// Python driver and tasks.
7315    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7316    pub jar_file_uris: std::vec::Vec<std::string::String>,
7317
7318    /// Optional. HCFS URIs of files to be placed in the working directory of
7319    /// each executor. Useful for naively parallel tasks.
7320    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7321    pub file_uris: std::vec::Vec<std::string::String>,
7322
7323    /// Optional. HCFS URIs of archives to be extracted into the working directory
7324    /// of each executor. Supported file types:
7325    /// .jar, .tar, .tar.gz, .tgz, and .zip.
7326    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7327    pub archive_uris: std::vec::Vec<std::string::String>,
7328
7329    /// Optional. A mapping of property names to values, used to configure PySpark.
7330    /// Properties that conflict with values set by the Dataproc API might be
7331    /// overwritten. Can include properties set in
7332    /// /etc/spark/conf/spark-defaults.conf and classes in user code.
7333    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7334    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7335
7336    /// Optional. The runtime log config for job execution.
7337    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7338    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7339
7340    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7341    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7342}
7343
7344impl PySparkJob {
7345    pub fn new() -> Self {
7346        std::default::Default::default()
7347    }
7348
7349    /// Sets the value of [main_python_file_uri][crate::model::PySparkJob::main_python_file_uri].
7350    pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
7351        mut self,
7352        v: T,
7353    ) -> Self {
7354        self.main_python_file_uri = v.into();
7355        self
7356    }
7357
7358    /// Sets the value of [logging_config][crate::model::PySparkJob::logging_config].
7359    pub fn set_logging_config<
7360        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7361    >(
7362        mut self,
7363        v: T,
7364    ) -> Self {
7365        self.logging_config = v.into();
7366        self
7367    }
7368
7369    /// Sets the value of [args][crate::model::PySparkJob::args].
7370    pub fn set_args<T, V>(mut self, v: T) -> Self
7371    where
7372        T: std::iter::IntoIterator<Item = V>,
7373        V: std::convert::Into<std::string::String>,
7374    {
7375        use std::iter::Iterator;
7376        self.args = v.into_iter().map(|i| i.into()).collect();
7377        self
7378    }
7379
7380    /// Sets the value of [python_file_uris][crate::model::PySparkJob::python_file_uris].
7381    pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
7382    where
7383        T: std::iter::IntoIterator<Item = V>,
7384        V: std::convert::Into<std::string::String>,
7385    {
7386        use std::iter::Iterator;
7387        self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
7388        self
7389    }
7390
7391    /// Sets the value of [jar_file_uris][crate::model::PySparkJob::jar_file_uris].
7392    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7393    where
7394        T: std::iter::IntoIterator<Item = V>,
7395        V: std::convert::Into<std::string::String>,
7396    {
7397        use std::iter::Iterator;
7398        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7399        self
7400    }
7401
7402    /// Sets the value of [file_uris][crate::model::PySparkJob::file_uris].
7403    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
7404    where
7405        T: std::iter::IntoIterator<Item = V>,
7406        V: std::convert::Into<std::string::String>,
7407    {
7408        use std::iter::Iterator;
7409        self.file_uris = v.into_iter().map(|i| i.into()).collect();
7410        self
7411    }
7412
7413    /// Sets the value of [archive_uris][crate::model::PySparkJob::archive_uris].
7414    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
7415    where
7416        T: std::iter::IntoIterator<Item = V>,
7417        V: std::convert::Into<std::string::String>,
7418    {
7419        use std::iter::Iterator;
7420        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
7421        self
7422    }
7423
7424    /// Sets the value of [properties][crate::model::PySparkJob::properties].
7425    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7426    where
7427        T: std::iter::IntoIterator<Item = (K, V)>,
7428        K: std::convert::Into<std::string::String>,
7429        V: std::convert::Into<std::string::String>,
7430    {
7431        use std::iter::Iterator;
7432        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7433        self
7434    }
7435}
7436
7437impl wkt::message::Message for PySparkJob {
7438    fn typename() -> &'static str {
7439        "type.googleapis.com/google.cloud.dataproc.v1.PySparkJob"
7440    }
7441}
7442
7443/// A list of queries to run on a cluster.
7444#[serde_with::serde_as]
7445#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7446#[serde(default, rename_all = "camelCase")]
7447#[non_exhaustive]
7448pub struct QueryList {
7449    /// Required. The queries to execute. You do not need to end a query expression
7450    /// with a semicolon. Multiple queries can be specified in one
7451    /// string by separating each with a semicolon. Here is an example of a
7452    /// Dataproc API snippet that uses a QueryList to specify a HiveJob:
7453    ///
7454    /// ```norust
7455    /// "hiveJob": {
7456    ///   "queryList": {
7457    ///     "queries": [
7458    ///       "query1",
7459    ///       "query2",
7460    ///       "query3;query4",
7461    ///     ]
7462    ///   }
7463    /// }
7464    /// ```
7465    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7466    pub queries: std::vec::Vec<std::string::String>,
7467
7468    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7469    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7470}
7471
7472impl QueryList {
7473    pub fn new() -> Self {
7474        std::default::Default::default()
7475    }
7476
7477    /// Sets the value of [queries][crate::model::QueryList::queries].
7478    pub fn set_queries<T, V>(mut self, v: T) -> Self
7479    where
7480        T: std::iter::IntoIterator<Item = V>,
7481        V: std::convert::Into<std::string::String>,
7482    {
7483        use std::iter::Iterator;
7484        self.queries = v.into_iter().map(|i| i.into()).collect();
7485        self
7486    }
7487}
7488
7489impl wkt::message::Message for QueryList {
7490    fn typename() -> &'static str {
7491        "type.googleapis.com/google.cloud.dataproc.v1.QueryList"
7492    }
7493}
7494
7495/// A Dataproc job for running [Apache Hive](https://hive.apache.org/)
7496/// queries on YARN.
7497#[serde_with::serde_as]
7498#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7499#[serde(default, rename_all = "camelCase")]
7500#[non_exhaustive]
7501pub struct HiveJob {
7502    /// Optional. Whether to continue executing queries if a query fails.
7503    /// The default value is `false`. Setting to `true` can be useful when
7504    /// executing independent parallel queries.
7505    pub continue_on_failure: bool,
7506
7507    /// Optional. Mapping of query variable names to values (equivalent to the
7508    /// Hive command: `SET name="value";`).
7509    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7510    pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
7511
7512    /// Optional. A mapping of property names and values, used to configure Hive.
7513    /// Properties that conflict with values set by the Dataproc API might be
7514    /// overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`,
7515    /// /etc/hive/conf/hive-site.xml, and classes in user code.
7516    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7517    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7518
7519    /// Optional. HCFS URIs of jar files to add to the CLASSPATH of the
7520    /// Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes
7521    /// and UDFs.
7522    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7523    pub jar_file_uris: std::vec::Vec<std::string::String>,
7524
7525    /// Required. The sequence of Hive queries to execute, specified as either
7526    /// an HCFS file URI or a list of queries.
7527    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7528    pub queries: std::option::Option<crate::model::hive_job::Queries>,
7529
7530    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7531    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7532}
7533
7534impl HiveJob {
7535    pub fn new() -> Self {
7536        std::default::Default::default()
7537    }
7538
7539    /// Sets the value of [continue_on_failure][crate::model::HiveJob::continue_on_failure].
7540    pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7541        self.continue_on_failure = v.into();
7542        self
7543    }
7544
7545    /// Sets the value of [jar_file_uris][crate::model::HiveJob::jar_file_uris].
7546    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7547    where
7548        T: std::iter::IntoIterator<Item = V>,
7549        V: std::convert::Into<std::string::String>,
7550    {
7551        use std::iter::Iterator;
7552        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7553        self
7554    }
7555
7556    /// Sets the value of [script_variables][crate::model::HiveJob::script_variables].
7557    pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
7558    where
7559        T: std::iter::IntoIterator<Item = (K, V)>,
7560        K: std::convert::Into<std::string::String>,
7561        V: std::convert::Into<std::string::String>,
7562    {
7563        use std::iter::Iterator;
7564        self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7565        self
7566    }
7567
7568    /// Sets the value of [properties][crate::model::HiveJob::properties].
7569    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7570    where
7571        T: std::iter::IntoIterator<Item = (K, V)>,
7572        K: std::convert::Into<std::string::String>,
7573        V: std::convert::Into<std::string::String>,
7574    {
7575        use std::iter::Iterator;
7576        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7577        self
7578    }
7579
7580    /// Sets the value of [queries][crate::model::HiveJob::queries].
7581    ///
7582    /// Note that all the setters affecting `queries` are mutually
7583    /// exclusive.
7584    pub fn set_queries<
7585        T: std::convert::Into<std::option::Option<crate::model::hive_job::Queries>>,
7586    >(
7587        mut self,
7588        v: T,
7589    ) -> Self {
7590        self.queries = v.into();
7591        self
7592    }
7593
7594    /// The value of [queries][crate::model::HiveJob::queries]
7595    /// if it holds a `QueryFileUri`, `None` if the field is not set or
7596    /// holds a different branch.
7597    pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
7598        #[allow(unreachable_patterns)]
7599        self.queries.as_ref().and_then(|v| match v {
7600            crate::model::hive_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
7601            _ => std::option::Option::None,
7602        })
7603    }
7604
7605    /// The value of [queries][crate::model::HiveJob::queries]
7606    /// if it holds a `QueryList`, `None` if the field is not set or
7607    /// holds a different branch.
7608    pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
7609        #[allow(unreachable_patterns)]
7610        self.queries.as_ref().and_then(|v| match v {
7611            crate::model::hive_job::Queries::QueryList(v) => std::option::Option::Some(v),
7612            _ => std::option::Option::None,
7613        })
7614    }
7615
7616    /// Sets the value of [queries][crate::model::HiveJob::queries]
7617    /// to hold a `QueryFileUri`.
7618    ///
7619    /// Note that all the setters affecting `queries` are
7620    /// mutually exclusive.
7621    pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7622        self.queries =
7623            std::option::Option::Some(crate::model::hive_job::Queries::QueryFileUri(v.into()));
7624        self
7625    }
7626
7627    /// Sets the value of [queries][crate::model::HiveJob::queries]
7628    /// to hold a `QueryList`.
7629    ///
7630    /// Note that all the setters affecting `queries` are
7631    /// mutually exclusive.
7632    pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
7633        mut self,
7634        v: T,
7635    ) -> Self {
7636        self.queries =
7637            std::option::Option::Some(crate::model::hive_job::Queries::QueryList(v.into()));
7638        self
7639    }
7640}
7641
7642impl wkt::message::Message for HiveJob {
7643    fn typename() -> &'static str {
7644        "type.googleapis.com/google.cloud.dataproc.v1.HiveJob"
7645    }
7646}
7647
7648/// Defines additional types related to [HiveJob].
7649pub mod hive_job {
7650    #[allow(unused_imports)]
7651    use super::*;
7652
7653    /// Required. The sequence of Hive queries to execute, specified as either
7654    /// an HCFS file URI or a list of queries.
7655    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7656    #[serde(rename_all = "camelCase")]
7657    #[non_exhaustive]
7658    pub enum Queries {
7659        /// The HCFS URI of the script that contains Hive queries.
7660        QueryFileUri(std::string::String),
7661        /// A list of queries.
7662        QueryList(std::boxed::Box<crate::model::QueryList>),
7663    }
7664}
7665
7666/// A Dataproc job for running [Apache Spark
7667/// SQL](https://spark.apache.org/sql/) queries.
7668#[serde_with::serde_as]
7669#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7670#[serde(default, rename_all = "camelCase")]
7671#[non_exhaustive]
7672pub struct SparkSqlJob {
7673    /// Optional. Mapping of query variable names to values (equivalent to the
7674    /// Spark SQL command: SET `name="value";`).
7675    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7676    pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
7677
7678    /// Optional. A mapping of property names to values, used to configure
7679    /// Spark SQL's SparkConf. Properties that conflict with values set by the
7680    /// Dataproc API might be overwritten.
7681    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7682    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7683
7684    /// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
7685    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7686    pub jar_file_uris: std::vec::Vec<std::string::String>,
7687
7688    /// Optional. The runtime log config for job execution.
7689    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7690    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7691
7692    /// Required. The sequence of Spark SQL queries to execute, specified as
7693    /// either an HCFS file URI or as a list of queries.
7694    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7695    pub queries: std::option::Option<crate::model::spark_sql_job::Queries>,
7696
7697    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7698    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7699}
7700
7701impl SparkSqlJob {
7702    pub fn new() -> Self {
7703        std::default::Default::default()
7704    }
7705
7706    /// Sets the value of [logging_config][crate::model::SparkSqlJob::logging_config].
7707    pub fn set_logging_config<
7708        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7709    >(
7710        mut self,
7711        v: T,
7712    ) -> Self {
7713        self.logging_config = v.into();
7714        self
7715    }
7716
7717    /// Sets the value of [jar_file_uris][crate::model::SparkSqlJob::jar_file_uris].
7718    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7719    where
7720        T: std::iter::IntoIterator<Item = V>,
7721        V: std::convert::Into<std::string::String>,
7722    {
7723        use std::iter::Iterator;
7724        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7725        self
7726    }
7727
7728    /// Sets the value of [script_variables][crate::model::SparkSqlJob::script_variables].
7729    pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
7730    where
7731        T: std::iter::IntoIterator<Item = (K, V)>,
7732        K: std::convert::Into<std::string::String>,
7733        V: std::convert::Into<std::string::String>,
7734    {
7735        use std::iter::Iterator;
7736        self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7737        self
7738    }
7739
7740    /// Sets the value of [properties][crate::model::SparkSqlJob::properties].
7741    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7742    where
7743        T: std::iter::IntoIterator<Item = (K, V)>,
7744        K: std::convert::Into<std::string::String>,
7745        V: std::convert::Into<std::string::String>,
7746    {
7747        use std::iter::Iterator;
7748        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7749        self
7750    }
7751
7752    /// Sets the value of [queries][crate::model::SparkSqlJob::queries].
7753    ///
7754    /// Note that all the setters affecting `queries` are mutually
7755    /// exclusive.
7756    pub fn set_queries<
7757        T: std::convert::Into<std::option::Option<crate::model::spark_sql_job::Queries>>,
7758    >(
7759        mut self,
7760        v: T,
7761    ) -> Self {
7762        self.queries = v.into();
7763        self
7764    }
7765
7766    /// The value of [queries][crate::model::SparkSqlJob::queries]
7767    /// if it holds a `QueryFileUri`, `None` if the field is not set or
7768    /// holds a different branch.
7769    pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
7770        #[allow(unreachable_patterns)]
7771        self.queries.as_ref().and_then(|v| match v {
7772            crate::model::spark_sql_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
7773            _ => std::option::Option::None,
7774        })
7775    }
7776
7777    /// The value of [queries][crate::model::SparkSqlJob::queries]
7778    /// if it holds a `QueryList`, `None` if the field is not set or
7779    /// holds a different branch.
7780    pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
7781        #[allow(unreachable_patterns)]
7782        self.queries.as_ref().and_then(|v| match v {
7783            crate::model::spark_sql_job::Queries::QueryList(v) => std::option::Option::Some(v),
7784            _ => std::option::Option::None,
7785        })
7786    }
7787
7788    /// Sets the value of [queries][crate::model::SparkSqlJob::queries]
7789    /// to hold a `QueryFileUri`.
7790    ///
7791    /// Note that all the setters affecting `queries` are
7792    /// mutually exclusive.
7793    pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7794        self.queries =
7795            std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryFileUri(v.into()));
7796        self
7797    }
7798
7799    /// Sets the value of [queries][crate::model::SparkSqlJob::queries]
7800    /// to hold a `QueryList`.
7801    ///
7802    /// Note that all the setters affecting `queries` are
7803    /// mutually exclusive.
7804    pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
7805        mut self,
7806        v: T,
7807    ) -> Self {
7808        self.queries =
7809            std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryList(v.into()));
7810        self
7811    }
7812}
7813
7814impl wkt::message::Message for SparkSqlJob {
7815    fn typename() -> &'static str {
7816        "type.googleapis.com/google.cloud.dataproc.v1.SparkSqlJob"
7817    }
7818}
7819
7820/// Defines additional types related to [SparkSqlJob].
7821pub mod spark_sql_job {
7822    #[allow(unused_imports)]
7823    use super::*;
7824
7825    /// Required. The sequence of Spark SQL queries to execute, specified as
7826    /// either an HCFS file URI or as a list of queries.
7827    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7828    #[serde(rename_all = "camelCase")]
7829    #[non_exhaustive]
7830    pub enum Queries {
7831        /// The HCFS URI of the script that contains SQL queries.
7832        QueryFileUri(std::string::String),
7833        /// A list of queries.
7834        QueryList(std::boxed::Box<crate::model::QueryList>),
7835    }
7836}
7837
7838/// A Dataproc job for running [Apache Pig](https://pig.apache.org/)
7839/// queries on YARN.
7840#[serde_with::serde_as]
7841#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7842#[serde(default, rename_all = "camelCase")]
7843#[non_exhaustive]
7844pub struct PigJob {
7845    /// Optional. Whether to continue executing queries if a query fails.
7846    /// The default value is `false`. Setting to `true` can be useful when
7847    /// executing independent parallel queries.
7848    pub continue_on_failure: bool,
7849
7850    /// Optional. Mapping of query variable names to values (equivalent to the Pig
7851    /// command: `name=[value]`).
7852    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7853    pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
7854
7855    /// Optional. A mapping of property names to values, used to configure Pig.
7856    /// Properties that conflict with values set by the Dataproc API might be
7857    /// overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`,
7858    /// /etc/pig/conf/pig.properties, and classes in user code.
7859    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7860    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7861
7862    /// Optional. HCFS URIs of jar files to add to the CLASSPATH of
7863    /// the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
7864    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7865    pub jar_file_uris: std::vec::Vec<std::string::String>,
7866
7867    /// Optional. The runtime log config for job execution.
7868    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7869    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7870
7871    /// Required. The sequence of Pig queries to execute, specified as an HCFS
7872    /// file URI or a list of queries.
7873    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7874    pub queries: std::option::Option<crate::model::pig_job::Queries>,
7875
7876    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7877    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7878}
7879
7880impl PigJob {
7881    pub fn new() -> Self {
7882        std::default::Default::default()
7883    }
7884
7885    /// Sets the value of [continue_on_failure][crate::model::PigJob::continue_on_failure].
7886    pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7887        self.continue_on_failure = v.into();
7888        self
7889    }
7890
7891    /// Sets the value of [logging_config][crate::model::PigJob::logging_config].
7892    pub fn set_logging_config<
7893        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7894    >(
7895        mut self,
7896        v: T,
7897    ) -> Self {
7898        self.logging_config = v.into();
7899        self
7900    }
7901
7902    /// Sets the value of [jar_file_uris][crate::model::PigJob::jar_file_uris].
7903    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7904    where
7905        T: std::iter::IntoIterator<Item = V>,
7906        V: std::convert::Into<std::string::String>,
7907    {
7908        use std::iter::Iterator;
7909        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7910        self
7911    }
7912
7913    /// Sets the value of [script_variables][crate::model::PigJob::script_variables].
7914    pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
7915    where
7916        T: std::iter::IntoIterator<Item = (K, V)>,
7917        K: std::convert::Into<std::string::String>,
7918        V: std::convert::Into<std::string::String>,
7919    {
7920        use std::iter::Iterator;
7921        self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7922        self
7923    }
7924
7925    /// Sets the value of [properties][crate::model::PigJob::properties].
7926    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7927    where
7928        T: std::iter::IntoIterator<Item = (K, V)>,
7929        K: std::convert::Into<std::string::String>,
7930        V: std::convert::Into<std::string::String>,
7931    {
7932        use std::iter::Iterator;
7933        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7934        self
7935    }
7936
7937    /// Sets the value of [queries][crate::model::PigJob::queries].
7938    ///
7939    /// Note that all the setters affecting `queries` are mutually
7940    /// exclusive.
7941    pub fn set_queries<
7942        T: std::convert::Into<std::option::Option<crate::model::pig_job::Queries>>,
7943    >(
7944        mut self,
7945        v: T,
7946    ) -> Self {
7947        self.queries = v.into();
7948        self
7949    }
7950
7951    /// The value of [queries][crate::model::PigJob::queries]
7952    /// if it holds a `QueryFileUri`, `None` if the field is not set or
7953    /// holds a different branch.
7954    pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
7955        #[allow(unreachable_patterns)]
7956        self.queries.as_ref().and_then(|v| match v {
7957            crate::model::pig_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
7958            _ => std::option::Option::None,
7959        })
7960    }
7961
7962    /// The value of [queries][crate::model::PigJob::queries]
7963    /// if it holds a `QueryList`, `None` if the field is not set or
7964    /// holds a different branch.
7965    pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
7966        #[allow(unreachable_patterns)]
7967        self.queries.as_ref().and_then(|v| match v {
7968            crate::model::pig_job::Queries::QueryList(v) => std::option::Option::Some(v),
7969            _ => std::option::Option::None,
7970        })
7971    }
7972
7973    /// Sets the value of [queries][crate::model::PigJob::queries]
7974    /// to hold a `QueryFileUri`.
7975    ///
7976    /// Note that all the setters affecting `queries` are
7977    /// mutually exclusive.
7978    pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7979        self.queries =
7980            std::option::Option::Some(crate::model::pig_job::Queries::QueryFileUri(v.into()));
7981        self
7982    }
7983
7984    /// Sets the value of [queries][crate::model::PigJob::queries]
7985    /// to hold a `QueryList`.
7986    ///
7987    /// Note that all the setters affecting `queries` are
7988    /// mutually exclusive.
7989    pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
7990        mut self,
7991        v: T,
7992    ) -> Self {
7993        self.queries =
7994            std::option::Option::Some(crate::model::pig_job::Queries::QueryList(v.into()));
7995        self
7996    }
7997}
7998
7999impl wkt::message::Message for PigJob {
8000    fn typename() -> &'static str {
8001        "type.googleapis.com/google.cloud.dataproc.v1.PigJob"
8002    }
8003}
8004
8005/// Defines additional types related to [PigJob].
8006pub mod pig_job {
8007    #[allow(unused_imports)]
8008    use super::*;
8009
8010    /// Required. The sequence of Pig queries to execute, specified as an HCFS
8011    /// file URI or a list of queries.
8012    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8013    #[serde(rename_all = "camelCase")]
8014    #[non_exhaustive]
8015    pub enum Queries {
8016        /// The HCFS URI of the script that contains the Pig queries.
8017        QueryFileUri(std::string::String),
8018        /// A list of queries.
8019        QueryList(std::boxed::Box<crate::model::QueryList>),
8020    }
8021}
8022
8023/// A Dataproc job for running
8024/// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html)
8025/// applications on YARN.
8026#[serde_with::serde_as]
8027#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8028#[serde(default, rename_all = "camelCase")]
8029#[non_exhaustive]
8030pub struct SparkRJob {
8031    /// Required. The HCFS URI of the main R file to use as the driver.
8032    /// Must be a .R file.
8033    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8034    pub main_r_file_uri: std::string::String,
8035
8036    /// Optional. The arguments to pass to the driver.  Do not include arguments,
8037    /// such as `--conf`, that can be set as job properties, since a collision may
8038    /// occur that causes an incorrect job submission.
8039    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8040    pub args: std::vec::Vec<std::string::String>,
8041
8042    /// Optional. HCFS URIs of files to be placed in the working directory of
8043    /// each executor. Useful for naively parallel tasks.
8044    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8045    pub file_uris: std::vec::Vec<std::string::String>,
8046
8047    /// Optional. HCFS URIs of archives to be extracted into the working directory
8048    /// of each executor. Supported file types:
8049    /// .jar, .tar, .tar.gz, .tgz, and .zip.
8050    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8051    pub archive_uris: std::vec::Vec<std::string::String>,
8052
8053    /// Optional. A mapping of property names to values, used to configure SparkR.
8054    /// Properties that conflict with values set by the Dataproc API might be
8055    /// overwritten. Can include properties set in
8056    /// /etc/spark/conf/spark-defaults.conf and classes in user code.
8057    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8058    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8059
8060    /// Optional. The runtime log config for job execution.
8061    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8062    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8063
8064    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8065    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8066}
8067
8068impl SparkRJob {
8069    pub fn new() -> Self {
8070        std::default::Default::default()
8071    }
8072
8073    /// Sets the value of [main_r_file_uri][crate::model::SparkRJob::main_r_file_uri].
8074    pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8075        self.main_r_file_uri = v.into();
8076        self
8077    }
8078
8079    /// Sets the value of [logging_config][crate::model::SparkRJob::logging_config].
8080    pub fn set_logging_config<
8081        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8082    >(
8083        mut self,
8084        v: T,
8085    ) -> Self {
8086        self.logging_config = v.into();
8087        self
8088    }
8089
8090    /// Sets the value of [args][crate::model::SparkRJob::args].
8091    pub fn set_args<T, V>(mut self, v: T) -> Self
8092    where
8093        T: std::iter::IntoIterator<Item = V>,
8094        V: std::convert::Into<std::string::String>,
8095    {
8096        use std::iter::Iterator;
8097        self.args = v.into_iter().map(|i| i.into()).collect();
8098        self
8099    }
8100
8101    /// Sets the value of [file_uris][crate::model::SparkRJob::file_uris].
8102    pub fn set_file_uris<T, V>(mut self, v: T) -> Self
8103    where
8104        T: std::iter::IntoIterator<Item = V>,
8105        V: std::convert::Into<std::string::String>,
8106    {
8107        use std::iter::Iterator;
8108        self.file_uris = v.into_iter().map(|i| i.into()).collect();
8109        self
8110    }
8111
8112    /// Sets the value of [archive_uris][crate::model::SparkRJob::archive_uris].
8113    pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
8114    where
8115        T: std::iter::IntoIterator<Item = V>,
8116        V: std::convert::Into<std::string::String>,
8117    {
8118        use std::iter::Iterator;
8119        self.archive_uris = v.into_iter().map(|i| i.into()).collect();
8120        self
8121    }
8122
8123    /// Sets the value of [properties][crate::model::SparkRJob::properties].
8124    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8125    where
8126        T: std::iter::IntoIterator<Item = (K, V)>,
8127        K: std::convert::Into<std::string::String>,
8128        V: std::convert::Into<std::string::String>,
8129    {
8130        use std::iter::Iterator;
8131        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8132        self
8133    }
8134}
8135
8136impl wkt::message::Message for SparkRJob {
8137    fn typename() -> &'static str {
8138        "type.googleapis.com/google.cloud.dataproc.v1.SparkRJob"
8139    }
8140}
8141
8142/// A Dataproc job for running [Presto](https://prestosql.io/) queries.
8143/// **IMPORTANT**: The [Dataproc Presto Optional
8144/// Component](https://cloud.google.com/dataproc/docs/concepts/components/presto)
8145/// must be enabled when the cluster is created to submit a Presto job to the
8146/// cluster.
8147#[serde_with::serde_as]
8148#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8149#[serde(default, rename_all = "camelCase")]
8150#[non_exhaustive]
8151pub struct PrestoJob {
8152    /// Optional. Whether to continue executing queries if a query fails.
8153    /// The default value is `false`. Setting to `true` can be useful when
8154    /// executing independent parallel queries.
8155    pub continue_on_failure: bool,
8156
8157    /// Optional. The format in which query output will be displayed. See the
8158    /// Presto documentation for supported output formats
8159    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8160    pub output_format: std::string::String,
8161
8162    /// Optional. Presto client tags to attach to this query
8163    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8164    pub client_tags: std::vec::Vec<std::string::String>,
8165
8166    /// Optional. A mapping of property names to values. Used to set Presto
8167    /// [session properties](https://prestodb.io/docs/current/sql/set-session.html)
8168    /// Equivalent to using the --session flag in the Presto CLI
8169    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8170    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8171
8172    /// Optional. The runtime log config for job execution.
8173    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8174    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8175
8176    /// Required. The sequence of Presto queries to execute, specified as
8177    /// either an HCFS file URI or as a list of queries.
8178    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8179    pub queries: std::option::Option<crate::model::presto_job::Queries>,
8180
8181    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8182    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8183}
8184
8185impl PrestoJob {
8186    pub fn new() -> Self {
8187        std::default::Default::default()
8188    }
8189
8190    /// Sets the value of [continue_on_failure][crate::model::PrestoJob::continue_on_failure].
8191    pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8192        self.continue_on_failure = v.into();
8193        self
8194    }
8195
8196    /// Sets the value of [output_format][crate::model::PrestoJob::output_format].
8197    pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8198        self.output_format = v.into();
8199        self
8200    }
8201
8202    /// Sets the value of [logging_config][crate::model::PrestoJob::logging_config].
8203    pub fn set_logging_config<
8204        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8205    >(
8206        mut self,
8207        v: T,
8208    ) -> Self {
8209        self.logging_config = v.into();
8210        self
8211    }
8212
8213    /// Sets the value of [client_tags][crate::model::PrestoJob::client_tags].
8214    pub fn set_client_tags<T, V>(mut self, v: T) -> Self
8215    where
8216        T: std::iter::IntoIterator<Item = V>,
8217        V: std::convert::Into<std::string::String>,
8218    {
8219        use std::iter::Iterator;
8220        self.client_tags = v.into_iter().map(|i| i.into()).collect();
8221        self
8222    }
8223
8224    /// Sets the value of [properties][crate::model::PrestoJob::properties].
8225    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8226    where
8227        T: std::iter::IntoIterator<Item = (K, V)>,
8228        K: std::convert::Into<std::string::String>,
8229        V: std::convert::Into<std::string::String>,
8230    {
8231        use std::iter::Iterator;
8232        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8233        self
8234    }
8235
8236    /// Sets the value of [queries][crate::model::PrestoJob::queries].
8237    ///
8238    /// Note that all the setters affecting `queries` are mutually
8239    /// exclusive.
8240    pub fn set_queries<
8241        T: std::convert::Into<std::option::Option<crate::model::presto_job::Queries>>,
8242    >(
8243        mut self,
8244        v: T,
8245    ) -> Self {
8246        self.queries = v.into();
8247        self
8248    }
8249
8250    /// The value of [queries][crate::model::PrestoJob::queries]
8251    /// if it holds a `QueryFileUri`, `None` if the field is not set or
8252    /// holds a different branch.
8253    pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8254        #[allow(unreachable_patterns)]
8255        self.queries.as_ref().and_then(|v| match v {
8256            crate::model::presto_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8257            _ => std::option::Option::None,
8258        })
8259    }
8260
8261    /// The value of [queries][crate::model::PrestoJob::queries]
8262    /// if it holds a `QueryList`, `None` if the field is not set or
8263    /// holds a different branch.
8264    pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8265        #[allow(unreachable_patterns)]
8266        self.queries.as_ref().and_then(|v| match v {
8267            crate::model::presto_job::Queries::QueryList(v) => std::option::Option::Some(v),
8268            _ => std::option::Option::None,
8269        })
8270    }
8271
8272    /// Sets the value of [queries][crate::model::PrestoJob::queries]
8273    /// to hold a `QueryFileUri`.
8274    ///
8275    /// Note that all the setters affecting `queries` are
8276    /// mutually exclusive.
8277    pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8278        self.queries =
8279            std::option::Option::Some(crate::model::presto_job::Queries::QueryFileUri(v.into()));
8280        self
8281    }
8282
8283    /// Sets the value of [queries][crate::model::PrestoJob::queries]
8284    /// to hold a `QueryList`.
8285    ///
8286    /// Note that all the setters affecting `queries` are
8287    /// mutually exclusive.
8288    pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8289        mut self,
8290        v: T,
8291    ) -> Self {
8292        self.queries =
8293            std::option::Option::Some(crate::model::presto_job::Queries::QueryList(v.into()));
8294        self
8295    }
8296}
8297
8298impl wkt::message::Message for PrestoJob {
8299    fn typename() -> &'static str {
8300        "type.googleapis.com/google.cloud.dataproc.v1.PrestoJob"
8301    }
8302}
8303
8304/// Defines additional types related to [PrestoJob].
8305pub mod presto_job {
8306    #[allow(unused_imports)]
8307    use super::*;
8308
8309    /// Required. The sequence of Presto queries to execute, specified as
8310    /// either an HCFS file URI or as a list of queries.
8311    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8312    #[serde(rename_all = "camelCase")]
8313    #[non_exhaustive]
8314    pub enum Queries {
8315        /// The HCFS URI of the script that contains SQL queries.
8316        QueryFileUri(std::string::String),
8317        /// A list of queries.
8318        QueryList(std::boxed::Box<crate::model::QueryList>),
8319    }
8320}
8321
8322/// A Dataproc job for running [Trino](https://trino.io/) queries.
8323/// **IMPORTANT**: The [Dataproc Trino Optional
8324/// Component](https://cloud.google.com/dataproc/docs/concepts/components/trino)
8325/// must be enabled when the cluster is created to submit a Trino job to the
8326/// cluster.
8327#[serde_with::serde_as]
8328#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8329#[serde(default, rename_all = "camelCase")]
8330#[non_exhaustive]
8331pub struct TrinoJob {
8332    /// Optional. Whether to continue executing queries if a query fails.
8333    /// The default value is `false`. Setting to `true` can be useful when
8334    /// executing independent parallel queries.
8335    pub continue_on_failure: bool,
8336
8337    /// Optional. The format in which query output will be displayed. See the
8338    /// Trino documentation for supported output formats
8339    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8340    pub output_format: std::string::String,
8341
8342    /// Optional. Trino client tags to attach to this query
8343    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8344    pub client_tags: std::vec::Vec<std::string::String>,
8345
8346    /// Optional. A mapping of property names to values. Used to set Trino
8347    /// [session properties](https://trino.io/docs/current/sql/set-session.html)
8348    /// Equivalent to using the --session flag in the Trino CLI
8349    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8350    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8351
8352    /// Optional. The runtime log config for job execution.
8353    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8354    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8355
8356    /// Required. The sequence of Trino queries to execute, specified as
8357    /// either an HCFS file URI or as a list of queries.
8358    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8359    pub queries: std::option::Option<crate::model::trino_job::Queries>,
8360
8361    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8362    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8363}
8364
8365impl TrinoJob {
8366    pub fn new() -> Self {
8367        std::default::Default::default()
8368    }
8369
8370    /// Sets the value of [continue_on_failure][crate::model::TrinoJob::continue_on_failure].
8371    pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8372        self.continue_on_failure = v.into();
8373        self
8374    }
8375
8376    /// Sets the value of [output_format][crate::model::TrinoJob::output_format].
8377    pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8378        self.output_format = v.into();
8379        self
8380    }
8381
8382    /// Sets the value of [logging_config][crate::model::TrinoJob::logging_config].
8383    pub fn set_logging_config<
8384        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8385    >(
8386        mut self,
8387        v: T,
8388    ) -> Self {
8389        self.logging_config = v.into();
8390        self
8391    }
8392
8393    /// Sets the value of [client_tags][crate::model::TrinoJob::client_tags].
8394    pub fn set_client_tags<T, V>(mut self, v: T) -> Self
8395    where
8396        T: std::iter::IntoIterator<Item = V>,
8397        V: std::convert::Into<std::string::String>,
8398    {
8399        use std::iter::Iterator;
8400        self.client_tags = v.into_iter().map(|i| i.into()).collect();
8401        self
8402    }
8403
8404    /// Sets the value of [properties][crate::model::TrinoJob::properties].
8405    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8406    where
8407        T: std::iter::IntoIterator<Item = (K, V)>,
8408        K: std::convert::Into<std::string::String>,
8409        V: std::convert::Into<std::string::String>,
8410    {
8411        use std::iter::Iterator;
8412        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8413        self
8414    }
8415
8416    /// Sets the value of [queries][crate::model::TrinoJob::queries].
8417    ///
8418    /// Note that all the setters affecting `queries` are mutually
8419    /// exclusive.
8420    pub fn set_queries<
8421        T: std::convert::Into<std::option::Option<crate::model::trino_job::Queries>>,
8422    >(
8423        mut self,
8424        v: T,
8425    ) -> Self {
8426        self.queries = v.into();
8427        self
8428    }
8429
8430    /// The value of [queries][crate::model::TrinoJob::queries]
8431    /// if it holds a `QueryFileUri`, `None` if the field is not set or
8432    /// holds a different branch.
8433    pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8434        #[allow(unreachable_patterns)]
8435        self.queries.as_ref().and_then(|v| match v {
8436            crate::model::trino_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8437            _ => std::option::Option::None,
8438        })
8439    }
8440
8441    /// The value of [queries][crate::model::TrinoJob::queries]
8442    /// if it holds a `QueryList`, `None` if the field is not set or
8443    /// holds a different branch.
8444    pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8445        #[allow(unreachable_patterns)]
8446        self.queries.as_ref().and_then(|v| match v {
8447            crate::model::trino_job::Queries::QueryList(v) => std::option::Option::Some(v),
8448            _ => std::option::Option::None,
8449        })
8450    }
8451
8452    /// Sets the value of [queries][crate::model::TrinoJob::queries]
8453    /// to hold a `QueryFileUri`.
8454    ///
8455    /// Note that all the setters affecting `queries` are
8456    /// mutually exclusive.
8457    pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8458        self.queries =
8459            std::option::Option::Some(crate::model::trino_job::Queries::QueryFileUri(v.into()));
8460        self
8461    }
8462
8463    /// Sets the value of [queries][crate::model::TrinoJob::queries]
8464    /// to hold a `QueryList`.
8465    ///
8466    /// Note that all the setters affecting `queries` are
8467    /// mutually exclusive.
8468    pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8469        mut self,
8470        v: T,
8471    ) -> Self {
8472        self.queries =
8473            std::option::Option::Some(crate::model::trino_job::Queries::QueryList(v.into()));
8474        self
8475    }
8476}
8477
8478impl wkt::message::Message for TrinoJob {
8479    fn typename() -> &'static str {
8480        "type.googleapis.com/google.cloud.dataproc.v1.TrinoJob"
8481    }
8482}
8483
8484/// Defines additional types related to [TrinoJob].
8485pub mod trino_job {
8486    #[allow(unused_imports)]
8487    use super::*;
8488
8489    /// Required. The sequence of Trino queries to execute, specified as
8490    /// either an HCFS file URI or as a list of queries.
8491    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8492    #[serde(rename_all = "camelCase")]
8493    #[non_exhaustive]
8494    pub enum Queries {
8495        /// The HCFS URI of the script that contains SQL queries.
8496        QueryFileUri(std::string::String),
8497        /// A list of queries.
8498        QueryList(std::boxed::Box<crate::model::QueryList>),
8499    }
8500}
8501
8502/// A Dataproc job for running Apache Flink applications on YARN.
8503#[serde_with::serde_as]
8504#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8505#[serde(default, rename_all = "camelCase")]
8506#[non_exhaustive]
8507pub struct FlinkJob {
8508    /// Optional. The arguments to pass to the driver. Do not include arguments,
8509    /// such as `--conf`, that can be set as job properties, since a collision
8510    /// might occur that causes an incorrect job submission.
8511    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8512    pub args: std::vec::Vec<std::string::String>,
8513
8514    /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
8515    /// Flink driver and tasks.
8516    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8517    pub jar_file_uris: std::vec::Vec<std::string::String>,
8518
8519    /// Optional. HCFS URI of the savepoint, which contains the last saved progress
8520    /// for starting the current job.
8521    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8522    pub savepoint_uri: std::string::String,
8523
8524    /// Optional. A mapping of property names to values, used to configure Flink.
8525    /// Properties that conflict with values set by the Dataproc API might be
8526    /// overwritten. Can include properties set in
8527    /// `/etc/flink/conf/flink-defaults.conf` and classes in user code.
8528    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8529    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8530
8531    /// Optional. The runtime log config for job execution.
8532    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8533    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8534
8535    /// Required. The specification of the main method to call to drive the job.
8536    /// Specify either the jar file that contains the main class or the main class
8537    /// name. To pass both a main jar and a main class in the jar, add the jar to
8538    /// [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris], and then
8539    /// specify the main class name in
8540    /// [mainClass][google.cloud.dataproc.v1.FlinkJob.main_class].
8541    ///
8542    /// [google.cloud.dataproc.v1.FlinkJob.jar_file_uris]: crate::model::FlinkJob::jar_file_uris
8543    /// [google.cloud.dataproc.v1.FlinkJob.main_class]: crate::model::FlinkJob::driver
8544    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8545    pub driver: std::option::Option<crate::model::flink_job::Driver>,
8546
8547    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8548    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8549}
8550
8551impl FlinkJob {
8552    pub fn new() -> Self {
8553        std::default::Default::default()
8554    }
8555
8556    /// Sets the value of [savepoint_uri][crate::model::FlinkJob::savepoint_uri].
8557    pub fn set_savepoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8558        self.savepoint_uri = v.into();
8559        self
8560    }
8561
8562    /// Sets the value of [logging_config][crate::model::FlinkJob::logging_config].
8563    pub fn set_logging_config<
8564        T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8565    >(
8566        mut self,
8567        v: T,
8568    ) -> Self {
8569        self.logging_config = v.into();
8570        self
8571    }
8572
8573    /// Sets the value of [args][crate::model::FlinkJob::args].
8574    pub fn set_args<T, V>(mut self, v: T) -> Self
8575    where
8576        T: std::iter::IntoIterator<Item = V>,
8577        V: std::convert::Into<std::string::String>,
8578    {
8579        use std::iter::Iterator;
8580        self.args = v.into_iter().map(|i| i.into()).collect();
8581        self
8582    }
8583
8584    /// Sets the value of [jar_file_uris][crate::model::FlinkJob::jar_file_uris].
8585    pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8586    where
8587        T: std::iter::IntoIterator<Item = V>,
8588        V: std::convert::Into<std::string::String>,
8589    {
8590        use std::iter::Iterator;
8591        self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8592        self
8593    }
8594
8595    /// Sets the value of [properties][crate::model::FlinkJob::properties].
8596    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8597    where
8598        T: std::iter::IntoIterator<Item = (K, V)>,
8599        K: std::convert::Into<std::string::String>,
8600        V: std::convert::Into<std::string::String>,
8601    {
8602        use std::iter::Iterator;
8603        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8604        self
8605    }
8606
8607    /// Sets the value of [driver][crate::model::FlinkJob::driver].
8608    ///
8609    /// Note that all the setters affecting `driver` are mutually
8610    /// exclusive.
8611    pub fn set_driver<
8612        T: std::convert::Into<std::option::Option<crate::model::flink_job::Driver>>,
8613    >(
8614        mut self,
8615        v: T,
8616    ) -> Self {
8617        self.driver = v.into();
8618        self
8619    }
8620
8621    /// The value of [driver][crate::model::FlinkJob::driver]
8622    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
8623    /// holds a different branch.
8624    pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
8625        #[allow(unreachable_patterns)]
8626        self.driver.as_ref().and_then(|v| match v {
8627            crate::model::flink_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
8628            _ => std::option::Option::None,
8629        })
8630    }
8631
8632    /// The value of [driver][crate::model::FlinkJob::driver]
8633    /// if it holds a `MainClass`, `None` if the field is not set or
8634    /// holds a different branch.
8635    pub fn main_class(&self) -> std::option::Option<&std::string::String> {
8636        #[allow(unreachable_patterns)]
8637        self.driver.as_ref().and_then(|v| match v {
8638            crate::model::flink_job::Driver::MainClass(v) => std::option::Option::Some(v),
8639            _ => std::option::Option::None,
8640        })
8641    }
8642
8643    /// Sets the value of [driver][crate::model::FlinkJob::driver]
8644    /// to hold a `MainJarFileUri`.
8645    ///
8646    /// Note that all the setters affecting `driver` are
8647    /// mutually exclusive.
8648    pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
8649        mut self,
8650        v: T,
8651    ) -> Self {
8652        self.driver =
8653            std::option::Option::Some(crate::model::flink_job::Driver::MainJarFileUri(v.into()));
8654        self
8655    }
8656
8657    /// Sets the value of [driver][crate::model::FlinkJob::driver]
8658    /// to hold a `MainClass`.
8659    ///
8660    /// Note that all the setters affecting `driver` are
8661    /// mutually exclusive.
8662    pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8663        self.driver =
8664            std::option::Option::Some(crate::model::flink_job::Driver::MainClass(v.into()));
8665        self
8666    }
8667}
8668
8669impl wkt::message::Message for FlinkJob {
8670    fn typename() -> &'static str {
8671        "type.googleapis.com/google.cloud.dataproc.v1.FlinkJob"
8672    }
8673}
8674
8675/// Defines additional types related to [FlinkJob].
8676pub mod flink_job {
8677    #[allow(unused_imports)]
8678    use super::*;
8679
8680    /// Required. The specification of the main method to call to drive the job.
8681    /// Specify either the jar file that contains the main class or the main class
8682    /// name. To pass both a main jar and a main class in the jar, add the jar to
8683    /// [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris], and then
8684    /// specify the main class name in
8685    /// [mainClass][google.cloud.dataproc.v1.FlinkJob.main_class].
8686    ///
8687    /// [google.cloud.dataproc.v1.FlinkJob.jar_file_uris]: crate::model::FlinkJob::jar_file_uris
8688    /// [google.cloud.dataproc.v1.FlinkJob.main_class]: crate::model::FlinkJob::driver
8689    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8690    #[serde(rename_all = "camelCase")]
8691    #[non_exhaustive]
8692    pub enum Driver {
8693        /// The HCFS URI of the jar file that contains the main class.
8694        MainJarFileUri(std::string::String),
8695        /// The name of the driver's main class. The jar file that contains the class
8696        /// must be in the default CLASSPATH or specified in
8697        /// [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris].
8698        ///
8699        /// [google.cloud.dataproc.v1.FlinkJob.jar_file_uris]: crate::model::FlinkJob::jar_file_uris
8700        MainClass(std::string::String),
8701    }
8702}
8703
8704/// Dataproc job config.
8705#[serde_with::serde_as]
8706#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8707#[serde(default, rename_all = "camelCase")]
8708#[non_exhaustive]
8709pub struct JobPlacement {
8710    /// Required. The name of the cluster where the job will be submitted.
8711    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8712    pub cluster_name: std::string::String,
8713
8714    /// Output only. A cluster UUID generated by the Dataproc service when
8715    /// the job is submitted.
8716    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8717    pub cluster_uuid: std::string::String,
8718
8719    /// Optional. Cluster labels to identify a cluster where the job will be
8720    /// submitted.
8721    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8722    pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
8723
8724    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8725    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8726}
8727
8728impl JobPlacement {
8729    pub fn new() -> Self {
8730        std::default::Default::default()
8731    }
8732
8733    /// Sets the value of [cluster_name][crate::model::JobPlacement::cluster_name].
8734    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8735        self.cluster_name = v.into();
8736        self
8737    }
8738
8739    /// Sets the value of [cluster_uuid][crate::model::JobPlacement::cluster_uuid].
8740    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8741        self.cluster_uuid = v.into();
8742        self
8743    }
8744
8745    /// Sets the value of [cluster_labels][crate::model::JobPlacement::cluster_labels].
8746    pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
8747    where
8748        T: std::iter::IntoIterator<Item = (K, V)>,
8749        K: std::convert::Into<std::string::String>,
8750        V: std::convert::Into<std::string::String>,
8751    {
8752        use std::iter::Iterator;
8753        self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8754        self
8755    }
8756}
8757
8758impl wkt::message::Message for JobPlacement {
8759    fn typename() -> &'static str {
8760        "type.googleapis.com/google.cloud.dataproc.v1.JobPlacement"
8761    }
8762}
8763
8764/// Dataproc job status.
8765#[serde_with::serde_as]
8766#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8767#[serde(default, rename_all = "camelCase")]
8768#[non_exhaustive]
8769pub struct JobStatus {
8770    /// Output only. A state message specifying the overall job state.
8771    pub state: crate::model::job_status::State,
8772
8773    /// Optional. Output only. Job state details, such as an error
8774    /// description if the state is `ERROR`.
8775    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8776    pub details: std::string::String,
8777
8778    /// Output only. The time when this state was entered.
8779    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8780    pub state_start_time: std::option::Option<wkt::Timestamp>,
8781
8782    /// Output only. Additional state information, which includes
8783    /// status reported by the agent.
8784    pub substate: crate::model::job_status::Substate,
8785
8786    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8787    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8788}
8789
8790impl JobStatus {
8791    pub fn new() -> Self {
8792        std::default::Default::default()
8793    }
8794
8795    /// Sets the value of [state][crate::model::JobStatus::state].
8796    pub fn set_state<T: std::convert::Into<crate::model::job_status::State>>(
8797        mut self,
8798        v: T,
8799    ) -> Self {
8800        self.state = v.into();
8801        self
8802    }
8803
8804    /// Sets the value of [details][crate::model::JobStatus::details].
8805    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8806        self.details = v.into();
8807        self
8808    }
8809
8810    /// Sets the value of [state_start_time][crate::model::JobStatus::state_start_time].
8811    pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8812        mut self,
8813        v: T,
8814    ) -> Self {
8815        self.state_start_time = v.into();
8816        self
8817    }
8818
8819    /// Sets the value of [substate][crate::model::JobStatus::substate].
8820    pub fn set_substate<T: std::convert::Into<crate::model::job_status::Substate>>(
8821        mut self,
8822        v: T,
8823    ) -> Self {
8824        self.substate = v.into();
8825        self
8826    }
8827}
8828
8829impl wkt::message::Message for JobStatus {
8830    fn typename() -> &'static str {
8831        "type.googleapis.com/google.cloud.dataproc.v1.JobStatus"
8832    }
8833}
8834
8835/// Defines additional types related to [JobStatus].
8836pub mod job_status {
8837    #[allow(unused_imports)]
8838    use super::*;
8839
8840    /// The job state.
8841    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8842    pub struct State(i32);
8843
8844    impl State {
8845        /// The job state is unknown.
8846        pub const STATE_UNSPECIFIED: State = State::new(0);
8847
8848        /// The job is pending; it has been submitted, but is not yet running.
8849        pub const PENDING: State = State::new(1);
8850
8851        /// Job has been received by the service and completed initial setup;
8852        /// it will soon be submitted to the cluster.
8853        pub const SETUP_DONE: State = State::new(8);
8854
8855        /// The job is running on the cluster.
8856        pub const RUNNING: State = State::new(2);
8857
8858        /// A CancelJob request has been received, but is pending.
8859        pub const CANCEL_PENDING: State = State::new(3);
8860
8861        /// Transient in-flight resources have been canceled, and the request to
8862        /// cancel the running job has been issued to the cluster.
8863        pub const CANCEL_STARTED: State = State::new(7);
8864
8865        /// The job cancellation was successful.
8866        pub const CANCELLED: State = State::new(4);
8867
8868        /// The job has completed successfully.
8869        pub const DONE: State = State::new(5);
8870
8871        /// The job has completed, but encountered an error.
8872        pub const ERROR: State = State::new(6);
8873
8874        /// Job attempt has failed. The detail field contains failure details for
8875        /// this attempt.
8876        ///
8877        /// Applies to restartable jobs only.
8878        pub const ATTEMPT_FAILURE: State = State::new(9);
8879
8880        /// Creates a new State instance.
8881        pub(crate) const fn new(value: i32) -> Self {
8882            Self(value)
8883        }
8884
8885        /// Gets the enum value.
8886        pub fn value(&self) -> i32 {
8887            self.0
8888        }
8889
8890        /// Gets the enum value as a string.
8891        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8892            match self.0 {
8893                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
8894                1 => std::borrow::Cow::Borrowed("PENDING"),
8895                2 => std::borrow::Cow::Borrowed("RUNNING"),
8896                3 => std::borrow::Cow::Borrowed("CANCEL_PENDING"),
8897                4 => std::borrow::Cow::Borrowed("CANCELLED"),
8898                5 => std::borrow::Cow::Borrowed("DONE"),
8899                6 => std::borrow::Cow::Borrowed("ERROR"),
8900                7 => std::borrow::Cow::Borrowed("CANCEL_STARTED"),
8901                8 => std::borrow::Cow::Borrowed("SETUP_DONE"),
8902                9 => std::borrow::Cow::Borrowed("ATTEMPT_FAILURE"),
8903                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8904            }
8905        }
8906
8907        /// Creates an enum value from the value name.
8908        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8909            match name {
8910                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
8911                "PENDING" => std::option::Option::Some(Self::PENDING),
8912                "SETUP_DONE" => std::option::Option::Some(Self::SETUP_DONE),
8913                "RUNNING" => std::option::Option::Some(Self::RUNNING),
8914                "CANCEL_PENDING" => std::option::Option::Some(Self::CANCEL_PENDING),
8915                "CANCEL_STARTED" => std::option::Option::Some(Self::CANCEL_STARTED),
8916                "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
8917                "DONE" => std::option::Option::Some(Self::DONE),
8918                "ERROR" => std::option::Option::Some(Self::ERROR),
8919                "ATTEMPT_FAILURE" => std::option::Option::Some(Self::ATTEMPT_FAILURE),
8920                _ => std::option::Option::None,
8921            }
8922        }
8923    }
8924
8925    impl std::convert::From<i32> for State {
8926        fn from(value: i32) -> Self {
8927            Self::new(value)
8928        }
8929    }
8930
8931    impl std::default::Default for State {
8932        fn default() -> Self {
8933            Self::new(0)
8934        }
8935    }
8936
8937    /// The job substate.
8938    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8939    pub struct Substate(i32);
8940
8941    impl Substate {
8942        /// The job substate is unknown.
8943        pub const UNSPECIFIED: Substate = Substate::new(0);
8944
8945        /// The Job is submitted to the agent.
8946        ///
8947        /// Applies to RUNNING state.
8948        pub const SUBMITTED: Substate = Substate::new(1);
8949
8950        /// The Job has been received and is awaiting execution (it might be waiting
8951        /// for a condition to be met). See the "details" field for the reason for
8952        /// the delay.
8953        ///
8954        /// Applies to RUNNING state.
8955        pub const QUEUED: Substate = Substate::new(2);
8956
8957        /// The agent-reported status is out of date, which can be caused by a
8958        /// loss of communication between the agent and Dataproc. If the
8959        /// agent does not send a timely update, the job will fail.
8960        ///
8961        /// Applies to RUNNING state.
8962        pub const STALE_STATUS: Substate = Substate::new(3);
8963
8964        /// Creates a new Substate instance.
8965        pub(crate) const fn new(value: i32) -> Self {
8966            Self(value)
8967        }
8968
8969        /// Gets the enum value.
8970        pub fn value(&self) -> i32 {
8971            self.0
8972        }
8973
8974        /// Gets the enum value as a string.
8975        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8976            match self.0 {
8977                0 => std::borrow::Cow::Borrowed("UNSPECIFIED"),
8978                1 => std::borrow::Cow::Borrowed("SUBMITTED"),
8979                2 => std::borrow::Cow::Borrowed("QUEUED"),
8980                3 => std::borrow::Cow::Borrowed("STALE_STATUS"),
8981                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8982            }
8983        }
8984
8985        /// Creates an enum value from the value name.
8986        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8987            match name {
8988                "UNSPECIFIED" => std::option::Option::Some(Self::UNSPECIFIED),
8989                "SUBMITTED" => std::option::Option::Some(Self::SUBMITTED),
8990                "QUEUED" => std::option::Option::Some(Self::QUEUED),
8991                "STALE_STATUS" => std::option::Option::Some(Self::STALE_STATUS),
8992                _ => std::option::Option::None,
8993            }
8994        }
8995    }
8996
8997    impl std::convert::From<i32> for Substate {
8998        fn from(value: i32) -> Self {
8999            Self::new(value)
9000        }
9001    }
9002
9003    impl std::default::Default for Substate {
9004        fn default() -> Self {
9005            Self::new(0)
9006        }
9007    }
9008}
9009
9010/// Encapsulates the full scoping used to reference a job.
9011#[serde_with::serde_as]
9012#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9013#[serde(default, rename_all = "camelCase")]
9014#[non_exhaustive]
9015pub struct JobReference {
9016    /// Optional. The ID of the Google Cloud Platform project that the job belongs
9017    /// to. If specified, must match the request project ID.
9018    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9019    pub project_id: std::string::String,
9020
9021    /// Optional. The job ID, which must be unique within the project.
9022    ///
9023    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
9024    /// underscores (_), or hyphens (-). The maximum length is 100 characters.
9025    ///
9026    /// If not specified by the caller, the job ID will be provided by the server.
9027    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9028    pub job_id: std::string::String,
9029
9030    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9031    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9032}
9033
9034impl JobReference {
9035    pub fn new() -> Self {
9036        std::default::Default::default()
9037    }
9038
9039    /// Sets the value of [project_id][crate::model::JobReference::project_id].
9040    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9041        self.project_id = v.into();
9042        self
9043    }
9044
9045    /// Sets the value of [job_id][crate::model::JobReference::job_id].
9046    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9047        self.job_id = v.into();
9048        self
9049    }
9050}
9051
9052impl wkt::message::Message for JobReference {
9053    fn typename() -> &'static str {
9054        "type.googleapis.com/google.cloud.dataproc.v1.JobReference"
9055    }
9056}
9057
9058/// A YARN application created by a job. Application information is a subset of
9059/// \<code\>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto\</code\>.
9060///
9061/// **Beta Feature**: This report is available for testing purposes only. It may
9062/// be changed before final release.
9063#[serde_with::serde_as]
9064#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9065#[serde(default, rename_all = "camelCase")]
9066#[non_exhaustive]
9067pub struct YarnApplication {
9068    /// Required. The application name.
9069    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9070    pub name: std::string::String,
9071
9072    /// Required. The application state.
9073    pub state: crate::model::yarn_application::State,
9074
9075    /// Required. The numerical progress of the application, from 1 to 100.
9076    pub progress: f32,
9077
9078    /// Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or
9079    /// TimelineServer that provides application-specific information. The URL uses
9080    /// the internal hostname, and requires a proxy server for resolution and,
9081    /// possibly, access.
9082    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9083    pub tracking_url: std::string::String,
9084
9085    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9086    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9087}
9088
9089impl YarnApplication {
9090    pub fn new() -> Self {
9091        std::default::Default::default()
9092    }
9093
9094    /// Sets the value of [name][crate::model::YarnApplication::name].
9095    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9096        self.name = v.into();
9097        self
9098    }
9099
9100    /// Sets the value of [state][crate::model::YarnApplication::state].
9101    pub fn set_state<T: std::convert::Into<crate::model::yarn_application::State>>(
9102        mut self,
9103        v: T,
9104    ) -> Self {
9105        self.state = v.into();
9106        self
9107    }
9108
9109    /// Sets the value of [progress][crate::model::YarnApplication::progress].
9110    pub fn set_progress<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
9111        self.progress = v.into();
9112        self
9113    }
9114
9115    /// Sets the value of [tracking_url][crate::model::YarnApplication::tracking_url].
9116    pub fn set_tracking_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9117        self.tracking_url = v.into();
9118        self
9119    }
9120}
9121
9122impl wkt::message::Message for YarnApplication {
9123    fn typename() -> &'static str {
9124        "type.googleapis.com/google.cloud.dataproc.v1.YarnApplication"
9125    }
9126}
9127
9128/// Defines additional types related to [YarnApplication].
9129pub mod yarn_application {
9130    #[allow(unused_imports)]
9131    use super::*;
9132
9133    /// The application state, corresponding to
9134    /// \<code\>YarnProtos.YarnApplicationStateProto\</code\>.
9135    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9136    pub struct State(i32);
9137
9138    impl State {
9139        /// Status is unspecified.
9140        pub const STATE_UNSPECIFIED: State = State::new(0);
9141
9142        /// Status is NEW.
9143        pub const NEW: State = State::new(1);
9144
9145        /// Status is NEW_SAVING.
9146        pub const NEW_SAVING: State = State::new(2);
9147
9148        /// Status is SUBMITTED.
9149        pub const SUBMITTED: State = State::new(3);
9150
9151        /// Status is ACCEPTED.
9152        pub const ACCEPTED: State = State::new(4);
9153
9154        /// Status is RUNNING.
9155        pub const RUNNING: State = State::new(5);
9156
9157        /// Status is FINISHED.
9158        pub const FINISHED: State = State::new(6);
9159
9160        /// Status is FAILED.
9161        pub const FAILED: State = State::new(7);
9162
9163        /// Status is KILLED.
9164        pub const KILLED: State = State::new(8);
9165
9166        /// Creates a new State instance.
9167        pub(crate) const fn new(value: i32) -> Self {
9168            Self(value)
9169        }
9170
9171        /// Gets the enum value.
9172        pub fn value(&self) -> i32 {
9173            self.0
9174        }
9175
9176        /// Gets the enum value as a string.
9177        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9178            match self.0 {
9179                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
9180                1 => std::borrow::Cow::Borrowed("NEW"),
9181                2 => std::borrow::Cow::Borrowed("NEW_SAVING"),
9182                3 => std::borrow::Cow::Borrowed("SUBMITTED"),
9183                4 => std::borrow::Cow::Borrowed("ACCEPTED"),
9184                5 => std::borrow::Cow::Borrowed("RUNNING"),
9185                6 => std::borrow::Cow::Borrowed("FINISHED"),
9186                7 => std::borrow::Cow::Borrowed("FAILED"),
9187                8 => std::borrow::Cow::Borrowed("KILLED"),
9188                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9189            }
9190        }
9191
9192        /// Creates an enum value from the value name.
9193        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9194            match name {
9195                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
9196                "NEW" => std::option::Option::Some(Self::NEW),
9197                "NEW_SAVING" => std::option::Option::Some(Self::NEW_SAVING),
9198                "SUBMITTED" => std::option::Option::Some(Self::SUBMITTED),
9199                "ACCEPTED" => std::option::Option::Some(Self::ACCEPTED),
9200                "RUNNING" => std::option::Option::Some(Self::RUNNING),
9201                "FINISHED" => std::option::Option::Some(Self::FINISHED),
9202                "FAILED" => std::option::Option::Some(Self::FAILED),
9203                "KILLED" => std::option::Option::Some(Self::KILLED),
9204                _ => std::option::Option::None,
9205            }
9206        }
9207    }
9208
9209    impl std::convert::From<i32> for State {
9210        fn from(value: i32) -> Self {
9211            Self::new(value)
9212        }
9213    }
9214
9215    impl std::default::Default for State {
9216        fn default() -> Self {
9217            Self::new(0)
9218        }
9219    }
9220}
9221
9222/// A Dataproc job resource.
9223#[serde_with::serde_as]
9224#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9225#[serde(default, rename_all = "camelCase")]
9226#[non_exhaustive]
9227pub struct Job {
9228    /// Optional. The fully qualified reference to the job, which can be used to
9229    /// obtain the equivalent REST path of the job resource. If this property
9230    /// is not specified when a job is created, the server generates a
9231    /// \<code\>job_id\</code\>.
9232    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9233    pub reference: std::option::Option<crate::model::JobReference>,
9234
9235    /// Required. Job information, including how, when, and where to
9236    /// run the job.
9237    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9238    pub placement: std::option::Option<crate::model::JobPlacement>,
9239
9240    /// Output only. The job status. Additional application-specific
9241    /// status information might be contained in the \<code\>type_job\</code\>
9242    /// and \<code\>yarn_applications\</code\> fields.
9243    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9244    pub status: std::option::Option<crate::model::JobStatus>,
9245
9246    /// Output only. The previous job status.
9247    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9248    pub status_history: std::vec::Vec<crate::model::JobStatus>,
9249
9250    /// Output only. The collection of YARN applications spun up by this job.
9251    ///
9252    /// **Beta** Feature: This report is available for testing purposes only. It
9253    /// might be changed before final release.
9254    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9255    pub yarn_applications: std::vec::Vec<crate::model::YarnApplication>,
9256
9257    /// Output only. A URI pointing to the location of the stdout of the job's
9258    /// driver program.
9259    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9260    pub driver_output_resource_uri: std::string::String,
9261
9262    /// Output only. If present, the location of miscellaneous control files
9263    /// which can be used as part of job setup and handling. If not present,
9264    /// control files might be placed in the same location as `driver_output_uri`.
9265    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9266    pub driver_control_files_uri: std::string::String,
9267
9268    /// Optional. The labels to associate with this job.
9269    /// Label **keys** must contain 1 to 63 characters, and must conform to
9270    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
9271    /// Label **values** can be empty, but, if present, must contain 1 to 63
9272    /// characters, and must conform to [RFC
9273    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
9274    /// associated with a job.
9275    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
9276    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9277
9278    /// Optional. Job scheduling configuration.
9279    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9280    pub scheduling: std::option::Option<crate::model::JobScheduling>,
9281
9282    /// Output only. A UUID that uniquely identifies a job within the project
9283    /// over time. This is in contrast to a user-settable reference.job_id that
9284    /// might be reused over time.
9285    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9286    pub job_uuid: std::string::String,
9287
9288    /// Output only. Indicates whether the job is completed. If the value is
9289    /// `false`, the job is still in progress. If `true`, the job is completed, and
9290    /// `status.state` field will indicate if it was successful, failed,
9291    /// or cancelled.
9292    pub done: bool,
9293
9294    /// Optional. Driver scheduling configuration.
9295    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9296    pub driver_scheduling_config: std::option::Option<crate::model::DriverSchedulingConfig>,
9297
9298    /// Required. The application/framework-specific portion of the job.
9299    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
9300    pub type_job: std::option::Option<crate::model::job::TypeJob>,
9301
9302    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9303    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9304}
9305
9306impl Job {
9307    pub fn new() -> Self {
9308        std::default::Default::default()
9309    }
9310
9311    /// Sets the value of [reference][crate::model::Job::reference].
9312    pub fn set_reference<T: std::convert::Into<std::option::Option<crate::model::JobReference>>>(
9313        mut self,
9314        v: T,
9315    ) -> Self {
9316        self.reference = v.into();
9317        self
9318    }
9319
9320    /// Sets the value of [placement][crate::model::Job::placement].
9321    pub fn set_placement<T: std::convert::Into<std::option::Option<crate::model::JobPlacement>>>(
9322        mut self,
9323        v: T,
9324    ) -> Self {
9325        self.placement = v.into();
9326        self
9327    }
9328
9329    /// Sets the value of [status][crate::model::Job::status].
9330    pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::JobStatus>>>(
9331        mut self,
9332        v: T,
9333    ) -> Self {
9334        self.status = v.into();
9335        self
9336    }
9337
9338    /// Sets the value of [driver_output_resource_uri][crate::model::Job::driver_output_resource_uri].
9339    pub fn set_driver_output_resource_uri<T: std::convert::Into<std::string::String>>(
9340        mut self,
9341        v: T,
9342    ) -> Self {
9343        self.driver_output_resource_uri = v.into();
9344        self
9345    }
9346
9347    /// Sets the value of [driver_control_files_uri][crate::model::Job::driver_control_files_uri].
9348    pub fn set_driver_control_files_uri<T: std::convert::Into<std::string::String>>(
9349        mut self,
9350        v: T,
9351    ) -> Self {
9352        self.driver_control_files_uri = v.into();
9353        self
9354    }
9355
9356    /// Sets the value of [scheduling][crate::model::Job::scheduling].
9357    pub fn set_scheduling<
9358        T: std::convert::Into<std::option::Option<crate::model::JobScheduling>>,
9359    >(
9360        mut self,
9361        v: T,
9362    ) -> Self {
9363        self.scheduling = v.into();
9364        self
9365    }
9366
9367    /// Sets the value of [job_uuid][crate::model::Job::job_uuid].
9368    pub fn set_job_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9369        self.job_uuid = v.into();
9370        self
9371    }
9372
9373    /// Sets the value of [done][crate::model::Job::done].
9374    pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9375        self.done = v.into();
9376        self
9377    }
9378
9379    /// Sets the value of [driver_scheduling_config][crate::model::Job::driver_scheduling_config].
9380    pub fn set_driver_scheduling_config<
9381        T: std::convert::Into<std::option::Option<crate::model::DriverSchedulingConfig>>,
9382    >(
9383        mut self,
9384        v: T,
9385    ) -> Self {
9386        self.driver_scheduling_config = v.into();
9387        self
9388    }
9389
9390    /// Sets the value of [status_history][crate::model::Job::status_history].
9391    pub fn set_status_history<T, V>(mut self, v: T) -> Self
9392    where
9393        T: std::iter::IntoIterator<Item = V>,
9394        V: std::convert::Into<crate::model::JobStatus>,
9395    {
9396        use std::iter::Iterator;
9397        self.status_history = v.into_iter().map(|i| i.into()).collect();
9398        self
9399    }
9400
9401    /// Sets the value of [yarn_applications][crate::model::Job::yarn_applications].
9402    pub fn set_yarn_applications<T, V>(mut self, v: T) -> Self
9403    where
9404        T: std::iter::IntoIterator<Item = V>,
9405        V: std::convert::Into<crate::model::YarnApplication>,
9406    {
9407        use std::iter::Iterator;
9408        self.yarn_applications = v.into_iter().map(|i| i.into()).collect();
9409        self
9410    }
9411
9412    /// Sets the value of [labels][crate::model::Job::labels].
9413    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9414    where
9415        T: std::iter::IntoIterator<Item = (K, V)>,
9416        K: std::convert::Into<std::string::String>,
9417        V: std::convert::Into<std::string::String>,
9418    {
9419        use std::iter::Iterator;
9420        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9421        self
9422    }
9423
9424    /// Sets the value of [type_job][crate::model::Job::type_job].
9425    ///
9426    /// Note that all the setters affecting `type_job` are mutually
9427    /// exclusive.
9428    pub fn set_type_job<T: std::convert::Into<std::option::Option<crate::model::job::TypeJob>>>(
9429        mut self,
9430        v: T,
9431    ) -> Self {
9432        self.type_job = v.into();
9433        self
9434    }
9435
9436    /// The value of [type_job][crate::model::Job::type_job]
9437    /// if it holds a `HadoopJob`, `None` if the field is not set or
9438    /// holds a different branch.
9439    pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
9440        #[allow(unreachable_patterns)]
9441        self.type_job.as_ref().and_then(|v| match v {
9442            crate::model::job::TypeJob::HadoopJob(v) => std::option::Option::Some(v),
9443            _ => std::option::Option::None,
9444        })
9445    }
9446
9447    /// The value of [type_job][crate::model::Job::type_job]
9448    /// if it holds a `SparkJob`, `None` if the field is not set or
9449    /// holds a different branch.
9450    pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
9451        #[allow(unreachable_patterns)]
9452        self.type_job.as_ref().and_then(|v| match v {
9453            crate::model::job::TypeJob::SparkJob(v) => std::option::Option::Some(v),
9454            _ => std::option::Option::None,
9455        })
9456    }
9457
9458    /// The value of [type_job][crate::model::Job::type_job]
9459    /// if it holds a `PysparkJob`, `None` if the field is not set or
9460    /// holds a different branch.
9461    pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
9462        #[allow(unreachable_patterns)]
9463        self.type_job.as_ref().and_then(|v| match v {
9464            crate::model::job::TypeJob::PysparkJob(v) => std::option::Option::Some(v),
9465            _ => std::option::Option::None,
9466        })
9467    }
9468
9469    /// The value of [type_job][crate::model::Job::type_job]
9470    /// if it holds a `HiveJob`, `None` if the field is not set or
9471    /// holds a different branch.
9472    pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
9473        #[allow(unreachable_patterns)]
9474        self.type_job.as_ref().and_then(|v| match v {
9475            crate::model::job::TypeJob::HiveJob(v) => std::option::Option::Some(v),
9476            _ => std::option::Option::None,
9477        })
9478    }
9479
9480    /// The value of [type_job][crate::model::Job::type_job]
9481    /// if it holds a `PigJob`, `None` if the field is not set or
9482    /// holds a different branch.
9483    pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
9484        #[allow(unreachable_patterns)]
9485        self.type_job.as_ref().and_then(|v| match v {
9486            crate::model::job::TypeJob::PigJob(v) => std::option::Option::Some(v),
9487            _ => std::option::Option::None,
9488        })
9489    }
9490
9491    /// The value of [type_job][crate::model::Job::type_job]
9492    /// if it holds a `SparkRJob`, `None` if the field is not set or
9493    /// holds a different branch.
9494    pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
9495        #[allow(unreachable_patterns)]
9496        self.type_job.as_ref().and_then(|v| match v {
9497            crate::model::job::TypeJob::SparkRJob(v) => std::option::Option::Some(v),
9498            _ => std::option::Option::None,
9499        })
9500    }
9501
9502    /// The value of [type_job][crate::model::Job::type_job]
9503    /// if it holds a `SparkSqlJob`, `None` if the field is not set or
9504    /// holds a different branch.
9505    pub fn spark_sql_job(
9506        &self,
9507    ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
9508        #[allow(unreachable_patterns)]
9509        self.type_job.as_ref().and_then(|v| match v {
9510            crate::model::job::TypeJob::SparkSqlJob(v) => std::option::Option::Some(v),
9511            _ => std::option::Option::None,
9512        })
9513    }
9514
9515    /// The value of [type_job][crate::model::Job::type_job]
9516    /// if it holds a `PrestoJob`, `None` if the field is not set or
9517    /// holds a different branch.
9518    pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
9519        #[allow(unreachable_patterns)]
9520        self.type_job.as_ref().and_then(|v| match v {
9521            crate::model::job::TypeJob::PrestoJob(v) => std::option::Option::Some(v),
9522            _ => std::option::Option::None,
9523        })
9524    }
9525
9526    /// The value of [type_job][crate::model::Job::type_job]
9527    /// if it holds a `TrinoJob`, `None` if the field is not set or
9528    /// holds a different branch.
9529    pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
9530        #[allow(unreachable_patterns)]
9531        self.type_job.as_ref().and_then(|v| match v {
9532            crate::model::job::TypeJob::TrinoJob(v) => std::option::Option::Some(v),
9533            _ => std::option::Option::None,
9534        })
9535    }
9536
9537    /// The value of [type_job][crate::model::Job::type_job]
9538    /// if it holds a `FlinkJob`, `None` if the field is not set or
9539    /// holds a different branch.
9540    pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
9541        #[allow(unreachable_patterns)]
9542        self.type_job.as_ref().and_then(|v| match v {
9543            crate::model::job::TypeJob::FlinkJob(v) => std::option::Option::Some(v),
9544            _ => std::option::Option::None,
9545        })
9546    }
9547
9548    /// Sets the value of [type_job][crate::model::Job::type_job]
9549    /// to hold a `HadoopJob`.
9550    ///
9551    /// Note that all the setters affecting `type_job` are
9552    /// mutually exclusive.
9553    pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
9554        mut self,
9555        v: T,
9556    ) -> Self {
9557        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HadoopJob(v.into()));
9558        self
9559    }
9560
9561    /// Sets the value of [type_job][crate::model::Job::type_job]
9562    /// to hold a `SparkJob`.
9563    ///
9564    /// Note that all the setters affecting `type_job` are
9565    /// mutually exclusive.
9566    pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
9567        mut self,
9568        v: T,
9569    ) -> Self {
9570        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkJob(v.into()));
9571        self
9572    }
9573
9574    /// Sets the value of [type_job][crate::model::Job::type_job]
9575    /// to hold a `PysparkJob`.
9576    ///
9577    /// Note that all the setters affecting `type_job` are
9578    /// mutually exclusive.
9579    pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
9580        mut self,
9581        v: T,
9582    ) -> Self {
9583        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PysparkJob(v.into()));
9584        self
9585    }
9586
9587    /// Sets the value of [type_job][crate::model::Job::type_job]
9588    /// to hold a `HiveJob`.
9589    ///
9590    /// Note that all the setters affecting `type_job` are
9591    /// mutually exclusive.
9592    pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
9593        mut self,
9594        v: T,
9595    ) -> Self {
9596        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HiveJob(v.into()));
9597        self
9598    }
9599
9600    /// Sets the value of [type_job][crate::model::Job::type_job]
9601    /// to hold a `PigJob`.
9602    ///
9603    /// Note that all the setters affecting `type_job` are
9604    /// mutually exclusive.
9605    pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
9606        mut self,
9607        v: T,
9608    ) -> Self {
9609        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PigJob(v.into()));
9610        self
9611    }
9612
9613    /// Sets the value of [type_job][crate::model::Job::type_job]
9614    /// to hold a `SparkRJob`.
9615    ///
9616    /// Note that all the setters affecting `type_job` are
9617    /// mutually exclusive.
9618    pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
9619        mut self,
9620        v: T,
9621    ) -> Self {
9622        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkRJob(v.into()));
9623        self
9624    }
9625
9626    /// Sets the value of [type_job][crate::model::Job::type_job]
9627    /// to hold a `SparkSqlJob`.
9628    ///
9629    /// Note that all the setters affecting `type_job` are
9630    /// mutually exclusive.
9631    pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
9632        mut self,
9633        v: T,
9634    ) -> Self {
9635        self.type_job =
9636            std::option::Option::Some(crate::model::job::TypeJob::SparkSqlJob(v.into()));
9637        self
9638    }
9639
9640    /// Sets the value of [type_job][crate::model::Job::type_job]
9641    /// to hold a `PrestoJob`.
9642    ///
9643    /// Note that all the setters affecting `type_job` are
9644    /// mutually exclusive.
9645    pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
9646        mut self,
9647        v: T,
9648    ) -> Self {
9649        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PrestoJob(v.into()));
9650        self
9651    }
9652
9653    /// Sets the value of [type_job][crate::model::Job::type_job]
9654    /// to hold a `TrinoJob`.
9655    ///
9656    /// Note that all the setters affecting `type_job` are
9657    /// mutually exclusive.
9658    pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
9659        mut self,
9660        v: T,
9661    ) -> Self {
9662        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::TrinoJob(v.into()));
9663        self
9664    }
9665
9666    /// Sets the value of [type_job][crate::model::Job::type_job]
9667    /// to hold a `FlinkJob`.
9668    ///
9669    /// Note that all the setters affecting `type_job` are
9670    /// mutually exclusive.
9671    pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
9672        mut self,
9673        v: T,
9674    ) -> Self {
9675        self.type_job = std::option::Option::Some(crate::model::job::TypeJob::FlinkJob(v.into()));
9676        self
9677    }
9678}
9679
9680impl wkt::message::Message for Job {
9681    fn typename() -> &'static str {
9682        "type.googleapis.com/google.cloud.dataproc.v1.Job"
9683    }
9684}
9685
9686/// Defines additional types related to [Job].
9687pub mod job {
9688    #[allow(unused_imports)]
9689    use super::*;
9690
9691    /// Required. The application/framework-specific portion of the job.
9692    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9693    #[serde(rename_all = "camelCase")]
9694    #[non_exhaustive]
9695    pub enum TypeJob {
9696        /// Optional. Job is a Hadoop job.
9697        HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
9698        /// Optional. Job is a Spark job.
9699        SparkJob(std::boxed::Box<crate::model::SparkJob>),
9700        /// Optional. Job is a PySpark job.
9701        PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
9702        /// Optional. Job is a Hive job.
9703        HiveJob(std::boxed::Box<crate::model::HiveJob>),
9704        /// Optional. Job is a Pig job.
9705        PigJob(std::boxed::Box<crate::model::PigJob>),
9706        /// Optional. Job is a SparkR job.
9707        SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
9708        /// Optional. Job is a SparkSql job.
9709        SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
9710        /// Optional. Job is a Presto job.
9711        PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
9712        /// Optional. Job is a Trino job.
9713        TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
9714        /// Optional. Job is a Flink job.
9715        FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
9716    }
9717}
9718
9719/// Driver scheduling configuration.
9720#[serde_with::serde_as]
9721#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9722#[serde(default, rename_all = "camelCase")]
9723#[non_exhaustive]
9724pub struct DriverSchedulingConfig {
9725    /// Required. The amount of memory in MB the driver is requesting.
9726    pub memory_mb: i32,
9727
9728    /// Required. The number of vCPUs the driver is requesting.
9729    pub vcores: i32,
9730
9731    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9732    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9733}
9734
9735impl DriverSchedulingConfig {
9736    pub fn new() -> Self {
9737        std::default::Default::default()
9738    }
9739
9740    /// Sets the value of [memory_mb][crate::model::DriverSchedulingConfig::memory_mb].
9741    pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9742        self.memory_mb = v.into();
9743        self
9744    }
9745
9746    /// Sets the value of [vcores][crate::model::DriverSchedulingConfig::vcores].
9747    pub fn set_vcores<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9748        self.vcores = v.into();
9749        self
9750    }
9751}
9752
9753impl wkt::message::Message for DriverSchedulingConfig {
9754    fn typename() -> &'static str {
9755        "type.googleapis.com/google.cloud.dataproc.v1.DriverSchedulingConfig"
9756    }
9757}
9758
9759/// Job scheduling options.
9760#[serde_with::serde_as]
9761#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9762#[serde(default, rename_all = "camelCase")]
9763#[non_exhaustive]
9764pub struct JobScheduling {
9765    /// Optional. Maximum number of times per hour a driver can be restarted as
9766    /// a result of driver exiting with non-zero code before job is
9767    /// reported failed.
9768    ///
9769    /// A job might be reported as thrashing if the driver exits with a non-zero
9770    /// code four times within a 10-minute window.
9771    ///
9772    /// Maximum value is 10.
9773    ///
9774    /// **Note:** This restartable job option is not supported in Dataproc
9775    /// [workflow templates]
9776    /// (<https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template>).
9777    pub max_failures_per_hour: i32,
9778
9779    /// Optional. Maximum total number of times a driver can be restarted as a
9780    /// result of the driver exiting with a non-zero code. After the maximum number
9781    /// is reached, the job will be reported as failed.
9782    ///
9783    /// Maximum value is 240.
9784    ///
9785    /// **Note:** Currently, this restartable job option is
9786    /// not supported in Dataproc
9787    /// [workflow
9788    /// templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template).
9789    pub max_failures_total: i32,
9790
9791    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9792    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9793}
9794
9795impl JobScheduling {
9796    pub fn new() -> Self {
9797        std::default::Default::default()
9798    }
9799
9800    /// Sets the value of [max_failures_per_hour][crate::model::JobScheduling::max_failures_per_hour].
9801    pub fn set_max_failures_per_hour<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9802        self.max_failures_per_hour = v.into();
9803        self
9804    }
9805
9806    /// Sets the value of [max_failures_total][crate::model::JobScheduling::max_failures_total].
9807    pub fn set_max_failures_total<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9808        self.max_failures_total = v.into();
9809        self
9810    }
9811}
9812
9813impl wkt::message::Message for JobScheduling {
9814    fn typename() -> &'static str {
9815        "type.googleapis.com/google.cloud.dataproc.v1.JobScheduling"
9816    }
9817}
9818
9819/// A request to submit a job.
9820#[serde_with::serde_as]
9821#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9822#[serde(default, rename_all = "camelCase")]
9823#[non_exhaustive]
9824pub struct SubmitJobRequest {
9825    /// Required. The ID of the Google Cloud Platform project that the job
9826    /// belongs to.
9827    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9828    pub project_id: std::string::String,
9829
9830    /// Required. The Dataproc region in which to handle the request.
9831    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9832    pub region: std::string::String,
9833
9834    /// Required. The job resource.
9835    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9836    pub job: std::option::Option<crate::model::Job>,
9837
9838    /// Optional. A unique id used to identify the request. If the server
9839    /// receives two
9840    /// [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s
9841    /// with the same id, then the second request will be ignored and the
9842    /// first [Job][google.cloud.dataproc.v1.Job] created and stored in the backend
9843    /// is returned.
9844    ///
9845    /// It is recommended to always set this value to a
9846    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
9847    ///
9848    /// The id must contain only letters (a-z, A-Z), numbers (0-9),
9849    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
9850    ///
9851    /// [google.cloud.dataproc.v1.Job]: crate::model::Job
9852    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9853    pub request_id: std::string::String,
9854
9855    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9856    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9857}
9858
9859impl SubmitJobRequest {
9860    pub fn new() -> Self {
9861        std::default::Default::default()
9862    }
9863
9864    /// Sets the value of [project_id][crate::model::SubmitJobRequest::project_id].
9865    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9866        self.project_id = v.into();
9867        self
9868    }
9869
9870    /// Sets the value of [region][crate::model::SubmitJobRequest::region].
9871    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9872        self.region = v.into();
9873        self
9874    }
9875
9876    /// Sets the value of [job][crate::model::SubmitJobRequest::job].
9877    pub fn set_job<T: std::convert::Into<std::option::Option<crate::model::Job>>>(
9878        mut self,
9879        v: T,
9880    ) -> Self {
9881        self.job = v.into();
9882        self
9883    }
9884
9885    /// Sets the value of [request_id][crate::model::SubmitJobRequest::request_id].
9886    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9887        self.request_id = v.into();
9888        self
9889    }
9890}
9891
9892impl wkt::message::Message for SubmitJobRequest {
9893    fn typename() -> &'static str {
9894        "type.googleapis.com/google.cloud.dataproc.v1.SubmitJobRequest"
9895    }
9896}
9897
9898/// Job Operation metadata.
9899#[serde_with::serde_as]
9900#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9901#[serde(default, rename_all = "camelCase")]
9902#[non_exhaustive]
9903pub struct JobMetadata {
9904    /// Output only. The job id.
9905    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9906    pub job_id: std::string::String,
9907
9908    /// Output only. Most recent job status.
9909    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9910    pub status: std::option::Option<crate::model::JobStatus>,
9911
9912    /// Output only. Operation type.
9913    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9914    pub operation_type: std::string::String,
9915
9916    /// Output only. Job submission time.
9917    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9918    pub start_time: std::option::Option<wkt::Timestamp>,
9919
9920    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9921    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9922}
9923
9924impl JobMetadata {
9925    pub fn new() -> Self {
9926        std::default::Default::default()
9927    }
9928
9929    /// Sets the value of [job_id][crate::model::JobMetadata::job_id].
9930    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9931        self.job_id = v.into();
9932        self
9933    }
9934
9935    /// Sets the value of [status][crate::model::JobMetadata::status].
9936    pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::JobStatus>>>(
9937        mut self,
9938        v: T,
9939    ) -> Self {
9940        self.status = v.into();
9941        self
9942    }
9943
9944    /// Sets the value of [operation_type][crate::model::JobMetadata::operation_type].
9945    pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9946        self.operation_type = v.into();
9947        self
9948    }
9949
9950    /// Sets the value of [start_time][crate::model::JobMetadata::start_time].
9951    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
9952        mut self,
9953        v: T,
9954    ) -> Self {
9955        self.start_time = v.into();
9956        self
9957    }
9958}
9959
9960impl wkt::message::Message for JobMetadata {
9961    fn typename() -> &'static str {
9962        "type.googleapis.com/google.cloud.dataproc.v1.JobMetadata"
9963    }
9964}
9965
9966/// A request to get the resource representation for a job in a project.
9967#[serde_with::serde_as]
9968#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9969#[serde(default, rename_all = "camelCase")]
9970#[non_exhaustive]
9971pub struct GetJobRequest {
9972    /// Required. The ID of the Google Cloud Platform project that the job
9973    /// belongs to.
9974    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9975    pub project_id: std::string::String,
9976
9977    /// Required. The Dataproc region in which to handle the request.
9978    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9979    pub region: std::string::String,
9980
9981    /// Required. The job ID.
9982    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9983    pub job_id: std::string::String,
9984
9985    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9986    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9987}
9988
9989impl GetJobRequest {
9990    pub fn new() -> Self {
9991        std::default::Default::default()
9992    }
9993
9994    /// Sets the value of [project_id][crate::model::GetJobRequest::project_id].
9995    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9996        self.project_id = v.into();
9997        self
9998    }
9999
10000    /// Sets the value of [region][crate::model::GetJobRequest::region].
10001    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10002        self.region = v.into();
10003        self
10004    }
10005
10006    /// Sets the value of [job_id][crate::model::GetJobRequest::job_id].
10007    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10008        self.job_id = v.into();
10009        self
10010    }
10011}
10012
10013impl wkt::message::Message for GetJobRequest {
10014    fn typename() -> &'static str {
10015        "type.googleapis.com/google.cloud.dataproc.v1.GetJobRequest"
10016    }
10017}
10018
10019/// A request to list jobs in a project.
10020#[serde_with::serde_as]
10021#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10022#[serde(default, rename_all = "camelCase")]
10023#[non_exhaustive]
10024pub struct ListJobsRequest {
10025    /// Required. The ID of the Google Cloud Platform project that the job
10026    /// belongs to.
10027    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10028    pub project_id: std::string::String,
10029
10030    /// Required. The Dataproc region in which to handle the request.
10031    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10032    pub region: std::string::String,
10033
10034    /// Optional. The number of results to return in each response.
10035    pub page_size: i32,
10036
10037    /// Optional. The page token, returned by a previous call, to request the
10038    /// next page of results.
10039    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10040    pub page_token: std::string::String,
10041
10042    /// Optional. If set, the returned jobs list includes only jobs that were
10043    /// submitted to the named cluster.
10044    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10045    pub cluster_name: std::string::String,
10046
10047    /// Optional. Specifies enumerated categories of jobs to list.
10048    /// (default = match ALL jobs).
10049    ///
10050    /// If `filter` is provided, `jobStateMatcher` will be ignored.
10051    pub job_state_matcher: crate::model::list_jobs_request::JobStateMatcher,
10052
10053    /// Optional. A filter constraining the jobs to list. Filters are
10054    /// case-sensitive and have the following syntax:
10055    ///
10056    /// [field = value] AND [field [= value]] ...
10057    ///
10058    /// where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
10059    /// key. **value** can be `*` to match all values.
10060    /// `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
10061    /// Only the logical `AND` operator is supported; space-separated items are
10062    /// treated as having an implicit `AND` operator.
10063    ///
10064    /// Example filter:
10065    ///
10066    /// status.state = ACTIVE AND labels.env = staging AND labels.starred = *
10067    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10068    pub filter: std::string::String,
10069
10070    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10071    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10072}
10073
10074impl ListJobsRequest {
10075    pub fn new() -> Self {
10076        std::default::Default::default()
10077    }
10078
10079    /// Sets the value of [project_id][crate::model::ListJobsRequest::project_id].
10080    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10081        self.project_id = v.into();
10082        self
10083    }
10084
10085    /// Sets the value of [region][crate::model::ListJobsRequest::region].
10086    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10087        self.region = v.into();
10088        self
10089    }
10090
10091    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
10092    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10093        self.page_size = v.into();
10094        self
10095    }
10096
10097    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
10098    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10099        self.page_token = v.into();
10100        self
10101    }
10102
10103    /// Sets the value of [cluster_name][crate::model::ListJobsRequest::cluster_name].
10104    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10105        self.cluster_name = v.into();
10106        self
10107    }
10108
10109    /// Sets the value of [job_state_matcher][crate::model::ListJobsRequest::job_state_matcher].
10110    pub fn set_job_state_matcher<
10111        T: std::convert::Into<crate::model::list_jobs_request::JobStateMatcher>,
10112    >(
10113        mut self,
10114        v: T,
10115    ) -> Self {
10116        self.job_state_matcher = v.into();
10117        self
10118    }
10119
10120    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
10121    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10122        self.filter = v.into();
10123        self
10124    }
10125}
10126
10127impl wkt::message::Message for ListJobsRequest {
10128    fn typename() -> &'static str {
10129        "type.googleapis.com/google.cloud.dataproc.v1.ListJobsRequest"
10130    }
10131}
10132
10133/// Defines additional types related to [ListJobsRequest].
10134pub mod list_jobs_request {
10135    #[allow(unused_imports)]
10136    use super::*;
10137
10138    /// A matcher that specifies categories of job states.
10139    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10140    pub struct JobStateMatcher(i32);
10141
10142    impl JobStateMatcher {
10143        /// Match all jobs, regardless of state.
10144        pub const ALL: JobStateMatcher = JobStateMatcher::new(0);
10145
10146        /// Only match jobs in non-terminal states: PENDING, RUNNING, or
10147        /// CANCEL_PENDING.
10148        pub const ACTIVE: JobStateMatcher = JobStateMatcher::new(1);
10149
10150        /// Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
10151        pub const NON_ACTIVE: JobStateMatcher = JobStateMatcher::new(2);
10152
10153        /// Creates a new JobStateMatcher instance.
10154        pub(crate) const fn new(value: i32) -> Self {
10155            Self(value)
10156        }
10157
10158        /// Gets the enum value.
10159        pub fn value(&self) -> i32 {
10160            self.0
10161        }
10162
10163        /// Gets the enum value as a string.
10164        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10165            match self.0 {
10166                0 => std::borrow::Cow::Borrowed("ALL"),
10167                1 => std::borrow::Cow::Borrowed("ACTIVE"),
10168                2 => std::borrow::Cow::Borrowed("NON_ACTIVE"),
10169                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10170            }
10171        }
10172
10173        /// Creates an enum value from the value name.
10174        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10175            match name {
10176                "ALL" => std::option::Option::Some(Self::ALL),
10177                "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
10178                "NON_ACTIVE" => std::option::Option::Some(Self::NON_ACTIVE),
10179                _ => std::option::Option::None,
10180            }
10181        }
10182    }
10183
10184    impl std::convert::From<i32> for JobStateMatcher {
10185        fn from(value: i32) -> Self {
10186            Self::new(value)
10187        }
10188    }
10189
10190    impl std::default::Default for JobStateMatcher {
10191        fn default() -> Self {
10192            Self::new(0)
10193        }
10194    }
10195}
10196
10197/// A request to update a job.
10198#[serde_with::serde_as]
10199#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10200#[serde(default, rename_all = "camelCase")]
10201#[non_exhaustive]
10202pub struct UpdateJobRequest {
10203    /// Required. The ID of the Google Cloud Platform project that the job
10204    /// belongs to.
10205    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10206    pub project_id: std::string::String,
10207
10208    /// Required. The Dataproc region in which to handle the request.
10209    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10210    pub region: std::string::String,
10211
10212    /// Required. The job ID.
10213    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10214    pub job_id: std::string::String,
10215
10216    /// Required. The changes to the job.
10217    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10218    pub job: std::option::Option<crate::model::Job>,
10219
10220    /// Required. Specifies the path, relative to \<code\>Job\</code\>, of
10221    /// the field to update. For example, to update the labels of a Job the
10222    /// \<code\>update_mask\</code\> parameter would be specified as
10223    /// \<code\>labels\</code\>, and the `PATCH` request body would specify the new
10224    /// value. \<strong\>Note:\</strong\> Currently, \<code\>labels\</code\> is the only
10225    /// field that can be updated.
10226    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10227    pub update_mask: std::option::Option<wkt::FieldMask>,
10228
10229    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10230    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10231}
10232
10233impl UpdateJobRequest {
10234    pub fn new() -> Self {
10235        std::default::Default::default()
10236    }
10237
10238    /// Sets the value of [project_id][crate::model::UpdateJobRequest::project_id].
10239    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10240        self.project_id = v.into();
10241        self
10242    }
10243
10244    /// Sets the value of [region][crate::model::UpdateJobRequest::region].
10245    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10246        self.region = v.into();
10247        self
10248    }
10249
10250    /// Sets the value of [job_id][crate::model::UpdateJobRequest::job_id].
10251    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10252        self.job_id = v.into();
10253        self
10254    }
10255
10256    /// Sets the value of [job][crate::model::UpdateJobRequest::job].
10257    pub fn set_job<T: std::convert::Into<std::option::Option<crate::model::Job>>>(
10258        mut self,
10259        v: T,
10260    ) -> Self {
10261        self.job = v.into();
10262        self
10263    }
10264
10265    /// Sets the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
10266    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
10267        mut self,
10268        v: T,
10269    ) -> Self {
10270        self.update_mask = v.into();
10271        self
10272    }
10273}
10274
10275impl wkt::message::Message for UpdateJobRequest {
10276    fn typename() -> &'static str {
10277        "type.googleapis.com/google.cloud.dataproc.v1.UpdateJobRequest"
10278    }
10279}
10280
10281/// A list of jobs in a project.
10282#[serde_with::serde_as]
10283#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10284#[serde(default, rename_all = "camelCase")]
10285#[non_exhaustive]
10286pub struct ListJobsResponse {
10287    /// Output only. Jobs list.
10288    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10289    pub jobs: std::vec::Vec<crate::model::Job>,
10290
10291    /// Optional. This token is included in the response if there are more results
10292    /// to fetch. To fetch additional results, provide this value as the
10293    /// `page_token` in a subsequent \<code\>ListJobsRequest\</code\>.
10294    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10295    pub next_page_token: std::string::String,
10296
10297    /// Output only. List of jobs with
10298    /// [kms_key][google.cloud.dataproc.v1.EncryptionConfig.kms_key]-encrypted
10299    /// parameters that could not be decrypted. A response to a `jobs.get` request
10300    /// may indicate the reason for the decryption failure for a specific job.
10301    ///
10302    /// [google.cloud.dataproc.v1.EncryptionConfig.kms_key]: crate::model::EncryptionConfig::kms_key
10303    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10304    pub unreachable: std::vec::Vec<std::string::String>,
10305
10306    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10307    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10308}
10309
10310impl ListJobsResponse {
10311    pub fn new() -> Self {
10312        std::default::Default::default()
10313    }
10314
10315    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
10316    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10317        self.next_page_token = v.into();
10318        self
10319    }
10320
10321    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
10322    pub fn set_jobs<T, V>(mut self, v: T) -> Self
10323    where
10324        T: std::iter::IntoIterator<Item = V>,
10325        V: std::convert::Into<crate::model::Job>,
10326    {
10327        use std::iter::Iterator;
10328        self.jobs = v.into_iter().map(|i| i.into()).collect();
10329        self
10330    }
10331
10332    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
10333    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10334    where
10335        T: std::iter::IntoIterator<Item = V>,
10336        V: std::convert::Into<std::string::String>,
10337    {
10338        use std::iter::Iterator;
10339        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10340        self
10341    }
10342}
10343
10344impl wkt::message::Message for ListJobsResponse {
10345    fn typename() -> &'static str {
10346        "type.googleapis.com/google.cloud.dataproc.v1.ListJobsResponse"
10347    }
10348}
10349
10350#[doc(hidden)]
10351impl gax::paginator::internal::PageableResponse for ListJobsResponse {
10352    type PageItem = crate::model::Job;
10353
10354    fn items(self) -> std::vec::Vec<Self::PageItem> {
10355        self.jobs
10356    }
10357
10358    fn next_page_token(&self) -> std::string::String {
10359        use std::clone::Clone;
10360        self.next_page_token.clone()
10361    }
10362}
10363
10364/// A request to cancel a job.
10365#[serde_with::serde_as]
10366#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10367#[serde(default, rename_all = "camelCase")]
10368#[non_exhaustive]
10369pub struct CancelJobRequest {
10370    /// Required. The ID of the Google Cloud Platform project that the job
10371    /// belongs to.
10372    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10373    pub project_id: std::string::String,
10374
10375    /// Required. The Dataproc region in which to handle the request.
10376    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10377    pub region: std::string::String,
10378
10379    /// Required. The job ID.
10380    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10381    pub job_id: std::string::String,
10382
10383    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10384    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10385}
10386
10387impl CancelJobRequest {
10388    pub fn new() -> Self {
10389        std::default::Default::default()
10390    }
10391
10392    /// Sets the value of [project_id][crate::model::CancelJobRequest::project_id].
10393    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10394        self.project_id = v.into();
10395        self
10396    }
10397
10398    /// Sets the value of [region][crate::model::CancelJobRequest::region].
10399    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10400        self.region = v.into();
10401        self
10402    }
10403
10404    /// Sets the value of [job_id][crate::model::CancelJobRequest::job_id].
10405    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10406        self.job_id = v.into();
10407        self
10408    }
10409}
10410
10411impl wkt::message::Message for CancelJobRequest {
10412    fn typename() -> &'static str {
10413        "type.googleapis.com/google.cloud.dataproc.v1.CancelJobRequest"
10414    }
10415}
10416
10417/// A request to delete a job.
10418#[serde_with::serde_as]
10419#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10420#[serde(default, rename_all = "camelCase")]
10421#[non_exhaustive]
10422pub struct DeleteJobRequest {
10423    /// Required. The ID of the Google Cloud Platform project that the job
10424    /// belongs to.
10425    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10426    pub project_id: std::string::String,
10427
10428    /// Required. The Dataproc region in which to handle the request.
10429    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10430    pub region: std::string::String,
10431
10432    /// Required. The job ID.
10433    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10434    pub job_id: std::string::String,
10435
10436    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10437    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10438}
10439
10440impl DeleteJobRequest {
10441    pub fn new() -> Self {
10442        std::default::Default::default()
10443    }
10444
10445    /// Sets the value of [project_id][crate::model::DeleteJobRequest::project_id].
10446    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10447        self.project_id = v.into();
10448        self
10449    }
10450
10451    /// Sets the value of [region][crate::model::DeleteJobRequest::region].
10452    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10453        self.region = v.into();
10454        self
10455    }
10456
10457    /// Sets the value of [job_id][crate::model::DeleteJobRequest::job_id].
10458    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10459        self.job_id = v.into();
10460        self
10461    }
10462}
10463
10464impl wkt::message::Message for DeleteJobRequest {
10465    fn typename() -> &'static str {
10466        "type.googleapis.com/google.cloud.dataproc.v1.DeleteJobRequest"
10467    }
10468}
10469
10470/// A request to create a node group.
10471#[serde_with::serde_as]
10472#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10473#[serde(default, rename_all = "camelCase")]
10474#[non_exhaustive]
10475pub struct CreateNodeGroupRequest {
10476    /// Required. The parent resource where this node group will be created.
10477    /// Format: `projects/{project}/regions/{region}/clusters/{cluster}`
10478    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10479    pub parent: std::string::String,
10480
10481    /// Required. The node group to create.
10482    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10483    pub node_group: std::option::Option<crate::model::NodeGroup>,
10484
10485    /// Optional. An optional node group ID. Generated if not specified.
10486    ///
10487    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
10488    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
10489    /// or hyphen. Must consist of from 3 to 33 characters.
10490    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10491    pub node_group_id: std::string::String,
10492
10493    /// Optional. A unique ID used to identify the request. If the server receives
10494    /// two
10495    /// [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests)
10496    /// with the same ID, the second request is ignored and the
10497    /// first [google.longrunning.Operation][google.longrunning.Operation] created
10498    /// and stored in the backend is returned.
10499    ///
10500    /// Recommendation: Set this value to a
10501    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
10502    ///
10503    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
10504    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
10505    ///
10506    /// [google.longrunning.Operation]: longrunning::model::Operation
10507    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10508    pub request_id: std::string::String,
10509
10510    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10511    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10512}
10513
10514impl CreateNodeGroupRequest {
10515    pub fn new() -> Self {
10516        std::default::Default::default()
10517    }
10518
10519    /// Sets the value of [parent][crate::model::CreateNodeGroupRequest::parent].
10520    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10521        self.parent = v.into();
10522        self
10523    }
10524
10525    /// Sets the value of [node_group][crate::model::CreateNodeGroupRequest::node_group].
10526    pub fn set_node_group<T: std::convert::Into<std::option::Option<crate::model::NodeGroup>>>(
10527        mut self,
10528        v: T,
10529    ) -> Self {
10530        self.node_group = v.into();
10531        self
10532    }
10533
10534    /// Sets the value of [node_group_id][crate::model::CreateNodeGroupRequest::node_group_id].
10535    pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10536        self.node_group_id = v.into();
10537        self
10538    }
10539
10540    /// Sets the value of [request_id][crate::model::CreateNodeGroupRequest::request_id].
10541    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10542        self.request_id = v.into();
10543        self
10544    }
10545}
10546
10547impl wkt::message::Message for CreateNodeGroupRequest {
10548    fn typename() -> &'static str {
10549        "type.googleapis.com/google.cloud.dataproc.v1.CreateNodeGroupRequest"
10550    }
10551}
10552
10553/// A request to resize a node group.
10554#[serde_with::serde_as]
10555#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10556#[serde(default, rename_all = "camelCase")]
10557#[non_exhaustive]
10558pub struct ResizeNodeGroupRequest {
10559    /// Required. The name of the node group to resize.
10560    /// Format:
10561    /// `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}`
10562    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10563    pub name: std::string::String,
10564
10565    /// Required. The number of running instances for the node group to maintain.
10566    /// The group adds or removes instances to maintain the number of instances
10567    /// specified by this parameter.
10568    pub size: i32,
10569
10570    /// Optional. A unique ID used to identify the request. If the server receives
10571    /// two
10572    /// [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests)
10573    /// with the same ID, the second request is ignored and the
10574    /// first [google.longrunning.Operation][google.longrunning.Operation] created
10575    /// and stored in the backend is returned.
10576    ///
10577    /// Recommendation: Set this value to a
10578    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
10579    ///
10580    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
10581    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
10582    ///
10583    /// [google.longrunning.Operation]: longrunning::model::Operation
10584    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10585    pub request_id: std::string::String,
10586
10587    /// Optional. Timeout for graceful YARN decommissioning. [Graceful
10588    /// decommissioning]
10589    /// (<https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning>)
10590    /// allows the removal of nodes from the Compute Engine node group
10591    /// without interrupting jobs in progress. This timeout specifies how long to
10592    /// wait for jobs in progress to finish before forcefully removing nodes (and
10593    /// potentially interrupting jobs). Default timeout is 0 (for forceful
10594    /// decommission), and the maximum allowed timeout is 1 day. (see JSON
10595    /// representation of
10596    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
10597    ///
10598    /// Only supported on Dataproc image versions 1.2 and higher.
10599    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10600    pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
10601
10602    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10603    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10604}
10605
10606impl ResizeNodeGroupRequest {
10607    pub fn new() -> Self {
10608        std::default::Default::default()
10609    }
10610
10611    /// Sets the value of [name][crate::model::ResizeNodeGroupRequest::name].
10612    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10613        self.name = v.into();
10614        self
10615    }
10616
10617    /// Sets the value of [size][crate::model::ResizeNodeGroupRequest::size].
10618    pub fn set_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10619        self.size = v.into();
10620        self
10621    }
10622
10623    /// Sets the value of [request_id][crate::model::ResizeNodeGroupRequest::request_id].
10624    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10625        self.request_id = v.into();
10626        self
10627    }
10628
10629    /// Sets the value of [graceful_decommission_timeout][crate::model::ResizeNodeGroupRequest::graceful_decommission_timeout].
10630    pub fn set_graceful_decommission_timeout<
10631        T: std::convert::Into<std::option::Option<wkt::Duration>>,
10632    >(
10633        mut self,
10634        v: T,
10635    ) -> Self {
10636        self.graceful_decommission_timeout = v.into();
10637        self
10638    }
10639}
10640
10641impl wkt::message::Message for ResizeNodeGroupRequest {
10642    fn typename() -> &'static str {
10643        "type.googleapis.com/google.cloud.dataproc.v1.ResizeNodeGroupRequest"
10644    }
10645}
10646
10647/// A request to get a node group .
10648#[serde_with::serde_as]
10649#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10650#[serde(default, rename_all = "camelCase")]
10651#[non_exhaustive]
10652pub struct GetNodeGroupRequest {
10653    /// Required. The name of the node group to retrieve.
10654    /// Format:
10655    /// `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}`
10656    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10657    pub name: std::string::String,
10658
10659    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10660    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10661}
10662
10663impl GetNodeGroupRequest {
10664    pub fn new() -> Self {
10665        std::default::Default::default()
10666    }
10667
10668    /// Sets the value of [name][crate::model::GetNodeGroupRequest::name].
10669    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10670        self.name = v.into();
10671        self
10672    }
10673}
10674
10675impl wkt::message::Message for GetNodeGroupRequest {
10676    fn typename() -> &'static str {
10677        "type.googleapis.com/google.cloud.dataproc.v1.GetNodeGroupRequest"
10678    }
10679}
10680
10681/// Metadata describing the Batch operation.
10682#[serde_with::serde_as]
10683#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10684#[serde(default, rename_all = "camelCase")]
10685#[non_exhaustive]
10686pub struct BatchOperationMetadata {
10687    /// Name of the batch for the operation.
10688    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10689    pub batch: std::string::String,
10690
10691    /// Batch UUID for the operation.
10692    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10693    pub batch_uuid: std::string::String,
10694
10695    /// The time when the operation was created.
10696    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10697    pub create_time: std::option::Option<wkt::Timestamp>,
10698
10699    /// The time when the operation finished.
10700    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10701    pub done_time: std::option::Option<wkt::Timestamp>,
10702
10703    /// The operation type.
10704    pub operation_type: crate::model::batch_operation_metadata::BatchOperationType,
10705
10706    /// Short description of the operation.
10707    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10708    pub description: std::string::String,
10709
10710    /// Labels associated with the operation.
10711    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
10712    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10713
10714    /// Warnings encountered during operation execution.
10715    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10716    pub warnings: std::vec::Vec<std::string::String>,
10717
10718    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10719    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10720}
10721
10722impl BatchOperationMetadata {
10723    pub fn new() -> Self {
10724        std::default::Default::default()
10725    }
10726
10727    /// Sets the value of [batch][crate::model::BatchOperationMetadata::batch].
10728    pub fn set_batch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10729        self.batch = v.into();
10730        self
10731    }
10732
10733    /// Sets the value of [batch_uuid][crate::model::BatchOperationMetadata::batch_uuid].
10734    pub fn set_batch_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10735        self.batch_uuid = v.into();
10736        self
10737    }
10738
10739    /// Sets the value of [create_time][crate::model::BatchOperationMetadata::create_time].
10740    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10741        mut self,
10742        v: T,
10743    ) -> Self {
10744        self.create_time = v.into();
10745        self
10746    }
10747
10748    /// Sets the value of [done_time][crate::model::BatchOperationMetadata::done_time].
10749    pub fn set_done_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10750        mut self,
10751        v: T,
10752    ) -> Self {
10753        self.done_time = v.into();
10754        self
10755    }
10756
10757    /// Sets the value of [operation_type][crate::model::BatchOperationMetadata::operation_type].
10758    pub fn set_operation_type<
10759        T: std::convert::Into<crate::model::batch_operation_metadata::BatchOperationType>,
10760    >(
10761        mut self,
10762        v: T,
10763    ) -> Self {
10764        self.operation_type = v.into();
10765        self
10766    }
10767
10768    /// Sets the value of [description][crate::model::BatchOperationMetadata::description].
10769    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10770        self.description = v.into();
10771        self
10772    }
10773
10774    /// Sets the value of [warnings][crate::model::BatchOperationMetadata::warnings].
10775    pub fn set_warnings<T, V>(mut self, v: T) -> Self
10776    where
10777        T: std::iter::IntoIterator<Item = V>,
10778        V: std::convert::Into<std::string::String>,
10779    {
10780        use std::iter::Iterator;
10781        self.warnings = v.into_iter().map(|i| i.into()).collect();
10782        self
10783    }
10784
10785    /// Sets the value of [labels][crate::model::BatchOperationMetadata::labels].
10786    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10787    where
10788        T: std::iter::IntoIterator<Item = (K, V)>,
10789        K: std::convert::Into<std::string::String>,
10790        V: std::convert::Into<std::string::String>,
10791    {
10792        use std::iter::Iterator;
10793        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10794        self
10795    }
10796}
10797
10798impl wkt::message::Message for BatchOperationMetadata {
10799    fn typename() -> &'static str {
10800        "type.googleapis.com/google.cloud.dataproc.v1.BatchOperationMetadata"
10801    }
10802}
10803
10804/// Defines additional types related to [BatchOperationMetadata].
10805pub mod batch_operation_metadata {
10806    #[allow(unused_imports)]
10807    use super::*;
10808
10809    /// Operation type for Batch resources
10810    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10811    pub struct BatchOperationType(i32);
10812
10813    impl BatchOperationType {
10814        /// Batch operation type is unknown.
10815        pub const BATCH_OPERATION_TYPE_UNSPECIFIED: BatchOperationType = BatchOperationType::new(0);
10816
10817        /// Batch operation type.
10818        pub const BATCH: BatchOperationType = BatchOperationType::new(1);
10819
10820        /// Creates a new BatchOperationType instance.
10821        pub(crate) const fn new(value: i32) -> Self {
10822            Self(value)
10823        }
10824
10825        /// Gets the enum value.
10826        pub fn value(&self) -> i32 {
10827            self.0
10828        }
10829
10830        /// Gets the enum value as a string.
10831        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10832            match self.0 {
10833                0 => std::borrow::Cow::Borrowed("BATCH_OPERATION_TYPE_UNSPECIFIED"),
10834                1 => std::borrow::Cow::Borrowed("BATCH"),
10835                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10836            }
10837        }
10838
10839        /// Creates an enum value from the value name.
10840        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10841            match name {
10842                "BATCH_OPERATION_TYPE_UNSPECIFIED" => {
10843                    std::option::Option::Some(Self::BATCH_OPERATION_TYPE_UNSPECIFIED)
10844                }
10845                "BATCH" => std::option::Option::Some(Self::BATCH),
10846                _ => std::option::Option::None,
10847            }
10848        }
10849    }
10850
10851    impl std::convert::From<i32> for BatchOperationType {
10852        fn from(value: i32) -> Self {
10853            Self::new(value)
10854        }
10855    }
10856
10857    impl std::default::Default for BatchOperationType {
10858        fn default() -> Self {
10859            Self::new(0)
10860        }
10861    }
10862}
10863
10864/// Metadata describing the Session operation.
10865#[serde_with::serde_as]
10866#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10867#[serde(default, rename_all = "camelCase")]
10868#[non_exhaustive]
10869pub struct SessionOperationMetadata {
10870    /// Name of the session for the operation.
10871    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10872    pub session: std::string::String,
10873
10874    /// Session UUID for the operation.
10875    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10876    pub session_uuid: std::string::String,
10877
10878    /// The time when the operation was created.
10879    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10880    pub create_time: std::option::Option<wkt::Timestamp>,
10881
10882    /// The time when the operation was finished.
10883    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10884    pub done_time: std::option::Option<wkt::Timestamp>,
10885
10886    /// The operation type.
10887    pub operation_type: crate::model::session_operation_metadata::SessionOperationType,
10888
10889    /// Short description of the operation.
10890    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10891    pub description: std::string::String,
10892
10893    /// Labels associated with the operation.
10894    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
10895    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10896
10897    /// Warnings encountered during operation execution.
10898    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10899    pub warnings: std::vec::Vec<std::string::String>,
10900
10901    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10902    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10903}
10904
10905impl SessionOperationMetadata {
10906    pub fn new() -> Self {
10907        std::default::Default::default()
10908    }
10909
10910    /// Sets the value of [session][crate::model::SessionOperationMetadata::session].
10911    pub fn set_session<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10912        self.session = v.into();
10913        self
10914    }
10915
10916    /// Sets the value of [session_uuid][crate::model::SessionOperationMetadata::session_uuid].
10917    pub fn set_session_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10918        self.session_uuid = v.into();
10919        self
10920    }
10921
10922    /// Sets the value of [create_time][crate::model::SessionOperationMetadata::create_time].
10923    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10924        mut self,
10925        v: T,
10926    ) -> Self {
10927        self.create_time = v.into();
10928        self
10929    }
10930
10931    /// Sets the value of [done_time][crate::model::SessionOperationMetadata::done_time].
10932    pub fn set_done_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10933        mut self,
10934        v: T,
10935    ) -> Self {
10936        self.done_time = v.into();
10937        self
10938    }
10939
10940    /// Sets the value of [operation_type][crate::model::SessionOperationMetadata::operation_type].
10941    pub fn set_operation_type<
10942        T: std::convert::Into<crate::model::session_operation_metadata::SessionOperationType>,
10943    >(
10944        mut self,
10945        v: T,
10946    ) -> Self {
10947        self.operation_type = v.into();
10948        self
10949    }
10950
10951    /// Sets the value of [description][crate::model::SessionOperationMetadata::description].
10952    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10953        self.description = v.into();
10954        self
10955    }
10956
10957    /// Sets the value of [warnings][crate::model::SessionOperationMetadata::warnings].
10958    pub fn set_warnings<T, V>(mut self, v: T) -> Self
10959    where
10960        T: std::iter::IntoIterator<Item = V>,
10961        V: std::convert::Into<std::string::String>,
10962    {
10963        use std::iter::Iterator;
10964        self.warnings = v.into_iter().map(|i| i.into()).collect();
10965        self
10966    }
10967
10968    /// Sets the value of [labels][crate::model::SessionOperationMetadata::labels].
10969    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10970    where
10971        T: std::iter::IntoIterator<Item = (K, V)>,
10972        K: std::convert::Into<std::string::String>,
10973        V: std::convert::Into<std::string::String>,
10974    {
10975        use std::iter::Iterator;
10976        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10977        self
10978    }
10979}
10980
10981impl wkt::message::Message for SessionOperationMetadata {
10982    fn typename() -> &'static str {
10983        "type.googleapis.com/google.cloud.dataproc.v1.SessionOperationMetadata"
10984    }
10985}
10986
10987/// Defines additional types related to [SessionOperationMetadata].
10988pub mod session_operation_metadata {
10989    #[allow(unused_imports)]
10990    use super::*;
10991
10992    /// Operation type for Session resources
10993    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10994    pub struct SessionOperationType(i32);
10995
10996    impl SessionOperationType {
10997        /// Session operation type is unknown.
10998        pub const SESSION_OPERATION_TYPE_UNSPECIFIED: SessionOperationType =
10999            SessionOperationType::new(0);
11000
11001        /// Create Session operation type.
11002        pub const CREATE: SessionOperationType = SessionOperationType::new(1);
11003
11004        /// Terminate Session operation type.
11005        pub const TERMINATE: SessionOperationType = SessionOperationType::new(2);
11006
11007        /// Delete Session operation type.
11008        pub const DELETE: SessionOperationType = SessionOperationType::new(3);
11009
11010        /// Creates a new SessionOperationType instance.
11011        pub(crate) const fn new(value: i32) -> Self {
11012            Self(value)
11013        }
11014
11015        /// Gets the enum value.
11016        pub fn value(&self) -> i32 {
11017            self.0
11018        }
11019
11020        /// Gets the enum value as a string.
11021        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
11022            match self.0 {
11023                0 => std::borrow::Cow::Borrowed("SESSION_OPERATION_TYPE_UNSPECIFIED"),
11024                1 => std::borrow::Cow::Borrowed("CREATE"),
11025                2 => std::borrow::Cow::Borrowed("TERMINATE"),
11026                3 => std::borrow::Cow::Borrowed("DELETE"),
11027                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
11028            }
11029        }
11030
11031        /// Creates an enum value from the value name.
11032        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
11033            match name {
11034                "SESSION_OPERATION_TYPE_UNSPECIFIED" => {
11035                    std::option::Option::Some(Self::SESSION_OPERATION_TYPE_UNSPECIFIED)
11036                }
11037                "CREATE" => std::option::Option::Some(Self::CREATE),
11038                "TERMINATE" => std::option::Option::Some(Self::TERMINATE),
11039                "DELETE" => std::option::Option::Some(Self::DELETE),
11040                _ => std::option::Option::None,
11041            }
11042        }
11043    }
11044
11045    impl std::convert::From<i32> for SessionOperationType {
11046        fn from(value: i32) -> Self {
11047            Self::new(value)
11048        }
11049    }
11050
11051    impl std::default::Default for SessionOperationType {
11052        fn default() -> Self {
11053            Self::new(0)
11054        }
11055    }
11056}
11057
11058/// The status of the operation.
11059#[serde_with::serde_as]
11060#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11061#[serde(default, rename_all = "camelCase")]
11062#[non_exhaustive]
11063pub struct ClusterOperationStatus {
11064    /// Output only. A message containing the operation state.
11065    pub state: crate::model::cluster_operation_status::State,
11066
11067    /// Output only. A message containing the detailed operation state.
11068    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11069    pub inner_state: std::string::String,
11070
11071    /// Output only. A message containing any operation metadata details.
11072    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11073    pub details: std::string::String,
11074
11075    /// Output only. The time this state was entered.
11076    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11077    pub state_start_time: std::option::Option<wkt::Timestamp>,
11078
11079    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11080    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11081}
11082
11083impl ClusterOperationStatus {
11084    pub fn new() -> Self {
11085        std::default::Default::default()
11086    }
11087
11088    /// Sets the value of [state][crate::model::ClusterOperationStatus::state].
11089    pub fn set_state<T: std::convert::Into<crate::model::cluster_operation_status::State>>(
11090        mut self,
11091        v: T,
11092    ) -> Self {
11093        self.state = v.into();
11094        self
11095    }
11096
11097    /// Sets the value of [inner_state][crate::model::ClusterOperationStatus::inner_state].
11098    pub fn set_inner_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11099        self.inner_state = v.into();
11100        self
11101    }
11102
11103    /// Sets the value of [details][crate::model::ClusterOperationStatus::details].
11104    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11105        self.details = v.into();
11106        self
11107    }
11108
11109    /// Sets the value of [state_start_time][crate::model::ClusterOperationStatus::state_start_time].
11110    pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11111        mut self,
11112        v: T,
11113    ) -> Self {
11114        self.state_start_time = v.into();
11115        self
11116    }
11117}
11118
11119impl wkt::message::Message for ClusterOperationStatus {
11120    fn typename() -> &'static str {
11121        "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationStatus"
11122    }
11123}
11124
11125/// Defines additional types related to [ClusterOperationStatus].
11126pub mod cluster_operation_status {
11127    #[allow(unused_imports)]
11128    use super::*;
11129
11130    /// The operation state.
11131    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
11132    pub struct State(i32);
11133
11134    impl State {
11135        /// Unused.
11136        pub const UNKNOWN: State = State::new(0);
11137
11138        /// The operation has been created.
11139        pub const PENDING: State = State::new(1);
11140
11141        /// The operation is running.
11142        pub const RUNNING: State = State::new(2);
11143
11144        /// The operation is done; either cancelled or completed.
11145        pub const DONE: State = State::new(3);
11146
11147        /// Creates a new State instance.
11148        pub(crate) const fn new(value: i32) -> Self {
11149            Self(value)
11150        }
11151
11152        /// Gets the enum value.
11153        pub fn value(&self) -> i32 {
11154            self.0
11155        }
11156
11157        /// Gets the enum value as a string.
11158        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
11159            match self.0 {
11160                0 => std::borrow::Cow::Borrowed("UNKNOWN"),
11161                1 => std::borrow::Cow::Borrowed("PENDING"),
11162                2 => std::borrow::Cow::Borrowed("RUNNING"),
11163                3 => std::borrow::Cow::Borrowed("DONE"),
11164                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
11165            }
11166        }
11167
11168        /// Creates an enum value from the value name.
11169        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
11170            match name {
11171                "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
11172                "PENDING" => std::option::Option::Some(Self::PENDING),
11173                "RUNNING" => std::option::Option::Some(Self::RUNNING),
11174                "DONE" => std::option::Option::Some(Self::DONE),
11175                _ => std::option::Option::None,
11176            }
11177        }
11178    }
11179
11180    impl std::convert::From<i32> for State {
11181        fn from(value: i32) -> Self {
11182            Self::new(value)
11183        }
11184    }
11185
11186    impl std::default::Default for State {
11187        fn default() -> Self {
11188            Self::new(0)
11189        }
11190    }
11191}
11192
11193/// Metadata describing the operation.
11194#[serde_with::serde_as]
11195#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11196#[serde(default, rename_all = "camelCase")]
11197#[non_exhaustive]
11198pub struct ClusterOperationMetadata {
11199    /// Output only. Name of the cluster for the operation.
11200    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11201    pub cluster_name: std::string::String,
11202
11203    /// Output only. Cluster UUID for the operation.
11204    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11205    pub cluster_uuid: std::string::String,
11206
11207    /// Output only. Current operation status.
11208    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11209    pub status: std::option::Option<crate::model::ClusterOperationStatus>,
11210
11211    /// Output only. The previous operation status.
11212    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11213    pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
11214
11215    /// Output only. The operation type.
11216    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11217    pub operation_type: std::string::String,
11218
11219    /// Output only. Short description of operation.
11220    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11221    pub description: std::string::String,
11222
11223    /// Output only. Labels associated with the operation
11224    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
11225    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11226
11227    /// Output only. Errors encountered during operation execution.
11228    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11229    pub warnings: std::vec::Vec<std::string::String>,
11230
11231    /// Output only. Child operation ids
11232    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11233    pub child_operation_ids: std::vec::Vec<std::string::String>,
11234
11235    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11236    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11237}
11238
11239impl ClusterOperationMetadata {
11240    pub fn new() -> Self {
11241        std::default::Default::default()
11242    }
11243
11244    /// Sets the value of [cluster_name][crate::model::ClusterOperationMetadata::cluster_name].
11245    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11246        self.cluster_name = v.into();
11247        self
11248    }
11249
11250    /// Sets the value of [cluster_uuid][crate::model::ClusterOperationMetadata::cluster_uuid].
11251    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11252        self.cluster_uuid = v.into();
11253        self
11254    }
11255
11256    /// Sets the value of [status][crate::model::ClusterOperationMetadata::status].
11257    pub fn set_status<
11258        T: std::convert::Into<std::option::Option<crate::model::ClusterOperationStatus>>,
11259    >(
11260        mut self,
11261        v: T,
11262    ) -> Self {
11263        self.status = v.into();
11264        self
11265    }
11266
11267    /// Sets the value of [operation_type][crate::model::ClusterOperationMetadata::operation_type].
11268    pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11269        self.operation_type = v.into();
11270        self
11271    }
11272
11273    /// Sets the value of [description][crate::model::ClusterOperationMetadata::description].
11274    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11275        self.description = v.into();
11276        self
11277    }
11278
11279    /// Sets the value of [status_history][crate::model::ClusterOperationMetadata::status_history].
11280    pub fn set_status_history<T, V>(mut self, v: T) -> Self
11281    where
11282        T: std::iter::IntoIterator<Item = V>,
11283        V: std::convert::Into<crate::model::ClusterOperationStatus>,
11284    {
11285        use std::iter::Iterator;
11286        self.status_history = v.into_iter().map(|i| i.into()).collect();
11287        self
11288    }
11289
11290    /// Sets the value of [warnings][crate::model::ClusterOperationMetadata::warnings].
11291    pub fn set_warnings<T, V>(mut self, v: T) -> Self
11292    where
11293        T: std::iter::IntoIterator<Item = V>,
11294        V: std::convert::Into<std::string::String>,
11295    {
11296        use std::iter::Iterator;
11297        self.warnings = v.into_iter().map(|i| i.into()).collect();
11298        self
11299    }
11300
11301    /// Sets the value of [child_operation_ids][crate::model::ClusterOperationMetadata::child_operation_ids].
11302    pub fn set_child_operation_ids<T, V>(mut self, v: T) -> Self
11303    where
11304        T: std::iter::IntoIterator<Item = V>,
11305        V: std::convert::Into<std::string::String>,
11306    {
11307        use std::iter::Iterator;
11308        self.child_operation_ids = v.into_iter().map(|i| i.into()).collect();
11309        self
11310    }
11311
11312    /// Sets the value of [labels][crate::model::ClusterOperationMetadata::labels].
11313    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11314    where
11315        T: std::iter::IntoIterator<Item = (K, V)>,
11316        K: std::convert::Into<std::string::String>,
11317        V: std::convert::Into<std::string::String>,
11318    {
11319        use std::iter::Iterator;
11320        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11321        self
11322    }
11323}
11324
11325impl wkt::message::Message for ClusterOperationMetadata {
11326    fn typename() -> &'static str {
11327        "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationMetadata"
11328    }
11329}
11330
11331/// Metadata describing the node group operation.
11332#[serde_with::serde_as]
11333#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11334#[serde(default, rename_all = "camelCase")]
11335#[non_exhaustive]
11336pub struct NodeGroupOperationMetadata {
11337    /// Output only. Node group ID for the operation.
11338    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11339    pub node_group_id: std::string::String,
11340
11341    /// Output only. Cluster UUID associated with the node group operation.
11342    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11343    pub cluster_uuid: std::string::String,
11344
11345    /// Output only. Current operation status.
11346    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11347    pub status: std::option::Option<crate::model::ClusterOperationStatus>,
11348
11349    /// Output only. The previous operation status.
11350    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11351    pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
11352
11353    /// The operation type.
11354    pub operation_type: crate::model::node_group_operation_metadata::NodeGroupOperationType,
11355
11356    /// Output only. Short description of operation.
11357    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11358    pub description: std::string::String,
11359
11360    /// Output only. Labels associated with the operation.
11361    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
11362    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11363
11364    /// Output only. Errors encountered during operation execution.
11365    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11366    pub warnings: std::vec::Vec<std::string::String>,
11367
11368    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11369    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11370}
11371
11372impl NodeGroupOperationMetadata {
11373    pub fn new() -> Self {
11374        std::default::Default::default()
11375    }
11376
11377    /// Sets the value of [node_group_id][crate::model::NodeGroupOperationMetadata::node_group_id].
11378    pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11379        self.node_group_id = v.into();
11380        self
11381    }
11382
11383    /// Sets the value of [cluster_uuid][crate::model::NodeGroupOperationMetadata::cluster_uuid].
11384    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11385        self.cluster_uuid = v.into();
11386        self
11387    }
11388
11389    /// Sets the value of [status][crate::model::NodeGroupOperationMetadata::status].
11390    pub fn set_status<
11391        T: std::convert::Into<std::option::Option<crate::model::ClusterOperationStatus>>,
11392    >(
11393        mut self,
11394        v: T,
11395    ) -> Self {
11396        self.status = v.into();
11397        self
11398    }
11399
11400    /// Sets the value of [operation_type][crate::model::NodeGroupOperationMetadata::operation_type].
11401    pub fn set_operation_type<
11402        T: std::convert::Into<crate::model::node_group_operation_metadata::NodeGroupOperationType>,
11403    >(
11404        mut self,
11405        v: T,
11406    ) -> Self {
11407        self.operation_type = v.into();
11408        self
11409    }
11410
11411    /// Sets the value of [description][crate::model::NodeGroupOperationMetadata::description].
11412    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11413        self.description = v.into();
11414        self
11415    }
11416
11417    /// Sets the value of [status_history][crate::model::NodeGroupOperationMetadata::status_history].
11418    pub fn set_status_history<T, V>(mut self, v: T) -> Self
11419    where
11420        T: std::iter::IntoIterator<Item = V>,
11421        V: std::convert::Into<crate::model::ClusterOperationStatus>,
11422    {
11423        use std::iter::Iterator;
11424        self.status_history = v.into_iter().map(|i| i.into()).collect();
11425        self
11426    }
11427
11428    /// Sets the value of [warnings][crate::model::NodeGroupOperationMetadata::warnings].
11429    pub fn set_warnings<T, V>(mut self, v: T) -> Self
11430    where
11431        T: std::iter::IntoIterator<Item = V>,
11432        V: std::convert::Into<std::string::String>,
11433    {
11434        use std::iter::Iterator;
11435        self.warnings = v.into_iter().map(|i| i.into()).collect();
11436        self
11437    }
11438
11439    /// Sets the value of [labels][crate::model::NodeGroupOperationMetadata::labels].
11440    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11441    where
11442        T: std::iter::IntoIterator<Item = (K, V)>,
11443        K: std::convert::Into<std::string::String>,
11444        V: std::convert::Into<std::string::String>,
11445    {
11446        use std::iter::Iterator;
11447        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11448        self
11449    }
11450}
11451
11452impl wkt::message::Message for NodeGroupOperationMetadata {
11453    fn typename() -> &'static str {
11454        "type.googleapis.com/google.cloud.dataproc.v1.NodeGroupOperationMetadata"
11455    }
11456}
11457
11458/// Defines additional types related to [NodeGroupOperationMetadata].
11459pub mod node_group_operation_metadata {
11460    #[allow(unused_imports)]
11461    use super::*;
11462
11463    /// Operation type for node group resources.
11464    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
11465    pub struct NodeGroupOperationType(i32);
11466
11467    impl NodeGroupOperationType {
11468        /// Node group operation type is unknown.
11469        pub const NODE_GROUP_OPERATION_TYPE_UNSPECIFIED: NodeGroupOperationType =
11470            NodeGroupOperationType::new(0);
11471
11472        /// Create node group operation type.
11473        pub const CREATE: NodeGroupOperationType = NodeGroupOperationType::new(1);
11474
11475        /// Update node group operation type.
11476        pub const UPDATE: NodeGroupOperationType = NodeGroupOperationType::new(2);
11477
11478        /// Delete node group operation type.
11479        pub const DELETE: NodeGroupOperationType = NodeGroupOperationType::new(3);
11480
11481        /// Resize node group operation type.
11482        pub const RESIZE: NodeGroupOperationType = NodeGroupOperationType::new(4);
11483
11484        /// Creates a new NodeGroupOperationType instance.
11485        pub(crate) const fn new(value: i32) -> Self {
11486            Self(value)
11487        }
11488
11489        /// Gets the enum value.
11490        pub fn value(&self) -> i32 {
11491            self.0
11492        }
11493
11494        /// Gets the enum value as a string.
11495        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
11496            match self.0 {
11497                0 => std::borrow::Cow::Borrowed("NODE_GROUP_OPERATION_TYPE_UNSPECIFIED"),
11498                1 => std::borrow::Cow::Borrowed("CREATE"),
11499                2 => std::borrow::Cow::Borrowed("UPDATE"),
11500                3 => std::borrow::Cow::Borrowed("DELETE"),
11501                4 => std::borrow::Cow::Borrowed("RESIZE"),
11502                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
11503            }
11504        }
11505
11506        /// Creates an enum value from the value name.
11507        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
11508            match name {
11509                "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED" => {
11510                    std::option::Option::Some(Self::NODE_GROUP_OPERATION_TYPE_UNSPECIFIED)
11511                }
11512                "CREATE" => std::option::Option::Some(Self::CREATE),
11513                "UPDATE" => std::option::Option::Some(Self::UPDATE),
11514                "DELETE" => std::option::Option::Some(Self::DELETE),
11515                "RESIZE" => std::option::Option::Some(Self::RESIZE),
11516                _ => std::option::Option::None,
11517            }
11518        }
11519    }
11520
11521    impl std::convert::From<i32> for NodeGroupOperationType {
11522        fn from(value: i32) -> Self {
11523            Self::new(value)
11524        }
11525    }
11526
11527    impl std::default::Default for NodeGroupOperationType {
11528        fn default() -> Self {
11529            Self::new(0)
11530        }
11531    }
11532}
11533
11534/// A request to create a session template.
11535#[serde_with::serde_as]
11536#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11537#[serde(default, rename_all = "camelCase")]
11538#[non_exhaustive]
11539pub struct CreateSessionTemplateRequest {
11540    /// Required. The parent resource where this session template will be created.
11541    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11542    pub parent: std::string::String,
11543
11544    /// Required. The session template to create.
11545    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11546    pub session_template: std::option::Option<crate::model::SessionTemplate>,
11547
11548    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11549    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11550}
11551
11552impl CreateSessionTemplateRequest {
11553    pub fn new() -> Self {
11554        std::default::Default::default()
11555    }
11556
11557    /// Sets the value of [parent][crate::model::CreateSessionTemplateRequest::parent].
11558    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11559        self.parent = v.into();
11560        self
11561    }
11562
11563    /// Sets the value of [session_template][crate::model::CreateSessionTemplateRequest::session_template].
11564    pub fn set_session_template<
11565        T: std::convert::Into<std::option::Option<crate::model::SessionTemplate>>,
11566    >(
11567        mut self,
11568        v: T,
11569    ) -> Self {
11570        self.session_template = v.into();
11571        self
11572    }
11573}
11574
11575impl wkt::message::Message for CreateSessionTemplateRequest {
11576    fn typename() -> &'static str {
11577        "type.googleapis.com/google.cloud.dataproc.v1.CreateSessionTemplateRequest"
11578    }
11579}
11580
11581/// A request to update a session template.
11582#[serde_with::serde_as]
11583#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11584#[serde(default, rename_all = "camelCase")]
11585#[non_exhaustive]
11586pub struct UpdateSessionTemplateRequest {
11587    /// Required. The updated session template.
11588    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11589    pub session_template: std::option::Option<crate::model::SessionTemplate>,
11590
11591    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11592    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11593}
11594
11595impl UpdateSessionTemplateRequest {
11596    pub fn new() -> Self {
11597        std::default::Default::default()
11598    }
11599
11600    /// Sets the value of [session_template][crate::model::UpdateSessionTemplateRequest::session_template].
11601    pub fn set_session_template<
11602        T: std::convert::Into<std::option::Option<crate::model::SessionTemplate>>,
11603    >(
11604        mut self,
11605        v: T,
11606    ) -> Self {
11607        self.session_template = v.into();
11608        self
11609    }
11610}
11611
11612impl wkt::message::Message for UpdateSessionTemplateRequest {
11613    fn typename() -> &'static str {
11614        "type.googleapis.com/google.cloud.dataproc.v1.UpdateSessionTemplateRequest"
11615    }
11616}
11617
11618/// A request to get the resource representation for a session template.
11619#[serde_with::serde_as]
11620#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11621#[serde(default, rename_all = "camelCase")]
11622#[non_exhaustive]
11623pub struct GetSessionTemplateRequest {
11624    /// Required. The name of the session template to retrieve.
11625    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11626    pub name: std::string::String,
11627
11628    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11629    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11630}
11631
11632impl GetSessionTemplateRequest {
11633    pub fn new() -> Self {
11634        std::default::Default::default()
11635    }
11636
11637    /// Sets the value of [name][crate::model::GetSessionTemplateRequest::name].
11638    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11639        self.name = v.into();
11640        self
11641    }
11642}
11643
11644impl wkt::message::Message for GetSessionTemplateRequest {
11645    fn typename() -> &'static str {
11646        "type.googleapis.com/google.cloud.dataproc.v1.GetSessionTemplateRequest"
11647    }
11648}
11649
11650/// A request to list session templates in a project.
11651#[serde_with::serde_as]
11652#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11653#[serde(default, rename_all = "camelCase")]
11654#[non_exhaustive]
11655pub struct ListSessionTemplatesRequest {
11656    /// Required. The parent that owns this collection of session templates.
11657    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11658    pub parent: std::string::String,
11659
11660    /// Optional. The maximum number of sessions to return in each response.
11661    /// The service may return fewer than this value.
11662    pub page_size: i32,
11663
11664    /// Optional. A page token received from a previous `ListSessions` call.
11665    /// Provide this token to retrieve the subsequent page.
11666    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11667    pub page_token: std::string::String,
11668
11669    /// Optional. A filter for the session templates to return in the response.
11670    /// Filters are case sensitive and have the following syntax:
11671    ///
11672    /// [field = value] AND [field [= value]] ...
11673    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11674    pub filter: std::string::String,
11675
11676    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11677    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11678}
11679
11680impl ListSessionTemplatesRequest {
11681    pub fn new() -> Self {
11682        std::default::Default::default()
11683    }
11684
11685    /// Sets the value of [parent][crate::model::ListSessionTemplatesRequest::parent].
11686    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11687        self.parent = v.into();
11688        self
11689    }
11690
11691    /// Sets the value of [page_size][crate::model::ListSessionTemplatesRequest::page_size].
11692    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11693        self.page_size = v.into();
11694        self
11695    }
11696
11697    /// Sets the value of [page_token][crate::model::ListSessionTemplatesRequest::page_token].
11698    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11699        self.page_token = v.into();
11700        self
11701    }
11702
11703    /// Sets the value of [filter][crate::model::ListSessionTemplatesRequest::filter].
11704    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11705        self.filter = v.into();
11706        self
11707    }
11708}
11709
11710impl wkt::message::Message for ListSessionTemplatesRequest {
11711    fn typename() -> &'static str {
11712        "type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesRequest"
11713    }
11714}
11715
11716/// A list of session templates.
11717#[serde_with::serde_as]
11718#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11719#[serde(default, rename_all = "camelCase")]
11720#[non_exhaustive]
11721pub struct ListSessionTemplatesResponse {
11722    /// Output only. Session template list
11723    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11724    pub session_templates: std::vec::Vec<crate::model::SessionTemplate>,
11725
11726    /// A token, which can be sent as `page_token` to retrieve the next page.
11727    /// If this field is omitted, there are no subsequent pages.
11728    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11729    pub next_page_token: std::string::String,
11730
11731    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11732    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11733}
11734
11735impl ListSessionTemplatesResponse {
11736    pub fn new() -> Self {
11737        std::default::Default::default()
11738    }
11739
11740    /// Sets the value of [next_page_token][crate::model::ListSessionTemplatesResponse::next_page_token].
11741    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11742        self.next_page_token = v.into();
11743        self
11744    }
11745
11746    /// Sets the value of [session_templates][crate::model::ListSessionTemplatesResponse::session_templates].
11747    pub fn set_session_templates<T, V>(mut self, v: T) -> Self
11748    where
11749        T: std::iter::IntoIterator<Item = V>,
11750        V: std::convert::Into<crate::model::SessionTemplate>,
11751    {
11752        use std::iter::Iterator;
11753        self.session_templates = v.into_iter().map(|i| i.into()).collect();
11754        self
11755    }
11756}
11757
11758impl wkt::message::Message for ListSessionTemplatesResponse {
11759    fn typename() -> &'static str {
11760        "type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesResponse"
11761    }
11762}
11763
11764#[doc(hidden)]
11765impl gax::paginator::internal::PageableResponse for ListSessionTemplatesResponse {
11766    type PageItem = crate::model::SessionTemplate;
11767
11768    fn items(self) -> std::vec::Vec<Self::PageItem> {
11769        self.session_templates
11770    }
11771
11772    fn next_page_token(&self) -> std::string::String {
11773        use std::clone::Clone;
11774        self.next_page_token.clone()
11775    }
11776}
11777
11778/// A request to delete a session template.
11779#[serde_with::serde_as]
11780#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11781#[serde(default, rename_all = "camelCase")]
11782#[non_exhaustive]
11783pub struct DeleteSessionTemplateRequest {
11784    /// Required. The name of the session template resource to delete.
11785    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11786    pub name: std::string::String,
11787
11788    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11789    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11790}
11791
11792impl DeleteSessionTemplateRequest {
11793    pub fn new() -> Self {
11794        std::default::Default::default()
11795    }
11796
11797    /// Sets the value of [name][crate::model::DeleteSessionTemplateRequest::name].
11798    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11799        self.name = v.into();
11800        self
11801    }
11802}
11803
11804impl wkt::message::Message for DeleteSessionTemplateRequest {
11805    fn typename() -> &'static str {
11806        "type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionTemplateRequest"
11807    }
11808}
11809
11810/// A representation of a session template.
11811#[serde_with::serde_as]
11812#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11813#[serde(default, rename_all = "camelCase")]
11814#[non_exhaustive]
11815pub struct SessionTemplate {
11816    /// Required. The resource name of the session template.
11817    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11818    pub name: std::string::String,
11819
11820    /// Optional. Brief description of the template.
11821    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11822    pub description: std::string::String,
11823
11824    /// Output only. The time when the template was created.
11825    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11826    pub create_time: std::option::Option<wkt::Timestamp>,
11827
11828    /// Output only. The email address of the user who created the template.
11829    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11830    pub creator: std::string::String,
11831
11832    /// Optional. Labels to associate with sessions created using this template.
11833    /// Label **keys** must contain 1 to 63 characters, and must conform to
11834    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
11835    /// Label **values** can be empty, but, if present, must contain 1 to 63
11836    /// characters and conform to [RFC
11837    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
11838    /// associated with a session.
11839    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
11840    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11841
11842    /// Optional. Runtime configuration for session execution.
11843    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11844    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
11845
11846    /// Optional. Environment configuration for session execution.
11847    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11848    pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
11849
11850    /// Output only. The time the template was last updated.
11851    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11852    pub update_time: std::option::Option<wkt::Timestamp>,
11853
11854    /// Output only. A session template UUID (Unique Universal Identifier). The
11855    /// service generates this value when it creates the session template.
11856    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11857    pub uuid: std::string::String,
11858
11859    /// The session configuration.
11860    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
11861    pub session_config: std::option::Option<crate::model::session_template::SessionConfig>,
11862
11863    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11864    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11865}
11866
11867impl SessionTemplate {
11868    pub fn new() -> Self {
11869        std::default::Default::default()
11870    }
11871
11872    /// Sets the value of [name][crate::model::SessionTemplate::name].
11873    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11874        self.name = v.into();
11875        self
11876    }
11877
11878    /// Sets the value of [description][crate::model::SessionTemplate::description].
11879    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11880        self.description = v.into();
11881        self
11882    }
11883
11884    /// Sets the value of [create_time][crate::model::SessionTemplate::create_time].
11885    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11886        mut self,
11887        v: T,
11888    ) -> Self {
11889        self.create_time = v.into();
11890        self
11891    }
11892
11893    /// Sets the value of [creator][crate::model::SessionTemplate::creator].
11894    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11895        self.creator = v.into();
11896        self
11897    }
11898
11899    /// Sets the value of [runtime_config][crate::model::SessionTemplate::runtime_config].
11900    pub fn set_runtime_config<
11901        T: std::convert::Into<std::option::Option<crate::model::RuntimeConfig>>,
11902    >(
11903        mut self,
11904        v: T,
11905    ) -> Self {
11906        self.runtime_config = v.into();
11907        self
11908    }
11909
11910    /// Sets the value of [environment_config][crate::model::SessionTemplate::environment_config].
11911    pub fn set_environment_config<
11912        T: std::convert::Into<std::option::Option<crate::model::EnvironmentConfig>>,
11913    >(
11914        mut self,
11915        v: T,
11916    ) -> Self {
11917        self.environment_config = v.into();
11918        self
11919    }
11920
11921    /// Sets the value of [update_time][crate::model::SessionTemplate::update_time].
11922    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11923        mut self,
11924        v: T,
11925    ) -> Self {
11926        self.update_time = v.into();
11927        self
11928    }
11929
11930    /// Sets the value of [uuid][crate::model::SessionTemplate::uuid].
11931    pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11932        self.uuid = v.into();
11933        self
11934    }
11935
11936    /// Sets the value of [labels][crate::model::SessionTemplate::labels].
11937    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11938    where
11939        T: std::iter::IntoIterator<Item = (K, V)>,
11940        K: std::convert::Into<std::string::String>,
11941        V: std::convert::Into<std::string::String>,
11942    {
11943        use std::iter::Iterator;
11944        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11945        self
11946    }
11947
11948    /// Sets the value of [session_config][crate::model::SessionTemplate::session_config].
11949    ///
11950    /// Note that all the setters affecting `session_config` are mutually
11951    /// exclusive.
11952    pub fn set_session_config<
11953        T: std::convert::Into<std::option::Option<crate::model::session_template::SessionConfig>>,
11954    >(
11955        mut self,
11956        v: T,
11957    ) -> Self {
11958        self.session_config = v.into();
11959        self
11960    }
11961
11962    /// The value of [session_config][crate::model::SessionTemplate::session_config]
11963    /// if it holds a `JupyterSession`, `None` if the field is not set or
11964    /// holds a different branch.
11965    pub fn jupyter_session(
11966        &self,
11967    ) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
11968        #[allow(unreachable_patterns)]
11969        self.session_config.as_ref().and_then(|v| match v {
11970            crate::model::session_template::SessionConfig::JupyterSession(v) => {
11971                std::option::Option::Some(v)
11972            }
11973            _ => std::option::Option::None,
11974        })
11975    }
11976
11977    /// The value of [session_config][crate::model::SessionTemplate::session_config]
11978    /// if it holds a `SparkConnectSession`, `None` if the field is not set or
11979    /// holds a different branch.
11980    pub fn spark_connect_session(
11981        &self,
11982    ) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
11983        #[allow(unreachable_patterns)]
11984        self.session_config.as_ref().and_then(|v| match v {
11985            crate::model::session_template::SessionConfig::SparkConnectSession(v) => {
11986                std::option::Option::Some(v)
11987            }
11988            _ => std::option::Option::None,
11989        })
11990    }
11991
11992    /// Sets the value of [session_config][crate::model::SessionTemplate::session_config]
11993    /// to hold a `JupyterSession`.
11994    ///
11995    /// Note that all the setters affecting `session_config` are
11996    /// mutually exclusive.
11997    pub fn set_jupyter_session<
11998        T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
11999    >(
12000        mut self,
12001        v: T,
12002    ) -> Self {
12003        self.session_config = std::option::Option::Some(
12004            crate::model::session_template::SessionConfig::JupyterSession(v.into()),
12005        );
12006        self
12007    }
12008
12009    /// Sets the value of [session_config][crate::model::SessionTemplate::session_config]
12010    /// to hold a `SparkConnectSession`.
12011    ///
12012    /// Note that all the setters affecting `session_config` are
12013    /// mutually exclusive.
12014    pub fn set_spark_connect_session<
12015        T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
12016    >(
12017        mut self,
12018        v: T,
12019    ) -> Self {
12020        self.session_config = std::option::Option::Some(
12021            crate::model::session_template::SessionConfig::SparkConnectSession(v.into()),
12022        );
12023        self
12024    }
12025}
12026
12027impl wkt::message::Message for SessionTemplate {
12028    fn typename() -> &'static str {
12029        "type.googleapis.com/google.cloud.dataproc.v1.SessionTemplate"
12030    }
12031}
12032
12033/// Defines additional types related to [SessionTemplate].
12034pub mod session_template {
12035    #[allow(unused_imports)]
12036    use super::*;
12037
12038    /// The session configuration.
12039    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12040    #[serde(rename_all = "camelCase")]
12041    #[non_exhaustive]
12042    pub enum SessionConfig {
12043        /// Optional. Jupyter session config.
12044        JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
12045        /// Optional. Spark Connect session config.
12046        SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
12047    }
12048}
12049
12050/// A request to create a session.
12051#[serde_with::serde_as]
12052#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12053#[serde(default, rename_all = "camelCase")]
12054#[non_exhaustive]
12055pub struct CreateSessionRequest {
12056    /// Required. The parent resource where this session will be created.
12057    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12058    pub parent: std::string::String,
12059
12060    /// Required. The interactive session to create.
12061    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12062    pub session: std::option::Option<crate::model::Session>,
12063
12064    /// Required. The ID to use for the session, which becomes the final component
12065    /// of the session's resource name.
12066    ///
12067    /// This value must be 4-63 characters. Valid characters
12068    /// are /[a-z][0-9]-/.
12069    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12070    pub session_id: std::string::String,
12071
12072    /// Optional. A unique ID used to identify the request. If the service
12073    /// receives two
12074    /// [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s
12075    /// with the same ID, the second request is ignored, and the
12076    /// first [Session][google.cloud.dataproc.v1.Session] is created and stored in
12077    /// the backend.
12078    ///
12079    /// Recommendation: Set this value to a
12080    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
12081    ///
12082    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
12083    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
12084    ///
12085    /// [google.cloud.dataproc.v1.Session]: crate::model::Session
12086    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12087    pub request_id: std::string::String,
12088
12089    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12090    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12091}
12092
12093impl CreateSessionRequest {
12094    pub fn new() -> Self {
12095        std::default::Default::default()
12096    }
12097
12098    /// Sets the value of [parent][crate::model::CreateSessionRequest::parent].
12099    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12100        self.parent = v.into();
12101        self
12102    }
12103
12104    /// Sets the value of [session][crate::model::CreateSessionRequest::session].
12105    pub fn set_session<T: std::convert::Into<std::option::Option<crate::model::Session>>>(
12106        mut self,
12107        v: T,
12108    ) -> Self {
12109        self.session = v.into();
12110        self
12111    }
12112
12113    /// Sets the value of [session_id][crate::model::CreateSessionRequest::session_id].
12114    pub fn set_session_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12115        self.session_id = v.into();
12116        self
12117    }
12118
12119    /// Sets the value of [request_id][crate::model::CreateSessionRequest::request_id].
12120    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12121        self.request_id = v.into();
12122        self
12123    }
12124}
12125
12126impl wkt::message::Message for CreateSessionRequest {
12127    fn typename() -> &'static str {
12128        "type.googleapis.com/google.cloud.dataproc.v1.CreateSessionRequest"
12129    }
12130}
12131
12132/// A request to get the resource representation for a session.
12133#[serde_with::serde_as]
12134#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12135#[serde(default, rename_all = "camelCase")]
12136#[non_exhaustive]
12137pub struct GetSessionRequest {
12138    /// Required. The name of the session to retrieve.
12139    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12140    pub name: std::string::String,
12141
12142    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12143    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12144}
12145
12146impl GetSessionRequest {
12147    pub fn new() -> Self {
12148        std::default::Default::default()
12149    }
12150
12151    /// Sets the value of [name][crate::model::GetSessionRequest::name].
12152    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12153        self.name = v.into();
12154        self
12155    }
12156}
12157
12158impl wkt::message::Message for GetSessionRequest {
12159    fn typename() -> &'static str {
12160        "type.googleapis.com/google.cloud.dataproc.v1.GetSessionRequest"
12161    }
12162}
12163
12164/// A request to list sessions in a project.
12165#[serde_with::serde_as]
12166#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12167#[serde(default, rename_all = "camelCase")]
12168#[non_exhaustive]
12169pub struct ListSessionsRequest {
12170    /// Required. The parent, which owns this collection of sessions.
12171    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12172    pub parent: std::string::String,
12173
12174    /// Optional. The maximum number of sessions to return in each response.
12175    /// The service may return fewer than this value.
12176    pub page_size: i32,
12177
12178    /// Optional. A page token received from a previous `ListSessions` call.
12179    /// Provide this token to retrieve the subsequent page.
12180    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12181    pub page_token: std::string::String,
12182
12183    /// Optional. A filter for the sessions to return in the response.
12184    ///
12185    /// A filter is a logical expression constraining the values of various fields
12186    /// in each session resource. Filters are case sensitive, and may contain
12187    /// multiple clauses combined with logical operators (AND, OR).
12188    /// Supported fields are `session_id`, `session_uuid`, `state`, `create_time`,
12189    /// and `labels`.
12190    ///
12191    /// Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"`
12192    /// is a filter for sessions in an ACTIVE state that were created before
12193    /// 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter
12194    /// for sessions in an ACTIVE state that have a production environment label.
12195    ///
12196    /// See <https://google.aip.dev/assets/misc/ebnf-filtering.txt> for a detailed
12197    /// description of the filter syntax and a list of supported comparators.
12198    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12199    pub filter: std::string::String,
12200
12201    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12203}
12204
12205impl ListSessionsRequest {
12206    pub fn new() -> Self {
12207        std::default::Default::default()
12208    }
12209
12210    /// Sets the value of [parent][crate::model::ListSessionsRequest::parent].
12211    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12212        self.parent = v.into();
12213        self
12214    }
12215
12216    /// Sets the value of [page_size][crate::model::ListSessionsRequest::page_size].
12217    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12218        self.page_size = v.into();
12219        self
12220    }
12221
12222    /// Sets the value of [page_token][crate::model::ListSessionsRequest::page_token].
12223    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12224        self.page_token = v.into();
12225        self
12226    }
12227
12228    /// Sets the value of [filter][crate::model::ListSessionsRequest::filter].
12229    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12230        self.filter = v.into();
12231        self
12232    }
12233}
12234
12235impl wkt::message::Message for ListSessionsRequest {
12236    fn typename() -> &'static str {
12237        "type.googleapis.com/google.cloud.dataproc.v1.ListSessionsRequest"
12238    }
12239}
12240
12241/// A list of interactive sessions.
12242#[serde_with::serde_as]
12243#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12244#[serde(default, rename_all = "camelCase")]
12245#[non_exhaustive]
12246pub struct ListSessionsResponse {
12247    /// Output only. The sessions from the specified collection.
12248    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
12249    pub sessions: std::vec::Vec<crate::model::Session>,
12250
12251    /// A token, which can be sent as `page_token`, to retrieve the next page.
12252    /// If this field is omitted, there are no subsequent pages.
12253    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12254    pub next_page_token: std::string::String,
12255
12256    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12257    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12258}
12259
12260impl ListSessionsResponse {
12261    pub fn new() -> Self {
12262        std::default::Default::default()
12263    }
12264
12265    /// Sets the value of [next_page_token][crate::model::ListSessionsResponse::next_page_token].
12266    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12267        self.next_page_token = v.into();
12268        self
12269    }
12270
12271    /// Sets the value of [sessions][crate::model::ListSessionsResponse::sessions].
12272    pub fn set_sessions<T, V>(mut self, v: T) -> Self
12273    where
12274        T: std::iter::IntoIterator<Item = V>,
12275        V: std::convert::Into<crate::model::Session>,
12276    {
12277        use std::iter::Iterator;
12278        self.sessions = v.into_iter().map(|i| i.into()).collect();
12279        self
12280    }
12281}
12282
12283impl wkt::message::Message for ListSessionsResponse {
12284    fn typename() -> &'static str {
12285        "type.googleapis.com/google.cloud.dataproc.v1.ListSessionsResponse"
12286    }
12287}
12288
12289#[doc(hidden)]
12290impl gax::paginator::internal::PageableResponse for ListSessionsResponse {
12291    type PageItem = crate::model::Session;
12292
12293    fn items(self) -> std::vec::Vec<Self::PageItem> {
12294        self.sessions
12295    }
12296
12297    fn next_page_token(&self) -> std::string::String {
12298        use std::clone::Clone;
12299        self.next_page_token.clone()
12300    }
12301}
12302
12303/// A request to terminate an interactive session.
12304#[serde_with::serde_as]
12305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12306#[serde(default, rename_all = "camelCase")]
12307#[non_exhaustive]
12308pub struct TerminateSessionRequest {
12309    /// Required. The name of the session resource to terminate.
12310    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12311    pub name: std::string::String,
12312
12313    /// Optional. A unique ID used to identify the request. If the service
12314    /// receives two
12315    /// [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s
12316    /// with the same ID, the second request is ignored.
12317    ///
12318    /// Recommendation: Set this value to a
12319    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
12320    ///
12321    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
12322    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
12323    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12324    pub request_id: std::string::String,
12325
12326    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12327    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12328}
12329
12330impl TerminateSessionRequest {
12331    pub fn new() -> Self {
12332        std::default::Default::default()
12333    }
12334
12335    /// Sets the value of [name][crate::model::TerminateSessionRequest::name].
12336    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12337        self.name = v.into();
12338        self
12339    }
12340
12341    /// Sets the value of [request_id][crate::model::TerminateSessionRequest::request_id].
12342    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12343        self.request_id = v.into();
12344        self
12345    }
12346}
12347
12348impl wkt::message::Message for TerminateSessionRequest {
12349    fn typename() -> &'static str {
12350        "type.googleapis.com/google.cloud.dataproc.v1.TerminateSessionRequest"
12351    }
12352}
12353
12354/// A request to delete a session.
12355#[serde_with::serde_as]
12356#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12357#[serde(default, rename_all = "camelCase")]
12358#[non_exhaustive]
12359pub struct DeleteSessionRequest {
12360    /// Required. The name of the session resource to delete.
12361    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12362    pub name: std::string::String,
12363
12364    /// Optional. A unique ID used to identify the request. If the service
12365    /// receives two
12366    /// [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s
12367    /// with the same ID, the second request is ignored.
12368    ///
12369    /// Recommendation: Set this value to a
12370    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
12371    ///
12372    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
12373    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
12374    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12375    pub request_id: std::string::String,
12376
12377    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12378    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12379}
12380
12381impl DeleteSessionRequest {
12382    pub fn new() -> Self {
12383        std::default::Default::default()
12384    }
12385
12386    /// Sets the value of [name][crate::model::DeleteSessionRequest::name].
12387    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12388        self.name = v.into();
12389        self
12390    }
12391
12392    /// Sets the value of [request_id][crate::model::DeleteSessionRequest::request_id].
12393    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12394        self.request_id = v.into();
12395        self
12396    }
12397}
12398
12399impl wkt::message::Message for DeleteSessionRequest {
12400    fn typename() -> &'static str {
12401        "type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionRequest"
12402    }
12403}
12404
12405/// A representation of a session.
12406#[serde_with::serde_as]
12407#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12408#[serde(default, rename_all = "camelCase")]
12409#[non_exhaustive]
12410pub struct Session {
12411    /// Required. The resource name of the session.
12412    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12413    pub name: std::string::String,
12414
12415    /// Output only. A session UUID (Unique Universal Identifier). The service
12416    /// generates this value when it creates the session.
12417    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12418    pub uuid: std::string::String,
12419
12420    /// Output only. The time when the session was created.
12421    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12422    pub create_time: std::option::Option<wkt::Timestamp>,
12423
12424    /// Output only. Runtime information about session execution.
12425    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12426    pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
12427
12428    /// Output only. A state of the session.
12429    pub state: crate::model::session::State,
12430
12431    /// Output only. Session state details, such as the failure
12432    /// description if the state is `FAILED`.
12433    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12434    pub state_message: std::string::String,
12435
12436    /// Output only. The time when the session entered the current state.
12437    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12438    pub state_time: std::option::Option<wkt::Timestamp>,
12439
12440    /// Output only. The email address of the user who created the session.
12441    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12442    pub creator: std::string::String,
12443
12444    /// Optional. The labels to associate with the session.
12445    /// Label **keys** must contain 1 to 63 characters, and must conform to
12446    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
12447    /// Label **values** may be empty, but, if present, must contain 1 to 63
12448    /// characters, and must conform to [RFC
12449    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
12450    /// associated with a session.
12451    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
12452    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12453
12454    /// Optional. Runtime configuration for the session execution.
12455    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12456    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
12457
12458    /// Optional. Environment configuration for the session execution.
12459    #[serde(skip_serializing_if = "std::option::Option::is_none")]
12460    pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
12461
12462    /// Optional. The email address of the user who owns the session.
12463    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12464    pub user: std::string::String,
12465
12466    /// Output only. Historical state information for the session.
12467    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
12468    pub state_history: std::vec::Vec<crate::model::session::SessionStateHistory>,
12469
12470    /// Optional. The session template used by the session.
12471    ///
12472    /// Only resource names, including project ID and location, are valid.
12473    ///
12474    /// Example:
12475    ///
12476    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]`
12477    /// * `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]`
12478    ///
12479    /// The template must be in the same project and Dataproc region as the
12480    /// session.
12481    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12482    pub session_template: std::string::String,
12483
12484    /// The session configuration.
12485    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
12486    pub session_config: std::option::Option<crate::model::session::SessionConfig>,
12487
12488    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12489    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12490}
12491
12492impl Session {
12493    pub fn new() -> Self {
12494        std::default::Default::default()
12495    }
12496
12497    /// Sets the value of [name][crate::model::Session::name].
12498    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12499        self.name = v.into();
12500        self
12501    }
12502
12503    /// Sets the value of [uuid][crate::model::Session::uuid].
12504    pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12505        self.uuid = v.into();
12506        self
12507    }
12508
12509    /// Sets the value of [create_time][crate::model::Session::create_time].
12510    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12511        mut self,
12512        v: T,
12513    ) -> Self {
12514        self.create_time = v.into();
12515        self
12516    }
12517
12518    /// Sets the value of [runtime_info][crate::model::Session::runtime_info].
12519    pub fn set_runtime_info<
12520        T: std::convert::Into<std::option::Option<crate::model::RuntimeInfo>>,
12521    >(
12522        mut self,
12523        v: T,
12524    ) -> Self {
12525        self.runtime_info = v.into();
12526        self
12527    }
12528
12529    /// Sets the value of [state][crate::model::Session::state].
12530    pub fn set_state<T: std::convert::Into<crate::model::session::State>>(mut self, v: T) -> Self {
12531        self.state = v.into();
12532        self
12533    }
12534
12535    /// Sets the value of [state_message][crate::model::Session::state_message].
12536    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12537        self.state_message = v.into();
12538        self
12539    }
12540
12541    /// Sets the value of [state_time][crate::model::Session::state_time].
12542    pub fn set_state_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12543        mut self,
12544        v: T,
12545    ) -> Self {
12546        self.state_time = v.into();
12547        self
12548    }
12549
12550    /// Sets the value of [creator][crate::model::Session::creator].
12551    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12552        self.creator = v.into();
12553        self
12554    }
12555
12556    /// Sets the value of [runtime_config][crate::model::Session::runtime_config].
12557    pub fn set_runtime_config<
12558        T: std::convert::Into<std::option::Option<crate::model::RuntimeConfig>>,
12559    >(
12560        mut self,
12561        v: T,
12562    ) -> Self {
12563        self.runtime_config = v.into();
12564        self
12565    }
12566
12567    /// Sets the value of [environment_config][crate::model::Session::environment_config].
12568    pub fn set_environment_config<
12569        T: std::convert::Into<std::option::Option<crate::model::EnvironmentConfig>>,
12570    >(
12571        mut self,
12572        v: T,
12573    ) -> Self {
12574        self.environment_config = v.into();
12575        self
12576    }
12577
12578    /// Sets the value of [user][crate::model::Session::user].
12579    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12580        self.user = v.into();
12581        self
12582    }
12583
12584    /// Sets the value of [session_template][crate::model::Session::session_template].
12585    pub fn set_session_template<T: std::convert::Into<std::string::String>>(
12586        mut self,
12587        v: T,
12588    ) -> Self {
12589        self.session_template = v.into();
12590        self
12591    }
12592
12593    /// Sets the value of [state_history][crate::model::Session::state_history].
12594    pub fn set_state_history<T, V>(mut self, v: T) -> Self
12595    where
12596        T: std::iter::IntoIterator<Item = V>,
12597        V: std::convert::Into<crate::model::session::SessionStateHistory>,
12598    {
12599        use std::iter::Iterator;
12600        self.state_history = v.into_iter().map(|i| i.into()).collect();
12601        self
12602    }
12603
12604    /// Sets the value of [labels][crate::model::Session::labels].
12605    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12606    where
12607        T: std::iter::IntoIterator<Item = (K, V)>,
12608        K: std::convert::Into<std::string::String>,
12609        V: std::convert::Into<std::string::String>,
12610    {
12611        use std::iter::Iterator;
12612        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12613        self
12614    }
12615
12616    /// Sets the value of [session_config][crate::model::Session::session_config].
12617    ///
12618    /// Note that all the setters affecting `session_config` are mutually
12619    /// exclusive.
12620    pub fn set_session_config<
12621        T: std::convert::Into<std::option::Option<crate::model::session::SessionConfig>>,
12622    >(
12623        mut self,
12624        v: T,
12625    ) -> Self {
12626        self.session_config = v.into();
12627        self
12628    }
12629
12630    /// The value of [session_config][crate::model::Session::session_config]
12631    /// if it holds a `JupyterSession`, `None` if the field is not set or
12632    /// holds a different branch.
12633    pub fn jupyter_session(
12634        &self,
12635    ) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
12636        #[allow(unreachable_patterns)]
12637        self.session_config.as_ref().and_then(|v| match v {
12638            crate::model::session::SessionConfig::JupyterSession(v) => std::option::Option::Some(v),
12639            _ => std::option::Option::None,
12640        })
12641    }
12642
12643    /// The value of [session_config][crate::model::Session::session_config]
12644    /// if it holds a `SparkConnectSession`, `None` if the field is not set or
12645    /// holds a different branch.
12646    pub fn spark_connect_session(
12647        &self,
12648    ) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
12649        #[allow(unreachable_patterns)]
12650        self.session_config.as_ref().and_then(|v| match v {
12651            crate::model::session::SessionConfig::SparkConnectSession(v) => {
12652                std::option::Option::Some(v)
12653            }
12654            _ => std::option::Option::None,
12655        })
12656    }
12657
12658    /// Sets the value of [session_config][crate::model::Session::session_config]
12659    /// to hold a `JupyterSession`.
12660    ///
12661    /// Note that all the setters affecting `session_config` are
12662    /// mutually exclusive.
12663    pub fn set_jupyter_session<
12664        T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
12665    >(
12666        mut self,
12667        v: T,
12668    ) -> Self {
12669        self.session_config = std::option::Option::Some(
12670            crate::model::session::SessionConfig::JupyterSession(v.into()),
12671        );
12672        self
12673    }
12674
12675    /// Sets the value of [session_config][crate::model::Session::session_config]
12676    /// to hold a `SparkConnectSession`.
12677    ///
12678    /// Note that all the setters affecting `session_config` are
12679    /// mutually exclusive.
12680    pub fn set_spark_connect_session<
12681        T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
12682    >(
12683        mut self,
12684        v: T,
12685    ) -> Self {
12686        self.session_config = std::option::Option::Some(
12687            crate::model::session::SessionConfig::SparkConnectSession(v.into()),
12688        );
12689        self
12690    }
12691}
12692
12693impl wkt::message::Message for Session {
12694    fn typename() -> &'static str {
12695        "type.googleapis.com/google.cloud.dataproc.v1.Session"
12696    }
12697}
12698
12699/// Defines additional types related to [Session].
12700pub mod session {
12701    #[allow(unused_imports)]
12702    use super::*;
12703
12704    /// Historical state information.
12705    #[serde_with::serde_as]
12706    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12707    #[serde(default, rename_all = "camelCase")]
12708    #[non_exhaustive]
12709    pub struct SessionStateHistory {
12710        /// Output only. The state of the session at this point in the session
12711        /// history.
12712        pub state: crate::model::session::State,
12713
12714        /// Output only. Details about the state at this point in the session
12715        /// history.
12716        #[serde(skip_serializing_if = "std::string::String::is_empty")]
12717        pub state_message: std::string::String,
12718
12719        /// Output only. The time when the session entered the historical state.
12720        #[serde(skip_serializing_if = "std::option::Option::is_none")]
12721        pub state_start_time: std::option::Option<wkt::Timestamp>,
12722
12723        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12724        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12725    }
12726
12727    impl SessionStateHistory {
12728        pub fn new() -> Self {
12729            std::default::Default::default()
12730        }
12731
12732        /// Sets the value of [state][crate::model::session::SessionStateHistory::state].
12733        pub fn set_state<T: std::convert::Into<crate::model::session::State>>(
12734            mut self,
12735            v: T,
12736        ) -> Self {
12737            self.state = v.into();
12738            self
12739        }
12740
12741        /// Sets the value of [state_message][crate::model::session::SessionStateHistory::state_message].
12742        pub fn set_state_message<T: std::convert::Into<std::string::String>>(
12743            mut self,
12744            v: T,
12745        ) -> Self {
12746            self.state_message = v.into();
12747            self
12748        }
12749
12750        /// Sets the value of [state_start_time][crate::model::session::SessionStateHistory::state_start_time].
12751        pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12752            mut self,
12753            v: T,
12754        ) -> Self {
12755            self.state_start_time = v.into();
12756            self
12757        }
12758    }
12759
12760    impl wkt::message::Message for SessionStateHistory {
12761        fn typename() -> &'static str {
12762            "type.googleapis.com/google.cloud.dataproc.v1.Session.SessionStateHistory"
12763        }
12764    }
12765
12766    /// The session state.
12767    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12768    pub struct State(i32);
12769
12770    impl State {
12771        /// The session state is unknown.
12772        pub const STATE_UNSPECIFIED: State = State::new(0);
12773
12774        /// The session is created prior to running.
12775        pub const CREATING: State = State::new(1);
12776
12777        /// The session is running.
12778        pub const ACTIVE: State = State::new(2);
12779
12780        /// The session is terminating.
12781        pub const TERMINATING: State = State::new(3);
12782
12783        /// The session is terminated successfully.
12784        pub const TERMINATED: State = State::new(4);
12785
12786        /// The session is no longer running due to an error.
12787        pub const FAILED: State = State::new(5);
12788
12789        /// Creates a new State instance.
12790        pub(crate) const fn new(value: i32) -> Self {
12791            Self(value)
12792        }
12793
12794        /// Gets the enum value.
12795        pub fn value(&self) -> i32 {
12796            self.0
12797        }
12798
12799        /// Gets the enum value as a string.
12800        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
12801            match self.0 {
12802                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
12803                1 => std::borrow::Cow::Borrowed("CREATING"),
12804                2 => std::borrow::Cow::Borrowed("ACTIVE"),
12805                3 => std::borrow::Cow::Borrowed("TERMINATING"),
12806                4 => std::borrow::Cow::Borrowed("TERMINATED"),
12807                5 => std::borrow::Cow::Borrowed("FAILED"),
12808                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
12809            }
12810        }
12811
12812        /// Creates an enum value from the value name.
12813        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
12814            match name {
12815                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
12816                "CREATING" => std::option::Option::Some(Self::CREATING),
12817                "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
12818                "TERMINATING" => std::option::Option::Some(Self::TERMINATING),
12819                "TERMINATED" => std::option::Option::Some(Self::TERMINATED),
12820                "FAILED" => std::option::Option::Some(Self::FAILED),
12821                _ => std::option::Option::None,
12822            }
12823        }
12824    }
12825
12826    impl std::convert::From<i32> for State {
12827        fn from(value: i32) -> Self {
12828            Self::new(value)
12829        }
12830    }
12831
12832    impl std::default::Default for State {
12833        fn default() -> Self {
12834            Self::new(0)
12835        }
12836    }
12837
12838    /// The session configuration.
12839    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12840    #[serde(rename_all = "camelCase")]
12841    #[non_exhaustive]
12842    pub enum SessionConfig {
12843        /// Optional. Jupyter session config.
12844        JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
12845        /// Optional. Spark Connect session config.
12846        SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
12847    }
12848}
12849
12850/// Jupyter configuration for an interactive session.
12851#[serde_with::serde_as]
12852#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12853#[serde(default, rename_all = "camelCase")]
12854#[non_exhaustive]
12855pub struct JupyterConfig {
12856    /// Optional. Kernel
12857    pub kernel: crate::model::jupyter_config::Kernel,
12858
12859    /// Optional. Display name, shown in the Jupyter kernelspec card.
12860    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12861    pub display_name: std::string::String,
12862
12863    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12864    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12865}
12866
12867impl JupyterConfig {
12868    pub fn new() -> Self {
12869        std::default::Default::default()
12870    }
12871
12872    /// Sets the value of [kernel][crate::model::JupyterConfig::kernel].
12873    pub fn set_kernel<T: std::convert::Into<crate::model::jupyter_config::Kernel>>(
12874        mut self,
12875        v: T,
12876    ) -> Self {
12877        self.kernel = v.into();
12878        self
12879    }
12880
12881    /// Sets the value of [display_name][crate::model::JupyterConfig::display_name].
12882    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12883        self.display_name = v.into();
12884        self
12885    }
12886}
12887
12888impl wkt::message::Message for JupyterConfig {
12889    fn typename() -> &'static str {
12890        "type.googleapis.com/google.cloud.dataproc.v1.JupyterConfig"
12891    }
12892}
12893
12894/// Defines additional types related to [JupyterConfig].
12895pub mod jupyter_config {
12896    #[allow(unused_imports)]
12897    use super::*;
12898
12899    /// Jupyter kernel types.
12900    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12901    pub struct Kernel(i32);
12902
12903    impl Kernel {
12904        /// The kernel is unknown.
12905        pub const KERNEL_UNSPECIFIED: Kernel = Kernel::new(0);
12906
12907        /// Python kernel.
12908        pub const PYTHON: Kernel = Kernel::new(1);
12909
12910        /// Scala kernel.
12911        pub const SCALA: Kernel = Kernel::new(2);
12912
12913        /// Creates a new Kernel instance.
12914        pub(crate) const fn new(value: i32) -> Self {
12915            Self(value)
12916        }
12917
12918        /// Gets the enum value.
12919        pub fn value(&self) -> i32 {
12920            self.0
12921        }
12922
12923        /// Gets the enum value as a string.
12924        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
12925            match self.0 {
12926                0 => std::borrow::Cow::Borrowed("KERNEL_UNSPECIFIED"),
12927                1 => std::borrow::Cow::Borrowed("PYTHON"),
12928                2 => std::borrow::Cow::Borrowed("SCALA"),
12929                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
12930            }
12931        }
12932
12933        /// Creates an enum value from the value name.
12934        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
12935            match name {
12936                "KERNEL_UNSPECIFIED" => std::option::Option::Some(Self::KERNEL_UNSPECIFIED),
12937                "PYTHON" => std::option::Option::Some(Self::PYTHON),
12938                "SCALA" => std::option::Option::Some(Self::SCALA),
12939                _ => std::option::Option::None,
12940            }
12941        }
12942    }
12943
12944    impl std::convert::From<i32> for Kernel {
12945        fn from(value: i32) -> Self {
12946            Self::new(value)
12947        }
12948    }
12949
12950    impl std::default::Default for Kernel {
12951        fn default() -> Self {
12952            Self::new(0)
12953        }
12954    }
12955}
12956
12957/// Spark Connect configuration for an interactive session.
12958#[serde_with::serde_as]
12959#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12960#[serde(default, rename_all = "camelCase")]
12961#[non_exhaustive]
12962pub struct SparkConnectConfig {
12963    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12964    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12965}
12966
12967impl SparkConnectConfig {
12968    pub fn new() -> Self {
12969        std::default::Default::default()
12970    }
12971}
12972
12973impl wkt::message::Message for SparkConnectConfig {
12974    fn typename() -> &'static str {
12975        "type.googleapis.com/google.cloud.dataproc.v1.SparkConnectConfig"
12976    }
12977}
12978
12979/// Runtime configuration for a workload.
12980#[serde_with::serde_as]
12981#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12982#[serde(default, rename_all = "camelCase")]
12983#[non_exhaustive]
12984pub struct RuntimeConfig {
12985    /// Optional. Version of the batch runtime.
12986    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12987    pub version: std::string::String,
12988
12989    /// Optional. Optional custom container image for the job runtime environment.
12990    /// If not specified, a default container image will be used.
12991    #[serde(skip_serializing_if = "std::string::String::is_empty")]
12992    pub container_image: std::string::String,
12993
12994    /// Optional. A mapping of property names to values, which are used to
12995    /// configure workload execution.
12996    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
12997    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
12998
12999    /// Optional. Dependency repository configuration.
13000    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13001    pub repository_config: std::option::Option<crate::model::RepositoryConfig>,
13002
13003    /// Optional. Autotuning configuration of the workload.
13004    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13005    pub autotuning_config: std::option::Option<crate::model::AutotuningConfig>,
13006
13007    /// Optional. Cohort identifier. Identifies families of the workloads having
13008    /// the same shape, e.g. daily ETL jobs.
13009    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13010    pub cohort: std::string::String,
13011
13012    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13013    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13014}
13015
13016impl RuntimeConfig {
13017    pub fn new() -> Self {
13018        std::default::Default::default()
13019    }
13020
13021    /// Sets the value of [version][crate::model::RuntimeConfig::version].
13022    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13023        self.version = v.into();
13024        self
13025    }
13026
13027    /// Sets the value of [container_image][crate::model::RuntimeConfig::container_image].
13028    pub fn set_container_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13029        self.container_image = v.into();
13030        self
13031    }
13032
13033    /// Sets the value of [repository_config][crate::model::RuntimeConfig::repository_config].
13034    pub fn set_repository_config<
13035        T: std::convert::Into<std::option::Option<crate::model::RepositoryConfig>>,
13036    >(
13037        mut self,
13038        v: T,
13039    ) -> Self {
13040        self.repository_config = v.into();
13041        self
13042    }
13043
13044    /// Sets the value of [autotuning_config][crate::model::RuntimeConfig::autotuning_config].
13045    pub fn set_autotuning_config<
13046        T: std::convert::Into<std::option::Option<crate::model::AutotuningConfig>>,
13047    >(
13048        mut self,
13049        v: T,
13050    ) -> Self {
13051        self.autotuning_config = v.into();
13052        self
13053    }
13054
13055    /// Sets the value of [cohort][crate::model::RuntimeConfig::cohort].
13056    pub fn set_cohort<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13057        self.cohort = v.into();
13058        self
13059    }
13060
13061    /// Sets the value of [properties][crate::model::RuntimeConfig::properties].
13062    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
13063    where
13064        T: std::iter::IntoIterator<Item = (K, V)>,
13065        K: std::convert::Into<std::string::String>,
13066        V: std::convert::Into<std::string::String>,
13067    {
13068        use std::iter::Iterator;
13069        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13070        self
13071    }
13072}
13073
13074impl wkt::message::Message for RuntimeConfig {
13075    fn typename() -> &'static str {
13076        "type.googleapis.com/google.cloud.dataproc.v1.RuntimeConfig"
13077    }
13078}
13079
13080/// Environment configuration for a workload.
13081#[serde_with::serde_as]
13082#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13083#[serde(default, rename_all = "camelCase")]
13084#[non_exhaustive]
13085pub struct EnvironmentConfig {
13086    /// Optional. Execution configuration for a workload.
13087    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13088    pub execution_config: std::option::Option<crate::model::ExecutionConfig>,
13089
13090    /// Optional. Peripherals configuration that workload has access to.
13091    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13092    pub peripherals_config: std::option::Option<crate::model::PeripheralsConfig>,
13093
13094    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13095    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13096}
13097
13098impl EnvironmentConfig {
13099    pub fn new() -> Self {
13100        std::default::Default::default()
13101    }
13102
13103    /// Sets the value of [execution_config][crate::model::EnvironmentConfig::execution_config].
13104    pub fn set_execution_config<
13105        T: std::convert::Into<std::option::Option<crate::model::ExecutionConfig>>,
13106    >(
13107        mut self,
13108        v: T,
13109    ) -> Self {
13110        self.execution_config = v.into();
13111        self
13112    }
13113
13114    /// Sets the value of [peripherals_config][crate::model::EnvironmentConfig::peripherals_config].
13115    pub fn set_peripherals_config<
13116        T: std::convert::Into<std::option::Option<crate::model::PeripheralsConfig>>,
13117    >(
13118        mut self,
13119        v: T,
13120    ) -> Self {
13121        self.peripherals_config = v.into();
13122        self
13123    }
13124}
13125
13126impl wkt::message::Message for EnvironmentConfig {
13127    fn typename() -> &'static str {
13128        "type.googleapis.com/google.cloud.dataproc.v1.EnvironmentConfig"
13129    }
13130}
13131
13132/// Execution configuration for a workload.
13133#[serde_with::serde_as]
13134#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13135#[serde(default, rename_all = "camelCase")]
13136#[non_exhaustive]
13137pub struct ExecutionConfig {
13138    /// Optional. Service account that used to execute workload.
13139    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13140    pub service_account: std::string::String,
13141
13142    /// Optional. Tags used for network traffic control.
13143    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13144    pub network_tags: std::vec::Vec<std::string::String>,
13145
13146    /// Optional. The Cloud KMS key to use for encryption.
13147    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13148    pub kms_key: std::string::String,
13149
13150    /// Optional. Applies to sessions only. The duration to keep the session alive
13151    /// while it's idling. Exceeding this threshold causes the session to
13152    /// terminate. This field cannot be set on a batch workload. Minimum value is
13153    /// 10 minutes; maximum value is 14 days (see JSON representation of
13154    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
13155    /// Defaults to 1 hour if not set.
13156    /// If both `ttl` and `idle_ttl` are specified for an interactive session,
13157    /// the conditions are treated as `OR` conditions: the workload will be
13158    /// terminated when it has been idle for `idle_ttl` or when `ttl` has been
13159    /// exceeded, whichever occurs first.
13160    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13161    pub idle_ttl: std::option::Option<wkt::Duration>,
13162
13163    /// Optional. The duration after which the workload will be terminated,
13164    /// specified as the JSON representation for
13165    /// [Duration](https://protobuf.dev/programming-guides/proto3/#json).
13166    /// When the workload exceeds this duration, it will be unconditionally
13167    /// terminated without waiting for ongoing work to finish. If `ttl` is not
13168    /// specified for a batch workload, the workload will be allowed to run until
13169    /// it exits naturally (or run forever without exiting). If `ttl` is not
13170    /// specified for an interactive session, it defaults to 24 hours. If `ttl` is
13171    /// not specified for a batch that uses 2.1+ runtime version, it defaults to 4
13172    /// hours. Minimum value is 10 minutes; maximum value is 14 days. If both `ttl`
13173    /// and `idle_ttl` are specified (for an interactive session), the conditions
13174    /// are treated as `OR` conditions: the workload will be terminated when it has
13175    /// been idle for `idle_ttl` or when `ttl` has been exceeded, whichever occurs
13176    /// first.
13177    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13178    pub ttl: std::option::Option<wkt::Duration>,
13179
13180    /// Optional. A Cloud Storage bucket used to stage workload dependencies,
13181    /// config files, and store workload output and other ephemeral data, such as
13182    /// Spark history files. If you do not specify a staging bucket, Cloud Dataproc
13183    /// will determine a Cloud Storage location according to the region where your
13184    /// workload is running, and then create and manage project-level, per-location
13185    /// staging and temporary buckets.
13186    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
13187    /// a Cloud Storage bucket.**
13188    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13189    pub staging_bucket: std::string::String,
13190
13191    /// Optional. Authentication configuration used to set the default identity for
13192    /// the workload execution. The config specifies the type of identity
13193    /// (service account or user) that will be used by workloads to access
13194    /// resources on the project(s).
13195    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13196    pub authentication_config: std::option::Option<crate::model::AuthenticationConfig>,
13197
13198    /// Network configuration for workload execution.
13199    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
13200    pub network: std::option::Option<crate::model::execution_config::Network>,
13201
13202    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13203    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13204}
13205
13206impl ExecutionConfig {
13207    pub fn new() -> Self {
13208        std::default::Default::default()
13209    }
13210
13211    /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
13212    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13213        self.service_account = v.into();
13214        self
13215    }
13216
13217    /// Sets the value of [kms_key][crate::model::ExecutionConfig::kms_key].
13218    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13219        self.kms_key = v.into();
13220        self
13221    }
13222
13223    /// Sets the value of [idle_ttl][crate::model::ExecutionConfig::idle_ttl].
13224    pub fn set_idle_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
13225        mut self,
13226        v: T,
13227    ) -> Self {
13228        self.idle_ttl = v.into();
13229        self
13230    }
13231
13232    /// Sets the value of [ttl][crate::model::ExecutionConfig::ttl].
13233    pub fn set_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
13234        mut self,
13235        v: T,
13236    ) -> Self {
13237        self.ttl = v.into();
13238        self
13239    }
13240
13241    /// Sets the value of [staging_bucket][crate::model::ExecutionConfig::staging_bucket].
13242    pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13243        self.staging_bucket = v.into();
13244        self
13245    }
13246
13247    /// Sets the value of [authentication_config][crate::model::ExecutionConfig::authentication_config].
13248    pub fn set_authentication_config<
13249        T: std::convert::Into<std::option::Option<crate::model::AuthenticationConfig>>,
13250    >(
13251        mut self,
13252        v: T,
13253    ) -> Self {
13254        self.authentication_config = v.into();
13255        self
13256    }
13257
13258    /// Sets the value of [network_tags][crate::model::ExecutionConfig::network_tags].
13259    pub fn set_network_tags<T, V>(mut self, v: T) -> Self
13260    where
13261        T: std::iter::IntoIterator<Item = V>,
13262        V: std::convert::Into<std::string::String>,
13263    {
13264        use std::iter::Iterator;
13265        self.network_tags = v.into_iter().map(|i| i.into()).collect();
13266        self
13267    }
13268
13269    /// Sets the value of [network][crate::model::ExecutionConfig::network].
13270    ///
13271    /// Note that all the setters affecting `network` are mutually
13272    /// exclusive.
13273    pub fn set_network<
13274        T: std::convert::Into<std::option::Option<crate::model::execution_config::Network>>,
13275    >(
13276        mut self,
13277        v: T,
13278    ) -> Self {
13279        self.network = v.into();
13280        self
13281    }
13282
13283    /// The value of [network][crate::model::ExecutionConfig::network]
13284    /// if it holds a `NetworkUri`, `None` if the field is not set or
13285    /// holds a different branch.
13286    pub fn network_uri(&self) -> std::option::Option<&std::string::String> {
13287        #[allow(unreachable_patterns)]
13288        self.network.as_ref().and_then(|v| match v {
13289            crate::model::execution_config::Network::NetworkUri(v) => std::option::Option::Some(v),
13290            _ => std::option::Option::None,
13291        })
13292    }
13293
13294    /// The value of [network][crate::model::ExecutionConfig::network]
13295    /// if it holds a `SubnetworkUri`, `None` if the field is not set or
13296    /// holds a different branch.
13297    pub fn subnetwork_uri(&self) -> std::option::Option<&std::string::String> {
13298        #[allow(unreachable_patterns)]
13299        self.network.as_ref().and_then(|v| match v {
13300            crate::model::execution_config::Network::SubnetworkUri(v) => {
13301                std::option::Option::Some(v)
13302            }
13303            _ => std::option::Option::None,
13304        })
13305    }
13306
13307    /// Sets the value of [network][crate::model::ExecutionConfig::network]
13308    /// to hold a `NetworkUri`.
13309    ///
13310    /// Note that all the setters affecting `network` are
13311    /// mutually exclusive.
13312    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13313        self.network = std::option::Option::Some(
13314            crate::model::execution_config::Network::NetworkUri(v.into()),
13315        );
13316        self
13317    }
13318
13319    /// Sets the value of [network][crate::model::ExecutionConfig::network]
13320    /// to hold a `SubnetworkUri`.
13321    ///
13322    /// Note that all the setters affecting `network` are
13323    /// mutually exclusive.
13324    pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13325        self.network = std::option::Option::Some(
13326            crate::model::execution_config::Network::SubnetworkUri(v.into()),
13327        );
13328        self
13329    }
13330}
13331
13332impl wkt::message::Message for ExecutionConfig {
13333    fn typename() -> &'static str {
13334        "type.googleapis.com/google.cloud.dataproc.v1.ExecutionConfig"
13335    }
13336}
13337
13338/// Defines additional types related to [ExecutionConfig].
13339pub mod execution_config {
13340    #[allow(unused_imports)]
13341    use super::*;
13342
13343    /// Network configuration for workload execution.
13344    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
13345    #[serde(rename_all = "camelCase")]
13346    #[non_exhaustive]
13347    pub enum Network {
13348        /// Optional. Network URI to connect workload to.
13349        NetworkUri(std::string::String),
13350        /// Optional. Subnetwork URI to connect workload to.
13351        SubnetworkUri(std::string::String),
13352    }
13353}
13354
13355/// Spark History Server configuration for the workload.
13356#[serde_with::serde_as]
13357#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13358#[serde(default, rename_all = "camelCase")]
13359#[non_exhaustive]
13360pub struct SparkHistoryServerConfig {
13361    /// Optional. Resource name of an existing Dataproc Cluster to act as a Spark
13362    /// History Server for the workload.
13363    ///
13364    /// Example:
13365    ///
13366    /// * `projects/[project_id]/regions/[region]/clusters/[cluster_name]`
13367    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13368    pub dataproc_cluster: std::string::String,
13369
13370    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13371    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13372}
13373
13374impl SparkHistoryServerConfig {
13375    pub fn new() -> Self {
13376        std::default::Default::default()
13377    }
13378
13379    /// Sets the value of [dataproc_cluster][crate::model::SparkHistoryServerConfig::dataproc_cluster].
13380    pub fn set_dataproc_cluster<T: std::convert::Into<std::string::String>>(
13381        mut self,
13382        v: T,
13383    ) -> Self {
13384        self.dataproc_cluster = v.into();
13385        self
13386    }
13387}
13388
13389impl wkt::message::Message for SparkHistoryServerConfig {
13390    fn typename() -> &'static str {
13391        "type.googleapis.com/google.cloud.dataproc.v1.SparkHistoryServerConfig"
13392    }
13393}
13394
13395/// Auxiliary services configuration for a workload.
13396#[serde_with::serde_as]
13397#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13398#[serde(default, rename_all = "camelCase")]
13399#[non_exhaustive]
13400pub struct PeripheralsConfig {
13401    /// Optional. Resource name of an existing Dataproc Metastore service.
13402    ///
13403    /// Example:
13404    ///
13405    /// * `projects/[project_id]/locations/[region]/services/[service_id]`
13406    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13407    pub metastore_service: std::string::String,
13408
13409    /// Optional. The Spark History Server configuration for the workload.
13410    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13411    pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
13412
13413    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13414    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13415}
13416
13417impl PeripheralsConfig {
13418    pub fn new() -> Self {
13419        std::default::Default::default()
13420    }
13421
13422    /// Sets the value of [metastore_service][crate::model::PeripheralsConfig::metastore_service].
13423    pub fn set_metastore_service<T: std::convert::Into<std::string::String>>(
13424        mut self,
13425        v: T,
13426    ) -> Self {
13427        self.metastore_service = v.into();
13428        self
13429    }
13430
13431    /// Sets the value of [spark_history_server_config][crate::model::PeripheralsConfig::spark_history_server_config].
13432    pub fn set_spark_history_server_config<
13433        T: std::convert::Into<std::option::Option<crate::model::SparkHistoryServerConfig>>,
13434    >(
13435        mut self,
13436        v: T,
13437    ) -> Self {
13438        self.spark_history_server_config = v.into();
13439        self
13440    }
13441}
13442
13443impl wkt::message::Message for PeripheralsConfig {
13444    fn typename() -> &'static str {
13445        "type.googleapis.com/google.cloud.dataproc.v1.PeripheralsConfig"
13446    }
13447}
13448
13449/// Runtime information about workload execution.
13450#[serde_with::serde_as]
13451#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13452#[serde(default, rename_all = "camelCase")]
13453#[non_exhaustive]
13454pub struct RuntimeInfo {
13455    /// Output only. Map of remote access endpoints (such as web interfaces and
13456    /// APIs) to their URIs.
13457    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13458    pub endpoints: std::collections::HashMap<std::string::String, std::string::String>,
13459
13460    /// Output only. A URI pointing to the location of the stdout and stderr of the
13461    /// workload.
13462    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13463    pub output_uri: std::string::String,
13464
13465    /// Output only. A URI pointing to the location of the diagnostics tarball.
13466    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13467    pub diagnostic_output_uri: std::string::String,
13468
13469    /// Output only. Approximate workload resource usage, calculated when
13470    /// the workload completes (see [Dataproc Serverless pricing]
13471    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
13472    ///
13473    /// **Note:** This metric calculation may change in the future, for
13474    /// example, to capture cumulative workload resource
13475    /// consumption during workload execution (see the
13476    /// [Dataproc Serverless release notes]
13477    /// (<https://cloud.google.com/dataproc-serverless/docs/release-notes>)
13478    /// for announcements, changes, fixes
13479    /// and other Dataproc developments).
13480    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13481    pub approximate_usage: std::option::Option<crate::model::UsageMetrics>,
13482
13483    /// Output only. Snapshot of current workload resource usage.
13484    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13485    pub current_usage: std::option::Option<crate::model::UsageSnapshot>,
13486
13487    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13488    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13489}
13490
13491impl RuntimeInfo {
13492    pub fn new() -> Self {
13493        std::default::Default::default()
13494    }
13495
13496    /// Sets the value of [output_uri][crate::model::RuntimeInfo::output_uri].
13497    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13498        self.output_uri = v.into();
13499        self
13500    }
13501
13502    /// Sets the value of [diagnostic_output_uri][crate::model::RuntimeInfo::diagnostic_output_uri].
13503    pub fn set_diagnostic_output_uri<T: std::convert::Into<std::string::String>>(
13504        mut self,
13505        v: T,
13506    ) -> Self {
13507        self.diagnostic_output_uri = v.into();
13508        self
13509    }
13510
13511    /// Sets the value of [approximate_usage][crate::model::RuntimeInfo::approximate_usage].
13512    pub fn set_approximate_usage<
13513        T: std::convert::Into<std::option::Option<crate::model::UsageMetrics>>,
13514    >(
13515        mut self,
13516        v: T,
13517    ) -> Self {
13518        self.approximate_usage = v.into();
13519        self
13520    }
13521
13522    /// Sets the value of [current_usage][crate::model::RuntimeInfo::current_usage].
13523    pub fn set_current_usage<
13524        T: std::convert::Into<std::option::Option<crate::model::UsageSnapshot>>,
13525    >(
13526        mut self,
13527        v: T,
13528    ) -> Self {
13529        self.current_usage = v.into();
13530        self
13531    }
13532
13533    /// Sets the value of [endpoints][crate::model::RuntimeInfo::endpoints].
13534    pub fn set_endpoints<T, K, V>(mut self, v: T) -> Self
13535    where
13536        T: std::iter::IntoIterator<Item = (K, V)>,
13537        K: std::convert::Into<std::string::String>,
13538        V: std::convert::Into<std::string::String>,
13539    {
13540        use std::iter::Iterator;
13541        self.endpoints = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13542        self
13543    }
13544}
13545
13546impl wkt::message::Message for RuntimeInfo {
13547    fn typename() -> &'static str {
13548        "type.googleapis.com/google.cloud.dataproc.v1.RuntimeInfo"
13549    }
13550}
13551
13552/// Usage metrics represent approximate total resources consumed by a workload.
13553#[serde_with::serde_as]
13554#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13555#[serde(default, rename_all = "camelCase")]
13556#[non_exhaustive]
13557pub struct UsageMetrics {
13558    /// Optional. DCU (Dataproc Compute Units) usage in (`milliDCU` x `seconds`)
13559    /// (see [Dataproc Serverless pricing]
13560    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
13561    #[serde_as(as = "serde_with::DisplayFromStr")]
13562    pub milli_dcu_seconds: i64,
13563
13564    /// Optional. Shuffle storage usage in (`GB` x `seconds`) (see
13565    /// [Dataproc Serverless pricing]
13566    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
13567    #[serde_as(as = "serde_with::DisplayFromStr")]
13568    pub shuffle_storage_gb_seconds: i64,
13569
13570    /// Optional. Accelerator usage in (`milliAccelerator` x `seconds`) (see
13571    /// [Dataproc Serverless pricing]
13572    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
13573    #[serde_as(as = "serde_with::DisplayFromStr")]
13574    pub milli_accelerator_seconds: i64,
13575
13576    /// Optional. Accelerator type being used, if any
13577    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13578    pub accelerator_type: std::string::String,
13579
13580    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13581    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13582}
13583
13584impl UsageMetrics {
13585    pub fn new() -> Self {
13586        std::default::Default::default()
13587    }
13588
13589    /// Sets the value of [milli_dcu_seconds][crate::model::UsageMetrics::milli_dcu_seconds].
13590    pub fn set_milli_dcu_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13591        self.milli_dcu_seconds = v.into();
13592        self
13593    }
13594
13595    /// Sets the value of [shuffle_storage_gb_seconds][crate::model::UsageMetrics::shuffle_storage_gb_seconds].
13596    pub fn set_shuffle_storage_gb_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13597        self.shuffle_storage_gb_seconds = v.into();
13598        self
13599    }
13600
13601    /// Sets the value of [milli_accelerator_seconds][crate::model::UsageMetrics::milli_accelerator_seconds].
13602    pub fn set_milli_accelerator_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13603        self.milli_accelerator_seconds = v.into();
13604        self
13605    }
13606
13607    /// Sets the value of [accelerator_type][crate::model::UsageMetrics::accelerator_type].
13608    pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
13609        mut self,
13610        v: T,
13611    ) -> Self {
13612        self.accelerator_type = v.into();
13613        self
13614    }
13615}
13616
13617impl wkt::message::Message for UsageMetrics {
13618    fn typename() -> &'static str {
13619        "type.googleapis.com/google.cloud.dataproc.v1.UsageMetrics"
13620    }
13621}
13622
13623/// The usage snapshot represents the resources consumed by a workload at a
13624/// specified time.
13625#[serde_with::serde_as]
13626#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13627#[serde(default, rename_all = "camelCase")]
13628#[non_exhaustive]
13629pub struct UsageSnapshot {
13630    /// Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) (see
13631    /// [Dataproc Serverless pricing]
13632    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
13633    #[serde_as(as = "serde_with::DisplayFromStr")]
13634    pub milli_dcu: i64,
13635
13636    /// Optional. Shuffle Storage in gigabytes (GB). (see [Dataproc Serverless
13637    /// pricing] (<https://cloud.google.com/dataproc-serverless/pricing>))
13638    #[serde_as(as = "serde_with::DisplayFromStr")]
13639    pub shuffle_storage_gb: i64,
13640
13641    /// Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) charged at
13642    /// premium tier (see [Dataproc Serverless pricing]
13643    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
13644    #[serde_as(as = "serde_with::DisplayFromStr")]
13645    pub milli_dcu_premium: i64,
13646
13647    /// Optional. Shuffle Storage in gigabytes (GB) charged at premium tier. (see
13648    /// [Dataproc Serverless pricing]
13649    /// (<https://cloud.google.com/dataproc-serverless/pricing>))
13650    #[serde_as(as = "serde_with::DisplayFromStr")]
13651    pub shuffle_storage_gb_premium: i64,
13652
13653    /// Optional. Milli (one-thousandth) accelerator. (see [Dataproc
13654    /// Serverless pricing] (<https://cloud.google.com/dataproc-serverless/pricing>))
13655    #[serde_as(as = "serde_with::DisplayFromStr")]
13656    pub milli_accelerator: i64,
13657
13658    /// Optional. Accelerator type being used, if any
13659    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13660    pub accelerator_type: std::string::String,
13661
13662    /// Optional. The timestamp of the usage snapshot.
13663    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13664    pub snapshot_time: std::option::Option<wkt::Timestamp>,
13665
13666    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13667    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13668}
13669
13670impl UsageSnapshot {
13671    pub fn new() -> Self {
13672        std::default::Default::default()
13673    }
13674
13675    /// Sets the value of [milli_dcu][crate::model::UsageSnapshot::milli_dcu].
13676    pub fn set_milli_dcu<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13677        self.milli_dcu = v.into();
13678        self
13679    }
13680
13681    /// Sets the value of [shuffle_storage_gb][crate::model::UsageSnapshot::shuffle_storage_gb].
13682    pub fn set_shuffle_storage_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13683        self.shuffle_storage_gb = v.into();
13684        self
13685    }
13686
13687    /// Sets the value of [milli_dcu_premium][crate::model::UsageSnapshot::milli_dcu_premium].
13688    pub fn set_milli_dcu_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13689        self.milli_dcu_premium = v.into();
13690        self
13691    }
13692
13693    /// Sets the value of [shuffle_storage_gb_premium][crate::model::UsageSnapshot::shuffle_storage_gb_premium].
13694    pub fn set_shuffle_storage_gb_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13695        self.shuffle_storage_gb_premium = v.into();
13696        self
13697    }
13698
13699    /// Sets the value of [milli_accelerator][crate::model::UsageSnapshot::milli_accelerator].
13700    pub fn set_milli_accelerator<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13701        self.milli_accelerator = v.into();
13702        self
13703    }
13704
13705    /// Sets the value of [accelerator_type][crate::model::UsageSnapshot::accelerator_type].
13706    pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
13707        mut self,
13708        v: T,
13709    ) -> Self {
13710        self.accelerator_type = v.into();
13711        self
13712    }
13713
13714    /// Sets the value of [snapshot_time][crate::model::UsageSnapshot::snapshot_time].
13715    pub fn set_snapshot_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
13716        mut self,
13717        v: T,
13718    ) -> Self {
13719        self.snapshot_time = v.into();
13720        self
13721    }
13722}
13723
13724impl wkt::message::Message for UsageSnapshot {
13725    fn typename() -> &'static str {
13726        "type.googleapis.com/google.cloud.dataproc.v1.UsageSnapshot"
13727    }
13728}
13729
13730/// The cluster's GKE config.
13731#[serde_with::serde_as]
13732#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13733#[serde(default, rename_all = "camelCase")]
13734#[non_exhaustive]
13735pub struct GkeClusterConfig {
13736    /// Optional. A target GKE cluster to deploy to. It must be in the same project
13737    /// and region as the Dataproc cluster (the GKE cluster can be zonal or
13738    /// regional). Format:
13739    /// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
13740    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13741    pub gke_cluster_target: std::string::String,
13742
13743    /// Optional. GKE node pools where workloads will be scheduled. At least one
13744    /// node pool must be assigned the `DEFAULT`
13745    /// [GkeNodePoolTarget.Role][google.cloud.dataproc.v1.GkeNodePoolTarget.Role].
13746    /// If a `GkeNodePoolTarget` is not specified, Dataproc constructs a `DEFAULT`
13747    /// `GkeNodePoolTarget`. Each role can be given to only one
13748    /// `GkeNodePoolTarget`. All node pools must have the same location settings.
13749    ///
13750    /// [google.cloud.dataproc.v1.GkeNodePoolTarget.Role]: crate::model::gke_node_pool_target::Role
13751    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13752    pub node_pool_target: std::vec::Vec<crate::model::GkeNodePoolTarget>,
13753
13754    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13755    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13756}
13757
13758impl GkeClusterConfig {
13759    pub fn new() -> Self {
13760        std::default::Default::default()
13761    }
13762
13763    /// Sets the value of [gke_cluster_target][crate::model::GkeClusterConfig::gke_cluster_target].
13764    pub fn set_gke_cluster_target<T: std::convert::Into<std::string::String>>(
13765        mut self,
13766        v: T,
13767    ) -> Self {
13768        self.gke_cluster_target = v.into();
13769        self
13770    }
13771
13772    /// Sets the value of [node_pool_target][crate::model::GkeClusterConfig::node_pool_target].
13773    pub fn set_node_pool_target<T, V>(mut self, v: T) -> Self
13774    where
13775        T: std::iter::IntoIterator<Item = V>,
13776        V: std::convert::Into<crate::model::GkeNodePoolTarget>,
13777    {
13778        use std::iter::Iterator;
13779        self.node_pool_target = v.into_iter().map(|i| i.into()).collect();
13780        self
13781    }
13782}
13783
13784impl wkt::message::Message for GkeClusterConfig {
13785    fn typename() -> &'static str {
13786        "type.googleapis.com/google.cloud.dataproc.v1.GkeClusterConfig"
13787    }
13788}
13789
13790/// The configuration for running the Dataproc cluster on Kubernetes.
13791#[serde_with::serde_as]
13792#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13793#[serde(default, rename_all = "camelCase")]
13794#[non_exhaustive]
13795pub struct KubernetesClusterConfig {
13796    /// Optional. A namespace within the Kubernetes cluster to deploy into. If this
13797    /// namespace does not exist, it is created. If it exists, Dataproc verifies
13798    /// that another Dataproc VirtualCluster is not installed into it. If not
13799    /// specified, the name of the Dataproc Cluster is used.
13800    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13801    pub kubernetes_namespace: std::string::String,
13802
13803    /// Optional. The software configuration for this Dataproc cluster running on
13804    /// Kubernetes.
13805    #[serde(skip_serializing_if = "std::option::Option::is_none")]
13806    pub kubernetes_software_config: std::option::Option<crate::model::KubernetesSoftwareConfig>,
13807
13808    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
13809    pub config: std::option::Option<crate::model::kubernetes_cluster_config::Config>,
13810
13811    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13812    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13813}
13814
13815impl KubernetesClusterConfig {
13816    pub fn new() -> Self {
13817        std::default::Default::default()
13818    }
13819
13820    /// Sets the value of [kubernetes_namespace][crate::model::KubernetesClusterConfig::kubernetes_namespace].
13821    pub fn set_kubernetes_namespace<T: std::convert::Into<std::string::String>>(
13822        mut self,
13823        v: T,
13824    ) -> Self {
13825        self.kubernetes_namespace = v.into();
13826        self
13827    }
13828
13829    /// Sets the value of [kubernetes_software_config][crate::model::KubernetesClusterConfig::kubernetes_software_config].
13830    pub fn set_kubernetes_software_config<
13831        T: std::convert::Into<std::option::Option<crate::model::KubernetesSoftwareConfig>>,
13832    >(
13833        mut self,
13834        v: T,
13835    ) -> Self {
13836        self.kubernetes_software_config = v.into();
13837        self
13838    }
13839
13840    /// Sets the value of [config][crate::model::KubernetesClusterConfig::config].
13841    ///
13842    /// Note that all the setters affecting `config` are mutually
13843    /// exclusive.
13844    pub fn set_config<
13845        T: std::convert::Into<std::option::Option<crate::model::kubernetes_cluster_config::Config>>,
13846    >(
13847        mut self,
13848        v: T,
13849    ) -> Self {
13850        self.config = v.into();
13851        self
13852    }
13853
13854    /// The value of [config][crate::model::KubernetesClusterConfig::config]
13855    /// if it holds a `GkeClusterConfig`, `None` if the field is not set or
13856    /// holds a different branch.
13857    pub fn gke_cluster_config(
13858        &self,
13859    ) -> std::option::Option<&std::boxed::Box<crate::model::GkeClusterConfig>> {
13860        #[allow(unreachable_patterns)]
13861        self.config.as_ref().and_then(|v| match v {
13862            crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v) => {
13863                std::option::Option::Some(v)
13864            }
13865            _ => std::option::Option::None,
13866        })
13867    }
13868
13869    /// Sets the value of [config][crate::model::KubernetesClusterConfig::config]
13870    /// to hold a `GkeClusterConfig`.
13871    ///
13872    /// Note that all the setters affecting `config` are
13873    /// mutually exclusive.
13874    pub fn set_gke_cluster_config<
13875        T: std::convert::Into<std::boxed::Box<crate::model::GkeClusterConfig>>,
13876    >(
13877        mut self,
13878        v: T,
13879    ) -> Self {
13880        self.config = std::option::Option::Some(
13881            crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v.into()),
13882        );
13883        self
13884    }
13885}
13886
13887impl wkt::message::Message for KubernetesClusterConfig {
13888    fn typename() -> &'static str {
13889        "type.googleapis.com/google.cloud.dataproc.v1.KubernetesClusterConfig"
13890    }
13891}
13892
13893/// Defines additional types related to [KubernetesClusterConfig].
13894pub mod kubernetes_cluster_config {
13895    #[allow(unused_imports)]
13896    use super::*;
13897
13898    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
13899    #[serde(rename_all = "camelCase")]
13900    #[non_exhaustive]
13901    pub enum Config {
13902        /// Required. The configuration for running the Dataproc cluster on GKE.
13903        GkeClusterConfig(std::boxed::Box<crate::model::GkeClusterConfig>),
13904    }
13905}
13906
13907/// The software configuration for this Dataproc cluster running on Kubernetes.
13908#[serde_with::serde_as]
13909#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13910#[serde(default, rename_all = "camelCase")]
13911#[non_exhaustive]
13912pub struct KubernetesSoftwareConfig {
13913    /// The components that should be installed in this Dataproc cluster. The key
13914    /// must be a string from the KubernetesComponent enumeration. The value is
13915    /// the version of the software to be installed.
13916    /// At least one entry must be specified.
13917    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13918    pub component_version: std::collections::HashMap<std::string::String, std::string::String>,
13919
13920    /// The properties to set on daemon config files.
13921    ///
13922    /// Property keys are specified in `prefix:property` format, for example
13923    /// `spark:spark.kubernetes.container.image`. The following are supported
13924    /// prefixes and their mappings:
13925    ///
13926    /// * spark:  `spark-defaults.conf`
13927    ///
13928    /// For more information, see [Cluster
13929    /// properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
13930    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13931    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
13932
13933    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13934    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13935}
13936
13937impl KubernetesSoftwareConfig {
13938    pub fn new() -> Self {
13939        std::default::Default::default()
13940    }
13941
13942    /// Sets the value of [component_version][crate::model::KubernetesSoftwareConfig::component_version].
13943    pub fn set_component_version<T, K, V>(mut self, v: T) -> Self
13944    where
13945        T: std::iter::IntoIterator<Item = (K, V)>,
13946        K: std::convert::Into<std::string::String>,
13947        V: std::convert::Into<std::string::String>,
13948    {
13949        use std::iter::Iterator;
13950        self.component_version = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13951        self
13952    }
13953
13954    /// Sets the value of [properties][crate::model::KubernetesSoftwareConfig::properties].
13955    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
13956    where
13957        T: std::iter::IntoIterator<Item = (K, V)>,
13958        K: std::convert::Into<std::string::String>,
13959        V: std::convert::Into<std::string::String>,
13960    {
13961        use std::iter::Iterator;
13962        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13963        self
13964    }
13965}
13966
13967impl wkt::message::Message for KubernetesSoftwareConfig {
13968    fn typename() -> &'static str {
13969        "type.googleapis.com/google.cloud.dataproc.v1.KubernetesSoftwareConfig"
13970    }
13971}
13972
13973/// GKE node pools that Dataproc workloads run on.
13974#[serde_with::serde_as]
13975#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13976#[serde(default, rename_all = "camelCase")]
13977#[non_exhaustive]
13978pub struct GkeNodePoolTarget {
13979    /// Required. The target GKE node pool.
13980    /// Format:
13981    /// 'projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}'
13982    #[serde(skip_serializing_if = "std::string::String::is_empty")]
13983    pub node_pool: std::string::String,
13984
13985    /// Required. The roles associated with the GKE node pool.
13986    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13987    pub roles: std::vec::Vec<crate::model::gke_node_pool_target::Role>,
13988
13989    /// Input only. The configuration for the GKE node pool.
13990    ///
13991    /// If specified, Dataproc attempts to create a node pool with the
13992    /// specified shape. If one with the same name already exists, it is
13993    /// verified against all specified fields. If a field differs, the
13994    /// virtual cluster creation will fail.
13995    ///
13996    /// If omitted, any node pool with the specified name is used. If a
13997    /// node pool with the specified name does not exist, Dataproc create a
13998    /// node pool with default values.
13999    ///
14000    /// This is an input only field. It will not be returned by the API.
14001    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14002    pub node_pool_config: std::option::Option<crate::model::GkeNodePoolConfig>,
14003
14004    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14005    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14006}
14007
14008impl GkeNodePoolTarget {
14009    pub fn new() -> Self {
14010        std::default::Default::default()
14011    }
14012
14013    /// Sets the value of [node_pool][crate::model::GkeNodePoolTarget::node_pool].
14014    pub fn set_node_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14015        self.node_pool = v.into();
14016        self
14017    }
14018
14019    /// Sets the value of [node_pool_config][crate::model::GkeNodePoolTarget::node_pool_config].
14020    pub fn set_node_pool_config<
14021        T: std::convert::Into<std::option::Option<crate::model::GkeNodePoolConfig>>,
14022    >(
14023        mut self,
14024        v: T,
14025    ) -> Self {
14026        self.node_pool_config = v.into();
14027        self
14028    }
14029
14030    /// Sets the value of [roles][crate::model::GkeNodePoolTarget::roles].
14031    pub fn set_roles<T, V>(mut self, v: T) -> Self
14032    where
14033        T: std::iter::IntoIterator<Item = V>,
14034        V: std::convert::Into<crate::model::gke_node_pool_target::Role>,
14035    {
14036        use std::iter::Iterator;
14037        self.roles = v.into_iter().map(|i| i.into()).collect();
14038        self
14039    }
14040}
14041
14042impl wkt::message::Message for GkeNodePoolTarget {
14043    fn typename() -> &'static str {
14044        "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolTarget"
14045    }
14046}
14047
14048/// Defines additional types related to [GkeNodePoolTarget].
14049pub mod gke_node_pool_target {
14050    #[allow(unused_imports)]
14051    use super::*;
14052
14053    /// `Role` specifies the tasks that will run on the node pool. Roles can be
14054    /// specific to workloads. Exactly one
14055    /// [GkeNodePoolTarget][google.cloud.dataproc.v1.GkeNodePoolTarget] within the
14056    /// virtual cluster must have the `DEFAULT` role, which is used to run all
14057    /// workloads that are not associated with a node pool.
14058    ///
14059    /// [google.cloud.dataproc.v1.GkeNodePoolTarget]: crate::model::GkeNodePoolTarget
14060    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14061    pub struct Role(i32);
14062
14063    impl Role {
14064        /// Role is unspecified.
14065        pub const ROLE_UNSPECIFIED: Role = Role::new(0);
14066
14067        /// At least one node pool must have the `DEFAULT` role.
14068        /// Work assigned to a role that is not associated with a node pool
14069        /// is assigned to the node pool with the `DEFAULT` role. For example,
14070        /// work assigned to the `CONTROLLER` role will be assigned to the node pool
14071        /// with the `DEFAULT` role if no node pool has the `CONTROLLER` role.
14072        pub const DEFAULT: Role = Role::new(1);
14073
14074        /// Run work associated with the Dataproc control plane (for example,
14075        /// controllers and webhooks). Very low resource requirements.
14076        pub const CONTROLLER: Role = Role::new(2);
14077
14078        /// Run work associated with a Spark driver of a job.
14079        pub const SPARK_DRIVER: Role = Role::new(3);
14080
14081        /// Run work associated with a Spark executor of a job.
14082        pub const SPARK_EXECUTOR: Role = Role::new(4);
14083
14084        /// Creates a new Role instance.
14085        pub(crate) const fn new(value: i32) -> Self {
14086            Self(value)
14087        }
14088
14089        /// Gets the enum value.
14090        pub fn value(&self) -> i32 {
14091            self.0
14092        }
14093
14094        /// Gets the enum value as a string.
14095        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
14096            match self.0 {
14097                0 => std::borrow::Cow::Borrowed("ROLE_UNSPECIFIED"),
14098                1 => std::borrow::Cow::Borrowed("DEFAULT"),
14099                2 => std::borrow::Cow::Borrowed("CONTROLLER"),
14100                3 => std::borrow::Cow::Borrowed("SPARK_DRIVER"),
14101                4 => std::borrow::Cow::Borrowed("SPARK_EXECUTOR"),
14102                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
14103            }
14104        }
14105
14106        /// Creates an enum value from the value name.
14107        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
14108            match name {
14109                "ROLE_UNSPECIFIED" => std::option::Option::Some(Self::ROLE_UNSPECIFIED),
14110                "DEFAULT" => std::option::Option::Some(Self::DEFAULT),
14111                "CONTROLLER" => std::option::Option::Some(Self::CONTROLLER),
14112                "SPARK_DRIVER" => std::option::Option::Some(Self::SPARK_DRIVER),
14113                "SPARK_EXECUTOR" => std::option::Option::Some(Self::SPARK_EXECUTOR),
14114                _ => std::option::Option::None,
14115            }
14116        }
14117    }
14118
14119    impl std::convert::From<i32> for Role {
14120        fn from(value: i32) -> Self {
14121            Self::new(value)
14122        }
14123    }
14124
14125    impl std::default::Default for Role {
14126        fn default() -> Self {
14127            Self::new(0)
14128        }
14129    }
14130}
14131
14132/// The configuration of a GKE node pool used by a [Dataproc-on-GKE
14133/// cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster).
14134#[serde_with::serde_as]
14135#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14136#[serde(default, rename_all = "camelCase")]
14137#[non_exhaustive]
14138pub struct GkeNodePoolConfig {
14139    /// Optional. The node pool configuration.
14140    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14141    pub config: std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>,
14142
14143    /// Optional. The list of Compute Engine
14144    /// [zones](https://cloud.google.com/compute/docs/zones#available) where
14145    /// node pool nodes associated with a Dataproc on GKE virtual cluster
14146    /// will be located.
14147    ///
14148    /// **Note:** All node pools associated with a virtual cluster
14149    /// must be located in the same region as the virtual cluster, and they must
14150    /// be located in the same zone within that region.
14151    ///
14152    /// If a location is not specified during node pool creation, Dataproc on GKE
14153    /// will choose the zone.
14154    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14155    pub locations: std::vec::Vec<std::string::String>,
14156
14157    /// Optional. The autoscaler configuration for this node pool. The autoscaler
14158    /// is enabled only when a valid configuration is present.
14159    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14160    pub autoscaling:
14161        std::option::Option<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
14162
14163    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14164    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14165}
14166
14167impl GkeNodePoolConfig {
14168    pub fn new() -> Self {
14169        std::default::Default::default()
14170    }
14171
14172    /// Sets the value of [config][crate::model::GkeNodePoolConfig::config].
14173    pub fn set_config<
14174        T: std::convert::Into<std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>>,
14175    >(
14176        mut self,
14177        v: T,
14178    ) -> Self {
14179        self.config = v.into();
14180        self
14181    }
14182
14183    /// Sets the value of [autoscaling][crate::model::GkeNodePoolConfig::autoscaling].
14184    pub fn set_autoscaling<
14185        T: std::convert::Into<
14186                std::option::Option<
14187                    crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig,
14188                >,
14189            >,
14190    >(
14191        mut self,
14192        v: T,
14193    ) -> Self {
14194        self.autoscaling = v.into();
14195        self
14196    }
14197
14198    /// Sets the value of [locations][crate::model::GkeNodePoolConfig::locations].
14199    pub fn set_locations<T, V>(mut self, v: T) -> Self
14200    where
14201        T: std::iter::IntoIterator<Item = V>,
14202        V: std::convert::Into<std::string::String>,
14203    {
14204        use std::iter::Iterator;
14205        self.locations = v.into_iter().map(|i| i.into()).collect();
14206        self
14207    }
14208}
14209
14210impl wkt::message::Message for GkeNodePoolConfig {
14211    fn typename() -> &'static str {
14212        "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig"
14213    }
14214}
14215
14216/// Defines additional types related to [GkeNodePoolConfig].
14217pub mod gke_node_pool_config {
14218    #[allow(unused_imports)]
14219    use super::*;
14220
14221    /// Parameters that describe cluster nodes.
14222    #[serde_with::serde_as]
14223    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14224    #[serde(default, rename_all = "camelCase")]
14225    #[non_exhaustive]
14226    pub struct GkeNodeConfig {
14227        /// Optional. The name of a Compute Engine [machine
14228        /// type](https://cloud.google.com/compute/docs/machine-types).
14229        #[serde(skip_serializing_if = "std::string::String::is_empty")]
14230        pub machine_type: std::string::String,
14231
14232        /// Optional. The number of local SSD disks to attach to the node, which is
14233        /// limited by the maximum number of disks allowable per zone (see [Adding
14234        /// Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)).
14235        pub local_ssd_count: i32,
14236
14237        /// Optional. Whether the nodes are created as legacy [preemptible VM
14238        /// instances] (<https://cloud.google.com/compute/docs/instances/preemptible>).
14239        /// Also see
14240        /// [Spot][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.spot]
14241        /// VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot
14242        /// preemptible nodes cannot be used in a node pool with the `CONTROLLER`
14243        /// [role]
14244        /// (/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
14245        /// or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
14246        /// DEFAULT node pool will assume the CONTROLLER role).
14247        ///
14248        /// [google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.spot]: crate::model::gke_node_pool_config::GkeNodeConfig::spot
14249        pub preemptible: bool,
14250
14251        /// Optional. A list of [hardware
14252        /// accelerators](https://cloud.google.com/compute/docs/gpus) to attach to
14253        /// each node.
14254        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14255        pub accelerators:
14256            std::vec::Vec<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
14257
14258        /// Optional. [Minimum CPU
14259        /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
14260        /// to be used by this instance. The instance may be scheduled on the
14261        /// specified or a newer CPU platform. Specify the friendly names of CPU
14262        /// platforms, such as "Intel Haswell"` or Intel Sandy Bridge".
14263        #[serde(skip_serializing_if = "std::string::String::is_empty")]
14264        pub min_cpu_platform: std::string::String,
14265
14266        /// Optional. The [Customer Managed Encryption Key (CMEK)]
14267        /// (<https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek>)
14268        /// used to encrypt the boot disk attached to each node in the node pool.
14269        /// Specify the key using the following format:
14270        /// \<code\>projects/\<var\>KEY_PROJECT_ID\</var\>/locations/\<var\>LOCATION\</var\>/keyRings/\<var\>RING_NAME\</var\>/cryptoKeys/\<var\>KEY_NAME\</var\>\</code\>.
14271        #[serde(skip_serializing_if = "std::string::String::is_empty")]
14272        pub boot_disk_kms_key: std::string::String,
14273
14274        /// Optional. Whether the nodes are created as [Spot VM instances]
14275        /// (<https://cloud.google.com/compute/docs/instances/spot>).
14276        /// Spot VMs are the latest update to legacy
14277        /// [preemptible
14278        /// VMs][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible].
14279        /// Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible
14280        /// nodes cannot be used in a node pool with the `CONTROLLER`
14281        /// [role](/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
14282        /// or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
14283        /// DEFAULT node pool will assume the CONTROLLER role).
14284        ///
14285        /// [google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible]: crate::model::gke_node_pool_config::GkeNodeConfig::preemptible
14286        pub spot: bool,
14287
14288        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14289        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14290    }
14291
14292    impl GkeNodeConfig {
14293        pub fn new() -> Self {
14294            std::default::Default::default()
14295        }
14296
14297        /// Sets the value of [machine_type][crate::model::gke_node_pool_config::GkeNodeConfig::machine_type].
14298        pub fn set_machine_type<T: std::convert::Into<std::string::String>>(
14299            mut self,
14300            v: T,
14301        ) -> Self {
14302            self.machine_type = v.into();
14303            self
14304        }
14305
14306        /// Sets the value of [local_ssd_count][crate::model::gke_node_pool_config::GkeNodeConfig::local_ssd_count].
14307        pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14308            self.local_ssd_count = v.into();
14309            self
14310        }
14311
14312        /// Sets the value of [preemptible][crate::model::gke_node_pool_config::GkeNodeConfig::preemptible].
14313        pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14314            self.preemptible = v.into();
14315            self
14316        }
14317
14318        /// Sets the value of [min_cpu_platform][crate::model::gke_node_pool_config::GkeNodeConfig::min_cpu_platform].
14319        pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
14320            mut self,
14321            v: T,
14322        ) -> Self {
14323            self.min_cpu_platform = v.into();
14324            self
14325        }
14326
14327        /// Sets the value of [boot_disk_kms_key][crate::model::gke_node_pool_config::GkeNodeConfig::boot_disk_kms_key].
14328        pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
14329            mut self,
14330            v: T,
14331        ) -> Self {
14332            self.boot_disk_kms_key = v.into();
14333            self
14334        }
14335
14336        /// Sets the value of [spot][crate::model::gke_node_pool_config::GkeNodeConfig::spot].
14337        pub fn set_spot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14338            self.spot = v.into();
14339            self
14340        }
14341
14342        /// Sets the value of [accelerators][crate::model::gke_node_pool_config::GkeNodeConfig::accelerators].
14343        pub fn set_accelerators<T, V>(mut self, v: T) -> Self
14344        where
14345            T: std::iter::IntoIterator<Item = V>,
14346            V: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
14347        {
14348            use std::iter::Iterator;
14349            self.accelerators = v.into_iter().map(|i| i.into()).collect();
14350            self
14351        }
14352    }
14353
14354    impl wkt::message::Message for GkeNodeConfig {
14355        fn typename() -> &'static str {
14356            "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig"
14357        }
14358    }
14359
14360    /// A GkeNodeConfigAcceleratorConfig represents a Hardware Accelerator request
14361    /// for a node pool.
14362    #[serde_with::serde_as]
14363    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14364    #[serde(default, rename_all = "camelCase")]
14365    #[non_exhaustive]
14366    pub struct GkeNodePoolAcceleratorConfig {
14367        /// The number of accelerator cards exposed to an instance.
14368        #[serde_as(as = "serde_with::DisplayFromStr")]
14369        pub accelerator_count: i64,
14370
14371        /// The accelerator type resource namename (see GPUs on Compute Engine).
14372        #[serde(skip_serializing_if = "std::string::String::is_empty")]
14373        pub accelerator_type: std::string::String,
14374
14375        /// Size of partitions to create on the GPU. Valid values are described in
14376        /// the NVIDIA [mig user
14377        /// guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning).
14378        #[serde(skip_serializing_if = "std::string::String::is_empty")]
14379        pub gpu_partition_size: std::string::String,
14380
14381        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14382        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14383    }
14384
14385    impl GkeNodePoolAcceleratorConfig {
14386        pub fn new() -> Self {
14387            std::default::Default::default()
14388        }
14389
14390        /// Sets the value of [accelerator_count][crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig::accelerator_count].
14391        pub fn set_accelerator_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14392            self.accelerator_count = v.into();
14393            self
14394        }
14395
14396        /// Sets the value of [accelerator_type][crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig::accelerator_type].
14397        pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
14398            mut self,
14399            v: T,
14400        ) -> Self {
14401            self.accelerator_type = v.into();
14402            self
14403        }
14404
14405        /// Sets the value of [gpu_partition_size][crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig::gpu_partition_size].
14406        pub fn set_gpu_partition_size<T: std::convert::Into<std::string::String>>(
14407            mut self,
14408            v: T,
14409        ) -> Self {
14410            self.gpu_partition_size = v.into();
14411            self
14412        }
14413    }
14414
14415    impl wkt::message::Message for GkeNodePoolAcceleratorConfig {
14416        fn typename() -> &'static str {
14417            "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig"
14418        }
14419    }
14420
14421    /// GkeNodePoolAutoscaling contains information the cluster autoscaler needs to
14422    /// adjust the size of the node pool to the current cluster usage.
14423    #[serde_with::serde_as]
14424    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14425    #[serde(default, rename_all = "camelCase")]
14426    #[non_exhaustive]
14427    pub struct GkeNodePoolAutoscalingConfig {
14428        /// The minimum number of nodes in the node pool. Must be >= 0 and <=
14429        /// max_node_count.
14430        pub min_node_count: i32,
14431
14432        /// The maximum number of nodes in the node pool. Must be >= min_node_count,
14433        /// and must be > 0.
14434        /// **Note:** Quota must be sufficient to scale up the cluster.
14435        pub max_node_count: i32,
14436
14437        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14438        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14439    }
14440
14441    impl GkeNodePoolAutoscalingConfig {
14442        pub fn new() -> Self {
14443            std::default::Default::default()
14444        }
14445
14446        /// Sets the value of [min_node_count][crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig::min_node_count].
14447        pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14448            self.min_node_count = v.into();
14449            self
14450        }
14451
14452        /// Sets the value of [max_node_count][crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig::max_node_count].
14453        pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14454            self.max_node_count = v.into();
14455            self
14456        }
14457    }
14458
14459    impl wkt::message::Message for GkeNodePoolAutoscalingConfig {
14460        fn typename() -> &'static str {
14461            "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig"
14462        }
14463    }
14464}
14465
14466/// Authentication configuration for a workload is used to set the default
14467/// identity for the workload execution.
14468/// The config specifies the type of identity (service account or user) that
14469/// will be used by workloads to access resources on the project(s).
14470#[serde_with::serde_as]
14471#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14472#[serde(default, rename_all = "camelCase")]
14473#[non_exhaustive]
14474pub struct AuthenticationConfig {
14475    /// Optional. Authentication type for the user workload running in containers.
14476    pub user_workload_authentication_type: crate::model::authentication_config::AuthenticationType,
14477
14478    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14479    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14480}
14481
14482impl AuthenticationConfig {
14483    pub fn new() -> Self {
14484        std::default::Default::default()
14485    }
14486
14487    /// Sets the value of [user_workload_authentication_type][crate::model::AuthenticationConfig::user_workload_authentication_type].
14488    pub fn set_user_workload_authentication_type<
14489        T: std::convert::Into<crate::model::authentication_config::AuthenticationType>,
14490    >(
14491        mut self,
14492        v: T,
14493    ) -> Self {
14494        self.user_workload_authentication_type = v.into();
14495        self
14496    }
14497}
14498
14499impl wkt::message::Message for AuthenticationConfig {
14500    fn typename() -> &'static str {
14501        "type.googleapis.com/google.cloud.dataproc.v1.AuthenticationConfig"
14502    }
14503}
14504
14505/// Defines additional types related to [AuthenticationConfig].
14506pub mod authentication_config {
14507    #[allow(unused_imports)]
14508    use super::*;
14509
14510    /// Authentication types for workload execution.
14511    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14512    pub struct AuthenticationType(i32);
14513
14514    impl AuthenticationType {
14515        /// If AuthenticationType is unspecified then END_USER_CREDENTIALS is used
14516        /// for 3.0 and newer runtimes, and SERVICE_ACCOUNT is used for older
14517        /// runtimes.
14518        pub const AUTHENTICATION_TYPE_UNSPECIFIED: AuthenticationType = AuthenticationType::new(0);
14519
14520        /// Use service account credentials for authenticating to other services.
14521        pub const SERVICE_ACCOUNT: AuthenticationType = AuthenticationType::new(1);
14522
14523        /// Use OAuth credentials associated with the workload creator/user for
14524        /// authenticating to other services.
14525        pub const END_USER_CREDENTIALS: AuthenticationType = AuthenticationType::new(2);
14526
14527        /// Creates a new AuthenticationType instance.
14528        pub(crate) const fn new(value: i32) -> Self {
14529            Self(value)
14530        }
14531
14532        /// Gets the enum value.
14533        pub fn value(&self) -> i32 {
14534            self.0
14535        }
14536
14537        /// Gets the enum value as a string.
14538        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
14539            match self.0 {
14540                0 => std::borrow::Cow::Borrowed("AUTHENTICATION_TYPE_UNSPECIFIED"),
14541                1 => std::borrow::Cow::Borrowed("SERVICE_ACCOUNT"),
14542                2 => std::borrow::Cow::Borrowed("END_USER_CREDENTIALS"),
14543                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
14544            }
14545        }
14546
14547        /// Creates an enum value from the value name.
14548        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
14549            match name {
14550                "AUTHENTICATION_TYPE_UNSPECIFIED" => {
14551                    std::option::Option::Some(Self::AUTHENTICATION_TYPE_UNSPECIFIED)
14552                }
14553                "SERVICE_ACCOUNT" => std::option::Option::Some(Self::SERVICE_ACCOUNT),
14554                "END_USER_CREDENTIALS" => std::option::Option::Some(Self::END_USER_CREDENTIALS),
14555                _ => std::option::Option::None,
14556            }
14557        }
14558    }
14559
14560    impl std::convert::From<i32> for AuthenticationType {
14561        fn from(value: i32) -> Self {
14562            Self::new(value)
14563        }
14564    }
14565
14566    impl std::default::Default for AuthenticationType {
14567        fn default() -> Self {
14568            Self::new(0)
14569        }
14570    }
14571}
14572
14573/// Autotuning configuration of the workload.
14574#[serde_with::serde_as]
14575#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14576#[serde(default, rename_all = "camelCase")]
14577#[non_exhaustive]
14578pub struct AutotuningConfig {
14579    /// Optional. Scenarios for which tunings are applied.
14580    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14581    pub scenarios: std::vec::Vec<crate::model::autotuning_config::Scenario>,
14582
14583    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14584    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14585}
14586
14587impl AutotuningConfig {
14588    pub fn new() -> Self {
14589        std::default::Default::default()
14590    }
14591
14592    /// Sets the value of [scenarios][crate::model::AutotuningConfig::scenarios].
14593    pub fn set_scenarios<T, V>(mut self, v: T) -> Self
14594    where
14595        T: std::iter::IntoIterator<Item = V>,
14596        V: std::convert::Into<crate::model::autotuning_config::Scenario>,
14597    {
14598        use std::iter::Iterator;
14599        self.scenarios = v.into_iter().map(|i| i.into()).collect();
14600        self
14601    }
14602}
14603
14604impl wkt::message::Message for AutotuningConfig {
14605    fn typename() -> &'static str {
14606        "type.googleapis.com/google.cloud.dataproc.v1.AutotuningConfig"
14607    }
14608}
14609
14610/// Defines additional types related to [AutotuningConfig].
14611pub mod autotuning_config {
14612    #[allow(unused_imports)]
14613    use super::*;
14614
14615    /// Scenario represents a specific goal that autotuning will attempt to achieve
14616    /// by modifying workloads.
14617    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14618    pub struct Scenario(i32);
14619
14620    impl Scenario {
14621        /// Default value.
14622        pub const SCENARIO_UNSPECIFIED: Scenario = Scenario::new(0);
14623
14624        /// Scaling recommendations such as initialExecutors.
14625        pub const SCALING: Scenario = Scenario::new(2);
14626
14627        /// Adding hints for potential relation broadcasts.
14628        pub const BROADCAST_HASH_JOIN: Scenario = Scenario::new(3);
14629
14630        /// Memory management for workloads.
14631        pub const MEMORY: Scenario = Scenario::new(4);
14632
14633        /// Creates a new Scenario instance.
14634        pub(crate) const fn new(value: i32) -> Self {
14635            Self(value)
14636        }
14637
14638        /// Gets the enum value.
14639        pub fn value(&self) -> i32 {
14640            self.0
14641        }
14642
14643        /// Gets the enum value as a string.
14644        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
14645            match self.0 {
14646                0 => std::borrow::Cow::Borrowed("SCENARIO_UNSPECIFIED"),
14647                2 => std::borrow::Cow::Borrowed("SCALING"),
14648                3 => std::borrow::Cow::Borrowed("BROADCAST_HASH_JOIN"),
14649                4 => std::borrow::Cow::Borrowed("MEMORY"),
14650                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
14651            }
14652        }
14653
14654        /// Creates an enum value from the value name.
14655        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
14656            match name {
14657                "SCENARIO_UNSPECIFIED" => std::option::Option::Some(Self::SCENARIO_UNSPECIFIED),
14658                "SCALING" => std::option::Option::Some(Self::SCALING),
14659                "BROADCAST_HASH_JOIN" => std::option::Option::Some(Self::BROADCAST_HASH_JOIN),
14660                "MEMORY" => std::option::Option::Some(Self::MEMORY),
14661                _ => std::option::Option::None,
14662            }
14663        }
14664    }
14665
14666    impl std::convert::From<i32> for Scenario {
14667        fn from(value: i32) -> Self {
14668            Self::new(value)
14669        }
14670    }
14671
14672    impl std::default::Default for Scenario {
14673        fn default() -> Self {
14674            Self::new(0)
14675        }
14676    }
14677}
14678
14679/// Configuration for dependency repositories
14680#[serde_with::serde_as]
14681#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14682#[serde(default, rename_all = "camelCase")]
14683#[non_exhaustive]
14684pub struct RepositoryConfig {
14685    /// Optional. Configuration for PyPi repository.
14686    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14687    pub pypi_repository_config: std::option::Option<crate::model::PyPiRepositoryConfig>,
14688
14689    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14690    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14691}
14692
14693impl RepositoryConfig {
14694    pub fn new() -> Self {
14695        std::default::Default::default()
14696    }
14697
14698    /// Sets the value of [pypi_repository_config][crate::model::RepositoryConfig::pypi_repository_config].
14699    pub fn set_pypi_repository_config<
14700        T: std::convert::Into<std::option::Option<crate::model::PyPiRepositoryConfig>>,
14701    >(
14702        mut self,
14703        v: T,
14704    ) -> Self {
14705        self.pypi_repository_config = v.into();
14706        self
14707    }
14708}
14709
14710impl wkt::message::Message for RepositoryConfig {
14711    fn typename() -> &'static str {
14712        "type.googleapis.com/google.cloud.dataproc.v1.RepositoryConfig"
14713    }
14714}
14715
14716/// Configuration for PyPi repository
14717#[serde_with::serde_as]
14718#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14719#[serde(default, rename_all = "camelCase")]
14720#[non_exhaustive]
14721pub struct PyPiRepositoryConfig {
14722    /// Optional. PyPi repository address
14723    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14724    pub pypi_repository: std::string::String,
14725
14726    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14727    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14728}
14729
14730impl PyPiRepositoryConfig {
14731    pub fn new() -> Self {
14732        std::default::Default::default()
14733    }
14734
14735    /// Sets the value of [pypi_repository][crate::model::PyPiRepositoryConfig::pypi_repository].
14736    pub fn set_pypi_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14737        self.pypi_repository = v.into();
14738        self
14739    }
14740}
14741
14742impl wkt::message::Message for PyPiRepositoryConfig {
14743    fn typename() -> &'static str {
14744        "type.googleapis.com/google.cloud.dataproc.v1.PyPiRepositoryConfig"
14745    }
14746}
14747
14748/// A Dataproc workflow template resource.
14749#[serde_with::serde_as]
14750#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14751#[serde(default, rename_all = "camelCase")]
14752#[non_exhaustive]
14753pub struct WorkflowTemplate {
14754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14755    pub id: std::string::String,
14756
14757    /// Output only. The resource name of the workflow template, as described
14758    /// in <https://cloud.google.com/apis/design/resource_names>.
14759    ///
14760    /// * For `projects.regions.workflowTemplates`, the resource name of the
14761    ///   template has the following format:
14762    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
14763    ///
14764    /// * For `projects.locations.workflowTemplates`, the resource name of the
14765    ///   template has the following format:
14766    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
14767    ///
14768    #[serde(skip_serializing_if = "std::string::String::is_empty")]
14769    pub name: std::string::String,
14770
14771    /// Optional. Used to perform a consistent read-modify-write.
14772    ///
14773    /// This field should be left blank for a `CreateWorkflowTemplate` request. It
14774    /// is required for an `UpdateWorkflowTemplate` request, and must match the
14775    /// current server version. A typical update template flow would fetch the
14776    /// current template with a `GetWorkflowTemplate` request, which will return
14777    /// the current template with the `version` field filled in with the
14778    /// current server version. The user updates other fields in the template,
14779    /// then returns it as part of the `UpdateWorkflowTemplate` request.
14780    pub version: i32,
14781
14782    /// Output only. The time template was created.
14783    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14784    pub create_time: std::option::Option<wkt::Timestamp>,
14785
14786    /// Output only. The time template was last updated.
14787    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14788    pub update_time: std::option::Option<wkt::Timestamp>,
14789
14790    /// Optional. The labels to associate with this template. These labels
14791    /// will be propagated to all jobs and clusters created by the workflow
14792    /// instance.
14793    ///
14794    /// Label **keys** must contain 1 to 63 characters, and must conform to
14795    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
14796    ///
14797    /// Label **values** may be empty, but, if present, must contain 1 to 63
14798    /// characters, and must conform to
14799    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
14800    ///
14801    /// No more than 32 labels can be associated with a template.
14802    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
14803    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14804
14805    /// Required. WorkflowTemplate scheduling information.
14806    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14807    pub placement: std::option::Option<crate::model::WorkflowTemplatePlacement>,
14808
14809    /// Required. The Directed Acyclic Graph of Jobs to submit.
14810    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14811    pub jobs: std::vec::Vec<crate::model::OrderedJob>,
14812
14813    /// Optional. Template parameters whose values are substituted into the
14814    /// template. Values for parameters must be provided when the template is
14815    /// instantiated.
14816    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14817    pub parameters: std::vec::Vec<crate::model::TemplateParameter>,
14818
14819    /// Optional. Timeout duration for the DAG of jobs, expressed in seconds (see
14820    /// [JSON representation of
14821    /// duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
14822    /// The timeout duration must be from 10 minutes ("600s") to 24 hours
14823    /// ("86400s"). The timer begins when the first job is submitted. If the
14824    /// workflow is running at the end of the timeout period, any remaining jobs
14825    /// are cancelled, the workflow is ended, and if the workflow was running on a
14826    /// [managed
14827    /// cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster),
14828    /// the cluster is deleted.
14829    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14830    pub dag_timeout: std::option::Option<wkt::Duration>,
14831
14832    /// Optional. Encryption settings for encrypting workflow template job
14833    /// arguments.
14834    #[serde(skip_serializing_if = "std::option::Option::is_none")]
14835    pub encryption_config: std::option::Option<crate::model::workflow_template::EncryptionConfig>,
14836
14837    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14838    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14839}
14840
14841impl WorkflowTemplate {
14842    pub fn new() -> Self {
14843        std::default::Default::default()
14844    }
14845
14846    /// Sets the value of [id][crate::model::WorkflowTemplate::id].
14847    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14848        self.id = v.into();
14849        self
14850    }
14851
14852    /// Sets the value of [name][crate::model::WorkflowTemplate::name].
14853    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14854        self.name = v.into();
14855        self
14856    }
14857
14858    /// Sets the value of [version][crate::model::WorkflowTemplate::version].
14859    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14860        self.version = v.into();
14861        self
14862    }
14863
14864    /// Sets the value of [create_time][crate::model::WorkflowTemplate::create_time].
14865    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
14866        mut self,
14867        v: T,
14868    ) -> Self {
14869        self.create_time = v.into();
14870        self
14871    }
14872
14873    /// Sets the value of [update_time][crate::model::WorkflowTemplate::update_time].
14874    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
14875        mut self,
14876        v: T,
14877    ) -> Self {
14878        self.update_time = v.into();
14879        self
14880    }
14881
14882    /// Sets the value of [placement][crate::model::WorkflowTemplate::placement].
14883    pub fn set_placement<
14884        T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplatePlacement>>,
14885    >(
14886        mut self,
14887        v: T,
14888    ) -> Self {
14889        self.placement = v.into();
14890        self
14891    }
14892
14893    /// Sets the value of [dag_timeout][crate::model::WorkflowTemplate::dag_timeout].
14894    pub fn set_dag_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
14895        mut self,
14896        v: T,
14897    ) -> Self {
14898        self.dag_timeout = v.into();
14899        self
14900    }
14901
14902    /// Sets the value of [encryption_config][crate::model::WorkflowTemplate::encryption_config].
14903    pub fn set_encryption_config<
14904        T: std::convert::Into<std::option::Option<crate::model::workflow_template::EncryptionConfig>>,
14905    >(
14906        mut self,
14907        v: T,
14908    ) -> Self {
14909        self.encryption_config = v.into();
14910        self
14911    }
14912
14913    /// Sets the value of [jobs][crate::model::WorkflowTemplate::jobs].
14914    pub fn set_jobs<T, V>(mut self, v: T) -> Self
14915    where
14916        T: std::iter::IntoIterator<Item = V>,
14917        V: std::convert::Into<crate::model::OrderedJob>,
14918    {
14919        use std::iter::Iterator;
14920        self.jobs = v.into_iter().map(|i| i.into()).collect();
14921        self
14922    }
14923
14924    /// Sets the value of [parameters][crate::model::WorkflowTemplate::parameters].
14925    pub fn set_parameters<T, V>(mut self, v: T) -> Self
14926    where
14927        T: std::iter::IntoIterator<Item = V>,
14928        V: std::convert::Into<crate::model::TemplateParameter>,
14929    {
14930        use std::iter::Iterator;
14931        self.parameters = v.into_iter().map(|i| i.into()).collect();
14932        self
14933    }
14934
14935    /// Sets the value of [labels][crate::model::WorkflowTemplate::labels].
14936    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14937    where
14938        T: std::iter::IntoIterator<Item = (K, V)>,
14939        K: std::convert::Into<std::string::String>,
14940        V: std::convert::Into<std::string::String>,
14941    {
14942        use std::iter::Iterator;
14943        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14944        self
14945    }
14946}
14947
14948impl wkt::message::Message for WorkflowTemplate {
14949    fn typename() -> &'static str {
14950        "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate"
14951    }
14952}
14953
14954/// Defines additional types related to [WorkflowTemplate].
14955pub mod workflow_template {
14956    #[allow(unused_imports)]
14957    use super::*;
14958
14959    /// Encryption settings for encrypting workflow template job arguments.
14960    #[serde_with::serde_as]
14961    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14962    #[serde(default, rename_all = "camelCase")]
14963    #[non_exhaustive]
14964    pub struct EncryptionConfig {
14965        /// Optional. The Cloud KMS key name to use for encrypting
14966        /// workflow template job arguments.
14967        ///
14968        /// When this this key is provided, the following workflow template
14969        /// [job arguments]
14970        /// (<https://cloud.google.com/dataproc/docs/concepts/workflows/use-workflows#adding_jobs_to_a_template>),
14971        /// if present, are
14972        /// [CMEK
14973        /// encrypted](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_workflow_template_data):
14974        ///
14975        /// * [FlinkJob
14976        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob)
14977        /// * [HadoopJob
14978        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob)
14979        /// * [SparkJob
14980        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob)
14981        /// * [SparkRJob
14982        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob)
14983        /// * [PySparkJob
14984        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob)
14985        /// * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob)
14986        ///   scriptVariables and queryList.queries
14987        /// * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob)
14988        ///   scriptVariables and queryList.queries
14989        /// * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob)
14990        ///   scriptVariables and queryList.queries
14991        /// * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob)
14992        ///   scriptVariables and queryList.queries
14993        #[serde(skip_serializing_if = "std::string::String::is_empty")]
14994        pub kms_key: std::string::String,
14995
14996        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14997        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14998    }
14999
15000    impl EncryptionConfig {
15001        pub fn new() -> Self {
15002            std::default::Default::default()
15003        }
15004
15005        /// Sets the value of [kms_key][crate::model::workflow_template::EncryptionConfig::kms_key].
15006        pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15007            self.kms_key = v.into();
15008            self
15009        }
15010    }
15011
15012    impl wkt::message::Message for EncryptionConfig {
15013        fn typename() -> &'static str {
15014            "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig"
15015        }
15016    }
15017}
15018
15019/// Specifies workflow execution target.
15020///
15021/// Either `managed_cluster` or `cluster_selector` is required.
15022#[serde_with::serde_as]
15023#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15024#[serde(default, rename_all = "camelCase")]
15025#[non_exhaustive]
15026pub struct WorkflowTemplatePlacement {
15027    /// Required. Specifies where workflow executes; either on a managed
15028    /// cluster or an existing cluster chosen by labels.
15029    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15030    pub placement: std::option::Option<crate::model::workflow_template_placement::Placement>,
15031
15032    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15033    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15034}
15035
15036impl WorkflowTemplatePlacement {
15037    pub fn new() -> Self {
15038        std::default::Default::default()
15039    }
15040
15041    /// Sets the value of [placement][crate::model::WorkflowTemplatePlacement::placement].
15042    ///
15043    /// Note that all the setters affecting `placement` are mutually
15044    /// exclusive.
15045    pub fn set_placement<
15046        T: std::convert::Into<
15047                std::option::Option<crate::model::workflow_template_placement::Placement>,
15048            >,
15049    >(
15050        mut self,
15051        v: T,
15052    ) -> Self {
15053        self.placement = v.into();
15054        self
15055    }
15056
15057    /// The value of [placement][crate::model::WorkflowTemplatePlacement::placement]
15058    /// if it holds a `ManagedCluster`, `None` if the field is not set or
15059    /// holds a different branch.
15060    pub fn managed_cluster(
15061        &self,
15062    ) -> std::option::Option<&std::boxed::Box<crate::model::ManagedCluster>> {
15063        #[allow(unreachable_patterns)]
15064        self.placement.as_ref().and_then(|v| match v {
15065            crate::model::workflow_template_placement::Placement::ManagedCluster(v) => {
15066                std::option::Option::Some(v)
15067            }
15068            _ => std::option::Option::None,
15069        })
15070    }
15071
15072    /// The value of [placement][crate::model::WorkflowTemplatePlacement::placement]
15073    /// if it holds a `ClusterSelector`, `None` if the field is not set or
15074    /// holds a different branch.
15075    pub fn cluster_selector(
15076        &self,
15077    ) -> std::option::Option<&std::boxed::Box<crate::model::ClusterSelector>> {
15078        #[allow(unreachable_patterns)]
15079        self.placement.as_ref().and_then(|v| match v {
15080            crate::model::workflow_template_placement::Placement::ClusterSelector(v) => {
15081                std::option::Option::Some(v)
15082            }
15083            _ => std::option::Option::None,
15084        })
15085    }
15086
15087    /// Sets the value of [placement][crate::model::WorkflowTemplatePlacement::placement]
15088    /// to hold a `ManagedCluster`.
15089    ///
15090    /// Note that all the setters affecting `placement` are
15091    /// mutually exclusive.
15092    pub fn set_managed_cluster<
15093        T: std::convert::Into<std::boxed::Box<crate::model::ManagedCluster>>,
15094    >(
15095        mut self,
15096        v: T,
15097    ) -> Self {
15098        self.placement = std::option::Option::Some(
15099            crate::model::workflow_template_placement::Placement::ManagedCluster(v.into()),
15100        );
15101        self
15102    }
15103
15104    /// Sets the value of [placement][crate::model::WorkflowTemplatePlacement::placement]
15105    /// to hold a `ClusterSelector`.
15106    ///
15107    /// Note that all the setters affecting `placement` are
15108    /// mutually exclusive.
15109    pub fn set_cluster_selector<
15110        T: std::convert::Into<std::boxed::Box<crate::model::ClusterSelector>>,
15111    >(
15112        mut self,
15113        v: T,
15114    ) -> Self {
15115        self.placement = std::option::Option::Some(
15116            crate::model::workflow_template_placement::Placement::ClusterSelector(v.into()),
15117        );
15118        self
15119    }
15120}
15121
15122impl wkt::message::Message for WorkflowTemplatePlacement {
15123    fn typename() -> &'static str {
15124        "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplatePlacement"
15125    }
15126}
15127
15128/// Defines additional types related to [WorkflowTemplatePlacement].
15129pub mod workflow_template_placement {
15130    #[allow(unused_imports)]
15131    use super::*;
15132
15133    /// Required. Specifies where workflow executes; either on a managed
15134    /// cluster or an existing cluster chosen by labels.
15135    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15136    #[serde(rename_all = "camelCase")]
15137    #[non_exhaustive]
15138    pub enum Placement {
15139        /// A cluster that is managed by the workflow.
15140        ManagedCluster(std::boxed::Box<crate::model::ManagedCluster>),
15141        /// Optional. A selector that chooses target cluster for jobs based
15142        /// on metadata.
15143        ///
15144        /// The selector is evaluated at the time each job is submitted.
15145        ClusterSelector(std::boxed::Box<crate::model::ClusterSelector>),
15146    }
15147}
15148
15149/// Cluster that is managed by the workflow.
15150#[serde_with::serde_as]
15151#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15152#[serde(default, rename_all = "camelCase")]
15153#[non_exhaustive]
15154pub struct ManagedCluster {
15155    /// Required. The cluster name prefix. A unique cluster name will be formed by
15156    /// appending a random suffix.
15157    ///
15158    /// The name must contain only lower-case letters (a-z), numbers (0-9),
15159    /// and hyphens (-). Must begin with a letter. Cannot begin or end with
15160    /// hyphen. Must consist of between 2 and 35 characters.
15161    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15162    pub cluster_name: std::string::String,
15163
15164    /// Required. The cluster configuration.
15165    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15166    pub config: std::option::Option<crate::model::ClusterConfig>,
15167
15168    /// Optional. The labels to associate with this cluster.
15169    ///
15170    /// Label keys must be between 1 and 63 characters long, and must conform to
15171    /// the following PCRE regular expression:
15172    /// [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
15173    ///
15174    /// Label values must be between 1 and 63 characters long, and must conform to
15175    /// the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
15176    ///
15177    /// No more than 32 labels can be associated with a given cluster.
15178    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
15179    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15180
15181    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15182    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15183}
15184
15185impl ManagedCluster {
15186    pub fn new() -> Self {
15187        std::default::Default::default()
15188    }
15189
15190    /// Sets the value of [cluster_name][crate::model::ManagedCluster::cluster_name].
15191    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15192        self.cluster_name = v.into();
15193        self
15194    }
15195
15196    /// Sets the value of [config][crate::model::ManagedCluster::config].
15197    pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::ClusterConfig>>>(
15198        mut self,
15199        v: T,
15200    ) -> Self {
15201        self.config = v.into();
15202        self
15203    }
15204
15205    /// Sets the value of [labels][crate::model::ManagedCluster::labels].
15206    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15207    where
15208        T: std::iter::IntoIterator<Item = (K, V)>,
15209        K: std::convert::Into<std::string::String>,
15210        V: std::convert::Into<std::string::String>,
15211    {
15212        use std::iter::Iterator;
15213        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15214        self
15215    }
15216}
15217
15218impl wkt::message::Message for ManagedCluster {
15219    fn typename() -> &'static str {
15220        "type.googleapis.com/google.cloud.dataproc.v1.ManagedCluster"
15221    }
15222}
15223
15224/// A selector that chooses target cluster for jobs based on metadata.
15225#[serde_with::serde_as]
15226#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15227#[serde(default, rename_all = "camelCase")]
15228#[non_exhaustive]
15229pub struct ClusterSelector {
15230    /// Optional. The zone where workflow process executes. This parameter does not
15231    /// affect the selection of the cluster.
15232    ///
15233    /// If unspecified, the zone of the first cluster matching the selector
15234    /// is used.
15235    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15236    pub zone: std::string::String,
15237
15238    /// Required. The cluster labels. Cluster must have all labels
15239    /// to match.
15240    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
15241    pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
15242
15243    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15244    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15245}
15246
15247impl ClusterSelector {
15248    pub fn new() -> Self {
15249        std::default::Default::default()
15250    }
15251
15252    /// Sets the value of [zone][crate::model::ClusterSelector::zone].
15253    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15254        self.zone = v.into();
15255        self
15256    }
15257
15258    /// Sets the value of [cluster_labels][crate::model::ClusterSelector::cluster_labels].
15259    pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
15260    where
15261        T: std::iter::IntoIterator<Item = (K, V)>,
15262        K: std::convert::Into<std::string::String>,
15263        V: std::convert::Into<std::string::String>,
15264    {
15265        use std::iter::Iterator;
15266        self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15267        self
15268    }
15269}
15270
15271impl wkt::message::Message for ClusterSelector {
15272    fn typename() -> &'static str {
15273        "type.googleapis.com/google.cloud.dataproc.v1.ClusterSelector"
15274    }
15275}
15276
15277/// A job executed by the workflow.
15278#[serde_with::serde_as]
15279#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15280#[serde(default, rename_all = "camelCase")]
15281#[non_exhaustive]
15282pub struct OrderedJob {
15283    /// Required. The step id. The id must be unique among all jobs
15284    /// within the template.
15285    ///
15286    /// The step id is used as prefix for job id, as job
15287    /// `goog-dataproc-workflow-step-id` label, and in
15288    /// [prerequisiteStepIds][google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids]
15289    /// field from other steps.
15290    ///
15291    /// The id must contain only letters (a-z, A-Z), numbers (0-9),
15292    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
15293    /// or hyphen. Must consist of between 3 and 50 characters.
15294    ///
15295    /// [google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids]: crate::model::OrderedJob::prerequisite_step_ids
15296    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15297    pub step_id: std::string::String,
15298
15299    /// Optional. The labels to associate with this job.
15300    ///
15301    /// Label keys must be between 1 and 63 characters long, and must conform to
15302    /// the following regular expression:
15303    /// [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
15304    ///
15305    /// Label values must be between 1 and 63 characters long, and must conform to
15306    /// the following regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
15307    ///
15308    /// No more than 32 labels can be associated with a given job.
15309    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
15310    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15311
15312    /// Optional. Job scheduling configuration.
15313    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15314    pub scheduling: std::option::Option<crate::model::JobScheduling>,
15315
15316    /// Optional. The optional list of prerequisite job step_ids.
15317    /// If not specified, the job will start at the beginning of workflow.
15318    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15319    pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
15320
15321    /// Required. The job definition.
15322    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15323    pub job_type: std::option::Option<crate::model::ordered_job::JobType>,
15324
15325    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15326    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15327}
15328
15329impl OrderedJob {
15330    pub fn new() -> Self {
15331        std::default::Default::default()
15332    }
15333
15334    /// Sets the value of [step_id][crate::model::OrderedJob::step_id].
15335    pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15336        self.step_id = v.into();
15337        self
15338    }
15339
15340    /// Sets the value of [scheduling][crate::model::OrderedJob::scheduling].
15341    pub fn set_scheduling<
15342        T: std::convert::Into<std::option::Option<crate::model::JobScheduling>>,
15343    >(
15344        mut self,
15345        v: T,
15346    ) -> Self {
15347        self.scheduling = v.into();
15348        self
15349    }
15350
15351    /// Sets the value of [prerequisite_step_ids][crate::model::OrderedJob::prerequisite_step_ids].
15352    pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
15353    where
15354        T: std::iter::IntoIterator<Item = V>,
15355        V: std::convert::Into<std::string::String>,
15356    {
15357        use std::iter::Iterator;
15358        self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
15359        self
15360    }
15361
15362    /// Sets the value of [labels][crate::model::OrderedJob::labels].
15363    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15364    where
15365        T: std::iter::IntoIterator<Item = (K, V)>,
15366        K: std::convert::Into<std::string::String>,
15367        V: std::convert::Into<std::string::String>,
15368    {
15369        use std::iter::Iterator;
15370        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15371        self
15372    }
15373
15374    /// Sets the value of [job_type][crate::model::OrderedJob::job_type].
15375    ///
15376    /// Note that all the setters affecting `job_type` are mutually
15377    /// exclusive.
15378    pub fn set_job_type<
15379        T: std::convert::Into<std::option::Option<crate::model::ordered_job::JobType>>,
15380    >(
15381        mut self,
15382        v: T,
15383    ) -> Self {
15384        self.job_type = v.into();
15385        self
15386    }
15387
15388    /// The value of [job_type][crate::model::OrderedJob::job_type]
15389    /// if it holds a `HadoopJob`, `None` if the field is not set or
15390    /// holds a different branch.
15391    pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
15392        #[allow(unreachable_patterns)]
15393        self.job_type.as_ref().and_then(|v| match v {
15394            crate::model::ordered_job::JobType::HadoopJob(v) => std::option::Option::Some(v),
15395            _ => std::option::Option::None,
15396        })
15397    }
15398
15399    /// The value of [job_type][crate::model::OrderedJob::job_type]
15400    /// if it holds a `SparkJob`, `None` if the field is not set or
15401    /// holds a different branch.
15402    pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
15403        #[allow(unreachable_patterns)]
15404        self.job_type.as_ref().and_then(|v| match v {
15405            crate::model::ordered_job::JobType::SparkJob(v) => std::option::Option::Some(v),
15406            _ => std::option::Option::None,
15407        })
15408    }
15409
15410    /// The value of [job_type][crate::model::OrderedJob::job_type]
15411    /// if it holds a `PysparkJob`, `None` if the field is not set or
15412    /// holds a different branch.
15413    pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
15414        #[allow(unreachable_patterns)]
15415        self.job_type.as_ref().and_then(|v| match v {
15416            crate::model::ordered_job::JobType::PysparkJob(v) => std::option::Option::Some(v),
15417            _ => std::option::Option::None,
15418        })
15419    }
15420
15421    /// The value of [job_type][crate::model::OrderedJob::job_type]
15422    /// if it holds a `HiveJob`, `None` if the field is not set or
15423    /// holds a different branch.
15424    pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
15425        #[allow(unreachable_patterns)]
15426        self.job_type.as_ref().and_then(|v| match v {
15427            crate::model::ordered_job::JobType::HiveJob(v) => std::option::Option::Some(v),
15428            _ => std::option::Option::None,
15429        })
15430    }
15431
15432    /// The value of [job_type][crate::model::OrderedJob::job_type]
15433    /// if it holds a `PigJob`, `None` if the field is not set or
15434    /// holds a different branch.
15435    pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
15436        #[allow(unreachable_patterns)]
15437        self.job_type.as_ref().and_then(|v| match v {
15438            crate::model::ordered_job::JobType::PigJob(v) => std::option::Option::Some(v),
15439            _ => std::option::Option::None,
15440        })
15441    }
15442
15443    /// The value of [job_type][crate::model::OrderedJob::job_type]
15444    /// if it holds a `SparkRJob`, `None` if the field is not set or
15445    /// holds a different branch.
15446    pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
15447        #[allow(unreachable_patterns)]
15448        self.job_type.as_ref().and_then(|v| match v {
15449            crate::model::ordered_job::JobType::SparkRJob(v) => std::option::Option::Some(v),
15450            _ => std::option::Option::None,
15451        })
15452    }
15453
15454    /// The value of [job_type][crate::model::OrderedJob::job_type]
15455    /// if it holds a `SparkSqlJob`, `None` if the field is not set or
15456    /// holds a different branch.
15457    pub fn spark_sql_job(
15458        &self,
15459    ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
15460        #[allow(unreachable_patterns)]
15461        self.job_type.as_ref().and_then(|v| match v {
15462            crate::model::ordered_job::JobType::SparkSqlJob(v) => std::option::Option::Some(v),
15463            _ => std::option::Option::None,
15464        })
15465    }
15466
15467    /// The value of [job_type][crate::model::OrderedJob::job_type]
15468    /// if it holds a `PrestoJob`, `None` if the field is not set or
15469    /// holds a different branch.
15470    pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
15471        #[allow(unreachable_patterns)]
15472        self.job_type.as_ref().and_then(|v| match v {
15473            crate::model::ordered_job::JobType::PrestoJob(v) => std::option::Option::Some(v),
15474            _ => std::option::Option::None,
15475        })
15476    }
15477
15478    /// The value of [job_type][crate::model::OrderedJob::job_type]
15479    /// if it holds a `TrinoJob`, `None` if the field is not set or
15480    /// holds a different branch.
15481    pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
15482        #[allow(unreachable_patterns)]
15483        self.job_type.as_ref().and_then(|v| match v {
15484            crate::model::ordered_job::JobType::TrinoJob(v) => std::option::Option::Some(v),
15485            _ => std::option::Option::None,
15486        })
15487    }
15488
15489    /// The value of [job_type][crate::model::OrderedJob::job_type]
15490    /// if it holds a `FlinkJob`, `None` if the field is not set or
15491    /// holds a different branch.
15492    pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
15493        #[allow(unreachable_patterns)]
15494        self.job_type.as_ref().and_then(|v| match v {
15495            crate::model::ordered_job::JobType::FlinkJob(v) => std::option::Option::Some(v),
15496            _ => std::option::Option::None,
15497        })
15498    }
15499
15500    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15501    /// to hold a `HadoopJob`.
15502    ///
15503    /// Note that all the setters affecting `job_type` are
15504    /// mutually exclusive.
15505    pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
15506        mut self,
15507        v: T,
15508    ) -> Self {
15509        self.job_type =
15510            std::option::Option::Some(crate::model::ordered_job::JobType::HadoopJob(v.into()));
15511        self
15512    }
15513
15514    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15515    /// to hold a `SparkJob`.
15516    ///
15517    /// Note that all the setters affecting `job_type` are
15518    /// mutually exclusive.
15519    pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
15520        mut self,
15521        v: T,
15522    ) -> Self {
15523        self.job_type =
15524            std::option::Option::Some(crate::model::ordered_job::JobType::SparkJob(v.into()));
15525        self
15526    }
15527
15528    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15529    /// to hold a `PysparkJob`.
15530    ///
15531    /// Note that all the setters affecting `job_type` are
15532    /// mutually exclusive.
15533    pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
15534        mut self,
15535        v: T,
15536    ) -> Self {
15537        self.job_type =
15538            std::option::Option::Some(crate::model::ordered_job::JobType::PysparkJob(v.into()));
15539        self
15540    }
15541
15542    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15543    /// to hold a `HiveJob`.
15544    ///
15545    /// Note that all the setters affecting `job_type` are
15546    /// mutually exclusive.
15547    pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
15548        mut self,
15549        v: T,
15550    ) -> Self {
15551        self.job_type =
15552            std::option::Option::Some(crate::model::ordered_job::JobType::HiveJob(v.into()));
15553        self
15554    }
15555
15556    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15557    /// to hold a `PigJob`.
15558    ///
15559    /// Note that all the setters affecting `job_type` are
15560    /// mutually exclusive.
15561    pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
15562        mut self,
15563        v: T,
15564    ) -> Self {
15565        self.job_type =
15566            std::option::Option::Some(crate::model::ordered_job::JobType::PigJob(v.into()));
15567        self
15568    }
15569
15570    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15571    /// to hold a `SparkRJob`.
15572    ///
15573    /// Note that all the setters affecting `job_type` are
15574    /// mutually exclusive.
15575    pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
15576        mut self,
15577        v: T,
15578    ) -> Self {
15579        self.job_type =
15580            std::option::Option::Some(crate::model::ordered_job::JobType::SparkRJob(v.into()));
15581        self
15582    }
15583
15584    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15585    /// to hold a `SparkSqlJob`.
15586    ///
15587    /// Note that all the setters affecting `job_type` are
15588    /// mutually exclusive.
15589    pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
15590        mut self,
15591        v: T,
15592    ) -> Self {
15593        self.job_type =
15594            std::option::Option::Some(crate::model::ordered_job::JobType::SparkSqlJob(v.into()));
15595        self
15596    }
15597
15598    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15599    /// to hold a `PrestoJob`.
15600    ///
15601    /// Note that all the setters affecting `job_type` are
15602    /// mutually exclusive.
15603    pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
15604        mut self,
15605        v: T,
15606    ) -> Self {
15607        self.job_type =
15608            std::option::Option::Some(crate::model::ordered_job::JobType::PrestoJob(v.into()));
15609        self
15610    }
15611
15612    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15613    /// to hold a `TrinoJob`.
15614    ///
15615    /// Note that all the setters affecting `job_type` are
15616    /// mutually exclusive.
15617    pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
15618        mut self,
15619        v: T,
15620    ) -> Self {
15621        self.job_type =
15622            std::option::Option::Some(crate::model::ordered_job::JobType::TrinoJob(v.into()));
15623        self
15624    }
15625
15626    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
15627    /// to hold a `FlinkJob`.
15628    ///
15629    /// Note that all the setters affecting `job_type` are
15630    /// mutually exclusive.
15631    pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
15632        mut self,
15633        v: T,
15634    ) -> Self {
15635        self.job_type =
15636            std::option::Option::Some(crate::model::ordered_job::JobType::FlinkJob(v.into()));
15637        self
15638    }
15639}
15640
15641impl wkt::message::Message for OrderedJob {
15642    fn typename() -> &'static str {
15643        "type.googleapis.com/google.cloud.dataproc.v1.OrderedJob"
15644    }
15645}
15646
15647/// Defines additional types related to [OrderedJob].
15648pub mod ordered_job {
15649    #[allow(unused_imports)]
15650    use super::*;
15651
15652    /// Required. The job definition.
15653    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15654    #[serde(rename_all = "camelCase")]
15655    #[non_exhaustive]
15656    pub enum JobType {
15657        /// Optional. Job is a Hadoop job.
15658        HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
15659        /// Optional. Job is a Spark job.
15660        SparkJob(std::boxed::Box<crate::model::SparkJob>),
15661        /// Optional. Job is a PySpark job.
15662        PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
15663        /// Optional. Job is a Hive job.
15664        HiveJob(std::boxed::Box<crate::model::HiveJob>),
15665        /// Optional. Job is a Pig job.
15666        PigJob(std::boxed::Box<crate::model::PigJob>),
15667        /// Optional. Job is a SparkR job.
15668        SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
15669        /// Optional. Job is a SparkSql job.
15670        SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
15671        /// Optional. Job is a Presto job.
15672        PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
15673        /// Optional. Job is a Trino job.
15674        TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
15675        /// Optional. Job is a Flink job.
15676        FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
15677    }
15678}
15679
15680/// A configurable parameter that replaces one or more fields in the template.
15681/// Parameterizable fields:
15682///
15683/// - Labels
15684/// - File uris
15685/// - Job properties
15686/// - Job arguments
15687/// - Script variables
15688/// - Main class (in HadoopJob and SparkJob)
15689/// - Zone (in ClusterSelector)
15690#[serde_with::serde_as]
15691#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15692#[serde(default, rename_all = "camelCase")]
15693#[non_exhaustive]
15694pub struct TemplateParameter {
15695    /// Required. Parameter name.
15696    /// The parameter name is used as the key, and paired with the
15697    /// parameter value, which are passed to the template when the template
15698    /// is instantiated.
15699    /// The name must contain only capital letters (A-Z), numbers (0-9), and
15700    /// underscores (_), and must not start with a number. The maximum length is
15701    /// 40 characters.
15702    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15703    pub name: std::string::String,
15704
15705    /// Required. Paths to all fields that the parameter replaces.
15706    /// A field is allowed to appear in at most one parameter's list of field
15707    /// paths.
15708    ///
15709    /// A field path is similar in syntax to a
15710    /// [google.protobuf.FieldMask][google.protobuf.FieldMask]. For example, a
15711    /// field path that references the zone field of a workflow template's cluster
15712    /// selector would be specified as `placement.clusterSelector.zone`.
15713    ///
15714    /// Also, field paths can reference fields using the following syntax:
15715    ///
15716    /// * Values in maps can be referenced by key:
15717    ///
15718    ///   * labels['key']
15719    ///   * placement.clusterSelector.clusterLabels['key']
15720    ///   * placement.managedCluster.labels['key']
15721    ///   * placement.clusterSelector.clusterLabels['key']
15722    ///   * jobs['step-id'].labels['key']
15723    /// * Jobs in the jobs list can be referenced by step-id:
15724    ///
15725    ///   * jobs['step-id'].hadoopJob.mainJarFileUri
15726    ///   * jobs['step-id'].hiveJob.queryFileUri
15727    ///   * jobs['step-id'].pySparkJob.mainPythonFileUri
15728    ///   * jobs['step-id'].hadoopJob.jarFileUris[0]
15729    ///   * jobs['step-id'].hadoopJob.archiveUris[0]
15730    ///   * jobs['step-id'].hadoopJob.fileUris[0]
15731    ///   * jobs['step-id'].pySparkJob.pythonFileUris[0]
15732    /// * Items in repeated fields can be referenced by a zero-based index:
15733    ///
15734    ///   * jobs['step-id'].sparkJob.args[0]
15735    /// * Other examples:
15736    ///
15737    ///   * jobs['step-id'].hadoopJob.properties['key']
15738    ///   * jobs['step-id'].hadoopJob.args[0]
15739    ///   * jobs['step-id'].hiveJob.scriptVariables['key']
15740    ///   * jobs['step-id'].hadoopJob.mainJarFileUri
15741    ///   * placement.clusterSelector.zone
15742    ///
15743    /// It may not be possible to parameterize maps and repeated fields in their
15744    /// entirety since only individual map values and individual items in repeated
15745    /// fields can be referenced. For example, the following field paths are
15746    /// invalid:
15747    ///
15748    /// - placement.clusterSelector.clusterLabels
15749    /// - jobs['step-id'].sparkJob.args
15750    ///
15751    /// [google.protobuf.FieldMask]: wkt::FieldMask
15752    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15753    pub fields: std::vec::Vec<std::string::String>,
15754
15755    /// Optional. Brief description of the parameter.
15756    /// Must not exceed 1024 characters.
15757    #[serde(skip_serializing_if = "std::string::String::is_empty")]
15758    pub description: std::string::String,
15759
15760    /// Optional. Validation rules to be applied to this parameter's value.
15761    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15762    pub validation: std::option::Option<crate::model::ParameterValidation>,
15763
15764    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15765    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15766}
15767
15768impl TemplateParameter {
15769    pub fn new() -> Self {
15770        std::default::Default::default()
15771    }
15772
15773    /// Sets the value of [name][crate::model::TemplateParameter::name].
15774    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15775        self.name = v.into();
15776        self
15777    }
15778
15779    /// Sets the value of [description][crate::model::TemplateParameter::description].
15780    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15781        self.description = v.into();
15782        self
15783    }
15784
15785    /// Sets the value of [validation][crate::model::TemplateParameter::validation].
15786    pub fn set_validation<
15787        T: std::convert::Into<std::option::Option<crate::model::ParameterValidation>>,
15788    >(
15789        mut self,
15790        v: T,
15791    ) -> Self {
15792        self.validation = v.into();
15793        self
15794    }
15795
15796    /// Sets the value of [fields][crate::model::TemplateParameter::fields].
15797    pub fn set_fields<T, V>(mut self, v: T) -> Self
15798    where
15799        T: std::iter::IntoIterator<Item = V>,
15800        V: std::convert::Into<std::string::String>,
15801    {
15802        use std::iter::Iterator;
15803        self.fields = v.into_iter().map(|i| i.into()).collect();
15804        self
15805    }
15806}
15807
15808impl wkt::message::Message for TemplateParameter {
15809    fn typename() -> &'static str {
15810        "type.googleapis.com/google.cloud.dataproc.v1.TemplateParameter"
15811    }
15812}
15813
15814/// Configuration for parameter validation.
15815#[serde_with::serde_as]
15816#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15817#[serde(default, rename_all = "camelCase")]
15818#[non_exhaustive]
15819pub struct ParameterValidation {
15820    /// Required. The type of validation to be performed.
15821    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15822    pub validation_type: std::option::Option<crate::model::parameter_validation::ValidationType>,
15823
15824    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15825    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15826}
15827
15828impl ParameterValidation {
15829    pub fn new() -> Self {
15830        std::default::Default::default()
15831    }
15832
15833    /// Sets the value of [validation_type][crate::model::ParameterValidation::validation_type].
15834    ///
15835    /// Note that all the setters affecting `validation_type` are mutually
15836    /// exclusive.
15837    pub fn set_validation_type<
15838        T: std::convert::Into<std::option::Option<crate::model::parameter_validation::ValidationType>>,
15839    >(
15840        mut self,
15841        v: T,
15842    ) -> Self {
15843        self.validation_type = v.into();
15844        self
15845    }
15846
15847    /// The value of [validation_type][crate::model::ParameterValidation::validation_type]
15848    /// if it holds a `Regex`, `None` if the field is not set or
15849    /// holds a different branch.
15850    pub fn regex(&self) -> std::option::Option<&std::boxed::Box<crate::model::RegexValidation>> {
15851        #[allow(unreachable_patterns)]
15852        self.validation_type.as_ref().and_then(|v| match v {
15853            crate::model::parameter_validation::ValidationType::Regex(v) => {
15854                std::option::Option::Some(v)
15855            }
15856            _ => std::option::Option::None,
15857        })
15858    }
15859
15860    /// The value of [validation_type][crate::model::ParameterValidation::validation_type]
15861    /// if it holds a `Values`, `None` if the field is not set or
15862    /// holds a different branch.
15863    pub fn values(&self) -> std::option::Option<&std::boxed::Box<crate::model::ValueValidation>> {
15864        #[allow(unreachable_patterns)]
15865        self.validation_type.as_ref().and_then(|v| match v {
15866            crate::model::parameter_validation::ValidationType::Values(v) => {
15867                std::option::Option::Some(v)
15868            }
15869            _ => std::option::Option::None,
15870        })
15871    }
15872
15873    /// Sets the value of [validation_type][crate::model::ParameterValidation::validation_type]
15874    /// to hold a `Regex`.
15875    ///
15876    /// Note that all the setters affecting `validation_type` are
15877    /// mutually exclusive.
15878    pub fn set_regex<T: std::convert::Into<std::boxed::Box<crate::model::RegexValidation>>>(
15879        mut self,
15880        v: T,
15881    ) -> Self {
15882        self.validation_type = std::option::Option::Some(
15883            crate::model::parameter_validation::ValidationType::Regex(v.into()),
15884        );
15885        self
15886    }
15887
15888    /// Sets the value of [validation_type][crate::model::ParameterValidation::validation_type]
15889    /// to hold a `Values`.
15890    ///
15891    /// Note that all the setters affecting `validation_type` are
15892    /// mutually exclusive.
15893    pub fn set_values<T: std::convert::Into<std::boxed::Box<crate::model::ValueValidation>>>(
15894        mut self,
15895        v: T,
15896    ) -> Self {
15897        self.validation_type = std::option::Option::Some(
15898            crate::model::parameter_validation::ValidationType::Values(v.into()),
15899        );
15900        self
15901    }
15902}
15903
15904impl wkt::message::Message for ParameterValidation {
15905    fn typename() -> &'static str {
15906        "type.googleapis.com/google.cloud.dataproc.v1.ParameterValidation"
15907    }
15908}
15909
15910/// Defines additional types related to [ParameterValidation].
15911pub mod parameter_validation {
15912    #[allow(unused_imports)]
15913    use super::*;
15914
15915    /// Required. The type of validation to be performed.
15916    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15917    #[serde(rename_all = "camelCase")]
15918    #[non_exhaustive]
15919    pub enum ValidationType {
15920        /// Validation based on regular expressions.
15921        Regex(std::boxed::Box<crate::model::RegexValidation>),
15922        /// Validation based on a list of allowed values.
15923        Values(std::boxed::Box<crate::model::ValueValidation>),
15924    }
15925}
15926
15927/// Validation based on regular expressions.
15928#[serde_with::serde_as]
15929#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15930#[serde(default, rename_all = "camelCase")]
15931#[non_exhaustive]
15932pub struct RegexValidation {
15933    /// Required. RE2 regular expressions used to validate the parameter's value.
15934    /// The value must match the regex in its entirety (substring
15935    /// matches are not sufficient).
15936    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15937    pub regexes: std::vec::Vec<std::string::String>,
15938
15939    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15940    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15941}
15942
15943impl RegexValidation {
15944    pub fn new() -> Self {
15945        std::default::Default::default()
15946    }
15947
15948    /// Sets the value of [regexes][crate::model::RegexValidation::regexes].
15949    pub fn set_regexes<T, V>(mut self, v: T) -> Self
15950    where
15951        T: std::iter::IntoIterator<Item = V>,
15952        V: std::convert::Into<std::string::String>,
15953    {
15954        use std::iter::Iterator;
15955        self.regexes = v.into_iter().map(|i| i.into()).collect();
15956        self
15957    }
15958}
15959
15960impl wkt::message::Message for RegexValidation {
15961    fn typename() -> &'static str {
15962        "type.googleapis.com/google.cloud.dataproc.v1.RegexValidation"
15963    }
15964}
15965
15966/// Validation based on a list of allowed values.
15967#[serde_with::serde_as]
15968#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15969#[serde(default, rename_all = "camelCase")]
15970#[non_exhaustive]
15971pub struct ValueValidation {
15972    /// Required. List of allowed values for the parameter.
15973    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15974    pub values: std::vec::Vec<std::string::String>,
15975
15976    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15977    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15978}
15979
15980impl ValueValidation {
15981    pub fn new() -> Self {
15982        std::default::Default::default()
15983    }
15984
15985    /// Sets the value of [values][crate::model::ValueValidation::values].
15986    pub fn set_values<T, V>(mut self, v: T) -> Self
15987    where
15988        T: std::iter::IntoIterator<Item = V>,
15989        V: std::convert::Into<std::string::String>,
15990    {
15991        use std::iter::Iterator;
15992        self.values = v.into_iter().map(|i| i.into()).collect();
15993        self
15994    }
15995}
15996
15997impl wkt::message::Message for ValueValidation {
15998    fn typename() -> &'static str {
15999        "type.googleapis.com/google.cloud.dataproc.v1.ValueValidation"
16000    }
16001}
16002
16003/// A Dataproc workflow template resource.
16004#[serde_with::serde_as]
16005#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16006#[serde(default, rename_all = "camelCase")]
16007#[non_exhaustive]
16008pub struct WorkflowMetadata {
16009    /// Output only. The resource name of the workflow template as described
16010    /// in <https://cloud.google.com/apis/design/resource_names>.
16011    ///
16012    /// * For `projects.regions.workflowTemplates`, the resource name of the
16013    ///   template has the following format:
16014    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
16015    ///
16016    /// * For `projects.locations.workflowTemplates`, the resource name of the
16017    ///   template has the following format:
16018    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
16019    ///
16020    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16021    pub template: std::string::String,
16022
16023    /// Output only. The version of template at the time of
16024    /// workflow instantiation.
16025    pub version: i32,
16026
16027    /// Output only. The create cluster operation metadata.
16028    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16029    pub create_cluster: std::option::Option<crate::model::ClusterOperation>,
16030
16031    /// Output only. The workflow graph.
16032    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16033    pub graph: std::option::Option<crate::model::WorkflowGraph>,
16034
16035    /// Output only. The delete cluster operation metadata.
16036    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16037    pub delete_cluster: std::option::Option<crate::model::ClusterOperation>,
16038
16039    /// Output only. The workflow state.
16040    pub state: crate::model::workflow_metadata::State,
16041
16042    /// Output only. The name of the target cluster.
16043    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16044    pub cluster_name: std::string::String,
16045
16046    /// Map from parameter names to values that were used for those parameters.
16047    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
16048    pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
16049
16050    /// Output only. Workflow start time.
16051    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16052    pub start_time: std::option::Option<wkt::Timestamp>,
16053
16054    /// Output only. Workflow end time.
16055    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16056    pub end_time: std::option::Option<wkt::Timestamp>,
16057
16058    /// Output only. The UUID of target cluster.
16059    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16060    pub cluster_uuid: std::string::String,
16061
16062    /// Output only. The timeout duration for the DAG of jobs, expressed in seconds
16063    /// (see [JSON representation of
16064    /// duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
16065    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16066    pub dag_timeout: std::option::Option<wkt::Duration>,
16067
16068    /// Output only. DAG start time, only set for workflows with
16069    /// [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when
16070    /// DAG begins.
16071    ///
16072    /// [google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout]: crate::model::WorkflowMetadata::dag_timeout
16073    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16074    pub dag_start_time: std::option::Option<wkt::Timestamp>,
16075
16076    /// Output only. DAG end time, only set for workflows with
16077    /// [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when
16078    /// DAG ends.
16079    ///
16080    /// [google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout]: crate::model::WorkflowMetadata::dag_timeout
16081    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16082    pub dag_end_time: std::option::Option<wkt::Timestamp>,
16083
16084    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16085    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16086}
16087
16088impl WorkflowMetadata {
16089    pub fn new() -> Self {
16090        std::default::Default::default()
16091    }
16092
16093    /// Sets the value of [template][crate::model::WorkflowMetadata::template].
16094    pub fn set_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16095        self.template = v.into();
16096        self
16097    }
16098
16099    /// Sets the value of [version][crate::model::WorkflowMetadata::version].
16100    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16101        self.version = v.into();
16102        self
16103    }
16104
16105    /// Sets the value of [create_cluster][crate::model::WorkflowMetadata::create_cluster].
16106    pub fn set_create_cluster<
16107        T: std::convert::Into<std::option::Option<crate::model::ClusterOperation>>,
16108    >(
16109        mut self,
16110        v: T,
16111    ) -> Self {
16112        self.create_cluster = v.into();
16113        self
16114    }
16115
16116    /// Sets the value of [graph][crate::model::WorkflowMetadata::graph].
16117    pub fn set_graph<T: std::convert::Into<std::option::Option<crate::model::WorkflowGraph>>>(
16118        mut self,
16119        v: T,
16120    ) -> Self {
16121        self.graph = v.into();
16122        self
16123    }
16124
16125    /// Sets the value of [delete_cluster][crate::model::WorkflowMetadata::delete_cluster].
16126    pub fn set_delete_cluster<
16127        T: std::convert::Into<std::option::Option<crate::model::ClusterOperation>>,
16128    >(
16129        mut self,
16130        v: T,
16131    ) -> Self {
16132        self.delete_cluster = v.into();
16133        self
16134    }
16135
16136    /// Sets the value of [state][crate::model::WorkflowMetadata::state].
16137    pub fn set_state<T: std::convert::Into<crate::model::workflow_metadata::State>>(
16138        mut self,
16139        v: T,
16140    ) -> Self {
16141        self.state = v.into();
16142        self
16143    }
16144
16145    /// Sets the value of [cluster_name][crate::model::WorkflowMetadata::cluster_name].
16146    pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16147        self.cluster_name = v.into();
16148        self
16149    }
16150
16151    /// Sets the value of [start_time][crate::model::WorkflowMetadata::start_time].
16152    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16153        mut self,
16154        v: T,
16155    ) -> Self {
16156        self.start_time = v.into();
16157        self
16158    }
16159
16160    /// Sets the value of [end_time][crate::model::WorkflowMetadata::end_time].
16161    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16162        mut self,
16163        v: T,
16164    ) -> Self {
16165        self.end_time = v.into();
16166        self
16167    }
16168
16169    /// Sets the value of [cluster_uuid][crate::model::WorkflowMetadata::cluster_uuid].
16170    pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16171        self.cluster_uuid = v.into();
16172        self
16173    }
16174
16175    /// Sets the value of [dag_timeout][crate::model::WorkflowMetadata::dag_timeout].
16176    pub fn set_dag_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
16177        mut self,
16178        v: T,
16179    ) -> Self {
16180        self.dag_timeout = v.into();
16181        self
16182    }
16183
16184    /// Sets the value of [dag_start_time][crate::model::WorkflowMetadata::dag_start_time].
16185    pub fn set_dag_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16186        mut self,
16187        v: T,
16188    ) -> Self {
16189        self.dag_start_time = v.into();
16190        self
16191    }
16192
16193    /// Sets the value of [dag_end_time][crate::model::WorkflowMetadata::dag_end_time].
16194    pub fn set_dag_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16195        mut self,
16196        v: T,
16197    ) -> Self {
16198        self.dag_end_time = v.into();
16199        self
16200    }
16201
16202    /// Sets the value of [parameters][crate::model::WorkflowMetadata::parameters].
16203    pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
16204    where
16205        T: std::iter::IntoIterator<Item = (K, V)>,
16206        K: std::convert::Into<std::string::String>,
16207        V: std::convert::Into<std::string::String>,
16208    {
16209        use std::iter::Iterator;
16210        self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16211        self
16212    }
16213}
16214
16215impl wkt::message::Message for WorkflowMetadata {
16216    fn typename() -> &'static str {
16217        "type.googleapis.com/google.cloud.dataproc.v1.WorkflowMetadata"
16218    }
16219}
16220
16221/// Defines additional types related to [WorkflowMetadata].
16222pub mod workflow_metadata {
16223    #[allow(unused_imports)]
16224    use super::*;
16225
16226    /// The operation state.
16227    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
16228    pub struct State(i32);
16229
16230    impl State {
16231        /// Unused.
16232        pub const UNKNOWN: State = State::new(0);
16233
16234        /// The operation has been created.
16235        pub const PENDING: State = State::new(1);
16236
16237        /// The operation is running.
16238        pub const RUNNING: State = State::new(2);
16239
16240        /// The operation is done; either cancelled or completed.
16241        pub const DONE: State = State::new(3);
16242
16243        /// Creates a new State instance.
16244        pub(crate) const fn new(value: i32) -> Self {
16245            Self(value)
16246        }
16247
16248        /// Gets the enum value.
16249        pub fn value(&self) -> i32 {
16250            self.0
16251        }
16252
16253        /// Gets the enum value as a string.
16254        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
16255            match self.0 {
16256                0 => std::borrow::Cow::Borrowed("UNKNOWN"),
16257                1 => std::borrow::Cow::Borrowed("PENDING"),
16258                2 => std::borrow::Cow::Borrowed("RUNNING"),
16259                3 => std::borrow::Cow::Borrowed("DONE"),
16260                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
16261            }
16262        }
16263
16264        /// Creates an enum value from the value name.
16265        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
16266            match name {
16267                "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
16268                "PENDING" => std::option::Option::Some(Self::PENDING),
16269                "RUNNING" => std::option::Option::Some(Self::RUNNING),
16270                "DONE" => std::option::Option::Some(Self::DONE),
16271                _ => std::option::Option::None,
16272            }
16273        }
16274    }
16275
16276    impl std::convert::From<i32> for State {
16277        fn from(value: i32) -> Self {
16278            Self::new(value)
16279        }
16280    }
16281
16282    impl std::default::Default for State {
16283        fn default() -> Self {
16284            Self::new(0)
16285        }
16286    }
16287}
16288
16289/// The cluster operation triggered by a workflow.
16290#[serde_with::serde_as]
16291#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16292#[serde(default, rename_all = "camelCase")]
16293#[non_exhaustive]
16294pub struct ClusterOperation {
16295    /// Output only. The id of the cluster operation.
16296    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16297    pub operation_id: std::string::String,
16298
16299    /// Output only. Error, if operation failed.
16300    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16301    pub error: std::string::String,
16302
16303    /// Output only. Indicates the operation is done.
16304    pub done: bool,
16305
16306    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16307    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16308}
16309
16310impl ClusterOperation {
16311    pub fn new() -> Self {
16312        std::default::Default::default()
16313    }
16314
16315    /// Sets the value of [operation_id][crate::model::ClusterOperation::operation_id].
16316    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16317        self.operation_id = v.into();
16318        self
16319    }
16320
16321    /// Sets the value of [error][crate::model::ClusterOperation::error].
16322    pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16323        self.error = v.into();
16324        self
16325    }
16326
16327    /// Sets the value of [done][crate::model::ClusterOperation::done].
16328    pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16329        self.done = v.into();
16330        self
16331    }
16332}
16333
16334impl wkt::message::Message for ClusterOperation {
16335    fn typename() -> &'static str {
16336        "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperation"
16337    }
16338}
16339
16340/// The workflow graph.
16341#[serde_with::serde_as]
16342#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16343#[serde(default, rename_all = "camelCase")]
16344#[non_exhaustive]
16345pub struct WorkflowGraph {
16346    /// Output only. The workflow nodes.
16347    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16348    pub nodes: std::vec::Vec<crate::model::WorkflowNode>,
16349
16350    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16351    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16352}
16353
16354impl WorkflowGraph {
16355    pub fn new() -> Self {
16356        std::default::Default::default()
16357    }
16358
16359    /// Sets the value of [nodes][crate::model::WorkflowGraph::nodes].
16360    pub fn set_nodes<T, V>(mut self, v: T) -> Self
16361    where
16362        T: std::iter::IntoIterator<Item = V>,
16363        V: std::convert::Into<crate::model::WorkflowNode>,
16364    {
16365        use std::iter::Iterator;
16366        self.nodes = v.into_iter().map(|i| i.into()).collect();
16367        self
16368    }
16369}
16370
16371impl wkt::message::Message for WorkflowGraph {
16372    fn typename() -> &'static str {
16373        "type.googleapis.com/google.cloud.dataproc.v1.WorkflowGraph"
16374    }
16375}
16376
16377/// The workflow node.
16378#[serde_with::serde_as]
16379#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16380#[serde(default, rename_all = "camelCase")]
16381#[non_exhaustive]
16382pub struct WorkflowNode {
16383    /// Output only. The name of the node.
16384    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16385    pub step_id: std::string::String,
16386
16387    /// Output only. Node's prerequisite nodes.
16388    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16389    pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
16390
16391    /// Output only. The job id; populated after the node enters RUNNING state.
16392    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16393    pub job_id: std::string::String,
16394
16395    /// Output only. The node state.
16396    pub state: crate::model::workflow_node::NodeState,
16397
16398    /// Output only. The error detail.
16399    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16400    pub error: std::string::String,
16401
16402    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16403    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16404}
16405
16406impl WorkflowNode {
16407    pub fn new() -> Self {
16408        std::default::Default::default()
16409    }
16410
16411    /// Sets the value of [step_id][crate::model::WorkflowNode::step_id].
16412    pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16413        self.step_id = v.into();
16414        self
16415    }
16416
16417    /// Sets the value of [job_id][crate::model::WorkflowNode::job_id].
16418    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16419        self.job_id = v.into();
16420        self
16421    }
16422
16423    /// Sets the value of [state][crate::model::WorkflowNode::state].
16424    pub fn set_state<T: std::convert::Into<crate::model::workflow_node::NodeState>>(
16425        mut self,
16426        v: T,
16427    ) -> Self {
16428        self.state = v.into();
16429        self
16430    }
16431
16432    /// Sets the value of [error][crate::model::WorkflowNode::error].
16433    pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16434        self.error = v.into();
16435        self
16436    }
16437
16438    /// Sets the value of [prerequisite_step_ids][crate::model::WorkflowNode::prerequisite_step_ids].
16439    pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
16440    where
16441        T: std::iter::IntoIterator<Item = V>,
16442        V: std::convert::Into<std::string::String>,
16443    {
16444        use std::iter::Iterator;
16445        self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
16446        self
16447    }
16448}
16449
16450impl wkt::message::Message for WorkflowNode {
16451    fn typename() -> &'static str {
16452        "type.googleapis.com/google.cloud.dataproc.v1.WorkflowNode"
16453    }
16454}
16455
16456/// Defines additional types related to [WorkflowNode].
16457pub mod workflow_node {
16458    #[allow(unused_imports)]
16459    use super::*;
16460
16461    /// The workflow node state.
16462    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
16463    pub struct NodeState(i32);
16464
16465    impl NodeState {
16466        /// State is unspecified.
16467        pub const NODE_STATE_UNSPECIFIED: NodeState = NodeState::new(0);
16468
16469        /// The node is awaiting prerequisite node to finish.
16470        pub const BLOCKED: NodeState = NodeState::new(1);
16471
16472        /// The node is runnable but not running.
16473        pub const RUNNABLE: NodeState = NodeState::new(2);
16474
16475        /// The node is running.
16476        pub const RUNNING: NodeState = NodeState::new(3);
16477
16478        /// The node completed successfully.
16479        pub const COMPLETED: NodeState = NodeState::new(4);
16480
16481        /// The node failed. A node can be marked FAILED because
16482        /// its ancestor or peer failed.
16483        pub const FAILED: NodeState = NodeState::new(5);
16484
16485        /// Creates a new NodeState instance.
16486        pub(crate) const fn new(value: i32) -> Self {
16487            Self(value)
16488        }
16489
16490        /// Gets the enum value.
16491        pub fn value(&self) -> i32 {
16492            self.0
16493        }
16494
16495        /// Gets the enum value as a string.
16496        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
16497            match self.0 {
16498                0 => std::borrow::Cow::Borrowed("NODE_STATE_UNSPECIFIED"),
16499                1 => std::borrow::Cow::Borrowed("BLOCKED"),
16500                2 => std::borrow::Cow::Borrowed("RUNNABLE"),
16501                3 => std::borrow::Cow::Borrowed("RUNNING"),
16502                4 => std::borrow::Cow::Borrowed("COMPLETED"),
16503                5 => std::borrow::Cow::Borrowed("FAILED"),
16504                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
16505            }
16506        }
16507
16508        /// Creates an enum value from the value name.
16509        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
16510            match name {
16511                "NODE_STATE_UNSPECIFIED" => std::option::Option::Some(Self::NODE_STATE_UNSPECIFIED),
16512                "BLOCKED" => std::option::Option::Some(Self::BLOCKED),
16513                "RUNNABLE" => std::option::Option::Some(Self::RUNNABLE),
16514                "RUNNING" => std::option::Option::Some(Self::RUNNING),
16515                "COMPLETED" => std::option::Option::Some(Self::COMPLETED),
16516                "FAILED" => std::option::Option::Some(Self::FAILED),
16517                _ => std::option::Option::None,
16518            }
16519        }
16520    }
16521
16522    impl std::convert::From<i32> for NodeState {
16523        fn from(value: i32) -> Self {
16524            Self::new(value)
16525        }
16526    }
16527
16528    impl std::default::Default for NodeState {
16529        fn default() -> Self {
16530            Self::new(0)
16531        }
16532    }
16533}
16534
16535/// A request to create a workflow template.
16536#[serde_with::serde_as]
16537#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16538#[serde(default, rename_all = "camelCase")]
16539#[non_exhaustive]
16540pub struct CreateWorkflowTemplateRequest {
16541    /// Required. The resource name of the region or location, as described
16542    /// in <https://cloud.google.com/apis/design/resource_names>.
16543    ///
16544    /// * For `projects.regions.workflowTemplates.create`, the resource name of the
16545    ///   region has the following format:
16546    ///   `projects/{project_id}/regions/{region}`
16547    ///
16548    /// * For `projects.locations.workflowTemplates.create`, the resource name of
16549    ///   the location has the following format:
16550    ///   `projects/{project_id}/locations/{location}`
16551    ///
16552    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16553    pub parent: std::string::String,
16554
16555    /// Required. The Dataproc workflow template to create.
16556    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16557    pub template: std::option::Option<crate::model::WorkflowTemplate>,
16558
16559    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16560    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16561}
16562
16563impl CreateWorkflowTemplateRequest {
16564    pub fn new() -> Self {
16565        std::default::Default::default()
16566    }
16567
16568    /// Sets the value of [parent][crate::model::CreateWorkflowTemplateRequest::parent].
16569    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16570        self.parent = v.into();
16571        self
16572    }
16573
16574    /// Sets the value of [template][crate::model::CreateWorkflowTemplateRequest::template].
16575    pub fn set_template<
16576        T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplate>>,
16577    >(
16578        mut self,
16579        v: T,
16580    ) -> Self {
16581        self.template = v.into();
16582        self
16583    }
16584}
16585
16586impl wkt::message::Message for CreateWorkflowTemplateRequest {
16587    fn typename() -> &'static str {
16588        "type.googleapis.com/google.cloud.dataproc.v1.CreateWorkflowTemplateRequest"
16589    }
16590}
16591
16592/// A request to fetch a workflow template.
16593#[serde_with::serde_as]
16594#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16595#[serde(default, rename_all = "camelCase")]
16596#[non_exhaustive]
16597pub struct GetWorkflowTemplateRequest {
16598    /// Required. The resource name of the workflow template, as described
16599    /// in <https://cloud.google.com/apis/design/resource_names>.
16600    ///
16601    /// * For `projects.regions.workflowTemplates.get`, the resource name of the
16602    ///   template has the following format:
16603    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
16604    ///
16605    /// * For `projects.locations.workflowTemplates.get`, the resource name of the
16606    ///   template has the following format:
16607    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
16608    ///
16609    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16610    pub name: std::string::String,
16611
16612    /// Optional. The version of workflow template to retrieve. Only previously
16613    /// instantiated versions can be retrieved.
16614    ///
16615    /// If unspecified, retrieves the current version.
16616    pub version: i32,
16617
16618    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16619    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16620}
16621
16622impl GetWorkflowTemplateRequest {
16623    pub fn new() -> Self {
16624        std::default::Default::default()
16625    }
16626
16627    /// Sets the value of [name][crate::model::GetWorkflowTemplateRequest::name].
16628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16629        self.name = v.into();
16630        self
16631    }
16632
16633    /// Sets the value of [version][crate::model::GetWorkflowTemplateRequest::version].
16634    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16635        self.version = v.into();
16636        self
16637    }
16638}
16639
16640impl wkt::message::Message for GetWorkflowTemplateRequest {
16641    fn typename() -> &'static str {
16642        "type.googleapis.com/google.cloud.dataproc.v1.GetWorkflowTemplateRequest"
16643    }
16644}
16645
16646/// A request to instantiate a workflow template.
16647#[serde_with::serde_as]
16648#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16649#[serde(default, rename_all = "camelCase")]
16650#[non_exhaustive]
16651pub struct InstantiateWorkflowTemplateRequest {
16652    /// Required. The resource name of the workflow template, as described
16653    /// in <https://cloud.google.com/apis/design/resource_names>.
16654    ///
16655    /// * For `projects.regions.workflowTemplates.instantiate`, the resource name
16656    ///   of the template has the following format:
16657    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
16658    ///
16659    /// * For `projects.locations.workflowTemplates.instantiate`, the resource name
16660    ///   of the template has the following format:
16661    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
16662    ///
16663    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16664    pub name: std::string::String,
16665
16666    /// Optional. The version of workflow template to instantiate. If specified,
16667    /// the workflow will be instantiated only if the current version of
16668    /// the workflow template has the supplied version.
16669    ///
16670    /// This option cannot be used to instantiate a previous version of
16671    /// workflow template.
16672    pub version: i32,
16673
16674    /// Optional. A tag that prevents multiple concurrent workflow
16675    /// instances with the same tag from running. This mitigates risk of
16676    /// concurrent instances started due to retries.
16677    ///
16678    /// It is recommended to always set this value to a
16679    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
16680    ///
16681    /// The tag must contain only letters (a-z, A-Z), numbers (0-9),
16682    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
16683    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16684    pub request_id: std::string::String,
16685
16686    /// Optional. Map from parameter names to values that should be used for those
16687    /// parameters. Values may not exceed 1000 characters.
16688    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
16689    pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
16690
16691    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16692    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16693}
16694
16695impl InstantiateWorkflowTemplateRequest {
16696    pub fn new() -> Self {
16697        std::default::Default::default()
16698    }
16699
16700    /// Sets the value of [name][crate::model::InstantiateWorkflowTemplateRequest::name].
16701    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16702        self.name = v.into();
16703        self
16704    }
16705
16706    /// Sets the value of [version][crate::model::InstantiateWorkflowTemplateRequest::version].
16707    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16708        self.version = v.into();
16709        self
16710    }
16711
16712    /// Sets the value of [request_id][crate::model::InstantiateWorkflowTemplateRequest::request_id].
16713    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16714        self.request_id = v.into();
16715        self
16716    }
16717
16718    /// Sets the value of [parameters][crate::model::InstantiateWorkflowTemplateRequest::parameters].
16719    pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
16720    where
16721        T: std::iter::IntoIterator<Item = (K, V)>,
16722        K: std::convert::Into<std::string::String>,
16723        V: std::convert::Into<std::string::String>,
16724    {
16725        use std::iter::Iterator;
16726        self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16727        self
16728    }
16729}
16730
16731impl wkt::message::Message for InstantiateWorkflowTemplateRequest {
16732    fn typename() -> &'static str {
16733        "type.googleapis.com/google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest"
16734    }
16735}
16736
16737/// A request to instantiate an inline workflow template.
16738#[serde_with::serde_as]
16739#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16740#[serde(default, rename_all = "camelCase")]
16741#[non_exhaustive]
16742pub struct InstantiateInlineWorkflowTemplateRequest {
16743    /// Required. The resource name of the region or location, as described
16744    /// in <https://cloud.google.com/apis/design/resource_names>.
16745    ///
16746    /// * For `projects.regions.workflowTemplates,instantiateinline`, the resource
16747    ///   name of the region has the following format:
16748    ///   `projects/{project_id}/regions/{region}`
16749    ///
16750    /// * For `projects.locations.workflowTemplates.instantiateinline`, the
16751    ///   resource name of the location has the following format:
16752    ///   `projects/{project_id}/locations/{location}`
16753    ///
16754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16755    pub parent: std::string::String,
16756
16757    /// Required. The workflow template to instantiate.
16758    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16759    pub template: std::option::Option<crate::model::WorkflowTemplate>,
16760
16761    /// Optional. A tag that prevents multiple concurrent workflow
16762    /// instances with the same tag from running. This mitigates risk of
16763    /// concurrent instances started due to retries.
16764    ///
16765    /// It is recommended to always set this value to a
16766    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
16767    ///
16768    /// The tag must contain only letters (a-z, A-Z), numbers (0-9),
16769    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
16770    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16771    pub request_id: std::string::String,
16772
16773    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16774    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16775}
16776
16777impl InstantiateInlineWorkflowTemplateRequest {
16778    pub fn new() -> Self {
16779        std::default::Default::default()
16780    }
16781
16782    /// Sets the value of [parent][crate::model::InstantiateInlineWorkflowTemplateRequest::parent].
16783    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16784        self.parent = v.into();
16785        self
16786    }
16787
16788    /// Sets the value of [template][crate::model::InstantiateInlineWorkflowTemplateRequest::template].
16789    pub fn set_template<
16790        T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplate>>,
16791    >(
16792        mut self,
16793        v: T,
16794    ) -> Self {
16795        self.template = v.into();
16796        self
16797    }
16798
16799    /// Sets the value of [request_id][crate::model::InstantiateInlineWorkflowTemplateRequest::request_id].
16800    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16801        self.request_id = v.into();
16802        self
16803    }
16804}
16805
16806impl wkt::message::Message for InstantiateInlineWorkflowTemplateRequest {
16807    fn typename() -> &'static str {
16808        "type.googleapis.com/google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest"
16809    }
16810}
16811
16812/// A request to update a workflow template.
16813#[serde_with::serde_as]
16814#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16815#[serde(default, rename_all = "camelCase")]
16816#[non_exhaustive]
16817pub struct UpdateWorkflowTemplateRequest {
16818    /// Required. The updated workflow template.
16819    ///
16820    /// The `template.version` field must match the current version.
16821    #[serde(skip_serializing_if = "std::option::Option::is_none")]
16822    pub template: std::option::Option<crate::model::WorkflowTemplate>,
16823
16824    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16825    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16826}
16827
16828impl UpdateWorkflowTemplateRequest {
16829    pub fn new() -> Self {
16830        std::default::Default::default()
16831    }
16832
16833    /// Sets the value of [template][crate::model::UpdateWorkflowTemplateRequest::template].
16834    pub fn set_template<
16835        T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplate>>,
16836    >(
16837        mut self,
16838        v: T,
16839    ) -> Self {
16840        self.template = v.into();
16841        self
16842    }
16843}
16844
16845impl wkt::message::Message for UpdateWorkflowTemplateRequest {
16846    fn typename() -> &'static str {
16847        "type.googleapis.com/google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest"
16848    }
16849}
16850
16851/// A request to list workflow templates in a project.
16852#[serde_with::serde_as]
16853#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16854#[serde(default, rename_all = "camelCase")]
16855#[non_exhaustive]
16856pub struct ListWorkflowTemplatesRequest {
16857    /// Required. The resource name of the region or location, as described
16858    /// in <https://cloud.google.com/apis/design/resource_names>.
16859    ///
16860    /// * For `projects.regions.workflowTemplates,list`, the resource
16861    ///   name of the region has the following format:
16862    ///   `projects/{project_id}/regions/{region}`
16863    ///
16864    /// * For `projects.locations.workflowTemplates.list`, the
16865    ///   resource name of the location has the following format:
16866    ///   `projects/{project_id}/locations/{location}`
16867    ///
16868    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16869    pub parent: std::string::String,
16870
16871    /// Optional. The maximum number of results to return in each response.
16872    pub page_size: i32,
16873
16874    /// Optional. The page token, returned by a previous call, to request the
16875    /// next page of results.
16876    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16877    pub page_token: std::string::String,
16878
16879    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16880    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16881}
16882
16883impl ListWorkflowTemplatesRequest {
16884    pub fn new() -> Self {
16885        std::default::Default::default()
16886    }
16887
16888    /// Sets the value of [parent][crate::model::ListWorkflowTemplatesRequest::parent].
16889    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16890        self.parent = v.into();
16891        self
16892    }
16893
16894    /// Sets the value of [page_size][crate::model::ListWorkflowTemplatesRequest::page_size].
16895    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16896        self.page_size = v.into();
16897        self
16898    }
16899
16900    /// Sets the value of [page_token][crate::model::ListWorkflowTemplatesRequest::page_token].
16901    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16902        self.page_token = v.into();
16903        self
16904    }
16905}
16906
16907impl wkt::message::Message for ListWorkflowTemplatesRequest {
16908    fn typename() -> &'static str {
16909        "type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesRequest"
16910    }
16911}
16912
16913/// A response to a request to list workflow templates in a project.
16914#[serde_with::serde_as]
16915#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16916#[serde(default, rename_all = "camelCase")]
16917#[non_exhaustive]
16918pub struct ListWorkflowTemplatesResponse {
16919    /// Output only. WorkflowTemplates list.
16920    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16921    pub templates: std::vec::Vec<crate::model::WorkflowTemplate>,
16922
16923    /// Output only. This token is included in the response if there are more
16924    /// results to fetch. To fetch additional results, provide this value as the
16925    /// page_token in a subsequent \<code\>ListWorkflowTemplatesRequest\</code\>.
16926    #[serde(skip_serializing_if = "std::string::String::is_empty")]
16927    pub next_page_token: std::string::String,
16928
16929    /// Output only. List of workflow templates that could not be included in the
16930    /// response. Attempting to get one of these resources may indicate why it was
16931    /// not included in the list response.
16932    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16933    pub unreachable: std::vec::Vec<std::string::String>,
16934
16935    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16936    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16937}
16938
16939impl ListWorkflowTemplatesResponse {
16940    pub fn new() -> Self {
16941        std::default::Default::default()
16942    }
16943
16944    /// Sets the value of [next_page_token][crate::model::ListWorkflowTemplatesResponse::next_page_token].
16945    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16946        self.next_page_token = v.into();
16947        self
16948    }
16949
16950    /// Sets the value of [templates][crate::model::ListWorkflowTemplatesResponse::templates].
16951    pub fn set_templates<T, V>(mut self, v: T) -> Self
16952    where
16953        T: std::iter::IntoIterator<Item = V>,
16954        V: std::convert::Into<crate::model::WorkflowTemplate>,
16955    {
16956        use std::iter::Iterator;
16957        self.templates = v.into_iter().map(|i| i.into()).collect();
16958        self
16959    }
16960
16961    /// Sets the value of [unreachable][crate::model::ListWorkflowTemplatesResponse::unreachable].
16962    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16963    where
16964        T: std::iter::IntoIterator<Item = V>,
16965        V: std::convert::Into<std::string::String>,
16966    {
16967        use std::iter::Iterator;
16968        self.unreachable = v.into_iter().map(|i| i.into()).collect();
16969        self
16970    }
16971}
16972
16973impl wkt::message::Message for ListWorkflowTemplatesResponse {
16974    fn typename() -> &'static str {
16975        "type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesResponse"
16976    }
16977}
16978
16979#[doc(hidden)]
16980impl gax::paginator::internal::PageableResponse for ListWorkflowTemplatesResponse {
16981    type PageItem = crate::model::WorkflowTemplate;
16982
16983    fn items(self) -> std::vec::Vec<Self::PageItem> {
16984        self.templates
16985    }
16986
16987    fn next_page_token(&self) -> std::string::String {
16988        use std::clone::Clone;
16989        self.next_page_token.clone()
16990    }
16991}
16992
16993/// A request to delete a workflow template.
16994///
16995/// Currently started workflows will remain running.
16996#[serde_with::serde_as]
16997#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16998#[serde(default, rename_all = "camelCase")]
16999#[non_exhaustive]
17000pub struct DeleteWorkflowTemplateRequest {
17001    /// Required. The resource name of the workflow template, as described
17002    /// in <https://cloud.google.com/apis/design/resource_names>.
17003    ///
17004    /// * For `projects.regions.workflowTemplates.delete`, the resource name
17005    ///   of the template has the following format:
17006    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
17007    ///
17008    /// * For `projects.locations.workflowTemplates.instantiate`, the resource name
17009    ///   of the template has the following format:
17010    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
17011    ///
17012    #[serde(skip_serializing_if = "std::string::String::is_empty")]
17013    pub name: std::string::String,
17014
17015    /// Optional. The version of workflow template to delete. If specified,
17016    /// will only delete the template if the current server version matches
17017    /// specified version.
17018    pub version: i32,
17019
17020    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
17021    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17022}
17023
17024impl DeleteWorkflowTemplateRequest {
17025    pub fn new() -> Self {
17026        std::default::Default::default()
17027    }
17028
17029    /// Sets the value of [name][crate::model::DeleteWorkflowTemplateRequest::name].
17030    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17031        self.name = v.into();
17032        self
17033    }
17034
17035    /// Sets the value of [version][crate::model::DeleteWorkflowTemplateRequest::version].
17036    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17037        self.version = v.into();
17038        self
17039    }
17040}
17041
17042impl wkt::message::Message for DeleteWorkflowTemplateRequest {
17043    fn typename() -> &'static str {
17044        "type.googleapis.com/google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest"
17045    }
17046}
17047
17048/// Cluster components that can be activated.
17049#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
17050pub struct Component(i32);
17051
17052impl Component {
17053    /// Unspecified component. Specifying this will cause Cluster creation to fail.
17054    pub const COMPONENT_UNSPECIFIED: Component = Component::new(0);
17055
17056    /// The Anaconda component is no longer supported or applicable to
17057    /// [supported Dataproc on Compute Engine image versions]
17058    /// (<https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-version-clusters#supported-dataproc-image-versions>).
17059    /// It cannot be activated on clusters created with supported Dataproc on
17060    /// Compute Engine image versions.
17061    pub const ANACONDA: Component = Component::new(5);
17062
17063    /// Docker
17064    pub const DOCKER: Component = Component::new(13);
17065
17066    /// The Druid query engine. (alpha)
17067    pub const DRUID: Component = Component::new(9);
17068
17069    /// Flink
17070    pub const FLINK: Component = Component::new(14);
17071
17072    /// HBase. (beta)
17073    pub const HBASE: Component = Component::new(11);
17074
17075    /// The Hive Web HCatalog (the REST service for accessing HCatalog).
17076    pub const HIVE_WEBHCAT: Component = Component::new(3);
17077
17078    /// Hudi.
17079    pub const HUDI: Component = Component::new(18);
17080
17081    /// The Jupyter Notebook.
17082    pub const JUPYTER: Component = Component::new(1);
17083
17084    /// The Presto query engine.
17085    pub const PRESTO: Component = Component::new(6);
17086
17087    /// The Trino query engine.
17088    pub const TRINO: Component = Component::new(17);
17089
17090    /// The Ranger service.
17091    pub const RANGER: Component = Component::new(12);
17092
17093    /// The Solr service.
17094    pub const SOLR: Component = Component::new(10);
17095
17096    /// The Zeppelin notebook.
17097    pub const ZEPPELIN: Component = Component::new(4);
17098
17099    /// The Zookeeper service.
17100    pub const ZOOKEEPER: Component = Component::new(8);
17101
17102    /// Creates a new Component instance.
17103    pub(crate) const fn new(value: i32) -> Self {
17104        Self(value)
17105    }
17106
17107    /// Gets the enum value.
17108    pub fn value(&self) -> i32 {
17109        self.0
17110    }
17111
17112    /// Gets the enum value as a string.
17113    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
17114        match self.0 {
17115            0 => std::borrow::Cow::Borrowed("COMPONENT_UNSPECIFIED"),
17116            1 => std::borrow::Cow::Borrowed("JUPYTER"),
17117            3 => std::borrow::Cow::Borrowed("HIVE_WEBHCAT"),
17118            4 => std::borrow::Cow::Borrowed("ZEPPELIN"),
17119            5 => std::borrow::Cow::Borrowed("ANACONDA"),
17120            6 => std::borrow::Cow::Borrowed("PRESTO"),
17121            8 => std::borrow::Cow::Borrowed("ZOOKEEPER"),
17122            9 => std::borrow::Cow::Borrowed("DRUID"),
17123            10 => std::borrow::Cow::Borrowed("SOLR"),
17124            11 => std::borrow::Cow::Borrowed("HBASE"),
17125            12 => std::borrow::Cow::Borrowed("RANGER"),
17126            13 => std::borrow::Cow::Borrowed("DOCKER"),
17127            14 => std::borrow::Cow::Borrowed("FLINK"),
17128            17 => std::borrow::Cow::Borrowed("TRINO"),
17129            18 => std::borrow::Cow::Borrowed("HUDI"),
17130            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
17131        }
17132    }
17133
17134    /// Creates an enum value from the value name.
17135    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
17136        match name {
17137            "COMPONENT_UNSPECIFIED" => std::option::Option::Some(Self::COMPONENT_UNSPECIFIED),
17138            "ANACONDA" => std::option::Option::Some(Self::ANACONDA),
17139            "DOCKER" => std::option::Option::Some(Self::DOCKER),
17140            "DRUID" => std::option::Option::Some(Self::DRUID),
17141            "FLINK" => std::option::Option::Some(Self::FLINK),
17142            "HBASE" => std::option::Option::Some(Self::HBASE),
17143            "HIVE_WEBHCAT" => std::option::Option::Some(Self::HIVE_WEBHCAT),
17144            "HUDI" => std::option::Option::Some(Self::HUDI),
17145            "JUPYTER" => std::option::Option::Some(Self::JUPYTER),
17146            "PRESTO" => std::option::Option::Some(Self::PRESTO),
17147            "TRINO" => std::option::Option::Some(Self::TRINO),
17148            "RANGER" => std::option::Option::Some(Self::RANGER),
17149            "SOLR" => std::option::Option::Some(Self::SOLR),
17150            "ZEPPELIN" => std::option::Option::Some(Self::ZEPPELIN),
17151            "ZOOKEEPER" => std::option::Option::Some(Self::ZOOKEEPER),
17152            _ => std::option::Option::None,
17153        }
17154    }
17155}
17156
17157impl std::convert::From<i32> for Component {
17158    fn from(value: i32) -> Self {
17159        Self::new(value)
17160    }
17161}
17162
17163impl std::default::Default for Component {
17164    fn default() -> Self {
17165        Self::new(0)
17166    }
17167}
17168
17169/// Actions in response to failure of a resource associated with a cluster.
17170#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
17171pub struct FailureAction(i32);
17172
17173impl FailureAction {
17174    /// When FailureAction is unspecified, failure action defaults to NO_ACTION.
17175    pub const FAILURE_ACTION_UNSPECIFIED: FailureAction = FailureAction::new(0);
17176
17177    /// Take no action on failure to create a cluster resource. NO_ACTION is the
17178    /// default.
17179    pub const NO_ACTION: FailureAction = FailureAction::new(1);
17180
17181    /// Delete the failed cluster resource.
17182    pub const DELETE: FailureAction = FailureAction::new(2);
17183
17184    /// Creates a new FailureAction instance.
17185    pub(crate) const fn new(value: i32) -> Self {
17186        Self(value)
17187    }
17188
17189    /// Gets the enum value.
17190    pub fn value(&self) -> i32 {
17191        self.0
17192    }
17193
17194    /// Gets the enum value as a string.
17195    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
17196        match self.0 {
17197            0 => std::borrow::Cow::Borrowed("FAILURE_ACTION_UNSPECIFIED"),
17198            1 => std::borrow::Cow::Borrowed("NO_ACTION"),
17199            2 => std::borrow::Cow::Borrowed("DELETE"),
17200            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
17201        }
17202    }
17203
17204    /// Creates an enum value from the value name.
17205    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
17206        match name {
17207            "FAILURE_ACTION_UNSPECIFIED" => {
17208                std::option::Option::Some(Self::FAILURE_ACTION_UNSPECIFIED)
17209            }
17210            "NO_ACTION" => std::option::Option::Some(Self::NO_ACTION),
17211            "DELETE" => std::option::Option::Some(Self::DELETE),
17212            _ => std::option::Option::None,
17213        }
17214    }
17215}
17216
17217impl std::convert::From<i32> for FailureAction {
17218    fn from(value: i32) -> Self {
17219        Self::new(value)
17220    }
17221}
17222
17223impl std::default::Default for FailureAction {
17224    fn default() -> Self {
17225        Self::new(0)
17226    }
17227}