google_cloud_parallelstore_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate lazy_static;
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 Parallelstore instance.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct Instance {
44 /// Identifier. The resource name of the instance, in the format
45 /// `projects/{project}/locations/{location}/instances/{instance_id}`.
46 pub name: std::string::String,
47
48 /// Optional. The description of the instance. 2048 characters or less.
49 pub description: std::string::String,
50
51 /// Output only. The instance state.
52 pub state: crate::model::instance::State,
53
54 /// Output only. The time when the instance was created.
55 pub create_time: std::option::Option<wkt::Timestamp>,
56
57 /// Output only. The time when the instance was updated.
58 pub update_time: std::option::Option<wkt::Timestamp>,
59
60 /// Optional. Cloud Labels are a flexible and lightweight mechanism for
61 /// organizing cloud resources into groups that reflect a customer's
62 /// organizational needs and deployment strategies. See
63 /// <https://cloud.google.com/resource-manager/docs/labels-overview> for details.
64 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
65
66 /// Required. Immutable. The instance's storage capacity in Gibibytes (GiB).
67 /// Allowed values are between 12000 and 100000, in multiples of 4000; e.g.,
68 /// 12000, 16000, 20000, ...
69 pub capacity_gib: i64,
70
71 /// Output only. Deprecated: The version of DAOS software running in the
72 /// instance.
73 #[deprecated]
74 pub daos_version: std::string::String,
75
76 /// Output only. A list of IPv4 addresses used for client side configuration.
77 pub access_points: std::vec::Vec<std::string::String>,
78
79 /// Optional. Immutable. The name of the Compute Engine
80 /// [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
81 /// instance is connected.
82 pub network: std::string::String,
83
84 /// Optional. Immutable. The ID of the IP address range being used by the
85 /// instance's VPC network. See [Configure a VPC
86 /// network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc).
87 /// If no ID is provided, all ranges are considered.
88 pub reserved_ip_range: std::string::String,
89
90 /// Output only. Immutable. The ID of the IP address range being used by the
91 /// instance's VPC network. This field is populated by the service and contains
92 /// the value currently used by the service.
93 pub effective_reserved_ip_range: std::string::String,
94
95 /// Optional. Immutable. Stripe level for files. Allowed values are:
96 ///
97 /// * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size
98 /// files.
99 /// * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads
100 /// involving a mix of small and large files.
101 /// * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files.
102 pub file_stripe_level: crate::model::FileStripeLevel,
103
104 /// Optional. Immutable. Stripe level for directories. Allowed values are:
105 ///
106 /// * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a
107 /// small number of files.
108 /// * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads
109 /// involving a mix of small and large directories.
110 /// * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large
111 /// number of files.
112 pub directory_stripe_level: crate::model::DirectoryStripeLevel,
113
114 /// Optional. Immutable. The deployment type of the instance. Allowed values
115 /// are:
116 ///
117 /// * `SCRATCH`: the instance is a scratch instance.
118 /// * `PERSISTENT`: the instance is a persistent instance.
119 pub deployment_type: crate::model::DeploymentType,
120
121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
122}
123
124impl Instance {
125 pub fn new() -> Self {
126 std::default::Default::default()
127 }
128
129 /// Sets the value of [name][crate::model::Instance::name].
130 ///
131 /// # Example
132 /// ```ignore,no_run
133 /// # use google_cloud_parallelstore_v1::model::Instance;
134 /// let x = Instance::new().set_name("example");
135 /// ```
136 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
137 self.name = v.into();
138 self
139 }
140
141 /// Sets the value of [description][crate::model::Instance::description].
142 ///
143 /// # Example
144 /// ```ignore,no_run
145 /// # use google_cloud_parallelstore_v1::model::Instance;
146 /// let x = Instance::new().set_description("example");
147 /// ```
148 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
149 self.description = v.into();
150 self
151 }
152
153 /// Sets the value of [state][crate::model::Instance::state].
154 ///
155 /// # Example
156 /// ```ignore,no_run
157 /// # use google_cloud_parallelstore_v1::model::Instance;
158 /// use google_cloud_parallelstore_v1::model::instance::State;
159 /// let x0 = Instance::new().set_state(State::Creating);
160 /// let x1 = Instance::new().set_state(State::Active);
161 /// let x2 = Instance::new().set_state(State::Deleting);
162 /// ```
163 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
164 self.state = v.into();
165 self
166 }
167
168 /// Sets the value of [create_time][crate::model::Instance::create_time].
169 ///
170 /// # Example
171 /// ```ignore,no_run
172 /// # use google_cloud_parallelstore_v1::model::Instance;
173 /// use wkt::Timestamp;
174 /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
175 /// ```
176 pub fn set_create_time<T>(mut self, v: T) -> Self
177 where
178 T: std::convert::Into<wkt::Timestamp>,
179 {
180 self.create_time = std::option::Option::Some(v.into());
181 self
182 }
183
184 /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_parallelstore_v1::model::Instance;
189 /// use wkt::Timestamp;
190 /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
191 /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
192 /// ```
193 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
194 where
195 T: std::convert::Into<wkt::Timestamp>,
196 {
197 self.create_time = v.map(|x| x.into());
198 self
199 }
200
201 /// Sets the value of [update_time][crate::model::Instance::update_time].
202 ///
203 /// # Example
204 /// ```ignore,no_run
205 /// # use google_cloud_parallelstore_v1::model::Instance;
206 /// use wkt::Timestamp;
207 /// let x = Instance::new().set_update_time(Timestamp::default()/* use setters */);
208 /// ```
209 pub fn set_update_time<T>(mut self, v: T) -> Self
210 where
211 T: std::convert::Into<wkt::Timestamp>,
212 {
213 self.update_time = std::option::Option::Some(v.into());
214 self
215 }
216
217 /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
218 ///
219 /// # Example
220 /// ```ignore,no_run
221 /// # use google_cloud_parallelstore_v1::model::Instance;
222 /// use wkt::Timestamp;
223 /// let x = Instance::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
224 /// let x = Instance::new().set_or_clear_update_time(None::<Timestamp>);
225 /// ```
226 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
227 where
228 T: std::convert::Into<wkt::Timestamp>,
229 {
230 self.update_time = v.map(|x| x.into());
231 self
232 }
233
234 /// Sets the value of [labels][crate::model::Instance::labels].
235 ///
236 /// # Example
237 /// ```ignore,no_run
238 /// # use google_cloud_parallelstore_v1::model::Instance;
239 /// let x = Instance::new().set_labels([
240 /// ("key0", "abc"),
241 /// ("key1", "xyz"),
242 /// ]);
243 /// ```
244 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
245 where
246 T: std::iter::IntoIterator<Item = (K, V)>,
247 K: std::convert::Into<std::string::String>,
248 V: std::convert::Into<std::string::String>,
249 {
250 use std::iter::Iterator;
251 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
252 self
253 }
254
255 /// Sets the value of [capacity_gib][crate::model::Instance::capacity_gib].
256 ///
257 /// # Example
258 /// ```ignore,no_run
259 /// # use google_cloud_parallelstore_v1::model::Instance;
260 /// let x = Instance::new().set_capacity_gib(42);
261 /// ```
262 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
263 self.capacity_gib = v.into();
264 self
265 }
266
267 /// Sets the value of [daos_version][crate::model::Instance::daos_version].
268 ///
269 /// # Example
270 /// ```ignore,no_run
271 /// # use google_cloud_parallelstore_v1::model::Instance;
272 /// let x = Instance::new().set_daos_version("example");
273 /// ```
274 #[deprecated]
275 pub fn set_daos_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
276 self.daos_version = v.into();
277 self
278 }
279
280 /// Sets the value of [access_points][crate::model::Instance::access_points].
281 ///
282 /// # Example
283 /// ```ignore,no_run
284 /// # use google_cloud_parallelstore_v1::model::Instance;
285 /// let x = Instance::new().set_access_points(["a", "b", "c"]);
286 /// ```
287 pub fn set_access_points<T, V>(mut self, v: T) -> Self
288 where
289 T: std::iter::IntoIterator<Item = V>,
290 V: std::convert::Into<std::string::String>,
291 {
292 use std::iter::Iterator;
293 self.access_points = v.into_iter().map(|i| i.into()).collect();
294 self
295 }
296
297 /// Sets the value of [network][crate::model::Instance::network].
298 ///
299 /// # Example
300 /// ```ignore,no_run
301 /// # use google_cloud_parallelstore_v1::model::Instance;
302 /// let x = Instance::new().set_network("example");
303 /// ```
304 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
305 self.network = v.into();
306 self
307 }
308
309 /// Sets the value of [reserved_ip_range][crate::model::Instance::reserved_ip_range].
310 ///
311 /// # Example
312 /// ```ignore,no_run
313 /// # use google_cloud_parallelstore_v1::model::Instance;
314 /// let x = Instance::new().set_reserved_ip_range("example");
315 /// ```
316 pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
317 mut self,
318 v: T,
319 ) -> Self {
320 self.reserved_ip_range = v.into();
321 self
322 }
323
324 /// Sets the value of [effective_reserved_ip_range][crate::model::Instance::effective_reserved_ip_range].
325 ///
326 /// # Example
327 /// ```ignore,no_run
328 /// # use google_cloud_parallelstore_v1::model::Instance;
329 /// let x = Instance::new().set_effective_reserved_ip_range("example");
330 /// ```
331 pub fn set_effective_reserved_ip_range<T: std::convert::Into<std::string::String>>(
332 mut self,
333 v: T,
334 ) -> Self {
335 self.effective_reserved_ip_range = v.into();
336 self
337 }
338
339 /// Sets the value of [file_stripe_level][crate::model::Instance::file_stripe_level].
340 ///
341 /// # Example
342 /// ```ignore,no_run
343 /// # use google_cloud_parallelstore_v1::model::Instance;
344 /// use google_cloud_parallelstore_v1::model::FileStripeLevel;
345 /// let x0 = Instance::new().set_file_stripe_level(FileStripeLevel::Min);
346 /// let x1 = Instance::new().set_file_stripe_level(FileStripeLevel::Balanced);
347 /// let x2 = Instance::new().set_file_stripe_level(FileStripeLevel::Max);
348 /// ```
349 pub fn set_file_stripe_level<T: std::convert::Into<crate::model::FileStripeLevel>>(
350 mut self,
351 v: T,
352 ) -> Self {
353 self.file_stripe_level = v.into();
354 self
355 }
356
357 /// Sets the value of [directory_stripe_level][crate::model::Instance::directory_stripe_level].
358 ///
359 /// # Example
360 /// ```ignore,no_run
361 /// # use google_cloud_parallelstore_v1::model::Instance;
362 /// use google_cloud_parallelstore_v1::model::DirectoryStripeLevel;
363 /// let x0 = Instance::new().set_directory_stripe_level(DirectoryStripeLevel::Min);
364 /// let x1 = Instance::new().set_directory_stripe_level(DirectoryStripeLevel::Balanced);
365 /// let x2 = Instance::new().set_directory_stripe_level(DirectoryStripeLevel::Max);
366 /// ```
367 pub fn set_directory_stripe_level<T: std::convert::Into<crate::model::DirectoryStripeLevel>>(
368 mut self,
369 v: T,
370 ) -> Self {
371 self.directory_stripe_level = v.into();
372 self
373 }
374
375 /// Sets the value of [deployment_type][crate::model::Instance::deployment_type].
376 ///
377 /// # Example
378 /// ```ignore,no_run
379 /// # use google_cloud_parallelstore_v1::model::Instance;
380 /// use google_cloud_parallelstore_v1::model::DeploymentType;
381 /// let x0 = Instance::new().set_deployment_type(DeploymentType::Scratch);
382 /// let x1 = Instance::new().set_deployment_type(DeploymentType::Persistent);
383 /// ```
384 pub fn set_deployment_type<T: std::convert::Into<crate::model::DeploymentType>>(
385 mut self,
386 v: T,
387 ) -> Self {
388 self.deployment_type = v.into();
389 self
390 }
391}
392
393impl wkt::message::Message for Instance {
394 fn typename() -> &'static str {
395 "type.googleapis.com/google.cloud.parallelstore.v1.Instance"
396 }
397}
398
399/// Defines additional types related to [Instance].
400pub mod instance {
401 #[allow(unused_imports)]
402 use super::*;
403
404 /// The possible states of a Parallelstore instance.
405 ///
406 /// # Working with unknown values
407 ///
408 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
409 /// additional enum variants at any time. Adding new variants is not considered
410 /// a breaking change. Applications should write their code in anticipation of:
411 ///
412 /// - New values appearing in future releases of the client library, **and**
413 /// - New values received dynamically, without application changes.
414 ///
415 /// Please consult the [Working with enums] section in the user guide for some
416 /// guidelines.
417 ///
418 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
419 #[derive(Clone, Debug, PartialEq)]
420 #[non_exhaustive]
421 pub enum State {
422 /// Not set.
423 Unspecified,
424 /// The instance is being created.
425 Creating,
426 /// The instance is available for use.
427 Active,
428 /// The instance is being deleted.
429 Deleting,
430 /// The instance is not usable.
431 Failed,
432 /// The instance is being upgraded.
433 Upgrading,
434 /// The instance is being repaired. This should only be used by instances
435 /// using the `PERSISTENT` deployment type.
436 Repairing,
437 /// If set, the enum was initialized with an unknown value.
438 ///
439 /// Applications can examine the value using [State::value] or
440 /// [State::name].
441 UnknownValue(state::UnknownValue),
442 }
443
444 #[doc(hidden)]
445 pub mod state {
446 #[allow(unused_imports)]
447 use super::*;
448 #[derive(Clone, Debug, PartialEq)]
449 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
450 }
451
452 impl State {
453 /// Gets the enum value.
454 ///
455 /// Returns `None` if the enum contains an unknown value deserialized from
456 /// the string representation of enums.
457 pub fn value(&self) -> std::option::Option<i32> {
458 match self {
459 Self::Unspecified => std::option::Option::Some(0),
460 Self::Creating => std::option::Option::Some(1),
461 Self::Active => std::option::Option::Some(2),
462 Self::Deleting => std::option::Option::Some(3),
463 Self::Failed => std::option::Option::Some(4),
464 Self::Upgrading => std::option::Option::Some(5),
465 Self::Repairing => std::option::Option::Some(6),
466 Self::UnknownValue(u) => u.0.value(),
467 }
468 }
469
470 /// Gets the enum value as a string.
471 ///
472 /// Returns `None` if the enum contains an unknown value deserialized from
473 /// the integer representation of enums.
474 pub fn name(&self) -> std::option::Option<&str> {
475 match self {
476 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
477 Self::Creating => std::option::Option::Some("CREATING"),
478 Self::Active => std::option::Option::Some("ACTIVE"),
479 Self::Deleting => std::option::Option::Some("DELETING"),
480 Self::Failed => std::option::Option::Some("FAILED"),
481 Self::Upgrading => std::option::Option::Some("UPGRADING"),
482 Self::Repairing => std::option::Option::Some("REPAIRING"),
483 Self::UnknownValue(u) => u.0.name(),
484 }
485 }
486 }
487
488 impl std::default::Default for State {
489 fn default() -> Self {
490 use std::convert::From;
491 Self::from(0)
492 }
493 }
494
495 impl std::fmt::Display for State {
496 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
497 wkt::internal::display_enum(f, self.name(), self.value())
498 }
499 }
500
501 impl std::convert::From<i32> for State {
502 fn from(value: i32) -> Self {
503 match value {
504 0 => Self::Unspecified,
505 1 => Self::Creating,
506 2 => Self::Active,
507 3 => Self::Deleting,
508 4 => Self::Failed,
509 5 => Self::Upgrading,
510 6 => Self::Repairing,
511 _ => Self::UnknownValue(state::UnknownValue(
512 wkt::internal::UnknownEnumValue::Integer(value),
513 )),
514 }
515 }
516 }
517
518 impl std::convert::From<&str> for State {
519 fn from(value: &str) -> Self {
520 use std::string::ToString;
521 match value {
522 "STATE_UNSPECIFIED" => Self::Unspecified,
523 "CREATING" => Self::Creating,
524 "ACTIVE" => Self::Active,
525 "DELETING" => Self::Deleting,
526 "FAILED" => Self::Failed,
527 "UPGRADING" => Self::Upgrading,
528 "REPAIRING" => Self::Repairing,
529 _ => Self::UnknownValue(state::UnknownValue(
530 wkt::internal::UnknownEnumValue::String(value.to_string()),
531 )),
532 }
533 }
534 }
535
536 impl serde::ser::Serialize for State {
537 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
538 where
539 S: serde::Serializer,
540 {
541 match self {
542 Self::Unspecified => serializer.serialize_i32(0),
543 Self::Creating => serializer.serialize_i32(1),
544 Self::Active => serializer.serialize_i32(2),
545 Self::Deleting => serializer.serialize_i32(3),
546 Self::Failed => serializer.serialize_i32(4),
547 Self::Upgrading => serializer.serialize_i32(5),
548 Self::Repairing => serializer.serialize_i32(6),
549 Self::UnknownValue(u) => u.0.serialize(serializer),
550 }
551 }
552 }
553
554 impl<'de> serde::de::Deserialize<'de> for State {
555 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
556 where
557 D: serde::Deserializer<'de>,
558 {
559 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
560 ".google.cloud.parallelstore.v1.Instance.State",
561 ))
562 }
563 }
564}
565
566/// Transfer metadata options for the instance.
567#[derive(Clone, Default, PartialEq)]
568#[non_exhaustive]
569pub struct TransferMetadataOptions {
570 /// Optional. The UID preservation behavior.
571 pub uid: crate::model::transfer_metadata_options::Uid,
572
573 /// Optional. The GID preservation behavior.
574 pub gid: crate::model::transfer_metadata_options::Gid,
575
576 /// Optional. The mode preservation behavior.
577 pub mode: crate::model::transfer_metadata_options::Mode,
578
579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
580}
581
582impl TransferMetadataOptions {
583 pub fn new() -> Self {
584 std::default::Default::default()
585 }
586
587 /// Sets the value of [uid][crate::model::TransferMetadataOptions::uid].
588 ///
589 /// # Example
590 /// ```ignore,no_run
591 /// # use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
592 /// use google_cloud_parallelstore_v1::model::transfer_metadata_options::Uid;
593 /// let x0 = TransferMetadataOptions::new().set_uid(Uid::Skip);
594 /// let x1 = TransferMetadataOptions::new().set_uid(Uid::NumberPreserve);
595 /// ```
596 pub fn set_uid<T: std::convert::Into<crate::model::transfer_metadata_options::Uid>>(
597 mut self,
598 v: T,
599 ) -> Self {
600 self.uid = v.into();
601 self
602 }
603
604 /// Sets the value of [gid][crate::model::TransferMetadataOptions::gid].
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
609 /// use google_cloud_parallelstore_v1::model::transfer_metadata_options::Gid;
610 /// let x0 = TransferMetadataOptions::new().set_gid(Gid::Skip);
611 /// let x1 = TransferMetadataOptions::new().set_gid(Gid::NumberPreserve);
612 /// ```
613 pub fn set_gid<T: std::convert::Into<crate::model::transfer_metadata_options::Gid>>(
614 mut self,
615 v: T,
616 ) -> Self {
617 self.gid = v.into();
618 self
619 }
620
621 /// Sets the value of [mode][crate::model::TransferMetadataOptions::mode].
622 ///
623 /// # Example
624 /// ```ignore,no_run
625 /// # use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
626 /// use google_cloud_parallelstore_v1::model::transfer_metadata_options::Mode;
627 /// let x0 = TransferMetadataOptions::new().set_mode(Mode::Skip);
628 /// let x1 = TransferMetadataOptions::new().set_mode(Mode::Preserve);
629 /// ```
630 pub fn set_mode<T: std::convert::Into<crate::model::transfer_metadata_options::Mode>>(
631 mut self,
632 v: T,
633 ) -> Self {
634 self.mode = v.into();
635 self
636 }
637}
638
639impl wkt::message::Message for TransferMetadataOptions {
640 fn typename() -> &'static str {
641 "type.googleapis.com/google.cloud.parallelstore.v1.TransferMetadataOptions"
642 }
643}
644
645/// Defines additional types related to [TransferMetadataOptions].
646pub mod transfer_metadata_options {
647 #[allow(unused_imports)]
648 use super::*;
649
650 /// The UID preservation behavior.
651 ///
652 /// # Working with unknown values
653 ///
654 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
655 /// additional enum variants at any time. Adding new variants is not considered
656 /// a breaking change. Applications should write their code in anticipation of:
657 ///
658 /// - New values appearing in future releases of the client library, **and**
659 /// - New values received dynamically, without application changes.
660 ///
661 /// Please consult the [Working with enums] section in the user guide for some
662 /// guidelines.
663 ///
664 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
665 #[derive(Clone, Debug, PartialEq)]
666 #[non_exhaustive]
667 pub enum Uid {
668 /// default is UID_NUMBER_PRESERVE.
669 Unspecified,
670 /// Do not preserve UID during a transfer job.
671 Skip,
672 /// Preserve UID that is in number format during a transfer job.
673 NumberPreserve,
674 /// If set, the enum was initialized with an unknown value.
675 ///
676 /// Applications can examine the value using [Uid::value] or
677 /// [Uid::name].
678 UnknownValue(uid::UnknownValue),
679 }
680
681 #[doc(hidden)]
682 pub mod uid {
683 #[allow(unused_imports)]
684 use super::*;
685 #[derive(Clone, Debug, PartialEq)]
686 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
687 }
688
689 impl Uid {
690 /// Gets the enum value.
691 ///
692 /// Returns `None` if the enum contains an unknown value deserialized from
693 /// the string representation of enums.
694 pub fn value(&self) -> std::option::Option<i32> {
695 match self {
696 Self::Unspecified => std::option::Option::Some(0),
697 Self::Skip => std::option::Option::Some(1),
698 Self::NumberPreserve => std::option::Option::Some(2),
699 Self::UnknownValue(u) => u.0.value(),
700 }
701 }
702
703 /// Gets the enum value as a string.
704 ///
705 /// Returns `None` if the enum contains an unknown value deserialized from
706 /// the integer representation of enums.
707 pub fn name(&self) -> std::option::Option<&str> {
708 match self {
709 Self::Unspecified => std::option::Option::Some("UID_UNSPECIFIED"),
710 Self::Skip => std::option::Option::Some("UID_SKIP"),
711 Self::NumberPreserve => std::option::Option::Some("UID_NUMBER_PRESERVE"),
712 Self::UnknownValue(u) => u.0.name(),
713 }
714 }
715 }
716
717 impl std::default::Default for Uid {
718 fn default() -> Self {
719 use std::convert::From;
720 Self::from(0)
721 }
722 }
723
724 impl std::fmt::Display for Uid {
725 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
726 wkt::internal::display_enum(f, self.name(), self.value())
727 }
728 }
729
730 impl std::convert::From<i32> for Uid {
731 fn from(value: i32) -> Self {
732 match value {
733 0 => Self::Unspecified,
734 1 => Self::Skip,
735 2 => Self::NumberPreserve,
736 _ => Self::UnknownValue(uid::UnknownValue(
737 wkt::internal::UnknownEnumValue::Integer(value),
738 )),
739 }
740 }
741 }
742
743 impl std::convert::From<&str> for Uid {
744 fn from(value: &str) -> Self {
745 use std::string::ToString;
746 match value {
747 "UID_UNSPECIFIED" => Self::Unspecified,
748 "UID_SKIP" => Self::Skip,
749 "UID_NUMBER_PRESERVE" => Self::NumberPreserve,
750 _ => Self::UnknownValue(uid::UnknownValue(
751 wkt::internal::UnknownEnumValue::String(value.to_string()),
752 )),
753 }
754 }
755 }
756
757 impl serde::ser::Serialize for Uid {
758 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
759 where
760 S: serde::Serializer,
761 {
762 match self {
763 Self::Unspecified => serializer.serialize_i32(0),
764 Self::Skip => serializer.serialize_i32(1),
765 Self::NumberPreserve => serializer.serialize_i32(2),
766 Self::UnknownValue(u) => u.0.serialize(serializer),
767 }
768 }
769 }
770
771 impl<'de> serde::de::Deserialize<'de> for Uid {
772 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
773 where
774 D: serde::Deserializer<'de>,
775 {
776 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Uid>::new(
777 ".google.cloud.parallelstore.v1.TransferMetadataOptions.Uid",
778 ))
779 }
780 }
781
782 /// The GID preservation behavior.
783 ///
784 /// # Working with unknown values
785 ///
786 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
787 /// additional enum variants at any time. Adding new variants is not considered
788 /// a breaking change. Applications should write their code in anticipation of:
789 ///
790 /// - New values appearing in future releases of the client library, **and**
791 /// - New values received dynamically, without application changes.
792 ///
793 /// Please consult the [Working with enums] section in the user guide for some
794 /// guidelines.
795 ///
796 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
797 #[derive(Clone, Debug, PartialEq)]
798 #[non_exhaustive]
799 pub enum Gid {
800 /// default is GID_NUMBER_PRESERVE.
801 Unspecified,
802 /// Do not preserve GID during a transfer job.
803 Skip,
804 /// Preserve GID that is in number format during a transfer job.
805 NumberPreserve,
806 /// If set, the enum was initialized with an unknown value.
807 ///
808 /// Applications can examine the value using [Gid::value] or
809 /// [Gid::name].
810 UnknownValue(gid::UnknownValue),
811 }
812
813 #[doc(hidden)]
814 pub mod gid {
815 #[allow(unused_imports)]
816 use super::*;
817 #[derive(Clone, Debug, PartialEq)]
818 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
819 }
820
821 impl Gid {
822 /// Gets the enum value.
823 ///
824 /// Returns `None` if the enum contains an unknown value deserialized from
825 /// the string representation of enums.
826 pub fn value(&self) -> std::option::Option<i32> {
827 match self {
828 Self::Unspecified => std::option::Option::Some(0),
829 Self::Skip => std::option::Option::Some(1),
830 Self::NumberPreserve => std::option::Option::Some(2),
831 Self::UnknownValue(u) => u.0.value(),
832 }
833 }
834
835 /// Gets the enum value as a string.
836 ///
837 /// Returns `None` if the enum contains an unknown value deserialized from
838 /// the integer representation of enums.
839 pub fn name(&self) -> std::option::Option<&str> {
840 match self {
841 Self::Unspecified => std::option::Option::Some("GID_UNSPECIFIED"),
842 Self::Skip => std::option::Option::Some("GID_SKIP"),
843 Self::NumberPreserve => std::option::Option::Some("GID_NUMBER_PRESERVE"),
844 Self::UnknownValue(u) => u.0.name(),
845 }
846 }
847 }
848
849 impl std::default::Default for Gid {
850 fn default() -> Self {
851 use std::convert::From;
852 Self::from(0)
853 }
854 }
855
856 impl std::fmt::Display for Gid {
857 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
858 wkt::internal::display_enum(f, self.name(), self.value())
859 }
860 }
861
862 impl std::convert::From<i32> for Gid {
863 fn from(value: i32) -> Self {
864 match value {
865 0 => Self::Unspecified,
866 1 => Self::Skip,
867 2 => Self::NumberPreserve,
868 _ => Self::UnknownValue(gid::UnknownValue(
869 wkt::internal::UnknownEnumValue::Integer(value),
870 )),
871 }
872 }
873 }
874
875 impl std::convert::From<&str> for Gid {
876 fn from(value: &str) -> Self {
877 use std::string::ToString;
878 match value {
879 "GID_UNSPECIFIED" => Self::Unspecified,
880 "GID_SKIP" => Self::Skip,
881 "GID_NUMBER_PRESERVE" => Self::NumberPreserve,
882 _ => Self::UnknownValue(gid::UnknownValue(
883 wkt::internal::UnknownEnumValue::String(value.to_string()),
884 )),
885 }
886 }
887 }
888
889 impl serde::ser::Serialize for Gid {
890 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
891 where
892 S: serde::Serializer,
893 {
894 match self {
895 Self::Unspecified => serializer.serialize_i32(0),
896 Self::Skip => serializer.serialize_i32(1),
897 Self::NumberPreserve => serializer.serialize_i32(2),
898 Self::UnknownValue(u) => u.0.serialize(serializer),
899 }
900 }
901 }
902
903 impl<'de> serde::de::Deserialize<'de> for Gid {
904 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
905 where
906 D: serde::Deserializer<'de>,
907 {
908 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Gid>::new(
909 ".google.cloud.parallelstore.v1.TransferMetadataOptions.Gid",
910 ))
911 }
912 }
913
914 /// The mode preservation behavior.
915 ///
916 /// # Working with unknown values
917 ///
918 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
919 /// additional enum variants at any time. Adding new variants is not considered
920 /// a breaking change. Applications should write their code in anticipation of:
921 ///
922 /// - New values appearing in future releases of the client library, **and**
923 /// - New values received dynamically, without application changes.
924 ///
925 /// Please consult the [Working with enums] section in the user guide for some
926 /// guidelines.
927 ///
928 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
929 #[derive(Clone, Debug, PartialEq)]
930 #[non_exhaustive]
931 pub enum Mode {
932 /// default is MODE_PRESERVE.
933 Unspecified,
934 /// Do not preserve mode during a transfer job.
935 Skip,
936 /// Preserve mode during a transfer job.
937 Preserve,
938 /// If set, the enum was initialized with an unknown value.
939 ///
940 /// Applications can examine the value using [Mode::value] or
941 /// [Mode::name].
942 UnknownValue(mode::UnknownValue),
943 }
944
945 #[doc(hidden)]
946 pub mod mode {
947 #[allow(unused_imports)]
948 use super::*;
949 #[derive(Clone, Debug, PartialEq)]
950 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
951 }
952
953 impl Mode {
954 /// Gets the enum value.
955 ///
956 /// Returns `None` if the enum contains an unknown value deserialized from
957 /// the string representation of enums.
958 pub fn value(&self) -> std::option::Option<i32> {
959 match self {
960 Self::Unspecified => std::option::Option::Some(0),
961 Self::Skip => std::option::Option::Some(1),
962 Self::Preserve => std::option::Option::Some(2),
963 Self::UnknownValue(u) => u.0.value(),
964 }
965 }
966
967 /// Gets the enum value as a string.
968 ///
969 /// Returns `None` if the enum contains an unknown value deserialized from
970 /// the integer representation of enums.
971 pub fn name(&self) -> std::option::Option<&str> {
972 match self {
973 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
974 Self::Skip => std::option::Option::Some("MODE_SKIP"),
975 Self::Preserve => std::option::Option::Some("MODE_PRESERVE"),
976 Self::UnknownValue(u) => u.0.name(),
977 }
978 }
979 }
980
981 impl std::default::Default for Mode {
982 fn default() -> Self {
983 use std::convert::From;
984 Self::from(0)
985 }
986 }
987
988 impl std::fmt::Display for Mode {
989 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
990 wkt::internal::display_enum(f, self.name(), self.value())
991 }
992 }
993
994 impl std::convert::From<i32> for Mode {
995 fn from(value: i32) -> Self {
996 match value {
997 0 => Self::Unspecified,
998 1 => Self::Skip,
999 2 => Self::Preserve,
1000 _ => Self::UnknownValue(mode::UnknownValue(
1001 wkt::internal::UnknownEnumValue::Integer(value),
1002 )),
1003 }
1004 }
1005 }
1006
1007 impl std::convert::From<&str> for Mode {
1008 fn from(value: &str) -> Self {
1009 use std::string::ToString;
1010 match value {
1011 "MODE_UNSPECIFIED" => Self::Unspecified,
1012 "MODE_SKIP" => Self::Skip,
1013 "MODE_PRESERVE" => Self::Preserve,
1014 _ => Self::UnknownValue(mode::UnknownValue(
1015 wkt::internal::UnknownEnumValue::String(value.to_string()),
1016 )),
1017 }
1018 }
1019 }
1020
1021 impl serde::ser::Serialize for Mode {
1022 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1023 where
1024 S: serde::Serializer,
1025 {
1026 match self {
1027 Self::Unspecified => serializer.serialize_i32(0),
1028 Self::Skip => serializer.serialize_i32(1),
1029 Self::Preserve => serializer.serialize_i32(2),
1030 Self::UnknownValue(u) => u.0.serialize(serializer),
1031 }
1032 }
1033 }
1034
1035 impl<'de> serde::de::Deserialize<'de> for Mode {
1036 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1037 where
1038 D: serde::Deserializer<'de>,
1039 {
1040 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
1041 ".google.cloud.parallelstore.v1.TransferMetadataOptions.Mode",
1042 ))
1043 }
1044 }
1045}
1046
1047/// List instances request.
1048#[derive(Clone, Default, PartialEq)]
1049#[non_exhaustive]
1050pub struct ListInstancesRequest {
1051 /// Required. The project and location for which to retrieve instance
1052 /// information, in the format `projects/{project_id}/locations/{location}`.
1053 ///
1054 /// To retrieve instance information for all locations, use "-" as the value of
1055 /// `{location}`.
1056 pub parent: std::string::String,
1057
1058 /// Optional. Requested page size. Server may return fewer items than
1059 /// requested. If unspecified, the server will pick an appropriate default.
1060 pub page_size: i32,
1061
1062 /// Optional. A token identifying a page of results the server should return.
1063 pub page_token: std::string::String,
1064
1065 /// Optional. Filtering results.
1066 pub filter: std::string::String,
1067
1068 /// Optional. Hint for how to order the results.
1069 pub order_by: std::string::String,
1070
1071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1072}
1073
1074impl ListInstancesRequest {
1075 pub fn new() -> Self {
1076 std::default::Default::default()
1077 }
1078
1079 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
1080 ///
1081 /// # Example
1082 /// ```ignore,no_run
1083 /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1084 /// let x = ListInstancesRequest::new().set_parent("example");
1085 /// ```
1086 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1087 self.parent = v.into();
1088 self
1089 }
1090
1091 /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
1092 ///
1093 /// # Example
1094 /// ```ignore,no_run
1095 /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1096 /// let x = ListInstancesRequest::new().set_page_size(42);
1097 /// ```
1098 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1099 self.page_size = v.into();
1100 self
1101 }
1102
1103 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
1104 ///
1105 /// # Example
1106 /// ```ignore,no_run
1107 /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1108 /// let x = ListInstancesRequest::new().set_page_token("example");
1109 /// ```
1110 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.page_token = v.into();
1112 self
1113 }
1114
1115 /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
1116 ///
1117 /// # Example
1118 /// ```ignore,no_run
1119 /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1120 /// let x = ListInstancesRequest::new().set_filter("example");
1121 /// ```
1122 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1123 self.filter = v.into();
1124 self
1125 }
1126
1127 /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1132 /// let x = ListInstancesRequest::new().set_order_by("example");
1133 /// ```
1134 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1135 self.order_by = v.into();
1136 self
1137 }
1138}
1139
1140impl wkt::message::Message for ListInstancesRequest {
1141 fn typename() -> &'static str {
1142 "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesRequest"
1143 }
1144}
1145
1146/// Response from
1147/// [ListInstances][google.cloud.parallelstore.v1.Parallelstore.ListInstances].
1148///
1149/// [google.cloud.parallelstore.v1.Parallelstore.ListInstances]: crate::client::Parallelstore::list_instances
1150#[derive(Clone, Default, PartialEq)]
1151#[non_exhaustive]
1152pub struct ListInstancesResponse {
1153 /// The list of Parallelstore instances.
1154 pub instances: std::vec::Vec<crate::model::Instance>,
1155
1156 /// A token identifying a page of results the server should return.
1157 pub next_page_token: std::string::String,
1158
1159 /// Locations that could not be reached.
1160 pub unreachable: std::vec::Vec<std::string::String>,
1161
1162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1163}
1164
1165impl ListInstancesResponse {
1166 pub fn new() -> Self {
1167 std::default::Default::default()
1168 }
1169
1170 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
1171 ///
1172 /// # Example
1173 /// ```ignore,no_run
1174 /// # use google_cloud_parallelstore_v1::model::ListInstancesResponse;
1175 /// use google_cloud_parallelstore_v1::model::Instance;
1176 /// let x = ListInstancesResponse::new()
1177 /// .set_instances([
1178 /// Instance::default()/* use setters */,
1179 /// Instance::default()/* use (different) setters */,
1180 /// ]);
1181 /// ```
1182 pub fn set_instances<T, V>(mut self, v: T) -> Self
1183 where
1184 T: std::iter::IntoIterator<Item = V>,
1185 V: std::convert::Into<crate::model::Instance>,
1186 {
1187 use std::iter::Iterator;
1188 self.instances = v.into_iter().map(|i| i.into()).collect();
1189 self
1190 }
1191
1192 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
1193 ///
1194 /// # Example
1195 /// ```ignore,no_run
1196 /// # use google_cloud_parallelstore_v1::model::ListInstancesResponse;
1197 /// let x = ListInstancesResponse::new().set_next_page_token("example");
1198 /// ```
1199 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1200 self.next_page_token = v.into();
1201 self
1202 }
1203
1204 /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
1205 ///
1206 /// # Example
1207 /// ```ignore,no_run
1208 /// # use google_cloud_parallelstore_v1::model::ListInstancesResponse;
1209 /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
1210 /// ```
1211 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1212 where
1213 T: std::iter::IntoIterator<Item = V>,
1214 V: std::convert::Into<std::string::String>,
1215 {
1216 use std::iter::Iterator;
1217 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1218 self
1219 }
1220}
1221
1222impl wkt::message::Message for ListInstancesResponse {
1223 fn typename() -> &'static str {
1224 "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesResponse"
1225 }
1226}
1227
1228#[doc(hidden)]
1229impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
1230 type PageItem = crate::model::Instance;
1231
1232 fn items(self) -> std::vec::Vec<Self::PageItem> {
1233 self.instances
1234 }
1235
1236 fn next_page_token(&self) -> std::string::String {
1237 use std::clone::Clone;
1238 self.next_page_token.clone()
1239 }
1240}
1241
1242/// Get an instance's details.
1243#[derive(Clone, Default, PartialEq)]
1244#[non_exhaustive]
1245pub struct GetInstanceRequest {
1246 /// Required. The instance resource name, in the format
1247 /// `projects/{project_id}/locations/{location}/instances/{instance_id}`.
1248 pub name: std::string::String,
1249
1250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1251}
1252
1253impl GetInstanceRequest {
1254 pub fn new() -> Self {
1255 std::default::Default::default()
1256 }
1257
1258 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
1259 ///
1260 /// # Example
1261 /// ```ignore,no_run
1262 /// # use google_cloud_parallelstore_v1::model::GetInstanceRequest;
1263 /// let x = GetInstanceRequest::new().set_name("example");
1264 /// ```
1265 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1266 self.name = v.into();
1267 self
1268 }
1269}
1270
1271impl wkt::message::Message for GetInstanceRequest {
1272 fn typename() -> &'static str {
1273 "type.googleapis.com/google.cloud.parallelstore.v1.GetInstanceRequest"
1274 }
1275}
1276
1277/// Create a new Parallelstore instance.
1278#[derive(Clone, Default, PartialEq)]
1279#[non_exhaustive]
1280pub struct CreateInstanceRequest {
1281 /// Required. The instance's project and location, in the format
1282 /// `projects/{project}/locations/{location}`.
1283 /// Locations map to Google Cloud zones; for example, `us-west1-b`.
1284 pub parent: std::string::String,
1285
1286 /// Required. The name of the Parallelstore instance.
1287 ///
1288 /// * Must contain only lowercase letters, numbers, and hyphens.
1289 /// * Must start with a letter.
1290 /// * Must be between 1-63 characters.
1291 /// * Must end with a number or a letter.
1292 /// * Must be unique within the customer project / location
1293 pub instance_id: std::string::String,
1294
1295 /// Required. The instance to create.
1296 pub instance: std::option::Option<crate::model::Instance>,
1297
1298 /// Optional. An optional request ID to identify requests. Specify a unique
1299 /// request ID so that if you must retry your request, the server will know to
1300 /// ignore the request if it has already been completed. The server will
1301 /// guarantee that for at least 60 minutes since the first request.
1302 ///
1303 /// For example, consider a situation where you make an initial request and
1304 /// the request times out. If you make the request again with the same request
1305 /// ID, the server can check if original operation with the same request ID
1306 /// was received, and if so, will ignore the second request. This prevents
1307 /// clients from accidentally creating duplicate commitments.
1308 ///
1309 /// The request ID must be a valid UUID with the exception that zero UUID is
1310 /// not supported (00000000-0000-0000-0000-000000000000).
1311 pub request_id: std::string::String,
1312
1313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1314}
1315
1316impl CreateInstanceRequest {
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1326 /// let x = CreateInstanceRequest::new().set_parent("example");
1327 /// ```
1328 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1329 self.parent = v.into();
1330 self
1331 }
1332
1333 /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
1334 ///
1335 /// # Example
1336 /// ```ignore,no_run
1337 /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1338 /// let x = CreateInstanceRequest::new().set_instance_id("example");
1339 /// ```
1340 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1341 self.instance_id = v.into();
1342 self
1343 }
1344
1345 /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
1346 ///
1347 /// # Example
1348 /// ```ignore,no_run
1349 /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1350 /// use google_cloud_parallelstore_v1::model::Instance;
1351 /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
1352 /// ```
1353 pub fn set_instance<T>(mut self, v: T) -> Self
1354 where
1355 T: std::convert::Into<crate::model::Instance>,
1356 {
1357 self.instance = std::option::Option::Some(v.into());
1358 self
1359 }
1360
1361 /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
1362 ///
1363 /// # Example
1364 /// ```ignore,no_run
1365 /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1366 /// use google_cloud_parallelstore_v1::model::Instance;
1367 /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
1368 /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
1369 /// ```
1370 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1371 where
1372 T: std::convert::Into<crate::model::Instance>,
1373 {
1374 self.instance = v.map(|x| x.into());
1375 self
1376 }
1377
1378 /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
1379 ///
1380 /// # Example
1381 /// ```ignore,no_run
1382 /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1383 /// let x = CreateInstanceRequest::new().set_request_id("example");
1384 /// ```
1385 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1386 self.request_id = v.into();
1387 self
1388 }
1389}
1390
1391impl wkt::message::Message for CreateInstanceRequest {
1392 fn typename() -> &'static str {
1393 "type.googleapis.com/google.cloud.parallelstore.v1.CreateInstanceRequest"
1394 }
1395}
1396
1397/// Update an instance.
1398#[derive(Clone, Default, PartialEq)]
1399#[non_exhaustive]
1400pub struct UpdateInstanceRequest {
1401 /// Required. Mask of fields to update. Field mask is used to specify the
1402 /// fields to be overwritten in the Instance resource by the update. At least
1403 /// one path must be supplied in this field. The fields specified in the
1404 /// update_mask are relative to the resource, not the full request.
1405 pub update_mask: std::option::Option<wkt::FieldMask>,
1406
1407 /// Required. The instance to update.
1408 pub instance: std::option::Option<crate::model::Instance>,
1409
1410 /// Optional. An optional request ID to identify requests. Specify a unique
1411 /// request ID so that if you must retry your request, the server will know to
1412 /// ignore the request if it has already been completed. The server will
1413 /// guarantee that for at least 60 minutes since the first request.
1414 ///
1415 /// For example, consider a situation where you make an initial request and
1416 /// the request times out. If you make the request again with the same request
1417 /// ID, the server can check if original operation with the same request ID
1418 /// was received, and if so, will ignore the second request. This prevents
1419 /// clients from accidentally creating duplicate commitments.
1420 ///
1421 /// The request ID must be a valid UUID with the exception that zero UUID is
1422 /// not supported (00000000-0000-0000-0000-000000000000).
1423 pub request_id: std::string::String,
1424
1425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl UpdateInstanceRequest {
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
1434 ///
1435 /// # Example
1436 /// ```ignore,no_run
1437 /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1438 /// use wkt::FieldMask;
1439 /// let x = UpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1440 /// ```
1441 pub fn set_update_mask<T>(mut self, v: T) -> Self
1442 where
1443 T: std::convert::Into<wkt::FieldMask>,
1444 {
1445 self.update_mask = std::option::Option::Some(v.into());
1446 self
1447 }
1448
1449 /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
1450 ///
1451 /// # Example
1452 /// ```ignore,no_run
1453 /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1454 /// use wkt::FieldMask;
1455 /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1456 /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1457 /// ```
1458 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1459 where
1460 T: std::convert::Into<wkt::FieldMask>,
1461 {
1462 self.update_mask = v.map(|x| x.into());
1463 self
1464 }
1465
1466 /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
1467 ///
1468 /// # Example
1469 /// ```ignore,no_run
1470 /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1471 /// use google_cloud_parallelstore_v1::model::Instance;
1472 /// let x = UpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
1473 /// ```
1474 pub fn set_instance<T>(mut self, v: T) -> Self
1475 where
1476 T: std::convert::Into<crate::model::Instance>,
1477 {
1478 self.instance = std::option::Option::Some(v.into());
1479 self
1480 }
1481
1482 /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
1483 ///
1484 /// # Example
1485 /// ```ignore,no_run
1486 /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1487 /// use google_cloud_parallelstore_v1::model::Instance;
1488 /// let x = UpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
1489 /// let x = UpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
1490 /// ```
1491 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1492 where
1493 T: std::convert::Into<crate::model::Instance>,
1494 {
1495 self.instance = v.map(|x| x.into());
1496 self
1497 }
1498
1499 /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
1500 ///
1501 /// # Example
1502 /// ```ignore,no_run
1503 /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1504 /// let x = UpdateInstanceRequest::new().set_request_id("example");
1505 /// ```
1506 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.request_id = v.into();
1508 self
1509 }
1510}
1511
1512impl wkt::message::Message for UpdateInstanceRequest {
1513 fn typename() -> &'static str {
1514 "type.googleapis.com/google.cloud.parallelstore.v1.UpdateInstanceRequest"
1515 }
1516}
1517
1518/// Delete an instance.
1519#[derive(Clone, Default, PartialEq)]
1520#[non_exhaustive]
1521pub struct DeleteInstanceRequest {
1522 /// Required. Name of the resource
1523 pub name: std::string::String,
1524
1525 /// Optional. An optional request ID to identify requests. Specify a unique
1526 /// request ID so that if you must retry your request, the server will know to
1527 /// ignore the request if it has already been completed. The server will
1528 /// guarantee that for at least 60 minutes after the first request.
1529 ///
1530 /// For example, consider a situation where you make an initial request and
1531 /// the request times out. If you make the request again with the same request
1532 /// ID, the server can check if original operation with the same request ID
1533 /// was received, and if so, will ignore the second request. This prevents
1534 /// clients from accidentally creating duplicate commitments.
1535 ///
1536 /// The request ID must be a valid UUID with the exception that zero UUID is
1537 /// not supported (00000000-0000-0000-0000-000000000000).
1538 pub request_id: std::string::String,
1539
1540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1541}
1542
1543impl DeleteInstanceRequest {
1544 pub fn new() -> Self {
1545 std::default::Default::default()
1546 }
1547
1548 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
1549 ///
1550 /// # Example
1551 /// ```ignore,no_run
1552 /// # use google_cloud_parallelstore_v1::model::DeleteInstanceRequest;
1553 /// let x = DeleteInstanceRequest::new().set_name("example");
1554 /// ```
1555 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1556 self.name = v.into();
1557 self
1558 }
1559
1560 /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
1561 ///
1562 /// # Example
1563 /// ```ignore,no_run
1564 /// # use google_cloud_parallelstore_v1::model::DeleteInstanceRequest;
1565 /// let x = DeleteInstanceRequest::new().set_request_id("example");
1566 /// ```
1567 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.request_id = v.into();
1569 self
1570 }
1571}
1572
1573impl wkt::message::Message for DeleteInstanceRequest {
1574 fn typename() -> &'static str {
1575 "type.googleapis.com/google.cloud.parallelstore.v1.DeleteInstanceRequest"
1576 }
1577}
1578
1579/// Long-running operation metadata.
1580#[derive(Clone, Default, PartialEq)]
1581#[non_exhaustive]
1582pub struct OperationMetadata {
1583 /// Output only. The time the operation was created.
1584 pub create_time: std::option::Option<wkt::Timestamp>,
1585
1586 /// Output only. The time the operation finished running.
1587 pub end_time: std::option::Option<wkt::Timestamp>,
1588
1589 /// Output only. Server-defined resource path for the target of the operation.
1590 pub target: std::string::String,
1591
1592 /// Output only. Name of the verb executed by the operation.
1593 pub verb: std::string::String,
1594
1595 /// Output only. Human-readable status of the operation, if any.
1596 pub status_message: std::string::String,
1597
1598 /// Output only. Identifies whether the user has requested cancellation
1599 /// of the operation. Operations that have been cancelled successfully
1600 /// have [Operation.error][google.longrunning.Operation.error] value with a
1601 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1602 /// `Code.CANCELLED`.
1603 ///
1604 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
1605 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
1606 pub requested_cancellation: bool,
1607
1608 /// Output only. API version used to start the operation.
1609 pub api_version: std::string::String,
1610
1611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1612}
1613
1614impl OperationMetadata {
1615 pub fn new() -> Self {
1616 std::default::Default::default()
1617 }
1618
1619 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1620 ///
1621 /// # Example
1622 /// ```ignore,no_run
1623 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1624 /// use wkt::Timestamp;
1625 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1626 /// ```
1627 pub fn set_create_time<T>(mut self, v: T) -> Self
1628 where
1629 T: std::convert::Into<wkt::Timestamp>,
1630 {
1631 self.create_time = std::option::Option::Some(v.into());
1632 self
1633 }
1634
1635 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1636 ///
1637 /// # Example
1638 /// ```ignore,no_run
1639 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1640 /// use wkt::Timestamp;
1641 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1642 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1643 /// ```
1644 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1645 where
1646 T: std::convert::Into<wkt::Timestamp>,
1647 {
1648 self.create_time = v.map(|x| x.into());
1649 self
1650 }
1651
1652 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1653 ///
1654 /// # Example
1655 /// ```ignore,no_run
1656 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1657 /// use wkt::Timestamp;
1658 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1659 /// ```
1660 pub fn set_end_time<T>(mut self, v: T) -> Self
1661 where
1662 T: std::convert::Into<wkt::Timestamp>,
1663 {
1664 self.end_time = std::option::Option::Some(v.into());
1665 self
1666 }
1667
1668 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1669 ///
1670 /// # Example
1671 /// ```ignore,no_run
1672 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1673 /// use wkt::Timestamp;
1674 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1675 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1676 /// ```
1677 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1678 where
1679 T: std::convert::Into<wkt::Timestamp>,
1680 {
1681 self.end_time = v.map(|x| x.into());
1682 self
1683 }
1684
1685 /// Sets the value of [target][crate::model::OperationMetadata::target].
1686 ///
1687 /// # Example
1688 /// ```ignore,no_run
1689 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1690 /// let x = OperationMetadata::new().set_target("example");
1691 /// ```
1692 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1693 self.target = v.into();
1694 self
1695 }
1696
1697 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1698 ///
1699 /// # Example
1700 /// ```ignore,no_run
1701 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1702 /// let x = OperationMetadata::new().set_verb("example");
1703 /// ```
1704 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1705 self.verb = v.into();
1706 self
1707 }
1708
1709 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1710 ///
1711 /// # Example
1712 /// ```ignore,no_run
1713 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1714 /// let x = OperationMetadata::new().set_status_message("example");
1715 /// ```
1716 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1717 self.status_message = v.into();
1718 self
1719 }
1720
1721 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1722 ///
1723 /// # Example
1724 /// ```ignore,no_run
1725 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1726 /// let x = OperationMetadata::new().set_requested_cancellation(true);
1727 /// ```
1728 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1729 self.requested_cancellation = v.into();
1730 self
1731 }
1732
1733 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1734 ///
1735 /// # Example
1736 /// ```ignore,no_run
1737 /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1738 /// let x = OperationMetadata::new().set_api_version("example");
1739 /// ```
1740 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1741 self.api_version = v.into();
1742 self
1743 }
1744}
1745
1746impl wkt::message::Message for OperationMetadata {
1747 fn typename() -> &'static str {
1748 "type.googleapis.com/google.cloud.parallelstore.v1.OperationMetadata"
1749 }
1750}
1751
1752/// Cloud Storage as the source of a data transfer.
1753#[derive(Clone, Default, PartialEq)]
1754#[non_exhaustive]
1755pub struct SourceGcsBucket {
1756 /// Required. URI to a Cloud Storage bucket in the format:
1757 /// `gs://<bucket_name>/<path_inside_bucket>`. The path inside the bucket is
1758 /// optional.
1759 pub uri: std::string::String,
1760
1761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1762}
1763
1764impl SourceGcsBucket {
1765 pub fn new() -> Self {
1766 std::default::Default::default()
1767 }
1768
1769 /// Sets the value of [uri][crate::model::SourceGcsBucket::uri].
1770 ///
1771 /// # Example
1772 /// ```ignore,no_run
1773 /// # use google_cloud_parallelstore_v1::model::SourceGcsBucket;
1774 /// let x = SourceGcsBucket::new().set_uri("example");
1775 /// ```
1776 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1777 self.uri = v.into();
1778 self
1779 }
1780}
1781
1782impl wkt::message::Message for SourceGcsBucket {
1783 fn typename() -> &'static str {
1784 "type.googleapis.com/google.cloud.parallelstore.v1.SourceGcsBucket"
1785 }
1786}
1787
1788/// Cloud Storage as the destination of a data transfer.
1789#[derive(Clone, Default, PartialEq)]
1790#[non_exhaustive]
1791pub struct DestinationGcsBucket {
1792 /// Required. URI to a Cloud Storage bucket in the format:
1793 /// `gs://<bucket_name>/<path_inside_bucket>`. The path inside the bucket is
1794 /// optional.
1795 pub uri: std::string::String,
1796
1797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1798}
1799
1800impl DestinationGcsBucket {
1801 pub fn new() -> Self {
1802 std::default::Default::default()
1803 }
1804
1805 /// Sets the value of [uri][crate::model::DestinationGcsBucket::uri].
1806 ///
1807 /// # Example
1808 /// ```ignore,no_run
1809 /// # use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
1810 /// let x = DestinationGcsBucket::new().set_uri("example");
1811 /// ```
1812 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1813 self.uri = v.into();
1814 self
1815 }
1816}
1817
1818impl wkt::message::Message for DestinationGcsBucket {
1819 fn typename() -> &'static str {
1820 "type.googleapis.com/google.cloud.parallelstore.v1.DestinationGcsBucket"
1821 }
1822}
1823
1824/// Parallelstore as the source of a data transfer.
1825#[derive(Clone, Default, PartialEq)]
1826#[non_exhaustive]
1827pub struct SourceParallelstore {
1828 /// Optional. Root directory path to the Paralellstore filesystem, starting
1829 /// with `/`. Defaults to `/` if unset.
1830 pub path: std::string::String,
1831
1832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1833}
1834
1835impl SourceParallelstore {
1836 pub fn new() -> Self {
1837 std::default::Default::default()
1838 }
1839
1840 /// Sets the value of [path][crate::model::SourceParallelstore::path].
1841 ///
1842 /// # Example
1843 /// ```ignore,no_run
1844 /// # use google_cloud_parallelstore_v1::model::SourceParallelstore;
1845 /// let x = SourceParallelstore::new().set_path("example");
1846 /// ```
1847 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1848 self.path = v.into();
1849 self
1850 }
1851}
1852
1853impl wkt::message::Message for SourceParallelstore {
1854 fn typename() -> &'static str {
1855 "type.googleapis.com/google.cloud.parallelstore.v1.SourceParallelstore"
1856 }
1857}
1858
1859/// Parallelstore as the destination of a data transfer.
1860#[derive(Clone, Default, PartialEq)]
1861#[non_exhaustive]
1862pub struct DestinationParallelstore {
1863 /// Optional. Root directory path to the Paralellstore filesystem, starting
1864 /// with `/`. Defaults to `/` if unset.
1865 pub path: std::string::String,
1866
1867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1868}
1869
1870impl DestinationParallelstore {
1871 pub fn new() -> Self {
1872 std::default::Default::default()
1873 }
1874
1875 /// Sets the value of [path][crate::model::DestinationParallelstore::path].
1876 ///
1877 /// # Example
1878 /// ```ignore,no_run
1879 /// # use google_cloud_parallelstore_v1::model::DestinationParallelstore;
1880 /// let x = DestinationParallelstore::new().set_path("example");
1881 /// ```
1882 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1883 self.path = v.into();
1884 self
1885 }
1886}
1887
1888impl wkt::message::Message for DestinationParallelstore {
1889 fn typename() -> &'static str {
1890 "type.googleapis.com/google.cloud.parallelstore.v1.DestinationParallelstore"
1891 }
1892}
1893
1894/// Import data from Cloud Storage into a Parallelstore instance.
1895#[derive(Clone, Default, PartialEq)]
1896#[non_exhaustive]
1897pub struct ImportDataRequest {
1898 /// Required. Name of the resource.
1899 pub name: std::string::String,
1900
1901 /// Optional. An optional request ID to identify requests. Specify a unique
1902 /// request ID so that if you must retry your request, the server will know to
1903 /// ignore the request if it has already been completed. The server will
1904 /// guarantee that for at least 60 minutes since the first request.
1905 ///
1906 /// For example, consider a situation where you make an initial request and
1907 /// the request times out. If you make the request again with the same request
1908 /// ID, the server can check if original operation with the same request ID
1909 /// was received, and if so, will ignore the second request. This prevents
1910 /// clients from accidentally creating duplicate commitments.
1911 ///
1912 /// The request ID must be a valid UUID with the exception that zero UUID is
1913 /// not supported (00000000-0000-0000-0000-000000000000).
1914 pub request_id: std::string::String,
1915
1916 /// Optional. User-specified service account credentials to be used when
1917 /// performing the transfer.
1918 ///
1919 /// Use one of the following formats:
1920 ///
1921 /// * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1922 /// * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1923 /// * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1924 ///
1925 /// If unspecified, the Parallelstore service agent is used:
1926 /// `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
1927 pub service_account: std::string::String,
1928
1929 /// Optional. The transfer metadata options for the import data.
1930 pub metadata_options: std::option::Option<crate::model::TransferMetadataOptions>,
1931
1932 /// The source of the data being imported into the Parallelstore instance.
1933 pub source: std::option::Option<crate::model::import_data_request::Source>,
1934
1935 /// The Parallelstore instance into which to import data.
1936 pub destination: std::option::Option<crate::model::import_data_request::Destination>,
1937
1938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1939}
1940
1941impl ImportDataRequest {
1942 pub fn new() -> Self {
1943 std::default::Default::default()
1944 }
1945
1946 /// Sets the value of [name][crate::model::ImportDataRequest::name].
1947 ///
1948 /// # Example
1949 /// ```ignore,no_run
1950 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1951 /// let x = ImportDataRequest::new().set_name("example");
1952 /// ```
1953 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.name = v.into();
1955 self
1956 }
1957
1958 /// Sets the value of [request_id][crate::model::ImportDataRequest::request_id].
1959 ///
1960 /// # Example
1961 /// ```ignore,no_run
1962 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1963 /// let x = ImportDataRequest::new().set_request_id("example");
1964 /// ```
1965 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1966 self.request_id = v.into();
1967 self
1968 }
1969
1970 /// Sets the value of [service_account][crate::model::ImportDataRequest::service_account].
1971 ///
1972 /// # Example
1973 /// ```ignore,no_run
1974 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1975 /// let x = ImportDataRequest::new().set_service_account("example");
1976 /// ```
1977 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1978 self.service_account = v.into();
1979 self
1980 }
1981
1982 /// Sets the value of [metadata_options][crate::model::ImportDataRequest::metadata_options].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1987 /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
1988 /// let x = ImportDataRequest::new().set_metadata_options(TransferMetadataOptions::default()/* use setters */);
1989 /// ```
1990 pub fn set_metadata_options<T>(mut self, v: T) -> Self
1991 where
1992 T: std::convert::Into<crate::model::TransferMetadataOptions>,
1993 {
1994 self.metadata_options = std::option::Option::Some(v.into());
1995 self
1996 }
1997
1998 /// Sets or clears the value of [metadata_options][crate::model::ImportDataRequest::metadata_options].
1999 ///
2000 /// # Example
2001 /// ```ignore,no_run
2002 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2003 /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
2004 /// let x = ImportDataRequest::new().set_or_clear_metadata_options(Some(TransferMetadataOptions::default()/* use setters */));
2005 /// let x = ImportDataRequest::new().set_or_clear_metadata_options(None::<TransferMetadataOptions>);
2006 /// ```
2007 pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
2008 where
2009 T: std::convert::Into<crate::model::TransferMetadataOptions>,
2010 {
2011 self.metadata_options = v.map(|x| x.into());
2012 self
2013 }
2014
2015 /// Sets the value of [source][crate::model::ImportDataRequest::source].
2016 ///
2017 /// Note that all the setters affecting `source` are mutually
2018 /// exclusive.
2019 ///
2020 /// # Example
2021 /// ```ignore,no_run
2022 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2023 /// use google_cloud_parallelstore_v1::model::SourceGcsBucket;
2024 /// let x = ImportDataRequest::new().set_source(Some(
2025 /// google_cloud_parallelstore_v1::model::import_data_request::Source::SourceGcsBucket(SourceGcsBucket::default().into())));
2026 /// ```
2027 pub fn set_source<
2028 T: std::convert::Into<std::option::Option<crate::model::import_data_request::Source>>,
2029 >(
2030 mut self,
2031 v: T,
2032 ) -> Self {
2033 self.source = v.into();
2034 self
2035 }
2036
2037 /// The value of [source][crate::model::ImportDataRequest::source]
2038 /// if it holds a `SourceGcsBucket`, `None` if the field is not set or
2039 /// holds a different branch.
2040 pub fn source_gcs_bucket(
2041 &self,
2042 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
2043 #[allow(unreachable_patterns)]
2044 self.source.as_ref().and_then(|v| match v {
2045 crate::model::import_data_request::Source::SourceGcsBucket(v) => {
2046 std::option::Option::Some(v)
2047 }
2048 _ => std::option::Option::None,
2049 })
2050 }
2051
2052 /// Sets the value of [source][crate::model::ImportDataRequest::source]
2053 /// to hold a `SourceGcsBucket`.
2054 ///
2055 /// Note that all the setters affecting `source` are
2056 /// mutually exclusive.
2057 ///
2058 /// # Example
2059 /// ```ignore,no_run
2060 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2061 /// use google_cloud_parallelstore_v1::model::SourceGcsBucket;
2062 /// let x = ImportDataRequest::new().set_source_gcs_bucket(SourceGcsBucket::default()/* use setters */);
2063 /// assert!(x.source_gcs_bucket().is_some());
2064 /// ```
2065 pub fn set_source_gcs_bucket<
2066 T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
2067 >(
2068 mut self,
2069 v: T,
2070 ) -> Self {
2071 self.source = std::option::Option::Some(
2072 crate::model::import_data_request::Source::SourceGcsBucket(v.into()),
2073 );
2074 self
2075 }
2076
2077 /// Sets the value of [destination][crate::model::ImportDataRequest::destination].
2078 ///
2079 /// Note that all the setters affecting `destination` are mutually
2080 /// exclusive.
2081 ///
2082 /// # Example
2083 /// ```ignore,no_run
2084 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2085 /// use google_cloud_parallelstore_v1::model::DestinationParallelstore;
2086 /// let x = ImportDataRequest::new().set_destination(Some(
2087 /// google_cloud_parallelstore_v1::model::import_data_request::Destination::DestinationParallelstore(DestinationParallelstore::default().into())));
2088 /// ```
2089 pub fn set_destination<
2090 T: std::convert::Into<std::option::Option<crate::model::import_data_request::Destination>>,
2091 >(
2092 mut self,
2093 v: T,
2094 ) -> Self {
2095 self.destination = v.into();
2096 self
2097 }
2098
2099 /// The value of [destination][crate::model::ImportDataRequest::destination]
2100 /// if it holds a `DestinationParallelstore`, `None` if the field is not set or
2101 /// holds a different branch.
2102 pub fn destination_parallelstore(
2103 &self,
2104 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
2105 #[allow(unreachable_patterns)]
2106 self.destination.as_ref().and_then(|v| match v {
2107 crate::model::import_data_request::Destination::DestinationParallelstore(v) => {
2108 std::option::Option::Some(v)
2109 }
2110 _ => std::option::Option::None,
2111 })
2112 }
2113
2114 /// Sets the value of [destination][crate::model::ImportDataRequest::destination]
2115 /// to hold a `DestinationParallelstore`.
2116 ///
2117 /// Note that all the setters affecting `destination` are
2118 /// mutually exclusive.
2119 ///
2120 /// # Example
2121 /// ```ignore,no_run
2122 /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2123 /// use google_cloud_parallelstore_v1::model::DestinationParallelstore;
2124 /// let x = ImportDataRequest::new().set_destination_parallelstore(DestinationParallelstore::default()/* use setters */);
2125 /// assert!(x.destination_parallelstore().is_some());
2126 /// ```
2127 pub fn set_destination_parallelstore<
2128 T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
2129 >(
2130 mut self,
2131 v: T,
2132 ) -> Self {
2133 self.destination = std::option::Option::Some(
2134 crate::model::import_data_request::Destination::DestinationParallelstore(v.into()),
2135 );
2136 self
2137 }
2138}
2139
2140impl wkt::message::Message for ImportDataRequest {
2141 fn typename() -> &'static str {
2142 "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataRequest"
2143 }
2144}
2145
2146/// Defines additional types related to [ImportDataRequest].
2147pub mod import_data_request {
2148 #[allow(unused_imports)]
2149 use super::*;
2150
2151 /// The source of the data being imported into the Parallelstore instance.
2152 #[derive(Clone, Debug, PartialEq)]
2153 #[non_exhaustive]
2154 pub enum Source {
2155 /// The Cloud Storage source bucket and, optionally, path inside the bucket.
2156 SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
2157 }
2158
2159 /// The Parallelstore instance into which to import data.
2160 #[derive(Clone, Debug, PartialEq)]
2161 #[non_exhaustive]
2162 pub enum Destination {
2163 /// Parallelstore destination.
2164 DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
2165 }
2166}
2167
2168/// Export data from Parallelstore to Cloud Storage.
2169#[derive(Clone, Default, PartialEq)]
2170#[non_exhaustive]
2171pub struct ExportDataRequest {
2172 /// Required. Name of the resource.
2173 pub name: std::string::String,
2174
2175 /// Optional. An optional request ID to identify requests. Specify a unique
2176 /// request ID so that if you must retry your request, the server will know to
2177 /// ignore the request if it has already been completed. The server will
2178 /// guarantee that for at least 60 minutes since the first request.
2179 ///
2180 /// For example, consider a situation where you make an initial request and
2181 /// the request times out. If you make the request again with the same request
2182 /// ID, the server can check if original operation with the same request ID
2183 /// was received, and if so, will ignore the second request. This prevents
2184 /// clients from accidentally creating duplicate commitments.
2185 ///
2186 /// The request ID must be a valid UUID with the exception that zero UUID is
2187 /// not supported (00000000-0000-0000-0000-000000000000).
2188 pub request_id: std::string::String,
2189
2190 /// Optional. User-specified Service Account (SA) credentials to be used when
2191 /// performing the transfer.
2192 /// Use one of the following formats:
2193 ///
2194 /// * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
2195 /// * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
2196 /// * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
2197 ///
2198 /// If unspecified, the Parallelstore service agent is used:
2199 /// `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
2200 pub service_account: std::string::String,
2201
2202 /// Optional. The metadata options for the export data.
2203 pub metadata_options: std::option::Option<crate::model::TransferMetadataOptions>,
2204
2205 /// The Parallelstore instance to export from.
2206 pub source: std::option::Option<crate::model::export_data_request::Source>,
2207
2208 /// The Cloud Storage bucket to export to.
2209 pub destination: std::option::Option<crate::model::export_data_request::Destination>,
2210
2211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2212}
2213
2214impl ExportDataRequest {
2215 pub fn new() -> Self {
2216 std::default::Default::default()
2217 }
2218
2219 /// Sets the value of [name][crate::model::ExportDataRequest::name].
2220 ///
2221 /// # Example
2222 /// ```ignore,no_run
2223 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2224 /// let x = ExportDataRequest::new().set_name("example");
2225 /// ```
2226 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2227 self.name = v.into();
2228 self
2229 }
2230
2231 /// Sets the value of [request_id][crate::model::ExportDataRequest::request_id].
2232 ///
2233 /// # Example
2234 /// ```ignore,no_run
2235 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2236 /// let x = ExportDataRequest::new().set_request_id("example");
2237 /// ```
2238 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2239 self.request_id = v.into();
2240 self
2241 }
2242
2243 /// Sets the value of [service_account][crate::model::ExportDataRequest::service_account].
2244 ///
2245 /// # Example
2246 /// ```ignore,no_run
2247 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2248 /// let x = ExportDataRequest::new().set_service_account("example");
2249 /// ```
2250 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2251 self.service_account = v.into();
2252 self
2253 }
2254
2255 /// Sets the value of [metadata_options][crate::model::ExportDataRequest::metadata_options].
2256 ///
2257 /// # Example
2258 /// ```ignore,no_run
2259 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2260 /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
2261 /// let x = ExportDataRequest::new().set_metadata_options(TransferMetadataOptions::default()/* use setters */);
2262 /// ```
2263 pub fn set_metadata_options<T>(mut self, v: T) -> Self
2264 where
2265 T: std::convert::Into<crate::model::TransferMetadataOptions>,
2266 {
2267 self.metadata_options = std::option::Option::Some(v.into());
2268 self
2269 }
2270
2271 /// Sets or clears the value of [metadata_options][crate::model::ExportDataRequest::metadata_options].
2272 ///
2273 /// # Example
2274 /// ```ignore,no_run
2275 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2276 /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
2277 /// let x = ExportDataRequest::new().set_or_clear_metadata_options(Some(TransferMetadataOptions::default()/* use setters */));
2278 /// let x = ExportDataRequest::new().set_or_clear_metadata_options(None::<TransferMetadataOptions>);
2279 /// ```
2280 pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
2281 where
2282 T: std::convert::Into<crate::model::TransferMetadataOptions>,
2283 {
2284 self.metadata_options = v.map(|x| x.into());
2285 self
2286 }
2287
2288 /// Sets the value of [source][crate::model::ExportDataRequest::source].
2289 ///
2290 /// Note that all the setters affecting `source` are mutually
2291 /// exclusive.
2292 ///
2293 /// # Example
2294 /// ```ignore,no_run
2295 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2296 /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
2297 /// let x = ExportDataRequest::new().set_source(Some(
2298 /// google_cloud_parallelstore_v1::model::export_data_request::Source::SourceParallelstore(SourceParallelstore::default().into())));
2299 /// ```
2300 pub fn set_source<
2301 T: std::convert::Into<std::option::Option<crate::model::export_data_request::Source>>,
2302 >(
2303 mut self,
2304 v: T,
2305 ) -> Self {
2306 self.source = v.into();
2307 self
2308 }
2309
2310 /// The value of [source][crate::model::ExportDataRequest::source]
2311 /// if it holds a `SourceParallelstore`, `None` if the field is not set or
2312 /// holds a different branch.
2313 pub fn source_parallelstore(
2314 &self,
2315 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
2316 #[allow(unreachable_patterns)]
2317 self.source.as_ref().and_then(|v| match v {
2318 crate::model::export_data_request::Source::SourceParallelstore(v) => {
2319 std::option::Option::Some(v)
2320 }
2321 _ => std::option::Option::None,
2322 })
2323 }
2324
2325 /// Sets the value of [source][crate::model::ExportDataRequest::source]
2326 /// to hold a `SourceParallelstore`.
2327 ///
2328 /// Note that all the setters affecting `source` are
2329 /// mutually exclusive.
2330 ///
2331 /// # Example
2332 /// ```ignore,no_run
2333 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2334 /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
2335 /// let x = ExportDataRequest::new().set_source_parallelstore(SourceParallelstore::default()/* use setters */);
2336 /// assert!(x.source_parallelstore().is_some());
2337 /// ```
2338 pub fn set_source_parallelstore<
2339 T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
2340 >(
2341 mut self,
2342 v: T,
2343 ) -> Self {
2344 self.source = std::option::Option::Some(
2345 crate::model::export_data_request::Source::SourceParallelstore(v.into()),
2346 );
2347 self
2348 }
2349
2350 /// Sets the value of [destination][crate::model::ExportDataRequest::destination].
2351 ///
2352 /// Note that all the setters affecting `destination` are mutually
2353 /// exclusive.
2354 ///
2355 /// # Example
2356 /// ```ignore,no_run
2357 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2358 /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
2359 /// let x = ExportDataRequest::new().set_destination(Some(
2360 /// google_cloud_parallelstore_v1::model::export_data_request::Destination::DestinationGcsBucket(DestinationGcsBucket::default().into())));
2361 /// ```
2362 pub fn set_destination<
2363 T: std::convert::Into<std::option::Option<crate::model::export_data_request::Destination>>,
2364 >(
2365 mut self,
2366 v: T,
2367 ) -> Self {
2368 self.destination = v.into();
2369 self
2370 }
2371
2372 /// The value of [destination][crate::model::ExportDataRequest::destination]
2373 /// if it holds a `DestinationGcsBucket`, `None` if the field is not set or
2374 /// holds a different branch.
2375 pub fn destination_gcs_bucket(
2376 &self,
2377 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
2378 #[allow(unreachable_patterns)]
2379 self.destination.as_ref().and_then(|v| match v {
2380 crate::model::export_data_request::Destination::DestinationGcsBucket(v) => {
2381 std::option::Option::Some(v)
2382 }
2383 _ => std::option::Option::None,
2384 })
2385 }
2386
2387 /// Sets the value of [destination][crate::model::ExportDataRequest::destination]
2388 /// to hold a `DestinationGcsBucket`.
2389 ///
2390 /// Note that all the setters affecting `destination` are
2391 /// mutually exclusive.
2392 ///
2393 /// # Example
2394 /// ```ignore,no_run
2395 /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2396 /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
2397 /// let x = ExportDataRequest::new().set_destination_gcs_bucket(DestinationGcsBucket::default()/* use setters */);
2398 /// assert!(x.destination_gcs_bucket().is_some());
2399 /// ```
2400 pub fn set_destination_gcs_bucket<
2401 T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
2402 >(
2403 mut self,
2404 v: T,
2405 ) -> Self {
2406 self.destination = std::option::Option::Some(
2407 crate::model::export_data_request::Destination::DestinationGcsBucket(v.into()),
2408 );
2409 self
2410 }
2411}
2412
2413impl wkt::message::Message for ExportDataRequest {
2414 fn typename() -> &'static str {
2415 "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataRequest"
2416 }
2417}
2418
2419/// Defines additional types related to [ExportDataRequest].
2420pub mod export_data_request {
2421 #[allow(unused_imports)]
2422 use super::*;
2423
2424 /// The Parallelstore instance to export from.
2425 #[derive(Clone, Debug, PartialEq)]
2426 #[non_exhaustive]
2427 pub enum Source {
2428 /// Parallelstore source.
2429 SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
2430 }
2431
2432 /// The Cloud Storage bucket to export to.
2433 #[derive(Clone, Debug, PartialEq)]
2434 #[non_exhaustive]
2435 pub enum Destination {
2436 /// Cloud Storage destination.
2437 DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
2438 }
2439}
2440
2441/// The response to a request to import data to Parallelstore.
2442#[derive(Clone, Default, PartialEq)]
2443#[non_exhaustive]
2444pub struct ImportDataResponse {
2445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2446}
2447
2448impl ImportDataResponse {
2449 pub fn new() -> Self {
2450 std::default::Default::default()
2451 }
2452}
2453
2454impl wkt::message::Message for ImportDataResponse {
2455 fn typename() -> &'static str {
2456 "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataResponse"
2457 }
2458}
2459
2460/// An entry describing an error that has occurred.
2461#[derive(Clone, Default, PartialEq)]
2462#[non_exhaustive]
2463pub struct TransferErrorLogEntry {
2464 /// A URL that refers to the target (a data source, a data sink,
2465 /// or an object) with which the error is associated.
2466 pub uri: std::string::String,
2467
2468 /// A list of messages that carry the error details.
2469 pub error_details: std::vec::Vec<std::string::String>,
2470
2471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2472}
2473
2474impl TransferErrorLogEntry {
2475 pub fn new() -> Self {
2476 std::default::Default::default()
2477 }
2478
2479 /// Sets the value of [uri][crate::model::TransferErrorLogEntry::uri].
2480 ///
2481 /// # Example
2482 /// ```ignore,no_run
2483 /// # use google_cloud_parallelstore_v1::model::TransferErrorLogEntry;
2484 /// let x = TransferErrorLogEntry::new().set_uri("example");
2485 /// ```
2486 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2487 self.uri = v.into();
2488 self
2489 }
2490
2491 /// Sets the value of [error_details][crate::model::TransferErrorLogEntry::error_details].
2492 ///
2493 /// # Example
2494 /// ```ignore,no_run
2495 /// # use google_cloud_parallelstore_v1::model::TransferErrorLogEntry;
2496 /// let x = TransferErrorLogEntry::new().set_error_details(["a", "b", "c"]);
2497 /// ```
2498 pub fn set_error_details<T, V>(mut self, v: T) -> Self
2499 where
2500 T: std::iter::IntoIterator<Item = V>,
2501 V: std::convert::Into<std::string::String>,
2502 {
2503 use std::iter::Iterator;
2504 self.error_details = v.into_iter().map(|i| i.into()).collect();
2505 self
2506 }
2507}
2508
2509impl wkt::message::Message for TransferErrorLogEntry {
2510 fn typename() -> &'static str {
2511 "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorLogEntry"
2512 }
2513}
2514
2515/// A summary of errors by error code, plus a count and sample error log
2516/// entries.
2517#[derive(Clone, Default, PartialEq)]
2518#[non_exhaustive]
2519pub struct TransferErrorSummary {
2520 /// One of the error codes that caused the transfer failure.
2521 pub error_code: google_cloud_rpc::model::Code,
2522
2523 /// Count of this type of error.
2524 pub error_count: i64,
2525
2526 /// A list of messages that carry the error details.
2527 pub error_log_entries: std::vec::Vec<crate::model::TransferErrorLogEntry>,
2528
2529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2530}
2531
2532impl TransferErrorSummary {
2533 pub fn new() -> Self {
2534 std::default::Default::default()
2535 }
2536
2537 /// Sets the value of [error_code][crate::model::TransferErrorSummary::error_code].
2538 ///
2539 /// # Example
2540 /// ```ignore,no_run
2541 /// # use google_cloud_parallelstore_v1::model::TransferErrorSummary;
2542 /// use google_cloud_rpc::model::Code;
2543 /// let x0 = TransferErrorSummary::new().set_error_code(Code::Cancelled);
2544 /// let x1 = TransferErrorSummary::new().set_error_code(Code::Unknown);
2545 /// let x2 = TransferErrorSummary::new().set_error_code(Code::InvalidArgument);
2546 /// ```
2547 pub fn set_error_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(
2548 mut self,
2549 v: T,
2550 ) -> Self {
2551 self.error_code = v.into();
2552 self
2553 }
2554
2555 /// Sets the value of [error_count][crate::model::TransferErrorSummary::error_count].
2556 ///
2557 /// # Example
2558 /// ```ignore,no_run
2559 /// # use google_cloud_parallelstore_v1::model::TransferErrorSummary;
2560 /// let x = TransferErrorSummary::new().set_error_count(42);
2561 /// ```
2562 pub fn set_error_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2563 self.error_count = v.into();
2564 self
2565 }
2566
2567 /// Sets the value of [error_log_entries][crate::model::TransferErrorSummary::error_log_entries].
2568 ///
2569 /// # Example
2570 /// ```ignore,no_run
2571 /// # use google_cloud_parallelstore_v1::model::TransferErrorSummary;
2572 /// use google_cloud_parallelstore_v1::model::TransferErrorLogEntry;
2573 /// let x = TransferErrorSummary::new()
2574 /// .set_error_log_entries([
2575 /// TransferErrorLogEntry::default()/* use setters */,
2576 /// TransferErrorLogEntry::default()/* use (different) setters */,
2577 /// ]);
2578 /// ```
2579 pub fn set_error_log_entries<T, V>(mut self, v: T) -> Self
2580 where
2581 T: std::iter::IntoIterator<Item = V>,
2582 V: std::convert::Into<crate::model::TransferErrorLogEntry>,
2583 {
2584 use std::iter::Iterator;
2585 self.error_log_entries = v.into_iter().map(|i| i.into()).collect();
2586 self
2587 }
2588}
2589
2590impl wkt::message::Message for TransferErrorSummary {
2591 fn typename() -> &'static str {
2592 "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorSummary"
2593 }
2594}
2595
2596/// Metadata related to the data import operation.
2597#[derive(Clone, Default, PartialEq)]
2598#[non_exhaustive]
2599pub struct ImportDataMetadata {
2600 /// Data transfer operation metadata.
2601 pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
2602
2603 /// Output only. The time the operation was created.
2604 pub create_time: std::option::Option<wkt::Timestamp>,
2605
2606 /// Output only. The time the operation finished running.
2607 pub end_time: std::option::Option<wkt::Timestamp>,
2608
2609 /// Output only. Server-defined resource path for the target of the operation.
2610 pub target: std::string::String,
2611
2612 /// Output only. Name of the verb executed by the operation.
2613 pub verb: std::string::String,
2614
2615 /// Output only. Human-readable status of the operation, if any.
2616 pub status_message: std::string::String,
2617
2618 /// Output only. Identifies whether the user has requested cancellation
2619 /// of the operation. Operations that have successfully been cancelled
2620 /// have [Operation.error][google.longrunning.Operation.error] value with a
2621 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
2622 /// `Code.CANCELLED`.
2623 ///
2624 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2625 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2626 pub requested_cancellation: bool,
2627
2628 /// Output only. API version used to start the operation.
2629 pub api_version: std::string::String,
2630
2631 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2632}
2633
2634impl ImportDataMetadata {
2635 pub fn new() -> Self {
2636 std::default::Default::default()
2637 }
2638
2639 /// Sets the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
2640 ///
2641 /// # Example
2642 /// ```ignore,no_run
2643 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2644 /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2645 /// let x = ImportDataMetadata::new().set_operation_metadata(TransferOperationMetadata::default()/* use setters */);
2646 /// ```
2647 pub fn set_operation_metadata<T>(mut self, v: T) -> Self
2648 where
2649 T: std::convert::Into<crate::model::TransferOperationMetadata>,
2650 {
2651 self.operation_metadata = std::option::Option::Some(v.into());
2652 self
2653 }
2654
2655 /// Sets or clears the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2660 /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2661 /// let x = ImportDataMetadata::new().set_or_clear_operation_metadata(Some(TransferOperationMetadata::default()/* use setters */));
2662 /// let x = ImportDataMetadata::new().set_or_clear_operation_metadata(None::<TransferOperationMetadata>);
2663 /// ```
2664 pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2665 where
2666 T: std::convert::Into<crate::model::TransferOperationMetadata>,
2667 {
2668 self.operation_metadata = v.map(|x| x.into());
2669 self
2670 }
2671
2672 /// Sets the value of [create_time][crate::model::ImportDataMetadata::create_time].
2673 ///
2674 /// # Example
2675 /// ```ignore,no_run
2676 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2677 /// use wkt::Timestamp;
2678 /// let x = ImportDataMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2679 /// ```
2680 pub fn set_create_time<T>(mut self, v: T) -> Self
2681 where
2682 T: std::convert::Into<wkt::Timestamp>,
2683 {
2684 self.create_time = std::option::Option::Some(v.into());
2685 self
2686 }
2687
2688 /// Sets or clears the value of [create_time][crate::model::ImportDataMetadata::create_time].
2689 ///
2690 /// # Example
2691 /// ```ignore,no_run
2692 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2693 /// use wkt::Timestamp;
2694 /// let x = ImportDataMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2695 /// let x = ImportDataMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2696 /// ```
2697 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2698 where
2699 T: std::convert::Into<wkt::Timestamp>,
2700 {
2701 self.create_time = v.map(|x| x.into());
2702 self
2703 }
2704
2705 /// Sets the value of [end_time][crate::model::ImportDataMetadata::end_time].
2706 ///
2707 /// # Example
2708 /// ```ignore,no_run
2709 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2710 /// use wkt::Timestamp;
2711 /// let x = ImportDataMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2712 /// ```
2713 pub fn set_end_time<T>(mut self, v: T) -> Self
2714 where
2715 T: std::convert::Into<wkt::Timestamp>,
2716 {
2717 self.end_time = std::option::Option::Some(v.into());
2718 self
2719 }
2720
2721 /// Sets or clears the value of [end_time][crate::model::ImportDataMetadata::end_time].
2722 ///
2723 /// # Example
2724 /// ```ignore,no_run
2725 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2726 /// use wkt::Timestamp;
2727 /// let x = ImportDataMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2728 /// let x = ImportDataMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2729 /// ```
2730 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2731 where
2732 T: std::convert::Into<wkt::Timestamp>,
2733 {
2734 self.end_time = v.map(|x| x.into());
2735 self
2736 }
2737
2738 /// Sets the value of [target][crate::model::ImportDataMetadata::target].
2739 ///
2740 /// # Example
2741 /// ```ignore,no_run
2742 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2743 /// let x = ImportDataMetadata::new().set_target("example");
2744 /// ```
2745 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2746 self.target = v.into();
2747 self
2748 }
2749
2750 /// Sets the value of [verb][crate::model::ImportDataMetadata::verb].
2751 ///
2752 /// # Example
2753 /// ```ignore,no_run
2754 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2755 /// let x = ImportDataMetadata::new().set_verb("example");
2756 /// ```
2757 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2758 self.verb = v.into();
2759 self
2760 }
2761
2762 /// Sets the value of [status_message][crate::model::ImportDataMetadata::status_message].
2763 ///
2764 /// # Example
2765 /// ```ignore,no_run
2766 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2767 /// let x = ImportDataMetadata::new().set_status_message("example");
2768 /// ```
2769 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.status_message = v.into();
2771 self
2772 }
2773
2774 /// Sets the value of [requested_cancellation][crate::model::ImportDataMetadata::requested_cancellation].
2775 ///
2776 /// # Example
2777 /// ```ignore,no_run
2778 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2779 /// let x = ImportDataMetadata::new().set_requested_cancellation(true);
2780 /// ```
2781 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2782 self.requested_cancellation = v.into();
2783 self
2784 }
2785
2786 /// Sets the value of [api_version][crate::model::ImportDataMetadata::api_version].
2787 ///
2788 /// # Example
2789 /// ```ignore,no_run
2790 /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2791 /// let x = ImportDataMetadata::new().set_api_version("example");
2792 /// ```
2793 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2794 self.api_version = v.into();
2795 self
2796 }
2797}
2798
2799impl wkt::message::Message for ImportDataMetadata {
2800 fn typename() -> &'static str {
2801 "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataMetadata"
2802 }
2803}
2804
2805/// The response to a request to export data from Parallelstore.
2806#[derive(Clone, Default, PartialEq)]
2807#[non_exhaustive]
2808pub struct ExportDataResponse {
2809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2810}
2811
2812impl ExportDataResponse {
2813 pub fn new() -> Self {
2814 std::default::Default::default()
2815 }
2816}
2817
2818impl wkt::message::Message for ExportDataResponse {
2819 fn typename() -> &'static str {
2820 "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataResponse"
2821 }
2822}
2823
2824/// Metadata related to the data export operation.
2825#[derive(Clone, Default, PartialEq)]
2826#[non_exhaustive]
2827pub struct ExportDataMetadata {
2828 /// Data transfer operation metadata.
2829 pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
2830
2831 /// Output only. The time the operation was created.
2832 pub create_time: std::option::Option<wkt::Timestamp>,
2833
2834 /// Output only. The time the operation finished running.
2835 pub end_time: std::option::Option<wkt::Timestamp>,
2836
2837 /// Output only. Server-defined resource path for the target of the operation.
2838 pub target: std::string::String,
2839
2840 /// Output only. Name of the verb executed by the operation.
2841 pub verb: std::string::String,
2842
2843 /// Output only. Human-readable status of the operation, if any.
2844 pub status_message: std::string::String,
2845
2846 /// Output only. Identifies whether the user has requested cancellation
2847 /// of the operation. Operations that have successfully been cancelled
2848 /// have [Operation.error][google.longrunning.Operation.error] value with a
2849 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
2850 /// `Code.CANCELLED`.
2851 ///
2852 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2853 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2854 pub requested_cancellation: bool,
2855
2856 /// Output only. API version used to start the operation.
2857 pub api_version: std::string::String,
2858
2859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2860}
2861
2862impl ExportDataMetadata {
2863 pub fn new() -> Self {
2864 std::default::Default::default()
2865 }
2866
2867 /// Sets the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
2868 ///
2869 /// # Example
2870 /// ```ignore,no_run
2871 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2872 /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2873 /// let x = ExportDataMetadata::new().set_operation_metadata(TransferOperationMetadata::default()/* use setters */);
2874 /// ```
2875 pub fn set_operation_metadata<T>(mut self, v: T) -> Self
2876 where
2877 T: std::convert::Into<crate::model::TransferOperationMetadata>,
2878 {
2879 self.operation_metadata = std::option::Option::Some(v.into());
2880 self
2881 }
2882
2883 /// Sets or clears the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
2884 ///
2885 /// # Example
2886 /// ```ignore,no_run
2887 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2888 /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2889 /// let x = ExportDataMetadata::new().set_or_clear_operation_metadata(Some(TransferOperationMetadata::default()/* use setters */));
2890 /// let x = ExportDataMetadata::new().set_or_clear_operation_metadata(None::<TransferOperationMetadata>);
2891 /// ```
2892 pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2893 where
2894 T: std::convert::Into<crate::model::TransferOperationMetadata>,
2895 {
2896 self.operation_metadata = v.map(|x| x.into());
2897 self
2898 }
2899
2900 /// Sets the value of [create_time][crate::model::ExportDataMetadata::create_time].
2901 ///
2902 /// # Example
2903 /// ```ignore,no_run
2904 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2905 /// use wkt::Timestamp;
2906 /// let x = ExportDataMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2907 /// ```
2908 pub fn set_create_time<T>(mut self, v: T) -> Self
2909 where
2910 T: std::convert::Into<wkt::Timestamp>,
2911 {
2912 self.create_time = std::option::Option::Some(v.into());
2913 self
2914 }
2915
2916 /// Sets or clears the value of [create_time][crate::model::ExportDataMetadata::create_time].
2917 ///
2918 /// # Example
2919 /// ```ignore,no_run
2920 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2921 /// use wkt::Timestamp;
2922 /// let x = ExportDataMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2923 /// let x = ExportDataMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2924 /// ```
2925 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2926 where
2927 T: std::convert::Into<wkt::Timestamp>,
2928 {
2929 self.create_time = v.map(|x| x.into());
2930 self
2931 }
2932
2933 /// Sets the value of [end_time][crate::model::ExportDataMetadata::end_time].
2934 ///
2935 /// # Example
2936 /// ```ignore,no_run
2937 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2938 /// use wkt::Timestamp;
2939 /// let x = ExportDataMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2940 /// ```
2941 pub fn set_end_time<T>(mut self, v: T) -> Self
2942 where
2943 T: std::convert::Into<wkt::Timestamp>,
2944 {
2945 self.end_time = std::option::Option::Some(v.into());
2946 self
2947 }
2948
2949 /// Sets or clears the value of [end_time][crate::model::ExportDataMetadata::end_time].
2950 ///
2951 /// # Example
2952 /// ```ignore,no_run
2953 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2954 /// use wkt::Timestamp;
2955 /// let x = ExportDataMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2956 /// let x = ExportDataMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2957 /// ```
2958 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2959 where
2960 T: std::convert::Into<wkt::Timestamp>,
2961 {
2962 self.end_time = v.map(|x| x.into());
2963 self
2964 }
2965
2966 /// Sets the value of [target][crate::model::ExportDataMetadata::target].
2967 ///
2968 /// # Example
2969 /// ```ignore,no_run
2970 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2971 /// let x = ExportDataMetadata::new().set_target("example");
2972 /// ```
2973 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.target = v.into();
2975 self
2976 }
2977
2978 /// Sets the value of [verb][crate::model::ExportDataMetadata::verb].
2979 ///
2980 /// # Example
2981 /// ```ignore,no_run
2982 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2983 /// let x = ExportDataMetadata::new().set_verb("example");
2984 /// ```
2985 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2986 self.verb = v.into();
2987 self
2988 }
2989
2990 /// Sets the value of [status_message][crate::model::ExportDataMetadata::status_message].
2991 ///
2992 /// # Example
2993 /// ```ignore,no_run
2994 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2995 /// let x = ExportDataMetadata::new().set_status_message("example");
2996 /// ```
2997 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2998 self.status_message = v.into();
2999 self
3000 }
3001
3002 /// Sets the value of [requested_cancellation][crate::model::ExportDataMetadata::requested_cancellation].
3003 ///
3004 /// # Example
3005 /// ```ignore,no_run
3006 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
3007 /// let x = ExportDataMetadata::new().set_requested_cancellation(true);
3008 /// ```
3009 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3010 self.requested_cancellation = v.into();
3011 self
3012 }
3013
3014 /// Sets the value of [api_version][crate::model::ExportDataMetadata::api_version].
3015 ///
3016 /// # Example
3017 /// ```ignore,no_run
3018 /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
3019 /// let x = ExportDataMetadata::new().set_api_version("example");
3020 /// ```
3021 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3022 self.api_version = v.into();
3023 self
3024 }
3025}
3026
3027impl wkt::message::Message for ExportDataMetadata {
3028 fn typename() -> &'static str {
3029 "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataMetadata"
3030 }
3031}
3032
3033/// Long-running operation metadata related to a data transfer.
3034#[derive(Clone, Default, PartialEq)]
3035#[non_exhaustive]
3036pub struct TransferOperationMetadata {
3037 /// Output only. The progress of the transfer operation.
3038 pub counters: std::option::Option<crate::model::TransferCounters>,
3039
3040 /// Output only. The type of transfer occurring.
3041 pub transfer_type: crate::model::TransferType,
3042
3043 /// Output only. List of files that failed to be transferred. This list will
3044 /// have a maximum size of 5 elements.
3045 pub error_summary: std::vec::Vec<crate::model::TransferErrorSummary>,
3046
3047 /// The source of transfer operation.
3048 pub source: std::option::Option<crate::model::transfer_operation_metadata::Source>,
3049
3050 /// The destination of transfer operation.
3051 pub destination: std::option::Option<crate::model::transfer_operation_metadata::Destination>,
3052
3053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3054}
3055
3056impl TransferOperationMetadata {
3057 pub fn new() -> Self {
3058 std::default::Default::default()
3059 }
3060
3061 /// Sets the value of [counters][crate::model::TransferOperationMetadata::counters].
3062 ///
3063 /// # Example
3064 /// ```ignore,no_run
3065 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3066 /// use google_cloud_parallelstore_v1::model::TransferCounters;
3067 /// let x = TransferOperationMetadata::new().set_counters(TransferCounters::default()/* use setters */);
3068 /// ```
3069 pub fn set_counters<T>(mut self, v: T) -> Self
3070 where
3071 T: std::convert::Into<crate::model::TransferCounters>,
3072 {
3073 self.counters = std::option::Option::Some(v.into());
3074 self
3075 }
3076
3077 /// Sets or clears the value of [counters][crate::model::TransferOperationMetadata::counters].
3078 ///
3079 /// # Example
3080 /// ```ignore,no_run
3081 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3082 /// use google_cloud_parallelstore_v1::model::TransferCounters;
3083 /// let x = TransferOperationMetadata::new().set_or_clear_counters(Some(TransferCounters::default()/* use setters */));
3084 /// let x = TransferOperationMetadata::new().set_or_clear_counters(None::<TransferCounters>);
3085 /// ```
3086 pub fn set_or_clear_counters<T>(mut self, v: std::option::Option<T>) -> Self
3087 where
3088 T: std::convert::Into<crate::model::TransferCounters>,
3089 {
3090 self.counters = v.map(|x| x.into());
3091 self
3092 }
3093
3094 /// Sets the value of [transfer_type][crate::model::TransferOperationMetadata::transfer_type].
3095 ///
3096 /// # Example
3097 /// ```ignore,no_run
3098 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3099 /// use google_cloud_parallelstore_v1::model::TransferType;
3100 /// let x0 = TransferOperationMetadata::new().set_transfer_type(TransferType::Import);
3101 /// let x1 = TransferOperationMetadata::new().set_transfer_type(TransferType::Export);
3102 /// ```
3103 pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
3104 mut self,
3105 v: T,
3106 ) -> Self {
3107 self.transfer_type = v.into();
3108 self
3109 }
3110
3111 /// Sets the value of [error_summary][crate::model::TransferOperationMetadata::error_summary].
3112 ///
3113 /// # Example
3114 /// ```ignore,no_run
3115 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3116 /// use google_cloud_parallelstore_v1::model::TransferErrorSummary;
3117 /// let x = TransferOperationMetadata::new()
3118 /// .set_error_summary([
3119 /// TransferErrorSummary::default()/* use setters */,
3120 /// TransferErrorSummary::default()/* use (different) setters */,
3121 /// ]);
3122 /// ```
3123 pub fn set_error_summary<T, V>(mut self, v: T) -> Self
3124 where
3125 T: std::iter::IntoIterator<Item = V>,
3126 V: std::convert::Into<crate::model::TransferErrorSummary>,
3127 {
3128 use std::iter::Iterator;
3129 self.error_summary = v.into_iter().map(|i| i.into()).collect();
3130 self
3131 }
3132
3133 /// Sets the value of [source][crate::model::TransferOperationMetadata::source].
3134 ///
3135 /// Note that all the setters affecting `source` are mutually
3136 /// exclusive.
3137 ///
3138 /// # Example
3139 /// ```ignore,no_run
3140 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3141 /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
3142 /// let x = TransferOperationMetadata::new().set_source(Some(
3143 /// google_cloud_parallelstore_v1::model::transfer_operation_metadata::Source::SourceParallelstore(SourceParallelstore::default().into())));
3144 /// ```
3145 pub fn set_source<
3146 T: std::convert::Into<std::option::Option<crate::model::transfer_operation_metadata::Source>>,
3147 >(
3148 mut self,
3149 v: T,
3150 ) -> Self {
3151 self.source = v.into();
3152 self
3153 }
3154
3155 /// The value of [source][crate::model::TransferOperationMetadata::source]
3156 /// if it holds a `SourceParallelstore`, `None` if the field is not set or
3157 /// holds a different branch.
3158 pub fn source_parallelstore(
3159 &self,
3160 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
3161 #[allow(unreachable_patterns)]
3162 self.source.as_ref().and_then(|v| match v {
3163 crate::model::transfer_operation_metadata::Source::SourceParallelstore(v) => {
3164 std::option::Option::Some(v)
3165 }
3166 _ => std::option::Option::None,
3167 })
3168 }
3169
3170 /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
3171 /// to hold a `SourceParallelstore`.
3172 ///
3173 /// Note that all the setters affecting `source` are
3174 /// mutually exclusive.
3175 ///
3176 /// # Example
3177 /// ```ignore,no_run
3178 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3179 /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
3180 /// let x = TransferOperationMetadata::new().set_source_parallelstore(SourceParallelstore::default()/* use setters */);
3181 /// assert!(x.source_parallelstore().is_some());
3182 /// assert!(x.source_gcs_bucket().is_none());
3183 /// ```
3184 pub fn set_source_parallelstore<
3185 T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
3186 >(
3187 mut self,
3188 v: T,
3189 ) -> Self {
3190 self.source = std::option::Option::Some(
3191 crate::model::transfer_operation_metadata::Source::SourceParallelstore(v.into()),
3192 );
3193 self
3194 }
3195
3196 /// The value of [source][crate::model::TransferOperationMetadata::source]
3197 /// if it holds a `SourceGcsBucket`, `None` if the field is not set or
3198 /// holds a different branch.
3199 pub fn source_gcs_bucket(
3200 &self,
3201 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
3202 #[allow(unreachable_patterns)]
3203 self.source.as_ref().and_then(|v| match v {
3204 crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v) => {
3205 std::option::Option::Some(v)
3206 }
3207 _ => std::option::Option::None,
3208 })
3209 }
3210
3211 /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
3212 /// to hold a `SourceGcsBucket`.
3213 ///
3214 /// Note that all the setters affecting `source` are
3215 /// mutually exclusive.
3216 ///
3217 /// # Example
3218 /// ```ignore,no_run
3219 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3220 /// use google_cloud_parallelstore_v1::model::SourceGcsBucket;
3221 /// let x = TransferOperationMetadata::new().set_source_gcs_bucket(SourceGcsBucket::default()/* use setters */);
3222 /// assert!(x.source_gcs_bucket().is_some());
3223 /// assert!(x.source_parallelstore().is_none());
3224 /// ```
3225 pub fn set_source_gcs_bucket<
3226 T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
3227 >(
3228 mut self,
3229 v: T,
3230 ) -> Self {
3231 self.source = std::option::Option::Some(
3232 crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v.into()),
3233 );
3234 self
3235 }
3236
3237 /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination].
3238 ///
3239 /// Note that all the setters affecting `destination` are mutually
3240 /// exclusive.
3241 ///
3242 /// # Example
3243 /// ```ignore,no_run
3244 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3245 /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
3246 /// let x = TransferOperationMetadata::new().set_destination(Some(
3247 /// google_cloud_parallelstore_v1::model::transfer_operation_metadata::Destination::DestinationGcsBucket(DestinationGcsBucket::default().into())));
3248 /// ```
3249 pub fn set_destination<
3250 T: std::convert::Into<
3251 std::option::Option<crate::model::transfer_operation_metadata::Destination>,
3252 >,
3253 >(
3254 mut self,
3255 v: T,
3256 ) -> Self {
3257 self.destination = v.into();
3258 self
3259 }
3260
3261 /// The value of [destination][crate::model::TransferOperationMetadata::destination]
3262 /// if it holds a `DestinationGcsBucket`, `None` if the field is not set or
3263 /// holds a different branch.
3264 pub fn destination_gcs_bucket(
3265 &self,
3266 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
3267 #[allow(unreachable_patterns)]
3268 self.destination.as_ref().and_then(|v| match v {
3269 crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v) => {
3270 std::option::Option::Some(v)
3271 }
3272 _ => std::option::Option::None,
3273 })
3274 }
3275
3276 /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
3277 /// to hold a `DestinationGcsBucket`.
3278 ///
3279 /// Note that all the setters affecting `destination` are
3280 /// mutually exclusive.
3281 ///
3282 /// # Example
3283 /// ```ignore,no_run
3284 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3285 /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
3286 /// let x = TransferOperationMetadata::new().set_destination_gcs_bucket(DestinationGcsBucket::default()/* use setters */);
3287 /// assert!(x.destination_gcs_bucket().is_some());
3288 /// assert!(x.destination_parallelstore().is_none());
3289 /// ```
3290 pub fn set_destination_gcs_bucket<
3291 T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
3292 >(
3293 mut self,
3294 v: T,
3295 ) -> Self {
3296 self.destination = std::option::Option::Some(
3297 crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v.into()),
3298 );
3299 self
3300 }
3301
3302 /// The value of [destination][crate::model::TransferOperationMetadata::destination]
3303 /// if it holds a `DestinationParallelstore`, `None` if the field is not set or
3304 /// holds a different branch.
3305 pub fn destination_parallelstore(
3306 &self,
3307 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
3308 #[allow(unreachable_patterns)]
3309 self.destination.as_ref().and_then(|v| match v {
3310 crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(v) => {
3311 std::option::Option::Some(v)
3312 }
3313 _ => std::option::Option::None,
3314 })
3315 }
3316
3317 /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
3318 /// to hold a `DestinationParallelstore`.
3319 ///
3320 /// Note that all the setters affecting `destination` are
3321 /// mutually exclusive.
3322 ///
3323 /// # Example
3324 /// ```ignore,no_run
3325 /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3326 /// use google_cloud_parallelstore_v1::model::DestinationParallelstore;
3327 /// let x = TransferOperationMetadata::new().set_destination_parallelstore(DestinationParallelstore::default()/* use setters */);
3328 /// assert!(x.destination_parallelstore().is_some());
3329 /// assert!(x.destination_gcs_bucket().is_none());
3330 /// ```
3331 pub fn set_destination_parallelstore<
3332 T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
3333 >(
3334 mut self,
3335 v: T,
3336 ) -> Self {
3337 self.destination = std::option::Option::Some(
3338 crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(
3339 v.into(),
3340 ),
3341 );
3342 self
3343 }
3344}
3345
3346impl wkt::message::Message for TransferOperationMetadata {
3347 fn typename() -> &'static str {
3348 "type.googleapis.com/google.cloud.parallelstore.v1.TransferOperationMetadata"
3349 }
3350}
3351
3352/// Defines additional types related to [TransferOperationMetadata].
3353pub mod transfer_operation_metadata {
3354 #[allow(unused_imports)]
3355 use super::*;
3356
3357 /// The source of transfer operation.
3358 #[derive(Clone, Debug, PartialEq)]
3359 #[non_exhaustive]
3360 pub enum Source {
3361 /// Output only. Parallelstore source.
3362 SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
3363 /// Output only. Cloud Storage source.
3364 SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
3365 }
3366
3367 /// The destination of transfer operation.
3368 #[derive(Clone, Debug, PartialEq)]
3369 #[non_exhaustive]
3370 pub enum Destination {
3371 /// Output only. Cloud Storage destination.
3372 DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
3373 /// Output only. Parallelstore destination.
3374 DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
3375 }
3376}
3377
3378/// A collection of counters that report the progress of a transfer operation.
3379#[derive(Clone, Default, PartialEq)]
3380#[non_exhaustive]
3381pub struct TransferCounters {
3382 /// Objects found in the data source that are scheduled to be transferred,
3383 /// excluding any that are filtered based on object conditions or skipped due
3384 /// to sync.
3385 pub objects_found: i64,
3386
3387 /// Bytes found in the data source that are scheduled to be transferred,
3388 /// excluding any that are filtered based on object conditions or skipped due
3389 /// to sync.
3390 pub bytes_found: i64,
3391
3392 /// Objects in the data source that are not transferred because they already
3393 /// exist in the data destination.
3394 pub objects_skipped: i64,
3395
3396 /// Bytes in the data source that are not transferred because they already
3397 /// exist in the data destination.
3398 pub bytes_skipped: i64,
3399
3400 /// Objects that are copied to the data destination.
3401 pub objects_copied: i64,
3402
3403 /// Bytes that are copied to the data destination.
3404 pub bytes_copied: i64,
3405
3406 /// Objects that failed to be written to the data destination.
3407 pub objects_failed: i64,
3408
3409 /// Bytes that failed to be written to the data destination.
3410 pub bytes_failed: i64,
3411
3412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3413}
3414
3415impl TransferCounters {
3416 pub fn new() -> Self {
3417 std::default::Default::default()
3418 }
3419
3420 /// Sets the value of [objects_found][crate::model::TransferCounters::objects_found].
3421 ///
3422 /// # Example
3423 /// ```ignore,no_run
3424 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3425 /// let x = TransferCounters::new().set_objects_found(42);
3426 /// ```
3427 pub fn set_objects_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3428 self.objects_found = v.into();
3429 self
3430 }
3431
3432 /// Sets the value of [bytes_found][crate::model::TransferCounters::bytes_found].
3433 ///
3434 /// # Example
3435 /// ```ignore,no_run
3436 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3437 /// let x = TransferCounters::new().set_bytes_found(42);
3438 /// ```
3439 pub fn set_bytes_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3440 self.bytes_found = v.into();
3441 self
3442 }
3443
3444 /// Sets the value of [objects_skipped][crate::model::TransferCounters::objects_skipped].
3445 ///
3446 /// # Example
3447 /// ```ignore,no_run
3448 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3449 /// let x = TransferCounters::new().set_objects_skipped(42);
3450 /// ```
3451 pub fn set_objects_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3452 self.objects_skipped = v.into();
3453 self
3454 }
3455
3456 /// Sets the value of [bytes_skipped][crate::model::TransferCounters::bytes_skipped].
3457 ///
3458 /// # Example
3459 /// ```ignore,no_run
3460 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3461 /// let x = TransferCounters::new().set_bytes_skipped(42);
3462 /// ```
3463 pub fn set_bytes_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3464 self.bytes_skipped = v.into();
3465 self
3466 }
3467
3468 /// Sets the value of [objects_copied][crate::model::TransferCounters::objects_copied].
3469 ///
3470 /// # Example
3471 /// ```ignore,no_run
3472 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3473 /// let x = TransferCounters::new().set_objects_copied(42);
3474 /// ```
3475 pub fn set_objects_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3476 self.objects_copied = v.into();
3477 self
3478 }
3479
3480 /// Sets the value of [bytes_copied][crate::model::TransferCounters::bytes_copied].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3485 /// let x = TransferCounters::new().set_bytes_copied(42);
3486 /// ```
3487 pub fn set_bytes_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3488 self.bytes_copied = v.into();
3489 self
3490 }
3491
3492 /// Sets the value of [objects_failed][crate::model::TransferCounters::objects_failed].
3493 ///
3494 /// # Example
3495 /// ```ignore,no_run
3496 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3497 /// let x = TransferCounters::new().set_objects_failed(42);
3498 /// ```
3499 pub fn set_objects_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3500 self.objects_failed = v.into();
3501 self
3502 }
3503
3504 /// Sets the value of [bytes_failed][crate::model::TransferCounters::bytes_failed].
3505 ///
3506 /// # Example
3507 /// ```ignore,no_run
3508 /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3509 /// let x = TransferCounters::new().set_bytes_failed(42);
3510 /// ```
3511 pub fn set_bytes_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3512 self.bytes_failed = v.into();
3513 self
3514 }
3515}
3516
3517impl wkt::message::Message for TransferCounters {
3518 fn typename() -> &'static str {
3519 "type.googleapis.com/google.cloud.parallelstore.v1.TransferCounters"
3520 }
3521}
3522
3523/// Type of transfer that occurred.
3524///
3525/// # Working with unknown values
3526///
3527/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3528/// additional enum variants at any time. Adding new variants is not considered
3529/// a breaking change. Applications should write their code in anticipation of:
3530///
3531/// - New values appearing in future releases of the client library, **and**
3532/// - New values received dynamically, without application changes.
3533///
3534/// Please consult the [Working with enums] section in the user guide for some
3535/// guidelines.
3536///
3537/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3538#[derive(Clone, Debug, PartialEq)]
3539#[non_exhaustive]
3540pub enum TransferType {
3541 /// Zero is an illegal value.
3542 Unspecified,
3543 /// Imports to Parallelstore.
3544 Import,
3545 /// Exports from Parallelstore.
3546 Export,
3547 /// If set, the enum was initialized with an unknown value.
3548 ///
3549 /// Applications can examine the value using [TransferType::value] or
3550 /// [TransferType::name].
3551 UnknownValue(transfer_type::UnknownValue),
3552}
3553
3554#[doc(hidden)]
3555pub mod transfer_type {
3556 #[allow(unused_imports)]
3557 use super::*;
3558 #[derive(Clone, Debug, PartialEq)]
3559 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3560}
3561
3562impl TransferType {
3563 /// Gets the enum value.
3564 ///
3565 /// Returns `None` if the enum contains an unknown value deserialized from
3566 /// the string representation of enums.
3567 pub fn value(&self) -> std::option::Option<i32> {
3568 match self {
3569 Self::Unspecified => std::option::Option::Some(0),
3570 Self::Import => std::option::Option::Some(1),
3571 Self::Export => std::option::Option::Some(2),
3572 Self::UnknownValue(u) => u.0.value(),
3573 }
3574 }
3575
3576 /// Gets the enum value as a string.
3577 ///
3578 /// Returns `None` if the enum contains an unknown value deserialized from
3579 /// the integer representation of enums.
3580 pub fn name(&self) -> std::option::Option<&str> {
3581 match self {
3582 Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
3583 Self::Import => std::option::Option::Some("IMPORT"),
3584 Self::Export => std::option::Option::Some("EXPORT"),
3585 Self::UnknownValue(u) => u.0.name(),
3586 }
3587 }
3588}
3589
3590impl std::default::Default for TransferType {
3591 fn default() -> Self {
3592 use std::convert::From;
3593 Self::from(0)
3594 }
3595}
3596
3597impl std::fmt::Display for TransferType {
3598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3599 wkt::internal::display_enum(f, self.name(), self.value())
3600 }
3601}
3602
3603impl std::convert::From<i32> for TransferType {
3604 fn from(value: i32) -> Self {
3605 match value {
3606 0 => Self::Unspecified,
3607 1 => Self::Import,
3608 2 => Self::Export,
3609 _ => Self::UnknownValue(transfer_type::UnknownValue(
3610 wkt::internal::UnknownEnumValue::Integer(value),
3611 )),
3612 }
3613 }
3614}
3615
3616impl std::convert::From<&str> for TransferType {
3617 fn from(value: &str) -> Self {
3618 use std::string::ToString;
3619 match value {
3620 "TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
3621 "IMPORT" => Self::Import,
3622 "EXPORT" => Self::Export,
3623 _ => Self::UnknownValue(transfer_type::UnknownValue(
3624 wkt::internal::UnknownEnumValue::String(value.to_string()),
3625 )),
3626 }
3627 }
3628}
3629
3630impl serde::ser::Serialize for TransferType {
3631 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3632 where
3633 S: serde::Serializer,
3634 {
3635 match self {
3636 Self::Unspecified => serializer.serialize_i32(0),
3637 Self::Import => serializer.serialize_i32(1),
3638 Self::Export => serializer.serialize_i32(2),
3639 Self::UnknownValue(u) => u.0.serialize(serializer),
3640 }
3641 }
3642}
3643
3644impl<'de> serde::de::Deserialize<'de> for TransferType {
3645 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3646 where
3647 D: serde::Deserializer<'de>,
3648 {
3649 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
3650 ".google.cloud.parallelstore.v1.TransferType",
3651 ))
3652 }
3653}
3654
3655/// Represents the striping options for files.
3656///
3657/// # Working with unknown values
3658///
3659/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3660/// additional enum variants at any time. Adding new variants is not considered
3661/// a breaking change. Applications should write their code in anticipation of:
3662///
3663/// - New values appearing in future releases of the client library, **and**
3664/// - New values received dynamically, without application changes.
3665///
3666/// Please consult the [Working with enums] section in the user guide for some
3667/// guidelines.
3668///
3669/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3670#[derive(Clone, Debug, PartialEq)]
3671#[non_exhaustive]
3672pub enum FileStripeLevel {
3673 /// If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED
3674 Unspecified,
3675 /// Minimum file striping
3676 Min,
3677 /// Medium file striping
3678 Balanced,
3679 /// Maximum file striping
3680 Max,
3681 /// If set, the enum was initialized with an unknown value.
3682 ///
3683 /// Applications can examine the value using [FileStripeLevel::value] or
3684 /// [FileStripeLevel::name].
3685 UnknownValue(file_stripe_level::UnknownValue),
3686}
3687
3688#[doc(hidden)]
3689pub mod file_stripe_level {
3690 #[allow(unused_imports)]
3691 use super::*;
3692 #[derive(Clone, Debug, PartialEq)]
3693 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3694}
3695
3696impl FileStripeLevel {
3697 /// Gets the enum value.
3698 ///
3699 /// Returns `None` if the enum contains an unknown value deserialized from
3700 /// the string representation of enums.
3701 pub fn value(&self) -> std::option::Option<i32> {
3702 match self {
3703 Self::Unspecified => std::option::Option::Some(0),
3704 Self::Min => std::option::Option::Some(1),
3705 Self::Balanced => std::option::Option::Some(2),
3706 Self::Max => std::option::Option::Some(3),
3707 Self::UnknownValue(u) => u.0.value(),
3708 }
3709 }
3710
3711 /// Gets the enum value as a string.
3712 ///
3713 /// Returns `None` if the enum contains an unknown value deserialized from
3714 /// the integer representation of enums.
3715 pub fn name(&self) -> std::option::Option<&str> {
3716 match self {
3717 Self::Unspecified => std::option::Option::Some("FILE_STRIPE_LEVEL_UNSPECIFIED"),
3718 Self::Min => std::option::Option::Some("FILE_STRIPE_LEVEL_MIN"),
3719 Self::Balanced => std::option::Option::Some("FILE_STRIPE_LEVEL_BALANCED"),
3720 Self::Max => std::option::Option::Some("FILE_STRIPE_LEVEL_MAX"),
3721 Self::UnknownValue(u) => u.0.name(),
3722 }
3723 }
3724}
3725
3726impl std::default::Default for FileStripeLevel {
3727 fn default() -> Self {
3728 use std::convert::From;
3729 Self::from(0)
3730 }
3731}
3732
3733impl std::fmt::Display for FileStripeLevel {
3734 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3735 wkt::internal::display_enum(f, self.name(), self.value())
3736 }
3737}
3738
3739impl std::convert::From<i32> for FileStripeLevel {
3740 fn from(value: i32) -> Self {
3741 match value {
3742 0 => Self::Unspecified,
3743 1 => Self::Min,
3744 2 => Self::Balanced,
3745 3 => Self::Max,
3746 _ => Self::UnknownValue(file_stripe_level::UnknownValue(
3747 wkt::internal::UnknownEnumValue::Integer(value),
3748 )),
3749 }
3750 }
3751}
3752
3753impl std::convert::From<&str> for FileStripeLevel {
3754 fn from(value: &str) -> Self {
3755 use std::string::ToString;
3756 match value {
3757 "FILE_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
3758 "FILE_STRIPE_LEVEL_MIN" => Self::Min,
3759 "FILE_STRIPE_LEVEL_BALANCED" => Self::Balanced,
3760 "FILE_STRIPE_LEVEL_MAX" => Self::Max,
3761 _ => Self::UnknownValue(file_stripe_level::UnknownValue(
3762 wkt::internal::UnknownEnumValue::String(value.to_string()),
3763 )),
3764 }
3765 }
3766}
3767
3768impl serde::ser::Serialize for FileStripeLevel {
3769 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3770 where
3771 S: serde::Serializer,
3772 {
3773 match self {
3774 Self::Unspecified => serializer.serialize_i32(0),
3775 Self::Min => serializer.serialize_i32(1),
3776 Self::Balanced => serializer.serialize_i32(2),
3777 Self::Max => serializer.serialize_i32(3),
3778 Self::UnknownValue(u) => u.0.serialize(serializer),
3779 }
3780 }
3781}
3782
3783impl<'de> serde::de::Deserialize<'de> for FileStripeLevel {
3784 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3785 where
3786 D: serde::Deserializer<'de>,
3787 {
3788 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileStripeLevel>::new(
3789 ".google.cloud.parallelstore.v1.FileStripeLevel",
3790 ))
3791 }
3792}
3793
3794/// Represents the striping options for directories.
3795///
3796/// # Working with unknown values
3797///
3798/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3799/// additional enum variants at any time. Adding new variants is not considered
3800/// a breaking change. Applications should write their code in anticipation of:
3801///
3802/// - New values appearing in future releases of the client library, **and**
3803/// - New values received dynamically, without application changes.
3804///
3805/// Please consult the [Working with enums] section in the user guide for some
3806/// guidelines.
3807///
3808/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3809#[derive(Clone, Debug, PartialEq)]
3810#[non_exhaustive]
3811pub enum DirectoryStripeLevel {
3812 /// If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX
3813 Unspecified,
3814 /// Minimum directory striping
3815 Min,
3816 /// Medium directory striping
3817 Balanced,
3818 /// Maximum directory striping
3819 Max,
3820 /// If set, the enum was initialized with an unknown value.
3821 ///
3822 /// Applications can examine the value using [DirectoryStripeLevel::value] or
3823 /// [DirectoryStripeLevel::name].
3824 UnknownValue(directory_stripe_level::UnknownValue),
3825}
3826
3827#[doc(hidden)]
3828pub mod directory_stripe_level {
3829 #[allow(unused_imports)]
3830 use super::*;
3831 #[derive(Clone, Debug, PartialEq)]
3832 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3833}
3834
3835impl DirectoryStripeLevel {
3836 /// Gets the enum value.
3837 ///
3838 /// Returns `None` if the enum contains an unknown value deserialized from
3839 /// the string representation of enums.
3840 pub fn value(&self) -> std::option::Option<i32> {
3841 match self {
3842 Self::Unspecified => std::option::Option::Some(0),
3843 Self::Min => std::option::Option::Some(1),
3844 Self::Balanced => std::option::Option::Some(2),
3845 Self::Max => std::option::Option::Some(3),
3846 Self::UnknownValue(u) => u.0.value(),
3847 }
3848 }
3849
3850 /// Gets the enum value as a string.
3851 ///
3852 /// Returns `None` if the enum contains an unknown value deserialized from
3853 /// the integer representation of enums.
3854 pub fn name(&self) -> std::option::Option<&str> {
3855 match self {
3856 Self::Unspecified => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_UNSPECIFIED"),
3857 Self::Min => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MIN"),
3858 Self::Balanced => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_BALANCED"),
3859 Self::Max => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MAX"),
3860 Self::UnknownValue(u) => u.0.name(),
3861 }
3862 }
3863}
3864
3865impl std::default::Default for DirectoryStripeLevel {
3866 fn default() -> Self {
3867 use std::convert::From;
3868 Self::from(0)
3869 }
3870}
3871
3872impl std::fmt::Display for DirectoryStripeLevel {
3873 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3874 wkt::internal::display_enum(f, self.name(), self.value())
3875 }
3876}
3877
3878impl std::convert::From<i32> for DirectoryStripeLevel {
3879 fn from(value: i32) -> Self {
3880 match value {
3881 0 => Self::Unspecified,
3882 1 => Self::Min,
3883 2 => Self::Balanced,
3884 3 => Self::Max,
3885 _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
3886 wkt::internal::UnknownEnumValue::Integer(value),
3887 )),
3888 }
3889 }
3890}
3891
3892impl std::convert::From<&str> for DirectoryStripeLevel {
3893 fn from(value: &str) -> Self {
3894 use std::string::ToString;
3895 match value {
3896 "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
3897 "DIRECTORY_STRIPE_LEVEL_MIN" => Self::Min,
3898 "DIRECTORY_STRIPE_LEVEL_BALANCED" => Self::Balanced,
3899 "DIRECTORY_STRIPE_LEVEL_MAX" => Self::Max,
3900 _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
3901 wkt::internal::UnknownEnumValue::String(value.to_string()),
3902 )),
3903 }
3904 }
3905}
3906
3907impl serde::ser::Serialize for DirectoryStripeLevel {
3908 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3909 where
3910 S: serde::Serializer,
3911 {
3912 match self {
3913 Self::Unspecified => serializer.serialize_i32(0),
3914 Self::Min => serializer.serialize_i32(1),
3915 Self::Balanced => serializer.serialize_i32(2),
3916 Self::Max => serializer.serialize_i32(3),
3917 Self::UnknownValue(u) => u.0.serialize(serializer),
3918 }
3919 }
3920}
3921
3922impl<'de> serde::de::Deserialize<'de> for DirectoryStripeLevel {
3923 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3924 where
3925 D: serde::Deserializer<'de>,
3926 {
3927 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryStripeLevel>::new(
3928 ".google.cloud.parallelstore.v1.DirectoryStripeLevel",
3929 ))
3930 }
3931}
3932
3933/// Represents the deployment type for the instance.
3934///
3935/// # Working with unknown values
3936///
3937/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3938/// additional enum variants at any time. Adding new variants is not considered
3939/// a breaking change. Applications should write their code in anticipation of:
3940///
3941/// - New values appearing in future releases of the client library, **and**
3942/// - New values received dynamically, without application changes.
3943///
3944/// Please consult the [Working with enums] section in the user guide for some
3945/// guidelines.
3946///
3947/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3948#[derive(Clone, Debug, PartialEq)]
3949#[non_exhaustive]
3950pub enum DeploymentType {
3951 /// Default Deployment Type
3952 /// It is equivalent to SCRATCH
3953 Unspecified,
3954 /// Scratch
3955 Scratch,
3956 /// Persistent
3957 Persistent,
3958 /// If set, the enum was initialized with an unknown value.
3959 ///
3960 /// Applications can examine the value using [DeploymentType::value] or
3961 /// [DeploymentType::name].
3962 UnknownValue(deployment_type::UnknownValue),
3963}
3964
3965#[doc(hidden)]
3966pub mod deployment_type {
3967 #[allow(unused_imports)]
3968 use super::*;
3969 #[derive(Clone, Debug, PartialEq)]
3970 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3971}
3972
3973impl DeploymentType {
3974 /// Gets the enum value.
3975 ///
3976 /// Returns `None` if the enum contains an unknown value deserialized from
3977 /// the string representation of enums.
3978 pub fn value(&self) -> std::option::Option<i32> {
3979 match self {
3980 Self::Unspecified => std::option::Option::Some(0),
3981 Self::Scratch => std::option::Option::Some(1),
3982 Self::Persistent => std::option::Option::Some(2),
3983 Self::UnknownValue(u) => u.0.value(),
3984 }
3985 }
3986
3987 /// Gets the enum value as a string.
3988 ///
3989 /// Returns `None` if the enum contains an unknown value deserialized from
3990 /// the integer representation of enums.
3991 pub fn name(&self) -> std::option::Option<&str> {
3992 match self {
3993 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_TYPE_UNSPECIFIED"),
3994 Self::Scratch => std::option::Option::Some("SCRATCH"),
3995 Self::Persistent => std::option::Option::Some("PERSISTENT"),
3996 Self::UnknownValue(u) => u.0.name(),
3997 }
3998 }
3999}
4000
4001impl std::default::Default for DeploymentType {
4002 fn default() -> Self {
4003 use std::convert::From;
4004 Self::from(0)
4005 }
4006}
4007
4008impl std::fmt::Display for DeploymentType {
4009 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4010 wkt::internal::display_enum(f, self.name(), self.value())
4011 }
4012}
4013
4014impl std::convert::From<i32> for DeploymentType {
4015 fn from(value: i32) -> Self {
4016 match value {
4017 0 => Self::Unspecified,
4018 1 => Self::Scratch,
4019 2 => Self::Persistent,
4020 _ => Self::UnknownValue(deployment_type::UnknownValue(
4021 wkt::internal::UnknownEnumValue::Integer(value),
4022 )),
4023 }
4024 }
4025}
4026
4027impl std::convert::From<&str> for DeploymentType {
4028 fn from(value: &str) -> Self {
4029 use std::string::ToString;
4030 match value {
4031 "DEPLOYMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
4032 "SCRATCH" => Self::Scratch,
4033 "PERSISTENT" => Self::Persistent,
4034 _ => Self::UnknownValue(deployment_type::UnknownValue(
4035 wkt::internal::UnknownEnumValue::String(value.to_string()),
4036 )),
4037 }
4038 }
4039}
4040
4041impl serde::ser::Serialize for DeploymentType {
4042 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4043 where
4044 S: serde::Serializer,
4045 {
4046 match self {
4047 Self::Unspecified => serializer.serialize_i32(0),
4048 Self::Scratch => serializer.serialize_i32(1),
4049 Self::Persistent => serializer.serialize_i32(2),
4050 Self::UnknownValue(u) => u.0.serialize(serializer),
4051 }
4052 }
4053}
4054
4055impl<'de> serde::de::Deserialize<'de> for DeploymentType {
4056 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4057 where
4058 D: serde::Deserializer<'de>,
4059 {
4060 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentType>::new(
4061 ".google.cloud.parallelstore.v1.DeploymentType",
4062 ))
4063 }
4064}