#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
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 Cluster {
pub name: std::string::String,
pub description: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub reconciling: bool,
pub network_resources:
std::collections::HashMap<std::string::String, crate::model::NetworkResource>,
pub storage_resources:
std::collections::HashMap<std::string::String, crate::model::StorageResource>,
pub compute_resources:
std::collections::HashMap<std::string::String, crate::model::ComputeResource>,
pub orchestrator: std::option::Option<crate::model::Orchestrator>,
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_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_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_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_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = v.into();
self
}
pub fn set_network_resources<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::NetworkResource>,
{
use std::iter::Iterator;
self.network_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_storage_resources<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::StorageResource>,
{
use std::iter::Iterator;
self.storage_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_compute_resources<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::ComputeResource>,
{
use std::iter::Iterator;
self.compute_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_orchestrator<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Orchestrator>,
{
self.orchestrator = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_orchestrator<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Orchestrator>,
{
self.orchestrator = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Cluster {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.Cluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListClustersRequest {
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 ListClustersRequest {
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 ListClustersRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.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 unreachable: std::vec::Vec<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
}
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 ListClustersResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.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 GetClusterRequest {
pub 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_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.GetClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateClusterRequest {
pub parent: std::string::String,
pub cluster_id: std::string::String,
pub cluster: std::option::Option<crate::model::Cluster>,
pub request_id: std::string::String,
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_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster_id = 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
}
}
impl wkt::message::Message for CreateClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateClusterRequest {
pub cluster: std::option::Option<crate::model::Cluster>,
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_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_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.hypercomputecluster.v1.UpdateClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteClusterRequest {
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 DeleteClusterRequest {
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 DeleteClusterRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteClusterRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkResource {
pub config: std::option::Option<crate::model::NetworkResourceConfig>,
pub reference: std::option::Option<crate::model::network_resource::Reference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkResource {
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::NetworkResourceConfig>,
{
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::NetworkResourceConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_reference<
T: std::convert::Into<std::option::Option<crate::model::network_resource::Reference>>,
>(
mut self,
v: T,
) -> Self {
self.reference = v.into();
self
}
pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkReference>> {
#[allow(unreachable_patterns)]
self.reference.as_ref().and_then(|v| match v {
crate::model::network_resource::Reference::Network(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkReference>>>(
mut self,
v: T,
) -> Self {
self.reference =
std::option::Option::Some(crate::model::network_resource::Reference::Network(v.into()));
self
}
}
impl wkt::message::Message for NetworkResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NetworkResource"
}
}
pub mod network_resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Reference {
Network(std::boxed::Box<crate::model::NetworkReference>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkReference {
pub network: std::string::String,
pub subnetwork: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnetwork = v.into();
self
}
}
impl wkt::message::Message for NetworkReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NetworkReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkResourceConfig {
pub config: std::option::Option<crate::model::network_resource_config::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkResourceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_config<
T: std::convert::Into<std::option::Option<crate::model::network_resource_config::Config>>,
>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
pub fn new_network(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewNetworkConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::network_resource_config::Config::NewNetwork(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_network<
T: std::convert::Into<std::boxed::Box<crate::model::NewNetworkConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::network_resource_config::Config::NewNetwork(v.into()),
);
self
}
pub fn existing_network(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExistingNetworkConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::network_resource_config::Config::ExistingNetwork(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_existing_network<
T: std::convert::Into<std::boxed::Box<crate::model::ExistingNetworkConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::network_resource_config::Config::ExistingNetwork(v.into()),
);
self
}
}
impl wkt::message::Message for NetworkResourceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NetworkResourceConfig"
}
}
pub mod network_resource_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
NewNetwork(std::boxed::Box<crate::model::NewNetworkConfig>),
ExistingNetwork(std::boxed::Box<crate::model::ExistingNetworkConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewNetworkConfig {
pub network: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewNetworkConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for NewNetworkConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewNetworkConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExistingNetworkConfig {
pub network: std::string::String,
pub subnetwork: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExistingNetworkConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnetwork = v.into();
self
}
}
impl wkt::message::Message for ExistingNetworkConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingNetworkConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageResource {
pub config: std::option::Option<crate::model::StorageResourceConfig>,
pub reference: std::option::Option<crate::model::storage_resource::Reference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageResource {
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::StorageResourceConfig>,
{
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::StorageResourceConfig>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_reference<
T: std::convert::Into<std::option::Option<crate::model::storage_resource::Reference>>,
>(
mut self,
v: T,
) -> Self {
self.reference = v.into();
self
}
pub fn filestore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::FilestoreReference>> {
#[allow(unreachable_patterns)]
self.reference.as_ref().and_then(|v| match v {
crate::model::storage_resource::Reference::Filestore(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_filestore<
T: std::convert::Into<std::boxed::Box<crate::model::FilestoreReference>>,
>(
mut self,
v: T,
) -> Self {
self.reference = std::option::Option::Some(
crate::model::storage_resource::Reference::Filestore(v.into()),
);
self
}
pub fn bucket(&self) -> std::option::Option<&std::boxed::Box<crate::model::BucketReference>> {
#[allow(unreachable_patterns)]
self.reference.as_ref().and_then(|v| match v {
crate::model::storage_resource::Reference::Bucket(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_bucket<T: std::convert::Into<std::boxed::Box<crate::model::BucketReference>>>(
mut self,
v: T,
) -> Self {
self.reference =
std::option::Option::Some(crate::model::storage_resource::Reference::Bucket(v.into()));
self
}
pub fn lustre(&self) -> std::option::Option<&std::boxed::Box<crate::model::LustreReference>> {
#[allow(unreachable_patterns)]
self.reference.as_ref().and_then(|v| match v {
crate::model::storage_resource::Reference::Lustre(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_lustre<T: std::convert::Into<std::boxed::Box<crate::model::LustreReference>>>(
mut self,
v: T,
) -> Self {
self.reference =
std::option::Option::Some(crate::model::storage_resource::Reference::Lustre(v.into()));
self
}
}
impl wkt::message::Message for StorageResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.StorageResource"
}
}
pub mod storage_resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Reference {
Filestore(std::boxed::Box<crate::model::FilestoreReference>),
Bucket(std::boxed::Box<crate::model::BucketReference>),
Lustre(std::boxed::Box<crate::model::LustreReference>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FilestoreReference {
pub filestore: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FilestoreReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filestore = v.into();
self
}
}
impl wkt::message::Message for FilestoreReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.FilestoreReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BucketReference {
pub bucket: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BucketReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
}
impl wkt::message::Message for BucketReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.BucketReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LustreReference {
pub lustre: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LustreReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lustre = v.into();
self
}
}
impl wkt::message::Message for LustreReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.LustreReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageResourceConfig {
pub config: std::option::Option<crate::model::storage_resource_config::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageResourceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_config<
T: std::convert::Into<std::option::Option<crate::model::storage_resource_config::Config>>,
>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
pub fn new_filestore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewFilestoreConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::storage_resource_config::Config::NewFilestore(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_filestore<
T: std::convert::Into<std::boxed::Box<crate::model::NewFilestoreConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::storage_resource_config::Config::NewFilestore(v.into()),
);
self
}
pub fn existing_filestore(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExistingFilestoreConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::storage_resource_config::Config::ExistingFilestore(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_existing_filestore<
T: std::convert::Into<std::boxed::Box<crate::model::ExistingFilestoreConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::storage_resource_config::Config::ExistingFilestore(v.into()),
);
self
}
pub fn new_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewBucketConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::storage_resource_config::Config::NewBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_bucket<T: std::convert::Into<std::boxed::Box<crate::model::NewBucketConfig>>>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::storage_resource_config::Config::NewBucket(v.into()),
);
self
}
pub fn existing_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExistingBucketConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::storage_resource_config::Config::ExistingBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_existing_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::ExistingBucketConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::storage_resource_config::Config::ExistingBucket(v.into()),
);
self
}
pub fn new_lustre(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewLustreConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::storage_resource_config::Config::NewLustre(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_lustre<T: std::convert::Into<std::boxed::Box<crate::model::NewLustreConfig>>>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::storage_resource_config::Config::NewLustre(v.into()),
);
self
}
pub fn existing_lustre(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ExistingLustreConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::storage_resource_config::Config::ExistingLustre(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_existing_lustre<
T: std::convert::Into<std::boxed::Box<crate::model::ExistingLustreConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::storage_resource_config::Config::ExistingLustre(v.into()),
);
self
}
}
impl wkt::message::Message for StorageResourceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.StorageResourceConfig"
}
}
pub mod storage_resource_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
NewFilestore(std::boxed::Box<crate::model::NewFilestoreConfig>),
ExistingFilestore(std::boxed::Box<crate::model::ExistingFilestoreConfig>),
NewBucket(std::boxed::Box<crate::model::NewBucketConfig>),
ExistingBucket(std::boxed::Box<crate::model::ExistingBucketConfig>),
NewLustre(std::boxed::Box<crate::model::NewLustreConfig>),
ExistingLustre(std::boxed::Box<crate::model::ExistingLustreConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewFilestoreConfig {
pub filestore: std::string::String,
pub description: std::string::String,
pub file_shares: std::vec::Vec<crate::model::FileShareConfig>,
pub tier: crate::model::new_filestore_config::Tier,
pub protocol: crate::model::new_filestore_config::Protocol,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewFilestoreConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filestore = 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_file_shares<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FileShareConfig>,
{
use std::iter::Iterator;
self.file_shares = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_tier<T: std::convert::Into<crate::model::new_filestore_config::Tier>>(
mut self,
v: T,
) -> Self {
self.tier = v.into();
self
}
pub fn set_protocol<T: std::convert::Into<crate::model::new_filestore_config::Protocol>>(
mut self,
v: T,
) -> Self {
self.protocol = v.into();
self
}
}
impl wkt::message::Message for NewFilestoreConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewFilestoreConfig"
}
}
pub mod new_filestore_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Tier {
Unspecified,
Zonal,
Regional,
UnknownValue(tier::UnknownValue),
}
#[doc(hidden)]
pub mod tier {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Tier {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Zonal => std::option::Option::Some(4),
Self::Regional => 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("TIER_UNSPECIFIED"),
Self::Zonal => std::option::Option::Some("ZONAL"),
Self::Regional => std::option::Option::Some("REGIONAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Tier {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Tier {
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 Tier {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
4 => Self::Zonal,
6 => Self::Regional,
_ => Self::UnknownValue(tier::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Tier {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TIER_UNSPECIFIED" => Self::Unspecified,
"ZONAL" => Self::Zonal,
"REGIONAL" => Self::Regional,
_ => Self::UnknownValue(tier::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Tier {
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::Zonal => serializer.serialize_i32(4),
Self::Regional => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Tier {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
".google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Tier",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Protocol {
Unspecified,
Nfsv3,
Nfsv41,
UnknownValue(protocol::UnknownValue),
}
#[doc(hidden)]
pub mod protocol {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Protocol {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Nfsv3 => std::option::Option::Some(1),
Self::Nfsv41 => 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("PROTOCOL_UNSPECIFIED"),
Self::Nfsv3 => std::option::Option::Some("NFSV3"),
Self::Nfsv41 => std::option::Option::Some("NFSV41"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Protocol {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Protocol {
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 Protocol {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Nfsv3,
2 => Self::Nfsv41,
_ => Self::UnknownValue(protocol::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Protocol {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PROTOCOL_UNSPECIFIED" => Self::Unspecified,
"NFSV3" => Self::Nfsv3,
"NFSV41" => Self::Nfsv41,
_ => Self::UnknownValue(protocol::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Protocol {
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::Nfsv3 => serializer.serialize_i32(1),
Self::Nfsv41 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Protocol {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
".google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Protocol",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FileShareConfig {
pub capacity_gb: i64,
pub file_share: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FileShareConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_capacity_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_gb = v.into();
self
}
pub fn set_file_share<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file_share = v.into();
self
}
}
impl wkt::message::Message for FileShareConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.FileShareConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExistingFilestoreConfig {
pub filestore: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExistingFilestoreConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filestore = v.into();
self
}
}
impl wkt::message::Message for ExistingFilestoreConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingFilestoreConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewBucketConfig {
pub bucket: std::string::String,
pub hierarchical_namespace: std::option::Option<crate::model::GcsHierarchicalNamespaceConfig>,
pub option: std::option::Option<crate::model::new_bucket_config::Option>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewBucketConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GcsHierarchicalNamespaceConfig>,
{
self.hierarchical_namespace = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GcsHierarchicalNamespaceConfig>,
{
self.hierarchical_namespace = v.map(|x| x.into());
self
}
pub fn set_option<
T: std::convert::Into<std::option::Option<crate::model::new_bucket_config::Option>>,
>(
mut self,
v: T,
) -> Self {
self.option = v.into();
self
}
pub fn autoclass(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GcsAutoclassConfig>> {
#[allow(unreachable_patterns)]
self.option.as_ref().and_then(|v| match v {
crate::model::new_bucket_config::Option::Autoclass(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_autoclass<
T: std::convert::Into<std::boxed::Box<crate::model::GcsAutoclassConfig>>,
>(
mut self,
v: T,
) -> Self {
self.option =
std::option::Option::Some(crate::model::new_bucket_config::Option::Autoclass(v.into()));
self
}
pub fn storage_class(
&self,
) -> std::option::Option<&crate::model::new_bucket_config::StorageClass> {
#[allow(unreachable_patterns)]
self.option.as_ref().and_then(|v| match v {
crate::model::new_bucket_config::Option::StorageClass(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_storage_class<
T: std::convert::Into<crate::model::new_bucket_config::StorageClass>,
>(
mut self,
v: T,
) -> Self {
self.option = std::option::Option::Some(
crate::model::new_bucket_config::Option::StorageClass(v.into()),
);
self
}
}
impl wkt::message::Message for NewBucketConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewBucketConfig"
}
}
pub mod new_bucket_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StorageClass {
Unspecified,
Standard,
Nearline,
Coldline,
Archive,
UnknownValue(storage_class::UnknownValue),
}
#[doc(hidden)]
pub mod storage_class {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl StorageClass {
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::Nearline => std::option::Option::Some(2),
Self::Coldline => std::option::Option::Some(3),
Self::Archive => 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("STORAGE_CLASS_UNSPECIFIED"),
Self::Standard => std::option::Option::Some("STANDARD"),
Self::Nearline => std::option::Option::Some("NEARLINE"),
Self::Coldline => std::option::Option::Some("COLDLINE"),
Self::Archive => std::option::Option::Some("ARCHIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for StorageClass {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for StorageClass {
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 StorageClass {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Standard,
2 => Self::Nearline,
3 => Self::Coldline,
4 => Self::Archive,
_ => Self::UnknownValue(storage_class::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for StorageClass {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STORAGE_CLASS_UNSPECIFIED" => Self::Unspecified,
"STANDARD" => Self::Standard,
"NEARLINE" => Self::Nearline,
"COLDLINE" => Self::Coldline,
"ARCHIVE" => Self::Archive,
_ => Self::UnknownValue(storage_class::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for StorageClass {
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::Nearline => serializer.serialize_i32(2),
Self::Coldline => serializer.serialize_i32(3),
Self::Archive => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for StorageClass {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageClass>::new(
".google.cloud.hypercomputecluster.v1.NewBucketConfig.StorageClass",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Option {
Autoclass(std::boxed::Box<crate::model::GcsAutoclassConfig>),
StorageClass(crate::model::new_bucket_config::StorageClass),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GcsAutoclassConfig {
pub enabled: bool,
pub terminal_storage_class: crate::model::gcs_autoclass_config::TerminalStorageClass,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GcsAutoclassConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
pub fn set_terminal_storage_class<
T: std::convert::Into<crate::model::gcs_autoclass_config::TerminalStorageClass>,
>(
mut self,
v: T,
) -> Self {
self.terminal_storage_class = v.into();
self
}
}
impl wkt::message::Message for GcsAutoclassConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.GcsAutoclassConfig"
}
}
pub mod gcs_autoclass_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TerminalStorageClass {
Unspecified,
UnknownValue(terminal_storage_class::UnknownValue),
}
#[doc(hidden)]
pub mod terminal_storage_class {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TerminalStorageClass {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("TERMINAL_STORAGE_CLASS_UNSPECIFIED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TerminalStorageClass {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TerminalStorageClass {
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 TerminalStorageClass {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
_ => Self::UnknownValue(terminal_storage_class::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TerminalStorageClass {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TERMINAL_STORAGE_CLASS_UNSPECIFIED" => Self::Unspecified,
_ => Self::UnknownValue(terminal_storage_class::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TerminalStorageClass {
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::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TerminalStorageClass {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TerminalStorageClass>::new(
".google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClass",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GcsHierarchicalNamespaceConfig {
pub enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GcsHierarchicalNamespaceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
}
impl wkt::message::Message for GcsHierarchicalNamespaceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExistingBucketConfig {
pub bucket: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExistingBucketConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
}
impl wkt::message::Message for ExistingBucketConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingBucketConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewLustreConfig {
pub lustre: std::string::String,
pub description: std::string::String,
pub filesystem: std::string::String,
pub capacity_gb: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewLustreConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lustre = 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_filesystem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filesystem = v.into();
self
}
pub fn set_capacity_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.capacity_gb = v.into();
self
}
}
impl wkt::message::Message for NewLustreConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewLustreConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExistingLustreConfig {
pub lustre: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExistingLustreConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lustre = v.into();
self
}
}
impl wkt::message::Message for ExistingLustreConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingLustreConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeResource {
pub config: std::option::Option<crate::model::ComputeResourceConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeResource {
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::ComputeResourceConfig>,
{
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::ComputeResourceConfig>,
{
self.config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ComputeResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeResource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeResourceConfig {
pub config: std::option::Option<crate::model::compute_resource_config::Config>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeResourceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_config<
T: std::convert::Into<std::option::Option<crate::model::compute_resource_config::Config>>,
>(
mut self,
v: T,
) -> Self {
self.config = v.into();
self
}
pub fn new_on_demand_instances(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewOnDemandInstancesConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::compute_resource_config::Config::NewOnDemandInstances(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_on_demand_instances<
T: std::convert::Into<std::boxed::Box<crate::model::NewOnDemandInstancesConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::compute_resource_config::Config::NewOnDemandInstances(v.into()),
);
self
}
pub fn new_spot_instances(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewSpotInstancesConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::compute_resource_config::Config::NewSpotInstances(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_spot_instances<
T: std::convert::Into<std::boxed::Box<crate::model::NewSpotInstancesConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::compute_resource_config::Config::NewSpotInstances(v.into()),
);
self
}
pub fn new_reserved_instances(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewReservedInstancesConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::compute_resource_config::Config::NewReservedInstances(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_reserved_instances<
T: std::convert::Into<std::boxed::Box<crate::model::NewReservedInstancesConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::compute_resource_config::Config::NewReservedInstances(v.into()),
);
self
}
pub fn new_flex_start_instances(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::NewFlexStartInstancesConfig>> {
#[allow(unreachable_patterns)]
self.config.as_ref().and_then(|v| match v {
crate::model::compute_resource_config::Config::NewFlexStartInstances(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_new_flex_start_instances<
T: std::convert::Into<std::boxed::Box<crate::model::NewFlexStartInstancesConfig>>,
>(
mut self,
v: T,
) -> Self {
self.config = std::option::Option::Some(
crate::model::compute_resource_config::Config::NewFlexStartInstances(v.into()),
);
self
}
}
impl wkt::message::Message for ComputeResourceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeResourceConfig"
}
}
pub mod compute_resource_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Config {
NewOnDemandInstances(std::boxed::Box<crate::model::NewOnDemandInstancesConfig>),
NewSpotInstances(std::boxed::Box<crate::model::NewSpotInstancesConfig>),
NewReservedInstances(std::boxed::Box<crate::model::NewReservedInstancesConfig>),
NewFlexStartInstances(std::boxed::Box<crate::model::NewFlexStartInstancesConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewOnDemandInstancesConfig {
pub zone: std::string::String,
pub machine_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewOnDemandInstancesConfig {
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_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
}
impl wkt::message::Message for NewOnDemandInstancesConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewOnDemandInstancesConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewSpotInstancesConfig {
pub zone: std::string::String,
pub machine_type: std::string::String,
pub termination_action: crate::model::new_spot_instances_config::TerminationAction,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewSpotInstancesConfig {
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_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
pub fn set_termination_action<
T: std::convert::Into<crate::model::new_spot_instances_config::TerminationAction>,
>(
mut self,
v: T,
) -> Self {
self.termination_action = v.into();
self
}
}
impl wkt::message::Message for NewSpotInstancesConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig"
}
}
pub mod new_spot_instances_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TerminationAction {
Unspecified,
Stop,
Delete,
UnknownValue(termination_action::UnknownValue),
}
#[doc(hidden)]
pub mod termination_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TerminationAction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Stop => 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("TERMINATION_ACTION_UNSPECIFIED"),
Self::Stop => std::option::Option::Some("STOP"),
Self::Delete => std::option::Option::Some("DELETE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TerminationAction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TerminationAction {
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 TerminationAction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Stop,
2 => Self::Delete,
_ => Self::UnknownValue(termination_action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TerminationAction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TERMINATION_ACTION_UNSPECIFIED" => Self::Unspecified,
"STOP" => Self::Stop,
"DELETE" => Self::Delete,
_ => Self::UnknownValue(termination_action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TerminationAction {
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::Stop => serializer.serialize_i32(1),
Self::Delete => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TerminationAction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TerminationAction>::new(
".google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationAction",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewReservedInstancesConfig {
pub source: std::option::Option<crate::model::new_reserved_instances_config::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewReservedInstancesConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<
T: std::convert::Into<
std::option::Option<crate::model::new_reserved_instances_config::Source>,
>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn reservation(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::new_reserved_instances_config::Source::Reservation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_reservation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = std::option::Option::Some(
crate::model::new_reserved_instances_config::Source::Reservation(v.into()),
);
self
}
}
impl wkt::message::Message for NewReservedInstancesConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewReservedInstancesConfig"
}
}
pub mod new_reserved_instances_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Reservation(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NewFlexStartInstancesConfig {
pub zone: std::string::String,
pub machine_type: std::string::String,
pub max_duration: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NewFlexStartInstancesConfig {
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_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
pub fn set_max_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for NewFlexStartInstancesConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.NewFlexStartInstancesConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BootDisk {
pub r#type: std::string::String,
pub size_gb: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BootDisk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_gb = v.into();
self
}
}
impl wkt::message::Message for BootDisk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.BootDisk"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Orchestrator {
pub option: std::option::Option<crate::model::orchestrator::Option>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Orchestrator {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_option<
T: std::convert::Into<std::option::Option<crate::model::orchestrator::Option>>,
>(
mut self,
v: T,
) -> Self {
self.option = v.into();
self
}
pub fn slurm(&self) -> std::option::Option<&std::boxed::Box<crate::model::SlurmOrchestrator>> {
#[allow(unreachable_patterns)]
self.option.as_ref().and_then(|v| match v {
crate::model::orchestrator::Option::Slurm(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_slurm<T: std::convert::Into<std::boxed::Box<crate::model::SlurmOrchestrator>>>(
mut self,
v: T,
) -> Self {
self.option =
std::option::Option::Some(crate::model::orchestrator::Option::Slurm(v.into()));
self
}
}
impl wkt::message::Message for Orchestrator {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.Orchestrator"
}
}
pub mod orchestrator {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Option {
Slurm(std::boxed::Box<crate::model::SlurmOrchestrator>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SlurmOrchestrator {
pub login_nodes: std::option::Option<crate::model::SlurmLoginNodes>,
pub node_sets: std::vec::Vec<crate::model::SlurmNodeSet>,
pub partitions: std::vec::Vec<crate::model::SlurmPartition>,
pub default_partition: std::string::String,
pub prolog_bash_scripts: std::vec::Vec<std::string::String>,
pub epilog_bash_scripts: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SlurmOrchestrator {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_login_nodes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SlurmLoginNodes>,
{
self.login_nodes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_login_nodes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SlurmLoginNodes>,
{
self.login_nodes = v.map(|x| x.into());
self
}
pub fn set_node_sets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SlurmNodeSet>,
{
use std::iter::Iterator;
self.node_sets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_partitions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SlurmPartition>,
{
use std::iter::Iterator;
self.partitions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_default_partition<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_partition = v.into();
self
}
pub fn set_prolog_bash_scripts<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.prolog_bash_scripts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_epilog_bash_scripts<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.epilog_bash_scripts = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SlurmOrchestrator {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmOrchestrator"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SlurmNodeSet {
pub id: std::string::String,
pub compute_id: std::string::String,
pub storage_configs: std::vec::Vec<crate::model::StorageConfig>,
pub static_node_count: i64,
pub max_dynamic_node_count: i64,
pub r#type: std::option::Option<crate::model::slurm_node_set::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SlurmNodeSet {
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_compute_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.compute_id = v.into();
self
}
pub fn set_storage_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::StorageConfig>,
{
use std::iter::Iterator;
self.storage_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_static_node_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.static_node_count = v.into();
self
}
pub fn set_max_dynamic_node_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max_dynamic_node_count = v.into();
self
}
pub fn set_type<
T: std::convert::Into<std::option::Option<crate::model::slurm_node_set::Type>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn compute_instance(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ComputeInstanceSlurmNodeSet>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::slurm_node_set::Type::ComputeInstance(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_compute_instance<
T: std::convert::Into<std::boxed::Box<crate::model::ComputeInstanceSlurmNodeSet>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::slurm_node_set::Type::ComputeInstance(v.into()),
);
self
}
}
impl wkt::message::Message for SlurmNodeSet {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmNodeSet"
}
}
pub mod slurm_node_set {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
ComputeInstance(std::boxed::Box<crate::model::ComputeInstanceSlurmNodeSet>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeInstanceSlurmNodeSet {
pub startup_script: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub boot_disk: std::option::Option<crate::model::BootDisk>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeInstanceSlurmNodeSet {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_startup_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.startup_script = 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_boot_disk<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BootDisk>,
{
self.boot_disk = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BootDisk>,
{
self.boot_disk = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ComputeInstanceSlurmNodeSet {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SlurmPartition {
pub id: std::string::String,
pub node_set_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SlurmPartition {
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_node_set_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.node_set_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SlurmPartition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmPartition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SlurmLoginNodes {
pub count: i64,
pub zone: std::string::String,
pub machine_type: std::string::String,
pub startup_script: std::string::String,
pub enable_os_login: bool,
pub enable_public_ips: bool,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub storage_configs: std::vec::Vec<crate::model::StorageConfig>,
pub instances: std::vec::Vec<crate::model::ComputeInstance>,
pub boot_disk: std::option::Option<crate::model::BootDisk>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SlurmLoginNodes {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.zone = v.into();
self
}
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_startup_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.startup_script = v.into();
self
}
pub fn set_enable_os_login<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_os_login = v.into();
self
}
pub fn set_enable_public_ips<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_public_ips = 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_storage_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::StorageConfig>,
{
use std::iter::Iterator;
self.storage_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_instances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ComputeInstance>,
{
use std::iter::Iterator;
self.instances = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_boot_disk<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BootDisk>,
{
self.boot_disk = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BootDisk>,
{
self.boot_disk = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SlurmLoginNodes {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmLoginNodes"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageConfig {
pub id: std::string::String,
pub local_mount: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageConfig {
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_local_mount<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.local_mount = v.into();
self
}
}
impl wkt::message::Message for StorageConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.StorageConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeInstance {
pub instance: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance = v.into();
self
}
}
impl wkt::message::Message for ComputeInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub progress: std::option::Option<crate::model::OperationProgress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
pub fn set_progress<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationProgress>,
{
self.progress = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationProgress {
pub steps: std::vec::Vec<crate::model::OperationStep>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationProgress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OperationStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for OperationProgress {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.OperationProgress"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationStep {
pub state: crate::model::operation_step::State,
pub r#type: std::option::Option<crate::model::operation_step::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::operation_step::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_type<
T: std::convert::Into<std::option::Option<crate::model::operation_step::Type>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn create_network(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateNetwork>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateNetwork(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_create_network<
T: std::convert::Into<std::boxed::Box<crate::model::CreateNetwork>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::operation_step::Type::CreateNetwork(v.into()));
self
}
pub fn create_private_service_access(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreatePrivateServiceAccess>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreatePrivateServiceAccess(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_private_service_access<
T: std::convert::Into<std::boxed::Box<crate::model::CreatePrivateServiceAccess>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreatePrivateServiceAccess(v.into()),
);
self
}
pub fn create_filestore_instance(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateFilestoreInstance>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateFilestoreInstance(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_filestore_instance<
T: std::convert::Into<std::boxed::Box<crate::model::CreateFilestoreInstance>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreateFilestoreInstance(v.into()),
);
self
}
pub fn create_storage_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateStorageBucket>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateStorageBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_storage_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::CreateStorageBucket>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreateStorageBucket(v.into()),
);
self
}
pub fn create_lustre_instance(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateLustreInstance>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateLustreInstance(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_lustre_instance<
T: std::convert::Into<std::boxed::Box<crate::model::CreateLustreInstance>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreateLustreInstance(v.into()),
);
self
}
pub fn create_orchestrator(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateOrchestrator>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateOrchestrator(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_orchestrator<
T: std::convert::Into<std::boxed::Box<crate::model::CreateOrchestrator>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreateOrchestrator(v.into()),
);
self
}
pub fn create_nodeset(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateNodeset>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateNodeset(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_create_nodeset<
T: std::convert::Into<std::boxed::Box<crate::model::CreateNodeset>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::operation_step::Type::CreateNodeset(v.into()));
self
}
pub fn create_partition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreatePartition>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreatePartition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_create_partition<
T: std::convert::Into<std::boxed::Box<crate::model::CreatePartition>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreatePartition(v.into()),
);
self
}
pub fn create_login_node(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateLoginNode>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CreateLoginNode(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_create_login_node<
T: std::convert::Into<std::boxed::Box<crate::model::CreateLoginNode>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CreateLoginNode(v.into()),
);
self
}
pub fn check_cluster_health(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CheckClusterHealth>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::CheckClusterHealth(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_check_cluster_health<
T: std::convert::Into<std::boxed::Box<crate::model::CheckClusterHealth>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::CheckClusterHealth(v.into()),
);
self
}
pub fn update_orchestrator(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateOrchestrator>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::UpdateOrchestrator(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_update_orchestrator<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateOrchestrator>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::UpdateOrchestrator(v.into()),
);
self
}
pub fn update_nodeset(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateNodeset>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::UpdateNodeset(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_update_nodeset<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateNodeset>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::operation_step::Type::UpdateNodeset(v.into()));
self
}
pub fn update_partition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdatePartition>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::UpdatePartition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_update_partition<
T: std::convert::Into<std::boxed::Box<crate::model::UpdatePartition>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::UpdatePartition(v.into()),
);
self
}
pub fn update_login_node(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateLoginNode>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::UpdateLoginNode(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_update_login_node<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateLoginNode>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::UpdateLoginNode(v.into()),
);
self
}
pub fn delete_orchestrator(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteOrchestrator>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteOrchestrator(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_orchestrator<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteOrchestrator>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeleteOrchestrator(v.into()),
);
self
}
pub fn delete_nodeset(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteNodeset>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteNodeset(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_delete_nodeset<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteNodeset>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::operation_step::Type::DeleteNodeset(v.into()));
self
}
pub fn delete_partition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeletePartition>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeletePartition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_delete_partition<
T: std::convert::Into<std::boxed::Box<crate::model::DeletePartition>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeletePartition(v.into()),
);
self
}
pub fn delete_login_node(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteLoginNode>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteLoginNode(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_delete_login_node<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteLoginNode>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeleteLoginNode(v.into()),
);
self
}
pub fn delete_filestore_instance(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteFilestoreInstance>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteFilestoreInstance(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_filestore_instance<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteFilestoreInstance>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeleteFilestoreInstance(v.into()),
);
self
}
pub fn delete_storage_bucket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteStorageBucket>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteStorageBucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_storage_bucket<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteStorageBucket>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeleteStorageBucket(v.into()),
);
self
}
pub fn delete_lustre_instance(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteLustreInstance>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteLustreInstance(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_lustre_instance<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteLustreInstance>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeleteLustreInstance(v.into()),
);
self
}
pub fn delete_private_service_access(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeletePrivateServiceAccess>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeletePrivateServiceAccess(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_private_service_access<
T: std::convert::Into<std::boxed::Box<crate::model::DeletePrivateServiceAccess>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::operation_step::Type::DeletePrivateServiceAccess(v.into()),
);
self
}
pub fn delete_network(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteNetwork>> {
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::operation_step::Type::DeleteNetwork(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_delete_network<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteNetwork>>,
>(
mut self,
v: T,
) -> Self {
self.r#type =
std::option::Option::Some(crate::model::operation_step::Type::DeleteNetwork(v.into()));
self
}
}
impl wkt::message::Message for OperationStep {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.OperationStep"
}
}
pub mod operation_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Waiting,
InProgress,
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::Unspecified => std::option::Option::Some(0),
Self::Waiting => std::option::Option::Some(1),
Self::InProgress => 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::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Waiting => std::option::Option::Some("WAITING"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
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::Unspecified,
1 => Self::Waiting,
2 => Self::InProgress,
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 {
"STATE_UNSPECIFIED" => Self::Unspecified,
"WAITING" => Self::Waiting,
"IN_PROGRESS" => Self::InProgress,
"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::Unspecified => serializer.serialize_i32(0),
Self::Waiting => serializer.serialize_i32(1),
Self::InProgress => 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.hypercomputecluster.v1.OperationStep.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
CreateNetwork(std::boxed::Box<crate::model::CreateNetwork>),
CreatePrivateServiceAccess(std::boxed::Box<crate::model::CreatePrivateServiceAccess>),
CreateFilestoreInstance(std::boxed::Box<crate::model::CreateFilestoreInstance>),
CreateStorageBucket(std::boxed::Box<crate::model::CreateStorageBucket>),
CreateLustreInstance(std::boxed::Box<crate::model::CreateLustreInstance>),
CreateOrchestrator(std::boxed::Box<crate::model::CreateOrchestrator>),
CreateNodeset(std::boxed::Box<crate::model::CreateNodeset>),
CreatePartition(std::boxed::Box<crate::model::CreatePartition>),
CreateLoginNode(std::boxed::Box<crate::model::CreateLoginNode>),
CheckClusterHealth(std::boxed::Box<crate::model::CheckClusterHealth>),
UpdateOrchestrator(std::boxed::Box<crate::model::UpdateOrchestrator>),
UpdateNodeset(std::boxed::Box<crate::model::UpdateNodeset>),
UpdatePartition(std::boxed::Box<crate::model::UpdatePartition>),
UpdateLoginNode(std::boxed::Box<crate::model::UpdateLoginNode>),
DeleteOrchestrator(std::boxed::Box<crate::model::DeleteOrchestrator>),
DeleteNodeset(std::boxed::Box<crate::model::DeleteNodeset>),
DeletePartition(std::boxed::Box<crate::model::DeletePartition>),
DeleteLoginNode(std::boxed::Box<crate::model::DeleteLoginNode>),
DeleteFilestoreInstance(std::boxed::Box<crate::model::DeleteFilestoreInstance>),
DeleteStorageBucket(std::boxed::Box<crate::model::DeleteStorageBucket>),
DeleteLustreInstance(std::boxed::Box<crate::model::DeleteLustreInstance>),
DeletePrivateServiceAccess(std::boxed::Box<crate::model::DeletePrivateServiceAccess>),
DeleteNetwork(std::boxed::Box<crate::model::DeleteNetwork>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateNetwork {
pub network: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
}
impl wkt::message::Message for CreateNetwork {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateNetwork"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePrivateServiceAccess {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatePrivateServiceAccess {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreatePrivateServiceAccess {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreatePrivateServiceAccess"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFilestoreInstance {
pub filestore: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFilestoreInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filestore = v.into();
self
}
}
impl wkt::message::Message for CreateFilestoreInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateFilestoreInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateStorageBucket {
pub bucket: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateStorageBucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
}
impl wkt::message::Message for CreateStorageBucket {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateStorageBucket"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLustreInstance {
pub lustre: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLustreInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lustre = v.into();
self
}
}
impl wkt::message::Message for CreateLustreInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateLustreInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateOrchestrator {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateOrchestrator {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateOrchestrator {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateOrchestrator"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateNodeset {
pub nodesets: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateNodeset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_nodesets<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.nodesets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CreateNodeset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateNodeset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePartition {
pub partitions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatePartition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_partitions<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.partitions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CreatePartition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreatePartition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLoginNode {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLoginNode {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateLoginNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateLoginNode"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckClusterHealth {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckClusterHealth {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CheckClusterHealth {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.CheckClusterHealth"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateOrchestrator {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateOrchestrator {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateOrchestrator {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateOrchestrator"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateNodeset {
pub nodesets: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateNodeset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_nodesets<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.nodesets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UpdateNodeset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateNodeset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePartition {
pub partitions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdatePartition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_partitions<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.partitions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for UpdatePartition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdatePartition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateLoginNode {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateLoginNode {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateLoginNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateLoginNode"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteOrchestrator {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteOrchestrator {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteOrchestrator {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteOrchestrator"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteNodeset {
pub nodesets: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteNodeset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_nodesets<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.nodesets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DeleteNodeset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteNodeset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePartition {
pub partitions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeletePartition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_partitions<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.partitions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DeletePartition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeletePartition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLoginNode {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLoginNode {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteLoginNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteLoginNode"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFilestoreInstance {
pub filestore: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteFilestoreInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filestore = v.into();
self
}
}
impl wkt::message::Message for DeleteFilestoreInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteFilestoreInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteStorageBucket {
pub bucket: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteStorageBucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
}
impl wkt::message::Message for DeleteStorageBucket {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteStorageBucket"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLustreInstance {
pub lustre: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLustreInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.lustre = v.into();
self
}
}
impl wkt::message::Message for DeleteLustreInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteLustreInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePrivateServiceAccess {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeletePrivateServiceAccess {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeletePrivateServiceAccess {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeletePrivateServiceAccess"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteNetwork {
pub network: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
}
impl wkt::message::Message for DeleteNetwork {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteNetwork"
}
}