google_cloud_hypercomputecluster_v1/model.rs
1// Copyright 2026 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A collection of virtual machines and connected resources forming a
41/// high-performance computing cluster capable of running large-scale, tightly
42/// coupled workloads. A cluster combines a set a compute resources that perform
43/// computations, storage resources that contain inputs and store outputs, an
44/// orchestrator that is responsible for assigning jobs to compute resources, and
45/// network resources that connect everything together.
46#[derive(Clone, Default, PartialEq)]
47#[non_exhaustive]
48pub struct Cluster {
49 /// Identifier. [Relative resource name](https://google.aip.dev/122) of the
50 /// cluster, in the format
51 /// `projects/{project}/locations/{location}/clusters/{cluster}`.
52 pub name: std::string::String,
53
54 /// Optional. User-provided description of the cluster.
55 pub description: std::string::String,
56
57 /// Optional.
58 /// [Labels](https://cloud.google.com/compute/docs/labeling-resources) applied
59 /// to the cluster. Labels can be used to organize clusters and to filter them
60 /// in queries.
61 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
62
63 /// Output only. Time that the cluster was originally created.
64 pub create_time: std::option::Option<wkt::Timestamp>,
65
66 /// Output only. Time that the cluster was most recently updated.
67 pub update_time: std::option::Option<wkt::Timestamp>,
68
69 /// Output only. Indicates whether changes to the cluster are currently in
70 /// flight. If this is `true`, then the current state might not match the
71 /// cluster's intended state.
72 pub reconciling: bool,
73
74 /// Optional. Network resources available to the cluster. Must contain at most
75 /// one value. Keys specify the ID of the network resource by which it can be
76 /// referenced elsewhere, and must conform to
77 /// [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
78 /// alphanumeric, and at most 63 characters).
79 pub network_resources:
80 std::collections::HashMap<std::string::String, crate::model::NetworkResource>,
81
82 /// Optional. Storage resources available to the cluster. Keys specify the ID
83 /// of the storage resource by which it can be referenced elsewhere, and must
84 /// conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034)
85 /// (lower-case, alphanumeric, and at most 63 characters).
86 pub storage_resources:
87 std::collections::HashMap<std::string::String, crate::model::StorageResource>,
88
89 /// Optional. Compute resources available to the cluster. Keys specify the ID
90 /// of the compute resource by which it can be referenced elsewhere, and must
91 /// conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034)
92 /// (lower-case, alphanumeric, and at most 63 characters).
93 pub compute_resources:
94 std::collections::HashMap<std::string::String, crate::model::ComputeResource>,
95
96 /// Optional. Orchestrator that is responsible for scheduling and running jobs
97 /// on the cluster.
98 pub orchestrator: std::option::Option<crate::model::Orchestrator>,
99
100 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
101}
102
103impl Cluster {
104 /// Creates a new default instance.
105 pub fn new() -> Self {
106 std::default::Default::default()
107 }
108
109 /// Sets the value of [name][crate::model::Cluster::name].
110 ///
111 /// # Example
112 /// ```ignore,no_run
113 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
114 /// # let project_id = "project_id";
115 /// # let location_id = "location_id";
116 /// # let cluster_id = "cluster_id";
117 /// let x = Cluster::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"));
118 /// ```
119 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.name = v.into();
121 self
122 }
123
124 /// Sets the value of [description][crate::model::Cluster::description].
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
129 /// let x = Cluster::new().set_description("example");
130 /// ```
131 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.description = v.into();
133 self
134 }
135
136 /// Sets the value of [labels][crate::model::Cluster::labels].
137 ///
138 /// # Example
139 /// ```ignore,no_run
140 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
141 /// let x = Cluster::new().set_labels([
142 /// ("key0", "abc"),
143 /// ("key1", "xyz"),
144 /// ]);
145 /// ```
146 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
147 where
148 T: std::iter::IntoIterator<Item = (K, V)>,
149 K: std::convert::Into<std::string::String>,
150 V: std::convert::Into<std::string::String>,
151 {
152 use std::iter::Iterator;
153 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
154 self
155 }
156
157 /// Sets the value of [create_time][crate::model::Cluster::create_time].
158 ///
159 /// # Example
160 /// ```ignore,no_run
161 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
162 /// use wkt::Timestamp;
163 /// let x = Cluster::new().set_create_time(Timestamp::default()/* use setters */);
164 /// ```
165 pub fn set_create_time<T>(mut self, v: T) -> Self
166 where
167 T: std::convert::Into<wkt::Timestamp>,
168 {
169 self.create_time = std::option::Option::Some(v.into());
170 self
171 }
172
173 /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
174 ///
175 /// # Example
176 /// ```ignore,no_run
177 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
178 /// use wkt::Timestamp;
179 /// let x = Cluster::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
180 /// let x = Cluster::new().set_or_clear_create_time(None::<Timestamp>);
181 /// ```
182 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
183 where
184 T: std::convert::Into<wkt::Timestamp>,
185 {
186 self.create_time = v.map(|x| x.into());
187 self
188 }
189
190 /// Sets the value of [update_time][crate::model::Cluster::update_time].
191 ///
192 /// # Example
193 /// ```ignore,no_run
194 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
195 /// use wkt::Timestamp;
196 /// let x = Cluster::new().set_update_time(Timestamp::default()/* use setters */);
197 /// ```
198 pub fn set_update_time<T>(mut self, v: T) -> Self
199 where
200 T: std::convert::Into<wkt::Timestamp>,
201 {
202 self.update_time = std::option::Option::Some(v.into());
203 self
204 }
205
206 /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
207 ///
208 /// # Example
209 /// ```ignore,no_run
210 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
211 /// use wkt::Timestamp;
212 /// let x = Cluster::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
213 /// let x = Cluster::new().set_or_clear_update_time(None::<Timestamp>);
214 /// ```
215 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
216 where
217 T: std::convert::Into<wkt::Timestamp>,
218 {
219 self.update_time = v.map(|x| x.into());
220 self
221 }
222
223 /// Sets the value of [reconciling][crate::model::Cluster::reconciling].
224 ///
225 /// # Example
226 /// ```ignore,no_run
227 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
228 /// let x = Cluster::new().set_reconciling(true);
229 /// ```
230 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
231 self.reconciling = v.into();
232 self
233 }
234
235 /// Sets the value of [network_resources][crate::model::Cluster::network_resources].
236 ///
237 /// # Example
238 /// ```ignore,no_run
239 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
240 /// use google_cloud_hypercomputecluster_v1::model::NetworkResource;
241 /// let x = Cluster::new().set_network_resources([
242 /// ("key0", NetworkResource::default()/* use setters */),
243 /// ("key1", NetworkResource::default()/* use (different) setters */),
244 /// ]);
245 /// ```
246 pub fn set_network_resources<T, K, V>(mut self, v: T) -> Self
247 where
248 T: std::iter::IntoIterator<Item = (K, V)>,
249 K: std::convert::Into<std::string::String>,
250 V: std::convert::Into<crate::model::NetworkResource>,
251 {
252 use std::iter::Iterator;
253 self.network_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
254 self
255 }
256
257 /// Sets the value of [storage_resources][crate::model::Cluster::storage_resources].
258 ///
259 /// # Example
260 /// ```ignore,no_run
261 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
262 /// use google_cloud_hypercomputecluster_v1::model::StorageResource;
263 /// let x = Cluster::new().set_storage_resources([
264 /// ("key0", StorageResource::default()/* use setters */),
265 /// ("key1", StorageResource::default()/* use (different) setters */),
266 /// ]);
267 /// ```
268 pub fn set_storage_resources<T, K, V>(mut self, v: T) -> Self
269 where
270 T: std::iter::IntoIterator<Item = (K, V)>,
271 K: std::convert::Into<std::string::String>,
272 V: std::convert::Into<crate::model::StorageResource>,
273 {
274 use std::iter::Iterator;
275 self.storage_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
276 self
277 }
278
279 /// Sets the value of [compute_resources][crate::model::Cluster::compute_resources].
280 ///
281 /// # Example
282 /// ```ignore,no_run
283 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
284 /// use google_cloud_hypercomputecluster_v1::model::ComputeResource;
285 /// let x = Cluster::new().set_compute_resources([
286 /// ("key0", ComputeResource::default()/* use setters */),
287 /// ("key1", ComputeResource::default()/* use (different) setters */),
288 /// ]);
289 /// ```
290 pub fn set_compute_resources<T, K, V>(mut self, v: T) -> Self
291 where
292 T: std::iter::IntoIterator<Item = (K, V)>,
293 K: std::convert::Into<std::string::String>,
294 V: std::convert::Into<crate::model::ComputeResource>,
295 {
296 use std::iter::Iterator;
297 self.compute_resources = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
298 self
299 }
300
301 /// Sets the value of [orchestrator][crate::model::Cluster::orchestrator].
302 ///
303 /// # Example
304 /// ```ignore,no_run
305 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
306 /// use google_cloud_hypercomputecluster_v1::model::Orchestrator;
307 /// let x = Cluster::new().set_orchestrator(Orchestrator::default()/* use setters */);
308 /// ```
309 pub fn set_orchestrator<T>(mut self, v: T) -> Self
310 where
311 T: std::convert::Into<crate::model::Orchestrator>,
312 {
313 self.orchestrator = std::option::Option::Some(v.into());
314 self
315 }
316
317 /// Sets or clears the value of [orchestrator][crate::model::Cluster::orchestrator].
318 ///
319 /// # Example
320 /// ```ignore,no_run
321 /// # use google_cloud_hypercomputecluster_v1::model::Cluster;
322 /// use google_cloud_hypercomputecluster_v1::model::Orchestrator;
323 /// let x = Cluster::new().set_or_clear_orchestrator(Some(Orchestrator::default()/* use setters */));
324 /// let x = Cluster::new().set_or_clear_orchestrator(None::<Orchestrator>);
325 /// ```
326 pub fn set_or_clear_orchestrator<T>(mut self, v: std::option::Option<T>) -> Self
327 where
328 T: std::convert::Into<crate::model::Orchestrator>,
329 {
330 self.orchestrator = v.map(|x| x.into());
331 self
332 }
333}
334
335impl wkt::message::Message for Cluster {
336 fn typename() -> &'static str {
337 "type.googleapis.com/google.cloud.hypercomputecluster.v1.Cluster"
338 }
339}
340
341/// Request message for
342/// [ListClusters][google.cloud.hypercomputecluster.v1.HypercomputeCluster.ListClusters].
343///
344/// [google.cloud.hypercomputecluster.v1.HypercomputeCluster.ListClusters]: crate::client::HypercomputeCluster::list_clusters
345#[derive(Clone, Default, PartialEq)]
346#[non_exhaustive]
347pub struct ListClustersRequest {
348 /// Required. Parent location of the clusters to list, in the format
349 /// `projects/{project}/locations/{location}`.
350 pub parent: std::string::String,
351
352 /// Optional. Maximum number of clusters to return. The service may return
353 /// fewer than this value.
354 pub page_size: i32,
355
356 /// Optional. A page token received from a previous `ListClusters` call.
357 /// Provide this to retrieve the subsequent page. When paginating, all other
358 /// parameters provided to `ListClusters` must match the call that provided the
359 /// page token.
360 pub page_token: std::string::String,
361
362 /// Optional. [Filter](https://google.aip.dev/160) to apply to the returned
363 /// results.
364 pub filter: std::string::String,
365
366 /// Optional. How to order the resulting clusters. Must be one of the following
367 /// strings:
368 ///
369 /// * `name`
370 /// * `name desc`
371 /// * `create_time`
372 /// * `create_time desc`
373 ///
374 /// If not specified, clusters will be returned in an arbitrary order.
375 pub order_by: std::string::String,
376
377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
378}
379
380impl ListClustersRequest {
381 /// Creates a new default instance.
382 pub fn new() -> Self {
383 std::default::Default::default()
384 }
385
386 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
387 ///
388 /// # Example
389 /// ```ignore,no_run
390 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersRequest;
391 /// # let project_id = "project_id";
392 /// # let location_id = "location_id";
393 /// let x = ListClustersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
394 /// ```
395 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
396 self.parent = v.into();
397 self
398 }
399
400 /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
401 ///
402 /// # Example
403 /// ```ignore,no_run
404 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersRequest;
405 /// let x = ListClustersRequest::new().set_page_size(42);
406 /// ```
407 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
408 self.page_size = v.into();
409 self
410 }
411
412 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
413 ///
414 /// # Example
415 /// ```ignore,no_run
416 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersRequest;
417 /// let x = ListClustersRequest::new().set_page_token("example");
418 /// ```
419 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
420 self.page_token = v.into();
421 self
422 }
423
424 /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersRequest;
429 /// let x = ListClustersRequest::new().set_filter("example");
430 /// ```
431 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
432 self.filter = v.into();
433 self
434 }
435
436 /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
437 ///
438 /// # Example
439 /// ```ignore,no_run
440 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersRequest;
441 /// let x = ListClustersRequest::new().set_order_by("example");
442 /// ```
443 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
444 self.order_by = v.into();
445 self
446 }
447}
448
449impl wkt::message::Message for ListClustersRequest {
450 fn typename() -> &'static str {
451 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ListClustersRequest"
452 }
453}
454
455/// Response message for
456/// [ListClusters][google.cloud.hypercomputecluster.v1.HypercomputeCluster.ListClusters].
457///
458/// [google.cloud.hypercomputecluster.v1.HypercomputeCluster.ListClusters]: crate::client::HypercomputeCluster::list_clusters
459#[derive(Clone, Default, PartialEq)]
460#[non_exhaustive]
461pub struct ListClustersResponse {
462 /// Clusters in the specified location.
463 pub clusters: std::vec::Vec<crate::model::Cluster>,
464
465 /// A token that can be sent as `page_token` to retrieve the next page. If this
466 /// field is absent, there are no subsequent pages.
467 pub next_page_token: std::string::String,
468
469 /// Locations that could not be reached.
470 pub unreachable: std::vec::Vec<std::string::String>,
471
472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
473}
474
475impl ListClustersResponse {
476 /// Creates a new default instance.
477 pub fn new() -> Self {
478 std::default::Default::default()
479 }
480
481 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
482 ///
483 /// # Example
484 /// ```ignore,no_run
485 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersResponse;
486 /// use google_cloud_hypercomputecluster_v1::model::Cluster;
487 /// let x = ListClustersResponse::new()
488 /// .set_clusters([
489 /// Cluster::default()/* use setters */,
490 /// Cluster::default()/* use (different) setters */,
491 /// ]);
492 /// ```
493 pub fn set_clusters<T, V>(mut self, v: T) -> Self
494 where
495 T: std::iter::IntoIterator<Item = V>,
496 V: std::convert::Into<crate::model::Cluster>,
497 {
498 use std::iter::Iterator;
499 self.clusters = v.into_iter().map(|i| i.into()).collect();
500 self
501 }
502
503 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
504 ///
505 /// # Example
506 /// ```ignore,no_run
507 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersResponse;
508 /// let x = ListClustersResponse::new().set_next_page_token("example");
509 /// ```
510 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
511 self.next_page_token = v.into();
512 self
513 }
514
515 /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
516 ///
517 /// # Example
518 /// ```ignore,no_run
519 /// # use google_cloud_hypercomputecluster_v1::model::ListClustersResponse;
520 /// let x = ListClustersResponse::new().set_unreachable(["a", "b", "c"]);
521 /// ```
522 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
523 where
524 T: std::iter::IntoIterator<Item = V>,
525 V: std::convert::Into<std::string::String>,
526 {
527 use std::iter::Iterator;
528 self.unreachable = v.into_iter().map(|i| i.into()).collect();
529 self
530 }
531}
532
533impl wkt::message::Message for ListClustersResponse {
534 fn typename() -> &'static str {
535 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ListClustersResponse"
536 }
537}
538
539#[doc(hidden)]
540impl google_cloud_gax::paginator::internal::PageableResponse for ListClustersResponse {
541 type PageItem = crate::model::Cluster;
542
543 fn items(self) -> std::vec::Vec<Self::PageItem> {
544 self.clusters
545 }
546
547 fn next_page_token(&self) -> std::string::String {
548 use std::clone::Clone;
549 self.next_page_token.clone()
550 }
551}
552
553/// Request message for
554/// [GetCluster][google.cloud.hypercomputecluster.v1.HypercomputeCluster.GetCluster].
555///
556/// [google.cloud.hypercomputecluster.v1.HypercomputeCluster.GetCluster]: crate::client::HypercomputeCluster::get_cluster
557#[derive(Clone, Default, PartialEq)]
558#[non_exhaustive]
559pub struct GetClusterRequest {
560 /// Required. Name of the cluster to retrieve, in the format
561 /// `projects/{project}/locations/{location}/clusters/{cluster}`.
562 pub name: std::string::String,
563
564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
565}
566
567impl GetClusterRequest {
568 /// Creates a new default instance.
569 pub fn new() -> Self {
570 std::default::Default::default()
571 }
572
573 /// Sets the value of [name][crate::model::GetClusterRequest::name].
574 ///
575 /// # Example
576 /// ```ignore,no_run
577 /// # use google_cloud_hypercomputecluster_v1::model::GetClusterRequest;
578 /// # let project_id = "project_id";
579 /// # let location_id = "location_id";
580 /// # let cluster_id = "cluster_id";
581 /// let x = GetClusterRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"));
582 /// ```
583 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
584 self.name = v.into();
585 self
586 }
587}
588
589impl wkt::message::Message for GetClusterRequest {
590 fn typename() -> &'static str {
591 "type.googleapis.com/google.cloud.hypercomputecluster.v1.GetClusterRequest"
592 }
593}
594
595/// Request message for
596/// [CreateCluster][google.cloud.hypercomputecluster.v1.HypercomputeCluster.CreateCluster].
597///
598/// [google.cloud.hypercomputecluster.v1.HypercomputeCluster.CreateCluster]: crate::client::HypercomputeCluster::create_cluster
599#[derive(Clone, Default, PartialEq)]
600#[non_exhaustive]
601pub struct CreateClusterRequest {
602 /// Required. Parent location in which the cluster should be created, in the
603 /// format `projects/{project}/locations/{location}`.
604 pub parent: std::string::String,
605
606 /// Required. ID of the cluster to create. Must conform to
607 /// [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
608 /// alphanumeric, and at most 63 characters).
609 pub cluster_id: std::string::String,
610
611 /// Required. Cluster to create.
612 pub cluster: std::option::Option<crate::model::Cluster>,
613
614 /// Optional. A unique identifier for this request. A random UUID is
615 /// recommended. This request is idempotent if and only if `request_id` is
616 /// provided.
617 pub request_id: std::string::String,
618
619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
620}
621
622impl CreateClusterRequest {
623 /// Creates a new default instance.
624 pub fn new() -> Self {
625 std::default::Default::default()
626 }
627
628 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
629 ///
630 /// # Example
631 /// ```ignore,no_run
632 /// # use google_cloud_hypercomputecluster_v1::model::CreateClusterRequest;
633 /// # let project_id = "project_id";
634 /// # let location_id = "location_id";
635 /// let x = CreateClusterRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
636 /// ```
637 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
638 self.parent = v.into();
639 self
640 }
641
642 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
643 ///
644 /// # Example
645 /// ```ignore,no_run
646 /// # use google_cloud_hypercomputecluster_v1::model::CreateClusterRequest;
647 /// let x = CreateClusterRequest::new().set_cluster_id("example");
648 /// ```
649 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650 self.cluster_id = v.into();
651 self
652 }
653
654 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
655 ///
656 /// # Example
657 /// ```ignore,no_run
658 /// # use google_cloud_hypercomputecluster_v1::model::CreateClusterRequest;
659 /// use google_cloud_hypercomputecluster_v1::model::Cluster;
660 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
661 /// ```
662 pub fn set_cluster<T>(mut self, v: T) -> Self
663 where
664 T: std::convert::Into<crate::model::Cluster>,
665 {
666 self.cluster = std::option::Option::Some(v.into());
667 self
668 }
669
670 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
671 ///
672 /// # Example
673 /// ```ignore,no_run
674 /// # use google_cloud_hypercomputecluster_v1::model::CreateClusterRequest;
675 /// use google_cloud_hypercomputecluster_v1::model::Cluster;
676 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
677 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
678 /// ```
679 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
680 where
681 T: std::convert::Into<crate::model::Cluster>,
682 {
683 self.cluster = v.map(|x| x.into());
684 self
685 }
686
687 /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
688 ///
689 /// # Example
690 /// ```ignore,no_run
691 /// # use google_cloud_hypercomputecluster_v1::model::CreateClusterRequest;
692 /// let x = CreateClusterRequest::new().set_request_id("example");
693 /// ```
694 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
695 self.request_id = v.into();
696 self
697 }
698}
699
700impl wkt::message::Message for CreateClusterRequest {
701 fn typename() -> &'static str {
702 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateClusterRequest"
703 }
704}
705
706/// Request message for
707/// [UpdateCluster][google.cloud.hypercomputecluster.v1.HypercomputeCluster.UpdateCluster].
708///
709/// [google.cloud.hypercomputecluster.v1.HypercomputeCluster.UpdateCluster]: crate::client::HypercomputeCluster::update_cluster
710#[derive(Clone, Default, PartialEq)]
711#[non_exhaustive]
712pub struct UpdateClusterRequest {
713 /// Required. Cluster to update.
714 pub cluster: std::option::Option<crate::model::Cluster>,
715
716 /// Optional. Mask specifying which fields in the cluster to update. All paths
717 /// must be specified explicitly - wildcards are not supported. At least one
718 /// path must be provided.
719 pub update_mask: std::option::Option<wkt::FieldMask>,
720
721 /// Optional. A unique identifier for this request. A random UUID is
722 /// recommended. This request is idempotent if and only if `request_id` is
723 /// provided.
724 pub request_id: std::string::String,
725
726 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
727}
728
729impl UpdateClusterRequest {
730 /// Creates a new default instance.
731 pub fn new() -> Self {
732 std::default::Default::default()
733 }
734
735 /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
736 ///
737 /// # Example
738 /// ```ignore,no_run
739 /// # use google_cloud_hypercomputecluster_v1::model::UpdateClusterRequest;
740 /// use google_cloud_hypercomputecluster_v1::model::Cluster;
741 /// let x = UpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
742 /// ```
743 pub fn set_cluster<T>(mut self, v: T) -> Self
744 where
745 T: std::convert::Into<crate::model::Cluster>,
746 {
747 self.cluster = std::option::Option::Some(v.into());
748 self
749 }
750
751 /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
752 ///
753 /// # Example
754 /// ```ignore,no_run
755 /// # use google_cloud_hypercomputecluster_v1::model::UpdateClusterRequest;
756 /// use google_cloud_hypercomputecluster_v1::model::Cluster;
757 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
758 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
759 /// ```
760 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
761 where
762 T: std::convert::Into<crate::model::Cluster>,
763 {
764 self.cluster = v.map(|x| x.into());
765 self
766 }
767
768 /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
769 ///
770 /// # Example
771 /// ```ignore,no_run
772 /// # use google_cloud_hypercomputecluster_v1::model::UpdateClusterRequest;
773 /// use wkt::FieldMask;
774 /// let x = UpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
775 /// ```
776 pub fn set_update_mask<T>(mut self, v: T) -> Self
777 where
778 T: std::convert::Into<wkt::FieldMask>,
779 {
780 self.update_mask = std::option::Option::Some(v.into());
781 self
782 }
783
784 /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
785 ///
786 /// # Example
787 /// ```ignore,no_run
788 /// # use google_cloud_hypercomputecluster_v1::model::UpdateClusterRequest;
789 /// use wkt::FieldMask;
790 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
791 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
792 /// ```
793 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
794 where
795 T: std::convert::Into<wkt::FieldMask>,
796 {
797 self.update_mask = v.map(|x| x.into());
798 self
799 }
800
801 /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
802 ///
803 /// # Example
804 /// ```ignore,no_run
805 /// # use google_cloud_hypercomputecluster_v1::model::UpdateClusterRequest;
806 /// let x = UpdateClusterRequest::new().set_request_id("example");
807 /// ```
808 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
809 self.request_id = v.into();
810 self
811 }
812}
813
814impl wkt::message::Message for UpdateClusterRequest {
815 fn typename() -> &'static str {
816 "type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateClusterRequest"
817 }
818}
819
820/// Request message for
821/// [DeleteCluster][google.cloud.hypercomputecluster.v1.HypercomputeCluster.DeleteCluster].
822///
823/// [google.cloud.hypercomputecluster.v1.HypercomputeCluster.DeleteCluster]: crate::client::HypercomputeCluster::delete_cluster
824#[derive(Clone, Default, PartialEq)]
825#[non_exhaustive]
826pub struct DeleteClusterRequest {
827 /// Required. Name of the cluster to delete, in the format
828 /// `projects/{project}/locations/{location}/clusters/{cluster}`.
829 pub name: std::string::String,
830
831 /// Optional. A unique identifier for this request. A random UUID is
832 /// recommended. This request is idempotent if and only if `request_id` is
833 /// provided.
834 pub request_id: std::string::String,
835
836 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
837}
838
839impl DeleteClusterRequest {
840 /// Creates a new default instance.
841 pub fn new() -> Self {
842 std::default::Default::default()
843 }
844
845 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
846 ///
847 /// # Example
848 /// ```ignore,no_run
849 /// # use google_cloud_hypercomputecluster_v1::model::DeleteClusterRequest;
850 /// # let project_id = "project_id";
851 /// # let location_id = "location_id";
852 /// # let cluster_id = "cluster_id";
853 /// let x = DeleteClusterRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/clusters/{cluster_id}"));
854 /// ```
855 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
856 self.name = v.into();
857 self
858 }
859
860 /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
861 ///
862 /// # Example
863 /// ```ignore,no_run
864 /// # use google_cloud_hypercomputecluster_v1::model::DeleteClusterRequest;
865 /// let x = DeleteClusterRequest::new().set_request_id("example");
866 /// ```
867 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
868 self.request_id = v.into();
869 self
870 }
871}
872
873impl wkt::message::Message for DeleteClusterRequest {
874 fn typename() -> &'static str {
875 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteClusterRequest"
876 }
877}
878
879/// A resource representing a network that connects the various components of a
880/// cluster together.
881#[derive(Clone, Default, PartialEq)]
882#[non_exhaustive]
883pub struct NetworkResource {
884 /// Immutable. Configuration for this network resource, which describes how it
885 /// should be created or imported. This field only controls how the network
886 /// resource is initially created or imported. Subsequent changes to the
887 /// network resource should be made via the resource's API and will not be
888 /// reflected in the configuration.
889 pub config: std::option::Option<crate::model::NetworkResourceConfig>,
890
891 /// Reference to the network resource in Google Cloud. Exactly one of these
892 /// fields will be populated based on the configured type of network resource.
893 pub reference: std::option::Option<crate::model::network_resource::Reference>,
894
895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
896}
897
898impl NetworkResource {
899 /// Creates a new default instance.
900 pub fn new() -> Self {
901 std::default::Default::default()
902 }
903
904 /// Sets the value of [config][crate::model::NetworkResource::config].
905 ///
906 /// # Example
907 /// ```ignore,no_run
908 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResource;
909 /// use google_cloud_hypercomputecluster_v1::model::NetworkResourceConfig;
910 /// let x = NetworkResource::new().set_config(NetworkResourceConfig::default()/* use setters */);
911 /// ```
912 pub fn set_config<T>(mut self, v: T) -> Self
913 where
914 T: std::convert::Into<crate::model::NetworkResourceConfig>,
915 {
916 self.config = std::option::Option::Some(v.into());
917 self
918 }
919
920 /// Sets or clears the value of [config][crate::model::NetworkResource::config].
921 ///
922 /// # Example
923 /// ```ignore,no_run
924 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResource;
925 /// use google_cloud_hypercomputecluster_v1::model::NetworkResourceConfig;
926 /// let x = NetworkResource::new().set_or_clear_config(Some(NetworkResourceConfig::default()/* use setters */));
927 /// let x = NetworkResource::new().set_or_clear_config(None::<NetworkResourceConfig>);
928 /// ```
929 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
930 where
931 T: std::convert::Into<crate::model::NetworkResourceConfig>,
932 {
933 self.config = v.map(|x| x.into());
934 self
935 }
936
937 /// Sets the value of [reference][crate::model::NetworkResource::reference].
938 ///
939 /// Note that all the setters affecting `reference` are mutually
940 /// exclusive.
941 ///
942 /// # Example
943 /// ```ignore,no_run
944 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResource;
945 /// use google_cloud_hypercomputecluster_v1::model::NetworkReference;
946 /// let x = NetworkResource::new().set_reference(Some(
947 /// google_cloud_hypercomputecluster_v1::model::network_resource::Reference::Network(NetworkReference::default().into())));
948 /// ```
949 pub fn set_reference<
950 T: std::convert::Into<std::option::Option<crate::model::network_resource::Reference>>,
951 >(
952 mut self,
953 v: T,
954 ) -> Self {
955 self.reference = v.into();
956 self
957 }
958
959 /// The value of [reference][crate::model::NetworkResource::reference]
960 /// if it holds a `Network`, `None` if the field is not set or
961 /// holds a different branch.
962 pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkReference>> {
963 #[allow(unreachable_patterns)]
964 self.reference.as_ref().and_then(|v| match v {
965 crate::model::network_resource::Reference::Network(v) => std::option::Option::Some(v),
966 _ => std::option::Option::None,
967 })
968 }
969
970 /// Sets the value of [reference][crate::model::NetworkResource::reference]
971 /// to hold a `Network`.
972 ///
973 /// Note that all the setters affecting `reference` are
974 /// mutually exclusive.
975 ///
976 /// # Example
977 /// ```ignore,no_run
978 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResource;
979 /// use google_cloud_hypercomputecluster_v1::model::NetworkReference;
980 /// let x = NetworkResource::new().set_network(NetworkReference::default()/* use setters */);
981 /// assert!(x.network().is_some());
982 /// ```
983 pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkReference>>>(
984 mut self,
985 v: T,
986 ) -> Self {
987 self.reference =
988 std::option::Option::Some(crate::model::network_resource::Reference::Network(v.into()));
989 self
990 }
991}
992
993impl wkt::message::Message for NetworkResource {
994 fn typename() -> &'static str {
995 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NetworkResource"
996 }
997}
998
999/// Defines additional types related to [NetworkResource].
1000pub mod network_resource {
1001 #[allow(unused_imports)]
1002 use super::*;
1003
1004 /// Reference to the network resource in Google Cloud. Exactly one of these
1005 /// fields will be populated based on the configured type of network resource.
1006 #[derive(Clone, Debug, PartialEq)]
1007 #[non_exhaustive]
1008 pub enum Reference {
1009 /// Reference to a network in Google Compute Engine.
1010 Network(std::boxed::Box<crate::model::NetworkReference>),
1011 }
1012}
1013
1014/// A reference to a [VPC network](https://cloud.google.com/vpc/docs/vpc) in
1015/// Google Compute Engine.
1016#[derive(Clone, Default, PartialEq)]
1017#[non_exhaustive]
1018pub struct NetworkReference {
1019 /// Output only. Name of the network, in the format
1020 /// `projects/{project}/global/networks/{network}`.
1021 pub network: std::string::String,
1022
1023 /// Output only. Name of the particular subnetwork being used by the cluster,
1024 /// in the format
1025 /// `projects/{project}/regions/{region}/subnetworks/{subnetwork}`.
1026 pub subnetwork: std::string::String,
1027
1028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1029}
1030
1031impl NetworkReference {
1032 /// Creates a new default instance.
1033 pub fn new() -> Self {
1034 std::default::Default::default()
1035 }
1036
1037 /// Sets the value of [network][crate::model::NetworkReference::network].
1038 ///
1039 /// # Example
1040 /// ```ignore,no_run
1041 /// # use google_cloud_hypercomputecluster_v1::model::NetworkReference;
1042 /// let x = NetworkReference::new().set_network("example");
1043 /// ```
1044 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1045 self.network = v.into();
1046 self
1047 }
1048
1049 /// Sets the value of [subnetwork][crate::model::NetworkReference::subnetwork].
1050 ///
1051 /// # Example
1052 /// ```ignore,no_run
1053 /// # use google_cloud_hypercomputecluster_v1::model::NetworkReference;
1054 /// let x = NetworkReference::new().set_subnetwork("example");
1055 /// ```
1056 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057 self.subnetwork = v.into();
1058 self
1059 }
1060}
1061
1062impl wkt::message::Message for NetworkReference {
1063 fn typename() -> &'static str {
1064 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NetworkReference"
1065 }
1066}
1067
1068/// Describes how a network resource should be initialized. Each network resource
1069/// can either be imported from an existing Google Cloud resource or initialized
1070/// when the cluster is created.
1071#[derive(Clone, Default, PartialEq)]
1072#[non_exhaustive]
1073pub struct NetworkResourceConfig {
1074 /// Particular type of configuration for this network resource.
1075 pub config: std::option::Option<crate::model::network_resource_config::Config>,
1076
1077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1078}
1079
1080impl NetworkResourceConfig {
1081 /// Creates a new default instance.
1082 pub fn new() -> Self {
1083 std::default::Default::default()
1084 }
1085
1086 /// Sets the value of [config][crate::model::NetworkResourceConfig::config].
1087 ///
1088 /// Note that all the setters affecting `config` are mutually
1089 /// exclusive.
1090 ///
1091 /// # Example
1092 /// ```ignore,no_run
1093 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResourceConfig;
1094 /// use google_cloud_hypercomputecluster_v1::model::NewNetworkConfig;
1095 /// let x = NetworkResourceConfig::new().set_config(Some(
1096 /// google_cloud_hypercomputecluster_v1::model::network_resource_config::Config::NewNetwork(NewNetworkConfig::default().into())));
1097 /// ```
1098 pub fn set_config<
1099 T: std::convert::Into<std::option::Option<crate::model::network_resource_config::Config>>,
1100 >(
1101 mut self,
1102 v: T,
1103 ) -> Self {
1104 self.config = v.into();
1105 self
1106 }
1107
1108 /// The value of [config][crate::model::NetworkResourceConfig::config]
1109 /// if it holds a `NewNetwork`, `None` if the field is not set or
1110 /// holds a different branch.
1111 pub fn new_network(
1112 &self,
1113 ) -> std::option::Option<&std::boxed::Box<crate::model::NewNetworkConfig>> {
1114 #[allow(unreachable_patterns)]
1115 self.config.as_ref().and_then(|v| match v {
1116 crate::model::network_resource_config::Config::NewNetwork(v) => {
1117 std::option::Option::Some(v)
1118 }
1119 _ => std::option::Option::None,
1120 })
1121 }
1122
1123 /// Sets the value of [config][crate::model::NetworkResourceConfig::config]
1124 /// to hold a `NewNetwork`.
1125 ///
1126 /// Note that all the setters affecting `config` are
1127 /// mutually exclusive.
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResourceConfig;
1132 /// use google_cloud_hypercomputecluster_v1::model::NewNetworkConfig;
1133 /// let x = NetworkResourceConfig::new().set_new_network(NewNetworkConfig::default()/* use setters */);
1134 /// assert!(x.new_network().is_some());
1135 /// assert!(x.existing_network().is_none());
1136 /// ```
1137 pub fn set_new_network<
1138 T: std::convert::Into<std::boxed::Box<crate::model::NewNetworkConfig>>,
1139 >(
1140 mut self,
1141 v: T,
1142 ) -> Self {
1143 self.config = std::option::Option::Some(
1144 crate::model::network_resource_config::Config::NewNetwork(v.into()),
1145 );
1146 self
1147 }
1148
1149 /// The value of [config][crate::model::NetworkResourceConfig::config]
1150 /// if it holds a `ExistingNetwork`, `None` if the field is not set or
1151 /// holds a different branch.
1152 pub fn existing_network(
1153 &self,
1154 ) -> std::option::Option<&std::boxed::Box<crate::model::ExistingNetworkConfig>> {
1155 #[allow(unreachable_patterns)]
1156 self.config.as_ref().and_then(|v| match v {
1157 crate::model::network_resource_config::Config::ExistingNetwork(v) => {
1158 std::option::Option::Some(v)
1159 }
1160 _ => std::option::Option::None,
1161 })
1162 }
1163
1164 /// Sets the value of [config][crate::model::NetworkResourceConfig::config]
1165 /// to hold a `ExistingNetwork`.
1166 ///
1167 /// Note that all the setters affecting `config` are
1168 /// mutually exclusive.
1169 ///
1170 /// # Example
1171 /// ```ignore,no_run
1172 /// # use google_cloud_hypercomputecluster_v1::model::NetworkResourceConfig;
1173 /// use google_cloud_hypercomputecluster_v1::model::ExistingNetworkConfig;
1174 /// let x = NetworkResourceConfig::new().set_existing_network(ExistingNetworkConfig::default()/* use setters */);
1175 /// assert!(x.existing_network().is_some());
1176 /// assert!(x.new_network().is_none());
1177 /// ```
1178 pub fn set_existing_network<
1179 T: std::convert::Into<std::boxed::Box<crate::model::ExistingNetworkConfig>>,
1180 >(
1181 mut self,
1182 v: T,
1183 ) -> Self {
1184 self.config = std::option::Option::Some(
1185 crate::model::network_resource_config::Config::ExistingNetwork(v.into()),
1186 );
1187 self
1188 }
1189}
1190
1191impl wkt::message::Message for NetworkResourceConfig {
1192 fn typename() -> &'static str {
1193 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NetworkResourceConfig"
1194 }
1195}
1196
1197/// Defines additional types related to [NetworkResourceConfig].
1198pub mod network_resource_config {
1199 #[allow(unused_imports)]
1200 use super::*;
1201
1202 /// Particular type of configuration for this network resource.
1203 #[derive(Clone, Debug, PartialEq)]
1204 #[non_exhaustive]
1205 pub enum Config {
1206 /// Optional. Immutable. If set, indicates that a new network should be
1207 /// created.
1208 NewNetwork(std::boxed::Box<crate::model::NewNetworkConfig>),
1209 /// Optional. Immutable. If set, indicates that an existing network should be
1210 /// imported.
1211 ExistingNetwork(std::boxed::Box<crate::model::ExistingNetworkConfig>),
1212 }
1213}
1214
1215/// When set in a
1216/// [NetworkResourceConfig][google.cloud.hypercomputecluster.v1.NetworkResourceConfig],
1217/// indicates that a new network should be created.
1218///
1219/// [google.cloud.hypercomputecluster.v1.NetworkResourceConfig]: crate::model::NetworkResourceConfig
1220#[derive(Clone, Default, PartialEq)]
1221#[non_exhaustive]
1222pub struct NewNetworkConfig {
1223 /// Required. Immutable. Name of the network to create, in the format
1224 /// `projects/{project}/global/networks/{network}`.
1225 pub network: std::string::String,
1226
1227 /// Optional. Immutable. Description of the network. Maximum of 2048
1228 /// characters.
1229 pub description: std::string::String,
1230
1231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1232}
1233
1234impl NewNetworkConfig {
1235 /// Creates a new default instance.
1236 pub fn new() -> Self {
1237 std::default::Default::default()
1238 }
1239
1240 /// Sets the value of [network][crate::model::NewNetworkConfig::network].
1241 ///
1242 /// # Example
1243 /// ```ignore,no_run
1244 /// # use google_cloud_hypercomputecluster_v1::model::NewNetworkConfig;
1245 /// let x = NewNetworkConfig::new().set_network("example");
1246 /// ```
1247 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1248 self.network = v.into();
1249 self
1250 }
1251
1252 /// Sets the value of [description][crate::model::NewNetworkConfig::description].
1253 ///
1254 /// # Example
1255 /// ```ignore,no_run
1256 /// # use google_cloud_hypercomputecluster_v1::model::NewNetworkConfig;
1257 /// let x = NewNetworkConfig::new().set_description("example");
1258 /// ```
1259 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.description = v.into();
1261 self
1262 }
1263}
1264
1265impl wkt::message::Message for NewNetworkConfig {
1266 fn typename() -> &'static str {
1267 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewNetworkConfig"
1268 }
1269}
1270
1271/// When set in a
1272/// [NetworkResourceConfig][google.cloud.hypercomputecluster.v1.NetworkResourceConfig],
1273/// indicates that an existing network should be imported.
1274///
1275/// [google.cloud.hypercomputecluster.v1.NetworkResourceConfig]: crate::model::NetworkResourceConfig
1276#[derive(Clone, Default, PartialEq)]
1277#[non_exhaustive]
1278pub struct ExistingNetworkConfig {
1279 /// Required. Immutable. Name of the network to import, in the format
1280 /// `projects/{project}/global/networks/{network}`.
1281 pub network: std::string::String,
1282
1283 /// Required. Immutable. Particular subnetwork to use, in the format
1284 /// `projects/{project}/regions/{region}/subnetworks/{subnetwork}`.
1285 pub subnetwork: std::string::String,
1286
1287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1288}
1289
1290impl ExistingNetworkConfig {
1291 /// Creates a new default instance.
1292 pub fn new() -> Self {
1293 std::default::Default::default()
1294 }
1295
1296 /// Sets the value of [network][crate::model::ExistingNetworkConfig::network].
1297 ///
1298 /// # Example
1299 /// ```ignore,no_run
1300 /// # use google_cloud_hypercomputecluster_v1::model::ExistingNetworkConfig;
1301 /// let x = ExistingNetworkConfig::new().set_network("example");
1302 /// ```
1303 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1304 self.network = v.into();
1305 self
1306 }
1307
1308 /// Sets the value of [subnetwork][crate::model::ExistingNetworkConfig::subnetwork].
1309 ///
1310 /// # Example
1311 /// ```ignore,no_run
1312 /// # use google_cloud_hypercomputecluster_v1::model::ExistingNetworkConfig;
1313 /// let x = ExistingNetworkConfig::new().set_subnetwork("example");
1314 /// ```
1315 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1316 self.subnetwork = v.into();
1317 self
1318 }
1319}
1320
1321impl wkt::message::Message for ExistingNetworkConfig {
1322 fn typename() -> &'static str {
1323 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingNetworkConfig"
1324 }
1325}
1326
1327/// A resource representing a form of persistent storage that is accessible to
1328/// compute resources in the cluster.
1329#[derive(Clone, Default, PartialEq)]
1330#[non_exhaustive]
1331pub struct StorageResource {
1332 /// Required. Immutable. Configuration for this storage resource, which
1333 /// describes how it should be created or imported. This field only controls
1334 /// how the storage resource is initially created or imported. Subsequent
1335 /// changes to the storage resource should be made via the resource's API and
1336 /// will not be reflected in the configuration.
1337 pub config: std::option::Option<crate::model::StorageResourceConfig>,
1338
1339 /// Reference to the storage resource in Google Cloud. Exactly one of these
1340 /// fields will be populated based on the configured type of storage resource.
1341 pub reference: std::option::Option<crate::model::storage_resource::Reference>,
1342
1343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1344}
1345
1346impl StorageResource {
1347 /// Creates a new default instance.
1348 pub fn new() -> Self {
1349 std::default::Default::default()
1350 }
1351
1352 /// Sets the value of [config][crate::model::StorageResource::config].
1353 ///
1354 /// # Example
1355 /// ```ignore,no_run
1356 /// # use google_cloud_hypercomputecluster_v1::model::StorageResource;
1357 /// use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1358 /// let x = StorageResource::new().set_config(StorageResourceConfig::default()/* use setters */);
1359 /// ```
1360 pub fn set_config<T>(mut self, v: T) -> Self
1361 where
1362 T: std::convert::Into<crate::model::StorageResourceConfig>,
1363 {
1364 self.config = std::option::Option::Some(v.into());
1365 self
1366 }
1367
1368 /// Sets or clears the value of [config][crate::model::StorageResource::config].
1369 ///
1370 /// # Example
1371 /// ```ignore,no_run
1372 /// # use google_cloud_hypercomputecluster_v1::model::StorageResource;
1373 /// use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1374 /// let x = StorageResource::new().set_or_clear_config(Some(StorageResourceConfig::default()/* use setters */));
1375 /// let x = StorageResource::new().set_or_clear_config(None::<StorageResourceConfig>);
1376 /// ```
1377 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
1378 where
1379 T: std::convert::Into<crate::model::StorageResourceConfig>,
1380 {
1381 self.config = v.map(|x| x.into());
1382 self
1383 }
1384
1385 /// Sets the value of [reference][crate::model::StorageResource::reference].
1386 ///
1387 /// Note that all the setters affecting `reference` are mutually
1388 /// exclusive.
1389 ///
1390 /// # Example
1391 /// ```ignore,no_run
1392 /// # use google_cloud_hypercomputecluster_v1::model::StorageResource;
1393 /// use google_cloud_hypercomputecluster_v1::model::FilestoreReference;
1394 /// let x = StorageResource::new().set_reference(Some(
1395 /// google_cloud_hypercomputecluster_v1::model::storage_resource::Reference::Filestore(FilestoreReference::default().into())));
1396 /// ```
1397 pub fn set_reference<
1398 T: std::convert::Into<std::option::Option<crate::model::storage_resource::Reference>>,
1399 >(
1400 mut self,
1401 v: T,
1402 ) -> Self {
1403 self.reference = v.into();
1404 self
1405 }
1406
1407 /// The value of [reference][crate::model::StorageResource::reference]
1408 /// if it holds a `Filestore`, `None` if the field is not set or
1409 /// holds a different branch.
1410 pub fn filestore(
1411 &self,
1412 ) -> std::option::Option<&std::boxed::Box<crate::model::FilestoreReference>> {
1413 #[allow(unreachable_patterns)]
1414 self.reference.as_ref().and_then(|v| match v {
1415 crate::model::storage_resource::Reference::Filestore(v) => std::option::Option::Some(v),
1416 _ => std::option::Option::None,
1417 })
1418 }
1419
1420 /// Sets the value of [reference][crate::model::StorageResource::reference]
1421 /// to hold a `Filestore`.
1422 ///
1423 /// Note that all the setters affecting `reference` are
1424 /// mutually exclusive.
1425 ///
1426 /// # Example
1427 /// ```ignore,no_run
1428 /// # use google_cloud_hypercomputecluster_v1::model::StorageResource;
1429 /// use google_cloud_hypercomputecluster_v1::model::FilestoreReference;
1430 /// let x = StorageResource::new().set_filestore(FilestoreReference::default()/* use setters */);
1431 /// assert!(x.filestore().is_some());
1432 /// assert!(x.bucket().is_none());
1433 /// assert!(x.lustre().is_none());
1434 /// ```
1435 pub fn set_filestore<
1436 T: std::convert::Into<std::boxed::Box<crate::model::FilestoreReference>>,
1437 >(
1438 mut self,
1439 v: T,
1440 ) -> Self {
1441 self.reference = std::option::Option::Some(
1442 crate::model::storage_resource::Reference::Filestore(v.into()),
1443 );
1444 self
1445 }
1446
1447 /// The value of [reference][crate::model::StorageResource::reference]
1448 /// if it holds a `Bucket`, `None` if the field is not set or
1449 /// holds a different branch.
1450 pub fn bucket(&self) -> std::option::Option<&std::boxed::Box<crate::model::BucketReference>> {
1451 #[allow(unreachable_patterns)]
1452 self.reference.as_ref().and_then(|v| match v {
1453 crate::model::storage_resource::Reference::Bucket(v) => std::option::Option::Some(v),
1454 _ => std::option::Option::None,
1455 })
1456 }
1457
1458 /// Sets the value of [reference][crate::model::StorageResource::reference]
1459 /// to hold a `Bucket`.
1460 ///
1461 /// Note that all the setters affecting `reference` are
1462 /// mutually exclusive.
1463 ///
1464 /// # Example
1465 /// ```ignore,no_run
1466 /// # use google_cloud_hypercomputecluster_v1::model::StorageResource;
1467 /// use google_cloud_hypercomputecluster_v1::model::BucketReference;
1468 /// let x = StorageResource::new().set_bucket(BucketReference::default()/* use setters */);
1469 /// assert!(x.bucket().is_some());
1470 /// assert!(x.filestore().is_none());
1471 /// assert!(x.lustre().is_none());
1472 /// ```
1473 pub fn set_bucket<T: std::convert::Into<std::boxed::Box<crate::model::BucketReference>>>(
1474 mut self,
1475 v: T,
1476 ) -> Self {
1477 self.reference =
1478 std::option::Option::Some(crate::model::storage_resource::Reference::Bucket(v.into()));
1479 self
1480 }
1481
1482 /// The value of [reference][crate::model::StorageResource::reference]
1483 /// if it holds a `Lustre`, `None` if the field is not set or
1484 /// holds a different branch.
1485 pub fn lustre(&self) -> std::option::Option<&std::boxed::Box<crate::model::LustreReference>> {
1486 #[allow(unreachable_patterns)]
1487 self.reference.as_ref().and_then(|v| match v {
1488 crate::model::storage_resource::Reference::Lustre(v) => std::option::Option::Some(v),
1489 _ => std::option::Option::None,
1490 })
1491 }
1492
1493 /// Sets the value of [reference][crate::model::StorageResource::reference]
1494 /// to hold a `Lustre`.
1495 ///
1496 /// Note that all the setters affecting `reference` are
1497 /// mutually exclusive.
1498 ///
1499 /// # Example
1500 /// ```ignore,no_run
1501 /// # use google_cloud_hypercomputecluster_v1::model::StorageResource;
1502 /// use google_cloud_hypercomputecluster_v1::model::LustreReference;
1503 /// let x = StorageResource::new().set_lustre(LustreReference::default()/* use setters */);
1504 /// assert!(x.lustre().is_some());
1505 /// assert!(x.filestore().is_none());
1506 /// assert!(x.bucket().is_none());
1507 /// ```
1508 pub fn set_lustre<T: std::convert::Into<std::boxed::Box<crate::model::LustreReference>>>(
1509 mut self,
1510 v: T,
1511 ) -> Self {
1512 self.reference =
1513 std::option::Option::Some(crate::model::storage_resource::Reference::Lustre(v.into()));
1514 self
1515 }
1516}
1517
1518impl wkt::message::Message for StorageResource {
1519 fn typename() -> &'static str {
1520 "type.googleapis.com/google.cloud.hypercomputecluster.v1.StorageResource"
1521 }
1522}
1523
1524/// Defines additional types related to [StorageResource].
1525pub mod storage_resource {
1526 #[allow(unused_imports)]
1527 use super::*;
1528
1529 /// Reference to the storage resource in Google Cloud. Exactly one of these
1530 /// fields will be populated based on the configured type of storage resource.
1531 #[derive(Clone, Debug, PartialEq)]
1532 #[non_exhaustive]
1533 pub enum Reference {
1534 /// Reference to a Filestore instance. Populated if and only if the storage
1535 /// resource was configured to use Filestore.
1536 Filestore(std::boxed::Box<crate::model::FilestoreReference>),
1537 /// Reference to a Google Cloud Storage bucket. Populated if and only if the
1538 /// storage resource was configured to use Google Cloud Storage.
1539 Bucket(std::boxed::Box<crate::model::BucketReference>),
1540 /// Reference to a Managed Lustre instance. Populated if and only if the
1541 /// storage resource was configured to use Managed Lustre.
1542 Lustre(std::boxed::Box<crate::model::LustreReference>),
1543 }
1544}
1545
1546/// A reference to a [Filestore](https://cloud.google.com/filestore) instance.
1547#[derive(Clone, Default, PartialEq)]
1548#[non_exhaustive]
1549pub struct FilestoreReference {
1550 /// Output only. Name of the Filestore instance, in the format
1551 /// `projects/{project}/locations/{location}/instances/{instance}`
1552 pub filestore: std::string::String,
1553
1554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1555}
1556
1557impl FilestoreReference {
1558 /// Creates a new default instance.
1559 pub fn new() -> Self {
1560 std::default::Default::default()
1561 }
1562
1563 /// Sets the value of [filestore][crate::model::FilestoreReference::filestore].
1564 ///
1565 /// # Example
1566 /// ```ignore,no_run
1567 /// # use google_cloud_hypercomputecluster_v1::model::FilestoreReference;
1568 /// let x = FilestoreReference::new().set_filestore("example");
1569 /// ```
1570 pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1571 self.filestore = v.into();
1572 self
1573 }
1574}
1575
1576impl wkt::message::Message for FilestoreReference {
1577 fn typename() -> &'static str {
1578 "type.googleapis.com/google.cloud.hypercomputecluster.v1.FilestoreReference"
1579 }
1580}
1581
1582/// A reference to a [Google Cloud Storage](https://cloud.google.com/storage)
1583/// bucket.
1584#[derive(Clone, Default, PartialEq)]
1585#[non_exhaustive]
1586pub struct BucketReference {
1587 /// Output only. Name of the bucket.
1588 pub bucket: std::string::String,
1589
1590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1591}
1592
1593impl BucketReference {
1594 /// Creates a new default instance.
1595 pub fn new() -> Self {
1596 std::default::Default::default()
1597 }
1598
1599 /// Sets the value of [bucket][crate::model::BucketReference::bucket].
1600 ///
1601 /// # Example
1602 /// ```ignore,no_run
1603 /// # use google_cloud_hypercomputecluster_v1::model::BucketReference;
1604 /// let x = BucketReference::new().set_bucket("example");
1605 /// ```
1606 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1607 self.bucket = v.into();
1608 self
1609 }
1610}
1611
1612impl wkt::message::Message for BucketReference {
1613 fn typename() -> &'static str {
1614 "type.googleapis.com/google.cloud.hypercomputecluster.v1.BucketReference"
1615 }
1616}
1617
1618/// A reference to a [Managed
1619/// Lustre](https://cloud.google.com/products/managed-lustre) instance.
1620#[derive(Clone, Default, PartialEq)]
1621#[non_exhaustive]
1622pub struct LustreReference {
1623 /// Output only. Name of the Managed Lustre instance, in the format
1624 /// `projects/{project}/locations/{location}/instances/{instance}`
1625 pub lustre: std::string::String,
1626
1627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1628}
1629
1630impl LustreReference {
1631 /// Creates a new default instance.
1632 pub fn new() -> Self {
1633 std::default::Default::default()
1634 }
1635
1636 /// Sets the value of [lustre][crate::model::LustreReference::lustre].
1637 ///
1638 /// # Example
1639 /// ```ignore,no_run
1640 /// # use google_cloud_hypercomputecluster_v1::model::LustreReference;
1641 /// let x = LustreReference::new().set_lustre("example");
1642 /// ```
1643 pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1644 self.lustre = v.into();
1645 self
1646 }
1647}
1648
1649impl wkt::message::Message for LustreReference {
1650 fn typename() -> &'static str {
1651 "type.googleapis.com/google.cloud.hypercomputecluster.v1.LustreReference"
1652 }
1653}
1654
1655/// Describes how a storage resource should be initialized. Each storage resource
1656/// can either be imported from an existing Google Cloud resource or initialized
1657/// when the cluster is created.
1658#[derive(Clone, Default, PartialEq)]
1659#[non_exhaustive]
1660pub struct StorageResourceConfig {
1661 /// Particular type of configuration for this storage resource.
1662 pub config: std::option::Option<crate::model::storage_resource_config::Config>,
1663
1664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1665}
1666
1667impl StorageResourceConfig {
1668 /// Creates a new default instance.
1669 pub fn new() -> Self {
1670 std::default::Default::default()
1671 }
1672
1673 /// Sets the value of [config][crate::model::StorageResourceConfig::config].
1674 ///
1675 /// Note that all the setters affecting `config` are mutually
1676 /// exclusive.
1677 ///
1678 /// # Example
1679 /// ```ignore,no_run
1680 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1681 /// use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
1682 /// let x = StorageResourceConfig::new().set_config(Some(
1683 /// google_cloud_hypercomputecluster_v1::model::storage_resource_config::Config::NewFilestore(NewFilestoreConfig::default().into())));
1684 /// ```
1685 pub fn set_config<
1686 T: std::convert::Into<std::option::Option<crate::model::storage_resource_config::Config>>,
1687 >(
1688 mut self,
1689 v: T,
1690 ) -> Self {
1691 self.config = v.into();
1692 self
1693 }
1694
1695 /// The value of [config][crate::model::StorageResourceConfig::config]
1696 /// if it holds a `NewFilestore`, `None` if the field is not set or
1697 /// holds a different branch.
1698 pub fn new_filestore(
1699 &self,
1700 ) -> std::option::Option<&std::boxed::Box<crate::model::NewFilestoreConfig>> {
1701 #[allow(unreachable_patterns)]
1702 self.config.as_ref().and_then(|v| match v {
1703 crate::model::storage_resource_config::Config::NewFilestore(v) => {
1704 std::option::Option::Some(v)
1705 }
1706 _ => std::option::Option::None,
1707 })
1708 }
1709
1710 /// Sets the value of [config][crate::model::StorageResourceConfig::config]
1711 /// to hold a `NewFilestore`.
1712 ///
1713 /// Note that all the setters affecting `config` are
1714 /// mutually exclusive.
1715 ///
1716 /// # Example
1717 /// ```ignore,no_run
1718 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1719 /// use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
1720 /// let x = StorageResourceConfig::new().set_new_filestore(NewFilestoreConfig::default()/* use setters */);
1721 /// assert!(x.new_filestore().is_some());
1722 /// assert!(x.existing_filestore().is_none());
1723 /// assert!(x.new_bucket().is_none());
1724 /// assert!(x.existing_bucket().is_none());
1725 /// assert!(x.new_lustre().is_none());
1726 /// assert!(x.existing_lustre().is_none());
1727 /// ```
1728 pub fn set_new_filestore<
1729 T: std::convert::Into<std::boxed::Box<crate::model::NewFilestoreConfig>>,
1730 >(
1731 mut self,
1732 v: T,
1733 ) -> Self {
1734 self.config = std::option::Option::Some(
1735 crate::model::storage_resource_config::Config::NewFilestore(v.into()),
1736 );
1737 self
1738 }
1739
1740 /// The value of [config][crate::model::StorageResourceConfig::config]
1741 /// if it holds a `ExistingFilestore`, `None` if the field is not set or
1742 /// holds a different branch.
1743 pub fn existing_filestore(
1744 &self,
1745 ) -> std::option::Option<&std::boxed::Box<crate::model::ExistingFilestoreConfig>> {
1746 #[allow(unreachable_patterns)]
1747 self.config.as_ref().and_then(|v| match v {
1748 crate::model::storage_resource_config::Config::ExistingFilestore(v) => {
1749 std::option::Option::Some(v)
1750 }
1751 _ => std::option::Option::None,
1752 })
1753 }
1754
1755 /// Sets the value of [config][crate::model::StorageResourceConfig::config]
1756 /// to hold a `ExistingFilestore`.
1757 ///
1758 /// Note that all the setters affecting `config` are
1759 /// mutually exclusive.
1760 ///
1761 /// # Example
1762 /// ```ignore,no_run
1763 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1764 /// use google_cloud_hypercomputecluster_v1::model::ExistingFilestoreConfig;
1765 /// let x = StorageResourceConfig::new().set_existing_filestore(ExistingFilestoreConfig::default()/* use setters */);
1766 /// assert!(x.existing_filestore().is_some());
1767 /// assert!(x.new_filestore().is_none());
1768 /// assert!(x.new_bucket().is_none());
1769 /// assert!(x.existing_bucket().is_none());
1770 /// assert!(x.new_lustre().is_none());
1771 /// assert!(x.existing_lustre().is_none());
1772 /// ```
1773 pub fn set_existing_filestore<
1774 T: std::convert::Into<std::boxed::Box<crate::model::ExistingFilestoreConfig>>,
1775 >(
1776 mut self,
1777 v: T,
1778 ) -> Self {
1779 self.config = std::option::Option::Some(
1780 crate::model::storage_resource_config::Config::ExistingFilestore(v.into()),
1781 );
1782 self
1783 }
1784
1785 /// The value of [config][crate::model::StorageResourceConfig::config]
1786 /// if it holds a `NewBucket`, `None` if the field is not set or
1787 /// holds a different branch.
1788 pub fn new_bucket(
1789 &self,
1790 ) -> std::option::Option<&std::boxed::Box<crate::model::NewBucketConfig>> {
1791 #[allow(unreachable_patterns)]
1792 self.config.as_ref().and_then(|v| match v {
1793 crate::model::storage_resource_config::Config::NewBucket(v) => {
1794 std::option::Option::Some(v)
1795 }
1796 _ => std::option::Option::None,
1797 })
1798 }
1799
1800 /// Sets the value of [config][crate::model::StorageResourceConfig::config]
1801 /// to hold a `NewBucket`.
1802 ///
1803 /// Note that all the setters affecting `config` are
1804 /// mutually exclusive.
1805 ///
1806 /// # Example
1807 /// ```ignore,no_run
1808 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1809 /// use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
1810 /// let x = StorageResourceConfig::new().set_new_bucket(NewBucketConfig::default()/* use setters */);
1811 /// assert!(x.new_bucket().is_some());
1812 /// assert!(x.new_filestore().is_none());
1813 /// assert!(x.existing_filestore().is_none());
1814 /// assert!(x.existing_bucket().is_none());
1815 /// assert!(x.new_lustre().is_none());
1816 /// assert!(x.existing_lustre().is_none());
1817 /// ```
1818 pub fn set_new_bucket<T: std::convert::Into<std::boxed::Box<crate::model::NewBucketConfig>>>(
1819 mut self,
1820 v: T,
1821 ) -> Self {
1822 self.config = std::option::Option::Some(
1823 crate::model::storage_resource_config::Config::NewBucket(v.into()),
1824 );
1825 self
1826 }
1827
1828 /// The value of [config][crate::model::StorageResourceConfig::config]
1829 /// if it holds a `ExistingBucket`, `None` if the field is not set or
1830 /// holds a different branch.
1831 pub fn existing_bucket(
1832 &self,
1833 ) -> std::option::Option<&std::boxed::Box<crate::model::ExistingBucketConfig>> {
1834 #[allow(unreachable_patterns)]
1835 self.config.as_ref().and_then(|v| match v {
1836 crate::model::storage_resource_config::Config::ExistingBucket(v) => {
1837 std::option::Option::Some(v)
1838 }
1839 _ => std::option::Option::None,
1840 })
1841 }
1842
1843 /// Sets the value of [config][crate::model::StorageResourceConfig::config]
1844 /// to hold a `ExistingBucket`.
1845 ///
1846 /// Note that all the setters affecting `config` are
1847 /// mutually exclusive.
1848 ///
1849 /// # Example
1850 /// ```ignore,no_run
1851 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1852 /// use google_cloud_hypercomputecluster_v1::model::ExistingBucketConfig;
1853 /// let x = StorageResourceConfig::new().set_existing_bucket(ExistingBucketConfig::default()/* use setters */);
1854 /// assert!(x.existing_bucket().is_some());
1855 /// assert!(x.new_filestore().is_none());
1856 /// assert!(x.existing_filestore().is_none());
1857 /// assert!(x.new_bucket().is_none());
1858 /// assert!(x.new_lustre().is_none());
1859 /// assert!(x.existing_lustre().is_none());
1860 /// ```
1861 pub fn set_existing_bucket<
1862 T: std::convert::Into<std::boxed::Box<crate::model::ExistingBucketConfig>>,
1863 >(
1864 mut self,
1865 v: T,
1866 ) -> Self {
1867 self.config = std::option::Option::Some(
1868 crate::model::storage_resource_config::Config::ExistingBucket(v.into()),
1869 );
1870 self
1871 }
1872
1873 /// The value of [config][crate::model::StorageResourceConfig::config]
1874 /// if it holds a `NewLustre`, `None` if the field is not set or
1875 /// holds a different branch.
1876 pub fn new_lustre(
1877 &self,
1878 ) -> std::option::Option<&std::boxed::Box<crate::model::NewLustreConfig>> {
1879 #[allow(unreachable_patterns)]
1880 self.config.as_ref().and_then(|v| match v {
1881 crate::model::storage_resource_config::Config::NewLustre(v) => {
1882 std::option::Option::Some(v)
1883 }
1884 _ => std::option::Option::None,
1885 })
1886 }
1887
1888 /// Sets the value of [config][crate::model::StorageResourceConfig::config]
1889 /// to hold a `NewLustre`.
1890 ///
1891 /// Note that all the setters affecting `config` are
1892 /// mutually exclusive.
1893 ///
1894 /// # Example
1895 /// ```ignore,no_run
1896 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1897 /// use google_cloud_hypercomputecluster_v1::model::NewLustreConfig;
1898 /// let x = StorageResourceConfig::new().set_new_lustre(NewLustreConfig::default()/* use setters */);
1899 /// assert!(x.new_lustre().is_some());
1900 /// assert!(x.new_filestore().is_none());
1901 /// assert!(x.existing_filestore().is_none());
1902 /// assert!(x.new_bucket().is_none());
1903 /// assert!(x.existing_bucket().is_none());
1904 /// assert!(x.existing_lustre().is_none());
1905 /// ```
1906 pub fn set_new_lustre<T: std::convert::Into<std::boxed::Box<crate::model::NewLustreConfig>>>(
1907 mut self,
1908 v: T,
1909 ) -> Self {
1910 self.config = std::option::Option::Some(
1911 crate::model::storage_resource_config::Config::NewLustre(v.into()),
1912 );
1913 self
1914 }
1915
1916 /// The value of [config][crate::model::StorageResourceConfig::config]
1917 /// if it holds a `ExistingLustre`, `None` if the field is not set or
1918 /// holds a different branch.
1919 pub fn existing_lustre(
1920 &self,
1921 ) -> std::option::Option<&std::boxed::Box<crate::model::ExistingLustreConfig>> {
1922 #[allow(unreachable_patterns)]
1923 self.config.as_ref().and_then(|v| match v {
1924 crate::model::storage_resource_config::Config::ExistingLustre(v) => {
1925 std::option::Option::Some(v)
1926 }
1927 _ => std::option::Option::None,
1928 })
1929 }
1930
1931 /// Sets the value of [config][crate::model::StorageResourceConfig::config]
1932 /// to hold a `ExistingLustre`.
1933 ///
1934 /// Note that all the setters affecting `config` are
1935 /// mutually exclusive.
1936 ///
1937 /// # Example
1938 /// ```ignore,no_run
1939 /// # use google_cloud_hypercomputecluster_v1::model::StorageResourceConfig;
1940 /// use google_cloud_hypercomputecluster_v1::model::ExistingLustreConfig;
1941 /// let x = StorageResourceConfig::new().set_existing_lustre(ExistingLustreConfig::default()/* use setters */);
1942 /// assert!(x.existing_lustre().is_some());
1943 /// assert!(x.new_filestore().is_none());
1944 /// assert!(x.existing_filestore().is_none());
1945 /// assert!(x.new_bucket().is_none());
1946 /// assert!(x.existing_bucket().is_none());
1947 /// assert!(x.new_lustre().is_none());
1948 /// ```
1949 pub fn set_existing_lustre<
1950 T: std::convert::Into<std::boxed::Box<crate::model::ExistingLustreConfig>>,
1951 >(
1952 mut self,
1953 v: T,
1954 ) -> Self {
1955 self.config = std::option::Option::Some(
1956 crate::model::storage_resource_config::Config::ExistingLustre(v.into()),
1957 );
1958 self
1959 }
1960}
1961
1962impl wkt::message::Message for StorageResourceConfig {
1963 fn typename() -> &'static str {
1964 "type.googleapis.com/google.cloud.hypercomputecluster.v1.StorageResourceConfig"
1965 }
1966}
1967
1968/// Defines additional types related to [StorageResourceConfig].
1969pub mod storage_resource_config {
1970 #[allow(unused_imports)]
1971 use super::*;
1972
1973 /// Particular type of configuration for this storage resource.
1974 #[derive(Clone, Debug, PartialEq)]
1975 #[non_exhaustive]
1976 pub enum Config {
1977 /// Optional. Immutable. If set, indicates that a new Filestore instance
1978 /// should be created.
1979 NewFilestore(std::boxed::Box<crate::model::NewFilestoreConfig>),
1980 /// Optional. Immutable. If set, indicates that an existing Filestore
1981 /// instance should be imported.
1982 ExistingFilestore(std::boxed::Box<crate::model::ExistingFilestoreConfig>),
1983 /// Optional. Immutable. If set, indicates that a new Cloud Storage bucket
1984 /// should be created.
1985 NewBucket(std::boxed::Box<crate::model::NewBucketConfig>),
1986 /// Optional. Immutable. If set, indicates that an existing Cloud Storage
1987 /// bucket should be imported.
1988 ExistingBucket(std::boxed::Box<crate::model::ExistingBucketConfig>),
1989 /// Optional. Immutable. If set, indicates that a new Managed Lustre instance
1990 /// should be created.
1991 NewLustre(std::boxed::Box<crate::model::NewLustreConfig>),
1992 /// Optional. Immutable. If set, indicates that an existing Managed Lustre
1993 /// instance should be imported.
1994 ExistingLustre(std::boxed::Box<crate::model::ExistingLustreConfig>),
1995 }
1996}
1997
1998/// When set in a
1999/// [StorageResourceConfig][google.cloud.hypercomputecluster.v1.StorageResourceConfig],
2000/// indicates that a new [Filestore](https://cloud.google.com/filestore) instance
2001/// should be created.
2002///
2003/// [google.cloud.hypercomputecluster.v1.StorageResourceConfig]: crate::model::StorageResourceConfig
2004#[derive(Clone, Default, PartialEq)]
2005#[non_exhaustive]
2006pub struct NewFilestoreConfig {
2007 /// Required. Immutable. Name of the Filestore instance to create, in the
2008 /// format `projects/{project}/locations/{location}/instances/{instance}`
2009 pub filestore: std::string::String,
2010
2011 /// Optional. Immutable. Description of the instance. Maximum of 2048
2012 /// characters.
2013 pub description: std::string::String,
2014
2015 /// Required. Immutable. File system shares on the instance. Exactly one file
2016 /// share must be specified.
2017 pub file_shares: std::vec::Vec<crate::model::FileShareConfig>,
2018
2019 /// Required. Immutable. Service tier to use for the instance.
2020 pub tier: crate::model::new_filestore_config::Tier,
2021
2022 /// Optional. Immutable. Access protocol to use for all file shares in the
2023 /// instance. Defaults to NFS V3 if not set.
2024 pub protocol: crate::model::new_filestore_config::Protocol,
2025
2026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2027}
2028
2029impl NewFilestoreConfig {
2030 /// Creates a new default instance.
2031 pub fn new() -> Self {
2032 std::default::Default::default()
2033 }
2034
2035 /// Sets the value of [filestore][crate::model::NewFilestoreConfig::filestore].
2036 ///
2037 /// # Example
2038 /// ```ignore,no_run
2039 /// # use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
2040 /// let x = NewFilestoreConfig::new().set_filestore("example");
2041 /// ```
2042 pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2043 self.filestore = v.into();
2044 self
2045 }
2046
2047 /// Sets the value of [description][crate::model::NewFilestoreConfig::description].
2048 ///
2049 /// # Example
2050 /// ```ignore,no_run
2051 /// # use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
2052 /// let x = NewFilestoreConfig::new().set_description("example");
2053 /// ```
2054 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055 self.description = v.into();
2056 self
2057 }
2058
2059 /// Sets the value of [file_shares][crate::model::NewFilestoreConfig::file_shares].
2060 ///
2061 /// # Example
2062 /// ```ignore,no_run
2063 /// # use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
2064 /// use google_cloud_hypercomputecluster_v1::model::FileShareConfig;
2065 /// let x = NewFilestoreConfig::new()
2066 /// .set_file_shares([
2067 /// FileShareConfig::default()/* use setters */,
2068 /// FileShareConfig::default()/* use (different) setters */,
2069 /// ]);
2070 /// ```
2071 pub fn set_file_shares<T, V>(mut self, v: T) -> Self
2072 where
2073 T: std::iter::IntoIterator<Item = V>,
2074 V: std::convert::Into<crate::model::FileShareConfig>,
2075 {
2076 use std::iter::Iterator;
2077 self.file_shares = v.into_iter().map(|i| i.into()).collect();
2078 self
2079 }
2080
2081 /// Sets the value of [tier][crate::model::NewFilestoreConfig::tier].
2082 ///
2083 /// # Example
2084 /// ```ignore,no_run
2085 /// # use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
2086 /// use google_cloud_hypercomputecluster_v1::model::new_filestore_config::Tier;
2087 /// let x0 = NewFilestoreConfig::new().set_tier(Tier::Zonal);
2088 /// let x1 = NewFilestoreConfig::new().set_tier(Tier::Regional);
2089 /// ```
2090 pub fn set_tier<T: std::convert::Into<crate::model::new_filestore_config::Tier>>(
2091 mut self,
2092 v: T,
2093 ) -> Self {
2094 self.tier = v.into();
2095 self
2096 }
2097
2098 /// Sets the value of [protocol][crate::model::NewFilestoreConfig::protocol].
2099 ///
2100 /// # Example
2101 /// ```ignore,no_run
2102 /// # use google_cloud_hypercomputecluster_v1::model::NewFilestoreConfig;
2103 /// use google_cloud_hypercomputecluster_v1::model::new_filestore_config::Protocol;
2104 /// let x0 = NewFilestoreConfig::new().set_protocol(Protocol::Nfsv3);
2105 /// let x1 = NewFilestoreConfig::new().set_protocol(Protocol::Nfsv41);
2106 /// ```
2107 pub fn set_protocol<T: std::convert::Into<crate::model::new_filestore_config::Protocol>>(
2108 mut self,
2109 v: T,
2110 ) -> Self {
2111 self.protocol = v.into();
2112 self
2113 }
2114}
2115
2116impl wkt::message::Message for NewFilestoreConfig {
2117 fn typename() -> &'static str {
2118 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewFilestoreConfig"
2119 }
2120}
2121
2122/// Defines additional types related to [NewFilestoreConfig].
2123pub mod new_filestore_config {
2124 #[allow(unused_imports)]
2125 use super::*;
2126
2127 /// Available [service
2128 /// tiers](https://cloud.google.com/filestore/docs/service-tiers) for Filestore
2129 /// instances.
2130 ///
2131 /// # Working with unknown values
2132 ///
2133 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2134 /// additional enum variants at any time. Adding new variants is not considered
2135 /// a breaking change. Applications should write their code in anticipation of:
2136 ///
2137 /// - New values appearing in future releases of the client library, **and**
2138 /// - New values received dynamically, without application changes.
2139 ///
2140 /// Please consult the [Working with enums] section in the user guide for some
2141 /// guidelines.
2142 ///
2143 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2144 #[derive(Clone, Debug, PartialEq)]
2145 #[non_exhaustive]
2146 pub enum Tier {
2147 /// Not set.
2148 Unspecified,
2149 /// Offers expanded capacity and performance scaling capabilities suitable
2150 /// for high-performance computing application requirements.
2151 Zonal,
2152 /// Offers features and availability needed for mission-critical,
2153 /// high-performance computing workloads.
2154 Regional,
2155 /// If set, the enum was initialized with an unknown value.
2156 ///
2157 /// Applications can examine the value using [Tier::value] or
2158 /// [Tier::name].
2159 UnknownValue(tier::UnknownValue),
2160 }
2161
2162 #[doc(hidden)]
2163 pub mod tier {
2164 #[allow(unused_imports)]
2165 use super::*;
2166 #[derive(Clone, Debug, PartialEq)]
2167 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2168 }
2169
2170 impl Tier {
2171 /// Gets the enum value.
2172 ///
2173 /// Returns `None` if the enum contains an unknown value deserialized from
2174 /// the string representation of enums.
2175 pub fn value(&self) -> std::option::Option<i32> {
2176 match self {
2177 Self::Unspecified => std::option::Option::Some(0),
2178 Self::Zonal => std::option::Option::Some(4),
2179 Self::Regional => std::option::Option::Some(6),
2180 Self::UnknownValue(u) => u.0.value(),
2181 }
2182 }
2183
2184 /// Gets the enum value as a string.
2185 ///
2186 /// Returns `None` if the enum contains an unknown value deserialized from
2187 /// the integer representation of enums.
2188 pub fn name(&self) -> std::option::Option<&str> {
2189 match self {
2190 Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
2191 Self::Zonal => std::option::Option::Some("ZONAL"),
2192 Self::Regional => std::option::Option::Some("REGIONAL"),
2193 Self::UnknownValue(u) => u.0.name(),
2194 }
2195 }
2196 }
2197
2198 impl std::default::Default for Tier {
2199 fn default() -> Self {
2200 use std::convert::From;
2201 Self::from(0)
2202 }
2203 }
2204
2205 impl std::fmt::Display for Tier {
2206 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2207 wkt::internal::display_enum(f, self.name(), self.value())
2208 }
2209 }
2210
2211 impl std::convert::From<i32> for Tier {
2212 fn from(value: i32) -> Self {
2213 match value {
2214 0 => Self::Unspecified,
2215 4 => Self::Zonal,
2216 6 => Self::Regional,
2217 _ => Self::UnknownValue(tier::UnknownValue(
2218 wkt::internal::UnknownEnumValue::Integer(value),
2219 )),
2220 }
2221 }
2222 }
2223
2224 impl std::convert::From<&str> for Tier {
2225 fn from(value: &str) -> Self {
2226 use std::string::ToString;
2227 match value {
2228 "TIER_UNSPECIFIED" => Self::Unspecified,
2229 "ZONAL" => Self::Zonal,
2230 "REGIONAL" => Self::Regional,
2231 _ => Self::UnknownValue(tier::UnknownValue(
2232 wkt::internal::UnknownEnumValue::String(value.to_string()),
2233 )),
2234 }
2235 }
2236 }
2237
2238 impl serde::ser::Serialize for Tier {
2239 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2240 where
2241 S: serde::Serializer,
2242 {
2243 match self {
2244 Self::Unspecified => serializer.serialize_i32(0),
2245 Self::Zonal => serializer.serialize_i32(4),
2246 Self::Regional => serializer.serialize_i32(6),
2247 Self::UnknownValue(u) => u.0.serialize(serializer),
2248 }
2249 }
2250 }
2251
2252 impl<'de> serde::de::Deserialize<'de> for Tier {
2253 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2254 where
2255 D: serde::Deserializer<'de>,
2256 {
2257 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
2258 ".google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Tier",
2259 ))
2260 }
2261 }
2262
2263 /// File access protocol for Filestore instances.
2264 ///
2265 /// # Working with unknown values
2266 ///
2267 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2268 /// additional enum variants at any time. Adding new variants is not considered
2269 /// a breaking change. Applications should write their code in anticipation of:
2270 ///
2271 /// - New values appearing in future releases of the client library, **and**
2272 /// - New values received dynamically, without application changes.
2273 ///
2274 /// Please consult the [Working with enums] section in the user guide for some
2275 /// guidelines.
2276 ///
2277 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2278 #[derive(Clone, Debug, PartialEq)]
2279 #[non_exhaustive]
2280 pub enum Protocol {
2281 /// Not set.
2282 Unspecified,
2283 /// NFS 3.0.
2284 Nfsv3,
2285 /// NFS 4.1.
2286 Nfsv41,
2287 /// If set, the enum was initialized with an unknown value.
2288 ///
2289 /// Applications can examine the value using [Protocol::value] or
2290 /// [Protocol::name].
2291 UnknownValue(protocol::UnknownValue),
2292 }
2293
2294 #[doc(hidden)]
2295 pub mod protocol {
2296 #[allow(unused_imports)]
2297 use super::*;
2298 #[derive(Clone, Debug, PartialEq)]
2299 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2300 }
2301
2302 impl Protocol {
2303 /// Gets the enum value.
2304 ///
2305 /// Returns `None` if the enum contains an unknown value deserialized from
2306 /// the string representation of enums.
2307 pub fn value(&self) -> std::option::Option<i32> {
2308 match self {
2309 Self::Unspecified => std::option::Option::Some(0),
2310 Self::Nfsv3 => std::option::Option::Some(1),
2311 Self::Nfsv41 => std::option::Option::Some(2),
2312 Self::UnknownValue(u) => u.0.value(),
2313 }
2314 }
2315
2316 /// Gets the enum value as a string.
2317 ///
2318 /// Returns `None` if the enum contains an unknown value deserialized from
2319 /// the integer representation of enums.
2320 pub fn name(&self) -> std::option::Option<&str> {
2321 match self {
2322 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
2323 Self::Nfsv3 => std::option::Option::Some("NFSV3"),
2324 Self::Nfsv41 => std::option::Option::Some("NFSV41"),
2325 Self::UnknownValue(u) => u.0.name(),
2326 }
2327 }
2328 }
2329
2330 impl std::default::Default for Protocol {
2331 fn default() -> Self {
2332 use std::convert::From;
2333 Self::from(0)
2334 }
2335 }
2336
2337 impl std::fmt::Display for Protocol {
2338 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2339 wkt::internal::display_enum(f, self.name(), self.value())
2340 }
2341 }
2342
2343 impl std::convert::From<i32> for Protocol {
2344 fn from(value: i32) -> Self {
2345 match value {
2346 0 => Self::Unspecified,
2347 1 => Self::Nfsv3,
2348 2 => Self::Nfsv41,
2349 _ => Self::UnknownValue(protocol::UnknownValue(
2350 wkt::internal::UnknownEnumValue::Integer(value),
2351 )),
2352 }
2353 }
2354 }
2355
2356 impl std::convert::From<&str> for Protocol {
2357 fn from(value: &str) -> Self {
2358 use std::string::ToString;
2359 match value {
2360 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
2361 "NFSV3" => Self::Nfsv3,
2362 "NFSV41" => Self::Nfsv41,
2363 _ => Self::UnknownValue(protocol::UnknownValue(
2364 wkt::internal::UnknownEnumValue::String(value.to_string()),
2365 )),
2366 }
2367 }
2368 }
2369
2370 impl serde::ser::Serialize for Protocol {
2371 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2372 where
2373 S: serde::Serializer,
2374 {
2375 match self {
2376 Self::Unspecified => serializer.serialize_i32(0),
2377 Self::Nfsv3 => serializer.serialize_i32(1),
2378 Self::Nfsv41 => serializer.serialize_i32(2),
2379 Self::UnknownValue(u) => u.0.serialize(serializer),
2380 }
2381 }
2382 }
2383
2384 impl<'de> serde::de::Deserialize<'de> for Protocol {
2385 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2386 where
2387 D: serde::Deserializer<'de>,
2388 {
2389 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
2390 ".google.cloud.hypercomputecluster.v1.NewFilestoreConfig.Protocol",
2391 ))
2392 }
2393 }
2394}
2395
2396/// Message describing filestore configuration
2397#[derive(Clone, Default, PartialEq)]
2398#[non_exhaustive]
2399pub struct FileShareConfig {
2400 /// Required. Size of the filestore in GB. Must be between 1024 and 102400, and
2401 /// must meet scalability requirements described at
2402 /// <https://cloud.google.com/filestore/docs/service-tiers>.
2403 pub capacity_gb: i64,
2404
2405 /// Required. Filestore share location
2406 pub file_share: std::string::String,
2407
2408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2409}
2410
2411impl FileShareConfig {
2412 /// Creates a new default instance.
2413 pub fn new() -> Self {
2414 std::default::Default::default()
2415 }
2416
2417 /// Sets the value of [capacity_gb][crate::model::FileShareConfig::capacity_gb].
2418 ///
2419 /// # Example
2420 /// ```ignore,no_run
2421 /// # use google_cloud_hypercomputecluster_v1::model::FileShareConfig;
2422 /// let x = FileShareConfig::new().set_capacity_gb(42);
2423 /// ```
2424 pub fn set_capacity_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2425 self.capacity_gb = v.into();
2426 self
2427 }
2428
2429 /// Sets the value of [file_share][crate::model::FileShareConfig::file_share].
2430 ///
2431 /// # Example
2432 /// ```ignore,no_run
2433 /// # use google_cloud_hypercomputecluster_v1::model::FileShareConfig;
2434 /// let x = FileShareConfig::new().set_file_share("example");
2435 /// ```
2436 pub fn set_file_share<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2437 self.file_share = v.into();
2438 self
2439 }
2440}
2441
2442impl wkt::message::Message for FileShareConfig {
2443 fn typename() -> &'static str {
2444 "type.googleapis.com/google.cloud.hypercomputecluster.v1.FileShareConfig"
2445 }
2446}
2447
2448/// When set in a
2449/// [StorageResourceConfig][google.cloud.hypercomputecluster.v1.StorageResourceConfig],
2450/// indicates that an existing [Filestore](https://cloud.google.com/filestore)
2451/// instance should be imported.
2452///
2453/// [google.cloud.hypercomputecluster.v1.StorageResourceConfig]: crate::model::StorageResourceConfig
2454#[derive(Clone, Default, PartialEq)]
2455#[non_exhaustive]
2456pub struct ExistingFilestoreConfig {
2457 /// Required. Immutable. Name of the Filestore instance to import, in the
2458 /// format `projects/{project}/locations/{location}/instances/{instance}`
2459 pub filestore: std::string::String,
2460
2461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2462}
2463
2464impl ExistingFilestoreConfig {
2465 /// Creates a new default instance.
2466 pub fn new() -> Self {
2467 std::default::Default::default()
2468 }
2469
2470 /// Sets the value of [filestore][crate::model::ExistingFilestoreConfig::filestore].
2471 ///
2472 /// # Example
2473 /// ```ignore,no_run
2474 /// # use google_cloud_hypercomputecluster_v1::model::ExistingFilestoreConfig;
2475 /// let x = ExistingFilestoreConfig::new().set_filestore("example");
2476 /// ```
2477 pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2478 self.filestore = v.into();
2479 self
2480 }
2481}
2482
2483impl wkt::message::Message for ExistingFilestoreConfig {
2484 fn typename() -> &'static str {
2485 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingFilestoreConfig"
2486 }
2487}
2488
2489/// When set in a
2490/// [StorageResourceConfig][google.cloud.hypercomputecluster.v1.StorageResourceConfig],
2491/// indicates that a new [Google Cloud Storage](https://cloud.google.com/storage)
2492/// bucket should be created.
2493///
2494/// [google.cloud.hypercomputecluster.v1.StorageResourceConfig]: crate::model::StorageResourceConfig
2495#[derive(Clone, Default, PartialEq)]
2496#[non_exhaustive]
2497pub struct NewBucketConfig {
2498 /// Required. Immutable. Name of the Cloud Storage bucket to create.
2499 pub bucket: std::string::String,
2500
2501 /// Optional. Immutable. If set, indicates that the bucket should use
2502 /// [hierarchical
2503 /// namespaces](https://cloud.google.com/storage/docs/hns-overview).
2504 pub hierarchical_namespace: std::option::Option<crate::model::GcsHierarchicalNamespaceConfig>,
2505
2506 /// Storage class of the bucket, which can be set automatically or explicitly.
2507 pub option: std::option::Option<crate::model::new_bucket_config::Option>,
2508
2509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2510}
2511
2512impl NewBucketConfig {
2513 /// Creates a new default instance.
2514 pub fn new() -> Self {
2515 std::default::Default::default()
2516 }
2517
2518 /// Sets the value of [bucket][crate::model::NewBucketConfig::bucket].
2519 ///
2520 /// # Example
2521 /// ```ignore,no_run
2522 /// # use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
2523 /// let x = NewBucketConfig::new().set_bucket("example");
2524 /// ```
2525 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2526 self.bucket = v.into();
2527 self
2528 }
2529
2530 /// Sets the value of [hierarchical_namespace][crate::model::NewBucketConfig::hierarchical_namespace].
2531 ///
2532 /// # Example
2533 /// ```ignore,no_run
2534 /// # use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
2535 /// use google_cloud_hypercomputecluster_v1::model::GcsHierarchicalNamespaceConfig;
2536 /// let x = NewBucketConfig::new().set_hierarchical_namespace(GcsHierarchicalNamespaceConfig::default()/* use setters */);
2537 /// ```
2538 pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
2539 where
2540 T: std::convert::Into<crate::model::GcsHierarchicalNamespaceConfig>,
2541 {
2542 self.hierarchical_namespace = std::option::Option::Some(v.into());
2543 self
2544 }
2545
2546 /// Sets or clears the value of [hierarchical_namespace][crate::model::NewBucketConfig::hierarchical_namespace].
2547 ///
2548 /// # Example
2549 /// ```ignore,no_run
2550 /// # use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
2551 /// use google_cloud_hypercomputecluster_v1::model::GcsHierarchicalNamespaceConfig;
2552 /// let x = NewBucketConfig::new().set_or_clear_hierarchical_namespace(Some(GcsHierarchicalNamespaceConfig::default()/* use setters */));
2553 /// let x = NewBucketConfig::new().set_or_clear_hierarchical_namespace(None::<GcsHierarchicalNamespaceConfig>);
2554 /// ```
2555 pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
2556 where
2557 T: std::convert::Into<crate::model::GcsHierarchicalNamespaceConfig>,
2558 {
2559 self.hierarchical_namespace = v.map(|x| x.into());
2560 self
2561 }
2562
2563 /// Sets the value of [option][crate::model::NewBucketConfig::option].
2564 ///
2565 /// Note that all the setters affecting `option` are mutually
2566 /// exclusive.
2567 ///
2568 /// # Example
2569 /// ```ignore,no_run
2570 /// # use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
2571 /// use google_cloud_hypercomputecluster_v1::model::new_bucket_config::StorageClass;
2572 /// let x0 = NewBucketConfig::new().set_option(Some(
2573 /// google_cloud_hypercomputecluster_v1::model::new_bucket_config::Option::StorageClass(StorageClass::Standard)));
2574 /// let x1 = NewBucketConfig::new().set_option(Some(
2575 /// google_cloud_hypercomputecluster_v1::model::new_bucket_config::Option::StorageClass(StorageClass::Nearline)));
2576 /// let x2 = NewBucketConfig::new().set_option(Some(
2577 /// google_cloud_hypercomputecluster_v1::model::new_bucket_config::Option::StorageClass(StorageClass::Coldline)));
2578 /// ```
2579 pub fn set_option<
2580 T: std::convert::Into<std::option::Option<crate::model::new_bucket_config::Option>>,
2581 >(
2582 mut self,
2583 v: T,
2584 ) -> Self {
2585 self.option = v.into();
2586 self
2587 }
2588
2589 /// The value of [option][crate::model::NewBucketConfig::option]
2590 /// if it holds a `Autoclass`, `None` if the field is not set or
2591 /// holds a different branch.
2592 pub fn autoclass(
2593 &self,
2594 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsAutoclassConfig>> {
2595 #[allow(unreachable_patterns)]
2596 self.option.as_ref().and_then(|v| match v {
2597 crate::model::new_bucket_config::Option::Autoclass(v) => std::option::Option::Some(v),
2598 _ => std::option::Option::None,
2599 })
2600 }
2601
2602 /// Sets the value of [option][crate::model::NewBucketConfig::option]
2603 /// to hold a `Autoclass`.
2604 ///
2605 /// Note that all the setters affecting `option` are
2606 /// mutually exclusive.
2607 ///
2608 /// # Example
2609 /// ```ignore,no_run
2610 /// # use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
2611 /// use google_cloud_hypercomputecluster_v1::model::GcsAutoclassConfig;
2612 /// let x = NewBucketConfig::new().set_autoclass(GcsAutoclassConfig::default()/* use setters */);
2613 /// assert!(x.autoclass().is_some());
2614 /// assert!(x.storage_class().is_none());
2615 /// ```
2616 pub fn set_autoclass<
2617 T: std::convert::Into<std::boxed::Box<crate::model::GcsAutoclassConfig>>,
2618 >(
2619 mut self,
2620 v: T,
2621 ) -> Self {
2622 self.option =
2623 std::option::Option::Some(crate::model::new_bucket_config::Option::Autoclass(v.into()));
2624 self
2625 }
2626
2627 /// The value of [option][crate::model::NewBucketConfig::option]
2628 /// if it holds a `StorageClass`, `None` if the field is not set or
2629 /// holds a different branch.
2630 pub fn storage_class(
2631 &self,
2632 ) -> std::option::Option<&crate::model::new_bucket_config::StorageClass> {
2633 #[allow(unreachable_patterns)]
2634 self.option.as_ref().and_then(|v| match v {
2635 crate::model::new_bucket_config::Option::StorageClass(v) => {
2636 std::option::Option::Some(v)
2637 }
2638 _ => std::option::Option::None,
2639 })
2640 }
2641
2642 /// Sets the value of [option][crate::model::NewBucketConfig::option]
2643 /// to hold a `StorageClass`.
2644 ///
2645 /// Note that all the setters affecting `option` are
2646 /// mutually exclusive.
2647 ///
2648 /// # Example
2649 /// ```ignore,no_run
2650 /// # use google_cloud_hypercomputecluster_v1::model::NewBucketConfig;
2651 /// use google_cloud_hypercomputecluster_v1::model::new_bucket_config::StorageClass;
2652 /// let x0 = NewBucketConfig::new().set_storage_class(StorageClass::Standard);
2653 /// let x1 = NewBucketConfig::new().set_storage_class(StorageClass::Nearline);
2654 /// let x2 = NewBucketConfig::new().set_storage_class(StorageClass::Coldline);
2655 /// assert!(x0.storage_class().is_some());
2656 /// assert!(x0.autoclass().is_none());
2657 /// assert!(x1.storage_class().is_some());
2658 /// assert!(x1.autoclass().is_none());
2659 /// assert!(x2.storage_class().is_some());
2660 /// assert!(x2.autoclass().is_none());
2661 /// ```
2662 pub fn set_storage_class<
2663 T: std::convert::Into<crate::model::new_bucket_config::StorageClass>,
2664 >(
2665 mut self,
2666 v: T,
2667 ) -> Self {
2668 self.option = std::option::Option::Some(
2669 crate::model::new_bucket_config::Option::StorageClass(v.into()),
2670 );
2671 self
2672 }
2673}
2674
2675impl wkt::message::Message for NewBucketConfig {
2676 fn typename() -> &'static str {
2677 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewBucketConfig"
2678 }
2679}
2680
2681/// Defines additional types related to [NewBucketConfig].
2682pub mod new_bucket_config {
2683 #[allow(unused_imports)]
2684 use super::*;
2685
2686 /// [Storage class](https://cloud.google.com/storage/docs/storage-classes) for
2687 /// a Cloud Storage bucket.
2688 ///
2689 /// # Working with unknown values
2690 ///
2691 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2692 /// additional enum variants at any time. Adding new variants is not considered
2693 /// a breaking change. Applications should write their code in anticipation of:
2694 ///
2695 /// - New values appearing in future releases of the client library, **and**
2696 /// - New values received dynamically, without application changes.
2697 ///
2698 /// Please consult the [Working with enums] section in the user guide for some
2699 /// guidelines.
2700 ///
2701 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2702 #[derive(Clone, Debug, PartialEq)]
2703 #[non_exhaustive]
2704 pub enum StorageClass {
2705 /// Not set.
2706 Unspecified,
2707 /// Best for data that is frequently accessed.
2708 Standard,
2709 /// Low-cost storage for data that is accessed less frequently.
2710 Nearline,
2711 /// Very low-cost storage for infrequently accessed data.
2712 Coldline,
2713 /// Lowest-cost storage for data archiving, online backup, and disaster
2714 /// recovery.
2715 Archive,
2716 /// If set, the enum was initialized with an unknown value.
2717 ///
2718 /// Applications can examine the value using [StorageClass::value] or
2719 /// [StorageClass::name].
2720 UnknownValue(storage_class::UnknownValue),
2721 }
2722
2723 #[doc(hidden)]
2724 pub mod storage_class {
2725 #[allow(unused_imports)]
2726 use super::*;
2727 #[derive(Clone, Debug, PartialEq)]
2728 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2729 }
2730
2731 impl StorageClass {
2732 /// Gets the enum value.
2733 ///
2734 /// Returns `None` if the enum contains an unknown value deserialized from
2735 /// the string representation of enums.
2736 pub fn value(&self) -> std::option::Option<i32> {
2737 match self {
2738 Self::Unspecified => std::option::Option::Some(0),
2739 Self::Standard => std::option::Option::Some(1),
2740 Self::Nearline => std::option::Option::Some(2),
2741 Self::Coldline => std::option::Option::Some(3),
2742 Self::Archive => std::option::Option::Some(4),
2743 Self::UnknownValue(u) => u.0.value(),
2744 }
2745 }
2746
2747 /// Gets the enum value as a string.
2748 ///
2749 /// Returns `None` if the enum contains an unknown value deserialized from
2750 /// the integer representation of enums.
2751 pub fn name(&self) -> std::option::Option<&str> {
2752 match self {
2753 Self::Unspecified => std::option::Option::Some("STORAGE_CLASS_UNSPECIFIED"),
2754 Self::Standard => std::option::Option::Some("STANDARD"),
2755 Self::Nearline => std::option::Option::Some("NEARLINE"),
2756 Self::Coldline => std::option::Option::Some("COLDLINE"),
2757 Self::Archive => std::option::Option::Some("ARCHIVE"),
2758 Self::UnknownValue(u) => u.0.name(),
2759 }
2760 }
2761 }
2762
2763 impl std::default::Default for StorageClass {
2764 fn default() -> Self {
2765 use std::convert::From;
2766 Self::from(0)
2767 }
2768 }
2769
2770 impl std::fmt::Display for StorageClass {
2771 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2772 wkt::internal::display_enum(f, self.name(), self.value())
2773 }
2774 }
2775
2776 impl std::convert::From<i32> for StorageClass {
2777 fn from(value: i32) -> Self {
2778 match value {
2779 0 => Self::Unspecified,
2780 1 => Self::Standard,
2781 2 => Self::Nearline,
2782 3 => Self::Coldline,
2783 4 => Self::Archive,
2784 _ => Self::UnknownValue(storage_class::UnknownValue(
2785 wkt::internal::UnknownEnumValue::Integer(value),
2786 )),
2787 }
2788 }
2789 }
2790
2791 impl std::convert::From<&str> for StorageClass {
2792 fn from(value: &str) -> Self {
2793 use std::string::ToString;
2794 match value {
2795 "STORAGE_CLASS_UNSPECIFIED" => Self::Unspecified,
2796 "STANDARD" => Self::Standard,
2797 "NEARLINE" => Self::Nearline,
2798 "COLDLINE" => Self::Coldline,
2799 "ARCHIVE" => Self::Archive,
2800 _ => Self::UnknownValue(storage_class::UnknownValue(
2801 wkt::internal::UnknownEnumValue::String(value.to_string()),
2802 )),
2803 }
2804 }
2805 }
2806
2807 impl serde::ser::Serialize for StorageClass {
2808 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2809 where
2810 S: serde::Serializer,
2811 {
2812 match self {
2813 Self::Unspecified => serializer.serialize_i32(0),
2814 Self::Standard => serializer.serialize_i32(1),
2815 Self::Nearline => serializer.serialize_i32(2),
2816 Self::Coldline => serializer.serialize_i32(3),
2817 Self::Archive => serializer.serialize_i32(4),
2818 Self::UnknownValue(u) => u.0.serialize(serializer),
2819 }
2820 }
2821 }
2822
2823 impl<'de> serde::de::Deserialize<'de> for StorageClass {
2824 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2825 where
2826 D: serde::Deserializer<'de>,
2827 {
2828 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageClass>::new(
2829 ".google.cloud.hypercomputecluster.v1.NewBucketConfig.StorageClass",
2830 ))
2831 }
2832 }
2833
2834 /// Storage class of the bucket, which can be set automatically or explicitly.
2835 #[derive(Clone, Debug, PartialEq)]
2836 #[non_exhaustive]
2837 pub enum Option {
2838 /// Optional. Immutable. If set, indicates that the bucket should use
2839 /// [Autoclass](https://cloud.google.com/storage/docs/autoclass).
2840 Autoclass(std::boxed::Box<crate::model::GcsAutoclassConfig>),
2841 /// Optional. Immutable. If set, uses the provided storage class as the
2842 /// bucket's default storage class.
2843 StorageClass(crate::model::new_bucket_config::StorageClass),
2844 }
2845}
2846
2847/// Message describing Google Cloud Storage autoclass configuration
2848#[derive(Clone, Default, PartialEq)]
2849#[non_exhaustive]
2850pub struct GcsAutoclassConfig {
2851 /// Required. Enables Auto-class feature.
2852 pub enabled: bool,
2853
2854 /// Optional. Terminal storage class of the autoclass bucket
2855 pub terminal_storage_class: crate::model::gcs_autoclass_config::TerminalStorageClass,
2856
2857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2858}
2859
2860impl GcsAutoclassConfig {
2861 /// Creates a new default instance.
2862 pub fn new() -> Self {
2863 std::default::Default::default()
2864 }
2865
2866 /// Sets the value of [enabled][crate::model::GcsAutoclassConfig::enabled].
2867 ///
2868 /// # Example
2869 /// ```ignore,no_run
2870 /// # use google_cloud_hypercomputecluster_v1::model::GcsAutoclassConfig;
2871 /// let x = GcsAutoclassConfig::new().set_enabled(true);
2872 /// ```
2873 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2874 self.enabled = v.into();
2875 self
2876 }
2877
2878 /// Sets the value of [terminal_storage_class][crate::model::GcsAutoclassConfig::terminal_storage_class].
2879 ///
2880 /// # Example
2881 /// ```ignore,no_run
2882 /// # use google_cloud_hypercomputecluster_v1::model::GcsAutoclassConfig;
2883 /// use google_cloud_hypercomputecluster_v1::model::gcs_autoclass_config::TerminalStorageClass;
2884 /// let x0 = GcsAutoclassConfig::new().set_terminal_storage_class(TerminalStorageClass::Unspecified);
2885 /// ```
2886 pub fn set_terminal_storage_class<
2887 T: std::convert::Into<crate::model::gcs_autoclass_config::TerminalStorageClass>,
2888 >(
2889 mut self,
2890 v: T,
2891 ) -> Self {
2892 self.terminal_storage_class = v.into();
2893 self
2894 }
2895}
2896
2897impl wkt::message::Message for GcsAutoclassConfig {
2898 fn typename() -> &'static str {
2899 "type.googleapis.com/google.cloud.hypercomputecluster.v1.GcsAutoclassConfig"
2900 }
2901}
2902
2903/// Defines additional types related to [GcsAutoclassConfig].
2904pub mod gcs_autoclass_config {
2905 #[allow(unused_imports)]
2906 use super::*;
2907
2908 /// Terminal storage class types of the autoclass bucket
2909 ///
2910 /// # Working with unknown values
2911 ///
2912 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2913 /// additional enum variants at any time. Adding new variants is not considered
2914 /// a breaking change. Applications should write their code in anticipation of:
2915 ///
2916 /// - New values appearing in future releases of the client library, **and**
2917 /// - New values received dynamically, without application changes.
2918 ///
2919 /// Please consult the [Working with enums] section in the user guide for some
2920 /// guidelines.
2921 ///
2922 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2923 #[derive(Clone, Debug, PartialEq)]
2924 #[non_exhaustive]
2925 pub enum TerminalStorageClass {
2926 /// Unspecified terminal storage class
2927 Unspecified,
2928 /// If set, the enum was initialized with an unknown value.
2929 ///
2930 /// Applications can examine the value using [TerminalStorageClass::value] or
2931 /// [TerminalStorageClass::name].
2932 UnknownValue(terminal_storage_class::UnknownValue),
2933 }
2934
2935 #[doc(hidden)]
2936 pub mod terminal_storage_class {
2937 #[allow(unused_imports)]
2938 use super::*;
2939 #[derive(Clone, Debug, PartialEq)]
2940 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2941 }
2942
2943 impl TerminalStorageClass {
2944 /// Gets the enum value.
2945 ///
2946 /// Returns `None` if the enum contains an unknown value deserialized from
2947 /// the string representation of enums.
2948 pub fn value(&self) -> std::option::Option<i32> {
2949 match self {
2950 Self::Unspecified => std::option::Option::Some(0),
2951 Self::UnknownValue(u) => u.0.value(),
2952 }
2953 }
2954
2955 /// Gets the enum value as a string.
2956 ///
2957 /// Returns `None` if the enum contains an unknown value deserialized from
2958 /// the integer representation of enums.
2959 pub fn name(&self) -> std::option::Option<&str> {
2960 match self {
2961 Self::Unspecified => {
2962 std::option::Option::Some("TERMINAL_STORAGE_CLASS_UNSPECIFIED")
2963 }
2964 Self::UnknownValue(u) => u.0.name(),
2965 }
2966 }
2967 }
2968
2969 impl std::default::Default for TerminalStorageClass {
2970 fn default() -> Self {
2971 use std::convert::From;
2972 Self::from(0)
2973 }
2974 }
2975
2976 impl std::fmt::Display for TerminalStorageClass {
2977 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2978 wkt::internal::display_enum(f, self.name(), self.value())
2979 }
2980 }
2981
2982 impl std::convert::From<i32> for TerminalStorageClass {
2983 fn from(value: i32) -> Self {
2984 match value {
2985 0 => Self::Unspecified,
2986 _ => Self::UnknownValue(terminal_storage_class::UnknownValue(
2987 wkt::internal::UnknownEnumValue::Integer(value),
2988 )),
2989 }
2990 }
2991 }
2992
2993 impl std::convert::From<&str> for TerminalStorageClass {
2994 fn from(value: &str) -> Self {
2995 use std::string::ToString;
2996 match value {
2997 "TERMINAL_STORAGE_CLASS_UNSPECIFIED" => Self::Unspecified,
2998 _ => Self::UnknownValue(terminal_storage_class::UnknownValue(
2999 wkt::internal::UnknownEnumValue::String(value.to_string()),
3000 )),
3001 }
3002 }
3003 }
3004
3005 impl serde::ser::Serialize for TerminalStorageClass {
3006 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3007 where
3008 S: serde::Serializer,
3009 {
3010 match self {
3011 Self::Unspecified => serializer.serialize_i32(0),
3012 Self::UnknownValue(u) => u.0.serialize(serializer),
3013 }
3014 }
3015 }
3016
3017 impl<'de> serde::de::Deserialize<'de> for TerminalStorageClass {
3018 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3019 where
3020 D: serde::Deserializer<'de>,
3021 {
3022 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TerminalStorageClass>::new(
3023 ".google.cloud.hypercomputecluster.v1.GcsAutoclassConfig.TerminalStorageClass",
3024 ))
3025 }
3026 }
3027}
3028
3029/// Message describing Google Cloud Storage hierarchical namespace configuration
3030#[derive(Clone, Default, PartialEq)]
3031#[non_exhaustive]
3032pub struct GcsHierarchicalNamespaceConfig {
3033 /// Required. Enables hierarchical namespace setup for the bucket.
3034 pub enabled: bool,
3035
3036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3037}
3038
3039impl GcsHierarchicalNamespaceConfig {
3040 /// Creates a new default instance.
3041 pub fn new() -> Self {
3042 std::default::Default::default()
3043 }
3044
3045 /// Sets the value of [enabled][crate::model::GcsHierarchicalNamespaceConfig::enabled].
3046 ///
3047 /// # Example
3048 /// ```ignore,no_run
3049 /// # use google_cloud_hypercomputecluster_v1::model::GcsHierarchicalNamespaceConfig;
3050 /// let x = GcsHierarchicalNamespaceConfig::new().set_enabled(true);
3051 /// ```
3052 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3053 self.enabled = v.into();
3054 self
3055 }
3056}
3057
3058impl wkt::message::Message for GcsHierarchicalNamespaceConfig {
3059 fn typename() -> &'static str {
3060 "type.googleapis.com/google.cloud.hypercomputecluster.v1.GcsHierarchicalNamespaceConfig"
3061 }
3062}
3063
3064/// When set in a
3065/// [StorageResourceConfig][google.cloud.hypercomputecluster.v1.StorageResourceConfig],
3066/// indicates that an existing [Google Cloud
3067/// Storage](https://cloud.google.com/storage) bucket should be imported.
3068///
3069/// [google.cloud.hypercomputecluster.v1.StorageResourceConfig]: crate::model::StorageResourceConfig
3070#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct ExistingBucketConfig {
3073 /// Required. Immutable. Name of the Cloud Storage bucket to import.
3074 pub bucket: std::string::String,
3075
3076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3077}
3078
3079impl ExistingBucketConfig {
3080 /// Creates a new default instance.
3081 pub fn new() -> Self {
3082 std::default::Default::default()
3083 }
3084
3085 /// Sets the value of [bucket][crate::model::ExistingBucketConfig::bucket].
3086 ///
3087 /// # Example
3088 /// ```ignore,no_run
3089 /// # use google_cloud_hypercomputecluster_v1::model::ExistingBucketConfig;
3090 /// let x = ExistingBucketConfig::new().set_bucket("example");
3091 /// ```
3092 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.bucket = v.into();
3094 self
3095 }
3096}
3097
3098impl wkt::message::Message for ExistingBucketConfig {
3099 fn typename() -> &'static str {
3100 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingBucketConfig"
3101 }
3102}
3103
3104/// When set in a
3105/// [StorageResourceConfig][google.cloud.hypercomputecluster.v1.StorageResourceConfig],
3106/// indicates that a new [Managed
3107/// Lustre](https://cloud.google.com/products/managed-lustre) instance should be
3108/// created.
3109///
3110/// [google.cloud.hypercomputecluster.v1.StorageResourceConfig]: crate::model::StorageResourceConfig
3111#[derive(Clone, Default, PartialEq)]
3112#[non_exhaustive]
3113pub struct NewLustreConfig {
3114 /// Required. Immutable. Name of the Managed Lustre instance to create, in the
3115 /// format `projects/{project}/locations/{location}/instances/{instance}`
3116 pub lustre: std::string::String,
3117
3118 /// Optional. Immutable. Description of the Managed Lustre instance. Maximum of
3119 /// 2048 characters.
3120 pub description: std::string::String,
3121
3122 /// Required. Immutable. Filesystem name for this instance. This name is used
3123 /// by client-side tools, including when mounting the instance. Must be 8
3124 /// characters or less and can only contain letters and numbers.
3125 pub filesystem: std::string::String,
3126
3127 /// Required. Immutable. Storage capacity of the instance in gibibytes (GiB).
3128 /// Allowed values are between 18000 and 7632000.
3129 pub capacity_gb: i64,
3130
3131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3132}
3133
3134impl NewLustreConfig {
3135 /// Creates a new default instance.
3136 pub fn new() -> Self {
3137 std::default::Default::default()
3138 }
3139
3140 /// Sets the value of [lustre][crate::model::NewLustreConfig::lustre].
3141 ///
3142 /// # Example
3143 /// ```ignore,no_run
3144 /// # use google_cloud_hypercomputecluster_v1::model::NewLustreConfig;
3145 /// let x = NewLustreConfig::new().set_lustre("example");
3146 /// ```
3147 pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3148 self.lustre = v.into();
3149 self
3150 }
3151
3152 /// Sets the value of [description][crate::model::NewLustreConfig::description].
3153 ///
3154 /// # Example
3155 /// ```ignore,no_run
3156 /// # use google_cloud_hypercomputecluster_v1::model::NewLustreConfig;
3157 /// let x = NewLustreConfig::new().set_description("example");
3158 /// ```
3159 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.description = v.into();
3161 self
3162 }
3163
3164 /// Sets the value of [filesystem][crate::model::NewLustreConfig::filesystem].
3165 ///
3166 /// # Example
3167 /// ```ignore,no_run
3168 /// # use google_cloud_hypercomputecluster_v1::model::NewLustreConfig;
3169 /// let x = NewLustreConfig::new().set_filesystem("example");
3170 /// ```
3171 pub fn set_filesystem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3172 self.filesystem = v.into();
3173 self
3174 }
3175
3176 /// Sets the value of [capacity_gb][crate::model::NewLustreConfig::capacity_gb].
3177 ///
3178 /// # Example
3179 /// ```ignore,no_run
3180 /// # use google_cloud_hypercomputecluster_v1::model::NewLustreConfig;
3181 /// let x = NewLustreConfig::new().set_capacity_gb(42);
3182 /// ```
3183 pub fn set_capacity_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3184 self.capacity_gb = v.into();
3185 self
3186 }
3187}
3188
3189impl wkt::message::Message for NewLustreConfig {
3190 fn typename() -> &'static str {
3191 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewLustreConfig"
3192 }
3193}
3194
3195/// When set in a
3196/// [StorageResourceConfig][google.cloud.hypercomputecluster.v1.StorageResourceConfig],
3197/// indicates that an existing [Managed
3198/// Lustre](https://cloud.google.com/products/managed-lustre) instance should be
3199/// imported.
3200///
3201/// [google.cloud.hypercomputecluster.v1.StorageResourceConfig]: crate::model::StorageResourceConfig
3202#[derive(Clone, Default, PartialEq)]
3203#[non_exhaustive]
3204pub struct ExistingLustreConfig {
3205 /// Required. Immutable. Name of the Managed Lustre instance to import, in the
3206 /// format `projects/{project}/locations/{location}/instances/{instance}`
3207 pub lustre: std::string::String,
3208
3209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3210}
3211
3212impl ExistingLustreConfig {
3213 /// Creates a new default instance.
3214 pub fn new() -> Self {
3215 std::default::Default::default()
3216 }
3217
3218 /// Sets the value of [lustre][crate::model::ExistingLustreConfig::lustre].
3219 ///
3220 /// # Example
3221 /// ```ignore,no_run
3222 /// # use google_cloud_hypercomputecluster_v1::model::ExistingLustreConfig;
3223 /// let x = ExistingLustreConfig::new().set_lustre("example");
3224 /// ```
3225 pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3226 self.lustre = v.into();
3227 self
3228 }
3229}
3230
3231impl wkt::message::Message for ExistingLustreConfig {
3232 fn typename() -> &'static str {
3233 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ExistingLustreConfig"
3234 }
3235}
3236
3237/// A resource defining how virtual machines and accelerators should be
3238/// provisioned for the cluster.
3239#[derive(Clone, Default, PartialEq)]
3240#[non_exhaustive]
3241pub struct ComputeResource {
3242 /// Required. Immutable. Configuration for this compute resource, which
3243 /// describes how it should be created at runtime.
3244 pub config: std::option::Option<crate::model::ComputeResourceConfig>,
3245
3246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3247}
3248
3249impl ComputeResource {
3250 /// Creates a new default instance.
3251 pub fn new() -> Self {
3252 std::default::Default::default()
3253 }
3254
3255 /// Sets the value of [config][crate::model::ComputeResource::config].
3256 ///
3257 /// # Example
3258 /// ```ignore,no_run
3259 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResource;
3260 /// use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3261 /// let x = ComputeResource::new().set_config(ComputeResourceConfig::default()/* use setters */);
3262 /// ```
3263 pub fn set_config<T>(mut self, v: T) -> Self
3264 where
3265 T: std::convert::Into<crate::model::ComputeResourceConfig>,
3266 {
3267 self.config = std::option::Option::Some(v.into());
3268 self
3269 }
3270
3271 /// Sets or clears the value of [config][crate::model::ComputeResource::config].
3272 ///
3273 /// # Example
3274 /// ```ignore,no_run
3275 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResource;
3276 /// use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3277 /// let x = ComputeResource::new().set_or_clear_config(Some(ComputeResourceConfig::default()/* use setters */));
3278 /// let x = ComputeResource::new().set_or_clear_config(None::<ComputeResourceConfig>);
3279 /// ```
3280 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
3281 where
3282 T: std::convert::Into<crate::model::ComputeResourceConfig>,
3283 {
3284 self.config = v.map(|x| x.into());
3285 self
3286 }
3287}
3288
3289impl wkt::message::Message for ComputeResource {
3290 fn typename() -> &'static str {
3291 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeResource"
3292 }
3293}
3294
3295/// Describes how a compute resource should be created at runtime.
3296#[derive(Clone, Default, PartialEq)]
3297#[non_exhaustive]
3298pub struct ComputeResourceConfig {
3299 /// Particular type of configuration for this compute resource.
3300 pub config: std::option::Option<crate::model::compute_resource_config::Config>,
3301
3302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3303}
3304
3305impl ComputeResourceConfig {
3306 /// Creates a new default instance.
3307 pub fn new() -> Self {
3308 std::default::Default::default()
3309 }
3310
3311 /// Sets the value of [config][crate::model::ComputeResourceConfig::config].
3312 ///
3313 /// Note that all the setters affecting `config` are mutually
3314 /// exclusive.
3315 ///
3316 /// # Example
3317 /// ```ignore,no_run
3318 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3319 /// use google_cloud_hypercomputecluster_v1::model::NewOnDemandInstancesConfig;
3320 /// let x = ComputeResourceConfig::new().set_config(Some(
3321 /// google_cloud_hypercomputecluster_v1::model::compute_resource_config::Config::NewOnDemandInstances(NewOnDemandInstancesConfig::default().into())));
3322 /// ```
3323 pub fn set_config<
3324 T: std::convert::Into<std::option::Option<crate::model::compute_resource_config::Config>>,
3325 >(
3326 mut self,
3327 v: T,
3328 ) -> Self {
3329 self.config = v.into();
3330 self
3331 }
3332
3333 /// The value of [config][crate::model::ComputeResourceConfig::config]
3334 /// if it holds a `NewOnDemandInstances`, `None` if the field is not set or
3335 /// holds a different branch.
3336 pub fn new_on_demand_instances(
3337 &self,
3338 ) -> std::option::Option<&std::boxed::Box<crate::model::NewOnDemandInstancesConfig>> {
3339 #[allow(unreachable_patterns)]
3340 self.config.as_ref().and_then(|v| match v {
3341 crate::model::compute_resource_config::Config::NewOnDemandInstances(v) => {
3342 std::option::Option::Some(v)
3343 }
3344 _ => std::option::Option::None,
3345 })
3346 }
3347
3348 /// Sets the value of [config][crate::model::ComputeResourceConfig::config]
3349 /// to hold a `NewOnDemandInstances`.
3350 ///
3351 /// Note that all the setters affecting `config` are
3352 /// mutually exclusive.
3353 ///
3354 /// # Example
3355 /// ```ignore,no_run
3356 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3357 /// use google_cloud_hypercomputecluster_v1::model::NewOnDemandInstancesConfig;
3358 /// let x = ComputeResourceConfig::new().set_new_on_demand_instances(NewOnDemandInstancesConfig::default()/* use setters */);
3359 /// assert!(x.new_on_demand_instances().is_some());
3360 /// assert!(x.new_spot_instances().is_none());
3361 /// assert!(x.new_reserved_instances().is_none());
3362 /// assert!(x.new_flex_start_instances().is_none());
3363 /// ```
3364 pub fn set_new_on_demand_instances<
3365 T: std::convert::Into<std::boxed::Box<crate::model::NewOnDemandInstancesConfig>>,
3366 >(
3367 mut self,
3368 v: T,
3369 ) -> Self {
3370 self.config = std::option::Option::Some(
3371 crate::model::compute_resource_config::Config::NewOnDemandInstances(v.into()),
3372 );
3373 self
3374 }
3375
3376 /// The value of [config][crate::model::ComputeResourceConfig::config]
3377 /// if it holds a `NewSpotInstances`, `None` if the field is not set or
3378 /// holds a different branch.
3379 pub fn new_spot_instances(
3380 &self,
3381 ) -> std::option::Option<&std::boxed::Box<crate::model::NewSpotInstancesConfig>> {
3382 #[allow(unreachable_patterns)]
3383 self.config.as_ref().and_then(|v| match v {
3384 crate::model::compute_resource_config::Config::NewSpotInstances(v) => {
3385 std::option::Option::Some(v)
3386 }
3387 _ => std::option::Option::None,
3388 })
3389 }
3390
3391 /// Sets the value of [config][crate::model::ComputeResourceConfig::config]
3392 /// to hold a `NewSpotInstances`.
3393 ///
3394 /// Note that all the setters affecting `config` are
3395 /// mutually exclusive.
3396 ///
3397 /// # Example
3398 /// ```ignore,no_run
3399 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3400 /// use google_cloud_hypercomputecluster_v1::model::NewSpotInstancesConfig;
3401 /// let x = ComputeResourceConfig::new().set_new_spot_instances(NewSpotInstancesConfig::default()/* use setters */);
3402 /// assert!(x.new_spot_instances().is_some());
3403 /// assert!(x.new_on_demand_instances().is_none());
3404 /// assert!(x.new_reserved_instances().is_none());
3405 /// assert!(x.new_flex_start_instances().is_none());
3406 /// ```
3407 pub fn set_new_spot_instances<
3408 T: std::convert::Into<std::boxed::Box<crate::model::NewSpotInstancesConfig>>,
3409 >(
3410 mut self,
3411 v: T,
3412 ) -> Self {
3413 self.config = std::option::Option::Some(
3414 crate::model::compute_resource_config::Config::NewSpotInstances(v.into()),
3415 );
3416 self
3417 }
3418
3419 /// The value of [config][crate::model::ComputeResourceConfig::config]
3420 /// if it holds a `NewReservedInstances`, `None` if the field is not set or
3421 /// holds a different branch.
3422 pub fn new_reserved_instances(
3423 &self,
3424 ) -> std::option::Option<&std::boxed::Box<crate::model::NewReservedInstancesConfig>> {
3425 #[allow(unreachable_patterns)]
3426 self.config.as_ref().and_then(|v| match v {
3427 crate::model::compute_resource_config::Config::NewReservedInstances(v) => {
3428 std::option::Option::Some(v)
3429 }
3430 _ => std::option::Option::None,
3431 })
3432 }
3433
3434 /// Sets the value of [config][crate::model::ComputeResourceConfig::config]
3435 /// to hold a `NewReservedInstances`.
3436 ///
3437 /// Note that all the setters affecting `config` are
3438 /// mutually exclusive.
3439 ///
3440 /// # Example
3441 /// ```ignore,no_run
3442 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3443 /// use google_cloud_hypercomputecluster_v1::model::NewReservedInstancesConfig;
3444 /// let x = ComputeResourceConfig::new().set_new_reserved_instances(NewReservedInstancesConfig::default()/* use setters */);
3445 /// assert!(x.new_reserved_instances().is_some());
3446 /// assert!(x.new_on_demand_instances().is_none());
3447 /// assert!(x.new_spot_instances().is_none());
3448 /// assert!(x.new_flex_start_instances().is_none());
3449 /// ```
3450 pub fn set_new_reserved_instances<
3451 T: std::convert::Into<std::boxed::Box<crate::model::NewReservedInstancesConfig>>,
3452 >(
3453 mut self,
3454 v: T,
3455 ) -> Self {
3456 self.config = std::option::Option::Some(
3457 crate::model::compute_resource_config::Config::NewReservedInstances(v.into()),
3458 );
3459 self
3460 }
3461
3462 /// The value of [config][crate::model::ComputeResourceConfig::config]
3463 /// if it holds a `NewFlexStartInstances`, `None` if the field is not set or
3464 /// holds a different branch.
3465 pub fn new_flex_start_instances(
3466 &self,
3467 ) -> std::option::Option<&std::boxed::Box<crate::model::NewFlexStartInstancesConfig>> {
3468 #[allow(unreachable_patterns)]
3469 self.config.as_ref().and_then(|v| match v {
3470 crate::model::compute_resource_config::Config::NewFlexStartInstances(v) => {
3471 std::option::Option::Some(v)
3472 }
3473 _ => std::option::Option::None,
3474 })
3475 }
3476
3477 /// Sets the value of [config][crate::model::ComputeResourceConfig::config]
3478 /// to hold a `NewFlexStartInstances`.
3479 ///
3480 /// Note that all the setters affecting `config` are
3481 /// mutually exclusive.
3482 ///
3483 /// # Example
3484 /// ```ignore,no_run
3485 /// # use google_cloud_hypercomputecluster_v1::model::ComputeResourceConfig;
3486 /// use google_cloud_hypercomputecluster_v1::model::NewFlexStartInstancesConfig;
3487 /// let x = ComputeResourceConfig::new().set_new_flex_start_instances(NewFlexStartInstancesConfig::default()/* use setters */);
3488 /// assert!(x.new_flex_start_instances().is_some());
3489 /// assert!(x.new_on_demand_instances().is_none());
3490 /// assert!(x.new_spot_instances().is_none());
3491 /// assert!(x.new_reserved_instances().is_none());
3492 /// ```
3493 pub fn set_new_flex_start_instances<
3494 T: std::convert::Into<std::boxed::Box<crate::model::NewFlexStartInstancesConfig>>,
3495 >(
3496 mut self,
3497 v: T,
3498 ) -> Self {
3499 self.config = std::option::Option::Some(
3500 crate::model::compute_resource_config::Config::NewFlexStartInstances(v.into()),
3501 );
3502 self
3503 }
3504}
3505
3506impl wkt::message::Message for ComputeResourceConfig {
3507 fn typename() -> &'static str {
3508 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeResourceConfig"
3509 }
3510}
3511
3512/// Defines additional types related to [ComputeResourceConfig].
3513pub mod compute_resource_config {
3514 #[allow(unused_imports)]
3515 use super::*;
3516
3517 /// Particular type of configuration for this compute resource.
3518 #[derive(Clone, Debug, PartialEq)]
3519 #[non_exhaustive]
3520 pub enum Config {
3521 /// Optional. Immutable. If set, indicates that this resource should use
3522 /// on-demand VMs.
3523 NewOnDemandInstances(std::boxed::Box<crate::model::NewOnDemandInstancesConfig>),
3524 /// Optional. Immutable. If set, indicates that this resource should use spot
3525 /// VMs.
3526 NewSpotInstances(std::boxed::Box<crate::model::NewSpotInstancesConfig>),
3527 /// Optional. Immutable. If set, indicates that this resource should use
3528 /// reserved VMs.
3529 NewReservedInstances(std::boxed::Box<crate::model::NewReservedInstancesConfig>),
3530 /// Optional. Immutable. If set, indicates that this resource should use
3531 /// flex-start VMs.
3532 NewFlexStartInstances(std::boxed::Box<crate::model::NewFlexStartInstancesConfig>),
3533 }
3534}
3535
3536/// When set in a
3537/// [ComputeResourceConfig][google.cloud.hypercomputecluster.v1.ComputeResourceConfig],
3538/// indicates that on-demand (i.e., using the standard provisioning model) VM
3539/// instances should be created.
3540///
3541/// [google.cloud.hypercomputecluster.v1.ComputeResourceConfig]: crate::model::ComputeResourceConfig
3542#[derive(Clone, Default, PartialEq)]
3543#[non_exhaustive]
3544pub struct NewOnDemandInstancesConfig {
3545 /// Required. Immutable. Name of the zone in which VM instances should run,
3546 /// e.g., `us-central1-a`. Must be in the same region as the cluster, and must
3547 /// match the zone of any other resources specified in the cluster.
3548 pub zone: std::string::String,
3549
3550 /// Required. Immutable. Name of the Compute Engine [machine
3551 /// type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g.
3552 /// `n2-standard-2`.
3553 pub machine_type: std::string::String,
3554
3555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3556}
3557
3558impl NewOnDemandInstancesConfig {
3559 /// Creates a new default instance.
3560 pub fn new() -> Self {
3561 std::default::Default::default()
3562 }
3563
3564 /// Sets the value of [zone][crate::model::NewOnDemandInstancesConfig::zone].
3565 ///
3566 /// # Example
3567 /// ```ignore,no_run
3568 /// # use google_cloud_hypercomputecluster_v1::model::NewOnDemandInstancesConfig;
3569 /// let x = NewOnDemandInstancesConfig::new().set_zone("example");
3570 /// ```
3571 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3572 self.zone = v.into();
3573 self
3574 }
3575
3576 /// Sets the value of [machine_type][crate::model::NewOnDemandInstancesConfig::machine_type].
3577 ///
3578 /// # Example
3579 /// ```ignore,no_run
3580 /// # use google_cloud_hypercomputecluster_v1::model::NewOnDemandInstancesConfig;
3581 /// let x = NewOnDemandInstancesConfig::new().set_machine_type("example");
3582 /// ```
3583 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3584 self.machine_type = v.into();
3585 self
3586 }
3587}
3588
3589impl wkt::message::Message for NewOnDemandInstancesConfig {
3590 fn typename() -> &'static str {
3591 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewOnDemandInstancesConfig"
3592 }
3593}
3594
3595/// When set in a
3596/// [ComputeResourceConfig][google.cloud.hypercomputecluster.v1.ComputeResourceConfig],
3597/// indicates that [spot
3598/// VM](https://cloud.google.com/compute/docs/instances/spot) instances should be
3599/// created.
3600///
3601/// [google.cloud.hypercomputecluster.v1.ComputeResourceConfig]: crate::model::ComputeResourceConfig
3602#[derive(Clone, Default, PartialEq)]
3603#[non_exhaustive]
3604pub struct NewSpotInstancesConfig {
3605 /// Required. Immutable. Name of the zone in which VM instances should run,
3606 /// e.g., `us-central1-a`. Must be in the same region as the cluster, and must
3607 /// match the zone of any other resources specified in the cluster.
3608 pub zone: std::string::String,
3609
3610 /// Required. Immutable. Name of the Compute Engine [machine
3611 /// type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g.
3612 /// `n2-standard-2`.
3613 pub machine_type: std::string::String,
3614
3615 /// Optional. Termination action for the instance. If not specified, Compute
3616 /// Engine sets the termination action to DELETE.
3617 pub termination_action: crate::model::new_spot_instances_config::TerminationAction,
3618
3619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3620}
3621
3622impl NewSpotInstancesConfig {
3623 /// Creates a new default instance.
3624 pub fn new() -> Self {
3625 std::default::Default::default()
3626 }
3627
3628 /// Sets the value of [zone][crate::model::NewSpotInstancesConfig::zone].
3629 ///
3630 /// # Example
3631 /// ```ignore,no_run
3632 /// # use google_cloud_hypercomputecluster_v1::model::NewSpotInstancesConfig;
3633 /// let x = NewSpotInstancesConfig::new().set_zone("example");
3634 /// ```
3635 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3636 self.zone = v.into();
3637 self
3638 }
3639
3640 /// Sets the value of [machine_type][crate::model::NewSpotInstancesConfig::machine_type].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_hypercomputecluster_v1::model::NewSpotInstancesConfig;
3645 /// let x = NewSpotInstancesConfig::new().set_machine_type("example");
3646 /// ```
3647 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.machine_type = v.into();
3649 self
3650 }
3651
3652 /// Sets the value of [termination_action][crate::model::NewSpotInstancesConfig::termination_action].
3653 ///
3654 /// # Example
3655 /// ```ignore,no_run
3656 /// # use google_cloud_hypercomputecluster_v1::model::NewSpotInstancesConfig;
3657 /// use google_cloud_hypercomputecluster_v1::model::new_spot_instances_config::TerminationAction;
3658 /// let x0 = NewSpotInstancesConfig::new().set_termination_action(TerminationAction::Stop);
3659 /// let x1 = NewSpotInstancesConfig::new().set_termination_action(TerminationAction::Delete);
3660 /// ```
3661 pub fn set_termination_action<
3662 T: std::convert::Into<crate::model::new_spot_instances_config::TerminationAction>,
3663 >(
3664 mut self,
3665 v: T,
3666 ) -> Self {
3667 self.termination_action = v.into();
3668 self
3669 }
3670}
3671
3672impl wkt::message::Message for NewSpotInstancesConfig {
3673 fn typename() -> &'static str {
3674 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig"
3675 }
3676}
3677
3678/// Defines additional types related to [NewSpotInstancesConfig].
3679pub mod new_spot_instances_config {
3680 #[allow(unused_imports)]
3681 use super::*;
3682
3683 /// Specifies the termination action of the instance
3684 ///
3685 /// # Working with unknown values
3686 ///
3687 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3688 /// additional enum variants at any time. Adding new variants is not considered
3689 /// a breaking change. Applications should write their code in anticipation of:
3690 ///
3691 /// - New values appearing in future releases of the client library, **and**
3692 /// - New values received dynamically, without application changes.
3693 ///
3694 /// Please consult the [Working with enums] section in the user guide for some
3695 /// guidelines.
3696 ///
3697 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3698 #[derive(Clone, Debug, PartialEq)]
3699 #[non_exhaustive]
3700 pub enum TerminationAction {
3701 /// Not set.
3702 Unspecified,
3703 /// Compute Engine stops the Spot VM on preemption.
3704 Stop,
3705 /// Compute Engine deletes the Spot VM on preemption.
3706 Delete,
3707 /// If set, the enum was initialized with an unknown value.
3708 ///
3709 /// Applications can examine the value using [TerminationAction::value] or
3710 /// [TerminationAction::name].
3711 UnknownValue(termination_action::UnknownValue),
3712 }
3713
3714 #[doc(hidden)]
3715 pub mod termination_action {
3716 #[allow(unused_imports)]
3717 use super::*;
3718 #[derive(Clone, Debug, PartialEq)]
3719 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3720 }
3721
3722 impl TerminationAction {
3723 /// Gets the enum value.
3724 ///
3725 /// Returns `None` if the enum contains an unknown value deserialized from
3726 /// the string representation of enums.
3727 pub fn value(&self) -> std::option::Option<i32> {
3728 match self {
3729 Self::Unspecified => std::option::Option::Some(0),
3730 Self::Stop => std::option::Option::Some(1),
3731 Self::Delete => std::option::Option::Some(2),
3732 Self::UnknownValue(u) => u.0.value(),
3733 }
3734 }
3735
3736 /// Gets the enum value as a string.
3737 ///
3738 /// Returns `None` if the enum contains an unknown value deserialized from
3739 /// the integer representation of enums.
3740 pub fn name(&self) -> std::option::Option<&str> {
3741 match self {
3742 Self::Unspecified => std::option::Option::Some("TERMINATION_ACTION_UNSPECIFIED"),
3743 Self::Stop => std::option::Option::Some("STOP"),
3744 Self::Delete => std::option::Option::Some("DELETE"),
3745 Self::UnknownValue(u) => u.0.name(),
3746 }
3747 }
3748 }
3749
3750 impl std::default::Default for TerminationAction {
3751 fn default() -> Self {
3752 use std::convert::From;
3753 Self::from(0)
3754 }
3755 }
3756
3757 impl std::fmt::Display for TerminationAction {
3758 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3759 wkt::internal::display_enum(f, self.name(), self.value())
3760 }
3761 }
3762
3763 impl std::convert::From<i32> for TerminationAction {
3764 fn from(value: i32) -> Self {
3765 match value {
3766 0 => Self::Unspecified,
3767 1 => Self::Stop,
3768 2 => Self::Delete,
3769 _ => Self::UnknownValue(termination_action::UnknownValue(
3770 wkt::internal::UnknownEnumValue::Integer(value),
3771 )),
3772 }
3773 }
3774 }
3775
3776 impl std::convert::From<&str> for TerminationAction {
3777 fn from(value: &str) -> Self {
3778 use std::string::ToString;
3779 match value {
3780 "TERMINATION_ACTION_UNSPECIFIED" => Self::Unspecified,
3781 "STOP" => Self::Stop,
3782 "DELETE" => Self::Delete,
3783 _ => Self::UnknownValue(termination_action::UnknownValue(
3784 wkt::internal::UnknownEnumValue::String(value.to_string()),
3785 )),
3786 }
3787 }
3788 }
3789
3790 impl serde::ser::Serialize for TerminationAction {
3791 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3792 where
3793 S: serde::Serializer,
3794 {
3795 match self {
3796 Self::Unspecified => serializer.serialize_i32(0),
3797 Self::Stop => serializer.serialize_i32(1),
3798 Self::Delete => serializer.serialize_i32(2),
3799 Self::UnknownValue(u) => u.0.serialize(serializer),
3800 }
3801 }
3802 }
3803
3804 impl<'de> serde::de::Deserialize<'de> for TerminationAction {
3805 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3806 where
3807 D: serde::Deserializer<'de>,
3808 {
3809 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TerminationAction>::new(
3810 ".google.cloud.hypercomputecluster.v1.NewSpotInstancesConfig.TerminationAction",
3811 ))
3812 }
3813 }
3814}
3815
3816/// When set in a
3817/// [ComputeResourceConfig][google.cloud.hypercomputecluster.v1.ComputeResourceConfig],
3818/// indicates that VM instances should be created from a
3819/// [reservation](https://cloud.google.com/compute/docs/instances/reservations-overview).
3820///
3821/// [google.cloud.hypercomputecluster.v1.ComputeResourceConfig]: crate::model::ComputeResourceConfig
3822#[derive(Clone, Default, PartialEq)]
3823#[non_exhaustive]
3824pub struct NewReservedInstancesConfig {
3825 /// Source of the reservation
3826 pub source: std::option::Option<crate::model::new_reserved_instances_config::Source>,
3827
3828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3829}
3830
3831impl NewReservedInstancesConfig {
3832 /// Creates a new default instance.
3833 pub fn new() -> Self {
3834 std::default::Default::default()
3835 }
3836
3837 /// Sets the value of [source][crate::model::NewReservedInstancesConfig::source].
3838 ///
3839 /// Note that all the setters affecting `source` are mutually
3840 /// exclusive.
3841 ///
3842 /// # Example
3843 /// ```ignore,no_run
3844 /// # use google_cloud_hypercomputecluster_v1::model::NewReservedInstancesConfig;
3845 /// use google_cloud_hypercomputecluster_v1::model::new_reserved_instances_config::Source;
3846 /// let x = NewReservedInstancesConfig::new().set_source(Some(Source::Reservation("example".to_string())));
3847 /// ```
3848 pub fn set_source<
3849 T: std::convert::Into<
3850 std::option::Option<crate::model::new_reserved_instances_config::Source>,
3851 >,
3852 >(
3853 mut self,
3854 v: T,
3855 ) -> Self {
3856 self.source = v.into();
3857 self
3858 }
3859
3860 /// The value of [source][crate::model::NewReservedInstancesConfig::source]
3861 /// if it holds a `Reservation`, `None` if the field is not set or
3862 /// holds a different branch.
3863 pub fn reservation(&self) -> std::option::Option<&std::string::String> {
3864 #[allow(unreachable_patterns)]
3865 self.source.as_ref().and_then(|v| match v {
3866 crate::model::new_reserved_instances_config::Source::Reservation(v) => {
3867 std::option::Option::Some(v)
3868 }
3869 _ => std::option::Option::None,
3870 })
3871 }
3872
3873 /// Sets the value of [source][crate::model::NewReservedInstancesConfig::source]
3874 /// to hold a `Reservation`.
3875 ///
3876 /// Note that all the setters affecting `source` are
3877 /// mutually exclusive.
3878 ///
3879 /// # Example
3880 /// ```ignore,no_run
3881 /// # use google_cloud_hypercomputecluster_v1::model::NewReservedInstancesConfig;
3882 /// let x = NewReservedInstancesConfig::new().set_reservation("example");
3883 /// assert!(x.reservation().is_some());
3884 /// ```
3885 pub fn set_reservation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.source = std::option::Option::Some(
3887 crate::model::new_reserved_instances_config::Source::Reservation(v.into()),
3888 );
3889 self
3890 }
3891}
3892
3893impl wkt::message::Message for NewReservedInstancesConfig {
3894 fn typename() -> &'static str {
3895 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewReservedInstancesConfig"
3896 }
3897}
3898
3899/// Defines additional types related to [NewReservedInstancesConfig].
3900pub mod new_reserved_instances_config {
3901 #[allow(unused_imports)]
3902 use super::*;
3903
3904 /// Source of the reservation
3905 #[derive(Clone, Debug, PartialEq)]
3906 #[non_exhaustive]
3907 pub enum Source {
3908 /// Optional. Immutable. Name of the reservation from which VM instances
3909 /// should be created, in the format
3910 /// `projects/{project}/zones/{zone}/reservations/{reservation}`.
3911 Reservation(std::string::String),
3912 }
3913}
3914
3915/// When set in a
3916/// [ComputeResourceConfig][google.cloud.hypercomputecluster.v1.ComputeResourceConfig],
3917/// indicates that VM instances should be created using [Flex
3918/// Start](https://cloud.google.com/compute/docs/instances/provisioning-models).
3919///
3920/// [google.cloud.hypercomputecluster.v1.ComputeResourceConfig]: crate::model::ComputeResourceConfig
3921#[derive(Clone, Default, PartialEq)]
3922#[non_exhaustive]
3923pub struct NewFlexStartInstancesConfig {
3924 /// Required. Immutable. Name of the zone in which VM instances should run,
3925 /// e.g., `us-central1-a`. Must be in the same region as the cluster, and must
3926 /// match the zone of any other resources specified in the cluster.
3927 pub zone: std::string::String,
3928
3929 /// Required. Immutable. Name of the Compute Engine [machine
3930 /// type](https://cloud.google.com/compute/docs/machine-resource) to use, e.g.
3931 /// `n2-standard-2`.
3932 pub machine_type: std::string::String,
3933
3934 /// Required. Immutable. Specifies the time limit for created instances.
3935 /// Instances will be terminated at the end of this duration.
3936 pub max_duration: std::option::Option<wkt::Duration>,
3937
3938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3939}
3940
3941impl NewFlexStartInstancesConfig {
3942 /// Creates a new default instance.
3943 pub fn new() -> Self {
3944 std::default::Default::default()
3945 }
3946
3947 /// Sets the value of [zone][crate::model::NewFlexStartInstancesConfig::zone].
3948 ///
3949 /// # Example
3950 /// ```ignore,no_run
3951 /// # use google_cloud_hypercomputecluster_v1::model::NewFlexStartInstancesConfig;
3952 /// let x = NewFlexStartInstancesConfig::new().set_zone("example");
3953 /// ```
3954 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3955 self.zone = v.into();
3956 self
3957 }
3958
3959 /// Sets the value of [machine_type][crate::model::NewFlexStartInstancesConfig::machine_type].
3960 ///
3961 /// # Example
3962 /// ```ignore,no_run
3963 /// # use google_cloud_hypercomputecluster_v1::model::NewFlexStartInstancesConfig;
3964 /// let x = NewFlexStartInstancesConfig::new().set_machine_type("example");
3965 /// ```
3966 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3967 self.machine_type = v.into();
3968 self
3969 }
3970
3971 /// Sets the value of [max_duration][crate::model::NewFlexStartInstancesConfig::max_duration].
3972 ///
3973 /// # Example
3974 /// ```ignore,no_run
3975 /// # use google_cloud_hypercomputecluster_v1::model::NewFlexStartInstancesConfig;
3976 /// use wkt::Duration;
3977 /// let x = NewFlexStartInstancesConfig::new().set_max_duration(Duration::default()/* use setters */);
3978 /// ```
3979 pub fn set_max_duration<T>(mut self, v: T) -> Self
3980 where
3981 T: std::convert::Into<wkt::Duration>,
3982 {
3983 self.max_duration = std::option::Option::Some(v.into());
3984 self
3985 }
3986
3987 /// Sets or clears the value of [max_duration][crate::model::NewFlexStartInstancesConfig::max_duration].
3988 ///
3989 /// # Example
3990 /// ```ignore,no_run
3991 /// # use google_cloud_hypercomputecluster_v1::model::NewFlexStartInstancesConfig;
3992 /// use wkt::Duration;
3993 /// let x = NewFlexStartInstancesConfig::new().set_or_clear_max_duration(Some(Duration::default()/* use setters */));
3994 /// let x = NewFlexStartInstancesConfig::new().set_or_clear_max_duration(None::<Duration>);
3995 /// ```
3996 pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
3997 where
3998 T: std::convert::Into<wkt::Duration>,
3999 {
4000 self.max_duration = v.map(|x| x.into());
4001 self
4002 }
4003}
4004
4005impl wkt::message::Message for NewFlexStartInstancesConfig {
4006 fn typename() -> &'static str {
4007 "type.googleapis.com/google.cloud.hypercomputecluster.v1.NewFlexStartInstancesConfig"
4008 }
4009}
4010
4011/// A [Persistent disk](https://cloud.google.com/compute/docs/disks) used as the
4012/// boot disk for a Compute Engine VM instance.
4013#[derive(Clone, Default, PartialEq)]
4014#[non_exhaustive]
4015pub struct BootDisk {
4016 /// Required. Immutable. [Persistent disk
4017 /// type](https://cloud.google.com/compute/docs/disks#disk-types), in the
4018 /// format `projects/{project}/zones/{zone}/diskTypes/{disk_type}`.
4019 pub r#type: std::string::String,
4020
4021 /// Required. Immutable. Size of the disk in gigabytes. Must be at least 10GB.
4022 pub size_gb: i64,
4023
4024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4025}
4026
4027impl BootDisk {
4028 /// Creates a new default instance.
4029 pub fn new() -> Self {
4030 std::default::Default::default()
4031 }
4032
4033 /// Sets the value of [r#type][crate::model::BootDisk::type].
4034 ///
4035 /// # Example
4036 /// ```ignore,no_run
4037 /// # use google_cloud_hypercomputecluster_v1::model::BootDisk;
4038 /// let x = BootDisk::new().set_type("example");
4039 /// ```
4040 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4041 self.r#type = v.into();
4042 self
4043 }
4044
4045 /// Sets the value of [size_gb][crate::model::BootDisk::size_gb].
4046 ///
4047 /// # Example
4048 /// ```ignore,no_run
4049 /// # use google_cloud_hypercomputecluster_v1::model::BootDisk;
4050 /// let x = BootDisk::new().set_size_gb(42);
4051 /// ```
4052 pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4053 self.size_gb = v.into();
4054 self
4055 }
4056}
4057
4058impl wkt::message::Message for BootDisk {
4059 fn typename() -> &'static str {
4060 "type.googleapis.com/google.cloud.hypercomputecluster.v1.BootDisk"
4061 }
4062}
4063
4064/// The component responsible for scheduling and running workloads on the
4065/// cluster as well as providing the user interface for interacting with the
4066/// cluster at runtime.
4067#[derive(Clone, Default, PartialEq)]
4068#[non_exhaustive]
4069pub struct Orchestrator {
4070 /// Particular type of orchestrator to use in this cluster.
4071 pub option: std::option::Option<crate::model::orchestrator::Option>,
4072
4073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4074}
4075
4076impl Orchestrator {
4077 /// Creates a new default instance.
4078 pub fn new() -> Self {
4079 std::default::Default::default()
4080 }
4081
4082 /// Sets the value of [option][crate::model::Orchestrator::option].
4083 ///
4084 /// Note that all the setters affecting `option` are mutually
4085 /// exclusive.
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_hypercomputecluster_v1::model::Orchestrator;
4090 /// use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4091 /// let x = Orchestrator::new().set_option(Some(
4092 /// google_cloud_hypercomputecluster_v1::model::orchestrator::Option::Slurm(SlurmOrchestrator::default().into())));
4093 /// ```
4094 pub fn set_option<
4095 T: std::convert::Into<std::option::Option<crate::model::orchestrator::Option>>,
4096 >(
4097 mut self,
4098 v: T,
4099 ) -> Self {
4100 self.option = v.into();
4101 self
4102 }
4103
4104 /// The value of [option][crate::model::Orchestrator::option]
4105 /// if it holds a `Slurm`, `None` if the field is not set or
4106 /// holds a different branch.
4107 pub fn slurm(&self) -> std::option::Option<&std::boxed::Box<crate::model::SlurmOrchestrator>> {
4108 #[allow(unreachable_patterns)]
4109 self.option.as_ref().and_then(|v| match v {
4110 crate::model::orchestrator::Option::Slurm(v) => std::option::Option::Some(v),
4111 _ => std::option::Option::None,
4112 })
4113 }
4114
4115 /// Sets the value of [option][crate::model::Orchestrator::option]
4116 /// to hold a `Slurm`.
4117 ///
4118 /// Note that all the setters affecting `option` are
4119 /// mutually exclusive.
4120 ///
4121 /// # Example
4122 /// ```ignore,no_run
4123 /// # use google_cloud_hypercomputecluster_v1::model::Orchestrator;
4124 /// use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4125 /// let x = Orchestrator::new().set_slurm(SlurmOrchestrator::default()/* use setters */);
4126 /// assert!(x.slurm().is_some());
4127 /// ```
4128 pub fn set_slurm<T: std::convert::Into<std::boxed::Box<crate::model::SlurmOrchestrator>>>(
4129 mut self,
4130 v: T,
4131 ) -> Self {
4132 self.option =
4133 std::option::Option::Some(crate::model::orchestrator::Option::Slurm(v.into()));
4134 self
4135 }
4136}
4137
4138impl wkt::message::Message for Orchestrator {
4139 fn typename() -> &'static str {
4140 "type.googleapis.com/google.cloud.hypercomputecluster.v1.Orchestrator"
4141 }
4142}
4143
4144/// Defines additional types related to [Orchestrator].
4145pub mod orchestrator {
4146 #[allow(unused_imports)]
4147 use super::*;
4148
4149 /// Particular type of orchestrator to use in this cluster.
4150 #[derive(Clone, Debug, PartialEq)]
4151 #[non_exhaustive]
4152 pub enum Option {
4153 /// Optional. If set, indicates that the cluster should use Slurm as the
4154 /// orchestrator.
4155 Slurm(std::boxed::Box<crate::model::SlurmOrchestrator>),
4156 }
4157}
4158
4159/// When set in [Orchestrator][google.cloud.hypercomputecluster.v1.Orchestrator],
4160/// indicates that the cluster should use [Slurm](https://slurm.schedmd.com/) as
4161/// the orchestrator.
4162///
4163/// [google.cloud.hypercomputecluster.v1.Orchestrator]: crate::model::Orchestrator
4164#[derive(Clone, Default, PartialEq)]
4165#[non_exhaustive]
4166pub struct SlurmOrchestrator {
4167 /// Required. Configuration for login nodes, which allow users to access the
4168 /// cluster over SSH.
4169 pub login_nodes: std::option::Option<crate::model::SlurmLoginNodes>,
4170
4171 /// Optional. Compute resource configuration for the Slurm nodesets in your
4172 /// cluster. If not specified, the cluster won't create any nodes.
4173 pub node_sets: std::vec::Vec<crate::model::SlurmNodeSet>,
4174
4175 /// Optional. Configuration for the Slurm partitions in your cluster. Each
4176 /// partition can contain one or more nodesets, and you can submit separate
4177 /// jobs on each partition. If you don't specify at least one partition in your
4178 /// cluster, you can't submit jobs to the cluster.
4179 pub partitions: std::vec::Vec<crate::model::SlurmPartition>,
4180
4181 /// Optional. Default partition to use for submitted jobs that do not
4182 /// explicitly specify a partition. Required if and only if there is more than
4183 /// one partition, in which case it must match the id of one of the partitions.
4184 pub default_partition: std::string::String,
4185
4186 /// Optional. Slurm [prolog
4187 /// scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be
4188 /// executed by compute nodes before a node begins running a new job. Values
4189 /// must not be empty.
4190 pub prolog_bash_scripts: std::vec::Vec<std::string::String>,
4191
4192 /// Optional. Slurm [epilog
4193 /// scripts](https://slurm.schedmd.com/prolog_epilog.html), which will be
4194 /// executed by compute nodes whenever a node finishes running a job. Values
4195 /// must not be empty.
4196 pub epilog_bash_scripts: std::vec::Vec<std::string::String>,
4197
4198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4199}
4200
4201impl SlurmOrchestrator {
4202 /// Creates a new default instance.
4203 pub fn new() -> Self {
4204 std::default::Default::default()
4205 }
4206
4207 /// Sets the value of [login_nodes][crate::model::SlurmOrchestrator::login_nodes].
4208 ///
4209 /// # Example
4210 /// ```ignore,no_run
4211 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4212 /// use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4213 /// let x = SlurmOrchestrator::new().set_login_nodes(SlurmLoginNodes::default()/* use setters */);
4214 /// ```
4215 pub fn set_login_nodes<T>(mut self, v: T) -> Self
4216 where
4217 T: std::convert::Into<crate::model::SlurmLoginNodes>,
4218 {
4219 self.login_nodes = std::option::Option::Some(v.into());
4220 self
4221 }
4222
4223 /// Sets or clears the value of [login_nodes][crate::model::SlurmOrchestrator::login_nodes].
4224 ///
4225 /// # Example
4226 /// ```ignore,no_run
4227 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4228 /// use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4229 /// let x = SlurmOrchestrator::new().set_or_clear_login_nodes(Some(SlurmLoginNodes::default()/* use setters */));
4230 /// let x = SlurmOrchestrator::new().set_or_clear_login_nodes(None::<SlurmLoginNodes>);
4231 /// ```
4232 pub fn set_or_clear_login_nodes<T>(mut self, v: std::option::Option<T>) -> Self
4233 where
4234 T: std::convert::Into<crate::model::SlurmLoginNodes>,
4235 {
4236 self.login_nodes = v.map(|x| x.into());
4237 self
4238 }
4239
4240 /// Sets the value of [node_sets][crate::model::SlurmOrchestrator::node_sets].
4241 ///
4242 /// # Example
4243 /// ```ignore,no_run
4244 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4245 /// use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4246 /// let x = SlurmOrchestrator::new()
4247 /// .set_node_sets([
4248 /// SlurmNodeSet::default()/* use setters */,
4249 /// SlurmNodeSet::default()/* use (different) setters */,
4250 /// ]);
4251 /// ```
4252 pub fn set_node_sets<T, V>(mut self, v: T) -> Self
4253 where
4254 T: std::iter::IntoIterator<Item = V>,
4255 V: std::convert::Into<crate::model::SlurmNodeSet>,
4256 {
4257 use std::iter::Iterator;
4258 self.node_sets = v.into_iter().map(|i| i.into()).collect();
4259 self
4260 }
4261
4262 /// Sets the value of [partitions][crate::model::SlurmOrchestrator::partitions].
4263 ///
4264 /// # Example
4265 /// ```ignore,no_run
4266 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4267 /// use google_cloud_hypercomputecluster_v1::model::SlurmPartition;
4268 /// let x = SlurmOrchestrator::new()
4269 /// .set_partitions([
4270 /// SlurmPartition::default()/* use setters */,
4271 /// SlurmPartition::default()/* use (different) setters */,
4272 /// ]);
4273 /// ```
4274 pub fn set_partitions<T, V>(mut self, v: T) -> Self
4275 where
4276 T: std::iter::IntoIterator<Item = V>,
4277 V: std::convert::Into<crate::model::SlurmPartition>,
4278 {
4279 use std::iter::Iterator;
4280 self.partitions = v.into_iter().map(|i| i.into()).collect();
4281 self
4282 }
4283
4284 /// Sets the value of [default_partition][crate::model::SlurmOrchestrator::default_partition].
4285 ///
4286 /// # Example
4287 /// ```ignore,no_run
4288 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4289 /// let x = SlurmOrchestrator::new().set_default_partition("example");
4290 /// ```
4291 pub fn set_default_partition<T: std::convert::Into<std::string::String>>(
4292 mut self,
4293 v: T,
4294 ) -> Self {
4295 self.default_partition = v.into();
4296 self
4297 }
4298
4299 /// Sets the value of [prolog_bash_scripts][crate::model::SlurmOrchestrator::prolog_bash_scripts].
4300 ///
4301 /// # Example
4302 /// ```ignore,no_run
4303 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4304 /// let x = SlurmOrchestrator::new().set_prolog_bash_scripts(["a", "b", "c"]);
4305 /// ```
4306 pub fn set_prolog_bash_scripts<T, V>(mut self, v: T) -> Self
4307 where
4308 T: std::iter::IntoIterator<Item = V>,
4309 V: std::convert::Into<std::string::String>,
4310 {
4311 use std::iter::Iterator;
4312 self.prolog_bash_scripts = v.into_iter().map(|i| i.into()).collect();
4313 self
4314 }
4315
4316 /// Sets the value of [epilog_bash_scripts][crate::model::SlurmOrchestrator::epilog_bash_scripts].
4317 ///
4318 /// # Example
4319 /// ```ignore,no_run
4320 /// # use google_cloud_hypercomputecluster_v1::model::SlurmOrchestrator;
4321 /// let x = SlurmOrchestrator::new().set_epilog_bash_scripts(["a", "b", "c"]);
4322 /// ```
4323 pub fn set_epilog_bash_scripts<T, V>(mut self, v: T) -> Self
4324 where
4325 T: std::iter::IntoIterator<Item = V>,
4326 V: std::convert::Into<std::string::String>,
4327 {
4328 use std::iter::Iterator;
4329 self.epilog_bash_scripts = v.into_iter().map(|i| i.into()).collect();
4330 self
4331 }
4332}
4333
4334impl wkt::message::Message for SlurmOrchestrator {
4335 fn typename() -> &'static str {
4336 "type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmOrchestrator"
4337 }
4338}
4339
4340/// Configuration for Slurm nodesets in the cluster. Nodesets are groups of
4341/// compute nodes used by Slurm that are responsible for running workloads
4342/// submitted to the cluster.
4343#[derive(Clone, Default, PartialEq)]
4344#[non_exhaustive]
4345pub struct SlurmNodeSet {
4346 /// Required. Identifier for the nodeset, which allows it to be referenced by
4347 /// partitions. Must conform to
4348 /// [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
4349 /// alphanumeric, and at most 63 characters).
4350 pub id: std::string::String,
4351
4352 /// Optional. ID of the compute resource on which this nodeset will run. Must
4353 /// match a key in the cluster's
4354 /// [compute_resources][google.cloud.hypercomputecluster.v1.Cluster.compute_resources].
4355 ///
4356 /// [google.cloud.hypercomputecluster.v1.Cluster.compute_resources]: crate::model::Cluster::compute_resources
4357 pub compute_id: std::string::String,
4358
4359 /// Optional. How [storage
4360 /// resources][google.cloud.hypercomputecluster.v1.StorageResource] should be
4361 /// mounted on each compute node.
4362 ///
4363 /// [google.cloud.hypercomputecluster.v1.StorageResource]: crate::model::StorageResource
4364 pub storage_configs: std::vec::Vec<crate::model::StorageConfig>,
4365
4366 /// Optional. Number of nodes to be statically created for this nodeset. The
4367 /// cluster will attempt to ensure that at least this many nodes exist at all
4368 /// times.
4369 pub static_node_count: i64,
4370
4371 /// Optional. Controls how many additional nodes a cluster can bring online to
4372 /// handle workloads. Set this value to enable dynamic node creation and limit
4373 /// the number of additional nodes the cluster can bring online. Leave empty if
4374 /// you do not want the cluster to create nodes dynamically, and instead rely
4375 /// only on static nodes.
4376 pub max_dynamic_node_count: i64,
4377
4378 /// Additional configuration for the nodeset. If not set, the nodeset will
4379 /// use
4380 /// [ComputeInstanceSlurmNodeSet][google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet]
4381 /// with default values.
4382 ///
4383 /// [google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet]: crate::model::ComputeInstanceSlurmNodeSet
4384 pub r#type: std::option::Option<crate::model::slurm_node_set::Type>,
4385
4386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4387}
4388
4389impl SlurmNodeSet {
4390 /// Creates a new default instance.
4391 pub fn new() -> Self {
4392 std::default::Default::default()
4393 }
4394
4395 /// Sets the value of [id][crate::model::SlurmNodeSet::id].
4396 ///
4397 /// # Example
4398 /// ```ignore,no_run
4399 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4400 /// let x = SlurmNodeSet::new().set_id("example");
4401 /// ```
4402 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4403 self.id = v.into();
4404 self
4405 }
4406
4407 /// Sets the value of [compute_id][crate::model::SlurmNodeSet::compute_id].
4408 ///
4409 /// # Example
4410 /// ```ignore,no_run
4411 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4412 /// let x = SlurmNodeSet::new().set_compute_id("example");
4413 /// ```
4414 pub fn set_compute_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4415 self.compute_id = v.into();
4416 self
4417 }
4418
4419 /// Sets the value of [storage_configs][crate::model::SlurmNodeSet::storage_configs].
4420 ///
4421 /// # Example
4422 /// ```ignore,no_run
4423 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4424 /// use google_cloud_hypercomputecluster_v1::model::StorageConfig;
4425 /// let x = SlurmNodeSet::new()
4426 /// .set_storage_configs([
4427 /// StorageConfig::default()/* use setters */,
4428 /// StorageConfig::default()/* use (different) setters */,
4429 /// ]);
4430 /// ```
4431 pub fn set_storage_configs<T, V>(mut self, v: T) -> Self
4432 where
4433 T: std::iter::IntoIterator<Item = V>,
4434 V: std::convert::Into<crate::model::StorageConfig>,
4435 {
4436 use std::iter::Iterator;
4437 self.storage_configs = v.into_iter().map(|i| i.into()).collect();
4438 self
4439 }
4440
4441 /// Sets the value of [static_node_count][crate::model::SlurmNodeSet::static_node_count].
4442 ///
4443 /// # Example
4444 /// ```ignore,no_run
4445 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4446 /// let x = SlurmNodeSet::new().set_static_node_count(42);
4447 /// ```
4448 pub fn set_static_node_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4449 self.static_node_count = v.into();
4450 self
4451 }
4452
4453 /// Sets the value of [max_dynamic_node_count][crate::model::SlurmNodeSet::max_dynamic_node_count].
4454 ///
4455 /// # Example
4456 /// ```ignore,no_run
4457 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4458 /// let x = SlurmNodeSet::new().set_max_dynamic_node_count(42);
4459 /// ```
4460 pub fn set_max_dynamic_node_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4461 self.max_dynamic_node_count = v.into();
4462 self
4463 }
4464
4465 /// Sets the value of [r#type][crate::model::SlurmNodeSet::type].
4466 ///
4467 /// Note that all the setters affecting `r#type` are mutually
4468 /// exclusive.
4469 ///
4470 /// # Example
4471 /// ```ignore,no_run
4472 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4473 /// use google_cloud_hypercomputecluster_v1::model::ComputeInstanceSlurmNodeSet;
4474 /// let x = SlurmNodeSet::new().set_type(Some(
4475 /// google_cloud_hypercomputecluster_v1::model::slurm_node_set::Type::ComputeInstance(ComputeInstanceSlurmNodeSet::default().into())));
4476 /// ```
4477 pub fn set_type<
4478 T: std::convert::Into<std::option::Option<crate::model::slurm_node_set::Type>>,
4479 >(
4480 mut self,
4481 v: T,
4482 ) -> Self {
4483 self.r#type = v.into();
4484 self
4485 }
4486
4487 /// The value of [r#type][crate::model::SlurmNodeSet::r#type]
4488 /// if it holds a `ComputeInstance`, `None` if the field is not set or
4489 /// holds a different branch.
4490 pub fn compute_instance(
4491 &self,
4492 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeInstanceSlurmNodeSet>> {
4493 #[allow(unreachable_patterns)]
4494 self.r#type.as_ref().and_then(|v| match v {
4495 crate::model::slurm_node_set::Type::ComputeInstance(v) => std::option::Option::Some(v),
4496 _ => std::option::Option::None,
4497 })
4498 }
4499
4500 /// Sets the value of [r#type][crate::model::SlurmNodeSet::r#type]
4501 /// to hold a `ComputeInstance`.
4502 ///
4503 /// Note that all the setters affecting `r#type` are
4504 /// mutually exclusive.
4505 ///
4506 /// # Example
4507 /// ```ignore,no_run
4508 /// # use google_cloud_hypercomputecluster_v1::model::SlurmNodeSet;
4509 /// use google_cloud_hypercomputecluster_v1::model::ComputeInstanceSlurmNodeSet;
4510 /// let x = SlurmNodeSet::new().set_compute_instance(ComputeInstanceSlurmNodeSet::default()/* use setters */);
4511 /// assert!(x.compute_instance().is_some());
4512 /// ```
4513 pub fn set_compute_instance<
4514 T: std::convert::Into<std::boxed::Box<crate::model::ComputeInstanceSlurmNodeSet>>,
4515 >(
4516 mut self,
4517 v: T,
4518 ) -> Self {
4519 self.r#type = std::option::Option::Some(
4520 crate::model::slurm_node_set::Type::ComputeInstance(v.into()),
4521 );
4522 self
4523 }
4524}
4525
4526impl wkt::message::Message for SlurmNodeSet {
4527 fn typename() -> &'static str {
4528 "type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmNodeSet"
4529 }
4530}
4531
4532/// Defines additional types related to [SlurmNodeSet].
4533pub mod slurm_node_set {
4534 #[allow(unused_imports)]
4535 use super::*;
4536
4537 /// Additional configuration for the nodeset. If not set, the nodeset will
4538 /// use
4539 /// [ComputeInstanceSlurmNodeSet][google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet]
4540 /// with default values.
4541 ///
4542 /// [google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet]: crate::model::ComputeInstanceSlurmNodeSet
4543 #[derive(Clone, Debug, PartialEq)]
4544 #[non_exhaustive]
4545 pub enum Type {
4546 /// Optional. If set, indicates that the nodeset should be backed by Compute
4547 /// Engine instances.
4548 ComputeInstance(std::boxed::Box<crate::model::ComputeInstanceSlurmNodeSet>),
4549 }
4550}
4551
4552/// When set in a
4553/// [SlurmNodeSet][google.cloud.hypercomputecluster.v1.SlurmNodeSet], indicates
4554/// that the nodeset should be backed by Compute Engine VM instances.
4555///
4556/// [google.cloud.hypercomputecluster.v1.SlurmNodeSet]: crate::model::SlurmNodeSet
4557#[derive(Clone, Default, PartialEq)]
4558#[non_exhaustive]
4559pub struct ComputeInstanceSlurmNodeSet {
4560 /// Optional. [Startup
4561 /// script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux)
4562 /// to be run on each VM instance in the nodeset. Max 256KB.
4563 pub startup_script: std::string::String,
4564
4565 /// Optional.
4566 /// [Labels](https://cloud.google.com/compute/docs/labeling-resources) that
4567 /// should be applied to each VM instance in the nodeset.
4568 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4569
4570 /// Optional. Boot disk for the compute instance
4571 pub boot_disk: std::option::Option<crate::model::BootDisk>,
4572
4573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4574}
4575
4576impl ComputeInstanceSlurmNodeSet {
4577 /// Creates a new default instance.
4578 pub fn new() -> Self {
4579 std::default::Default::default()
4580 }
4581
4582 /// Sets the value of [startup_script][crate::model::ComputeInstanceSlurmNodeSet::startup_script].
4583 ///
4584 /// # Example
4585 /// ```ignore,no_run
4586 /// # use google_cloud_hypercomputecluster_v1::model::ComputeInstanceSlurmNodeSet;
4587 /// let x = ComputeInstanceSlurmNodeSet::new().set_startup_script("example");
4588 /// ```
4589 pub fn set_startup_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4590 self.startup_script = v.into();
4591 self
4592 }
4593
4594 /// Sets the value of [labels][crate::model::ComputeInstanceSlurmNodeSet::labels].
4595 ///
4596 /// # Example
4597 /// ```ignore,no_run
4598 /// # use google_cloud_hypercomputecluster_v1::model::ComputeInstanceSlurmNodeSet;
4599 /// let x = ComputeInstanceSlurmNodeSet::new().set_labels([
4600 /// ("key0", "abc"),
4601 /// ("key1", "xyz"),
4602 /// ]);
4603 /// ```
4604 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4605 where
4606 T: std::iter::IntoIterator<Item = (K, V)>,
4607 K: std::convert::Into<std::string::String>,
4608 V: std::convert::Into<std::string::String>,
4609 {
4610 use std::iter::Iterator;
4611 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4612 self
4613 }
4614
4615 /// Sets the value of [boot_disk][crate::model::ComputeInstanceSlurmNodeSet::boot_disk].
4616 ///
4617 /// # Example
4618 /// ```ignore,no_run
4619 /// # use google_cloud_hypercomputecluster_v1::model::ComputeInstanceSlurmNodeSet;
4620 /// use google_cloud_hypercomputecluster_v1::model::BootDisk;
4621 /// let x = ComputeInstanceSlurmNodeSet::new().set_boot_disk(BootDisk::default()/* use setters */);
4622 /// ```
4623 pub fn set_boot_disk<T>(mut self, v: T) -> Self
4624 where
4625 T: std::convert::Into<crate::model::BootDisk>,
4626 {
4627 self.boot_disk = std::option::Option::Some(v.into());
4628 self
4629 }
4630
4631 /// Sets or clears the value of [boot_disk][crate::model::ComputeInstanceSlurmNodeSet::boot_disk].
4632 ///
4633 /// # Example
4634 /// ```ignore,no_run
4635 /// # use google_cloud_hypercomputecluster_v1::model::ComputeInstanceSlurmNodeSet;
4636 /// use google_cloud_hypercomputecluster_v1::model::BootDisk;
4637 /// let x = ComputeInstanceSlurmNodeSet::new().set_or_clear_boot_disk(Some(BootDisk::default()/* use setters */));
4638 /// let x = ComputeInstanceSlurmNodeSet::new().set_or_clear_boot_disk(None::<BootDisk>);
4639 /// ```
4640 pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
4641 where
4642 T: std::convert::Into<crate::model::BootDisk>,
4643 {
4644 self.boot_disk = v.map(|x| x.into());
4645 self
4646 }
4647}
4648
4649impl wkt::message::Message for ComputeInstanceSlurmNodeSet {
4650 fn typename() -> &'static str {
4651 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeInstanceSlurmNodeSet"
4652 }
4653}
4654
4655/// Configuration for Slurm partitions in the cluster. Partitions are groups of
4656/// nodesets, and are how clients specify where their workloads should be run.
4657#[derive(Clone, Default, PartialEq)]
4658#[non_exhaustive]
4659pub struct SlurmPartition {
4660 /// Required. ID of the partition, which is how users will identify it. Must
4661 /// conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034)
4662 /// (lower-case, alphanumeric, and at most 63 characters).
4663 pub id: std::string::String,
4664
4665 /// Required. IDs of the nodesets that make up this partition. Values must
4666 /// match
4667 /// [SlurmNodeSet.id][google.cloud.hypercomputecluster.v1.SlurmNodeSet.id].
4668 ///
4669 /// [google.cloud.hypercomputecluster.v1.SlurmNodeSet.id]: crate::model::SlurmNodeSet::id
4670 pub node_set_ids: std::vec::Vec<std::string::String>,
4671
4672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4673}
4674
4675impl SlurmPartition {
4676 /// Creates a new default instance.
4677 pub fn new() -> Self {
4678 std::default::Default::default()
4679 }
4680
4681 /// Sets the value of [id][crate::model::SlurmPartition::id].
4682 ///
4683 /// # Example
4684 /// ```ignore,no_run
4685 /// # use google_cloud_hypercomputecluster_v1::model::SlurmPartition;
4686 /// let x = SlurmPartition::new().set_id("example");
4687 /// ```
4688 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4689 self.id = v.into();
4690 self
4691 }
4692
4693 /// Sets the value of [node_set_ids][crate::model::SlurmPartition::node_set_ids].
4694 ///
4695 /// # Example
4696 /// ```ignore,no_run
4697 /// # use google_cloud_hypercomputecluster_v1::model::SlurmPartition;
4698 /// let x = SlurmPartition::new().set_node_set_ids(["a", "b", "c"]);
4699 /// ```
4700 pub fn set_node_set_ids<T, V>(mut self, v: T) -> Self
4701 where
4702 T: std::iter::IntoIterator<Item = V>,
4703 V: std::convert::Into<std::string::String>,
4704 {
4705 use std::iter::Iterator;
4706 self.node_set_ids = v.into_iter().map(|i| i.into()).collect();
4707 self
4708 }
4709}
4710
4711impl wkt::message::Message for SlurmPartition {
4712 fn typename() -> &'static str {
4713 "type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmPartition"
4714 }
4715}
4716
4717/// Configuration for Slurm [login
4718/// nodes](https://slurm.schedmd.com/quickstart_admin.html#login) in the cluster.
4719/// Login nodes are Compute Engine VM instances that allow users to access the
4720/// cluster over SSH.
4721#[derive(Clone, Default, PartialEq)]
4722#[non_exhaustive]
4723pub struct SlurmLoginNodes {
4724 /// Required. Number of login node instances to create.
4725 pub count: i64,
4726
4727 /// Required. Name of the zone in which login nodes should run, e.g.,
4728 /// `us-central1-a`. Must be in the same region as the cluster, and must match
4729 /// the zone of any other resources specified in the cluster.
4730 pub zone: std::string::String,
4731
4732 /// Required. Name of the Compute Engine [machine
4733 /// type](https://cloud.google.com/compute/docs/machine-resource) to use for
4734 /// login nodes, e.g. `n2-standard-2`.
4735 pub machine_type: std::string::String,
4736
4737 /// Optional. [Startup
4738 /// script](https://cloud.google.com/compute/docs/instances/startup-scripts/linux)
4739 /// to be run on each login node instance. Max 256KB.
4740 /// The script must complete within the system-defined default timeout of 5
4741 /// minutes. For tasks that require more time, consider running them in the
4742 /// background using methods such as `&` or `nohup`.
4743 pub startup_script: std::string::String,
4744
4745 /// Optional. Whether [OS Login](https://cloud.google.com/compute/docs/oslogin)
4746 /// should be enabled on login node instances.
4747 pub enable_os_login: bool,
4748
4749 /// Optional. Whether login node instances should be assigned [external IP
4750 /// addresses](https://cloud.google.com/compute/docs/ip-addresses#externaladdresses).
4751 pub enable_public_ips: bool,
4752
4753 /// Optional.
4754 /// [Labels](https://cloud.google.com/compute/docs/labeling-resources) that
4755 /// should be applied to each login node instance.
4756 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4757
4758 /// Optional. How [storage
4759 /// resources][google.cloud.hypercomputecluster.v1.StorageResource] should be
4760 /// mounted on each login node.
4761 ///
4762 /// [google.cloud.hypercomputecluster.v1.StorageResource]: crate::model::StorageResource
4763 pub storage_configs: std::vec::Vec<crate::model::StorageConfig>,
4764
4765 /// Output only. Information about the login node instances that were created
4766 /// in Compute Engine.
4767 pub instances: std::vec::Vec<crate::model::ComputeInstance>,
4768
4769 /// Optional. Boot disk for the login node.
4770 pub boot_disk: std::option::Option<crate::model::BootDisk>,
4771
4772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4773}
4774
4775impl SlurmLoginNodes {
4776 /// Creates a new default instance.
4777 pub fn new() -> Self {
4778 std::default::Default::default()
4779 }
4780
4781 /// Sets the value of [count][crate::model::SlurmLoginNodes::count].
4782 ///
4783 /// # Example
4784 /// ```ignore,no_run
4785 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4786 /// let x = SlurmLoginNodes::new().set_count(42);
4787 /// ```
4788 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4789 self.count = v.into();
4790 self
4791 }
4792
4793 /// Sets the value of [zone][crate::model::SlurmLoginNodes::zone].
4794 ///
4795 /// # Example
4796 /// ```ignore,no_run
4797 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4798 /// let x = SlurmLoginNodes::new().set_zone("example");
4799 /// ```
4800 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.zone = v.into();
4802 self
4803 }
4804
4805 /// Sets the value of [machine_type][crate::model::SlurmLoginNodes::machine_type].
4806 ///
4807 /// # Example
4808 /// ```ignore,no_run
4809 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4810 /// let x = SlurmLoginNodes::new().set_machine_type("example");
4811 /// ```
4812 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4813 self.machine_type = v.into();
4814 self
4815 }
4816
4817 /// Sets the value of [startup_script][crate::model::SlurmLoginNodes::startup_script].
4818 ///
4819 /// # Example
4820 /// ```ignore,no_run
4821 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4822 /// let x = SlurmLoginNodes::new().set_startup_script("example");
4823 /// ```
4824 pub fn set_startup_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4825 self.startup_script = v.into();
4826 self
4827 }
4828
4829 /// Sets the value of [enable_os_login][crate::model::SlurmLoginNodes::enable_os_login].
4830 ///
4831 /// # Example
4832 /// ```ignore,no_run
4833 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4834 /// let x = SlurmLoginNodes::new().set_enable_os_login(true);
4835 /// ```
4836 pub fn set_enable_os_login<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4837 self.enable_os_login = v.into();
4838 self
4839 }
4840
4841 /// Sets the value of [enable_public_ips][crate::model::SlurmLoginNodes::enable_public_ips].
4842 ///
4843 /// # Example
4844 /// ```ignore,no_run
4845 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4846 /// let x = SlurmLoginNodes::new().set_enable_public_ips(true);
4847 /// ```
4848 pub fn set_enable_public_ips<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4849 self.enable_public_ips = v.into();
4850 self
4851 }
4852
4853 /// Sets the value of [labels][crate::model::SlurmLoginNodes::labels].
4854 ///
4855 /// # Example
4856 /// ```ignore,no_run
4857 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4858 /// let x = SlurmLoginNodes::new().set_labels([
4859 /// ("key0", "abc"),
4860 /// ("key1", "xyz"),
4861 /// ]);
4862 /// ```
4863 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4864 where
4865 T: std::iter::IntoIterator<Item = (K, V)>,
4866 K: std::convert::Into<std::string::String>,
4867 V: std::convert::Into<std::string::String>,
4868 {
4869 use std::iter::Iterator;
4870 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4871 self
4872 }
4873
4874 /// Sets the value of [storage_configs][crate::model::SlurmLoginNodes::storage_configs].
4875 ///
4876 /// # Example
4877 /// ```ignore,no_run
4878 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4879 /// use google_cloud_hypercomputecluster_v1::model::StorageConfig;
4880 /// let x = SlurmLoginNodes::new()
4881 /// .set_storage_configs([
4882 /// StorageConfig::default()/* use setters */,
4883 /// StorageConfig::default()/* use (different) setters */,
4884 /// ]);
4885 /// ```
4886 pub fn set_storage_configs<T, V>(mut self, v: T) -> Self
4887 where
4888 T: std::iter::IntoIterator<Item = V>,
4889 V: std::convert::Into<crate::model::StorageConfig>,
4890 {
4891 use std::iter::Iterator;
4892 self.storage_configs = v.into_iter().map(|i| i.into()).collect();
4893 self
4894 }
4895
4896 /// Sets the value of [instances][crate::model::SlurmLoginNodes::instances].
4897 ///
4898 /// # Example
4899 /// ```ignore,no_run
4900 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4901 /// use google_cloud_hypercomputecluster_v1::model::ComputeInstance;
4902 /// let x = SlurmLoginNodes::new()
4903 /// .set_instances([
4904 /// ComputeInstance::default()/* use setters */,
4905 /// ComputeInstance::default()/* use (different) setters */,
4906 /// ]);
4907 /// ```
4908 pub fn set_instances<T, V>(mut self, v: T) -> Self
4909 where
4910 T: std::iter::IntoIterator<Item = V>,
4911 V: std::convert::Into<crate::model::ComputeInstance>,
4912 {
4913 use std::iter::Iterator;
4914 self.instances = v.into_iter().map(|i| i.into()).collect();
4915 self
4916 }
4917
4918 /// Sets the value of [boot_disk][crate::model::SlurmLoginNodes::boot_disk].
4919 ///
4920 /// # Example
4921 /// ```ignore,no_run
4922 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4923 /// use google_cloud_hypercomputecluster_v1::model::BootDisk;
4924 /// let x = SlurmLoginNodes::new().set_boot_disk(BootDisk::default()/* use setters */);
4925 /// ```
4926 pub fn set_boot_disk<T>(mut self, v: T) -> Self
4927 where
4928 T: std::convert::Into<crate::model::BootDisk>,
4929 {
4930 self.boot_disk = std::option::Option::Some(v.into());
4931 self
4932 }
4933
4934 /// Sets or clears the value of [boot_disk][crate::model::SlurmLoginNodes::boot_disk].
4935 ///
4936 /// # Example
4937 /// ```ignore,no_run
4938 /// # use google_cloud_hypercomputecluster_v1::model::SlurmLoginNodes;
4939 /// use google_cloud_hypercomputecluster_v1::model::BootDisk;
4940 /// let x = SlurmLoginNodes::new().set_or_clear_boot_disk(Some(BootDisk::default()/* use setters */));
4941 /// let x = SlurmLoginNodes::new().set_or_clear_boot_disk(None::<BootDisk>);
4942 /// ```
4943 pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
4944 where
4945 T: std::convert::Into<crate::model::BootDisk>,
4946 {
4947 self.boot_disk = v.map(|x| x.into());
4948 self
4949 }
4950}
4951
4952impl wkt::message::Message for SlurmLoginNodes {
4953 fn typename() -> &'static str {
4954 "type.googleapis.com/google.cloud.hypercomputecluster.v1.SlurmLoginNodes"
4955 }
4956}
4957
4958/// Description of how a [storage
4959/// resource][google.cloud.hypercomputecluster.v1.StorageResource] should be
4960/// mounted on a VM instance.
4961///
4962/// [google.cloud.hypercomputecluster.v1.StorageResource]: crate::model::StorageResource
4963#[derive(Clone, Default, PartialEq)]
4964#[non_exhaustive]
4965pub struct StorageConfig {
4966 /// Required. ID of the storage resource to mount, which must match a key in
4967 /// the cluster's
4968 /// [storage_resources][google.cloud.hypercomputecluster.v1.Cluster.storage_resources].
4969 ///
4970 /// [google.cloud.hypercomputecluster.v1.Cluster.storage_resources]: crate::model::Cluster::storage_resources
4971 pub id: std::string::String,
4972
4973 /// Required. A directory inside the VM instance's file system where the
4974 /// storage resource should be mounted (e.g., `/mnt/share`).
4975 pub local_mount: std::string::String,
4976
4977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4978}
4979
4980impl StorageConfig {
4981 /// Creates a new default instance.
4982 pub fn new() -> Self {
4983 std::default::Default::default()
4984 }
4985
4986 /// Sets the value of [id][crate::model::StorageConfig::id].
4987 ///
4988 /// # Example
4989 /// ```ignore,no_run
4990 /// # use google_cloud_hypercomputecluster_v1::model::StorageConfig;
4991 /// let x = StorageConfig::new().set_id("example");
4992 /// ```
4993 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4994 self.id = v.into();
4995 self
4996 }
4997
4998 /// Sets the value of [local_mount][crate::model::StorageConfig::local_mount].
4999 ///
5000 /// # Example
5001 /// ```ignore,no_run
5002 /// # use google_cloud_hypercomputecluster_v1::model::StorageConfig;
5003 /// let x = StorageConfig::new().set_local_mount("example");
5004 /// ```
5005 pub fn set_local_mount<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5006 self.local_mount = v.into();
5007 self
5008 }
5009}
5010
5011impl wkt::message::Message for StorageConfig {
5012 fn typename() -> &'static str {
5013 "type.googleapis.com/google.cloud.hypercomputecluster.v1.StorageConfig"
5014 }
5015}
5016
5017/// Details about a Compute Engine
5018/// [instance](https://cloud.google.com/compute/docs/instances).
5019#[derive(Clone, Default, PartialEq)]
5020#[non_exhaustive]
5021pub struct ComputeInstance {
5022 /// Output only. Name of the VM instance, in the format
5023 /// `projects/{project}/zones/{zone}/instances/{instance}`.
5024 pub instance: std::string::String,
5025
5026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5027}
5028
5029impl ComputeInstance {
5030 /// Creates a new default instance.
5031 pub fn new() -> Self {
5032 std::default::Default::default()
5033 }
5034
5035 /// Sets the value of [instance][crate::model::ComputeInstance::instance].
5036 ///
5037 /// # Example
5038 /// ```ignore,no_run
5039 /// # use google_cloud_hypercomputecluster_v1::model::ComputeInstance;
5040 /// let x = ComputeInstance::new().set_instance("example");
5041 /// ```
5042 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5043 self.instance = v.into();
5044 self
5045 }
5046}
5047
5048impl wkt::message::Message for ComputeInstance {
5049 fn typename() -> &'static str {
5050 "type.googleapis.com/google.cloud.hypercomputecluster.v1.ComputeInstance"
5051 }
5052}
5053
5054/// Represents the metadata of the long-running operation.
5055#[derive(Clone, Default, PartialEq)]
5056#[non_exhaustive]
5057pub struct OperationMetadata {
5058 /// Output only. The time the operation was created.
5059 pub create_time: std::option::Option<wkt::Timestamp>,
5060
5061 /// Output only. The time the operation finished running.
5062 pub end_time: std::option::Option<wkt::Timestamp>,
5063
5064 /// Output only. Server-defined resource path for the target of the operation.
5065 pub target: std::string::String,
5066
5067 /// Output only. Name of the verb executed by the operation.
5068 pub verb: std::string::String,
5069
5070 /// Output only. Identifies whether the user has requested cancellation
5071 /// of the operation. Operations that have been cancelled successfully
5072 /// have
5073 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
5074 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
5075 /// corresponding to `Code.CANCELLED`.
5076 ///
5077 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
5078 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
5079 pub requested_cancellation: bool,
5080
5081 /// Output only. API version used to start the operation.
5082 pub api_version: std::string::String,
5083
5084 /// Output only. Progress of the operation.
5085 pub progress: std::option::Option<crate::model::OperationProgress>,
5086
5087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5088}
5089
5090impl OperationMetadata {
5091 /// Creates a new default instance.
5092 pub fn new() -> Self {
5093 std::default::Default::default()
5094 }
5095
5096 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5097 ///
5098 /// # Example
5099 /// ```ignore,no_run
5100 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5101 /// use wkt::Timestamp;
5102 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5103 /// ```
5104 pub fn set_create_time<T>(mut self, v: T) -> Self
5105 where
5106 T: std::convert::Into<wkt::Timestamp>,
5107 {
5108 self.create_time = std::option::Option::Some(v.into());
5109 self
5110 }
5111
5112 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5113 ///
5114 /// # Example
5115 /// ```ignore,no_run
5116 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5117 /// use wkt::Timestamp;
5118 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5119 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5120 /// ```
5121 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5122 where
5123 T: std::convert::Into<wkt::Timestamp>,
5124 {
5125 self.create_time = v.map(|x| x.into());
5126 self
5127 }
5128
5129 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5130 ///
5131 /// # Example
5132 /// ```ignore,no_run
5133 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5134 /// use wkt::Timestamp;
5135 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5136 /// ```
5137 pub fn set_end_time<T>(mut self, v: T) -> Self
5138 where
5139 T: std::convert::Into<wkt::Timestamp>,
5140 {
5141 self.end_time = std::option::Option::Some(v.into());
5142 self
5143 }
5144
5145 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5146 ///
5147 /// # Example
5148 /// ```ignore,no_run
5149 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5150 /// use wkt::Timestamp;
5151 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5152 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5153 /// ```
5154 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5155 where
5156 T: std::convert::Into<wkt::Timestamp>,
5157 {
5158 self.end_time = v.map(|x| x.into());
5159 self
5160 }
5161
5162 /// Sets the value of [target][crate::model::OperationMetadata::target].
5163 ///
5164 /// # Example
5165 /// ```ignore,no_run
5166 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5167 /// let x = OperationMetadata::new().set_target("example");
5168 /// ```
5169 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5170 self.target = v.into();
5171 self
5172 }
5173
5174 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5175 ///
5176 /// # Example
5177 /// ```ignore,no_run
5178 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5179 /// let x = OperationMetadata::new().set_verb("example");
5180 /// ```
5181 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5182 self.verb = v.into();
5183 self
5184 }
5185
5186 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5187 ///
5188 /// # Example
5189 /// ```ignore,no_run
5190 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5191 /// let x = OperationMetadata::new().set_requested_cancellation(true);
5192 /// ```
5193 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5194 self.requested_cancellation = v.into();
5195 self
5196 }
5197
5198 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5199 ///
5200 /// # Example
5201 /// ```ignore,no_run
5202 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5203 /// let x = OperationMetadata::new().set_api_version("example");
5204 /// ```
5205 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5206 self.api_version = v.into();
5207 self
5208 }
5209
5210 /// Sets the value of [progress][crate::model::OperationMetadata::progress].
5211 ///
5212 /// # Example
5213 /// ```ignore,no_run
5214 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5215 /// use google_cloud_hypercomputecluster_v1::model::OperationProgress;
5216 /// let x = OperationMetadata::new().set_progress(OperationProgress::default()/* use setters */);
5217 /// ```
5218 pub fn set_progress<T>(mut self, v: T) -> Self
5219 where
5220 T: std::convert::Into<crate::model::OperationProgress>,
5221 {
5222 self.progress = std::option::Option::Some(v.into());
5223 self
5224 }
5225
5226 /// Sets or clears the value of [progress][crate::model::OperationMetadata::progress].
5227 ///
5228 /// # Example
5229 /// ```ignore,no_run
5230 /// # use google_cloud_hypercomputecluster_v1::model::OperationMetadata;
5231 /// use google_cloud_hypercomputecluster_v1::model::OperationProgress;
5232 /// let x = OperationMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
5233 /// let x = OperationMetadata::new().set_or_clear_progress(None::<OperationProgress>);
5234 /// ```
5235 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
5236 where
5237 T: std::convert::Into<crate::model::OperationProgress>,
5238 {
5239 self.progress = v.map(|x| x.into());
5240 self
5241 }
5242}
5243
5244impl wkt::message::Message for OperationMetadata {
5245 fn typename() -> &'static str {
5246 "type.googleapis.com/google.cloud.hypercomputecluster.v1.OperationMetadata"
5247 }
5248}
5249
5250/// Message describing the progress of a cluster mutation long-running operation.
5251#[derive(Clone, Default, PartialEq)]
5252#[non_exhaustive]
5253pub struct OperationProgress {
5254 /// Output only. Steps and status of the operation.
5255 pub steps: std::vec::Vec<crate::model::OperationStep>,
5256
5257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5258}
5259
5260impl OperationProgress {
5261 /// Creates a new default instance.
5262 pub fn new() -> Self {
5263 std::default::Default::default()
5264 }
5265
5266 /// Sets the value of [steps][crate::model::OperationProgress::steps].
5267 ///
5268 /// # Example
5269 /// ```ignore,no_run
5270 /// # use google_cloud_hypercomputecluster_v1::model::OperationProgress;
5271 /// use google_cloud_hypercomputecluster_v1::model::OperationStep;
5272 /// let x = OperationProgress::new()
5273 /// .set_steps([
5274 /// OperationStep::default()/* use setters */,
5275 /// OperationStep::default()/* use (different) setters */,
5276 /// ]);
5277 /// ```
5278 pub fn set_steps<T, V>(mut self, v: T) -> Self
5279 where
5280 T: std::iter::IntoIterator<Item = V>,
5281 V: std::convert::Into<crate::model::OperationStep>,
5282 {
5283 use std::iter::Iterator;
5284 self.steps = v.into_iter().map(|i| i.into()).collect();
5285 self
5286 }
5287}
5288
5289impl wkt::message::Message for OperationProgress {
5290 fn typename() -> &'static str {
5291 "type.googleapis.com/google.cloud.hypercomputecluster.v1.OperationProgress"
5292 }
5293}
5294
5295/// Message describing the status of a single step in a cluster mutation
5296/// long-running operation.
5297#[derive(Clone, Default, PartialEq)]
5298#[non_exhaustive]
5299pub struct OperationStep {
5300 /// Output only. State of the operation step.
5301 pub state: crate::model::operation_step::State,
5302
5303 /// Step of the operation.
5304 pub r#type: std::option::Option<crate::model::operation_step::Type>,
5305
5306 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5307}
5308
5309impl OperationStep {
5310 /// Creates a new default instance.
5311 pub fn new() -> Self {
5312 std::default::Default::default()
5313 }
5314
5315 /// Sets the value of [state][crate::model::OperationStep::state].
5316 ///
5317 /// # Example
5318 /// ```ignore,no_run
5319 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5320 /// use google_cloud_hypercomputecluster_v1::model::operation_step::State;
5321 /// let x0 = OperationStep::new().set_state(State::Waiting);
5322 /// let x1 = OperationStep::new().set_state(State::InProgress);
5323 /// let x2 = OperationStep::new().set_state(State::Done);
5324 /// ```
5325 pub fn set_state<T: std::convert::Into<crate::model::operation_step::State>>(
5326 mut self,
5327 v: T,
5328 ) -> Self {
5329 self.state = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [r#type][crate::model::OperationStep::type].
5334 ///
5335 /// Note that all the setters affecting `r#type` are mutually
5336 /// exclusive.
5337 ///
5338 /// # Example
5339 /// ```ignore,no_run
5340 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5341 /// use google_cloud_hypercomputecluster_v1::model::CreateNetwork;
5342 /// let x = OperationStep::new().set_type(Some(
5343 /// google_cloud_hypercomputecluster_v1::model::operation_step::Type::CreateNetwork(CreateNetwork::default().into())));
5344 /// ```
5345 pub fn set_type<
5346 T: std::convert::Into<std::option::Option<crate::model::operation_step::Type>>,
5347 >(
5348 mut self,
5349 v: T,
5350 ) -> Self {
5351 self.r#type = v.into();
5352 self
5353 }
5354
5355 /// The value of [r#type][crate::model::OperationStep::r#type]
5356 /// if it holds a `CreateNetwork`, `None` if the field is not set or
5357 /// holds a different branch.
5358 pub fn create_network(
5359 &self,
5360 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateNetwork>> {
5361 #[allow(unreachable_patterns)]
5362 self.r#type.as_ref().and_then(|v| match v {
5363 crate::model::operation_step::Type::CreateNetwork(v) => std::option::Option::Some(v),
5364 _ => std::option::Option::None,
5365 })
5366 }
5367
5368 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5369 /// to hold a `CreateNetwork`.
5370 ///
5371 /// Note that all the setters affecting `r#type` are
5372 /// mutually exclusive.
5373 ///
5374 /// # Example
5375 /// ```ignore,no_run
5376 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5377 /// use google_cloud_hypercomputecluster_v1::model::CreateNetwork;
5378 /// let x = OperationStep::new().set_create_network(CreateNetwork::default()/* use setters */);
5379 /// assert!(x.create_network().is_some());
5380 /// assert!(x.create_private_service_access().is_none());
5381 /// assert!(x.create_filestore_instance().is_none());
5382 /// assert!(x.create_storage_bucket().is_none());
5383 /// assert!(x.create_lustre_instance().is_none());
5384 /// assert!(x.create_orchestrator().is_none());
5385 /// assert!(x.create_nodeset().is_none());
5386 /// assert!(x.create_partition().is_none());
5387 /// assert!(x.create_login_node().is_none());
5388 /// assert!(x.check_cluster_health().is_none());
5389 /// assert!(x.update_orchestrator().is_none());
5390 /// assert!(x.update_nodeset().is_none());
5391 /// assert!(x.update_partition().is_none());
5392 /// assert!(x.update_login_node().is_none());
5393 /// assert!(x.delete_orchestrator().is_none());
5394 /// assert!(x.delete_nodeset().is_none());
5395 /// assert!(x.delete_partition().is_none());
5396 /// assert!(x.delete_login_node().is_none());
5397 /// assert!(x.delete_filestore_instance().is_none());
5398 /// assert!(x.delete_storage_bucket().is_none());
5399 /// assert!(x.delete_lustre_instance().is_none());
5400 /// assert!(x.delete_private_service_access().is_none());
5401 /// assert!(x.delete_network().is_none());
5402 /// ```
5403 pub fn set_create_network<
5404 T: std::convert::Into<std::boxed::Box<crate::model::CreateNetwork>>,
5405 >(
5406 mut self,
5407 v: T,
5408 ) -> Self {
5409 self.r#type =
5410 std::option::Option::Some(crate::model::operation_step::Type::CreateNetwork(v.into()));
5411 self
5412 }
5413
5414 /// The value of [r#type][crate::model::OperationStep::r#type]
5415 /// if it holds a `CreatePrivateServiceAccess`, `None` if the field is not set or
5416 /// holds a different branch.
5417 pub fn create_private_service_access(
5418 &self,
5419 ) -> std::option::Option<&std::boxed::Box<crate::model::CreatePrivateServiceAccess>> {
5420 #[allow(unreachable_patterns)]
5421 self.r#type.as_ref().and_then(|v| match v {
5422 crate::model::operation_step::Type::CreatePrivateServiceAccess(v) => {
5423 std::option::Option::Some(v)
5424 }
5425 _ => std::option::Option::None,
5426 })
5427 }
5428
5429 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5430 /// to hold a `CreatePrivateServiceAccess`.
5431 ///
5432 /// Note that all the setters affecting `r#type` are
5433 /// mutually exclusive.
5434 ///
5435 /// # Example
5436 /// ```ignore,no_run
5437 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5438 /// use google_cloud_hypercomputecluster_v1::model::CreatePrivateServiceAccess;
5439 /// let x = OperationStep::new().set_create_private_service_access(CreatePrivateServiceAccess::default()/* use setters */);
5440 /// assert!(x.create_private_service_access().is_some());
5441 /// assert!(x.create_network().is_none());
5442 /// assert!(x.create_filestore_instance().is_none());
5443 /// assert!(x.create_storage_bucket().is_none());
5444 /// assert!(x.create_lustre_instance().is_none());
5445 /// assert!(x.create_orchestrator().is_none());
5446 /// assert!(x.create_nodeset().is_none());
5447 /// assert!(x.create_partition().is_none());
5448 /// assert!(x.create_login_node().is_none());
5449 /// assert!(x.check_cluster_health().is_none());
5450 /// assert!(x.update_orchestrator().is_none());
5451 /// assert!(x.update_nodeset().is_none());
5452 /// assert!(x.update_partition().is_none());
5453 /// assert!(x.update_login_node().is_none());
5454 /// assert!(x.delete_orchestrator().is_none());
5455 /// assert!(x.delete_nodeset().is_none());
5456 /// assert!(x.delete_partition().is_none());
5457 /// assert!(x.delete_login_node().is_none());
5458 /// assert!(x.delete_filestore_instance().is_none());
5459 /// assert!(x.delete_storage_bucket().is_none());
5460 /// assert!(x.delete_lustre_instance().is_none());
5461 /// assert!(x.delete_private_service_access().is_none());
5462 /// assert!(x.delete_network().is_none());
5463 /// ```
5464 pub fn set_create_private_service_access<
5465 T: std::convert::Into<std::boxed::Box<crate::model::CreatePrivateServiceAccess>>,
5466 >(
5467 mut self,
5468 v: T,
5469 ) -> Self {
5470 self.r#type = std::option::Option::Some(
5471 crate::model::operation_step::Type::CreatePrivateServiceAccess(v.into()),
5472 );
5473 self
5474 }
5475
5476 /// The value of [r#type][crate::model::OperationStep::r#type]
5477 /// if it holds a `CreateFilestoreInstance`, `None` if the field is not set or
5478 /// holds a different branch.
5479 pub fn create_filestore_instance(
5480 &self,
5481 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateFilestoreInstance>> {
5482 #[allow(unreachable_patterns)]
5483 self.r#type.as_ref().and_then(|v| match v {
5484 crate::model::operation_step::Type::CreateFilestoreInstance(v) => {
5485 std::option::Option::Some(v)
5486 }
5487 _ => std::option::Option::None,
5488 })
5489 }
5490
5491 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5492 /// to hold a `CreateFilestoreInstance`.
5493 ///
5494 /// Note that all the setters affecting `r#type` are
5495 /// mutually exclusive.
5496 ///
5497 /// # Example
5498 /// ```ignore,no_run
5499 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5500 /// use google_cloud_hypercomputecluster_v1::model::CreateFilestoreInstance;
5501 /// let x = OperationStep::new().set_create_filestore_instance(CreateFilestoreInstance::default()/* use setters */);
5502 /// assert!(x.create_filestore_instance().is_some());
5503 /// assert!(x.create_network().is_none());
5504 /// assert!(x.create_private_service_access().is_none());
5505 /// assert!(x.create_storage_bucket().is_none());
5506 /// assert!(x.create_lustre_instance().is_none());
5507 /// assert!(x.create_orchestrator().is_none());
5508 /// assert!(x.create_nodeset().is_none());
5509 /// assert!(x.create_partition().is_none());
5510 /// assert!(x.create_login_node().is_none());
5511 /// assert!(x.check_cluster_health().is_none());
5512 /// assert!(x.update_orchestrator().is_none());
5513 /// assert!(x.update_nodeset().is_none());
5514 /// assert!(x.update_partition().is_none());
5515 /// assert!(x.update_login_node().is_none());
5516 /// assert!(x.delete_orchestrator().is_none());
5517 /// assert!(x.delete_nodeset().is_none());
5518 /// assert!(x.delete_partition().is_none());
5519 /// assert!(x.delete_login_node().is_none());
5520 /// assert!(x.delete_filestore_instance().is_none());
5521 /// assert!(x.delete_storage_bucket().is_none());
5522 /// assert!(x.delete_lustre_instance().is_none());
5523 /// assert!(x.delete_private_service_access().is_none());
5524 /// assert!(x.delete_network().is_none());
5525 /// ```
5526 pub fn set_create_filestore_instance<
5527 T: std::convert::Into<std::boxed::Box<crate::model::CreateFilestoreInstance>>,
5528 >(
5529 mut self,
5530 v: T,
5531 ) -> Self {
5532 self.r#type = std::option::Option::Some(
5533 crate::model::operation_step::Type::CreateFilestoreInstance(v.into()),
5534 );
5535 self
5536 }
5537
5538 /// The value of [r#type][crate::model::OperationStep::r#type]
5539 /// if it holds a `CreateStorageBucket`, `None` if the field is not set or
5540 /// holds a different branch.
5541 pub fn create_storage_bucket(
5542 &self,
5543 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateStorageBucket>> {
5544 #[allow(unreachable_patterns)]
5545 self.r#type.as_ref().and_then(|v| match v {
5546 crate::model::operation_step::Type::CreateStorageBucket(v) => {
5547 std::option::Option::Some(v)
5548 }
5549 _ => std::option::Option::None,
5550 })
5551 }
5552
5553 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5554 /// to hold a `CreateStorageBucket`.
5555 ///
5556 /// Note that all the setters affecting `r#type` are
5557 /// mutually exclusive.
5558 ///
5559 /// # Example
5560 /// ```ignore,no_run
5561 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5562 /// use google_cloud_hypercomputecluster_v1::model::CreateStorageBucket;
5563 /// let x = OperationStep::new().set_create_storage_bucket(CreateStorageBucket::default()/* use setters */);
5564 /// assert!(x.create_storage_bucket().is_some());
5565 /// assert!(x.create_network().is_none());
5566 /// assert!(x.create_private_service_access().is_none());
5567 /// assert!(x.create_filestore_instance().is_none());
5568 /// assert!(x.create_lustre_instance().is_none());
5569 /// assert!(x.create_orchestrator().is_none());
5570 /// assert!(x.create_nodeset().is_none());
5571 /// assert!(x.create_partition().is_none());
5572 /// assert!(x.create_login_node().is_none());
5573 /// assert!(x.check_cluster_health().is_none());
5574 /// assert!(x.update_orchestrator().is_none());
5575 /// assert!(x.update_nodeset().is_none());
5576 /// assert!(x.update_partition().is_none());
5577 /// assert!(x.update_login_node().is_none());
5578 /// assert!(x.delete_orchestrator().is_none());
5579 /// assert!(x.delete_nodeset().is_none());
5580 /// assert!(x.delete_partition().is_none());
5581 /// assert!(x.delete_login_node().is_none());
5582 /// assert!(x.delete_filestore_instance().is_none());
5583 /// assert!(x.delete_storage_bucket().is_none());
5584 /// assert!(x.delete_lustre_instance().is_none());
5585 /// assert!(x.delete_private_service_access().is_none());
5586 /// assert!(x.delete_network().is_none());
5587 /// ```
5588 pub fn set_create_storage_bucket<
5589 T: std::convert::Into<std::boxed::Box<crate::model::CreateStorageBucket>>,
5590 >(
5591 mut self,
5592 v: T,
5593 ) -> Self {
5594 self.r#type = std::option::Option::Some(
5595 crate::model::operation_step::Type::CreateStorageBucket(v.into()),
5596 );
5597 self
5598 }
5599
5600 /// The value of [r#type][crate::model::OperationStep::r#type]
5601 /// if it holds a `CreateLustreInstance`, `None` if the field is not set or
5602 /// holds a different branch.
5603 pub fn create_lustre_instance(
5604 &self,
5605 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateLustreInstance>> {
5606 #[allow(unreachable_patterns)]
5607 self.r#type.as_ref().and_then(|v| match v {
5608 crate::model::operation_step::Type::CreateLustreInstance(v) => {
5609 std::option::Option::Some(v)
5610 }
5611 _ => std::option::Option::None,
5612 })
5613 }
5614
5615 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5616 /// to hold a `CreateLustreInstance`.
5617 ///
5618 /// Note that all the setters affecting `r#type` are
5619 /// mutually exclusive.
5620 ///
5621 /// # Example
5622 /// ```ignore,no_run
5623 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5624 /// use google_cloud_hypercomputecluster_v1::model::CreateLustreInstance;
5625 /// let x = OperationStep::new().set_create_lustre_instance(CreateLustreInstance::default()/* use setters */);
5626 /// assert!(x.create_lustre_instance().is_some());
5627 /// assert!(x.create_network().is_none());
5628 /// assert!(x.create_private_service_access().is_none());
5629 /// assert!(x.create_filestore_instance().is_none());
5630 /// assert!(x.create_storage_bucket().is_none());
5631 /// assert!(x.create_orchestrator().is_none());
5632 /// assert!(x.create_nodeset().is_none());
5633 /// assert!(x.create_partition().is_none());
5634 /// assert!(x.create_login_node().is_none());
5635 /// assert!(x.check_cluster_health().is_none());
5636 /// assert!(x.update_orchestrator().is_none());
5637 /// assert!(x.update_nodeset().is_none());
5638 /// assert!(x.update_partition().is_none());
5639 /// assert!(x.update_login_node().is_none());
5640 /// assert!(x.delete_orchestrator().is_none());
5641 /// assert!(x.delete_nodeset().is_none());
5642 /// assert!(x.delete_partition().is_none());
5643 /// assert!(x.delete_login_node().is_none());
5644 /// assert!(x.delete_filestore_instance().is_none());
5645 /// assert!(x.delete_storage_bucket().is_none());
5646 /// assert!(x.delete_lustre_instance().is_none());
5647 /// assert!(x.delete_private_service_access().is_none());
5648 /// assert!(x.delete_network().is_none());
5649 /// ```
5650 pub fn set_create_lustre_instance<
5651 T: std::convert::Into<std::boxed::Box<crate::model::CreateLustreInstance>>,
5652 >(
5653 mut self,
5654 v: T,
5655 ) -> Self {
5656 self.r#type = std::option::Option::Some(
5657 crate::model::operation_step::Type::CreateLustreInstance(v.into()),
5658 );
5659 self
5660 }
5661
5662 /// The value of [r#type][crate::model::OperationStep::r#type]
5663 /// if it holds a `CreateOrchestrator`, `None` if the field is not set or
5664 /// holds a different branch.
5665 pub fn create_orchestrator(
5666 &self,
5667 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateOrchestrator>> {
5668 #[allow(unreachable_patterns)]
5669 self.r#type.as_ref().and_then(|v| match v {
5670 crate::model::operation_step::Type::CreateOrchestrator(v) => {
5671 std::option::Option::Some(v)
5672 }
5673 _ => std::option::Option::None,
5674 })
5675 }
5676
5677 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5678 /// to hold a `CreateOrchestrator`.
5679 ///
5680 /// Note that all the setters affecting `r#type` are
5681 /// mutually exclusive.
5682 ///
5683 /// # Example
5684 /// ```ignore,no_run
5685 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5686 /// use google_cloud_hypercomputecluster_v1::model::CreateOrchestrator;
5687 /// let x = OperationStep::new().set_create_orchestrator(CreateOrchestrator::default()/* use setters */);
5688 /// assert!(x.create_orchestrator().is_some());
5689 /// assert!(x.create_network().is_none());
5690 /// assert!(x.create_private_service_access().is_none());
5691 /// assert!(x.create_filestore_instance().is_none());
5692 /// assert!(x.create_storage_bucket().is_none());
5693 /// assert!(x.create_lustre_instance().is_none());
5694 /// assert!(x.create_nodeset().is_none());
5695 /// assert!(x.create_partition().is_none());
5696 /// assert!(x.create_login_node().is_none());
5697 /// assert!(x.check_cluster_health().is_none());
5698 /// assert!(x.update_orchestrator().is_none());
5699 /// assert!(x.update_nodeset().is_none());
5700 /// assert!(x.update_partition().is_none());
5701 /// assert!(x.update_login_node().is_none());
5702 /// assert!(x.delete_orchestrator().is_none());
5703 /// assert!(x.delete_nodeset().is_none());
5704 /// assert!(x.delete_partition().is_none());
5705 /// assert!(x.delete_login_node().is_none());
5706 /// assert!(x.delete_filestore_instance().is_none());
5707 /// assert!(x.delete_storage_bucket().is_none());
5708 /// assert!(x.delete_lustre_instance().is_none());
5709 /// assert!(x.delete_private_service_access().is_none());
5710 /// assert!(x.delete_network().is_none());
5711 /// ```
5712 pub fn set_create_orchestrator<
5713 T: std::convert::Into<std::boxed::Box<crate::model::CreateOrchestrator>>,
5714 >(
5715 mut self,
5716 v: T,
5717 ) -> Self {
5718 self.r#type = std::option::Option::Some(
5719 crate::model::operation_step::Type::CreateOrchestrator(v.into()),
5720 );
5721 self
5722 }
5723
5724 /// The value of [r#type][crate::model::OperationStep::r#type]
5725 /// if it holds a `CreateNodeset`, `None` if the field is not set or
5726 /// holds a different branch.
5727 pub fn create_nodeset(
5728 &self,
5729 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateNodeset>> {
5730 #[allow(unreachable_patterns)]
5731 self.r#type.as_ref().and_then(|v| match v {
5732 crate::model::operation_step::Type::CreateNodeset(v) => std::option::Option::Some(v),
5733 _ => std::option::Option::None,
5734 })
5735 }
5736
5737 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5738 /// to hold a `CreateNodeset`.
5739 ///
5740 /// Note that all the setters affecting `r#type` are
5741 /// mutually exclusive.
5742 ///
5743 /// # Example
5744 /// ```ignore,no_run
5745 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5746 /// use google_cloud_hypercomputecluster_v1::model::CreateNodeset;
5747 /// let x = OperationStep::new().set_create_nodeset(CreateNodeset::default()/* use setters */);
5748 /// assert!(x.create_nodeset().is_some());
5749 /// assert!(x.create_network().is_none());
5750 /// assert!(x.create_private_service_access().is_none());
5751 /// assert!(x.create_filestore_instance().is_none());
5752 /// assert!(x.create_storage_bucket().is_none());
5753 /// assert!(x.create_lustre_instance().is_none());
5754 /// assert!(x.create_orchestrator().is_none());
5755 /// assert!(x.create_partition().is_none());
5756 /// assert!(x.create_login_node().is_none());
5757 /// assert!(x.check_cluster_health().is_none());
5758 /// assert!(x.update_orchestrator().is_none());
5759 /// assert!(x.update_nodeset().is_none());
5760 /// assert!(x.update_partition().is_none());
5761 /// assert!(x.update_login_node().is_none());
5762 /// assert!(x.delete_orchestrator().is_none());
5763 /// assert!(x.delete_nodeset().is_none());
5764 /// assert!(x.delete_partition().is_none());
5765 /// assert!(x.delete_login_node().is_none());
5766 /// assert!(x.delete_filestore_instance().is_none());
5767 /// assert!(x.delete_storage_bucket().is_none());
5768 /// assert!(x.delete_lustre_instance().is_none());
5769 /// assert!(x.delete_private_service_access().is_none());
5770 /// assert!(x.delete_network().is_none());
5771 /// ```
5772 pub fn set_create_nodeset<
5773 T: std::convert::Into<std::boxed::Box<crate::model::CreateNodeset>>,
5774 >(
5775 mut self,
5776 v: T,
5777 ) -> Self {
5778 self.r#type =
5779 std::option::Option::Some(crate::model::operation_step::Type::CreateNodeset(v.into()));
5780 self
5781 }
5782
5783 /// The value of [r#type][crate::model::OperationStep::r#type]
5784 /// if it holds a `CreatePartition`, `None` if the field is not set or
5785 /// holds a different branch.
5786 pub fn create_partition(
5787 &self,
5788 ) -> std::option::Option<&std::boxed::Box<crate::model::CreatePartition>> {
5789 #[allow(unreachable_patterns)]
5790 self.r#type.as_ref().and_then(|v| match v {
5791 crate::model::operation_step::Type::CreatePartition(v) => std::option::Option::Some(v),
5792 _ => std::option::Option::None,
5793 })
5794 }
5795
5796 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5797 /// to hold a `CreatePartition`.
5798 ///
5799 /// Note that all the setters affecting `r#type` are
5800 /// mutually exclusive.
5801 ///
5802 /// # Example
5803 /// ```ignore,no_run
5804 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5805 /// use google_cloud_hypercomputecluster_v1::model::CreatePartition;
5806 /// let x = OperationStep::new().set_create_partition(CreatePartition::default()/* use setters */);
5807 /// assert!(x.create_partition().is_some());
5808 /// assert!(x.create_network().is_none());
5809 /// assert!(x.create_private_service_access().is_none());
5810 /// assert!(x.create_filestore_instance().is_none());
5811 /// assert!(x.create_storage_bucket().is_none());
5812 /// assert!(x.create_lustre_instance().is_none());
5813 /// assert!(x.create_orchestrator().is_none());
5814 /// assert!(x.create_nodeset().is_none());
5815 /// assert!(x.create_login_node().is_none());
5816 /// assert!(x.check_cluster_health().is_none());
5817 /// assert!(x.update_orchestrator().is_none());
5818 /// assert!(x.update_nodeset().is_none());
5819 /// assert!(x.update_partition().is_none());
5820 /// assert!(x.update_login_node().is_none());
5821 /// assert!(x.delete_orchestrator().is_none());
5822 /// assert!(x.delete_nodeset().is_none());
5823 /// assert!(x.delete_partition().is_none());
5824 /// assert!(x.delete_login_node().is_none());
5825 /// assert!(x.delete_filestore_instance().is_none());
5826 /// assert!(x.delete_storage_bucket().is_none());
5827 /// assert!(x.delete_lustre_instance().is_none());
5828 /// assert!(x.delete_private_service_access().is_none());
5829 /// assert!(x.delete_network().is_none());
5830 /// ```
5831 pub fn set_create_partition<
5832 T: std::convert::Into<std::boxed::Box<crate::model::CreatePartition>>,
5833 >(
5834 mut self,
5835 v: T,
5836 ) -> Self {
5837 self.r#type = std::option::Option::Some(
5838 crate::model::operation_step::Type::CreatePartition(v.into()),
5839 );
5840 self
5841 }
5842
5843 /// The value of [r#type][crate::model::OperationStep::r#type]
5844 /// if it holds a `CreateLoginNode`, `None` if the field is not set or
5845 /// holds a different branch.
5846 pub fn create_login_node(
5847 &self,
5848 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateLoginNode>> {
5849 #[allow(unreachable_patterns)]
5850 self.r#type.as_ref().and_then(|v| match v {
5851 crate::model::operation_step::Type::CreateLoginNode(v) => std::option::Option::Some(v),
5852 _ => std::option::Option::None,
5853 })
5854 }
5855
5856 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5857 /// to hold a `CreateLoginNode`.
5858 ///
5859 /// Note that all the setters affecting `r#type` are
5860 /// mutually exclusive.
5861 ///
5862 /// # Example
5863 /// ```ignore,no_run
5864 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5865 /// use google_cloud_hypercomputecluster_v1::model::CreateLoginNode;
5866 /// let x = OperationStep::new().set_create_login_node(CreateLoginNode::default()/* use setters */);
5867 /// assert!(x.create_login_node().is_some());
5868 /// assert!(x.create_network().is_none());
5869 /// assert!(x.create_private_service_access().is_none());
5870 /// assert!(x.create_filestore_instance().is_none());
5871 /// assert!(x.create_storage_bucket().is_none());
5872 /// assert!(x.create_lustre_instance().is_none());
5873 /// assert!(x.create_orchestrator().is_none());
5874 /// assert!(x.create_nodeset().is_none());
5875 /// assert!(x.create_partition().is_none());
5876 /// assert!(x.check_cluster_health().is_none());
5877 /// assert!(x.update_orchestrator().is_none());
5878 /// assert!(x.update_nodeset().is_none());
5879 /// assert!(x.update_partition().is_none());
5880 /// assert!(x.update_login_node().is_none());
5881 /// assert!(x.delete_orchestrator().is_none());
5882 /// assert!(x.delete_nodeset().is_none());
5883 /// assert!(x.delete_partition().is_none());
5884 /// assert!(x.delete_login_node().is_none());
5885 /// assert!(x.delete_filestore_instance().is_none());
5886 /// assert!(x.delete_storage_bucket().is_none());
5887 /// assert!(x.delete_lustre_instance().is_none());
5888 /// assert!(x.delete_private_service_access().is_none());
5889 /// assert!(x.delete_network().is_none());
5890 /// ```
5891 pub fn set_create_login_node<
5892 T: std::convert::Into<std::boxed::Box<crate::model::CreateLoginNode>>,
5893 >(
5894 mut self,
5895 v: T,
5896 ) -> Self {
5897 self.r#type = std::option::Option::Some(
5898 crate::model::operation_step::Type::CreateLoginNode(v.into()),
5899 );
5900 self
5901 }
5902
5903 /// The value of [r#type][crate::model::OperationStep::r#type]
5904 /// if it holds a `CheckClusterHealth`, `None` if the field is not set or
5905 /// holds a different branch.
5906 pub fn check_cluster_health(
5907 &self,
5908 ) -> std::option::Option<&std::boxed::Box<crate::model::CheckClusterHealth>> {
5909 #[allow(unreachable_patterns)]
5910 self.r#type.as_ref().and_then(|v| match v {
5911 crate::model::operation_step::Type::CheckClusterHealth(v) => {
5912 std::option::Option::Some(v)
5913 }
5914 _ => std::option::Option::None,
5915 })
5916 }
5917
5918 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5919 /// to hold a `CheckClusterHealth`.
5920 ///
5921 /// Note that all the setters affecting `r#type` are
5922 /// mutually exclusive.
5923 ///
5924 /// # Example
5925 /// ```ignore,no_run
5926 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5927 /// use google_cloud_hypercomputecluster_v1::model::CheckClusterHealth;
5928 /// let x = OperationStep::new().set_check_cluster_health(CheckClusterHealth::default()/* use setters */);
5929 /// assert!(x.check_cluster_health().is_some());
5930 /// assert!(x.create_network().is_none());
5931 /// assert!(x.create_private_service_access().is_none());
5932 /// assert!(x.create_filestore_instance().is_none());
5933 /// assert!(x.create_storage_bucket().is_none());
5934 /// assert!(x.create_lustre_instance().is_none());
5935 /// assert!(x.create_orchestrator().is_none());
5936 /// assert!(x.create_nodeset().is_none());
5937 /// assert!(x.create_partition().is_none());
5938 /// assert!(x.create_login_node().is_none());
5939 /// assert!(x.update_orchestrator().is_none());
5940 /// assert!(x.update_nodeset().is_none());
5941 /// assert!(x.update_partition().is_none());
5942 /// assert!(x.update_login_node().is_none());
5943 /// assert!(x.delete_orchestrator().is_none());
5944 /// assert!(x.delete_nodeset().is_none());
5945 /// assert!(x.delete_partition().is_none());
5946 /// assert!(x.delete_login_node().is_none());
5947 /// assert!(x.delete_filestore_instance().is_none());
5948 /// assert!(x.delete_storage_bucket().is_none());
5949 /// assert!(x.delete_lustre_instance().is_none());
5950 /// assert!(x.delete_private_service_access().is_none());
5951 /// assert!(x.delete_network().is_none());
5952 /// ```
5953 pub fn set_check_cluster_health<
5954 T: std::convert::Into<std::boxed::Box<crate::model::CheckClusterHealth>>,
5955 >(
5956 mut self,
5957 v: T,
5958 ) -> Self {
5959 self.r#type = std::option::Option::Some(
5960 crate::model::operation_step::Type::CheckClusterHealth(v.into()),
5961 );
5962 self
5963 }
5964
5965 /// The value of [r#type][crate::model::OperationStep::r#type]
5966 /// if it holds a `UpdateOrchestrator`, `None` if the field is not set or
5967 /// holds a different branch.
5968 pub fn update_orchestrator(
5969 &self,
5970 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateOrchestrator>> {
5971 #[allow(unreachable_patterns)]
5972 self.r#type.as_ref().and_then(|v| match v {
5973 crate::model::operation_step::Type::UpdateOrchestrator(v) => {
5974 std::option::Option::Some(v)
5975 }
5976 _ => std::option::Option::None,
5977 })
5978 }
5979
5980 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
5981 /// to hold a `UpdateOrchestrator`.
5982 ///
5983 /// Note that all the setters affecting `r#type` are
5984 /// mutually exclusive.
5985 ///
5986 /// # Example
5987 /// ```ignore,no_run
5988 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
5989 /// use google_cloud_hypercomputecluster_v1::model::UpdateOrchestrator;
5990 /// let x = OperationStep::new().set_update_orchestrator(UpdateOrchestrator::default()/* use setters */);
5991 /// assert!(x.update_orchestrator().is_some());
5992 /// assert!(x.create_network().is_none());
5993 /// assert!(x.create_private_service_access().is_none());
5994 /// assert!(x.create_filestore_instance().is_none());
5995 /// assert!(x.create_storage_bucket().is_none());
5996 /// assert!(x.create_lustre_instance().is_none());
5997 /// assert!(x.create_orchestrator().is_none());
5998 /// assert!(x.create_nodeset().is_none());
5999 /// assert!(x.create_partition().is_none());
6000 /// assert!(x.create_login_node().is_none());
6001 /// assert!(x.check_cluster_health().is_none());
6002 /// assert!(x.update_nodeset().is_none());
6003 /// assert!(x.update_partition().is_none());
6004 /// assert!(x.update_login_node().is_none());
6005 /// assert!(x.delete_orchestrator().is_none());
6006 /// assert!(x.delete_nodeset().is_none());
6007 /// assert!(x.delete_partition().is_none());
6008 /// assert!(x.delete_login_node().is_none());
6009 /// assert!(x.delete_filestore_instance().is_none());
6010 /// assert!(x.delete_storage_bucket().is_none());
6011 /// assert!(x.delete_lustre_instance().is_none());
6012 /// assert!(x.delete_private_service_access().is_none());
6013 /// assert!(x.delete_network().is_none());
6014 /// ```
6015 pub fn set_update_orchestrator<
6016 T: std::convert::Into<std::boxed::Box<crate::model::UpdateOrchestrator>>,
6017 >(
6018 mut self,
6019 v: T,
6020 ) -> Self {
6021 self.r#type = std::option::Option::Some(
6022 crate::model::operation_step::Type::UpdateOrchestrator(v.into()),
6023 );
6024 self
6025 }
6026
6027 /// The value of [r#type][crate::model::OperationStep::r#type]
6028 /// if it holds a `UpdateNodeset`, `None` if the field is not set or
6029 /// holds a different branch.
6030 pub fn update_nodeset(
6031 &self,
6032 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateNodeset>> {
6033 #[allow(unreachable_patterns)]
6034 self.r#type.as_ref().and_then(|v| match v {
6035 crate::model::operation_step::Type::UpdateNodeset(v) => std::option::Option::Some(v),
6036 _ => std::option::Option::None,
6037 })
6038 }
6039
6040 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6041 /// to hold a `UpdateNodeset`.
6042 ///
6043 /// Note that all the setters affecting `r#type` are
6044 /// mutually exclusive.
6045 ///
6046 /// # Example
6047 /// ```ignore,no_run
6048 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6049 /// use google_cloud_hypercomputecluster_v1::model::UpdateNodeset;
6050 /// let x = OperationStep::new().set_update_nodeset(UpdateNodeset::default()/* use setters */);
6051 /// assert!(x.update_nodeset().is_some());
6052 /// assert!(x.create_network().is_none());
6053 /// assert!(x.create_private_service_access().is_none());
6054 /// assert!(x.create_filestore_instance().is_none());
6055 /// assert!(x.create_storage_bucket().is_none());
6056 /// assert!(x.create_lustre_instance().is_none());
6057 /// assert!(x.create_orchestrator().is_none());
6058 /// assert!(x.create_nodeset().is_none());
6059 /// assert!(x.create_partition().is_none());
6060 /// assert!(x.create_login_node().is_none());
6061 /// assert!(x.check_cluster_health().is_none());
6062 /// assert!(x.update_orchestrator().is_none());
6063 /// assert!(x.update_partition().is_none());
6064 /// assert!(x.update_login_node().is_none());
6065 /// assert!(x.delete_orchestrator().is_none());
6066 /// assert!(x.delete_nodeset().is_none());
6067 /// assert!(x.delete_partition().is_none());
6068 /// assert!(x.delete_login_node().is_none());
6069 /// assert!(x.delete_filestore_instance().is_none());
6070 /// assert!(x.delete_storage_bucket().is_none());
6071 /// assert!(x.delete_lustre_instance().is_none());
6072 /// assert!(x.delete_private_service_access().is_none());
6073 /// assert!(x.delete_network().is_none());
6074 /// ```
6075 pub fn set_update_nodeset<
6076 T: std::convert::Into<std::boxed::Box<crate::model::UpdateNodeset>>,
6077 >(
6078 mut self,
6079 v: T,
6080 ) -> Self {
6081 self.r#type =
6082 std::option::Option::Some(crate::model::operation_step::Type::UpdateNodeset(v.into()));
6083 self
6084 }
6085
6086 /// The value of [r#type][crate::model::OperationStep::r#type]
6087 /// if it holds a `UpdatePartition`, `None` if the field is not set or
6088 /// holds a different branch.
6089 pub fn update_partition(
6090 &self,
6091 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdatePartition>> {
6092 #[allow(unreachable_patterns)]
6093 self.r#type.as_ref().and_then(|v| match v {
6094 crate::model::operation_step::Type::UpdatePartition(v) => std::option::Option::Some(v),
6095 _ => std::option::Option::None,
6096 })
6097 }
6098
6099 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6100 /// to hold a `UpdatePartition`.
6101 ///
6102 /// Note that all the setters affecting `r#type` are
6103 /// mutually exclusive.
6104 ///
6105 /// # Example
6106 /// ```ignore,no_run
6107 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6108 /// use google_cloud_hypercomputecluster_v1::model::UpdatePartition;
6109 /// let x = OperationStep::new().set_update_partition(UpdatePartition::default()/* use setters */);
6110 /// assert!(x.update_partition().is_some());
6111 /// assert!(x.create_network().is_none());
6112 /// assert!(x.create_private_service_access().is_none());
6113 /// assert!(x.create_filestore_instance().is_none());
6114 /// assert!(x.create_storage_bucket().is_none());
6115 /// assert!(x.create_lustre_instance().is_none());
6116 /// assert!(x.create_orchestrator().is_none());
6117 /// assert!(x.create_nodeset().is_none());
6118 /// assert!(x.create_partition().is_none());
6119 /// assert!(x.create_login_node().is_none());
6120 /// assert!(x.check_cluster_health().is_none());
6121 /// assert!(x.update_orchestrator().is_none());
6122 /// assert!(x.update_nodeset().is_none());
6123 /// assert!(x.update_login_node().is_none());
6124 /// assert!(x.delete_orchestrator().is_none());
6125 /// assert!(x.delete_nodeset().is_none());
6126 /// assert!(x.delete_partition().is_none());
6127 /// assert!(x.delete_login_node().is_none());
6128 /// assert!(x.delete_filestore_instance().is_none());
6129 /// assert!(x.delete_storage_bucket().is_none());
6130 /// assert!(x.delete_lustre_instance().is_none());
6131 /// assert!(x.delete_private_service_access().is_none());
6132 /// assert!(x.delete_network().is_none());
6133 /// ```
6134 pub fn set_update_partition<
6135 T: std::convert::Into<std::boxed::Box<crate::model::UpdatePartition>>,
6136 >(
6137 mut self,
6138 v: T,
6139 ) -> Self {
6140 self.r#type = std::option::Option::Some(
6141 crate::model::operation_step::Type::UpdatePartition(v.into()),
6142 );
6143 self
6144 }
6145
6146 /// The value of [r#type][crate::model::OperationStep::r#type]
6147 /// if it holds a `UpdateLoginNode`, `None` if the field is not set or
6148 /// holds a different branch.
6149 pub fn update_login_node(
6150 &self,
6151 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateLoginNode>> {
6152 #[allow(unreachable_patterns)]
6153 self.r#type.as_ref().and_then(|v| match v {
6154 crate::model::operation_step::Type::UpdateLoginNode(v) => std::option::Option::Some(v),
6155 _ => std::option::Option::None,
6156 })
6157 }
6158
6159 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6160 /// to hold a `UpdateLoginNode`.
6161 ///
6162 /// Note that all the setters affecting `r#type` are
6163 /// mutually exclusive.
6164 ///
6165 /// # Example
6166 /// ```ignore,no_run
6167 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6168 /// use google_cloud_hypercomputecluster_v1::model::UpdateLoginNode;
6169 /// let x = OperationStep::new().set_update_login_node(UpdateLoginNode::default()/* use setters */);
6170 /// assert!(x.update_login_node().is_some());
6171 /// assert!(x.create_network().is_none());
6172 /// assert!(x.create_private_service_access().is_none());
6173 /// assert!(x.create_filestore_instance().is_none());
6174 /// assert!(x.create_storage_bucket().is_none());
6175 /// assert!(x.create_lustre_instance().is_none());
6176 /// assert!(x.create_orchestrator().is_none());
6177 /// assert!(x.create_nodeset().is_none());
6178 /// assert!(x.create_partition().is_none());
6179 /// assert!(x.create_login_node().is_none());
6180 /// assert!(x.check_cluster_health().is_none());
6181 /// assert!(x.update_orchestrator().is_none());
6182 /// assert!(x.update_nodeset().is_none());
6183 /// assert!(x.update_partition().is_none());
6184 /// assert!(x.delete_orchestrator().is_none());
6185 /// assert!(x.delete_nodeset().is_none());
6186 /// assert!(x.delete_partition().is_none());
6187 /// assert!(x.delete_login_node().is_none());
6188 /// assert!(x.delete_filestore_instance().is_none());
6189 /// assert!(x.delete_storage_bucket().is_none());
6190 /// assert!(x.delete_lustre_instance().is_none());
6191 /// assert!(x.delete_private_service_access().is_none());
6192 /// assert!(x.delete_network().is_none());
6193 /// ```
6194 pub fn set_update_login_node<
6195 T: std::convert::Into<std::boxed::Box<crate::model::UpdateLoginNode>>,
6196 >(
6197 mut self,
6198 v: T,
6199 ) -> Self {
6200 self.r#type = std::option::Option::Some(
6201 crate::model::operation_step::Type::UpdateLoginNode(v.into()),
6202 );
6203 self
6204 }
6205
6206 /// The value of [r#type][crate::model::OperationStep::r#type]
6207 /// if it holds a `DeleteOrchestrator`, `None` if the field is not set or
6208 /// holds a different branch.
6209 pub fn delete_orchestrator(
6210 &self,
6211 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteOrchestrator>> {
6212 #[allow(unreachable_patterns)]
6213 self.r#type.as_ref().and_then(|v| match v {
6214 crate::model::operation_step::Type::DeleteOrchestrator(v) => {
6215 std::option::Option::Some(v)
6216 }
6217 _ => std::option::Option::None,
6218 })
6219 }
6220
6221 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6222 /// to hold a `DeleteOrchestrator`.
6223 ///
6224 /// Note that all the setters affecting `r#type` are
6225 /// mutually exclusive.
6226 ///
6227 /// # Example
6228 /// ```ignore,no_run
6229 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6230 /// use google_cloud_hypercomputecluster_v1::model::DeleteOrchestrator;
6231 /// let x = OperationStep::new().set_delete_orchestrator(DeleteOrchestrator::default()/* use setters */);
6232 /// assert!(x.delete_orchestrator().is_some());
6233 /// assert!(x.create_network().is_none());
6234 /// assert!(x.create_private_service_access().is_none());
6235 /// assert!(x.create_filestore_instance().is_none());
6236 /// assert!(x.create_storage_bucket().is_none());
6237 /// assert!(x.create_lustre_instance().is_none());
6238 /// assert!(x.create_orchestrator().is_none());
6239 /// assert!(x.create_nodeset().is_none());
6240 /// assert!(x.create_partition().is_none());
6241 /// assert!(x.create_login_node().is_none());
6242 /// assert!(x.check_cluster_health().is_none());
6243 /// assert!(x.update_orchestrator().is_none());
6244 /// assert!(x.update_nodeset().is_none());
6245 /// assert!(x.update_partition().is_none());
6246 /// assert!(x.update_login_node().is_none());
6247 /// assert!(x.delete_nodeset().is_none());
6248 /// assert!(x.delete_partition().is_none());
6249 /// assert!(x.delete_login_node().is_none());
6250 /// assert!(x.delete_filestore_instance().is_none());
6251 /// assert!(x.delete_storage_bucket().is_none());
6252 /// assert!(x.delete_lustre_instance().is_none());
6253 /// assert!(x.delete_private_service_access().is_none());
6254 /// assert!(x.delete_network().is_none());
6255 /// ```
6256 pub fn set_delete_orchestrator<
6257 T: std::convert::Into<std::boxed::Box<crate::model::DeleteOrchestrator>>,
6258 >(
6259 mut self,
6260 v: T,
6261 ) -> Self {
6262 self.r#type = std::option::Option::Some(
6263 crate::model::operation_step::Type::DeleteOrchestrator(v.into()),
6264 );
6265 self
6266 }
6267
6268 /// The value of [r#type][crate::model::OperationStep::r#type]
6269 /// if it holds a `DeleteNodeset`, `None` if the field is not set or
6270 /// holds a different branch.
6271 pub fn delete_nodeset(
6272 &self,
6273 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteNodeset>> {
6274 #[allow(unreachable_patterns)]
6275 self.r#type.as_ref().and_then(|v| match v {
6276 crate::model::operation_step::Type::DeleteNodeset(v) => std::option::Option::Some(v),
6277 _ => std::option::Option::None,
6278 })
6279 }
6280
6281 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6282 /// to hold a `DeleteNodeset`.
6283 ///
6284 /// Note that all the setters affecting `r#type` are
6285 /// mutually exclusive.
6286 ///
6287 /// # Example
6288 /// ```ignore,no_run
6289 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6290 /// use google_cloud_hypercomputecluster_v1::model::DeleteNodeset;
6291 /// let x = OperationStep::new().set_delete_nodeset(DeleteNodeset::default()/* use setters */);
6292 /// assert!(x.delete_nodeset().is_some());
6293 /// assert!(x.create_network().is_none());
6294 /// assert!(x.create_private_service_access().is_none());
6295 /// assert!(x.create_filestore_instance().is_none());
6296 /// assert!(x.create_storage_bucket().is_none());
6297 /// assert!(x.create_lustre_instance().is_none());
6298 /// assert!(x.create_orchestrator().is_none());
6299 /// assert!(x.create_nodeset().is_none());
6300 /// assert!(x.create_partition().is_none());
6301 /// assert!(x.create_login_node().is_none());
6302 /// assert!(x.check_cluster_health().is_none());
6303 /// assert!(x.update_orchestrator().is_none());
6304 /// assert!(x.update_nodeset().is_none());
6305 /// assert!(x.update_partition().is_none());
6306 /// assert!(x.update_login_node().is_none());
6307 /// assert!(x.delete_orchestrator().is_none());
6308 /// assert!(x.delete_partition().is_none());
6309 /// assert!(x.delete_login_node().is_none());
6310 /// assert!(x.delete_filestore_instance().is_none());
6311 /// assert!(x.delete_storage_bucket().is_none());
6312 /// assert!(x.delete_lustre_instance().is_none());
6313 /// assert!(x.delete_private_service_access().is_none());
6314 /// assert!(x.delete_network().is_none());
6315 /// ```
6316 pub fn set_delete_nodeset<
6317 T: std::convert::Into<std::boxed::Box<crate::model::DeleteNodeset>>,
6318 >(
6319 mut self,
6320 v: T,
6321 ) -> Self {
6322 self.r#type =
6323 std::option::Option::Some(crate::model::operation_step::Type::DeleteNodeset(v.into()));
6324 self
6325 }
6326
6327 /// The value of [r#type][crate::model::OperationStep::r#type]
6328 /// if it holds a `DeletePartition`, `None` if the field is not set or
6329 /// holds a different branch.
6330 pub fn delete_partition(
6331 &self,
6332 ) -> std::option::Option<&std::boxed::Box<crate::model::DeletePartition>> {
6333 #[allow(unreachable_patterns)]
6334 self.r#type.as_ref().and_then(|v| match v {
6335 crate::model::operation_step::Type::DeletePartition(v) => std::option::Option::Some(v),
6336 _ => std::option::Option::None,
6337 })
6338 }
6339
6340 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6341 /// to hold a `DeletePartition`.
6342 ///
6343 /// Note that all the setters affecting `r#type` are
6344 /// mutually exclusive.
6345 ///
6346 /// # Example
6347 /// ```ignore,no_run
6348 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6349 /// use google_cloud_hypercomputecluster_v1::model::DeletePartition;
6350 /// let x = OperationStep::new().set_delete_partition(DeletePartition::default()/* use setters */);
6351 /// assert!(x.delete_partition().is_some());
6352 /// assert!(x.create_network().is_none());
6353 /// assert!(x.create_private_service_access().is_none());
6354 /// assert!(x.create_filestore_instance().is_none());
6355 /// assert!(x.create_storage_bucket().is_none());
6356 /// assert!(x.create_lustre_instance().is_none());
6357 /// assert!(x.create_orchestrator().is_none());
6358 /// assert!(x.create_nodeset().is_none());
6359 /// assert!(x.create_partition().is_none());
6360 /// assert!(x.create_login_node().is_none());
6361 /// assert!(x.check_cluster_health().is_none());
6362 /// assert!(x.update_orchestrator().is_none());
6363 /// assert!(x.update_nodeset().is_none());
6364 /// assert!(x.update_partition().is_none());
6365 /// assert!(x.update_login_node().is_none());
6366 /// assert!(x.delete_orchestrator().is_none());
6367 /// assert!(x.delete_nodeset().is_none());
6368 /// assert!(x.delete_login_node().is_none());
6369 /// assert!(x.delete_filestore_instance().is_none());
6370 /// assert!(x.delete_storage_bucket().is_none());
6371 /// assert!(x.delete_lustre_instance().is_none());
6372 /// assert!(x.delete_private_service_access().is_none());
6373 /// assert!(x.delete_network().is_none());
6374 /// ```
6375 pub fn set_delete_partition<
6376 T: std::convert::Into<std::boxed::Box<crate::model::DeletePartition>>,
6377 >(
6378 mut self,
6379 v: T,
6380 ) -> Self {
6381 self.r#type = std::option::Option::Some(
6382 crate::model::operation_step::Type::DeletePartition(v.into()),
6383 );
6384 self
6385 }
6386
6387 /// The value of [r#type][crate::model::OperationStep::r#type]
6388 /// if it holds a `DeleteLoginNode`, `None` if the field is not set or
6389 /// holds a different branch.
6390 pub fn delete_login_node(
6391 &self,
6392 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteLoginNode>> {
6393 #[allow(unreachable_patterns)]
6394 self.r#type.as_ref().and_then(|v| match v {
6395 crate::model::operation_step::Type::DeleteLoginNode(v) => std::option::Option::Some(v),
6396 _ => std::option::Option::None,
6397 })
6398 }
6399
6400 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6401 /// to hold a `DeleteLoginNode`.
6402 ///
6403 /// Note that all the setters affecting `r#type` are
6404 /// mutually exclusive.
6405 ///
6406 /// # Example
6407 /// ```ignore,no_run
6408 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6409 /// use google_cloud_hypercomputecluster_v1::model::DeleteLoginNode;
6410 /// let x = OperationStep::new().set_delete_login_node(DeleteLoginNode::default()/* use setters */);
6411 /// assert!(x.delete_login_node().is_some());
6412 /// assert!(x.create_network().is_none());
6413 /// assert!(x.create_private_service_access().is_none());
6414 /// assert!(x.create_filestore_instance().is_none());
6415 /// assert!(x.create_storage_bucket().is_none());
6416 /// assert!(x.create_lustre_instance().is_none());
6417 /// assert!(x.create_orchestrator().is_none());
6418 /// assert!(x.create_nodeset().is_none());
6419 /// assert!(x.create_partition().is_none());
6420 /// assert!(x.create_login_node().is_none());
6421 /// assert!(x.check_cluster_health().is_none());
6422 /// assert!(x.update_orchestrator().is_none());
6423 /// assert!(x.update_nodeset().is_none());
6424 /// assert!(x.update_partition().is_none());
6425 /// assert!(x.update_login_node().is_none());
6426 /// assert!(x.delete_orchestrator().is_none());
6427 /// assert!(x.delete_nodeset().is_none());
6428 /// assert!(x.delete_partition().is_none());
6429 /// assert!(x.delete_filestore_instance().is_none());
6430 /// assert!(x.delete_storage_bucket().is_none());
6431 /// assert!(x.delete_lustre_instance().is_none());
6432 /// assert!(x.delete_private_service_access().is_none());
6433 /// assert!(x.delete_network().is_none());
6434 /// ```
6435 pub fn set_delete_login_node<
6436 T: std::convert::Into<std::boxed::Box<crate::model::DeleteLoginNode>>,
6437 >(
6438 mut self,
6439 v: T,
6440 ) -> Self {
6441 self.r#type = std::option::Option::Some(
6442 crate::model::operation_step::Type::DeleteLoginNode(v.into()),
6443 );
6444 self
6445 }
6446
6447 /// The value of [r#type][crate::model::OperationStep::r#type]
6448 /// if it holds a `DeleteFilestoreInstance`, `None` if the field is not set or
6449 /// holds a different branch.
6450 pub fn delete_filestore_instance(
6451 &self,
6452 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteFilestoreInstance>> {
6453 #[allow(unreachable_patterns)]
6454 self.r#type.as_ref().and_then(|v| match v {
6455 crate::model::operation_step::Type::DeleteFilestoreInstance(v) => {
6456 std::option::Option::Some(v)
6457 }
6458 _ => std::option::Option::None,
6459 })
6460 }
6461
6462 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6463 /// to hold a `DeleteFilestoreInstance`.
6464 ///
6465 /// Note that all the setters affecting `r#type` are
6466 /// mutually exclusive.
6467 ///
6468 /// # Example
6469 /// ```ignore,no_run
6470 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6471 /// use google_cloud_hypercomputecluster_v1::model::DeleteFilestoreInstance;
6472 /// let x = OperationStep::new().set_delete_filestore_instance(DeleteFilestoreInstance::default()/* use setters */);
6473 /// assert!(x.delete_filestore_instance().is_some());
6474 /// assert!(x.create_network().is_none());
6475 /// assert!(x.create_private_service_access().is_none());
6476 /// assert!(x.create_filestore_instance().is_none());
6477 /// assert!(x.create_storage_bucket().is_none());
6478 /// assert!(x.create_lustre_instance().is_none());
6479 /// assert!(x.create_orchestrator().is_none());
6480 /// assert!(x.create_nodeset().is_none());
6481 /// assert!(x.create_partition().is_none());
6482 /// assert!(x.create_login_node().is_none());
6483 /// assert!(x.check_cluster_health().is_none());
6484 /// assert!(x.update_orchestrator().is_none());
6485 /// assert!(x.update_nodeset().is_none());
6486 /// assert!(x.update_partition().is_none());
6487 /// assert!(x.update_login_node().is_none());
6488 /// assert!(x.delete_orchestrator().is_none());
6489 /// assert!(x.delete_nodeset().is_none());
6490 /// assert!(x.delete_partition().is_none());
6491 /// assert!(x.delete_login_node().is_none());
6492 /// assert!(x.delete_storage_bucket().is_none());
6493 /// assert!(x.delete_lustre_instance().is_none());
6494 /// assert!(x.delete_private_service_access().is_none());
6495 /// assert!(x.delete_network().is_none());
6496 /// ```
6497 pub fn set_delete_filestore_instance<
6498 T: std::convert::Into<std::boxed::Box<crate::model::DeleteFilestoreInstance>>,
6499 >(
6500 mut self,
6501 v: T,
6502 ) -> Self {
6503 self.r#type = std::option::Option::Some(
6504 crate::model::operation_step::Type::DeleteFilestoreInstance(v.into()),
6505 );
6506 self
6507 }
6508
6509 /// The value of [r#type][crate::model::OperationStep::r#type]
6510 /// if it holds a `DeleteStorageBucket`, `None` if the field is not set or
6511 /// holds a different branch.
6512 pub fn delete_storage_bucket(
6513 &self,
6514 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteStorageBucket>> {
6515 #[allow(unreachable_patterns)]
6516 self.r#type.as_ref().and_then(|v| match v {
6517 crate::model::operation_step::Type::DeleteStorageBucket(v) => {
6518 std::option::Option::Some(v)
6519 }
6520 _ => std::option::Option::None,
6521 })
6522 }
6523
6524 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6525 /// to hold a `DeleteStorageBucket`.
6526 ///
6527 /// Note that all the setters affecting `r#type` are
6528 /// mutually exclusive.
6529 ///
6530 /// # Example
6531 /// ```ignore,no_run
6532 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6533 /// use google_cloud_hypercomputecluster_v1::model::DeleteStorageBucket;
6534 /// let x = OperationStep::new().set_delete_storage_bucket(DeleteStorageBucket::default()/* use setters */);
6535 /// assert!(x.delete_storage_bucket().is_some());
6536 /// assert!(x.create_network().is_none());
6537 /// assert!(x.create_private_service_access().is_none());
6538 /// assert!(x.create_filestore_instance().is_none());
6539 /// assert!(x.create_storage_bucket().is_none());
6540 /// assert!(x.create_lustre_instance().is_none());
6541 /// assert!(x.create_orchestrator().is_none());
6542 /// assert!(x.create_nodeset().is_none());
6543 /// assert!(x.create_partition().is_none());
6544 /// assert!(x.create_login_node().is_none());
6545 /// assert!(x.check_cluster_health().is_none());
6546 /// assert!(x.update_orchestrator().is_none());
6547 /// assert!(x.update_nodeset().is_none());
6548 /// assert!(x.update_partition().is_none());
6549 /// assert!(x.update_login_node().is_none());
6550 /// assert!(x.delete_orchestrator().is_none());
6551 /// assert!(x.delete_nodeset().is_none());
6552 /// assert!(x.delete_partition().is_none());
6553 /// assert!(x.delete_login_node().is_none());
6554 /// assert!(x.delete_filestore_instance().is_none());
6555 /// assert!(x.delete_lustre_instance().is_none());
6556 /// assert!(x.delete_private_service_access().is_none());
6557 /// assert!(x.delete_network().is_none());
6558 /// ```
6559 pub fn set_delete_storage_bucket<
6560 T: std::convert::Into<std::boxed::Box<crate::model::DeleteStorageBucket>>,
6561 >(
6562 mut self,
6563 v: T,
6564 ) -> Self {
6565 self.r#type = std::option::Option::Some(
6566 crate::model::operation_step::Type::DeleteStorageBucket(v.into()),
6567 );
6568 self
6569 }
6570
6571 /// The value of [r#type][crate::model::OperationStep::r#type]
6572 /// if it holds a `DeleteLustreInstance`, `None` if the field is not set or
6573 /// holds a different branch.
6574 pub fn delete_lustre_instance(
6575 &self,
6576 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteLustreInstance>> {
6577 #[allow(unreachable_patterns)]
6578 self.r#type.as_ref().and_then(|v| match v {
6579 crate::model::operation_step::Type::DeleteLustreInstance(v) => {
6580 std::option::Option::Some(v)
6581 }
6582 _ => std::option::Option::None,
6583 })
6584 }
6585
6586 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6587 /// to hold a `DeleteLustreInstance`.
6588 ///
6589 /// Note that all the setters affecting `r#type` are
6590 /// mutually exclusive.
6591 ///
6592 /// # Example
6593 /// ```ignore,no_run
6594 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6595 /// use google_cloud_hypercomputecluster_v1::model::DeleteLustreInstance;
6596 /// let x = OperationStep::new().set_delete_lustre_instance(DeleteLustreInstance::default()/* use setters */);
6597 /// assert!(x.delete_lustre_instance().is_some());
6598 /// assert!(x.create_network().is_none());
6599 /// assert!(x.create_private_service_access().is_none());
6600 /// assert!(x.create_filestore_instance().is_none());
6601 /// assert!(x.create_storage_bucket().is_none());
6602 /// assert!(x.create_lustre_instance().is_none());
6603 /// assert!(x.create_orchestrator().is_none());
6604 /// assert!(x.create_nodeset().is_none());
6605 /// assert!(x.create_partition().is_none());
6606 /// assert!(x.create_login_node().is_none());
6607 /// assert!(x.check_cluster_health().is_none());
6608 /// assert!(x.update_orchestrator().is_none());
6609 /// assert!(x.update_nodeset().is_none());
6610 /// assert!(x.update_partition().is_none());
6611 /// assert!(x.update_login_node().is_none());
6612 /// assert!(x.delete_orchestrator().is_none());
6613 /// assert!(x.delete_nodeset().is_none());
6614 /// assert!(x.delete_partition().is_none());
6615 /// assert!(x.delete_login_node().is_none());
6616 /// assert!(x.delete_filestore_instance().is_none());
6617 /// assert!(x.delete_storage_bucket().is_none());
6618 /// assert!(x.delete_private_service_access().is_none());
6619 /// assert!(x.delete_network().is_none());
6620 /// ```
6621 pub fn set_delete_lustre_instance<
6622 T: std::convert::Into<std::boxed::Box<crate::model::DeleteLustreInstance>>,
6623 >(
6624 mut self,
6625 v: T,
6626 ) -> Self {
6627 self.r#type = std::option::Option::Some(
6628 crate::model::operation_step::Type::DeleteLustreInstance(v.into()),
6629 );
6630 self
6631 }
6632
6633 /// The value of [r#type][crate::model::OperationStep::r#type]
6634 /// if it holds a `DeletePrivateServiceAccess`, `None` if the field is not set or
6635 /// holds a different branch.
6636 pub fn delete_private_service_access(
6637 &self,
6638 ) -> std::option::Option<&std::boxed::Box<crate::model::DeletePrivateServiceAccess>> {
6639 #[allow(unreachable_patterns)]
6640 self.r#type.as_ref().and_then(|v| match v {
6641 crate::model::operation_step::Type::DeletePrivateServiceAccess(v) => {
6642 std::option::Option::Some(v)
6643 }
6644 _ => std::option::Option::None,
6645 })
6646 }
6647
6648 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6649 /// to hold a `DeletePrivateServiceAccess`.
6650 ///
6651 /// Note that all the setters affecting `r#type` are
6652 /// mutually exclusive.
6653 ///
6654 /// # Example
6655 /// ```ignore,no_run
6656 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6657 /// use google_cloud_hypercomputecluster_v1::model::DeletePrivateServiceAccess;
6658 /// let x = OperationStep::new().set_delete_private_service_access(DeletePrivateServiceAccess::default()/* use setters */);
6659 /// assert!(x.delete_private_service_access().is_some());
6660 /// assert!(x.create_network().is_none());
6661 /// assert!(x.create_private_service_access().is_none());
6662 /// assert!(x.create_filestore_instance().is_none());
6663 /// assert!(x.create_storage_bucket().is_none());
6664 /// assert!(x.create_lustre_instance().is_none());
6665 /// assert!(x.create_orchestrator().is_none());
6666 /// assert!(x.create_nodeset().is_none());
6667 /// assert!(x.create_partition().is_none());
6668 /// assert!(x.create_login_node().is_none());
6669 /// assert!(x.check_cluster_health().is_none());
6670 /// assert!(x.update_orchestrator().is_none());
6671 /// assert!(x.update_nodeset().is_none());
6672 /// assert!(x.update_partition().is_none());
6673 /// assert!(x.update_login_node().is_none());
6674 /// assert!(x.delete_orchestrator().is_none());
6675 /// assert!(x.delete_nodeset().is_none());
6676 /// assert!(x.delete_partition().is_none());
6677 /// assert!(x.delete_login_node().is_none());
6678 /// assert!(x.delete_filestore_instance().is_none());
6679 /// assert!(x.delete_storage_bucket().is_none());
6680 /// assert!(x.delete_lustre_instance().is_none());
6681 /// assert!(x.delete_network().is_none());
6682 /// ```
6683 pub fn set_delete_private_service_access<
6684 T: std::convert::Into<std::boxed::Box<crate::model::DeletePrivateServiceAccess>>,
6685 >(
6686 mut self,
6687 v: T,
6688 ) -> Self {
6689 self.r#type = std::option::Option::Some(
6690 crate::model::operation_step::Type::DeletePrivateServiceAccess(v.into()),
6691 );
6692 self
6693 }
6694
6695 /// The value of [r#type][crate::model::OperationStep::r#type]
6696 /// if it holds a `DeleteNetwork`, `None` if the field is not set or
6697 /// holds a different branch.
6698 pub fn delete_network(
6699 &self,
6700 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteNetwork>> {
6701 #[allow(unreachable_patterns)]
6702 self.r#type.as_ref().and_then(|v| match v {
6703 crate::model::operation_step::Type::DeleteNetwork(v) => std::option::Option::Some(v),
6704 _ => std::option::Option::None,
6705 })
6706 }
6707
6708 /// Sets the value of [r#type][crate::model::OperationStep::r#type]
6709 /// to hold a `DeleteNetwork`.
6710 ///
6711 /// Note that all the setters affecting `r#type` are
6712 /// mutually exclusive.
6713 ///
6714 /// # Example
6715 /// ```ignore,no_run
6716 /// # use google_cloud_hypercomputecluster_v1::model::OperationStep;
6717 /// use google_cloud_hypercomputecluster_v1::model::DeleteNetwork;
6718 /// let x = OperationStep::new().set_delete_network(DeleteNetwork::default()/* use setters */);
6719 /// assert!(x.delete_network().is_some());
6720 /// assert!(x.create_network().is_none());
6721 /// assert!(x.create_private_service_access().is_none());
6722 /// assert!(x.create_filestore_instance().is_none());
6723 /// assert!(x.create_storage_bucket().is_none());
6724 /// assert!(x.create_lustre_instance().is_none());
6725 /// assert!(x.create_orchestrator().is_none());
6726 /// assert!(x.create_nodeset().is_none());
6727 /// assert!(x.create_partition().is_none());
6728 /// assert!(x.create_login_node().is_none());
6729 /// assert!(x.check_cluster_health().is_none());
6730 /// assert!(x.update_orchestrator().is_none());
6731 /// assert!(x.update_nodeset().is_none());
6732 /// assert!(x.update_partition().is_none());
6733 /// assert!(x.update_login_node().is_none());
6734 /// assert!(x.delete_orchestrator().is_none());
6735 /// assert!(x.delete_nodeset().is_none());
6736 /// assert!(x.delete_partition().is_none());
6737 /// assert!(x.delete_login_node().is_none());
6738 /// assert!(x.delete_filestore_instance().is_none());
6739 /// assert!(x.delete_storage_bucket().is_none());
6740 /// assert!(x.delete_lustre_instance().is_none());
6741 /// assert!(x.delete_private_service_access().is_none());
6742 /// ```
6743 pub fn set_delete_network<
6744 T: std::convert::Into<std::boxed::Box<crate::model::DeleteNetwork>>,
6745 >(
6746 mut self,
6747 v: T,
6748 ) -> Self {
6749 self.r#type =
6750 std::option::Option::Some(crate::model::operation_step::Type::DeleteNetwork(v.into()));
6751 self
6752 }
6753}
6754
6755impl wkt::message::Message for OperationStep {
6756 fn typename() -> &'static str {
6757 "type.googleapis.com/google.cloud.hypercomputecluster.v1.OperationStep"
6758 }
6759}
6760
6761/// Defines additional types related to [OperationStep].
6762pub mod operation_step {
6763 #[allow(unused_imports)]
6764 use super::*;
6765
6766 /// State of the operation step.
6767 ///
6768 /// # Working with unknown values
6769 ///
6770 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6771 /// additional enum variants at any time. Adding new variants is not considered
6772 /// a breaking change. Applications should write their code in anticipation of:
6773 ///
6774 /// - New values appearing in future releases of the client library, **and**
6775 /// - New values received dynamically, without application changes.
6776 ///
6777 /// Please consult the [Working with enums] section in the user guide for some
6778 /// guidelines.
6779 ///
6780 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6781 #[derive(Clone, Debug, PartialEq)]
6782 #[non_exhaustive]
6783 pub enum State {
6784 /// Unspecified state.
6785 Unspecified,
6786 /// Initial state before step execution starts.
6787 Waiting,
6788 /// Step execution is running in progress.
6789 InProgress,
6790 /// Step execution is completed.
6791 Done,
6792 /// If set, the enum was initialized with an unknown value.
6793 ///
6794 /// Applications can examine the value using [State::value] or
6795 /// [State::name].
6796 UnknownValue(state::UnknownValue),
6797 }
6798
6799 #[doc(hidden)]
6800 pub mod state {
6801 #[allow(unused_imports)]
6802 use super::*;
6803 #[derive(Clone, Debug, PartialEq)]
6804 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6805 }
6806
6807 impl State {
6808 /// Gets the enum value.
6809 ///
6810 /// Returns `None` if the enum contains an unknown value deserialized from
6811 /// the string representation of enums.
6812 pub fn value(&self) -> std::option::Option<i32> {
6813 match self {
6814 Self::Unspecified => std::option::Option::Some(0),
6815 Self::Waiting => std::option::Option::Some(1),
6816 Self::InProgress => std::option::Option::Some(2),
6817 Self::Done => std::option::Option::Some(3),
6818 Self::UnknownValue(u) => u.0.value(),
6819 }
6820 }
6821
6822 /// Gets the enum value as a string.
6823 ///
6824 /// Returns `None` if the enum contains an unknown value deserialized from
6825 /// the integer representation of enums.
6826 pub fn name(&self) -> std::option::Option<&str> {
6827 match self {
6828 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6829 Self::Waiting => std::option::Option::Some("WAITING"),
6830 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
6831 Self::Done => std::option::Option::Some("DONE"),
6832 Self::UnknownValue(u) => u.0.name(),
6833 }
6834 }
6835 }
6836
6837 impl std::default::Default for State {
6838 fn default() -> Self {
6839 use std::convert::From;
6840 Self::from(0)
6841 }
6842 }
6843
6844 impl std::fmt::Display for State {
6845 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6846 wkt::internal::display_enum(f, self.name(), self.value())
6847 }
6848 }
6849
6850 impl std::convert::From<i32> for State {
6851 fn from(value: i32) -> Self {
6852 match value {
6853 0 => Self::Unspecified,
6854 1 => Self::Waiting,
6855 2 => Self::InProgress,
6856 3 => Self::Done,
6857 _ => Self::UnknownValue(state::UnknownValue(
6858 wkt::internal::UnknownEnumValue::Integer(value),
6859 )),
6860 }
6861 }
6862 }
6863
6864 impl std::convert::From<&str> for State {
6865 fn from(value: &str) -> Self {
6866 use std::string::ToString;
6867 match value {
6868 "STATE_UNSPECIFIED" => Self::Unspecified,
6869 "WAITING" => Self::Waiting,
6870 "IN_PROGRESS" => Self::InProgress,
6871 "DONE" => Self::Done,
6872 _ => Self::UnknownValue(state::UnknownValue(
6873 wkt::internal::UnknownEnumValue::String(value.to_string()),
6874 )),
6875 }
6876 }
6877 }
6878
6879 impl serde::ser::Serialize for State {
6880 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6881 where
6882 S: serde::Serializer,
6883 {
6884 match self {
6885 Self::Unspecified => serializer.serialize_i32(0),
6886 Self::Waiting => serializer.serialize_i32(1),
6887 Self::InProgress => serializer.serialize_i32(2),
6888 Self::Done => serializer.serialize_i32(3),
6889 Self::UnknownValue(u) => u.0.serialize(serializer),
6890 }
6891 }
6892 }
6893
6894 impl<'de> serde::de::Deserialize<'de> for State {
6895 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6896 where
6897 D: serde::Deserializer<'de>,
6898 {
6899 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6900 ".google.cloud.hypercomputecluster.v1.OperationStep.State",
6901 ))
6902 }
6903 }
6904
6905 /// Step of the operation.
6906 #[derive(Clone, Debug, PartialEq)]
6907 #[non_exhaustive]
6908 pub enum Type {
6909 /// Output only. If set, indicates that new network creation is part of the
6910 /// operation.
6911 CreateNetwork(std::boxed::Box<crate::model::CreateNetwork>),
6912 /// Output only. If set, indicates that new private service access creation
6913 /// is part of the operation.
6914 CreatePrivateServiceAccess(std::boxed::Box<crate::model::CreatePrivateServiceAccess>),
6915 /// Output only. If set, indicates that new Filestore instance creation is
6916 /// part of the operation.
6917 CreateFilestoreInstance(std::boxed::Box<crate::model::CreateFilestoreInstance>),
6918 /// Output only. If set, indicates that new Cloud Storage bucket creation is
6919 /// part of the operation.
6920 CreateStorageBucket(std::boxed::Box<crate::model::CreateStorageBucket>),
6921 /// Output only. If set, indicates that new Lustre instance creation is part
6922 /// of the operation.
6923 CreateLustreInstance(std::boxed::Box<crate::model::CreateLustreInstance>),
6924 /// Output only. If set, indicates that orchestrator creation is part of the
6925 /// operation.
6926 CreateOrchestrator(std::boxed::Box<crate::model::CreateOrchestrator>),
6927 /// Output only. If set, indicates that new nodeset creation is part of the
6928 /// operation.
6929 CreateNodeset(std::boxed::Box<crate::model::CreateNodeset>),
6930 /// Output only. If set, indicates that new partition creation is part of the
6931 /// operation.
6932 CreatePartition(std::boxed::Box<crate::model::CreatePartition>),
6933 /// Output only. If set, indicates that new login node creation is part of
6934 /// the operation.
6935 CreateLoginNode(std::boxed::Box<crate::model::CreateLoginNode>),
6936 /// Output only. If set, indicates that cluster health check is part of the
6937 /// operation.
6938 CheckClusterHealth(std::boxed::Box<crate::model::CheckClusterHealth>),
6939 /// Output only. If set, indicates that an orchestrator update is part of the
6940 /// operation.
6941 UpdateOrchestrator(std::boxed::Box<crate::model::UpdateOrchestrator>),
6942 /// Output only. If set, indicates that nodeset update is part of the
6943 /// operation.
6944 UpdateNodeset(std::boxed::Box<crate::model::UpdateNodeset>),
6945 /// Output only. If set, indicates that partition update is part of the
6946 /// operation.
6947 UpdatePartition(std::boxed::Box<crate::model::UpdatePartition>),
6948 /// Output only. If set, indicates that login node update is part of the
6949 /// operation.
6950 UpdateLoginNode(std::boxed::Box<crate::model::UpdateLoginNode>),
6951 /// Output only. If set, indicates that orchestrator deletion is part of the
6952 /// operation.
6953 DeleteOrchestrator(std::boxed::Box<crate::model::DeleteOrchestrator>),
6954 /// Output only. If set, indicates that nodeset deletion is part of the
6955 /// operation.
6956 DeleteNodeset(std::boxed::Box<crate::model::DeleteNodeset>),
6957 /// Output only. If set, indicates that partition deletion is part of the
6958 /// operation.
6959 DeletePartition(std::boxed::Box<crate::model::DeletePartition>),
6960 /// Output only. If set, indicates that login node deletion is part of the
6961 /// operation.
6962 DeleteLoginNode(std::boxed::Box<crate::model::DeleteLoginNode>),
6963 /// Output only. If set, indicates that Filestore instance deletion is part
6964 /// of the operation.
6965 DeleteFilestoreInstance(std::boxed::Box<crate::model::DeleteFilestoreInstance>),
6966 /// Output only. If set, indicates that Cloud Storage bucket deletion is part
6967 /// of the operation.
6968 DeleteStorageBucket(std::boxed::Box<crate::model::DeleteStorageBucket>),
6969 /// Output only. If set, indicates that Lustre instance deletion is part of
6970 /// the operation.
6971 DeleteLustreInstance(std::boxed::Box<crate::model::DeleteLustreInstance>),
6972 /// Output only. If set, indicates that private service access deletion is
6973 /// part of the operation.
6974 DeletePrivateServiceAccess(std::boxed::Box<crate::model::DeletePrivateServiceAccess>),
6975 /// Output only. If set, indicates that network deletion is part of the
6976 /// operation.
6977 DeleteNetwork(std::boxed::Box<crate::model::DeleteNetwork>),
6978 }
6979}
6980
6981/// When set in OperationStep, indicates that a new network should be created.
6982#[derive(Clone, Default, PartialEq)]
6983#[non_exhaustive]
6984pub struct CreateNetwork {
6985 /// Output only. Name of the network to create, in the format
6986 /// `projects/{project}/global/networks/{network}`.
6987 pub network: std::string::String,
6988
6989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6990}
6991
6992impl CreateNetwork {
6993 /// Creates a new default instance.
6994 pub fn new() -> Self {
6995 std::default::Default::default()
6996 }
6997
6998 /// Sets the value of [network][crate::model::CreateNetwork::network].
6999 ///
7000 /// # Example
7001 /// ```ignore,no_run
7002 /// # use google_cloud_hypercomputecluster_v1::model::CreateNetwork;
7003 /// let x = CreateNetwork::new().set_network("example");
7004 /// ```
7005 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7006 self.network = v.into();
7007 self
7008 }
7009}
7010
7011impl wkt::message::Message for CreateNetwork {
7012 fn typename() -> &'static str {
7013 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateNetwork"
7014 }
7015}
7016
7017/// When set in OperationStep, indicates that a new private service access should
7018/// be created.
7019#[derive(Clone, Default, PartialEq)]
7020#[non_exhaustive]
7021pub struct CreatePrivateServiceAccess {
7022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7023}
7024
7025impl CreatePrivateServiceAccess {
7026 /// Creates a new default instance.
7027 pub fn new() -> Self {
7028 std::default::Default::default()
7029 }
7030}
7031
7032impl wkt::message::Message for CreatePrivateServiceAccess {
7033 fn typename() -> &'static str {
7034 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreatePrivateServiceAccess"
7035 }
7036}
7037
7038/// When set in OperationStep, indicates that a new filestore instance should be
7039/// created.
7040#[derive(Clone, Default, PartialEq)]
7041#[non_exhaustive]
7042pub struct CreateFilestoreInstance {
7043 /// Output only. Name of the Filestore instance, in the format
7044 /// `projects/{project}/locations/{location}/instances/{instance}`
7045 pub filestore: std::string::String,
7046
7047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7048}
7049
7050impl CreateFilestoreInstance {
7051 /// Creates a new default instance.
7052 pub fn new() -> Self {
7053 std::default::Default::default()
7054 }
7055
7056 /// Sets the value of [filestore][crate::model::CreateFilestoreInstance::filestore].
7057 ///
7058 /// # Example
7059 /// ```ignore,no_run
7060 /// # use google_cloud_hypercomputecluster_v1::model::CreateFilestoreInstance;
7061 /// let x = CreateFilestoreInstance::new().set_filestore("example");
7062 /// ```
7063 pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7064 self.filestore = v.into();
7065 self
7066 }
7067}
7068
7069impl wkt::message::Message for CreateFilestoreInstance {
7070 fn typename() -> &'static str {
7071 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateFilestoreInstance"
7072 }
7073}
7074
7075/// When set in OperationStep, indicates that a new storage bucket should be
7076/// created.
7077#[derive(Clone, Default, PartialEq)]
7078#[non_exhaustive]
7079pub struct CreateStorageBucket {
7080 /// Output only. Name of the bucket.
7081 pub bucket: std::string::String,
7082
7083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7084}
7085
7086impl CreateStorageBucket {
7087 /// Creates a new default instance.
7088 pub fn new() -> Self {
7089 std::default::Default::default()
7090 }
7091
7092 /// Sets the value of [bucket][crate::model::CreateStorageBucket::bucket].
7093 ///
7094 /// # Example
7095 /// ```ignore,no_run
7096 /// # use google_cloud_hypercomputecluster_v1::model::CreateStorageBucket;
7097 /// let x = CreateStorageBucket::new().set_bucket("example");
7098 /// ```
7099 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7100 self.bucket = v.into();
7101 self
7102 }
7103}
7104
7105impl wkt::message::Message for CreateStorageBucket {
7106 fn typename() -> &'static str {
7107 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateStorageBucket"
7108 }
7109}
7110
7111/// When set in OperationStep, indicates that a new lustre instance should be
7112/// created.
7113#[derive(Clone, Default, PartialEq)]
7114#[non_exhaustive]
7115pub struct CreateLustreInstance {
7116 /// Output only. Name of the Managed Lustre instance, in the format
7117 /// `projects/{project}/locations/{location}/instances/{instance}`
7118 pub lustre: std::string::String,
7119
7120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7121}
7122
7123impl CreateLustreInstance {
7124 /// Creates a new default instance.
7125 pub fn new() -> Self {
7126 std::default::Default::default()
7127 }
7128
7129 /// Sets the value of [lustre][crate::model::CreateLustreInstance::lustre].
7130 ///
7131 /// # Example
7132 /// ```ignore,no_run
7133 /// # use google_cloud_hypercomputecluster_v1::model::CreateLustreInstance;
7134 /// let x = CreateLustreInstance::new().set_lustre("example");
7135 /// ```
7136 pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7137 self.lustre = v.into();
7138 self
7139 }
7140}
7141
7142impl wkt::message::Message for CreateLustreInstance {
7143 fn typename() -> &'static str {
7144 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateLustreInstance"
7145 }
7146}
7147
7148/// When set in OperationStep, indicates that an orchestrator should be created.
7149#[derive(Clone, Default, PartialEq)]
7150#[non_exhaustive]
7151pub struct CreateOrchestrator {
7152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7153}
7154
7155impl CreateOrchestrator {
7156 /// Creates a new default instance.
7157 pub fn new() -> Self {
7158 std::default::Default::default()
7159 }
7160}
7161
7162impl wkt::message::Message for CreateOrchestrator {
7163 fn typename() -> &'static str {
7164 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateOrchestrator"
7165 }
7166}
7167
7168/// When set in OperationStep, indicates that a nodeset should be created.
7169#[derive(Clone, Default, PartialEq)]
7170#[non_exhaustive]
7171pub struct CreateNodeset {
7172 /// Output only. Name of the nodeset to create
7173 pub nodesets: std::vec::Vec<std::string::String>,
7174
7175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7176}
7177
7178impl CreateNodeset {
7179 /// Creates a new default instance.
7180 pub fn new() -> Self {
7181 std::default::Default::default()
7182 }
7183
7184 /// Sets the value of [nodesets][crate::model::CreateNodeset::nodesets].
7185 ///
7186 /// # Example
7187 /// ```ignore,no_run
7188 /// # use google_cloud_hypercomputecluster_v1::model::CreateNodeset;
7189 /// let x = CreateNodeset::new().set_nodesets(["a", "b", "c"]);
7190 /// ```
7191 pub fn set_nodesets<T, V>(mut self, v: T) -> Self
7192 where
7193 T: std::iter::IntoIterator<Item = V>,
7194 V: std::convert::Into<std::string::String>,
7195 {
7196 use std::iter::Iterator;
7197 self.nodesets = v.into_iter().map(|i| i.into()).collect();
7198 self
7199 }
7200}
7201
7202impl wkt::message::Message for CreateNodeset {
7203 fn typename() -> &'static str {
7204 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateNodeset"
7205 }
7206}
7207
7208/// When set in OperationStep, indicates that a partition should be created.
7209#[derive(Clone, Default, PartialEq)]
7210#[non_exhaustive]
7211pub struct CreatePartition {
7212 /// Output only. Name of the partition to create
7213 pub partitions: std::vec::Vec<std::string::String>,
7214
7215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7216}
7217
7218impl CreatePartition {
7219 /// Creates a new default instance.
7220 pub fn new() -> Self {
7221 std::default::Default::default()
7222 }
7223
7224 /// Sets the value of [partitions][crate::model::CreatePartition::partitions].
7225 ///
7226 /// # Example
7227 /// ```ignore,no_run
7228 /// # use google_cloud_hypercomputecluster_v1::model::CreatePartition;
7229 /// let x = CreatePartition::new().set_partitions(["a", "b", "c"]);
7230 /// ```
7231 pub fn set_partitions<T, V>(mut self, v: T) -> Self
7232 where
7233 T: std::iter::IntoIterator<Item = V>,
7234 V: std::convert::Into<std::string::String>,
7235 {
7236 use std::iter::Iterator;
7237 self.partitions = v.into_iter().map(|i| i.into()).collect();
7238 self
7239 }
7240}
7241
7242impl wkt::message::Message for CreatePartition {
7243 fn typename() -> &'static str {
7244 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreatePartition"
7245 }
7246}
7247
7248/// When set in OperationStep, indicates that a login node should be created.
7249#[derive(Clone, Default, PartialEq)]
7250#[non_exhaustive]
7251pub struct CreateLoginNode {
7252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7253}
7254
7255impl CreateLoginNode {
7256 /// Creates a new default instance.
7257 pub fn new() -> Self {
7258 std::default::Default::default()
7259 }
7260}
7261
7262impl wkt::message::Message for CreateLoginNode {
7263 fn typename() -> &'static str {
7264 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CreateLoginNode"
7265 }
7266}
7267
7268/// When set in OperationStep, indicates that cluster health check should be
7269/// performed.
7270#[derive(Clone, Default, PartialEq)]
7271#[non_exhaustive]
7272pub struct CheckClusterHealth {
7273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7274}
7275
7276impl CheckClusterHealth {
7277 /// Creates a new default instance.
7278 pub fn new() -> Self {
7279 std::default::Default::default()
7280 }
7281}
7282
7283impl wkt::message::Message for CheckClusterHealth {
7284 fn typename() -> &'static str {
7285 "type.googleapis.com/google.cloud.hypercomputecluster.v1.CheckClusterHealth"
7286 }
7287}
7288
7289/// When set in OperationStep, indicates that an orchestrator should be updated.
7290#[derive(Clone, Default, PartialEq)]
7291#[non_exhaustive]
7292pub struct UpdateOrchestrator {
7293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7294}
7295
7296impl UpdateOrchestrator {
7297 /// Creates a new default instance.
7298 pub fn new() -> Self {
7299 std::default::Default::default()
7300 }
7301}
7302
7303impl wkt::message::Message for UpdateOrchestrator {
7304 fn typename() -> &'static str {
7305 "type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateOrchestrator"
7306 }
7307}
7308
7309/// When set in OperationStep, indicates that a nodeset should be updated.
7310#[derive(Clone, Default, PartialEq)]
7311#[non_exhaustive]
7312pub struct UpdateNodeset {
7313 /// Output only. Name of the nodeset to update
7314 pub nodesets: std::vec::Vec<std::string::String>,
7315
7316 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7317}
7318
7319impl UpdateNodeset {
7320 /// Creates a new default instance.
7321 pub fn new() -> Self {
7322 std::default::Default::default()
7323 }
7324
7325 /// Sets the value of [nodesets][crate::model::UpdateNodeset::nodesets].
7326 ///
7327 /// # Example
7328 /// ```ignore,no_run
7329 /// # use google_cloud_hypercomputecluster_v1::model::UpdateNodeset;
7330 /// let x = UpdateNodeset::new().set_nodesets(["a", "b", "c"]);
7331 /// ```
7332 pub fn set_nodesets<T, V>(mut self, v: T) -> Self
7333 where
7334 T: std::iter::IntoIterator<Item = V>,
7335 V: std::convert::Into<std::string::String>,
7336 {
7337 use std::iter::Iterator;
7338 self.nodesets = v.into_iter().map(|i| i.into()).collect();
7339 self
7340 }
7341}
7342
7343impl wkt::message::Message for UpdateNodeset {
7344 fn typename() -> &'static str {
7345 "type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateNodeset"
7346 }
7347}
7348
7349/// When set in OperationStep, indicates that a partition should be updated.
7350#[derive(Clone, Default, PartialEq)]
7351#[non_exhaustive]
7352pub struct UpdatePartition {
7353 /// Output only. Name of the partition to update
7354 pub partitions: std::vec::Vec<std::string::String>,
7355
7356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7357}
7358
7359impl UpdatePartition {
7360 /// Creates a new default instance.
7361 pub fn new() -> Self {
7362 std::default::Default::default()
7363 }
7364
7365 /// Sets the value of [partitions][crate::model::UpdatePartition::partitions].
7366 ///
7367 /// # Example
7368 /// ```ignore,no_run
7369 /// # use google_cloud_hypercomputecluster_v1::model::UpdatePartition;
7370 /// let x = UpdatePartition::new().set_partitions(["a", "b", "c"]);
7371 /// ```
7372 pub fn set_partitions<T, V>(mut self, v: T) -> Self
7373 where
7374 T: std::iter::IntoIterator<Item = V>,
7375 V: std::convert::Into<std::string::String>,
7376 {
7377 use std::iter::Iterator;
7378 self.partitions = v.into_iter().map(|i| i.into()).collect();
7379 self
7380 }
7381}
7382
7383impl wkt::message::Message for UpdatePartition {
7384 fn typename() -> &'static str {
7385 "type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdatePartition"
7386 }
7387}
7388
7389/// When set in OperationStep, indicates that a login node should be updated.
7390#[derive(Clone, Default, PartialEq)]
7391#[non_exhaustive]
7392pub struct UpdateLoginNode {
7393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7394}
7395
7396impl UpdateLoginNode {
7397 /// Creates a new default instance.
7398 pub fn new() -> Self {
7399 std::default::Default::default()
7400 }
7401}
7402
7403impl wkt::message::Message for UpdateLoginNode {
7404 fn typename() -> &'static str {
7405 "type.googleapis.com/google.cloud.hypercomputecluster.v1.UpdateLoginNode"
7406 }
7407}
7408
7409/// When set in OperationStep, indicates that an orchestrator should be deleted.
7410#[derive(Clone, Default, PartialEq)]
7411#[non_exhaustive]
7412pub struct DeleteOrchestrator {
7413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7414}
7415
7416impl DeleteOrchestrator {
7417 /// Creates a new default instance.
7418 pub fn new() -> Self {
7419 std::default::Default::default()
7420 }
7421}
7422
7423impl wkt::message::Message for DeleteOrchestrator {
7424 fn typename() -> &'static str {
7425 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteOrchestrator"
7426 }
7427}
7428
7429/// When set in OperationStep, indicates that a nodeset should be deleted.
7430#[derive(Clone, Default, PartialEq)]
7431#[non_exhaustive]
7432pub struct DeleteNodeset {
7433 /// Output only. Name of the nodeset to delete
7434 pub nodesets: std::vec::Vec<std::string::String>,
7435
7436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7437}
7438
7439impl DeleteNodeset {
7440 /// Creates a new default instance.
7441 pub fn new() -> Self {
7442 std::default::Default::default()
7443 }
7444
7445 /// Sets the value of [nodesets][crate::model::DeleteNodeset::nodesets].
7446 ///
7447 /// # Example
7448 /// ```ignore,no_run
7449 /// # use google_cloud_hypercomputecluster_v1::model::DeleteNodeset;
7450 /// let x = DeleteNodeset::new().set_nodesets(["a", "b", "c"]);
7451 /// ```
7452 pub fn set_nodesets<T, V>(mut self, v: T) -> Self
7453 where
7454 T: std::iter::IntoIterator<Item = V>,
7455 V: std::convert::Into<std::string::String>,
7456 {
7457 use std::iter::Iterator;
7458 self.nodesets = v.into_iter().map(|i| i.into()).collect();
7459 self
7460 }
7461}
7462
7463impl wkt::message::Message for DeleteNodeset {
7464 fn typename() -> &'static str {
7465 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteNodeset"
7466 }
7467}
7468
7469/// When set in OperationStep, indicates that a partition should be deleted.
7470#[derive(Clone, Default, PartialEq)]
7471#[non_exhaustive]
7472pub struct DeletePartition {
7473 /// Output only. Name of the partition to delete
7474 pub partitions: std::vec::Vec<std::string::String>,
7475
7476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7477}
7478
7479impl DeletePartition {
7480 /// Creates a new default instance.
7481 pub fn new() -> Self {
7482 std::default::Default::default()
7483 }
7484
7485 /// Sets the value of [partitions][crate::model::DeletePartition::partitions].
7486 ///
7487 /// # Example
7488 /// ```ignore,no_run
7489 /// # use google_cloud_hypercomputecluster_v1::model::DeletePartition;
7490 /// let x = DeletePartition::new().set_partitions(["a", "b", "c"]);
7491 /// ```
7492 pub fn set_partitions<T, V>(mut self, v: T) -> Self
7493 where
7494 T: std::iter::IntoIterator<Item = V>,
7495 V: std::convert::Into<std::string::String>,
7496 {
7497 use std::iter::Iterator;
7498 self.partitions = v.into_iter().map(|i| i.into()).collect();
7499 self
7500 }
7501}
7502
7503impl wkt::message::Message for DeletePartition {
7504 fn typename() -> &'static str {
7505 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeletePartition"
7506 }
7507}
7508
7509/// When set in OperationStep, indicates that a login node should be deleted.
7510#[derive(Clone, Default, PartialEq)]
7511#[non_exhaustive]
7512pub struct DeleteLoginNode {
7513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7514}
7515
7516impl DeleteLoginNode {
7517 /// Creates a new default instance.
7518 pub fn new() -> Self {
7519 std::default::Default::default()
7520 }
7521}
7522
7523impl wkt::message::Message for DeleteLoginNode {
7524 fn typename() -> &'static str {
7525 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteLoginNode"
7526 }
7527}
7528
7529/// When set in OperationStep, indicates that a Filestore instance should be
7530/// deleted.
7531#[derive(Clone, Default, PartialEq)]
7532#[non_exhaustive]
7533pub struct DeleteFilestoreInstance {
7534 /// Output only. Name of the Filestore instance, in the format
7535 /// `projects/{project}/locations/{location}/instances/{instance}`
7536 pub filestore: std::string::String,
7537
7538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7539}
7540
7541impl DeleteFilestoreInstance {
7542 /// Creates a new default instance.
7543 pub fn new() -> Self {
7544 std::default::Default::default()
7545 }
7546
7547 /// Sets the value of [filestore][crate::model::DeleteFilestoreInstance::filestore].
7548 ///
7549 /// # Example
7550 /// ```ignore,no_run
7551 /// # use google_cloud_hypercomputecluster_v1::model::DeleteFilestoreInstance;
7552 /// let x = DeleteFilestoreInstance::new().set_filestore("example");
7553 /// ```
7554 pub fn set_filestore<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7555 self.filestore = v.into();
7556 self
7557 }
7558}
7559
7560impl wkt::message::Message for DeleteFilestoreInstance {
7561 fn typename() -> &'static str {
7562 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteFilestoreInstance"
7563 }
7564}
7565
7566/// When set in OperationStep, indicates that Cloud Storage bucket should be
7567/// deleted.
7568#[derive(Clone, Default, PartialEq)]
7569#[non_exhaustive]
7570pub struct DeleteStorageBucket {
7571 /// Output only. Name of the bucket.
7572 pub bucket: std::string::String,
7573
7574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7575}
7576
7577impl DeleteStorageBucket {
7578 /// Creates a new default instance.
7579 pub fn new() -> Self {
7580 std::default::Default::default()
7581 }
7582
7583 /// Sets the value of [bucket][crate::model::DeleteStorageBucket::bucket].
7584 ///
7585 /// # Example
7586 /// ```ignore,no_run
7587 /// # use google_cloud_hypercomputecluster_v1::model::DeleteStorageBucket;
7588 /// let x = DeleteStorageBucket::new().set_bucket("example");
7589 /// ```
7590 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7591 self.bucket = v.into();
7592 self
7593 }
7594}
7595
7596impl wkt::message::Message for DeleteStorageBucket {
7597 fn typename() -> &'static str {
7598 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteStorageBucket"
7599 }
7600}
7601
7602/// When set in OperationStep, indicates that a Lustre instance should be
7603/// deleted.
7604#[derive(Clone, Default, PartialEq)]
7605#[non_exhaustive]
7606pub struct DeleteLustreInstance {
7607 /// Output only. Name of the Managed Lustre instance, in the format
7608 /// `projects/{project}/locations/{location}/instances/{instance}`
7609 pub lustre: std::string::String,
7610
7611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7612}
7613
7614impl DeleteLustreInstance {
7615 /// Creates a new default instance.
7616 pub fn new() -> Self {
7617 std::default::Default::default()
7618 }
7619
7620 /// Sets the value of [lustre][crate::model::DeleteLustreInstance::lustre].
7621 ///
7622 /// # Example
7623 /// ```ignore,no_run
7624 /// # use google_cloud_hypercomputecluster_v1::model::DeleteLustreInstance;
7625 /// let x = DeleteLustreInstance::new().set_lustre("example");
7626 /// ```
7627 pub fn set_lustre<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7628 self.lustre = v.into();
7629 self
7630 }
7631}
7632
7633impl wkt::message::Message for DeleteLustreInstance {
7634 fn typename() -> &'static str {
7635 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteLustreInstance"
7636 }
7637}
7638
7639/// When set in OperationStep, indicates private service access deletion
7640/// step.
7641#[derive(Clone, Default, PartialEq)]
7642#[non_exhaustive]
7643pub struct DeletePrivateServiceAccess {
7644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7645}
7646
7647impl DeletePrivateServiceAccess {
7648 /// Creates a new default instance.
7649 pub fn new() -> Self {
7650 std::default::Default::default()
7651 }
7652}
7653
7654impl wkt::message::Message for DeletePrivateServiceAccess {
7655 fn typename() -> &'static str {
7656 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeletePrivateServiceAccess"
7657 }
7658}
7659
7660/// When set in OperationStep, indicates network deletion step with the
7661/// resource name.
7662#[derive(Clone, Default, PartialEq)]
7663#[non_exhaustive]
7664pub struct DeleteNetwork {
7665 /// Output only. Name of the network to delete, in the format
7666 /// `projects/{project}/global/networks/{network}`.
7667 pub network: std::string::String,
7668
7669 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7670}
7671
7672impl DeleteNetwork {
7673 /// Creates a new default instance.
7674 pub fn new() -> Self {
7675 std::default::Default::default()
7676 }
7677
7678 /// Sets the value of [network][crate::model::DeleteNetwork::network].
7679 ///
7680 /// # Example
7681 /// ```ignore,no_run
7682 /// # use google_cloud_hypercomputecluster_v1::model::DeleteNetwork;
7683 /// let x = DeleteNetwork::new().set_network("example");
7684 /// ```
7685 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7686 self.network = v.into();
7687 self
7688 }
7689}
7690
7691impl wkt::message::Message for DeleteNetwork {
7692 fn typename() -> &'static str {
7693 "type.googleapis.com/google.cloud.hypercomputecluster.v1.DeleteNetwork"
7694 }
7695}