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