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