#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_type;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoscalingPolicy {
pub id: std::string::String,
pub name: std::string::String,
pub worker_config: std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
pub secondary_worker_config:
std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub cluster_type: crate::model::autoscaling_policy::ClusterType,
pub algorithm: std::option::Option<crate::model::autoscaling_policy::Algorithm>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutoscalingPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_worker_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
{
self.worker_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
{
self.worker_config = v.map(|x| x.into());
self
}
pub fn set_secondary_worker_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
{
self.secondary_worker_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_secondary_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
{
self.secondary_worker_config = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_cluster_type<
T: std::convert::Into<crate::model::autoscaling_policy::ClusterType>,
>(
mut self,
v: T,
) -> Self {
self.cluster_type = v.into();
self
}
pub fn set_algorithm<
T: std::convert::Into<std::option::Option<crate::model::autoscaling_policy::Algorithm>>,
>(
mut self,
v: T,
) -> Self {
self.algorithm = v.into();
self
}
pub fn basic_algorithm(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>> {
#[allow(unreachable_patterns)]
self.algorithm.as_ref().and_then(|v| match v {
crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_basic_algorithm<
T: std::convert::Into<std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>>,
>(
mut self,
v: T,
) -> Self {
self.algorithm = std::option::Option::Some(
crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v.into()),
);
self
}
}
impl wkt::message::Message for AutoscalingPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AutoscalingPolicy"
}
}
pub mod autoscaling_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ClusterType {
Unspecified,
Standard,
ZeroScale,
UnknownValue(cluster_type::UnknownValue),
}
#[doc(hidden)]
pub mod cluster_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ClusterType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::ZeroScale => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CLUSTER_TYPE_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::ZeroScale => std::option::Option::Some("ZERO_SCALE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ClusterType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ClusterType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ClusterType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::ZeroScale,
_ => Self::UnknownValue(cluster_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ClusterType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLUSTER_TYPE_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"ZERO_SCALE" => Self::ZeroScale,
_ => Self::UnknownValue(cluster_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ClusterType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::ZeroScale => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ClusterType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterType>::new(
".google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Algorithm {
BasicAlgorithm(std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BasicAutoscalingAlgorithm {
pub cooldown_period: std::option::Option<wkt::Duration>,
pub config: std::option::Option<crate::model::basic_autoscaling_algorithm::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BasicAutoscalingAlgorithm {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cooldown_period<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.cooldown_period = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cooldown_period<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.cooldown_period = v.map(|x| x.into());
self
}
pub fn set_config<
T: std::convert::Into<std::option::Option<crate::model::basic_autoscaling_algorithm::Config>>,
>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
pub fn yarn_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_yarn_config<
T: std::convert::Into<std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v.into()),
);
self
}
}
impl wkt::message::Message for BasicAutoscalingAlgorithm {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.BasicAutoscalingAlgorithm"
}
}
pub mod basic_autoscaling_algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
YarnConfig(std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BasicYarnAutoscalingConfig {
pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
pub scale_up_factor: f64,
pub scale_down_factor: f64,
pub scale_up_min_worker_fraction: f64,
pub scale_down_min_worker_fraction: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BasicYarnAutoscalingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.graceful_decommission_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_graceful_decommission_timeout<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.graceful_decommission_timeout = v.map(|x| x.into());
self
}
pub fn set_scale_up_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.scale_up_factor = v.into();
self
}
pub fn set_scale_down_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.scale_down_factor = v.into();
self
}
pub fn set_scale_up_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.scale_up_min_worker_fraction = v.into();
self
}
pub fn set_scale_down_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.scale_down_min_worker_fraction = v.into();
self
}
}
impl wkt::message::Message for BasicYarnAutoscalingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.BasicYarnAutoscalingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceGroupAutoscalingPolicyConfig {
pub min_instances: i32,
pub max_instances: i32,
pub weight: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceGroupAutoscalingPolicyConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_instances = v.into();
self
}
pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_instances = v.into();
self
}
pub fn set_weight<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.weight = v.into();
self
}
}
impl wkt::message::Message for InstanceGroupAutoscalingPolicyConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAutoscalingPolicyRequest {
pub parent: std::string::String,
pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAutoscalingPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutoscalingPolicy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutoscalingPolicy>,
{
self.policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateAutoscalingPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAutoscalingPolicyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAutoscalingPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAutoscalingPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetAutoscalingPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAutoscalingPolicyRequest {
pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAutoscalingPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutoscalingPolicy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutoscalingPolicy>,
{
self.policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateAutoscalingPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAutoscalingPolicyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAutoscalingPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteAutoscalingPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAutoscalingPoliciesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAutoscalingPoliciesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListAutoscalingPoliciesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAutoscalingPoliciesResponse {
pub policies: std::vec::Vec<crate::model::AutoscalingPolicy>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAutoscalingPoliciesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AutoscalingPolicy>,
{
use std::iter::Iterator;
self.policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListAutoscalingPoliciesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAutoscalingPoliciesResponse {
type PageItem = crate::model::AutoscalingPolicy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.policies
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBatchRequest {
pub parent: std::string::String,
pub batch: std::option::Option<crate::model::Batch>,
pub batch_id: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_batch<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Batch>,
{
self.batch = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_batch<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Batch>,
{
self.batch = v.map(|x| x.into());
self
}
pub fn set_batch_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.batch_id = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateBatchRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateBatchRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBatchRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetBatchRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetBatchRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBatchesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBatchesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListBatchesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListBatchesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBatchesResponse {
pub batches: std::vec::Vec<crate::model::Batch>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBatchesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_batches<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Batch>,
{
use std::iter::Iterator;
self.batches = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListBatchesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListBatchesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBatchesResponse {
type PageItem = crate::model::Batch;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.batches
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBatchRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteBatchRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteBatchRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Batch {
pub name: std::string::String,
pub uuid: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
pub state: crate::model::batch::State,
pub state_message: std::string::String,
pub state_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
pub operation: std::string::String,
pub state_history: std::vec::Vec<crate::model::batch::StateHistory>,
pub batch_config: std::option::Option<crate::model::batch::BatchConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Batch {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_runtime_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeInfo>,
{
self.runtime_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeInfo>,
{
self.runtime_info = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::batch::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_message = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_runtime_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = v.map(|x| x.into());
self
}
pub fn set_environment_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EnvironmentConfig>,
{
self.environment_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EnvironmentConfig>,
{
self.environment_config = v.map(|x| x.into());
self
}
pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation = v.into();
self
}
pub fn set_state_history<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::batch::StateHistory>,
{
use std::iter::Iterator;
self.state_history = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_batch_config<
T: std::convert::Into<std::option::Option<crate::model::batch::BatchConfig>>,
>(
mut self,
v: T,
) -> Self {
self.batch_config = v.into();
self
}
pub fn pyspark_batch(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PySparkBatch>> {
#[allow(unreachable_patterns)]
self.batch_config.as_ref().and_then(|v| match v {
crate::model::batch::BatchConfig::PysparkBatch(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_pyspark_batch<T: std::convert::Into<std::boxed::Box<crate::model::PySparkBatch>>>(
mut self,
v: T,
) -> Self {
self.batch_config =
std::option::Option::Some(crate::model::batch::BatchConfig::PysparkBatch(v.into()));
self
}
pub fn spark_batch(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkBatch>> {
#[allow(unreachable_patterns)]
self.batch_config.as_ref().and_then(|v| match v {
crate::model::batch::BatchConfig::SparkBatch(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkBatch>>>(
mut self,
v: T,
) -> Self {
self.batch_config =
std::option::Option::Some(crate::model::batch::BatchConfig::SparkBatch(v.into()));
self
}
pub fn spark_r_batch(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SparkRBatch>> {
#[allow(unreachable_patterns)]
self.batch_config.as_ref().and_then(|v| match v {
crate::model::batch::BatchConfig::SparkRBatch(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_r_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkRBatch>>>(
mut self,
v: T,
) -> Self {
self.batch_config =
std::option::Option::Some(crate::model::batch::BatchConfig::SparkRBatch(v.into()));
self
}
pub fn spark_sql_batch(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlBatch>> {
#[allow(unreachable_patterns)]
self.batch_config.as_ref().and_then(|v| match v {
crate::model::batch::BatchConfig::SparkSqlBatch(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_sql_batch<
T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlBatch>>,
>(
mut self,
v: T,
) -> Self {
self.batch_config =
std::option::Option::Some(crate::model::batch::BatchConfig::SparkSqlBatch(v.into()));
self
}
}
impl wkt::message::Message for Batch {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.Batch"
}
}
pub mod batch {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StateHistory {
pub state: crate::model::batch::State,
pub state_message: std::string::String,
pub state_start_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StateHistory {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::batch::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.state_message = v.into();
self
}
pub fn set_state_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StateHistory {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.Batch.StateHistory"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Running,
Cancelling,
Cancelled,
Succeeded,
Failed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Cancelling => std::option::Option::Some(3),
Self::Cancelled => std::option::Option::Some(4),
Self::Succeeded => std::option::Option::Some(5),
Self::Failed => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Cancelling,
4 => Self::Cancelled,
5 => Self::Succeeded,
6 => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"CANCELLING" => Self::Cancelling,
"CANCELLED" => Self::Cancelled,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Cancelling => serializer.serialize_i32(3),
Self::Cancelled => serializer.serialize_i32(4),
Self::Succeeded => serializer.serialize_i32(5),
Self::Failed => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.Batch.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BatchConfig {
PysparkBatch(std::boxed::Box<crate::model::PySparkBatch>),
SparkBatch(std::boxed::Box<crate::model::SparkBatch>),
SparkRBatch(std::boxed::Box<crate::model::SparkRBatch>),
SparkSqlBatch(std::boxed::Box<crate::model::SparkSqlBatch>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PySparkBatch {
pub main_python_file_uri: std::string::String,
pub args: std::vec::Vec<std::string::String>,
pub python_file_uris: std::vec::Vec<std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PySparkBatch {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.main_python_file_uri = v.into();
self
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PySparkBatch {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.PySparkBatch"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkBatch {
pub args: std::vec::Vec<std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub driver: std::option::Option<crate::model::spark_batch::Driver>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkBatch {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_driver<
T: std::convert::Into<std::option::Option<crate::model::spark_batch::Driver>>,
>(
mut self,
v: T,
) -> Self {
self.driver = v.into();
self
}
pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::spark_batch::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver =
std::option::Option::Some(crate::model::spark_batch::Driver::MainJarFileUri(v.into()));
self
}
pub fn main_class(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::spark_batch::Driver::MainClass(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.driver =
std::option::Option::Some(crate::model::spark_batch::Driver::MainClass(v.into()));
self
}
}
impl wkt::message::Message for SparkBatch {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkBatch"
}
}
pub mod spark_batch {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Driver {
MainJarFileUri(std::string::String),
MainClass(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkRBatch {
pub main_r_file_uri: std::string::String,
pub args: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkRBatch {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.main_r_file_uri = v.into();
self
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SparkRBatch {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkRBatch"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkSqlBatch {
pub query_file_uri: std::string::String,
pub query_variables: std::collections::HashMap<std::string::String, std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkSqlBatch {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query_file_uri = v.into();
self
}
pub fn set_query_variables<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.query_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SparkSqlBatch {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkSqlBatch"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Cluster {
pub project_id: std::string::String,
pub cluster_name: std::string::String,
pub config: std::option::Option<crate::model::ClusterConfig>,
pub virtual_cluster_config: std::option::Option<crate::model::VirtualClusterConfig>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub status: std::option::Option<crate::model::ClusterStatus>,
pub status_history: std::vec::Vec<crate::model::ClusterStatus>,
pub cluster_uuid: std::string::String,
pub metrics: std::option::Option<crate::model::ClusterMetrics>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Cluster {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterConfig>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_virtual_cluster_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VirtualClusterConfig>,
{
self.virtual_cluster_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_virtual_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VirtualClusterConfig>,
{
self.virtual_cluster_config = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_status_history<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ClusterStatus>,
{
use std::iter::Iterator;
self.status_history = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_metrics<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterMetrics>,
{
self.metrics = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metrics<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterMetrics>,
{
self.metrics = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Cluster {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.Cluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterConfig {
pub cluster_type: crate::model::cluster_config::ClusterType,
pub cluster_tier: crate::model::cluster_config::ClusterTier,
pub config_bucket: std::string::String,
pub temp_bucket: std::string::String,
pub gce_cluster_config: std::option::Option<crate::model::GceClusterConfig>,
pub master_config: std::option::Option<crate::model::InstanceGroupConfig>,
pub worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
pub secondary_worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
pub software_config: std::option::Option<crate::model::SoftwareConfig>,
pub initialization_actions: std::vec::Vec<crate::model::NodeInitializationAction>,
pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
pub autoscaling_config: std::option::Option<crate::model::AutoscalingConfig>,
pub security_config: std::option::Option<crate::model::SecurityConfig>,
pub lifecycle_config: std::option::Option<crate::model::LifecycleConfig>,
pub endpoint_config: std::option::Option<crate::model::EndpointConfig>,
pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
pub dataproc_metric_config: std::option::Option<crate::model::DataprocMetricConfig>,
pub auxiliary_node_groups: std::vec::Vec<crate::model::AuxiliaryNodeGroup>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_type<T: std::convert::Into<crate::model::cluster_config::ClusterType>>(
mut self,
v: T,
) -> Self {
self.cluster_type = v.into();
self
}
pub fn set_cluster_tier<T: std::convert::Into<crate::model::cluster_config::ClusterTier>>(
mut self,
v: T,
) -> Self {
self.cluster_tier = v.into();
self
}
pub fn set_config_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.config_bucket = v.into();
self
}
pub fn set_temp_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.temp_bucket = v.into();
self
}
pub fn set_gce_cluster_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GceClusterConfig>,
{
self.gce_cluster_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gce_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GceClusterConfig>,
{
self.gce_cluster_config = v.map(|x| x.into());
self
}
pub fn set_master_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.master_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_master_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.master_config = v.map(|x| x.into());
self
}
pub fn set_worker_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.worker_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.worker_config = v.map(|x| x.into());
self
}
pub fn set_secondary_worker_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.secondary_worker_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_secondary_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.secondary_worker_config = v.map(|x| x.into());
self
}
pub fn set_software_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SoftwareConfig>,
{
self.software_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_software_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SoftwareConfig>,
{
self.software_config = v.map(|x| x.into());
self
}
pub fn set_initialization_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NodeInitializationAction>,
{
use std::iter::Iterator;
self.initialization_actions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfig>,
{
self.encryption_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EncryptionConfig>,
{
self.encryption_config = v.map(|x| x.into());
self
}
pub fn set_autoscaling_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutoscalingConfig>,
{
self.autoscaling_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_autoscaling_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutoscalingConfig>,
{
self.autoscaling_config = v.map(|x| x.into());
self
}
pub fn set_security_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityConfig>,
{
self.security_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityConfig>,
{
self.security_config = v.map(|x| x.into());
self
}
pub fn set_lifecycle_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LifecycleConfig>,
{
self.lifecycle_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lifecycle_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LifecycleConfig>,
{
self.lifecycle_config = v.map(|x| x.into());
self
}
pub fn set_endpoint_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EndpointConfig>,
{
self.endpoint_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_endpoint_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EndpointConfig>,
{
self.endpoint_config = v.map(|x| x.into());
self
}
pub fn set_metastore_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MetastoreConfig>,
{
self.metastore_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metastore_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MetastoreConfig>,
{
self.metastore_config = v.map(|x| x.into());
self
}
pub fn set_dataproc_metric_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataprocMetricConfig>,
{
self.dataproc_metric_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dataproc_metric_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataprocMetricConfig>,
{
self.dataproc_metric_config = v.map(|x| x.into());
self
}
pub fn set_auxiliary_node_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuxiliaryNodeGroup>,
{
use std::iter::Iterator;
self.auxiliary_node_groups = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ClusterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterConfig"
}
}
pub mod cluster_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ClusterType {
Unspecified,
Standard,
SingleNode,
ZeroScale,
UnknownValue(cluster_type::UnknownValue),
}
#[doc(hidden)]
pub mod cluster_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ClusterType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::SingleNode => std::option::Option::Some(2),
Self::ZeroScale => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CLUSTER_TYPE_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::SingleNode => std::option::Option::Some("SINGLE_NODE"),
Self::ZeroScale => std::option::Option::Some("ZERO_SCALE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ClusterType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ClusterType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ClusterType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::SingleNode,
3 => Self::ZeroScale,
_ => Self::UnknownValue(cluster_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ClusterType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLUSTER_TYPE_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"SINGLE_NODE" => Self::SingleNode,
"ZERO_SCALE" => Self::ZeroScale,
_ => Self::UnknownValue(cluster_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ClusterType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::SingleNode => serializer.serialize_i32(2),
Self::ZeroScale => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ClusterType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterType>::new(
".google.cloud.dataproc.v1.ClusterConfig.ClusterType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ClusterTier {
Unspecified,
Standard,
Premium,
UnknownValue(cluster_tier::UnknownValue),
}
#[doc(hidden)]
pub mod cluster_tier {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ClusterTier {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Standard => std::option::Option::Some(1),
Self::Premium => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CLUSTER_TIER_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("CLUSTER_TIER_STANDARD"),
Self::Premium => std::option::Option::Some("CLUSTER_TIER_PREMIUM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ClusterTier {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ClusterTier {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ClusterTier {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Premium,
_ => Self::UnknownValue(cluster_tier::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ClusterTier {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLUSTER_TIER_UNSPECIFIED" => Self::Unspecified,
"CLUSTER_TIER_STANDARD" => Self::Standard,
"CLUSTER_TIER_PREMIUM" => Self::Premium,
_ => Self::UnknownValue(cluster_tier::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ClusterTier {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Standard => serializer.serialize_i32(1),
Self::Premium => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ClusterTier {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterTier>::new(
".google.cloud.dataproc.v1.ClusterConfig.ClusterTier",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VirtualClusterConfig {
pub staging_bucket: std::string::String,
pub auxiliary_services_config: std::option::Option<crate::model::AuxiliaryServicesConfig>,
pub infrastructure_config:
std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VirtualClusterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.staging_bucket = v.into();
self
}
pub fn set_auxiliary_services_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuxiliaryServicesConfig>,
{
self.auxiliary_services_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auxiliary_services_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuxiliaryServicesConfig>,
{
self.auxiliary_services_config = v.map(|x| x.into());
self
}
pub fn set_infrastructure_config<
T: std::convert::Into<
std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.infrastructure_config = v.into();
self
}
pub fn kubernetes_cluster_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesClusterConfig>> {
#[allow(unreachable_patterns)]
self.infrastructure_config.as_ref().and_then(|v| match v {
crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_kubernetes_cluster_config<
T: std::convert::Into<std::boxed::Box<crate::model::KubernetesClusterConfig>>,
>(
mut self,
v: T,
) -> Self {
self.infrastructure_config = std::option::Option::Some(
crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
v.into(),
),
);
self
}
}
impl wkt::message::Message for VirtualClusterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.VirtualClusterConfig"
}
}
pub mod virtual_cluster_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum InfrastructureConfig {
KubernetesClusterConfig(std::boxed::Box<crate::model::KubernetesClusterConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuxiliaryServicesConfig {
pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuxiliaryServicesConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metastore_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MetastoreConfig>,
{
self.metastore_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metastore_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MetastoreConfig>,
{
self.metastore_config = v.map(|x| x.into());
self
}
pub fn set_spark_history_server_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
{
self.spark_history_server_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spark_history_server_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
{
self.spark_history_server_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AuxiliaryServicesConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryServicesConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EndpointConfig {
pub http_ports: std::collections::HashMap<std::string::String, std::string::String>,
pub enable_http_port_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EndpointConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_http_ports<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.http_ports = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_enable_http_port_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_http_port_access = v.into();
self
}
}
impl wkt::message::Message for EndpointConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.EndpointConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoscalingConfig {
pub policy_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutoscalingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy_uri = v.into();
self
}
}
impl wkt::message::Message for AutoscalingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AutoscalingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
pub gce_pd_kms_key_name: std::string::String,
pub kms_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gce_pd_kms_key_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.gce_pd_kms_key_name = v.into();
self
}
pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
}
impl wkt::message::Message for EncryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.EncryptionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GceClusterConfig {
pub zone_uri: std::string::String,
pub network_uri: std::string::String,
pub subnetwork_uri: std::string::String,
pub internal_ip_only: std::option::Option<bool>,
pub private_ipv6_google_access: crate::model::gce_cluster_config::PrivateIpv6GoogleAccess,
pub service_account: std::string::String,
pub service_account_scopes: std::vec::Vec<std::string::String>,
pub tags: std::vec::Vec<std::string::String>,
pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
pub node_group_affinity: std::option::Option<crate::model::NodeGroupAffinity>,
pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
pub confidential_instance_config: std::option::Option<crate::model::ConfidentialInstanceConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GceClusterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_zone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone_uri = v.into();
self
}
pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network_uri = v.into();
self
}
pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnetwork_uri = v.into();
self
}
pub fn set_internal_ip_only<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.internal_ip_only = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_internal_ip_only<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.internal_ip_only = v.map(|x| x.into());
self
}
pub fn set_private_ipv6_google_access<
T: std::convert::Into<crate::model::gce_cluster_config::PrivateIpv6GoogleAccess>,
>(
mut self,
v: T,
) -> Self {
self.private_ipv6_google_access = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_service_account_scopes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.service_account_scopes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_reservation_affinity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReservationAffinity>,
{
self.reservation_affinity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reservation_affinity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReservationAffinity>,
{
self.reservation_affinity = v.map(|x| x.into());
self
}
pub fn set_node_group_affinity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeGroupAffinity>,
{
self.node_group_affinity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_group_affinity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeGroupAffinity>,
{
self.node_group_affinity = v.map(|x| x.into());
self
}
pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
{
self.shielded_instance_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
{
self.shielded_instance_config = v.map(|x| x.into());
self
}
pub fn set_confidential_instance_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ConfidentialInstanceConfig>,
{
self.confidential_instance_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_confidential_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ConfidentialInstanceConfig>,
{
self.confidential_instance_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GceClusterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GceClusterConfig"
}
}
pub mod gce_cluster_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PrivateIpv6GoogleAccess {
Unspecified,
InheritFromSubnetwork,
Outbound,
Bidirectional,
UnknownValue(private_ipv_6_google_access::UnknownValue),
}
#[doc(hidden)]
pub mod private_ipv_6_google_access {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PrivateIpv6GoogleAccess {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::InheritFromSubnetwork => std::option::Option::Some(1),
Self::Outbound => std::option::Option::Some(2),
Self::Bidirectional => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED")
}
Self::InheritFromSubnetwork => std::option::Option::Some("INHERIT_FROM_SUBNETWORK"),
Self::Outbound => std::option::Option::Some("OUTBOUND"),
Self::Bidirectional => std::option::Option::Some("BIDIRECTIONAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PrivateIpv6GoogleAccess {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PrivateIpv6GoogleAccess {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PrivateIpv6GoogleAccess {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::InheritFromSubnetwork,
2 => Self::Outbound,
3 => Self::Bidirectional,
_ => Self::UnknownValue(private_ipv_6_google_access::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PrivateIpv6GoogleAccess {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" => Self::Unspecified,
"INHERIT_FROM_SUBNETWORK" => Self::InheritFromSubnetwork,
"OUTBOUND" => Self::Outbound,
"BIDIRECTIONAL" => Self::Bidirectional,
_ => Self::UnknownValue(private_ipv_6_google_access::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PrivateIpv6GoogleAccess {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::InheritFromSubnetwork => serializer.serialize_i32(1),
Self::Outbound => serializer.serialize_i32(2),
Self::Bidirectional => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PrivateIpv6GoogleAccess {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<PrivateIpv6GoogleAccess>::new(
".google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeGroupAffinity {
pub node_group_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeGroupAffinity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node_group_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.node_group_uri = v.into();
self
}
}
impl wkt::message::Message for NodeGroupAffinity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.NodeGroupAffinity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ShieldedInstanceConfig {
pub enable_secure_boot: std::option::Option<bool>,
pub enable_vtpm: std::option::Option<bool>,
pub enable_integrity_monitoring: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ShieldedInstanceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_secure_boot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_secure_boot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_secure_boot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_secure_boot = v.map(|x| x.into());
self
}
pub fn set_enable_vtpm<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_vtpm = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_vtpm<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_vtpm = v.map(|x| x.into());
self
}
pub fn set_enable_integrity_monitoring<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_integrity_monitoring = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enable_integrity_monitoring<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_integrity_monitoring = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ShieldedInstanceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ShieldedInstanceConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfidentialInstanceConfig {
pub enable_confidential_compute: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConfidentialInstanceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_confidential_compute<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_confidential_compute = v.into();
self
}
}
impl wkt::message::Message for ConfidentialInstanceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ConfidentialInstanceConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceGroupConfig {
pub num_instances: i32,
pub instance_names: std::vec::Vec<std::string::String>,
pub instance_references: std::vec::Vec<crate::model::InstanceReference>,
pub image_uri: std::string::String,
pub machine_type_uri: std::string::String,
pub disk_config: std::option::Option<crate::model::DiskConfig>,
pub is_preemptible: bool,
pub preemptibility: crate::model::instance_group_config::Preemptibility,
pub managed_group_config: std::option::Option<crate::model::ManagedGroupConfig>,
pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
pub min_cpu_platform: std::string::String,
pub min_num_instances: i32,
pub instance_flexibility_policy: std::option::Option<crate::model::InstanceFlexibilityPolicy>,
pub startup_config: std::option::Option<crate::model::StartupConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceGroupConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.num_instances = v.into();
self
}
pub fn set_instance_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.instance_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_instance_references<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::InstanceReference>,
{
use std::iter::Iterator;
self.instance_references = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_uri = v.into();
self
}
pub fn set_machine_type_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type_uri = v.into();
self
}
pub fn set_disk_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DiskConfig>,
{
self.disk_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DiskConfig>,
{
self.disk_config = v.map(|x| x.into());
self
}
pub fn set_is_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.is_preemptible = v.into();
self
}
pub fn set_preemptibility<
T: std::convert::Into<crate::model::instance_group_config::Preemptibility>,
>(
mut self,
v: T,
) -> Self {
self.preemptibility = v.into();
self
}
pub fn set_managed_group_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedGroupConfig>,
{
self.managed_group_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_managed_group_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedGroupConfig>,
{
self.managed_group_config = v.map(|x| x.into());
self
}
pub fn set_accelerators<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AcceleratorConfig>,
{
use std::iter::Iterator;
self.accelerators = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.min_cpu_platform = v.into();
self
}
pub fn set_min_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_num_instances = v.into();
self
}
pub fn set_instance_flexibility_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceFlexibilityPolicy>,
{
self.instance_flexibility_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance_flexibility_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceFlexibilityPolicy>,
{
self.instance_flexibility_policy = v.map(|x| x.into());
self
}
pub fn set_startup_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StartupConfig>,
{
self.startup_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_startup_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StartupConfig>,
{
self.startup_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstanceGroupConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupConfig"
}
}
pub mod instance_group_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Preemptibility {
Unspecified,
NonPreemptible,
Preemptible,
Spot,
UnknownValue(preemptibility::UnknownValue),
}
#[doc(hidden)]
pub mod preemptibility {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Preemptibility {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NonPreemptible => std::option::Option::Some(1),
Self::Preemptible => std::option::Option::Some(2),
Self::Spot => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PREEMPTIBILITY_UNSPECIFIED"),
Self::NonPreemptible => std::option::Option::Some("NON_PREEMPTIBLE"),
Self::Preemptible => std::option::Option::Some("PREEMPTIBLE"),
Self::Spot => std::option::Option::Some("SPOT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Preemptibility {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Preemptibility {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Preemptibility {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NonPreemptible,
2 => Self::Preemptible,
3 => Self::Spot,
_ => Self::UnknownValue(preemptibility::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Preemptibility {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PREEMPTIBILITY_UNSPECIFIED" => Self::Unspecified,
"NON_PREEMPTIBLE" => Self::NonPreemptible,
"PREEMPTIBLE" => Self::Preemptible,
"SPOT" => Self::Spot,
_ => Self::UnknownValue(preemptibility::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Preemptibility {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NonPreemptible => serializer.serialize_i32(1),
Self::Preemptible => serializer.serialize_i32(2),
Self::Spot => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Preemptibility {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Preemptibility>::new(
".google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartupConfig {
pub required_registration_fraction: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartupConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_required_registration_fraction<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.required_registration_fraction = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_required_registration_fraction<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<f64>,
{
self.required_registration_fraction = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StartupConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.StartupConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceReference {
pub instance_name: std::string::String,
pub instance_id: std::string::String,
pub public_key: std::string::String,
pub public_ecies_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_name = v.into();
self
}
pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_id = v.into();
self
}
pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.public_key = v.into();
self
}
pub fn set_public_ecies_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.public_ecies_key = v.into();
self
}
}
impl wkt::message::Message for InstanceReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedGroupConfig {
pub instance_template_name: std::string::String,
pub instance_group_manager_name: std::string::String,
pub instance_group_manager_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedGroupConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance_template_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.instance_template_name = v.into();
self
}
pub fn set_instance_group_manager_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.instance_group_manager_name = v.into();
self
}
pub fn set_instance_group_manager_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.instance_group_manager_uri = v.into();
self
}
}
impl wkt::message::Message for ManagedGroupConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ManagedGroupConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceFlexibilityPolicy {
pub provisioning_model_mix:
std::option::Option<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
pub instance_selection_list:
std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelection>,
pub instance_selection_results:
std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceFlexibilityPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_provisioning_model_mix<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
{
self.provisioning_model_mix = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_provisioning_model_mix<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
{
self.provisioning_model_mix = v.map(|x| x.into());
self
}
pub fn set_instance_selection_list<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelection>,
{
use std::iter::Iterator;
self.instance_selection_list = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_instance_selection_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
{
use std::iter::Iterator;
self.instance_selection_results = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for InstanceFlexibilityPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy"
}
}
pub mod instance_flexibility_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProvisioningModelMix {
pub standard_capacity_base: std::option::Option<i32>,
pub standard_capacity_percent_above_base: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProvisioningModelMix {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_standard_capacity_base<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.standard_capacity_base = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_standard_capacity_base<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.standard_capacity_base = v.map(|x| x.into());
self
}
pub fn set_standard_capacity_percent_above_base<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.standard_capacity_percent_above_base = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_standard_capacity_percent_above_base<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.standard_capacity_percent_above_base = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ProvisioningModelMix {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceSelection {
pub machine_types: std::vec::Vec<std::string::String>,
pub rank: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceSelection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.machine_types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rank<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.rank = v.into();
self
}
}
impl wkt::message::Message for InstanceSelection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceSelectionResult {
pub machine_type: std::option::Option<std::string::String>,
pub vm_count: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceSelectionResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.machine_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_machine_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.machine_type = v.map(|x| x.into());
self
}
pub fn set_vm_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.vm_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vm_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.vm_count = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for InstanceSelectionResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceleratorConfig {
pub accelerator_type_uri: std::string::String,
pub accelerator_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AcceleratorConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_accelerator_type_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.accelerator_type_uri = v.into();
self
}
pub fn set_accelerator_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.accelerator_count = v.into();
self
}
}
impl wkt::message::Message for AcceleratorConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AcceleratorConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskConfig {
pub boot_disk_type: std::string::String,
pub boot_disk_size_gb: i32,
pub num_local_ssds: i32,
pub local_ssd_interface: std::string::String,
pub boot_disk_provisioned_iops: std::option::Option<i64>,
pub boot_disk_provisioned_throughput: std::option::Option<i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_boot_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.boot_disk_type = v.into();
self
}
pub fn set_boot_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.boot_disk_size_gb = v.into();
self
}
pub fn set_num_local_ssds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.num_local_ssds = v.into();
self
}
pub fn set_local_ssd_interface<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.local_ssd_interface = v.into();
self
}
pub fn set_boot_disk_provisioned_iops<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.boot_disk_provisioned_iops = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_boot_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.boot_disk_provisioned_iops = v.map(|x| x.into());
self
}
pub fn set_boot_disk_provisioned_throughput<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.boot_disk_provisioned_throughput = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_boot_disk_provisioned_throughput<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i64>,
{
self.boot_disk_provisioned_throughput = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DiskConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DiskConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuxiliaryNodeGroup {
pub node_group: std::option::Option<crate::model::NodeGroup>,
pub node_group_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuxiliaryNodeGroup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeGroup>,
{
self.node_group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeGroup>,
{
self.node_group = v.map(|x| x.into());
self
}
pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.node_group_id = v.into();
self
}
}
impl wkt::message::Message for AuxiliaryNodeGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryNodeGroup"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeGroup {
pub name: std::string::String,
pub roles: std::vec::Vec<crate::model::node_group::Role>,
pub node_group_config: std::option::Option<crate::model::InstanceGroupConfig>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeGroup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::node_group::Role>,
{
use std::iter::Iterator;
self.roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_node_group_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.node_group_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_group_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InstanceGroupConfig>,
{
self.node_group_config = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for NodeGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.NodeGroup"
}
}
pub mod node_group {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Role {
Unspecified,
Driver,
UnknownValue(role::UnknownValue),
}
#[doc(hidden)]
pub mod role {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Role {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Driver => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROLE_UNSPECIFIED"),
Self::Driver => std::option::Option::Some("DRIVER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Role {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Role {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Role {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Driver,
_ => Self::UnknownValue(role::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Role {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROLE_UNSPECIFIED" => Self::Unspecified,
"DRIVER" => Self::Driver,
_ => Self::UnknownValue(role::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Role {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Driver => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Role {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Role>::new(
".google.cloud.dataproc.v1.NodeGroup.Role",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeInitializationAction {
pub executable_file: std::string::String,
pub execution_timeout: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeInitializationAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_executable_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.executable_file = v.into();
self
}
pub fn set_execution_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.execution_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.execution_timeout = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for NodeInitializationAction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.NodeInitializationAction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterStatus {
pub state: crate::model::cluster_status::State,
pub detail: std::string::String,
pub state_start_time: std::option::Option<wkt::Timestamp>,
pub substate: crate::model::cluster_status::Substate,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::cluster_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.detail = v.into();
self
}
pub fn set_state_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = v.map(|x| x.into());
self
}
pub fn set_substate<T: std::convert::Into<crate::model::cluster_status::Substate>>(
mut self,
v: T,
) -> Self {
self.substate = v.into();
self
}
}
impl wkt::message::Message for ClusterStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterStatus"
}
}
pub mod cluster_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unknown,
Creating,
Running,
Error,
ErrorDueToUpdate,
Deleting,
Updating,
Stopping,
Stopped,
Starting,
Repairing,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::Creating => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Error => std::option::Option::Some(3),
Self::ErrorDueToUpdate => std::option::Option::Some(9),
Self::Deleting => std::option::Option::Some(4),
Self::Updating => std::option::Option::Some(5),
Self::Stopping => std::option::Option::Some(6),
Self::Stopped => std::option::Option::Some(7),
Self::Starting => std::option::Option::Some(8),
Self::Repairing => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::ErrorDueToUpdate => std::option::Option::Some("ERROR_DUE_TO_UPDATE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Stopping => std::option::Option::Some("STOPPING"),
Self::Stopped => std::option::Option::Some("STOPPED"),
Self::Starting => std::option::Option::Some("STARTING"),
Self::Repairing => std::option::Option::Some("REPAIRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
1 => Self::Creating,
2 => Self::Running,
3 => Self::Error,
4 => Self::Deleting,
5 => Self::Updating,
6 => Self::Stopping,
7 => Self::Stopped,
8 => Self::Starting,
9 => Self::ErrorDueToUpdate,
10 => Self::Repairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNKNOWN" => Self::Unknown,
"CREATING" => Self::Creating,
"RUNNING" => Self::Running,
"ERROR" => Self::Error,
"ERROR_DUE_TO_UPDATE" => Self::ErrorDueToUpdate,
"DELETING" => Self::Deleting,
"UPDATING" => Self::Updating,
"STOPPING" => Self::Stopping,
"STOPPED" => Self::Stopped,
"STARTING" => Self::Starting,
"REPAIRING" => Self::Repairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::Creating => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Error => serializer.serialize_i32(3),
Self::ErrorDueToUpdate => serializer.serialize_i32(9),
Self::Deleting => serializer.serialize_i32(4),
Self::Updating => serializer.serialize_i32(5),
Self::Stopping => serializer.serialize_i32(6),
Self::Stopped => serializer.serialize_i32(7),
Self::Starting => serializer.serialize_i32(8),
Self::Repairing => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.ClusterStatus.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Substate {
Unspecified,
Unhealthy,
StaleStatus,
UnknownValue(substate::UnknownValue),
}
#[doc(hidden)]
pub mod substate {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Substate {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Unhealthy => std::option::Option::Some(1),
Self::StaleStatus => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
Self::StaleStatus => std::option::Option::Some("STALE_STATUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Substate {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Substate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Substate {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Unhealthy,
2 => Self::StaleStatus,
_ => Self::UnknownValue(substate::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Substate {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNSPECIFIED" => Self::Unspecified,
"UNHEALTHY" => Self::Unhealthy,
"STALE_STATUS" => Self::StaleStatus,
_ => Self::UnknownValue(substate::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Substate {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Unhealthy => serializer.serialize_i32(1),
Self::StaleStatus => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Substate {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Substate>::new(
".google.cloud.dataproc.v1.ClusterStatus.Substate",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityConfig {
pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,
pub identity_config: std::option::Option<crate::model::IdentityConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kerberos_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KerberosConfig>,
{
self.kerberos_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kerberos_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KerberosConfig>,
{
self.kerberos_config = v.map(|x| x.into());
self
}
pub fn set_identity_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::IdentityConfig>,
{
self.identity_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_identity_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::IdentityConfig>,
{
self.identity_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SecurityConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SecurityConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KerberosConfig {
pub enable_kerberos: bool,
pub root_principal_password_uri: std::string::String,
pub kms_key_uri: std::string::String,
pub keystore_uri: std::string::String,
pub truststore_uri: std::string::String,
pub keystore_password_uri: std::string::String,
pub key_password_uri: std::string::String,
pub truststore_password_uri: std::string::String,
pub cross_realm_trust_realm: std::string::String,
pub cross_realm_trust_kdc: std::string::String,
pub cross_realm_trust_admin_server: std::string::String,
pub cross_realm_trust_shared_password_uri: std::string::String,
pub kdc_db_key_uri: std::string::String,
pub tgt_lifetime_hours: i32,
pub realm: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KerberosConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enable_kerberos<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_kerberos = v.into();
self
}
pub fn set_root_principal_password_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.root_principal_password_uri = v.into();
self
}
pub fn set_kms_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_uri = v.into();
self
}
pub fn set_keystore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.keystore_uri = v.into();
self
}
pub fn set_truststore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.truststore_uri = v.into();
self
}
pub fn set_keystore_password_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.keystore_password_uri = v.into();
self
}
pub fn set_key_password_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.key_password_uri = v.into();
self
}
pub fn set_truststore_password_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.truststore_password_uri = v.into();
self
}
pub fn set_cross_realm_trust_realm<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cross_realm_trust_realm = v.into();
self
}
pub fn set_cross_realm_trust_kdc<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cross_realm_trust_kdc = v.into();
self
}
pub fn set_cross_realm_trust_admin_server<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cross_realm_trust_admin_server = v.into();
self
}
pub fn set_cross_realm_trust_shared_password_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cross_realm_trust_shared_password_uri = v.into();
self
}
pub fn set_kdc_db_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kdc_db_key_uri = v.into();
self
}
pub fn set_tgt_lifetime_hours<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.tgt_lifetime_hours = v.into();
self
}
pub fn set_realm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.realm = v.into();
self
}
}
impl wkt::message::Message for KerberosConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.KerberosConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IdentityConfig {
pub user_service_account_mapping:
std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IdentityConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_user_service_account_mapping<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.user_service_account_mapping =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for IdentityConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.IdentityConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SoftwareConfig {
pub image_version: std::string::String,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub optional_components: std::vec::Vec<crate::model::Component>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SoftwareConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_image_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_version = v.into();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_optional_components<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Component>,
{
use std::iter::Iterator;
self.optional_components = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SoftwareConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SoftwareConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LifecycleConfig {
pub idle_delete_ttl: std::option::Option<wkt::Duration>,
pub idle_start_time: std::option::Option<wkt::Timestamp>,
pub ttl: std::option::Option<crate::model::lifecycle_config::Ttl>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LifecycleConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_idle_delete_ttl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.idle_delete_ttl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_idle_delete_ttl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.idle_delete_ttl = v.map(|x| x.into());
self
}
pub fn set_idle_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.idle_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_idle_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.idle_start_time = v.map(|x| x.into());
self
}
pub fn set_ttl<
T: std::convert::Into<std::option::Option<crate::model::lifecycle_config::Ttl>>,
>(
mut self,
v: T,
) -> Self {
self.ttl = v.into();
self
}
pub fn auto_delete_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.ttl.as_ref().and_then(|v| match v {
crate::model::lifecycle_config::Ttl::AutoDeleteTime(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_auto_delete_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.ttl = std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTime(
v.into(),
));
self
}
pub fn auto_delete_ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.ttl.as_ref().and_then(|v| match v {
crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_auto_delete_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
mut self,
v: T,
) -> Self {
self.ttl =
std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v.into()));
self
}
}
impl wkt::message::Message for LifecycleConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.LifecycleConfig"
}
}
pub mod lifecycle_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Ttl {
AutoDeleteTime(std::boxed::Box<wkt::Timestamp>),
AutoDeleteTtl(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetastoreConfig {
pub dataproc_metastore_service: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MetastoreConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dataproc_metastore_service<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.dataproc_metastore_service = v.into();
self
}
}
impl wkt::message::Message for MetastoreConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.MetastoreConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterMetrics {
pub hdfs_metrics: std::collections::HashMap<std::string::String, i64>,
pub yarn_metrics: std::collections::HashMap<std::string::String, i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterMetrics {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hdfs_metrics<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.hdfs_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_yarn_metrics<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.yarn_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for ClusterMetrics {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterMetrics"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataprocMetricConfig {
pub metrics: std::vec::Vec<crate::model::dataproc_metric_config::Metric>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataprocMetricConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metrics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::dataproc_metric_config::Metric>,
{
use std::iter::Iterator;
self.metrics = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataprocMetricConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig"
}
}
pub mod dataproc_metric_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Metric {
pub metric_source: crate::model::dataproc_metric_config::MetricSource,
pub metric_overrides: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Metric {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metric_source<
T: std::convert::Into<crate::model::dataproc_metric_config::MetricSource>,
>(
mut self,
v: T,
) -> Self {
self.metric_source = v.into();
self
}
pub fn set_metric_overrides<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.metric_overrides = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Metric {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig.Metric"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MetricSource {
Unspecified,
MonitoringAgentDefaults,
Hdfs,
Spark,
Yarn,
SparkHistoryServer,
Hiveserver2,
Hivemetastore,
Flink,
UnknownValue(metric_source::UnknownValue),
}
#[doc(hidden)]
pub mod metric_source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MetricSource {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::MonitoringAgentDefaults => std::option::Option::Some(1),
Self::Hdfs => std::option::Option::Some(2),
Self::Spark => std::option::Option::Some(3),
Self::Yarn => std::option::Option::Some(4),
Self::SparkHistoryServer => std::option::Option::Some(5),
Self::Hiveserver2 => std::option::Option::Some(6),
Self::Hivemetastore => std::option::Option::Some(7),
Self::Flink => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("METRIC_SOURCE_UNSPECIFIED"),
Self::MonitoringAgentDefaults => {
std::option::Option::Some("MONITORING_AGENT_DEFAULTS")
}
Self::Hdfs => std::option::Option::Some("HDFS"),
Self::Spark => std::option::Option::Some("SPARK"),
Self::Yarn => std::option::Option::Some("YARN"),
Self::SparkHistoryServer => std::option::Option::Some("SPARK_HISTORY_SERVER"),
Self::Hiveserver2 => std::option::Option::Some("HIVESERVER2"),
Self::Hivemetastore => std::option::Option::Some("HIVEMETASTORE"),
Self::Flink => std::option::Option::Some("FLINK"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MetricSource {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MetricSource {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MetricSource {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::MonitoringAgentDefaults,
2 => Self::Hdfs,
3 => Self::Spark,
4 => Self::Yarn,
5 => Self::SparkHistoryServer,
6 => Self::Hiveserver2,
7 => Self::Hivemetastore,
8 => Self::Flink,
_ => Self::UnknownValue(metric_source::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MetricSource {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"METRIC_SOURCE_UNSPECIFIED" => Self::Unspecified,
"MONITORING_AGENT_DEFAULTS" => Self::MonitoringAgentDefaults,
"HDFS" => Self::Hdfs,
"SPARK" => Self::Spark,
"YARN" => Self::Yarn,
"SPARK_HISTORY_SERVER" => Self::SparkHistoryServer,
"HIVESERVER2" => Self::Hiveserver2,
"HIVEMETASTORE" => Self::Hivemetastore,
"FLINK" => Self::Flink,
_ => Self::UnknownValue(metric_source::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MetricSource {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::MonitoringAgentDefaults => serializer.serialize_i32(1),
Self::Hdfs => serializer.serialize_i32(2),
Self::Spark => serializer.serialize_i32(3),
Self::Yarn => serializer.serialize_i32(4),
Self::SparkHistoryServer => serializer.serialize_i32(5),
Self::Hiveserver2 => serializer.serialize_i32(6),
Self::Hivemetastore => serializer.serialize_i32(7),
Self::Flink => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MetricSource {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetricSource>::new(
".google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster: std::option::Option<crate::model::Cluster>,
pub request_id: std::string::String,
pub action_on_failed_primary_workers: crate::model::FailureAction,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_action_on_failed_primary_workers<
T: std::convert::Into<crate::model::FailureAction>,
>(
mut self,
v: T,
) -> Self {
self.action_on_failed_primary_workers = v.into();
self
}
}
impl wkt::message::Message for CreateClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster_name: std::string::String,
pub cluster: std::option::Option<crate::model::Cluster>,
pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cluster>,
{
self.cluster = v.map(|x| x.into());
self
}
pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.graceful_decommission_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_graceful_decommission_timeout<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.graceful_decommission_timeout = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UpdateClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StopClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster_name: std::string::String,
pub cluster_uuid: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StopClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for StopClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.StopClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster_name: std::string::String,
pub cluster_uuid: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for StartClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.StartClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster_name: std::string::String,
pub cluster_uuid: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
}
impl wkt::message::Message for GetClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClustersRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub filter: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListClustersRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListClustersRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListClustersRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClustersResponse {
pub clusters: std::vec::Vec<crate::model::Cluster>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListClustersResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_clusters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Cluster>,
{
use std::iter::Iterator;
self.clusters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListClustersResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListClustersResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListClustersResponse {
type PageItem = crate::model::Cluster;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.clusters
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseClusterRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub cluster_name: std::string::String,
pub tarball_gcs_dir: std::string::String,
pub tarball_access: crate::model::diagnose_cluster_request::TarballAccess,
pub diagnosis_interval: std::option::Option<google_cloud_type::model::Interval>,
pub jobs: std::vec::Vec<std::string::String>,
pub yarn_application_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiagnoseClusterRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_tarball_gcs_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tarball_gcs_dir = v.into();
self
}
pub fn set_tarball_access<
T: std::convert::Into<crate::model::diagnose_cluster_request::TarballAccess>,
>(
mut self,
v: T,
) -> Self {
self.tarball_access = v.into();
self
}
pub fn set_diagnosis_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.diagnosis_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_diagnosis_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.diagnosis_interval = v.map(|x| x.into());
self
}
pub fn set_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_yarn_application_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.yarn_application_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DiagnoseClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterRequest"
}
}
pub mod diagnose_cluster_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TarballAccess {
Unspecified,
GoogleCloudSupport,
GoogleDataprocDiagnose,
UnknownValue(tarball_access::UnknownValue),
}
#[doc(hidden)]
pub mod tarball_access {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TarballAccess {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GoogleCloudSupport => std::option::Option::Some(1),
Self::GoogleDataprocDiagnose => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TARBALL_ACCESS_UNSPECIFIED"),
Self::GoogleCloudSupport => std::option::Option::Some("GOOGLE_CLOUD_SUPPORT"),
Self::GoogleDataprocDiagnose => {
std::option::Option::Some("GOOGLE_DATAPROC_DIAGNOSE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TarballAccess {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TarballAccess {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TarballAccess {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GoogleCloudSupport,
2 => Self::GoogleDataprocDiagnose,
_ => Self::UnknownValue(tarball_access::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TarballAccess {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TARBALL_ACCESS_UNSPECIFIED" => Self::Unspecified,
"GOOGLE_CLOUD_SUPPORT" => Self::GoogleCloudSupport,
"GOOGLE_DATAPROC_DIAGNOSE" => Self::GoogleDataprocDiagnose,
_ => Self::UnknownValue(tarball_access::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TarballAccess {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GoogleCloudSupport => serializer.serialize_i32(1),
Self::GoogleDataprocDiagnose => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TarballAccess {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TarballAccess>::new(
".google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseClusterResults {
pub output_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiagnoseClusterResults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_uri = v.into();
self
}
}
impl wkt::message::Message for DiagnoseClusterResults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterResults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReservationAffinity {
pub consume_reservation_type: crate::model::reservation_affinity::Type,
pub key: std::string::String,
pub values: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReservationAffinity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_consume_reservation_type<
T: std::convert::Into<crate::model::reservation_affinity::Type>,
>(
mut self,
v: T,
) -> Self {
self.consume_reservation_type = v.into();
self
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReservationAffinity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ReservationAffinity"
}
}
pub mod reservation_affinity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
NoReservation,
AnyReservation,
SpecificReservation,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NoReservation => std::option::Option::Some(1),
Self::AnyReservation => std::option::Option::Some(2),
Self::SpecificReservation => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::NoReservation => std::option::Option::Some("NO_RESERVATION"),
Self::AnyReservation => std::option::Option::Some("ANY_RESERVATION"),
Self::SpecificReservation => std::option::Option::Some("SPECIFIC_RESERVATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NoReservation,
2 => Self::AnyReservation,
3 => Self::SpecificReservation,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"NO_RESERVATION" => Self::NoReservation,
"ANY_RESERVATION" => Self::AnyReservation,
"SPECIFIC_RESERVATION" => Self::SpecificReservation,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NoReservation => serializer.serialize_i32(1),
Self::AnyReservation => serializer.serialize_i32(2),
Self::SpecificReservation => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.dataproc.v1.ReservationAffinity.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LoggingConfig {
pub driver_log_levels:
std::collections::HashMap<std::string::String, crate::model::logging_config::Level>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LoggingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_driver_log_levels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::logging_config::Level>,
{
use std::iter::Iterator;
self.driver_log_levels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for LoggingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.LoggingConfig"
}
}
pub mod logging_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Level {
Unspecified,
All,
Trace,
Debug,
Info,
Warn,
Error,
Fatal,
Off,
UnknownValue(level::UnknownValue),
}
#[doc(hidden)]
pub mod level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Level {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::All => std::option::Option::Some(1),
Self::Trace => std::option::Option::Some(2),
Self::Debug => std::option::Option::Some(3),
Self::Info => std::option::Option::Some(4),
Self::Warn => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
Self::Fatal => std::option::Option::Some(7),
Self::Off => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
Self::All => std::option::Option::Some("ALL"),
Self::Trace => std::option::Option::Some("TRACE"),
Self::Debug => std::option::Option::Some("DEBUG"),
Self::Info => std::option::Option::Some("INFO"),
Self::Warn => std::option::Option::Some("WARN"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Fatal => std::option::Option::Some("FATAL"),
Self::Off => std::option::Option::Some("OFF"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Level {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Level {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Level {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::All,
2 => Self::Trace,
3 => Self::Debug,
4 => Self::Info,
5 => Self::Warn,
6 => Self::Error,
7 => Self::Fatal,
8 => Self::Off,
_ => Self::UnknownValue(level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Level {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LEVEL_UNSPECIFIED" => Self::Unspecified,
"ALL" => Self::All,
"TRACE" => Self::Trace,
"DEBUG" => Self::Debug,
"INFO" => Self::Info,
"WARN" => Self::Warn,
"ERROR" => Self::Error,
"FATAL" => Self::Fatal,
"OFF" => Self::Off,
_ => Self::UnknownValue(level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Level {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::All => serializer.serialize_i32(1),
Self::Trace => serializer.serialize_i32(2),
Self::Debug => serializer.serialize_i32(3),
Self::Info => serializer.serialize_i32(4),
Self::Warn => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
Self::Fatal => serializer.serialize_i32(7),
Self::Off => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Level {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
".google.cloud.dataproc.v1.LoggingConfig.Level",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HadoopJob {
pub args: std::vec::Vec<std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub driver: std::option::Option<crate::model::hadoop_job::Driver>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HadoopJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_driver<
T: std::convert::Into<std::option::Option<crate::model::hadoop_job::Driver>>,
>(
mut self,
v: T,
) -> Self {
self.driver = v.into();
self
}
pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::hadoop_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver =
std::option::Option::Some(crate::model::hadoop_job::Driver::MainJarFileUri(v.into()));
self
}
pub fn main_class(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::hadoop_job::Driver::MainClass(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.driver =
std::option::Option::Some(crate::model::hadoop_job::Driver::MainClass(v.into()));
self
}
}
impl wkt::message::Message for HadoopJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.HadoopJob"
}
}
pub mod hadoop_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Driver {
MainJarFileUri(std::string::String),
MainClass(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkJob {
pub args: std::vec::Vec<std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub driver: std::option::Option<crate::model::spark_job::Driver>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_driver<
T: std::convert::Into<std::option::Option<crate::model::spark_job::Driver>>,
>(
mut self,
v: T,
) -> Self {
self.driver = v.into();
self
}
pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::spark_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver =
std::option::Option::Some(crate::model::spark_job::Driver::MainJarFileUri(v.into()));
self
}
pub fn main_class(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::spark_job::Driver::MainClass(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.driver =
std::option::Option::Some(crate::model::spark_job::Driver::MainClass(v.into()));
self
}
}
impl wkt::message::Message for SparkJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkJob"
}
}
pub mod spark_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Driver {
MainJarFileUri(std::string::String),
MainClass(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PySparkJob {
pub main_python_file_uri: std::string::String,
pub args: std::vec::Vec<std::string::String>,
pub python_file_uris: std::vec::Vec<std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PySparkJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.main_python_file_uri = v.into();
self
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PySparkJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.PySparkJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryList {
pub queries: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_queries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.queries = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for QueryList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.QueryList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HiveJob {
pub continue_on_failure: bool,
pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub queries: std::option::Option<crate::model::hive_job::Queries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HiveJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.continue_on_failure = v.into();
self
}
pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_queries<
T: std::convert::Into<std::option::Option<crate::model::hive_job::Queries>>,
>(
mut self,
v: T,
) -> Self {
self.queries = v.into();
self
}
pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::hive_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.queries =
std::option::Option::Some(crate::model::hive_job::Queries::QueryFileUri(v.into()));
self
}
pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::hive_job::Queries::QueryList(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
mut self,
v: T,
) -> Self {
self.queries =
std::option::Option::Some(crate::model::hive_job::Queries::QueryList(v.into()));
self
}
}
impl wkt::message::Message for HiveJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.HiveJob"
}
}
pub mod hive_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Queries {
QueryFileUri(std::string::String),
QueryList(std::boxed::Box<crate::model::QueryList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkSqlJob {
pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub queries: std::option::Option<crate::model::spark_sql_job::Queries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkSqlJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_queries<
T: std::convert::Into<std::option::Option<crate::model::spark_sql_job::Queries>>,
>(
mut self,
v: T,
) -> Self {
self.queries = v.into();
self
}
pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::spark_sql_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.queries =
std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryFileUri(v.into()));
self
}
pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::spark_sql_job::Queries::QueryList(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
mut self,
v: T,
) -> Self {
self.queries =
std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryList(v.into()));
self
}
}
impl wkt::message::Message for SparkSqlJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkSqlJob"
}
}
pub mod spark_sql_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Queries {
QueryFileUri(std::string::String),
QueryList(std::boxed::Box<crate::model::QueryList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PigJob {
pub continue_on_failure: bool,
pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub queries: std::option::Option<crate::model::pig_job::Queries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PigJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.continue_on_failure = v.into();
self
}
pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_queries<
T: std::convert::Into<std::option::Option<crate::model::pig_job::Queries>>,
>(
mut self,
v: T,
) -> Self {
self.queries = v.into();
self
}
pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::pig_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.queries =
std::option::Option::Some(crate::model::pig_job::Queries::QueryFileUri(v.into()));
self
}
pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::pig_job::Queries::QueryList(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
mut self,
v: T,
) -> Self {
self.queries =
std::option::Option::Some(crate::model::pig_job::Queries::QueryList(v.into()));
self
}
}
impl wkt::message::Message for PigJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.PigJob"
}
}
pub mod pig_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Queries {
QueryFileUri(std::string::String),
QueryList(std::boxed::Box<crate::model::QueryList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkRJob {
pub main_r_file_uri: std::string::String,
pub args: std::vec::Vec<std::string::String>,
pub file_uris: std::vec::Vec<std::string::String>,
pub archive_uris: std::vec::Vec<std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkRJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.main_r_file_uri = v.into();
self
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.archive_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SparkRJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkRJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PrestoJob {
pub continue_on_failure: bool,
pub output_format: std::string::String,
pub client_tags: std::vec::Vec<std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub queries: std::option::Option<crate::model::presto_job::Queries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PrestoJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.continue_on_failure = v.into();
self
}
pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_format = v.into();
self
}
pub fn set_client_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.client_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_queries<
T: std::convert::Into<std::option::Option<crate::model::presto_job::Queries>>,
>(
mut self,
v: T,
) -> Self {
self.queries = v.into();
self
}
pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::presto_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.queries =
std::option::Option::Some(crate::model::presto_job::Queries::QueryFileUri(v.into()));
self
}
pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::presto_job::Queries::QueryList(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
mut self,
v: T,
) -> Self {
self.queries =
std::option::Option::Some(crate::model::presto_job::Queries::QueryList(v.into()));
self
}
}
impl wkt::message::Message for PrestoJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.PrestoJob"
}
}
pub mod presto_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Queries {
QueryFileUri(std::string::String),
QueryList(std::boxed::Box<crate::model::QueryList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TrinoJob {
pub continue_on_failure: bool,
pub output_format: std::string::String,
pub client_tags: std::vec::Vec<std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub queries: std::option::Option<crate::model::trino_job::Queries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TrinoJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.continue_on_failure = v.into();
self
}
pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_format = v.into();
self
}
pub fn set_client_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.client_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_queries<
T: std::convert::Into<std::option::Option<crate::model::trino_job::Queries>>,
>(
mut self,
v: T,
) -> Self {
self.queries = v.into();
self
}
pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::trino_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.queries =
std::option::Option::Some(crate::model::trino_job::Queries::QueryFileUri(v.into()));
self
}
pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
#[allow(unreachable_patterns)]
self.queries.as_ref().and_then(|v| match v {
crate::model::trino_job::Queries::QueryList(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
mut self,
v: T,
) -> Self {
self.queries =
std::option::Option::Some(crate::model::trino_job::Queries::QueryList(v.into()));
self
}
}
impl wkt::message::Message for TrinoJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.TrinoJob"
}
}
pub mod trino_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Queries {
QueryFileUri(std::string::String),
QueryList(std::boxed::Box<crate::model::QueryList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FlinkJob {
pub args: std::vec::Vec<std::string::String>,
pub jar_file_uris: std::vec::Vec<std::string::String>,
pub savepoint_uri: std::string::String,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub logging_config: std::option::Option<crate::model::LoggingConfig>,
pub driver: std::option::Option<crate::model::flink_job::Driver>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FlinkJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_savepoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.savepoint_uri = v.into();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LoggingConfig>,
{
self.logging_config = v.map(|x| x.into());
self
}
pub fn set_driver<
T: std::convert::Into<std::option::Option<crate::model::flink_job::Driver>>,
>(
mut self,
v: T,
) -> Self {
self.driver = v.into();
self
}
pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::flink_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver =
std::option::Option::Some(crate::model::flink_job::Driver::MainJarFileUri(v.into()));
self
}
pub fn main_class(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.driver.as_ref().and_then(|v| match v {
crate::model::flink_job::Driver::MainClass(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.driver =
std::option::Option::Some(crate::model::flink_job::Driver::MainClass(v.into()));
self
}
}
impl wkt::message::Message for FlinkJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.FlinkJob"
}
}
pub mod flink_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Driver {
MainJarFileUri(std::string::String),
MainClass(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobPlacement {
pub cluster_name: std::string::String,
pub cluster_uuid: std::string::String,
pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobPlacement {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for JobPlacement {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.JobPlacement"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobStatus {
pub state: crate::model::job_status::State,
pub details: std::string::String,
pub state_start_time: std::option::Option<wkt::Timestamp>,
pub substate: crate::model::job_status::Substate,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::job_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.details = v.into();
self
}
pub fn set_state_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = v.map(|x| x.into());
self
}
pub fn set_substate<T: std::convert::Into<crate::model::job_status::Substate>>(
mut self,
v: T,
) -> Self {
self.substate = v.into();
self
}
}
impl wkt::message::Message for JobStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.JobStatus"
}
}
pub mod job_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
SetupDone,
Running,
CancelPending,
CancelStarted,
Cancelled,
Done,
Error,
AttemptFailure,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::SetupDone => std::option::Option::Some(8),
Self::Running => std::option::Option::Some(2),
Self::CancelPending => std::option::Option::Some(3),
Self::CancelStarted => std::option::Option::Some(7),
Self::Cancelled => std::option::Option::Some(4),
Self::Done => std::option::Option::Some(5),
Self::Error => std::option::Option::Some(6),
Self::AttemptFailure => std::option::Option::Some(9),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::SetupDone => std::option::Option::Some("SETUP_DONE"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::CancelPending => std::option::Option::Some("CANCEL_PENDING"),
Self::CancelStarted => std::option::Option::Some("CANCEL_STARTED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Done => std::option::Option::Some("DONE"),
Self::Error => std::option::Option::Some("ERROR"),
Self::AttemptFailure => std::option::Option::Some("ATTEMPT_FAILURE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::CancelPending,
4 => Self::Cancelled,
5 => Self::Done,
6 => Self::Error,
7 => Self::CancelStarted,
8 => Self::SetupDone,
9 => Self::AttemptFailure,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"SETUP_DONE" => Self::SetupDone,
"RUNNING" => Self::Running,
"CANCEL_PENDING" => Self::CancelPending,
"CANCEL_STARTED" => Self::CancelStarted,
"CANCELLED" => Self::Cancelled,
"DONE" => Self::Done,
"ERROR" => Self::Error,
"ATTEMPT_FAILURE" => Self::AttemptFailure,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::SetupDone => serializer.serialize_i32(8),
Self::Running => serializer.serialize_i32(2),
Self::CancelPending => serializer.serialize_i32(3),
Self::CancelStarted => serializer.serialize_i32(7),
Self::Cancelled => serializer.serialize_i32(4),
Self::Done => serializer.serialize_i32(5),
Self::Error => serializer.serialize_i32(6),
Self::AttemptFailure => serializer.serialize_i32(9),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.JobStatus.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Substate {
Unspecified,
Submitted,
Queued,
StaleStatus,
UnknownValue(substate::UnknownValue),
}
#[doc(hidden)]
pub mod substate {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Substate {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Submitted => std::option::Option::Some(1),
Self::Queued => std::option::Option::Some(2),
Self::StaleStatus => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
Self::Submitted => std::option::Option::Some("SUBMITTED"),
Self::Queued => std::option::Option::Some("QUEUED"),
Self::StaleStatus => std::option::Option::Some("STALE_STATUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Substate {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Substate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Substate {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Submitted,
2 => Self::Queued,
3 => Self::StaleStatus,
_ => Self::UnknownValue(substate::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Substate {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNSPECIFIED" => Self::Unspecified,
"SUBMITTED" => Self::Submitted,
"QUEUED" => Self::Queued,
"STALE_STATUS" => Self::StaleStatus,
_ => Self::UnknownValue(substate::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Substate {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Submitted => serializer.serialize_i32(1),
Self::Queued => serializer.serialize_i32(2),
Self::StaleStatus => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Substate {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Substate>::new(
".google.cloud.dataproc.v1.JobStatus.Substate",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobReference {
pub project_id: std::string::String,
pub job_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
}
impl wkt::message::Message for JobReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.JobReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct YarnApplication {
pub name: std::string::String,
pub state: crate::model::yarn_application::State,
pub progress: f32,
pub tracking_url: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl YarnApplication {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::yarn_application::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_progress<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.progress = v.into();
self
}
pub fn set_tracking_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tracking_url = v.into();
self
}
}
impl wkt::message::Message for YarnApplication {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.YarnApplication"
}
}
pub mod yarn_application {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
New,
NewSaving,
Submitted,
Accepted,
Running,
Finished,
Failed,
Killed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::New => std::option::Option::Some(1),
Self::NewSaving => std::option::Option::Some(2),
Self::Submitted => std::option::Option::Some(3),
Self::Accepted => std::option::Option::Some(4),
Self::Running => std::option::Option::Some(5),
Self::Finished => std::option::Option::Some(6),
Self::Failed => std::option::Option::Some(7),
Self::Killed => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::New => std::option::Option::Some("NEW"),
Self::NewSaving => std::option::Option::Some("NEW_SAVING"),
Self::Submitted => std::option::Option::Some("SUBMITTED"),
Self::Accepted => std::option::Option::Some("ACCEPTED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Finished => std::option::Option::Some("FINISHED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Killed => std::option::Option::Some("KILLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::New,
2 => Self::NewSaving,
3 => Self::Submitted,
4 => Self::Accepted,
5 => Self::Running,
6 => Self::Finished,
7 => Self::Failed,
8 => Self::Killed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"NEW" => Self::New,
"NEW_SAVING" => Self::NewSaving,
"SUBMITTED" => Self::Submitted,
"ACCEPTED" => Self::Accepted,
"RUNNING" => Self::Running,
"FINISHED" => Self::Finished,
"FAILED" => Self::Failed,
"KILLED" => Self::Killed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::New => serializer.serialize_i32(1),
Self::NewSaving => serializer.serialize_i32(2),
Self::Submitted => serializer.serialize_i32(3),
Self::Accepted => serializer.serialize_i32(4),
Self::Running => serializer.serialize_i32(5),
Self::Finished => serializer.serialize_i32(6),
Self::Failed => serializer.serialize_i32(7),
Self::Killed => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.YarnApplication.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Job {
pub reference: std::option::Option<crate::model::JobReference>,
pub placement: std::option::Option<crate::model::JobPlacement>,
pub status: std::option::Option<crate::model::JobStatus>,
pub status_history: std::vec::Vec<crate::model::JobStatus>,
pub yarn_applications: std::vec::Vec<crate::model::YarnApplication>,
pub driver_output_resource_uri: std::string::String,
pub driver_control_files_uri: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub scheduling: std::option::Option<crate::model::JobScheduling>,
pub job_uuid: std::string::String,
pub done: bool,
pub driver_scheduling_config: std::option::Option<crate::model::DriverSchedulingConfig>,
pub type_job: std::option::Option<crate::model::job::TypeJob>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Job {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reference<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JobReference>,
{
self.reference = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reference<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JobReference>,
{
self.reference = v.map(|x| x.into());
self
}
pub fn set_placement<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JobPlacement>,
{
self.placement = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_placement<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JobPlacement>,
{
self.placement = v.map(|x| x.into());
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JobStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JobStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_status_history<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::JobStatus>,
{
use std::iter::Iterator;
self.status_history = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_yarn_applications<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::YarnApplication>,
{
use std::iter::Iterator;
self.yarn_applications = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_driver_output_resource_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver_output_resource_uri = v.into();
self
}
pub fn set_driver_control_files_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.driver_control_files_uri = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_scheduling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JobScheduling>,
{
self.scheduling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JobScheduling>,
{
self.scheduling = v.map(|x| x.into());
self
}
pub fn set_job_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_uuid = v.into();
self
}
pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.done = v.into();
self
}
pub fn set_driver_scheduling_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DriverSchedulingConfig>,
{
self.driver_scheduling_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_driver_scheduling_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DriverSchedulingConfig>,
{
self.driver_scheduling_config = v.map(|x| x.into());
self
}
pub fn set_type_job<T: std::convert::Into<std::option::Option<crate::model::job::TypeJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = v.into();
self
}
pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::HadoopJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HadoopJob(v.into()));
self
}
pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::SparkJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkJob(v.into()));
self
}
pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::PysparkJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PysparkJob(v.into()));
self
}
pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::HiveJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HiveJob(v.into()));
self
}
pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::PigJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PigJob(v.into()));
self
}
pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::SparkRJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkRJob(v.into()));
self
}
pub fn spark_sql_job(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::SparkSqlJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
mut self,
v: T,
) -> Self {
self.type_job =
std::option::Option::Some(crate::model::job::TypeJob::SparkSqlJob(v.into()));
self
}
pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::PrestoJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PrestoJob(v.into()));
self
}
pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::TrinoJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::TrinoJob(v.into()));
self
}
pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
#[allow(unreachable_patterns)]
self.type_job.as_ref().and_then(|v| match v {
crate::model::job::TypeJob::FlinkJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
mut self,
v: T,
) -> Self {
self.type_job = std::option::Option::Some(crate::model::job::TypeJob::FlinkJob(v.into()));
self
}
}
impl wkt::message::Message for Job {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.Job"
}
}
pub mod job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TypeJob {
HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
SparkJob(std::boxed::Box<crate::model::SparkJob>),
PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
HiveJob(std::boxed::Box<crate::model::HiveJob>),
PigJob(std::boxed::Box<crate::model::PigJob>),
SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DriverSchedulingConfig {
pub memory_mb: i32,
pub vcores: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DriverSchedulingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.memory_mb = v.into();
self
}
pub fn set_vcores<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.vcores = v.into();
self
}
}
impl wkt::message::Message for DriverSchedulingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DriverSchedulingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobScheduling {
pub max_failures_per_hour: i32,
pub max_failures_total: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobScheduling {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_max_failures_per_hour<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_failures_per_hour = v.into();
self
}
pub fn set_max_failures_total<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_failures_total = v.into();
self
}
}
impl wkt::message::Message for JobScheduling {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.JobScheduling"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubmitJobRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub job: std::option::Option<crate::model::Job>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubmitJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for SubmitJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SubmitJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobMetadata {
pub job_id: std::string::String,
pub status: std::option::Option<crate::model::JobStatus>,
pub operation_type: std::string::String,
pub start_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JobStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JobStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation_type = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for JobMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.JobMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetJobRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub job_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
}
impl wkt::message::Message for GetJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub cluster_name: std::string::String,
pub job_state_matcher: crate::model::list_jobs_request::JobStateMatcher,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_job_state_matcher<
T: std::convert::Into<crate::model::list_jobs_request::JobStateMatcher>,
>(
mut self,
v: T,
) -> Self {
self.job_state_matcher = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListJobsRequest"
}
}
pub mod list_jobs_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobStateMatcher {
All,
Active,
NonActive,
UnknownValue(job_state_matcher::UnknownValue),
}
#[doc(hidden)]
pub mod job_state_matcher {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl JobStateMatcher {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::All => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::NonActive => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::All => std::option::Option::Some("ALL"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::NonActive => std::option::Option::Some("NON_ACTIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for JobStateMatcher {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for JobStateMatcher {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for JobStateMatcher {
fn from(value: i32) -> Self {
match value {
0 => Self::All,
1 => Self::Active,
2 => Self::NonActive,
_ => Self::UnknownValue(job_state_matcher::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for JobStateMatcher {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ALL" => Self::All,
"ACTIVE" => Self::Active,
"NON_ACTIVE" => Self::NonActive,
_ => Self::UnknownValue(job_state_matcher::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for JobStateMatcher {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::All => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::NonActive => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for JobStateMatcher {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobStateMatcher>::new(
".google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateJobRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub job_id: std::string::String,
pub job: std::option::Option<crate::model::Job>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
pub fn set_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UpdateJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsResponse {
pub jobs: std::vec::Vec<crate::model::Job>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Job>,
{
use std::iter::Iterator;
self.jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListJobsResponse {
type PageItem = crate::model::Job;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.jobs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelJobRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub job_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
}
impl wkt::message::Message for CancelJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CancelJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteJobRequest {
pub project_id: std::string::String,
pub region: std::string::String,
pub job_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
}
impl wkt::message::Message for DeleteJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateNodeGroupRequest {
pub parent: std::string::String,
pub node_group: std::option::Option<crate::model::NodeGroup>,
pub node_group_id: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateNodeGroupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_node_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeGroup>,
{
self.node_group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeGroup>,
{
self.node_group = v.map(|x| x.into());
self
}
pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.node_group_id = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateNodeGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateNodeGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResizeNodeGroupRequest {
pub name: std::string::String,
pub size: i32,
pub request_id: std::string::String,
pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResizeNodeGroupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.size = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.graceful_decommission_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_graceful_decommission_timeout<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.graceful_decommission_timeout = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResizeNodeGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ResizeNodeGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetNodeGroupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetNodeGroupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetNodeGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetNodeGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchOperationMetadata {
pub batch: std::string::String,
pub batch_uuid: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub done_time: std::option::Option<wkt::Timestamp>,
pub operation_type: crate::model::batch_operation_metadata::BatchOperationType,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub warnings: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_batch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.batch = v.into();
self
}
pub fn set_batch_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.batch_uuid = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_done_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.done_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_done_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.done_time = v.map(|x| x.into());
self
}
pub fn set_operation_type<
T: std::convert::Into<crate::model::batch_operation_metadata::BatchOperationType>,
>(
mut self,
v: T,
) -> Self {
self.operation_type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.BatchOperationMetadata"
}
}
pub mod batch_operation_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BatchOperationType {
Unspecified,
Batch,
UnknownValue(batch_operation_type::UnknownValue),
}
#[doc(hidden)]
pub mod batch_operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BatchOperationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Batch => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BATCH_OPERATION_TYPE_UNSPECIFIED"),
Self::Batch => std::option::Option::Some("BATCH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BatchOperationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BatchOperationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for BatchOperationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Batch,
_ => Self::UnknownValue(batch_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BatchOperationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BATCH_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"BATCH" => Self::Batch,
_ => Self::UnknownValue(batch_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BatchOperationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Batch => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BatchOperationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BatchOperationType>::new(
".google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionOperationMetadata {
pub session: std::string::String,
pub session_uuid: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub done_time: std::option::Option<wkt::Timestamp>,
pub operation_type: crate::model::session_operation_metadata::SessionOperationType,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub warnings: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_session<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.session = v.into();
self
}
pub fn set_session_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.session_uuid = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_done_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.done_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_done_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.done_time = v.map(|x| x.into());
self
}
pub fn set_operation_type<
T: std::convert::Into<crate::model::session_operation_metadata::SessionOperationType>,
>(
mut self,
v: T,
) -> Self {
self.operation_type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SessionOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SessionOperationMetadata"
}
}
pub mod session_operation_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SessionOperationType {
Unspecified,
Create,
Terminate,
Delete,
UnknownValue(session_operation_type::UnknownValue),
}
#[doc(hidden)]
pub mod session_operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SessionOperationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Create => std::option::Option::Some(1),
Self::Terminate => std::option::Option::Some(2),
Self::Delete => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("SESSION_OPERATION_TYPE_UNSPECIFIED")
}
Self::Create => std::option::Option::Some("CREATE"),
Self::Terminate => std::option::Option::Some("TERMINATE"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SessionOperationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SessionOperationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SessionOperationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Create,
2 => Self::Terminate,
3 => Self::Delete,
_ => Self::UnknownValue(session_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SessionOperationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SESSION_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"CREATE" => Self::Create,
"TERMINATE" => Self::Terminate,
"DELETE" => Self::Delete,
_ => Self::UnknownValue(session_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SessionOperationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Create => serializer.serialize_i32(1),
Self::Terminate => serializer.serialize_i32(2),
Self::Delete => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SessionOperationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SessionOperationType>::new(
".google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterOperationStatus {
pub state: crate::model::cluster_operation_status::State,
pub inner_state: std::string::String,
pub details: std::string::String,
pub state_start_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterOperationStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::cluster_operation_status::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_inner_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.inner_state = v.into();
self
}
pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.details = v.into();
self
}
pub fn set_state_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ClusterOperationStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationStatus"
}
}
pub mod cluster_operation_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unknown,
Pending,
Running,
Done,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Done => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Done => std::option::Option::Some("DONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Done,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNKNOWN" => Self::Unknown,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"DONE" => Self::Done,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Done => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.ClusterOperationStatus.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterOperationMetadata {
pub cluster_name: std::string::String,
pub cluster_uuid: std::string::String,
pub status: std::option::Option<crate::model::ClusterOperationStatus>,
pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
pub operation_type: std::string::String,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub warnings: std::vec::Vec<std::string::String>,
pub child_operation_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterOperationStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterOperationStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_status_history<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ClusterOperationStatus>,
{
use std::iter::Iterator;
self.status_history = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation_type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_child_operation_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.child_operation_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ClusterOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeGroupOperationMetadata {
pub node_group_id: std::string::String,
pub cluster_uuid: std::string::String,
pub status: std::option::Option<crate::model::ClusterOperationStatus>,
pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
pub operation_type: crate::model::node_group_operation_metadata::NodeGroupOperationType,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub warnings: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeGroupOperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.node_group_id = v.into();
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterOperationStatus>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterOperationStatus>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_status_history<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ClusterOperationStatus>,
{
use std::iter::Iterator;
self.status_history = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_operation_type<
T: std::convert::Into<crate::model::node_group_operation_metadata::NodeGroupOperationType>,
>(
mut self,
v: T,
) -> Self {
self.operation_type = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NodeGroupOperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.NodeGroupOperationMetadata"
}
}
pub mod node_group_operation_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NodeGroupOperationType {
Unspecified,
Create,
Update,
Delete,
Resize,
UnknownValue(node_group_operation_type::UnknownValue),
}
#[doc(hidden)]
pub mod node_group_operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NodeGroupOperationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Create => std::option::Option::Some(1),
Self::Update => std::option::Option::Some(2),
Self::Delete => std::option::Option::Some(3),
Self::Resize => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("NODE_GROUP_OPERATION_TYPE_UNSPECIFIED")
}
Self::Create => std::option::Option::Some("CREATE"),
Self::Update => std::option::Option::Some("UPDATE"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::Resize => std::option::Option::Some("RESIZE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NodeGroupOperationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NodeGroupOperationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NodeGroupOperationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Create,
2 => Self::Update,
3 => Self::Delete,
4 => Self::Resize,
_ => Self::UnknownValue(node_group_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NodeGroupOperationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NODE_GROUP_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"CREATE" => Self::Create,
"UPDATE" => Self::Update,
"DELETE" => Self::Delete,
"RESIZE" => Self::Resize,
_ => Self::UnknownValue(node_group_operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NodeGroupOperationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Create => serializer.serialize_i32(1),
Self::Update => serializer.serialize_i32(2),
Self::Delete => serializer.serialize_i32(3),
Self::Resize => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NodeGroupOperationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeGroupOperationType>::new(
".google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSessionTemplateRequest {
pub parent: std::string::String,
pub session_template: std::option::Option<crate::model::SessionTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSessionTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_session_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SessionTemplate>,
{
self.session_template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_session_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SessionTemplate>,
{
self.session_template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSessionTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateSessionTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSessionTemplateRequest {
pub session_template: std::option::Option<crate::model::SessionTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSessionTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_session_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SessionTemplate>,
{
self.session_template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_session_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SessionTemplate>,
{
self.session_template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSessionTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UpdateSessionTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSessionTemplateRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSessionTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSessionTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetSessionTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSessionTemplatesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSessionTemplatesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListSessionTemplatesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSessionTemplatesResponse {
pub session_templates: std::vec::Vec<crate::model::SessionTemplate>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSessionTemplatesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_session_templates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SessionTemplate>,
{
use std::iter::Iterator;
self.session_templates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSessionTemplatesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSessionTemplatesResponse {
type PageItem = crate::model::SessionTemplate;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.session_templates
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSessionTemplateRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSessionTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteSessionTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionTemplate {
pub name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub uuid: std::string::String,
pub session_config: std::option::Option<crate::model::session_template::SessionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_runtime_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = v.map(|x| x.into());
self
}
pub fn set_environment_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EnvironmentConfig>,
{
self.environment_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EnvironmentConfig>,
{
self.environment_config = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_session_config<
T: std::convert::Into<std::option::Option<crate::model::session_template::SessionConfig>>,
>(
mut self,
v: T,
) -> Self {
self.session_config = v.into();
self
}
pub fn jupyter_session(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
#[allow(unreachable_patterns)]
self.session_config.as_ref().and_then(|v| match v {
crate::model::session_template::SessionConfig::JupyterSession(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_jupyter_session<
T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
>(
mut self,
v: T,
) -> Self {
self.session_config = std::option::Option::Some(
crate::model::session_template::SessionConfig::JupyterSession(v.into()),
);
self
}
pub fn spark_connect_session(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
#[allow(unreachable_patterns)]
self.session_config.as_ref().and_then(|v| match v {
crate::model::session_template::SessionConfig::SparkConnectSession(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_spark_connect_session<
T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
>(
mut self,
v: T,
) -> Self {
self.session_config = std::option::Option::Some(
crate::model::session_template::SessionConfig::SparkConnectSession(v.into()),
);
self
}
}
impl wkt::message::Message for SessionTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SessionTemplate"
}
}
pub mod session_template {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SessionConfig {
JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSessionRequest {
pub parent: std::string::String,
pub session: std::option::Option<crate::model::Session>,
pub session_id: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSessionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_session<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Session>,
{
self.session = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_session<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Session>,
{
self.session = v.map(|x| x.into());
self
}
pub fn set_session_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.session_id = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateSessionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateSessionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSessionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSessionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSessionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetSessionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSessionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSessionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListSessionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListSessionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSessionsResponse {
pub sessions: std::vec::Vec<crate::model::Session>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSessionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sessions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Session>,
{
use std::iter::Iterator;
self.sessions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSessionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListSessionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSessionsResponse {
type PageItem = crate::model::Session;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.sessions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TerminateSessionRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TerminateSessionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for TerminateSessionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.TerminateSessionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSessionRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSessionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteSessionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Session {
pub name: std::string::String,
pub uuid: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
pub state: crate::model::session::State,
pub state_message: std::string::String,
pub state_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
pub user: std::string::String,
pub state_history: std::vec::Vec<crate::model::session::SessionStateHistory>,
pub session_template: std::string::String,
pub session_config: std::option::Option<crate::model::session::SessionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Session {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_runtime_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeInfo>,
{
self.runtime_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeInfo>,
{
self.runtime_info = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::session::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_message = v.into();
self
}
pub fn set_state_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_time = v.map(|x| x.into());
self
}
pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_runtime_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = v.map(|x| x.into());
self
}
pub fn set_environment_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EnvironmentConfig>,
{
self.environment_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EnvironmentConfig>,
{
self.environment_config = v.map(|x| x.into());
self
}
pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user = v.into();
self
}
pub fn set_state_history<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::session::SessionStateHistory>,
{
use std::iter::Iterator;
self.state_history = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_session_template<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.session_template = v.into();
self
}
pub fn set_session_config<
T: std::convert::Into<std::option::Option<crate::model::session::SessionConfig>>,
>(
mut self,
v: T,
) -> Self {
self.session_config = v.into();
self
}
pub fn jupyter_session(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
#[allow(unreachable_patterns)]
self.session_config.as_ref().and_then(|v| match v {
crate::model::session::SessionConfig::JupyterSession(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_jupyter_session<
T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
>(
mut self,
v: T,
) -> Self {
self.session_config = std::option::Option::Some(
crate::model::session::SessionConfig::JupyterSession(v.into()),
);
self
}
pub fn spark_connect_session(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
#[allow(unreachable_patterns)]
self.session_config.as_ref().and_then(|v| match v {
crate::model::session::SessionConfig::SparkConnectSession(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_spark_connect_session<
T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
>(
mut self,
v: T,
) -> Self {
self.session_config = std::option::Option::Some(
crate::model::session::SessionConfig::SparkConnectSession(v.into()),
);
self
}
}
impl wkt::message::Message for Session {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.Session"
}
}
pub mod session {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SessionStateHistory {
pub state: crate::model::session::State,
pub state_message: std::string::String,
pub state_start_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SessionStateHistory {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::session::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.state_message = v.into();
self
}
pub fn set_state_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.state_start_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SessionStateHistory {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.Session.SessionStateHistory"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Active,
Terminating,
Terminated,
Failed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Creating => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Terminating => std::option::Option::Some(3),
Self::Terminated => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Terminating => std::option::Option::Some("TERMINATING"),
Self::Terminated => std::option::Option::Some("TERMINATED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Creating,
2 => Self::Active,
3 => Self::Terminating,
4 => Self::Terminated,
5 => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"CREATING" => Self::Creating,
"ACTIVE" => Self::Active,
"TERMINATING" => Self::Terminating,
"TERMINATED" => Self::Terminated,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Creating => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Terminating => serializer.serialize_i32(3),
Self::Terminated => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.Session.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SessionConfig {
JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JupyterConfig {
pub kernel: crate::model::jupyter_config::Kernel,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JupyterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kernel<T: std::convert::Into<crate::model::jupyter_config::Kernel>>(
mut self,
v: T,
) -> Self {
self.kernel = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for JupyterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.JupyterConfig"
}
}
pub mod jupyter_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Kernel {
Unspecified,
Python,
Scala,
UnknownValue(kernel::UnknownValue),
}
#[doc(hidden)]
pub mod kernel {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Kernel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Python => std::option::Option::Some(1),
Self::Scala => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("KERNEL_UNSPECIFIED"),
Self::Python => std::option::Option::Some("PYTHON"),
Self::Scala => std::option::Option::Some("SCALA"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Kernel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Kernel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Kernel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Python,
2 => Self::Scala,
_ => Self::UnknownValue(kernel::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Kernel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KERNEL_UNSPECIFIED" => Self::Unspecified,
"PYTHON" => Self::Python,
"SCALA" => Self::Scala,
_ => Self::UnknownValue(kernel::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Kernel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Python => serializer.serialize_i32(1),
Self::Scala => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Kernel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kernel>::new(
".google.cloud.dataproc.v1.JupyterConfig.Kernel",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkConnectConfig {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkConnectConfig {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for SparkConnectConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkConnectConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeConfig {
pub version: std::string::String,
pub container_image: std::string::String,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub repository_config: std::option::Option<crate::model::RepositoryConfig>,
pub autotuning_config: std::option::Option<crate::model::AutotuningConfig>,
pub cohort: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_container_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.container_image = v.into();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_repository_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RepositoryConfig>,
{
self.repository_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_repository_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RepositoryConfig>,
{
self.repository_config = v.map(|x| x.into());
self
}
pub fn set_autotuning_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutotuningConfig>,
{
self.autotuning_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_autotuning_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutotuningConfig>,
{
self.autotuning_config = v.map(|x| x.into());
self
}
pub fn set_cohort<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cohort = v.into();
self
}
}
impl wkt::message::Message for RuntimeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.RuntimeConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnvironmentConfig {
pub execution_config: std::option::Option<crate::model::ExecutionConfig>,
pub peripherals_config: std::option::Option<crate::model::PeripheralsConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnvironmentConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_execution_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExecutionConfig>,
{
self.execution_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_execution_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExecutionConfig>,
{
self.execution_config = v.map(|x| x.into());
self
}
pub fn set_peripherals_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PeripheralsConfig>,
{
self.peripherals_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_peripherals_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PeripheralsConfig>,
{
self.peripherals_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EnvironmentConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.EnvironmentConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionConfig {
pub service_account: std::string::String,
pub network_tags: std::vec::Vec<std::string::String>,
pub kms_key: std::string::String,
pub idle_ttl: std::option::Option<wkt::Duration>,
pub ttl: std::option::Option<wkt::Duration>,
pub staging_bucket: std::string::String,
pub authentication_config: std::option::Option<crate::model::AuthenticationConfig>,
pub network: std::option::Option<crate::model::execution_config::Network>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_network_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.network_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
pub fn set_idle_ttl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.idle_ttl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_idle_ttl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.idle_ttl = v.map(|x| x.into());
self
}
pub fn set_ttl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ttl = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.ttl = v.map(|x| x.into());
self
}
pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.staging_bucket = v.into();
self
}
pub fn set_authentication_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuthenticationConfig>,
{
self.authentication_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_authentication_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuthenticationConfig>,
{
self.authentication_config = v.map(|x| x.into());
self
}
pub fn set_network<
T: std::convert::Into<std::option::Option<crate::model::execution_config::Network>>,
>(
mut self,
v: T,
) -> Self {
self.network = v.into();
self
}
pub fn network_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.network.as_ref().and_then(|v| match v {
crate::model::execution_config::Network::NetworkUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = std::option::Option::Some(
crate::model::execution_config::Network::NetworkUri(v.into()),
);
self
}
pub fn subnetwork_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.network.as_ref().and_then(|v| match v {
crate::model::execution_config::Network::SubnetworkUri(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = std::option::Option::Some(
crate::model::execution_config::Network::SubnetworkUri(v.into()),
);
self
}
}
impl wkt::message::Message for ExecutionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ExecutionConfig"
}
}
pub mod execution_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Network {
NetworkUri(std::string::String),
SubnetworkUri(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SparkHistoryServerConfig {
pub dataproc_cluster: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SparkHistoryServerConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dataproc_cluster<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.dataproc_cluster = v.into();
self
}
}
impl wkt::message::Message for SparkHistoryServerConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.SparkHistoryServerConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PeripheralsConfig {
pub metastore_service: std::string::String,
pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PeripheralsConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metastore_service<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.metastore_service = v.into();
self
}
pub fn set_spark_history_server_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
{
self.spark_history_server_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spark_history_server_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
{
self.spark_history_server_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PeripheralsConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.PeripheralsConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeInfo {
pub endpoints: std::collections::HashMap<std::string::String, std::string::String>,
pub output_uri: std::string::String,
pub diagnostic_output_uri: std::string::String,
pub approximate_usage: std::option::Option<crate::model::UsageMetrics>,
pub current_usage: std::option::Option<crate::model::UsageSnapshot>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_endpoints<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.endpoints = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_uri = v.into();
self
}
pub fn set_diagnostic_output_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.diagnostic_output_uri = v.into();
self
}
pub fn set_approximate_usage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UsageMetrics>,
{
self.approximate_usage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_approximate_usage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UsageMetrics>,
{
self.approximate_usage = v.map(|x| x.into());
self
}
pub fn set_current_usage<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::UsageSnapshot>,
{
self.current_usage = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_current_usage<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::UsageSnapshot>,
{
self.current_usage = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RuntimeInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.RuntimeInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UsageMetrics {
pub milli_dcu_seconds: i64,
pub shuffle_storage_gb_seconds: i64,
pub milli_accelerator_seconds: i64,
pub accelerator_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UsageMetrics {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_milli_dcu_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.milli_dcu_seconds = v.into();
self
}
pub fn set_shuffle_storage_gb_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.shuffle_storage_gb_seconds = v.into();
self
}
pub fn set_milli_accelerator_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.milli_accelerator_seconds = v.into();
self
}
pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.accelerator_type = v.into();
self
}
}
impl wkt::message::Message for UsageMetrics {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UsageMetrics"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UsageSnapshot {
pub milli_dcu: i64,
pub shuffle_storage_gb: i64,
pub milli_dcu_premium: i64,
pub shuffle_storage_gb_premium: i64,
pub milli_accelerator: i64,
pub accelerator_type: std::string::String,
pub snapshot_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UsageSnapshot {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_milli_dcu<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.milli_dcu = v.into();
self
}
pub fn set_shuffle_storage_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.shuffle_storage_gb = v.into();
self
}
pub fn set_milli_dcu_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.milli_dcu_premium = v.into();
self
}
pub fn set_shuffle_storage_gb_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.shuffle_storage_gb_premium = v.into();
self
}
pub fn set_milli_accelerator<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.milli_accelerator = v.into();
self
}
pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.accelerator_type = v.into();
self
}
pub fn set_snapshot_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.snapshot_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UsageSnapshot {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UsageSnapshot"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeClusterConfig {
pub gke_cluster_target: std::string::String,
pub node_pool_target: std::vec::Vec<crate::model::GkeNodePoolTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeClusterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gke_cluster_target<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.gke_cluster_target = v.into();
self
}
pub fn set_node_pool_target<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GkeNodePoolTarget>,
{
use std::iter::Iterator;
self.node_pool_target = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GkeClusterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GkeClusterConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KubernetesClusterConfig {
pub kubernetes_namespace: std::string::String,
pub kubernetes_software_config: std::option::Option<crate::model::KubernetesSoftwareConfig>,
pub config: std::option::Option<crate::model::kubernetes_cluster_config::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KubernetesClusterConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kubernetes_namespace<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.kubernetes_namespace = v.into();
self
}
pub fn set_kubernetes_software_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KubernetesSoftwareConfig>,
{
self.kubernetes_software_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kubernetes_software_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KubernetesSoftwareConfig>,
{
self.kubernetes_software_config = v.map(|x| x.into());
self
}
pub fn set_config<
T: std::convert::Into<std::option::Option<crate::model::kubernetes_cluster_config::Config>>,
>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
pub fn gke_cluster_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GkeClusterConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_gke_cluster_config<
T: std::convert::Into<std::boxed::Box<crate::model::GkeClusterConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v.into()),
);
self
}
}
impl wkt::message::Message for KubernetesClusterConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.KubernetesClusterConfig"
}
}
pub mod kubernetes_cluster_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
GkeClusterConfig(std::boxed::Box<crate::model::GkeClusterConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KubernetesSoftwareConfig {
pub component_version: std::collections::HashMap<std::string::String, std::string::String>,
pub properties: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KubernetesSoftwareConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_component_version<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.component_version = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for KubernetesSoftwareConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.KubernetesSoftwareConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeNodePoolTarget {
pub node_pool: std::string::String,
pub roles: std::vec::Vec<crate::model::gke_node_pool_target::Role>,
pub node_pool_config: std::option::Option<crate::model::GkeNodePoolConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeNodePoolTarget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.node_pool = v.into();
self
}
pub fn set_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::gke_node_pool_target::Role>,
{
use std::iter::Iterator;
self.roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_node_pool_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GkeNodePoolConfig>,
{
self.node_pool_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GkeNodePoolConfig>,
{
self.node_pool_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GkeNodePoolTarget {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolTarget"
}
}
pub mod gke_node_pool_target {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Role {
Unspecified,
Default,
Controller,
SparkDriver,
SparkExecutor,
UnknownValue(role::UnknownValue),
}
#[doc(hidden)]
pub mod role {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Role {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::Controller => std::option::Option::Some(2),
Self::SparkDriver => std::option::Option::Some(3),
Self::SparkExecutor => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROLE_UNSPECIFIED"),
Self::Default => std::option::Option::Some("DEFAULT"),
Self::Controller => std::option::Option::Some("CONTROLLER"),
Self::SparkDriver => std::option::Option::Some("SPARK_DRIVER"),
Self::SparkExecutor => std::option::Option::Some("SPARK_EXECUTOR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Role {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Role {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Role {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::Controller,
3 => Self::SparkDriver,
4 => Self::SparkExecutor,
_ => Self::UnknownValue(role::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Role {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROLE_UNSPECIFIED" => Self::Unspecified,
"DEFAULT" => Self::Default,
"CONTROLLER" => Self::Controller,
"SPARK_DRIVER" => Self::SparkDriver,
"SPARK_EXECUTOR" => Self::SparkExecutor,
_ => Self::UnknownValue(role::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Role {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Default => serializer.serialize_i32(1),
Self::Controller => serializer.serialize_i32(2),
Self::SparkDriver => serializer.serialize_i32(3),
Self::SparkExecutor => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Role {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Role>::new(
".google.cloud.dataproc.v1.GkeNodePoolTarget.Role",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeNodePoolConfig {
pub config: std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>,
pub locations: std::vec::Vec<std::string::String>,
pub autoscaling:
std::option::Option<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeNodePoolConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodeConfig>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodeConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.locations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_autoscaling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
{
self.autoscaling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
{
self.autoscaling = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GkeNodePoolConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig"
}
}
pub mod gke_node_pool_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeNodeConfig {
pub machine_type: std::string::String,
pub local_ssd_count: i32,
pub preemptible: bool,
pub accelerators:
std::vec::Vec<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
pub min_cpu_platform: std::string::String,
pub boot_disk_kms_key: std::string::String,
pub spot: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeNodeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_machine_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.machine_type = v.into();
self
}
pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.local_ssd_count = v.into();
self
}
pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.preemptible = v.into();
self
}
pub fn set_accelerators<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
{
use std::iter::Iterator;
self.accelerators = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.min_cpu_platform = v.into();
self
}
pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.boot_disk_kms_key = v.into();
self
}
pub fn set_spot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.spot = v.into();
self
}
}
impl wkt::message::Message for GkeNodeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeNodePoolAcceleratorConfig {
pub accelerator_count: i64,
pub accelerator_type: std::string::String,
pub gpu_partition_size: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeNodePoolAcceleratorConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_accelerator_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.accelerator_count = v.into();
self
}
pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.accelerator_type = v.into();
self
}
pub fn set_gpu_partition_size<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.gpu_partition_size = v.into();
self
}
}
impl wkt::message::Message for GkeNodePoolAcceleratorConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeNodePoolAutoscalingConfig {
pub min_node_count: i32,
pub max_node_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeNodePoolAutoscalingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_node_count = v.into();
self
}
pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_node_count = v.into();
self
}
}
impl wkt::message::Message for GkeNodePoolAutoscalingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthenticationConfig {
pub user_workload_authentication_type: crate::model::authentication_config::AuthenticationType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuthenticationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_user_workload_authentication_type<
T: std::convert::Into<crate::model::authentication_config::AuthenticationType>,
>(
mut self,
v: T,
) -> Self {
self.user_workload_authentication_type = v.into();
self
}
}
impl wkt::message::Message for AuthenticationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AuthenticationConfig"
}
}
pub mod authentication_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthenticationType {
Unspecified,
ServiceAccount,
EndUserCredentials,
UnknownValue(authentication_type::UnknownValue),
}
#[doc(hidden)]
pub mod authentication_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AuthenticationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ServiceAccount => std::option::Option::Some(1),
Self::EndUserCredentials => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("AUTHENTICATION_TYPE_UNSPECIFIED"),
Self::ServiceAccount => std::option::Option::Some("SERVICE_ACCOUNT"),
Self::EndUserCredentials => std::option::Option::Some("END_USER_CREDENTIALS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AuthenticationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AuthenticationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AuthenticationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ServiceAccount,
2 => Self::EndUserCredentials,
_ => Self::UnknownValue(authentication_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AuthenticationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"AUTHENTICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"SERVICE_ACCOUNT" => Self::ServiceAccount,
"END_USER_CREDENTIALS" => Self::EndUserCredentials,
_ => Self::UnknownValue(authentication_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AuthenticationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ServiceAccount => serializer.serialize_i32(1),
Self::EndUserCredentials => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AuthenticationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthenticationType>::new(
".google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutotuningConfig {
pub scenarios: std::vec::Vec<crate::model::autotuning_config::Scenario>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutotuningConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_scenarios<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::autotuning_config::Scenario>,
{
use std::iter::Iterator;
self.scenarios = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AutotuningConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.AutotuningConfig"
}
}
pub mod autotuning_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Scenario {
Unspecified,
Scaling,
BroadcastHashJoin,
Memory,
None,
Auto,
UnknownValue(scenario::UnknownValue),
}
#[doc(hidden)]
pub mod scenario {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Scenario {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Scaling => std::option::Option::Some(2),
Self::BroadcastHashJoin => std::option::Option::Some(3),
Self::Memory => std::option::Option::Some(4),
Self::None => std::option::Option::Some(5),
Self::Auto => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SCENARIO_UNSPECIFIED"),
Self::Scaling => std::option::Option::Some("SCALING"),
Self::BroadcastHashJoin => std::option::Option::Some("BROADCAST_HASH_JOIN"),
Self::Memory => std::option::Option::Some("MEMORY"),
Self::None => std::option::Option::Some("NONE"),
Self::Auto => std::option::Option::Some("AUTO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Scenario {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Scenario {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Scenario {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Scaling,
3 => Self::BroadcastHashJoin,
4 => Self::Memory,
5 => Self::None,
6 => Self::Auto,
_ => Self::UnknownValue(scenario::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Scenario {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SCENARIO_UNSPECIFIED" => Self::Unspecified,
"SCALING" => Self::Scaling,
"BROADCAST_HASH_JOIN" => Self::BroadcastHashJoin,
"MEMORY" => Self::Memory,
"NONE" => Self::None,
"AUTO" => Self::Auto,
_ => Self::UnknownValue(scenario::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Scenario {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Scaling => serializer.serialize_i32(2),
Self::BroadcastHashJoin => serializer.serialize_i32(3),
Self::Memory => serializer.serialize_i32(4),
Self::None => serializer.serialize_i32(5),
Self::Auto => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Scenario {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scenario>::new(
".google.cloud.dataproc.v1.AutotuningConfig.Scenario",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RepositoryConfig {
pub pypi_repository_config: std::option::Option<crate::model::PyPiRepositoryConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RepositoryConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pypi_repository_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PyPiRepositoryConfig>,
{
self.pypi_repository_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pypi_repository_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PyPiRepositoryConfig>,
{
self.pypi_repository_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RepositoryConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.RepositoryConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PyPiRepositoryConfig {
pub pypi_repository: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PyPiRepositoryConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pypi_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pypi_repository = v.into();
self
}
}
impl wkt::message::Message for PyPiRepositoryConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.PyPiRepositoryConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowTemplate {
pub id: std::string::String,
pub name: std::string::String,
pub version: i32,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub placement: std::option::Option<crate::model::WorkflowTemplatePlacement>,
pub jobs: std::vec::Vec<crate::model::OrderedJob>,
pub parameters: std::vec::Vec<crate::model::TemplateParameter>,
pub dag_timeout: std::option::Option<wkt::Duration>,
pub encryption_config: std::option::Option<crate::model::workflow_template::EncryptionConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkflowTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_placement<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplatePlacement>,
{
self.placement = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_placement<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplatePlacement>,
{
self.placement = v.map(|x| x.into());
self
}
pub fn set_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OrderedJob>,
{
use std::iter::Iterator;
self.jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TemplateParameter>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_dag_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.dag_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dag_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.dag_timeout = v.map(|x| x.into());
self
}
pub fn set_encryption_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::workflow_template::EncryptionConfig>,
{
self.encryption_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::workflow_template::EncryptionConfig>,
{
self.encryption_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WorkflowTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate"
}
}
pub mod workflow_template {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
pub kms_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EncryptionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key = v.into();
self
}
}
impl wkt::message::Message for EncryptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowTemplatePlacement {
pub placement: std::option::Option<crate::model::workflow_template_placement::Placement>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkflowTemplatePlacement {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_placement<
T: std::convert::Into<
std::option::Option<crate::model::workflow_template_placement::Placement>,
>,
>(
mut self,
v: T,
) -> Self {
self.placement = v.into();
self
}
pub fn managed_cluster(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ManagedCluster>> {
#[allow(unreachable_patterns)]
self.placement.as_ref().and_then(|v| match v {
crate::model::workflow_template_placement::Placement::ManagedCluster(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_managed_cluster<
T: std::convert::Into<std::boxed::Box<crate::model::ManagedCluster>>,
>(
mut self,
v: T,
) -> Self {
self.placement = std::option::Option::Some(
crate::model::workflow_template_placement::Placement::ManagedCluster(v.into()),
);
self
}
pub fn cluster_selector(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ClusterSelector>> {
#[allow(unreachable_patterns)]
self.placement.as_ref().and_then(|v| match v {
crate::model::workflow_template_placement::Placement::ClusterSelector(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_cluster_selector<
T: std::convert::Into<std::boxed::Box<crate::model::ClusterSelector>>,
>(
mut self,
v: T,
) -> Self {
self.placement = std::option::Option::Some(
crate::model::workflow_template_placement::Placement::ClusterSelector(v.into()),
);
self
}
}
impl wkt::message::Message for WorkflowTemplatePlacement {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplatePlacement"
}
}
pub mod workflow_template_placement {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Placement {
ManagedCluster(std::boxed::Box<crate::model::ManagedCluster>),
ClusterSelector(std::boxed::Box<crate::model::ClusterSelector>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedCluster {
pub cluster_name: std::string::String,
pub config: std::option::Option<crate::model::ClusterConfig>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedCluster {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterConfig>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for ManagedCluster {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ManagedCluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterSelector {
pub zone: std::string::String,
pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterSelector {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for ClusterSelector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterSelector"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OrderedJob {
pub step_id: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub scheduling: std::option::Option<crate::model::JobScheduling>,
pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
pub job_type: std::option::Option<crate::model::ordered_job::JobType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OrderedJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.step_id = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_scheduling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::JobScheduling>,
{
self.scheduling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::JobScheduling>,
{
self.scheduling = v.map(|x| x.into());
self
}
pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_job_type<
T: std::convert::Into<std::option::Option<crate::model::ordered_job::JobType>>,
>(
mut self,
v: T,
) -> Self {
self.job_type = v.into();
self
}
pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::HadoopJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::HadoopJob(v.into()));
self
}
pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::SparkJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::SparkJob(v.into()));
self
}
pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::PysparkJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::PysparkJob(v.into()));
self
}
pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::HiveJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::HiveJob(v.into()));
self
}
pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::PigJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::PigJob(v.into()));
self
}
pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::SparkRJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::SparkRJob(v.into()));
self
}
pub fn spark_sql_job(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::SparkSqlJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::SparkSqlJob(v.into()));
self
}
pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::PrestoJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::PrestoJob(v.into()));
self
}
pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::TrinoJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::TrinoJob(v.into()));
self
}
pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::ordered_job::JobType::FlinkJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::ordered_job::JobType::FlinkJob(v.into()));
self
}
}
impl wkt::message::Message for OrderedJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.OrderedJob"
}
}
pub mod ordered_job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobType {
HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
SparkJob(std::boxed::Box<crate::model::SparkJob>),
PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
HiveJob(std::boxed::Box<crate::model::HiveJob>),
PigJob(std::boxed::Box<crate::model::PigJob>),
SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TemplateParameter {
pub name: std::string::String,
pub fields: std::vec::Vec<std::string::String>,
pub description: std::string::String,
pub validation: std::option::Option<crate::model::ParameterValidation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TemplateParameter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_validation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ParameterValidation>,
{
self.validation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_validation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ParameterValidation>,
{
self.validation = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TemplateParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.TemplateParameter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ParameterValidation {
pub validation_type: std::option::Option<crate::model::parameter_validation::ValidationType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ParameterValidation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_validation_type<
T: std::convert::Into<std::option::Option<crate::model::parameter_validation::ValidationType>>,
>(
mut self,
v: T,
) -> Self {
self.validation_type = v.into();
self
}
pub fn regex(&self) -> std::option::Option<&std::boxed::Box<crate::model::RegexValidation>> {
#[allow(unreachable_patterns)]
self.validation_type.as_ref().and_then(|v| match v {
crate::model::parameter_validation::ValidationType::Regex(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_regex<T: std::convert::Into<std::boxed::Box<crate::model::RegexValidation>>>(
mut self,
v: T,
) -> Self {
self.validation_type = std::option::Option::Some(
crate::model::parameter_validation::ValidationType::Regex(v.into()),
);
self
}
pub fn values(&self) -> std::option::Option<&std::boxed::Box<crate::model::ValueValidation>> {
#[allow(unreachable_patterns)]
self.validation_type.as_ref().and_then(|v| match v {
crate::model::parameter_validation::ValidationType::Values(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_values<T: std::convert::Into<std::boxed::Box<crate::model::ValueValidation>>>(
mut self,
v: T,
) -> Self {
self.validation_type = std::option::Option::Some(
crate::model::parameter_validation::ValidationType::Values(v.into()),
);
self
}
}
impl wkt::message::Message for ParameterValidation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ParameterValidation"
}
}
pub mod parameter_validation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValidationType {
Regex(std::boxed::Box<crate::model::RegexValidation>),
Values(std::boxed::Box<crate::model::ValueValidation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegexValidation {
pub regexes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RegexValidation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_regexes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.regexes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RegexValidation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.RegexValidation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValueValidation {
pub values: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValueValidation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ValueValidation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ValueValidation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowMetadata {
pub template: std::string::String,
pub version: i32,
pub create_cluster: std::option::Option<crate::model::ClusterOperation>,
pub graph: std::option::Option<crate::model::WorkflowGraph>,
pub delete_cluster: std::option::Option<crate::model::ClusterOperation>,
pub state: crate::model::workflow_metadata::State,
pub cluster_name: std::string::String,
pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub cluster_uuid: std::string::String,
pub dag_timeout: std::option::Option<wkt::Duration>,
pub dag_start_time: std::option::Option<wkt::Timestamp>,
pub dag_end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkflowMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.template = v.into();
self
}
pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_create_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterOperation>,
{
self.create_cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterOperation>,
{
self.create_cluster = v.map(|x| x.into());
self
}
pub fn set_graph<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkflowGraph>,
{
self.graph = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_graph<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkflowGraph>,
{
self.graph = v.map(|x| x.into());
self
}
pub fn set_delete_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ClusterOperation>,
{
self.delete_cluster = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_cluster<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ClusterOperation>,
{
self.delete_cluster = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::workflow_metadata::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_name = v.into();
self
}
pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_uuid = v.into();
self
}
pub fn set_dag_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.dag_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dag_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.dag_timeout = v.map(|x| x.into());
self
}
pub fn set_dag_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.dag_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dag_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.dag_start_time = v.map(|x| x.into());
self
}
pub fn set_dag_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.dag_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dag_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.dag_end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WorkflowMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.WorkflowMetadata"
}
}
pub mod workflow_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unknown,
Pending,
Running,
Done,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unknown => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Done => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Done => std::option::Option::Some("DONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unknown,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Done,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNKNOWN" => Self::Unknown,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"DONE" => Self::Done,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unknown => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Done => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.dataproc.v1.WorkflowMetadata.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ClusterOperation {
pub operation_id: std::string::String,
pub error: std::string::String,
pub done: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ClusterOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation_id = v.into();
self
}
pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.error = v.into();
self
}
pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.done = v.into();
self
}
}
impl wkt::message::Message for ClusterOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ClusterOperation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowGraph {
pub nodes: std::vec::Vec<crate::model::WorkflowNode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkflowGraph {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WorkflowNode>,
{
use std::iter::Iterator;
self.nodes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for WorkflowGraph {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.WorkflowGraph"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkflowNode {
pub step_id: std::string::String,
pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
pub job_id: std::string::String,
pub state: crate::model::workflow_node::NodeState,
pub error: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkflowNode {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.step_id = v.into();
self
}
pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::workflow_node::NodeState>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.error = v.into();
self
}
}
impl wkt::message::Message for WorkflowNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.WorkflowNode"
}
}
pub mod workflow_node {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NodeState {
Unspecified,
Blocked,
Runnable,
Running,
Completed,
Failed,
UnknownValue(node_state::UnknownValue),
}
#[doc(hidden)]
pub mod node_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NodeState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Blocked => std::option::Option::Some(1),
Self::Runnable => std::option::Option::Some(2),
Self::Running => std::option::Option::Some(3),
Self::Completed => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("NODE_STATE_UNSPECIFIED"),
Self::Blocked => std::option::Option::Some("BLOCKED"),
Self::Runnable => std::option::Option::Some("RUNNABLE"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Completed => std::option::Option::Some("COMPLETED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NodeState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NodeState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NodeState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Blocked,
2 => Self::Runnable,
3 => Self::Running,
4 => Self::Completed,
5 => Self::Failed,
_ => Self::UnknownValue(node_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NodeState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NODE_STATE_UNSPECIFIED" => Self::Unspecified,
"BLOCKED" => Self::Blocked,
"RUNNABLE" => Self::Runnable,
"RUNNING" => Self::Running,
"COMPLETED" => Self::Completed,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(node_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NodeState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Blocked => serializer.serialize_i32(1),
Self::Runnable => serializer.serialize_i32(2),
Self::Running => serializer.serialize_i32(3),
Self::Completed => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NodeState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeState>::new(
".google.cloud.dataproc.v1.WorkflowNode.NodeState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkflowTemplateRequest {
pub parent: std::string::String,
pub template: std::option::Option<crate::model::WorkflowTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateWorkflowTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplate>,
{
self.template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateWorkflowTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.CreateWorkflowTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkflowTemplateRequest {
pub name: std::string::String,
pub version: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetWorkflowTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for GetWorkflowTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.GetWorkflowTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstantiateWorkflowTemplateRequest {
pub name: std::string::String,
pub version: i32,
pub request_id: std::string::String,
pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstantiateWorkflowTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for InstantiateWorkflowTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstantiateInlineWorkflowTemplateRequest {
pub parent: std::string::String,
pub template: std::option::Option<crate::model::WorkflowTemplate>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstantiateInlineWorkflowTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplate>,
{
self.template = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for InstantiateInlineWorkflowTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWorkflowTemplateRequest {
pub template: std::option::Option<crate::model::WorkflowTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateWorkflowTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkflowTemplate>,
{
self.template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateWorkflowTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowTemplatesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkflowTemplatesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListWorkflowTemplatesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowTemplatesResponse {
pub templates: std::vec::Vec<crate::model::WorkflowTemplate>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkflowTemplatesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_templates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WorkflowTemplate>,
{
use std::iter::Iterator;
self.templates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListWorkflowTemplatesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowTemplatesResponse {
type PageItem = crate::model::WorkflowTemplate;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.templates
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkflowTemplateRequest {
pub name: std::string::String,
pub version: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteWorkflowTemplateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for DeleteWorkflowTemplateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Component {
Unspecified,
Anaconda,
Delta,
Docker,
Druid,
Flink,
Hbase,
HiveWebhcat,
Hudi,
Iceberg,
Jupyter,
JupyterKernelGateway,
Pig,
Presto,
Trino,
Ranger,
Solr,
Zeppelin,
Zookeeper,
UnknownValue(component::UnknownValue),
}
#[doc(hidden)]
pub mod component {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Component {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Anaconda => std::option::Option::Some(5),
Self::Delta => std::option::Option::Some(20),
Self::Docker => std::option::Option::Some(13),
Self::Druid => std::option::Option::Some(9),
Self::Flink => std::option::Option::Some(14),
Self::Hbase => std::option::Option::Some(11),
Self::HiveWebhcat => std::option::Option::Some(3),
Self::Hudi => std::option::Option::Some(18),
Self::Iceberg => std::option::Option::Some(19),
Self::Jupyter => std::option::Option::Some(1),
Self::JupyterKernelGateway => std::option::Option::Some(22),
Self::Pig => std::option::Option::Some(21),
Self::Presto => std::option::Option::Some(6),
Self::Trino => std::option::Option::Some(17),
Self::Ranger => std::option::Option::Some(12),
Self::Solr => std::option::Option::Some(10),
Self::Zeppelin => std::option::Option::Some(4),
Self::Zookeeper => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("COMPONENT_UNSPECIFIED"),
Self::Anaconda => std::option::Option::Some("ANACONDA"),
Self::Delta => std::option::Option::Some("DELTA"),
Self::Docker => std::option::Option::Some("DOCKER"),
Self::Druid => std::option::Option::Some("DRUID"),
Self::Flink => std::option::Option::Some("FLINK"),
Self::Hbase => std::option::Option::Some("HBASE"),
Self::HiveWebhcat => std::option::Option::Some("HIVE_WEBHCAT"),
Self::Hudi => std::option::Option::Some("HUDI"),
Self::Iceberg => std::option::Option::Some("ICEBERG"),
Self::Jupyter => std::option::Option::Some("JUPYTER"),
Self::JupyterKernelGateway => std::option::Option::Some("JUPYTER_KERNEL_GATEWAY"),
Self::Pig => std::option::Option::Some("PIG"),
Self::Presto => std::option::Option::Some("PRESTO"),
Self::Trino => std::option::Option::Some("TRINO"),
Self::Ranger => std::option::Option::Some("RANGER"),
Self::Solr => std::option::Option::Some("SOLR"),
Self::Zeppelin => std::option::Option::Some("ZEPPELIN"),
Self::Zookeeper => std::option::Option::Some("ZOOKEEPER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Component {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Component {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Component {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Jupyter,
3 => Self::HiveWebhcat,
4 => Self::Zeppelin,
5 => Self::Anaconda,
6 => Self::Presto,
8 => Self::Zookeeper,
9 => Self::Druid,
10 => Self::Solr,
11 => Self::Hbase,
12 => Self::Ranger,
13 => Self::Docker,
14 => Self::Flink,
17 => Self::Trino,
18 => Self::Hudi,
19 => Self::Iceberg,
20 => Self::Delta,
21 => Self::Pig,
22 => Self::JupyterKernelGateway,
_ => Self::UnknownValue(component::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Component {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPONENT_UNSPECIFIED" => Self::Unspecified,
"ANACONDA" => Self::Anaconda,
"DELTA" => Self::Delta,
"DOCKER" => Self::Docker,
"DRUID" => Self::Druid,
"FLINK" => Self::Flink,
"HBASE" => Self::Hbase,
"HIVE_WEBHCAT" => Self::HiveWebhcat,
"HUDI" => Self::Hudi,
"ICEBERG" => Self::Iceberg,
"JUPYTER" => Self::Jupyter,
"JUPYTER_KERNEL_GATEWAY" => Self::JupyterKernelGateway,
"PIG" => Self::Pig,
"PRESTO" => Self::Presto,
"TRINO" => Self::Trino,
"RANGER" => Self::Ranger,
"SOLR" => Self::Solr,
"ZEPPELIN" => Self::Zeppelin,
"ZOOKEEPER" => Self::Zookeeper,
_ => Self::UnknownValue(component::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Component {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Anaconda => serializer.serialize_i32(5),
Self::Delta => serializer.serialize_i32(20),
Self::Docker => serializer.serialize_i32(13),
Self::Druid => serializer.serialize_i32(9),
Self::Flink => serializer.serialize_i32(14),
Self::Hbase => serializer.serialize_i32(11),
Self::HiveWebhcat => serializer.serialize_i32(3),
Self::Hudi => serializer.serialize_i32(18),
Self::Iceberg => serializer.serialize_i32(19),
Self::Jupyter => serializer.serialize_i32(1),
Self::JupyterKernelGateway => serializer.serialize_i32(22),
Self::Pig => serializer.serialize_i32(21),
Self::Presto => serializer.serialize_i32(6),
Self::Trino => serializer.serialize_i32(17),
Self::Ranger => serializer.serialize_i32(12),
Self::Solr => serializer.serialize_i32(10),
Self::Zeppelin => serializer.serialize_i32(4),
Self::Zookeeper => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Component {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Component>::new(
".google.cloud.dataproc.v1.Component",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureAction {
Unspecified,
NoAction,
Delete,
UnknownValue(failure_action::UnknownValue),
}
#[doc(hidden)]
pub mod failure_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureAction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NoAction => std::option::Option::Some(1),
Self::Delete => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_ACTION_UNSPECIFIED"),
Self::NoAction => std::option::Option::Some("NO_ACTION"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureAction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureAction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureAction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NoAction,
2 => Self::Delete,
_ => Self::UnknownValue(failure_action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureAction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_ACTION_UNSPECIFIED" => Self::Unspecified,
"NO_ACTION" => Self::NoAction,
"DELETE" => Self::Delete,
_ => Self::UnknownValue(failure_action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureAction {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NoAction => serializer.serialize_i32(1),
Self::Delete => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureAction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureAction>::new(
".google.cloud.dataproc.v1.FailureAction",
))
}
}