Skip to main content

google_cloud_lustre_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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate google_cloud_rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// A Managed Lustre instance.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Instance {
45    /// Identifier. The name of the instance.
46    pub name: std::string::String,
47
48    /// Required. Immutable. The filesystem name for this instance. This name is
49    /// used by client-side tools, including when mounting the instance. Must be
50    /// eight characters or less and can only contain letters and numbers.
51    pub filesystem: std::string::String,
52
53    /// Required. The storage capacity of the instance in gibibytes (GiB). Allowed
54    /// values are from `18000` to `954000`, in increments of 9000.
55    pub capacity_gib: i64,
56
57    /// Required. Immutable. The full name of the VPC network to which the instance
58    /// is connected. Must be in the format
59    /// `projects/{project_id}/global/networks/{network_name}`.
60    pub network: std::string::String,
61
62    /// Output only. The state of the instance.
63    pub state: crate::model::instance::State,
64
65    /// Output only. Mount point of the instance in the format
66    /// `IP_ADDRESS@tcp:/FILESYSTEM`.
67    pub mount_point: std::string::String,
68
69    /// Output only. Timestamp when the instance was created.
70    pub create_time: std::option::Option<wkt::Timestamp>,
71
72    /// Output only. Timestamp when the instance was last updated.
73    pub update_time: std::option::Option<wkt::Timestamp>,
74
75    /// Optional. A user-readable description of the instance.
76    pub description: std::string::String,
77
78    /// Optional. Labels as key value pairs.
79    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
80
81    /// Required. The throughput of the instance in MB/s/TiB.
82    /// Valid values are 125, 250, 500, 1000.
83    pub per_unit_storage_throughput: i64,
84
85    /// Optional. Indicates whether you want to enable support for GKE clients. By
86    /// default, GKE clients are not supported. Deprecated. No longer required for
87    /// GKE instance creation.
88    #[deprecated]
89    pub gke_support_enabled: bool,
90
91    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
92}
93
94impl Instance {
95    /// Creates a new default instance.
96    pub fn new() -> Self {
97        std::default::Default::default()
98    }
99
100    /// Sets the value of [name][crate::model::Instance::name].
101    ///
102    /// # Example
103    /// ```ignore,no_run
104    /// # use google_cloud_lustre_v1::model::Instance;
105    /// # let project_id = "project_id";
106    /// # let location_id = "location_id";
107    /// # let instance_id = "instance_id";
108    /// let x = Instance::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
109    /// ```
110    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.name = v.into();
112        self
113    }
114
115    /// Sets the value of [filesystem][crate::model::Instance::filesystem].
116    ///
117    /// # Example
118    /// ```ignore,no_run
119    /// # use google_cloud_lustre_v1::model::Instance;
120    /// let x = Instance::new().set_filesystem("example");
121    /// ```
122    pub fn set_filesystem<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123        self.filesystem = v.into();
124        self
125    }
126
127    /// Sets the value of [capacity_gib][crate::model::Instance::capacity_gib].
128    ///
129    /// # Example
130    /// ```ignore,no_run
131    /// # use google_cloud_lustre_v1::model::Instance;
132    /// let x = Instance::new().set_capacity_gib(42);
133    /// ```
134    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
135        self.capacity_gib = v.into();
136        self
137    }
138
139    /// Sets the value of [network][crate::model::Instance::network].
140    ///
141    /// # Example
142    /// ```ignore,no_run
143    /// # use google_cloud_lustre_v1::model::Instance;
144    /// let x = Instance::new().set_network("example");
145    /// ```
146    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
147        self.network = v.into();
148        self
149    }
150
151    /// Sets the value of [state][crate::model::Instance::state].
152    ///
153    /// # Example
154    /// ```ignore,no_run
155    /// # use google_cloud_lustre_v1::model::Instance;
156    /// use google_cloud_lustre_v1::model::instance::State;
157    /// let x0 = Instance::new().set_state(State::Active);
158    /// let x1 = Instance::new().set_state(State::Creating);
159    /// let x2 = Instance::new().set_state(State::Deleting);
160    /// ```
161    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
162        self.state = v.into();
163        self
164    }
165
166    /// Sets the value of [mount_point][crate::model::Instance::mount_point].
167    ///
168    /// # Example
169    /// ```ignore,no_run
170    /// # use google_cloud_lustre_v1::model::Instance;
171    /// let x = Instance::new().set_mount_point("example");
172    /// ```
173    pub fn set_mount_point<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
174        self.mount_point = v.into();
175        self
176    }
177
178    /// Sets the value of [create_time][crate::model::Instance::create_time].
179    ///
180    /// # Example
181    /// ```ignore,no_run
182    /// # use google_cloud_lustre_v1::model::Instance;
183    /// use wkt::Timestamp;
184    /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
185    /// ```
186    pub fn set_create_time<T>(mut self, v: T) -> Self
187    where
188        T: std::convert::Into<wkt::Timestamp>,
189    {
190        self.create_time = std::option::Option::Some(v.into());
191        self
192    }
193
194    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
195    ///
196    /// # Example
197    /// ```ignore,no_run
198    /// # use google_cloud_lustre_v1::model::Instance;
199    /// use wkt::Timestamp;
200    /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
201    /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
202    /// ```
203    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
204    where
205        T: std::convert::Into<wkt::Timestamp>,
206    {
207        self.create_time = v.map(|x| x.into());
208        self
209    }
210
211    /// Sets the value of [update_time][crate::model::Instance::update_time].
212    ///
213    /// # Example
214    /// ```ignore,no_run
215    /// # use google_cloud_lustre_v1::model::Instance;
216    /// use wkt::Timestamp;
217    /// let x = Instance::new().set_update_time(Timestamp::default()/* use setters */);
218    /// ```
219    pub fn set_update_time<T>(mut self, v: T) -> Self
220    where
221        T: std::convert::Into<wkt::Timestamp>,
222    {
223        self.update_time = std::option::Option::Some(v.into());
224        self
225    }
226
227    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
228    ///
229    /// # Example
230    /// ```ignore,no_run
231    /// # use google_cloud_lustre_v1::model::Instance;
232    /// use wkt::Timestamp;
233    /// let x = Instance::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
234    /// let x = Instance::new().set_or_clear_update_time(None::<Timestamp>);
235    /// ```
236    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
237    where
238        T: std::convert::Into<wkt::Timestamp>,
239    {
240        self.update_time = v.map(|x| x.into());
241        self
242    }
243
244    /// Sets the value of [description][crate::model::Instance::description].
245    ///
246    /// # Example
247    /// ```ignore,no_run
248    /// # use google_cloud_lustre_v1::model::Instance;
249    /// let x = Instance::new().set_description("example");
250    /// ```
251    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
252        self.description = v.into();
253        self
254    }
255
256    /// Sets the value of [labels][crate::model::Instance::labels].
257    ///
258    /// # Example
259    /// ```ignore,no_run
260    /// # use google_cloud_lustre_v1::model::Instance;
261    /// let x = Instance::new().set_labels([
262    ///     ("key0", "abc"),
263    ///     ("key1", "xyz"),
264    /// ]);
265    /// ```
266    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
267    where
268        T: std::iter::IntoIterator<Item = (K, V)>,
269        K: std::convert::Into<std::string::String>,
270        V: std::convert::Into<std::string::String>,
271    {
272        use std::iter::Iterator;
273        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
274        self
275    }
276
277    /// Sets the value of [per_unit_storage_throughput][crate::model::Instance::per_unit_storage_throughput].
278    ///
279    /// # Example
280    /// ```ignore,no_run
281    /// # use google_cloud_lustre_v1::model::Instance;
282    /// let x = Instance::new().set_per_unit_storage_throughput(42);
283    /// ```
284    pub fn set_per_unit_storage_throughput<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
285        self.per_unit_storage_throughput = v.into();
286        self
287    }
288
289    /// Sets the value of [gke_support_enabled][crate::model::Instance::gke_support_enabled].
290    ///
291    /// # Example
292    /// ```ignore,no_run
293    /// # use google_cloud_lustre_v1::model::Instance;
294    /// let x = Instance::new().set_gke_support_enabled(true);
295    /// ```
296    #[deprecated]
297    pub fn set_gke_support_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
298        self.gke_support_enabled = v.into();
299        self
300    }
301}
302
303impl wkt::message::Message for Instance {
304    fn typename() -> &'static str {
305        "type.googleapis.com/google.cloud.lustre.v1.Instance"
306    }
307}
308
309/// Defines additional types related to [Instance].
310pub mod instance {
311    #[allow(unused_imports)]
312    use super::*;
313
314    /// The possible states of an instance.
315    ///
316    /// # Working with unknown values
317    ///
318    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
319    /// additional enum variants at any time. Adding new variants is not considered
320    /// a breaking change. Applications should write their code in anticipation of:
321    ///
322    /// - New values appearing in future releases of the client library, **and**
323    /// - New values received dynamically, without application changes.
324    ///
325    /// Please consult the [Working with enums] section in the user guide for some
326    /// guidelines.
327    ///
328    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
329    #[derive(Clone, Debug, PartialEq)]
330    #[non_exhaustive]
331    pub enum State {
332        /// Not set.
333        Unspecified,
334        /// The instance is available for use.
335        Active,
336        /// The instance is being created and is not yet ready for use.
337        Creating,
338        /// The instance is being deleted.
339        Deleting,
340        /// The instance is being upgraded.
341        Upgrading,
342        /// The instance is being repaired.
343        Repairing,
344        /// The instance is stopped.
345        Stopped,
346        /// The instance is being updated.
347        Updating,
348        /// If set, the enum was initialized with an unknown value.
349        ///
350        /// Applications can examine the value using [State::value] or
351        /// [State::name].
352        UnknownValue(state::UnknownValue),
353    }
354
355    #[doc(hidden)]
356    pub mod state {
357        #[allow(unused_imports)]
358        use super::*;
359        #[derive(Clone, Debug, PartialEq)]
360        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
361    }
362
363    impl State {
364        /// Gets the enum value.
365        ///
366        /// Returns `None` if the enum contains an unknown value deserialized from
367        /// the string representation of enums.
368        pub fn value(&self) -> std::option::Option<i32> {
369            match self {
370                Self::Unspecified => std::option::Option::Some(0),
371                Self::Active => std::option::Option::Some(1),
372                Self::Creating => std::option::Option::Some(2),
373                Self::Deleting => std::option::Option::Some(3),
374                Self::Upgrading => std::option::Option::Some(4),
375                Self::Repairing => std::option::Option::Some(5),
376                Self::Stopped => std::option::Option::Some(6),
377                Self::Updating => std::option::Option::Some(7),
378                Self::UnknownValue(u) => u.0.value(),
379            }
380        }
381
382        /// Gets the enum value as a string.
383        ///
384        /// Returns `None` if the enum contains an unknown value deserialized from
385        /// the integer representation of enums.
386        pub fn name(&self) -> std::option::Option<&str> {
387            match self {
388                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
389                Self::Active => std::option::Option::Some("ACTIVE"),
390                Self::Creating => std::option::Option::Some("CREATING"),
391                Self::Deleting => std::option::Option::Some("DELETING"),
392                Self::Upgrading => std::option::Option::Some("UPGRADING"),
393                Self::Repairing => std::option::Option::Some("REPAIRING"),
394                Self::Stopped => std::option::Option::Some("STOPPED"),
395                Self::Updating => std::option::Option::Some("UPDATING"),
396                Self::UnknownValue(u) => u.0.name(),
397            }
398        }
399    }
400
401    impl std::default::Default for State {
402        fn default() -> Self {
403            use std::convert::From;
404            Self::from(0)
405        }
406    }
407
408    impl std::fmt::Display for State {
409        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
410            wkt::internal::display_enum(f, self.name(), self.value())
411        }
412    }
413
414    impl std::convert::From<i32> for State {
415        fn from(value: i32) -> Self {
416            match value {
417                0 => Self::Unspecified,
418                1 => Self::Active,
419                2 => Self::Creating,
420                3 => Self::Deleting,
421                4 => Self::Upgrading,
422                5 => Self::Repairing,
423                6 => Self::Stopped,
424                7 => Self::Updating,
425                _ => Self::UnknownValue(state::UnknownValue(
426                    wkt::internal::UnknownEnumValue::Integer(value),
427                )),
428            }
429        }
430    }
431
432    impl std::convert::From<&str> for State {
433        fn from(value: &str) -> Self {
434            use std::string::ToString;
435            match value {
436                "STATE_UNSPECIFIED" => Self::Unspecified,
437                "ACTIVE" => Self::Active,
438                "CREATING" => Self::Creating,
439                "DELETING" => Self::Deleting,
440                "UPGRADING" => Self::Upgrading,
441                "REPAIRING" => Self::Repairing,
442                "STOPPED" => Self::Stopped,
443                "UPDATING" => Self::Updating,
444                _ => Self::UnknownValue(state::UnknownValue(
445                    wkt::internal::UnknownEnumValue::String(value.to_string()),
446                )),
447            }
448        }
449    }
450
451    impl serde::ser::Serialize for State {
452        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
453        where
454            S: serde::Serializer,
455        {
456            match self {
457                Self::Unspecified => serializer.serialize_i32(0),
458                Self::Active => serializer.serialize_i32(1),
459                Self::Creating => serializer.serialize_i32(2),
460                Self::Deleting => serializer.serialize_i32(3),
461                Self::Upgrading => serializer.serialize_i32(4),
462                Self::Repairing => serializer.serialize_i32(5),
463                Self::Stopped => serializer.serialize_i32(6),
464                Self::Updating => serializer.serialize_i32(7),
465                Self::UnknownValue(u) => u.0.serialize(serializer),
466            }
467        }
468    }
469
470    impl<'de> serde::de::Deserialize<'de> for State {
471        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
472        where
473            D: serde::Deserializer<'de>,
474        {
475            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
476                ".google.cloud.lustre.v1.Instance.State",
477            ))
478        }
479    }
480}
481
482/// Message for requesting list of Instances
483#[derive(Clone, Default, PartialEq)]
484#[non_exhaustive]
485pub struct ListInstancesRequest {
486    /// Required. The project and location for which to retrieve a list of
487    /// instances, in the format `projects/{projectId}/locations/{location}`.
488    ///
489    /// To retrieve instance information for all locations, use "-" as the value
490    /// of `{location}`.
491    pub parent: std::string::String,
492
493    /// Optional. Requested page size. Server might return fewer items than
494    /// requested. If unspecified, the server will pick an appropriate default.
495    pub page_size: i32,
496
497    /// Optional. A token identifying a page of results the server should return.
498    pub page_token: std::string::String,
499
500    /// Optional. Filtering results.
501    pub filter: std::string::String,
502
503    /// Optional. Desired order of results.
504    pub order_by: std::string::String,
505
506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
507}
508
509impl ListInstancesRequest {
510    /// Creates a new default instance.
511    pub fn new() -> Self {
512        std::default::Default::default()
513    }
514
515    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
516    ///
517    /// # Example
518    /// ```ignore,no_run
519    /// # use google_cloud_lustre_v1::model::ListInstancesRequest;
520    /// # let project_id = "project_id";
521    /// # let location_id = "location_id";
522    /// let x = ListInstancesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
523    /// ```
524    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
525        self.parent = v.into();
526        self
527    }
528
529    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
530    ///
531    /// # Example
532    /// ```ignore,no_run
533    /// # use google_cloud_lustre_v1::model::ListInstancesRequest;
534    /// let x = ListInstancesRequest::new().set_page_size(42);
535    /// ```
536    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
537        self.page_size = v.into();
538        self
539    }
540
541    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
542    ///
543    /// # Example
544    /// ```ignore,no_run
545    /// # use google_cloud_lustre_v1::model::ListInstancesRequest;
546    /// let x = ListInstancesRequest::new().set_page_token("example");
547    /// ```
548    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
549        self.page_token = v.into();
550        self
551    }
552
553    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
554    ///
555    /// # Example
556    /// ```ignore,no_run
557    /// # use google_cloud_lustre_v1::model::ListInstancesRequest;
558    /// let x = ListInstancesRequest::new().set_filter("example");
559    /// ```
560    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
561        self.filter = v.into();
562        self
563    }
564
565    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
566    ///
567    /// # Example
568    /// ```ignore,no_run
569    /// # use google_cloud_lustre_v1::model::ListInstancesRequest;
570    /// let x = ListInstancesRequest::new().set_order_by("example");
571    /// ```
572    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
573        self.order_by = v.into();
574        self
575    }
576}
577
578impl wkt::message::Message for ListInstancesRequest {
579    fn typename() -> &'static str {
580        "type.googleapis.com/google.cloud.lustre.v1.ListInstancesRequest"
581    }
582}
583
584/// Message for response to listing Instances
585#[derive(Clone, Default, PartialEq)]
586#[non_exhaustive]
587pub struct ListInstancesResponse {
588    /// Response from [ListInstances][google.cloud.lustre.v1.Lustre.ListInstances].
589    ///
590    /// [google.cloud.lustre.v1.Lustre.ListInstances]: crate::client::Lustre::list_instances
591    pub instances: std::vec::Vec<crate::model::Instance>,
592
593    /// A token identifying a page of results the server should return.
594    pub next_page_token: std::string::String,
595
596    /// Unordered list. Locations that could not be reached.
597    pub unreachable: std::vec::Vec<std::string::String>,
598
599    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
600}
601
602impl ListInstancesResponse {
603    /// Creates a new default instance.
604    pub fn new() -> Self {
605        std::default::Default::default()
606    }
607
608    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
609    ///
610    /// # Example
611    /// ```ignore,no_run
612    /// # use google_cloud_lustre_v1::model::ListInstancesResponse;
613    /// use google_cloud_lustre_v1::model::Instance;
614    /// let x = ListInstancesResponse::new()
615    ///     .set_instances([
616    ///         Instance::default()/* use setters */,
617    ///         Instance::default()/* use (different) setters */,
618    ///     ]);
619    /// ```
620    pub fn set_instances<T, V>(mut self, v: T) -> Self
621    where
622        T: std::iter::IntoIterator<Item = V>,
623        V: std::convert::Into<crate::model::Instance>,
624    {
625        use std::iter::Iterator;
626        self.instances = v.into_iter().map(|i| i.into()).collect();
627        self
628    }
629
630    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
631    ///
632    /// # Example
633    /// ```ignore,no_run
634    /// # use google_cloud_lustre_v1::model::ListInstancesResponse;
635    /// let x = ListInstancesResponse::new().set_next_page_token("example");
636    /// ```
637    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
638        self.next_page_token = v.into();
639        self
640    }
641
642    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
643    ///
644    /// # Example
645    /// ```ignore,no_run
646    /// # use google_cloud_lustre_v1::model::ListInstancesResponse;
647    /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
648    /// ```
649    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
650    where
651        T: std::iter::IntoIterator<Item = V>,
652        V: std::convert::Into<std::string::String>,
653    {
654        use std::iter::Iterator;
655        self.unreachable = v.into_iter().map(|i| i.into()).collect();
656        self
657    }
658}
659
660impl wkt::message::Message for ListInstancesResponse {
661    fn typename() -> &'static str {
662        "type.googleapis.com/google.cloud.lustre.v1.ListInstancesResponse"
663    }
664}
665
666#[doc(hidden)]
667impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
668    type PageItem = crate::model::Instance;
669
670    fn items(self) -> std::vec::Vec<Self::PageItem> {
671        self.instances
672    }
673
674    fn next_page_token(&self) -> std::string::String {
675        use std::clone::Clone;
676        self.next_page_token.clone()
677    }
678}
679
680/// Message for getting a Instance
681#[derive(Clone, Default, PartialEq)]
682#[non_exhaustive]
683pub struct GetInstanceRequest {
684    /// Required. The instance resource name, in the format
685    /// `projects/{projectId}/locations/{location}/instances/{instanceId}`.
686    pub name: std::string::String,
687
688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
689}
690
691impl GetInstanceRequest {
692    /// Creates a new default instance.
693    pub fn new() -> Self {
694        std::default::Default::default()
695    }
696
697    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
698    ///
699    /// # Example
700    /// ```ignore,no_run
701    /// # use google_cloud_lustre_v1::model::GetInstanceRequest;
702    /// # let project_id = "project_id";
703    /// # let location_id = "location_id";
704    /// # let instance_id = "instance_id";
705    /// let x = GetInstanceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
706    /// ```
707    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
708        self.name = v.into();
709        self
710    }
711}
712
713impl wkt::message::Message for GetInstanceRequest {
714    fn typename() -> &'static str {
715        "type.googleapis.com/google.cloud.lustre.v1.GetInstanceRequest"
716    }
717}
718
719/// Message for creating a Instance
720#[derive(Clone, Default, PartialEq)]
721#[non_exhaustive]
722pub struct CreateInstanceRequest {
723    /// Required. The instance's project and location, in the format
724    /// `projects/{project}/locations/{location}`. Locations map to Google Cloud
725    /// zones; for example, `us-west1-b`.
726    pub parent: std::string::String,
727
728    /// Required. The name of the Managed Lustre instance.
729    ///
730    /// * Must contain only lowercase letters, numbers, and hyphens.
731    /// * Must start with a letter.
732    /// * Must be between 1-63 characters.
733    /// * Must end with a number or a letter.
734    pub instance_id: std::string::String,
735
736    /// Required. The resource being created
737    pub instance: std::option::Option<crate::model::Instance>,
738
739    /// Optional. An optional request ID to identify requests. Specify a unique
740    /// request ID so that if you must retry your request, the server will know to
741    /// ignore the request if it has already been completed. The server will
742    /// guarantee that for at least 60 minutes since the first request.
743    ///
744    /// For example, consider a situation where you make an initial request and the
745    /// request times out. If you make the request again with the same request
746    /// ID, the server can check if original operation with the same request ID
747    /// was received, and if so, will ignore the second request. This prevents
748    /// clients from accidentally creating duplicate commitments.
749    ///
750    /// The request ID must be a valid UUID with the exception that zero UUID is
751    /// not supported (00000000-0000-0000-0000-000000000000).
752    pub request_id: std::string::String,
753
754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
755}
756
757impl CreateInstanceRequest {
758    /// Creates a new default instance.
759    pub fn new() -> Self {
760        std::default::Default::default()
761    }
762
763    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
764    ///
765    /// # Example
766    /// ```ignore,no_run
767    /// # use google_cloud_lustre_v1::model::CreateInstanceRequest;
768    /// # let project_id = "project_id";
769    /// # let location_id = "location_id";
770    /// let x = CreateInstanceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
771    /// ```
772    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
773        self.parent = v.into();
774        self
775    }
776
777    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
778    ///
779    /// # Example
780    /// ```ignore,no_run
781    /// # use google_cloud_lustre_v1::model::CreateInstanceRequest;
782    /// let x = CreateInstanceRequest::new().set_instance_id("example");
783    /// ```
784    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
785        self.instance_id = v.into();
786        self
787    }
788
789    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
790    ///
791    /// # Example
792    /// ```ignore,no_run
793    /// # use google_cloud_lustre_v1::model::CreateInstanceRequest;
794    /// use google_cloud_lustre_v1::model::Instance;
795    /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
796    /// ```
797    pub fn set_instance<T>(mut self, v: T) -> Self
798    where
799        T: std::convert::Into<crate::model::Instance>,
800    {
801        self.instance = std::option::Option::Some(v.into());
802        self
803    }
804
805    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
806    ///
807    /// # Example
808    /// ```ignore,no_run
809    /// # use google_cloud_lustre_v1::model::CreateInstanceRequest;
810    /// use google_cloud_lustre_v1::model::Instance;
811    /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
812    /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
813    /// ```
814    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
815    where
816        T: std::convert::Into<crate::model::Instance>,
817    {
818        self.instance = v.map(|x| x.into());
819        self
820    }
821
822    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
823    ///
824    /// # Example
825    /// ```ignore,no_run
826    /// # use google_cloud_lustre_v1::model::CreateInstanceRequest;
827    /// let x = CreateInstanceRequest::new().set_request_id("example");
828    /// ```
829    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
830        self.request_id = v.into();
831        self
832    }
833}
834
835impl wkt::message::Message for CreateInstanceRequest {
836    fn typename() -> &'static str {
837        "type.googleapis.com/google.cloud.lustre.v1.CreateInstanceRequest"
838    }
839}
840
841/// Message for updating a Instance
842#[derive(Clone, Default, PartialEq)]
843#[non_exhaustive]
844pub struct UpdateInstanceRequest {
845    /// Optional. Specifies the fields to be overwritten in the instance resource
846    /// by the update.
847    ///
848    /// The fields specified in the update_mask are relative to the resource, not
849    /// the full request. A field will be overwritten if it is in the mask. If no
850    /// mask is provided then all fields present in the request are
851    /// overwritten.
852    pub update_mask: std::option::Option<wkt::FieldMask>,
853
854    /// Required. The resource name of the instance to update, in the format
855    /// `projects/{projectId}/locations/{location}/instances/{instanceId}`.
856    pub instance: std::option::Option<crate::model::Instance>,
857
858    /// Optional. An optional request ID to identify requests. Specify a unique
859    /// request ID so that if you must retry your request, the server will know to
860    /// ignore the request if it has already been completed. The server will
861    /// guarantee that for at least 60 minutes since the first request.
862    ///
863    /// For example, consider a situation where you make an initial request and the
864    /// request times out. If you make the request again with the same request
865    /// ID, the server can check if original operation with the same request ID
866    /// was received, and if so, will ignore the second request. This prevents
867    /// clients from accidentally creating duplicate commitments.
868    ///
869    /// The request ID must be a valid UUID with the exception that zero UUID is
870    /// not supported (00000000-0000-0000-0000-000000000000).
871    pub request_id: std::string::String,
872
873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
874}
875
876impl UpdateInstanceRequest {
877    /// Creates a new default instance.
878    pub fn new() -> Self {
879        std::default::Default::default()
880    }
881
882    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
883    ///
884    /// # Example
885    /// ```ignore,no_run
886    /// # use google_cloud_lustre_v1::model::UpdateInstanceRequest;
887    /// use wkt::FieldMask;
888    /// let x = UpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
889    /// ```
890    pub fn set_update_mask<T>(mut self, v: T) -> Self
891    where
892        T: std::convert::Into<wkt::FieldMask>,
893    {
894        self.update_mask = std::option::Option::Some(v.into());
895        self
896    }
897
898    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
899    ///
900    /// # Example
901    /// ```ignore,no_run
902    /// # use google_cloud_lustre_v1::model::UpdateInstanceRequest;
903    /// use wkt::FieldMask;
904    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
905    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
906    /// ```
907    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
908    where
909        T: std::convert::Into<wkt::FieldMask>,
910    {
911        self.update_mask = v.map(|x| x.into());
912        self
913    }
914
915    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
916    ///
917    /// # Example
918    /// ```ignore,no_run
919    /// # use google_cloud_lustre_v1::model::UpdateInstanceRequest;
920    /// use google_cloud_lustre_v1::model::Instance;
921    /// let x = UpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
922    /// ```
923    pub fn set_instance<T>(mut self, v: T) -> Self
924    where
925        T: std::convert::Into<crate::model::Instance>,
926    {
927        self.instance = std::option::Option::Some(v.into());
928        self
929    }
930
931    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
932    ///
933    /// # Example
934    /// ```ignore,no_run
935    /// # use google_cloud_lustre_v1::model::UpdateInstanceRequest;
936    /// use google_cloud_lustre_v1::model::Instance;
937    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
938    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
939    /// ```
940    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
941    where
942        T: std::convert::Into<crate::model::Instance>,
943    {
944        self.instance = v.map(|x| x.into());
945        self
946    }
947
948    /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
949    ///
950    /// # Example
951    /// ```ignore,no_run
952    /// # use google_cloud_lustre_v1::model::UpdateInstanceRequest;
953    /// let x = UpdateInstanceRequest::new().set_request_id("example");
954    /// ```
955    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
956        self.request_id = v.into();
957        self
958    }
959}
960
961impl wkt::message::Message for UpdateInstanceRequest {
962    fn typename() -> &'static str {
963        "type.googleapis.com/google.cloud.lustre.v1.UpdateInstanceRequest"
964    }
965}
966
967/// Message for deleting a Instance
968#[derive(Clone, Default, PartialEq)]
969#[non_exhaustive]
970pub struct DeleteInstanceRequest {
971    /// Required. The resource name of the instance to delete, in the format
972    /// `projects/{projectId}/locations/{location}/instances/{instanceId}`.
973    pub name: std::string::String,
974
975    /// Optional. An optional request ID to identify requests. Specify a unique
976    /// request ID so that if you must retry your request, the server will know to
977    /// ignore the request if it has already been completed. The server will
978    /// guarantee that for at least 60 minutes after the first request.
979    ///
980    /// For example, consider a situation where you make an initial request and the
981    /// request times out. If you make the request again with the same request
982    /// ID, the server can check if original operation with the same request ID
983    /// was received, and if so, will ignore the second request. This prevents
984    /// clients from accidentally creating duplicate commitments.
985    ///
986    /// The request ID must be a valid UUID with the exception that zero UUID is
987    /// not supported (00000000-0000-0000-0000-000000000000).
988    pub request_id: std::string::String,
989
990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
991}
992
993impl DeleteInstanceRequest {
994    /// Creates a new default instance.
995    pub fn new() -> Self {
996        std::default::Default::default()
997    }
998
999    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
1000    ///
1001    /// # Example
1002    /// ```ignore,no_run
1003    /// # use google_cloud_lustre_v1::model::DeleteInstanceRequest;
1004    /// # let project_id = "project_id";
1005    /// # let location_id = "location_id";
1006    /// # let instance_id = "instance_id";
1007    /// let x = DeleteInstanceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
1008    /// ```
1009    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1010        self.name = v.into();
1011        self
1012    }
1013
1014    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
1015    ///
1016    /// # Example
1017    /// ```ignore,no_run
1018    /// # use google_cloud_lustre_v1::model::DeleteInstanceRequest;
1019    /// let x = DeleteInstanceRequest::new().set_request_id("example");
1020    /// ```
1021    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1022        self.request_id = v.into();
1023        self
1024    }
1025}
1026
1027impl wkt::message::Message for DeleteInstanceRequest {
1028    fn typename() -> &'static str {
1029        "type.googleapis.com/google.cloud.lustre.v1.DeleteInstanceRequest"
1030    }
1031}
1032
1033/// Represents the metadata of a long-running operation.
1034#[derive(Clone, Default, PartialEq)]
1035#[non_exhaustive]
1036pub struct OperationMetadata {
1037    /// Output only. The time the operation was created.
1038    pub create_time: std::option::Option<wkt::Timestamp>,
1039
1040    /// Output only. The time the operation finished running.
1041    pub end_time: std::option::Option<wkt::Timestamp>,
1042
1043    /// Output only. Server-defined resource path for the target of the operation.
1044    pub target: std::string::String,
1045
1046    /// Output only. Name of the verb executed by the operation.
1047    pub verb: std::string::String,
1048
1049    /// Output only. Human-readable status of the operation, if any.
1050    pub status_message: std::string::String,
1051
1052    /// Output only. Identifies whether the user has requested cancellation
1053    /// of the operation. Operations that have been cancelled successfully
1054    /// have [Operation.error][] value with a
1055    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1056    /// `Code.CANCELLED`.
1057    pub requested_cancellation: bool,
1058
1059    /// Output only. API version used to start the operation.
1060    pub api_version: std::string::String,
1061
1062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1063}
1064
1065impl OperationMetadata {
1066    /// Creates a new default instance.
1067    pub fn new() -> Self {
1068        std::default::Default::default()
1069    }
1070
1071    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1072    ///
1073    /// # Example
1074    /// ```ignore,no_run
1075    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1076    /// use wkt::Timestamp;
1077    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1078    /// ```
1079    pub fn set_create_time<T>(mut self, v: T) -> Self
1080    where
1081        T: std::convert::Into<wkt::Timestamp>,
1082    {
1083        self.create_time = std::option::Option::Some(v.into());
1084        self
1085    }
1086
1087    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1088    ///
1089    /// # Example
1090    /// ```ignore,no_run
1091    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1092    /// use wkt::Timestamp;
1093    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1094    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1095    /// ```
1096    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1097    where
1098        T: std::convert::Into<wkt::Timestamp>,
1099    {
1100        self.create_time = v.map(|x| x.into());
1101        self
1102    }
1103
1104    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1105    ///
1106    /// # Example
1107    /// ```ignore,no_run
1108    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1109    /// use wkt::Timestamp;
1110    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1111    /// ```
1112    pub fn set_end_time<T>(mut self, v: T) -> Self
1113    where
1114        T: std::convert::Into<wkt::Timestamp>,
1115    {
1116        self.end_time = std::option::Option::Some(v.into());
1117        self
1118    }
1119
1120    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1121    ///
1122    /// # Example
1123    /// ```ignore,no_run
1124    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1125    /// use wkt::Timestamp;
1126    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1127    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1128    /// ```
1129    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1130    where
1131        T: std::convert::Into<wkt::Timestamp>,
1132    {
1133        self.end_time = v.map(|x| x.into());
1134        self
1135    }
1136
1137    /// Sets the value of [target][crate::model::OperationMetadata::target].
1138    ///
1139    /// # Example
1140    /// ```ignore,no_run
1141    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1142    /// let x = OperationMetadata::new().set_target("example");
1143    /// ```
1144    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145        self.target = v.into();
1146        self
1147    }
1148
1149    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1150    ///
1151    /// # Example
1152    /// ```ignore,no_run
1153    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1154    /// let x = OperationMetadata::new().set_verb("example");
1155    /// ```
1156    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1157        self.verb = v.into();
1158        self
1159    }
1160
1161    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1162    ///
1163    /// # Example
1164    /// ```ignore,no_run
1165    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1166    /// let x = OperationMetadata::new().set_status_message("example");
1167    /// ```
1168    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1169        self.status_message = v.into();
1170        self
1171    }
1172
1173    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1174    ///
1175    /// # Example
1176    /// ```ignore,no_run
1177    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1178    /// let x = OperationMetadata::new().set_requested_cancellation(true);
1179    /// ```
1180    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1181        self.requested_cancellation = v.into();
1182        self
1183    }
1184
1185    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1186    ///
1187    /// # Example
1188    /// ```ignore,no_run
1189    /// # use google_cloud_lustre_v1::model::OperationMetadata;
1190    /// let x = OperationMetadata::new().set_api_version("example");
1191    /// ```
1192    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1193        self.api_version = v.into();
1194        self
1195    }
1196}
1197
1198impl wkt::message::Message for OperationMetadata {
1199    fn typename() -> &'static str {
1200        "type.googleapis.com/google.cloud.lustre.v1.OperationMetadata"
1201    }
1202}
1203
1204/// Message for importing data to Lustre.
1205#[derive(Clone, Default, PartialEq)]
1206#[non_exhaustive]
1207pub struct ImportDataRequest {
1208    /// Required. The name of the Managed Lustre instance in the format
1209    /// `projects/{project}/locations/{location}/instances/{instance}`.
1210    pub name: std::string::String,
1211
1212    /// Optional. UUID to identify requests.
1213    pub request_id: std::string::String,
1214
1215    /// Optional. User-specified service account used to perform the transfer.
1216    /// If unspecified, the default Managed Lustre service agent will be used.
1217    pub service_account: std::string::String,
1218
1219    /// A Cloud Storage URI of a folder to import file data from, in the
1220    /// form of `gs://<bucket_name>/<path_inside_bucket>/`.
1221    pub source: std::option::Option<crate::model::import_data_request::Source>,
1222
1223    /// The destination of the data transfer.
1224    pub destination: std::option::Option<crate::model::import_data_request::Destination>,
1225
1226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1227}
1228
1229impl ImportDataRequest {
1230    /// Creates a new default instance.
1231    pub fn new() -> Self {
1232        std::default::Default::default()
1233    }
1234
1235    /// Sets the value of [name][crate::model::ImportDataRequest::name].
1236    ///
1237    /// # Example
1238    /// ```ignore,no_run
1239    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1240    /// # let project_id = "project_id";
1241    /// # let location_id = "location_id";
1242    /// # let instance_id = "instance_id";
1243    /// let x = ImportDataRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
1244    /// ```
1245    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1246        self.name = v.into();
1247        self
1248    }
1249
1250    /// Sets the value of [request_id][crate::model::ImportDataRequest::request_id].
1251    ///
1252    /// # Example
1253    /// ```ignore,no_run
1254    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1255    /// let x = ImportDataRequest::new().set_request_id("example");
1256    /// ```
1257    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1258        self.request_id = v.into();
1259        self
1260    }
1261
1262    /// Sets the value of [service_account][crate::model::ImportDataRequest::service_account].
1263    ///
1264    /// # Example
1265    /// ```ignore,no_run
1266    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1267    /// let x = ImportDataRequest::new().set_service_account("example");
1268    /// ```
1269    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1270        self.service_account = v.into();
1271        self
1272    }
1273
1274    /// Sets the value of [source][crate::model::ImportDataRequest::source].
1275    ///
1276    /// Note that all the setters affecting `source` are mutually
1277    /// exclusive.
1278    ///
1279    /// # Example
1280    /// ```ignore,no_run
1281    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1282    /// use google_cloud_lustre_v1::model::GcsPath;
1283    /// let x = ImportDataRequest::new().set_source(Some(
1284    ///     google_cloud_lustre_v1::model::import_data_request::Source::GcsPath(GcsPath::default().into())));
1285    /// ```
1286    pub fn set_source<
1287        T: std::convert::Into<std::option::Option<crate::model::import_data_request::Source>>,
1288    >(
1289        mut self,
1290        v: T,
1291    ) -> Self {
1292        self.source = v.into();
1293        self
1294    }
1295
1296    /// The value of [source][crate::model::ImportDataRequest::source]
1297    /// if it holds a `GcsPath`, `None` if the field is not set or
1298    /// holds a different branch.
1299    pub fn gcs_path(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsPath>> {
1300        #[allow(unreachable_patterns)]
1301        self.source.as_ref().and_then(|v| match v {
1302            crate::model::import_data_request::Source::GcsPath(v) => std::option::Option::Some(v),
1303            _ => std::option::Option::None,
1304        })
1305    }
1306
1307    /// Sets the value of [source][crate::model::ImportDataRequest::source]
1308    /// to hold a `GcsPath`.
1309    ///
1310    /// Note that all the setters affecting `source` are
1311    /// mutually exclusive.
1312    ///
1313    /// # Example
1314    /// ```ignore,no_run
1315    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1316    /// use google_cloud_lustre_v1::model::GcsPath;
1317    /// let x = ImportDataRequest::new().set_gcs_path(GcsPath::default()/* use setters */);
1318    /// assert!(x.gcs_path().is_some());
1319    /// ```
1320    pub fn set_gcs_path<T: std::convert::Into<std::boxed::Box<crate::model::GcsPath>>>(
1321        mut self,
1322        v: T,
1323    ) -> Self {
1324        self.source =
1325            std::option::Option::Some(crate::model::import_data_request::Source::GcsPath(v.into()));
1326        self
1327    }
1328
1329    /// Sets the value of [destination][crate::model::ImportDataRequest::destination].
1330    ///
1331    /// Note that all the setters affecting `destination` are mutually
1332    /// exclusive.
1333    ///
1334    /// # Example
1335    /// ```ignore,no_run
1336    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1337    /// use google_cloud_lustre_v1::model::LustrePath;
1338    /// let x = ImportDataRequest::new().set_destination(Some(
1339    ///     google_cloud_lustre_v1::model::import_data_request::Destination::LustrePath(LustrePath::default().into())));
1340    /// ```
1341    pub fn set_destination<
1342        T: std::convert::Into<std::option::Option<crate::model::import_data_request::Destination>>,
1343    >(
1344        mut self,
1345        v: T,
1346    ) -> Self {
1347        self.destination = v.into();
1348        self
1349    }
1350
1351    /// The value of [destination][crate::model::ImportDataRequest::destination]
1352    /// if it holds a `LustrePath`, `None` if the field is not set or
1353    /// holds a different branch.
1354    pub fn lustre_path(&self) -> std::option::Option<&std::boxed::Box<crate::model::LustrePath>> {
1355        #[allow(unreachable_patterns)]
1356        self.destination.as_ref().and_then(|v| match v {
1357            crate::model::import_data_request::Destination::LustrePath(v) => {
1358                std::option::Option::Some(v)
1359            }
1360            _ => std::option::Option::None,
1361        })
1362    }
1363
1364    /// Sets the value of [destination][crate::model::ImportDataRequest::destination]
1365    /// to hold a `LustrePath`.
1366    ///
1367    /// Note that all the setters affecting `destination` are
1368    /// mutually exclusive.
1369    ///
1370    /// # Example
1371    /// ```ignore,no_run
1372    /// # use google_cloud_lustre_v1::model::ImportDataRequest;
1373    /// use google_cloud_lustre_v1::model::LustrePath;
1374    /// let x = ImportDataRequest::new().set_lustre_path(LustrePath::default()/* use setters */);
1375    /// assert!(x.lustre_path().is_some());
1376    /// ```
1377    pub fn set_lustre_path<T: std::convert::Into<std::boxed::Box<crate::model::LustrePath>>>(
1378        mut self,
1379        v: T,
1380    ) -> Self {
1381        self.destination = std::option::Option::Some(
1382            crate::model::import_data_request::Destination::LustrePath(v.into()),
1383        );
1384        self
1385    }
1386}
1387
1388impl wkt::message::Message for ImportDataRequest {
1389    fn typename() -> &'static str {
1390        "type.googleapis.com/google.cloud.lustre.v1.ImportDataRequest"
1391    }
1392}
1393
1394/// Defines additional types related to [ImportDataRequest].
1395pub mod import_data_request {
1396    #[allow(unused_imports)]
1397    use super::*;
1398
1399    /// A Cloud Storage URI of a folder to import file data from, in the
1400    /// form of `gs://<bucket_name>/<path_inside_bucket>/`.
1401    #[derive(Clone, Debug, PartialEq)]
1402    #[non_exhaustive]
1403    pub enum Source {
1404        /// The Cloud Storage source bucket and, optionally, path inside the bucket.
1405        /// If a path inside the bucket is specified, it must end with a forward
1406        /// slash (`/`).
1407        GcsPath(std::boxed::Box<crate::model::GcsPath>),
1408    }
1409
1410    /// The destination of the data transfer.
1411    #[derive(Clone, Debug, PartialEq)]
1412    #[non_exhaustive]
1413    pub enum Destination {
1414        /// Lustre path destination.
1415        LustrePath(std::boxed::Box<crate::model::LustrePath>),
1416    }
1417}
1418
1419/// Export data from Managed Lustre to a Cloud Storage bucket.
1420#[derive(Clone, Default, PartialEq)]
1421#[non_exhaustive]
1422pub struct ExportDataRequest {
1423    /// Required. The name of the Managed Lustre instance in the format
1424    /// `projects/{project}/locations/{location}/instances/{instance}`.
1425    pub name: std::string::String,
1426
1427    /// Optional. UUID to identify requests.
1428    pub request_id: std::string::String,
1429
1430    /// Optional. User-specified service account used to perform the transfer.
1431    /// If unspecified, the Managed Lustre service agent is used.
1432    pub service_account: std::string::String,
1433
1434    /// The source of the data transfer.
1435    pub source: std::option::Option<crate::model::export_data_request::Source>,
1436
1437    /// The destination of the data transfer.
1438    pub destination: std::option::Option<crate::model::export_data_request::Destination>,
1439
1440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1441}
1442
1443impl ExportDataRequest {
1444    /// Creates a new default instance.
1445    pub fn new() -> Self {
1446        std::default::Default::default()
1447    }
1448
1449    /// Sets the value of [name][crate::model::ExportDataRequest::name].
1450    ///
1451    /// # Example
1452    /// ```ignore,no_run
1453    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1454    /// # let project_id = "project_id";
1455    /// # let location_id = "location_id";
1456    /// # let instance_id = "instance_id";
1457    /// let x = ExportDataRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
1458    /// ```
1459    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1460        self.name = v.into();
1461        self
1462    }
1463
1464    /// Sets the value of [request_id][crate::model::ExportDataRequest::request_id].
1465    ///
1466    /// # Example
1467    /// ```ignore,no_run
1468    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1469    /// let x = ExportDataRequest::new().set_request_id("example");
1470    /// ```
1471    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1472        self.request_id = v.into();
1473        self
1474    }
1475
1476    /// Sets the value of [service_account][crate::model::ExportDataRequest::service_account].
1477    ///
1478    /// # Example
1479    /// ```ignore,no_run
1480    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1481    /// let x = ExportDataRequest::new().set_service_account("example");
1482    /// ```
1483    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1484        self.service_account = v.into();
1485        self
1486    }
1487
1488    /// Sets the value of [source][crate::model::ExportDataRequest::source].
1489    ///
1490    /// Note that all the setters affecting `source` are mutually
1491    /// exclusive.
1492    ///
1493    /// # Example
1494    /// ```ignore,no_run
1495    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1496    /// use google_cloud_lustre_v1::model::LustrePath;
1497    /// let x = ExportDataRequest::new().set_source(Some(
1498    ///     google_cloud_lustre_v1::model::export_data_request::Source::LustrePath(LustrePath::default().into())));
1499    /// ```
1500    pub fn set_source<
1501        T: std::convert::Into<std::option::Option<crate::model::export_data_request::Source>>,
1502    >(
1503        mut self,
1504        v: T,
1505    ) -> Self {
1506        self.source = v.into();
1507        self
1508    }
1509
1510    /// The value of [source][crate::model::ExportDataRequest::source]
1511    /// if it holds a `LustrePath`, `None` if the field is not set or
1512    /// holds a different branch.
1513    pub fn lustre_path(&self) -> std::option::Option<&std::boxed::Box<crate::model::LustrePath>> {
1514        #[allow(unreachable_patterns)]
1515        self.source.as_ref().and_then(|v| match v {
1516            crate::model::export_data_request::Source::LustrePath(v) => {
1517                std::option::Option::Some(v)
1518            }
1519            _ => std::option::Option::None,
1520        })
1521    }
1522
1523    /// Sets the value of [source][crate::model::ExportDataRequest::source]
1524    /// to hold a `LustrePath`.
1525    ///
1526    /// Note that all the setters affecting `source` are
1527    /// mutually exclusive.
1528    ///
1529    /// # Example
1530    /// ```ignore,no_run
1531    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1532    /// use google_cloud_lustre_v1::model::LustrePath;
1533    /// let x = ExportDataRequest::new().set_lustre_path(LustrePath::default()/* use setters */);
1534    /// assert!(x.lustre_path().is_some());
1535    /// ```
1536    pub fn set_lustre_path<T: std::convert::Into<std::boxed::Box<crate::model::LustrePath>>>(
1537        mut self,
1538        v: T,
1539    ) -> Self {
1540        self.source = std::option::Option::Some(
1541            crate::model::export_data_request::Source::LustrePath(v.into()),
1542        );
1543        self
1544    }
1545
1546    /// Sets the value of [destination][crate::model::ExportDataRequest::destination].
1547    ///
1548    /// Note that all the setters affecting `destination` are mutually
1549    /// exclusive.
1550    ///
1551    /// # Example
1552    /// ```ignore,no_run
1553    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1554    /// use google_cloud_lustre_v1::model::GcsPath;
1555    /// let x = ExportDataRequest::new().set_destination(Some(
1556    ///     google_cloud_lustre_v1::model::export_data_request::Destination::GcsPath(GcsPath::default().into())));
1557    /// ```
1558    pub fn set_destination<
1559        T: std::convert::Into<std::option::Option<crate::model::export_data_request::Destination>>,
1560    >(
1561        mut self,
1562        v: T,
1563    ) -> Self {
1564        self.destination = v.into();
1565        self
1566    }
1567
1568    /// The value of [destination][crate::model::ExportDataRequest::destination]
1569    /// if it holds a `GcsPath`, `None` if the field is not set or
1570    /// holds a different branch.
1571    pub fn gcs_path(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsPath>> {
1572        #[allow(unreachable_patterns)]
1573        self.destination.as_ref().and_then(|v| match v {
1574            crate::model::export_data_request::Destination::GcsPath(v) => {
1575                std::option::Option::Some(v)
1576            }
1577            _ => std::option::Option::None,
1578        })
1579    }
1580
1581    /// Sets the value of [destination][crate::model::ExportDataRequest::destination]
1582    /// to hold a `GcsPath`.
1583    ///
1584    /// Note that all the setters affecting `destination` are
1585    /// mutually exclusive.
1586    ///
1587    /// # Example
1588    /// ```ignore,no_run
1589    /// # use google_cloud_lustre_v1::model::ExportDataRequest;
1590    /// use google_cloud_lustre_v1::model::GcsPath;
1591    /// let x = ExportDataRequest::new().set_gcs_path(GcsPath::default()/* use setters */);
1592    /// assert!(x.gcs_path().is_some());
1593    /// ```
1594    pub fn set_gcs_path<T: std::convert::Into<std::boxed::Box<crate::model::GcsPath>>>(
1595        mut self,
1596        v: T,
1597    ) -> Self {
1598        self.destination = std::option::Option::Some(
1599            crate::model::export_data_request::Destination::GcsPath(v.into()),
1600        );
1601        self
1602    }
1603}
1604
1605impl wkt::message::Message for ExportDataRequest {
1606    fn typename() -> &'static str {
1607        "type.googleapis.com/google.cloud.lustre.v1.ExportDataRequest"
1608    }
1609}
1610
1611/// Defines additional types related to [ExportDataRequest].
1612pub mod export_data_request {
1613    #[allow(unused_imports)]
1614    use super::*;
1615
1616    /// The source of the data transfer.
1617    #[derive(Clone, Debug, PartialEq)]
1618    #[non_exhaustive]
1619    pub enum Source {
1620        /// The root directory path to the Managed Lustre file system. Must start
1621        /// with `/`. Default is `/`.
1622        LustrePath(std::boxed::Box<crate::model::LustrePath>),
1623    }
1624
1625    /// The destination of the data transfer.
1626    #[derive(Clone, Debug, PartialEq)]
1627    #[non_exhaustive]
1628    pub enum Destination {
1629        /// The URI to a Cloud Storage bucket, or a path within a bucket, using
1630        /// the format `gs://<bucket_name>/<optional_path_inside_bucket>/`. If a
1631        /// path inside the bucket is specified, it must end with a forward slash
1632        /// (`/`).
1633        GcsPath(std::boxed::Box<crate::model::GcsPath>),
1634    }
1635}
1636
1637/// Response message for ExportData.
1638#[derive(Clone, Default, PartialEq)]
1639#[non_exhaustive]
1640pub struct ExportDataResponse {
1641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1642}
1643
1644impl ExportDataResponse {
1645    /// Creates a new default instance.
1646    pub fn new() -> Self {
1647        std::default::Default::default()
1648    }
1649}
1650
1651impl wkt::message::Message for ExportDataResponse {
1652    fn typename() -> &'static str {
1653        "type.googleapis.com/google.cloud.lustre.v1.ExportDataResponse"
1654    }
1655}
1656
1657/// Response message for ImportData.
1658#[derive(Clone, Default, PartialEq)]
1659#[non_exhaustive]
1660pub struct ImportDataResponse {
1661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1662}
1663
1664impl ImportDataResponse {
1665    /// Creates a new default instance.
1666    pub fn new() -> Self {
1667        std::default::Default::default()
1668    }
1669}
1670
1671impl wkt::message::Message for ImportDataResponse {
1672    fn typename() -> &'static str {
1673        "type.googleapis.com/google.cloud.lustre.v1.ImportDataResponse"
1674    }
1675}
1676
1677/// Metadata of the export data operation.
1678#[derive(Clone, Default, PartialEq)]
1679#[non_exhaustive]
1680pub struct ExportDataMetadata {
1681    /// Data transfer operation metadata.
1682    pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
1683
1684    /// Output only. The time the operation was created.
1685    pub create_time: std::option::Option<wkt::Timestamp>,
1686
1687    /// Output only. The time the operation finished running.
1688    pub end_time: std::option::Option<wkt::Timestamp>,
1689
1690    /// Output only. Server-defined resource path for the target of the operation.
1691    pub target: std::string::String,
1692
1693    /// Output only. Name of the verb executed by the operation.
1694    pub verb: std::string::String,
1695
1696    /// Output only. Human-readable status of the operation, if any.
1697    pub status_message: std::string::String,
1698
1699    /// Output only. Identifies whether the user has requested cancellation
1700    /// of the operation. Operations that have successfully been cancelled
1701    /// have
1702    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
1703    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1704    /// corresponding to `Code.CANCELLED`.
1705    ///
1706    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
1707    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
1708    pub requested_cancellation: bool,
1709
1710    /// Output only. API version used to start the operation.
1711    pub api_version: std::string::String,
1712
1713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1714}
1715
1716impl ExportDataMetadata {
1717    /// Creates a new default instance.
1718    pub fn new() -> Self {
1719        std::default::Default::default()
1720    }
1721
1722    /// Sets the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
1723    ///
1724    /// # Example
1725    /// ```ignore,no_run
1726    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1727    /// use google_cloud_lustre_v1::model::TransferOperationMetadata;
1728    /// let x = ExportDataMetadata::new().set_operation_metadata(TransferOperationMetadata::default()/* use setters */);
1729    /// ```
1730    pub fn set_operation_metadata<T>(mut self, v: T) -> Self
1731    where
1732        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1733    {
1734        self.operation_metadata = std::option::Option::Some(v.into());
1735        self
1736    }
1737
1738    /// Sets or clears the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
1739    ///
1740    /// # Example
1741    /// ```ignore,no_run
1742    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1743    /// use google_cloud_lustre_v1::model::TransferOperationMetadata;
1744    /// let x = ExportDataMetadata::new().set_or_clear_operation_metadata(Some(TransferOperationMetadata::default()/* use setters */));
1745    /// let x = ExportDataMetadata::new().set_or_clear_operation_metadata(None::<TransferOperationMetadata>);
1746    /// ```
1747    pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1748    where
1749        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1750    {
1751        self.operation_metadata = v.map(|x| x.into());
1752        self
1753    }
1754
1755    /// Sets the value of [create_time][crate::model::ExportDataMetadata::create_time].
1756    ///
1757    /// # Example
1758    /// ```ignore,no_run
1759    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1760    /// use wkt::Timestamp;
1761    /// let x = ExportDataMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1762    /// ```
1763    pub fn set_create_time<T>(mut self, v: T) -> Self
1764    where
1765        T: std::convert::Into<wkt::Timestamp>,
1766    {
1767        self.create_time = std::option::Option::Some(v.into());
1768        self
1769    }
1770
1771    /// Sets or clears the value of [create_time][crate::model::ExportDataMetadata::create_time].
1772    ///
1773    /// # Example
1774    /// ```ignore,no_run
1775    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1776    /// use wkt::Timestamp;
1777    /// let x = ExportDataMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1778    /// let x = ExportDataMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1779    /// ```
1780    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1781    where
1782        T: std::convert::Into<wkt::Timestamp>,
1783    {
1784        self.create_time = v.map(|x| x.into());
1785        self
1786    }
1787
1788    /// Sets the value of [end_time][crate::model::ExportDataMetadata::end_time].
1789    ///
1790    /// # Example
1791    /// ```ignore,no_run
1792    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1793    /// use wkt::Timestamp;
1794    /// let x = ExportDataMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1795    /// ```
1796    pub fn set_end_time<T>(mut self, v: T) -> Self
1797    where
1798        T: std::convert::Into<wkt::Timestamp>,
1799    {
1800        self.end_time = std::option::Option::Some(v.into());
1801        self
1802    }
1803
1804    /// Sets or clears the value of [end_time][crate::model::ExportDataMetadata::end_time].
1805    ///
1806    /// # Example
1807    /// ```ignore,no_run
1808    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1809    /// use wkt::Timestamp;
1810    /// let x = ExportDataMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1811    /// let x = ExportDataMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1812    /// ```
1813    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1814    where
1815        T: std::convert::Into<wkt::Timestamp>,
1816    {
1817        self.end_time = v.map(|x| x.into());
1818        self
1819    }
1820
1821    /// Sets the value of [target][crate::model::ExportDataMetadata::target].
1822    ///
1823    /// # Example
1824    /// ```ignore,no_run
1825    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1826    /// let x = ExportDataMetadata::new().set_target("example");
1827    /// ```
1828    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1829        self.target = v.into();
1830        self
1831    }
1832
1833    /// Sets the value of [verb][crate::model::ExportDataMetadata::verb].
1834    ///
1835    /// # Example
1836    /// ```ignore,no_run
1837    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1838    /// let x = ExportDataMetadata::new().set_verb("example");
1839    /// ```
1840    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1841        self.verb = v.into();
1842        self
1843    }
1844
1845    /// Sets the value of [status_message][crate::model::ExportDataMetadata::status_message].
1846    ///
1847    /// # Example
1848    /// ```ignore,no_run
1849    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1850    /// let x = ExportDataMetadata::new().set_status_message("example");
1851    /// ```
1852    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1853        self.status_message = v.into();
1854        self
1855    }
1856
1857    /// Sets the value of [requested_cancellation][crate::model::ExportDataMetadata::requested_cancellation].
1858    ///
1859    /// # Example
1860    /// ```ignore,no_run
1861    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1862    /// let x = ExportDataMetadata::new().set_requested_cancellation(true);
1863    /// ```
1864    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1865        self.requested_cancellation = v.into();
1866        self
1867    }
1868
1869    /// Sets the value of [api_version][crate::model::ExportDataMetadata::api_version].
1870    ///
1871    /// # Example
1872    /// ```ignore,no_run
1873    /// # use google_cloud_lustre_v1::model::ExportDataMetadata;
1874    /// let x = ExportDataMetadata::new().set_api_version("example");
1875    /// ```
1876    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1877        self.api_version = v.into();
1878        self
1879    }
1880}
1881
1882impl wkt::message::Message for ExportDataMetadata {
1883    fn typename() -> &'static str {
1884        "type.googleapis.com/google.cloud.lustre.v1.ExportDataMetadata"
1885    }
1886}
1887
1888/// Metadata of the import data operation.
1889#[derive(Clone, Default, PartialEq)]
1890#[non_exhaustive]
1891pub struct ImportDataMetadata {
1892    /// Data transfer operation metadata.
1893    pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
1894
1895    /// Output only. The time the operation was created.
1896    pub create_time: std::option::Option<wkt::Timestamp>,
1897
1898    /// Output only. The time the operation finished running.
1899    pub end_time: std::option::Option<wkt::Timestamp>,
1900
1901    /// Output only. Server-defined resource path for the target of the operation.
1902    pub target: std::string::String,
1903
1904    /// Output only. Name of the verb executed by the operation.
1905    pub status_message: std::string::String,
1906
1907    /// Output only. Identifies whether the user has requested cancellation
1908    /// of the operation. Operations that have successfully been cancelled
1909    /// have
1910    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
1911    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1912    /// corresponding to `Code.CANCELLED`.
1913    ///
1914    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
1915    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
1916    pub requested_cancellation: bool,
1917
1918    /// Output only. API version used to start the operation.
1919    pub api_version: std::string::String,
1920
1921    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1922}
1923
1924impl ImportDataMetadata {
1925    /// Creates a new default instance.
1926    pub fn new() -> Self {
1927        std::default::Default::default()
1928    }
1929
1930    /// Sets the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
1931    ///
1932    /// # Example
1933    /// ```ignore,no_run
1934    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
1935    /// use google_cloud_lustre_v1::model::TransferOperationMetadata;
1936    /// let x = ImportDataMetadata::new().set_operation_metadata(TransferOperationMetadata::default()/* use setters */);
1937    /// ```
1938    pub fn set_operation_metadata<T>(mut self, v: T) -> Self
1939    where
1940        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1941    {
1942        self.operation_metadata = std::option::Option::Some(v.into());
1943        self
1944    }
1945
1946    /// Sets or clears the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
1947    ///
1948    /// # Example
1949    /// ```ignore,no_run
1950    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
1951    /// use google_cloud_lustre_v1::model::TransferOperationMetadata;
1952    /// let x = ImportDataMetadata::new().set_or_clear_operation_metadata(Some(TransferOperationMetadata::default()/* use setters */));
1953    /// let x = ImportDataMetadata::new().set_or_clear_operation_metadata(None::<TransferOperationMetadata>);
1954    /// ```
1955    pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1956    where
1957        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1958    {
1959        self.operation_metadata = v.map(|x| x.into());
1960        self
1961    }
1962
1963    /// Sets the value of [create_time][crate::model::ImportDataMetadata::create_time].
1964    ///
1965    /// # Example
1966    /// ```ignore,no_run
1967    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
1968    /// use wkt::Timestamp;
1969    /// let x = ImportDataMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1970    /// ```
1971    pub fn set_create_time<T>(mut self, v: T) -> Self
1972    where
1973        T: std::convert::Into<wkt::Timestamp>,
1974    {
1975        self.create_time = std::option::Option::Some(v.into());
1976        self
1977    }
1978
1979    /// Sets or clears the value of [create_time][crate::model::ImportDataMetadata::create_time].
1980    ///
1981    /// # Example
1982    /// ```ignore,no_run
1983    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
1984    /// use wkt::Timestamp;
1985    /// let x = ImportDataMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1986    /// let x = ImportDataMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1987    /// ```
1988    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1989    where
1990        T: std::convert::Into<wkt::Timestamp>,
1991    {
1992        self.create_time = v.map(|x| x.into());
1993        self
1994    }
1995
1996    /// Sets the value of [end_time][crate::model::ImportDataMetadata::end_time].
1997    ///
1998    /// # Example
1999    /// ```ignore,no_run
2000    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
2001    /// use wkt::Timestamp;
2002    /// let x = ImportDataMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2003    /// ```
2004    pub fn set_end_time<T>(mut self, v: T) -> Self
2005    where
2006        T: std::convert::Into<wkt::Timestamp>,
2007    {
2008        self.end_time = std::option::Option::Some(v.into());
2009        self
2010    }
2011
2012    /// Sets or clears the value of [end_time][crate::model::ImportDataMetadata::end_time].
2013    ///
2014    /// # Example
2015    /// ```ignore,no_run
2016    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
2017    /// use wkt::Timestamp;
2018    /// let x = ImportDataMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2019    /// let x = ImportDataMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2020    /// ```
2021    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2022    where
2023        T: std::convert::Into<wkt::Timestamp>,
2024    {
2025        self.end_time = v.map(|x| x.into());
2026        self
2027    }
2028
2029    /// Sets the value of [target][crate::model::ImportDataMetadata::target].
2030    ///
2031    /// # Example
2032    /// ```ignore,no_run
2033    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
2034    /// let x = ImportDataMetadata::new().set_target("example");
2035    /// ```
2036    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2037        self.target = v.into();
2038        self
2039    }
2040
2041    /// Sets the value of [status_message][crate::model::ImportDataMetadata::status_message].
2042    ///
2043    /// # Example
2044    /// ```ignore,no_run
2045    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
2046    /// let x = ImportDataMetadata::new().set_status_message("example");
2047    /// ```
2048    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2049        self.status_message = v.into();
2050        self
2051    }
2052
2053    /// Sets the value of [requested_cancellation][crate::model::ImportDataMetadata::requested_cancellation].
2054    ///
2055    /// # Example
2056    /// ```ignore,no_run
2057    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
2058    /// let x = ImportDataMetadata::new().set_requested_cancellation(true);
2059    /// ```
2060    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2061        self.requested_cancellation = v.into();
2062        self
2063    }
2064
2065    /// Sets the value of [api_version][crate::model::ImportDataMetadata::api_version].
2066    ///
2067    /// # Example
2068    /// ```ignore,no_run
2069    /// # use google_cloud_lustre_v1::model::ImportDataMetadata;
2070    /// let x = ImportDataMetadata::new().set_api_version("example");
2071    /// ```
2072    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2073        self.api_version = v.into();
2074        self
2075    }
2076}
2077
2078impl wkt::message::Message for ImportDataMetadata {
2079    fn typename() -> &'static str {
2080        "type.googleapis.com/google.cloud.lustre.v1.ImportDataMetadata"
2081    }
2082}
2083
2084/// Specifies a Cloud Storage bucket and, optionally, a path inside the bucket.
2085#[derive(Clone, Default, PartialEq)]
2086#[non_exhaustive]
2087pub struct GcsPath {
2088    /// Required. The URI to a Cloud Storage bucket, or a path within a bucket,
2089    /// using the format `gs://<bucket_name>/<optional_path_inside_bucket>/`. If a
2090    /// path inside the bucket is specified, it must end with a forward slash
2091    /// (`/`).
2092    pub uri: std::string::String,
2093
2094    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2095}
2096
2097impl GcsPath {
2098    /// Creates a new default instance.
2099    pub fn new() -> Self {
2100        std::default::Default::default()
2101    }
2102
2103    /// Sets the value of [uri][crate::model::GcsPath::uri].
2104    ///
2105    /// # Example
2106    /// ```ignore,no_run
2107    /// # use google_cloud_lustre_v1::model::GcsPath;
2108    /// let x = GcsPath::new().set_uri("example");
2109    /// ```
2110    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2111        self.uri = v.into();
2112        self
2113    }
2114}
2115
2116impl wkt::message::Message for GcsPath {
2117    fn typename() -> &'static str {
2118        "type.googleapis.com/google.cloud.lustre.v1.GcsPath"
2119    }
2120}
2121
2122/// The root directory path to the Lustre file system.
2123#[derive(Clone, Default, PartialEq)]
2124#[non_exhaustive]
2125pub struct LustrePath {
2126    /// Optional. The root directory path to the Managed Lustre file system. Must
2127    /// start with
2128    /// `/`. Default is `/`. If you're importing data into Managed Lustre, any
2129    /// path other than the default must already exist on the file system.
2130    pub path: std::string::String,
2131
2132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2133}
2134
2135impl LustrePath {
2136    /// Creates a new default instance.
2137    pub fn new() -> Self {
2138        std::default::Default::default()
2139    }
2140
2141    /// Sets the value of [path][crate::model::LustrePath::path].
2142    ///
2143    /// # Example
2144    /// ```ignore,no_run
2145    /// # use google_cloud_lustre_v1::model::LustrePath;
2146    /// let x = LustrePath::new().set_path("example");
2147    /// ```
2148    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2149        self.path = v.into();
2150        self
2151    }
2152}
2153
2154impl wkt::message::Message for LustrePath {
2155    fn typename() -> &'static str {
2156        "type.googleapis.com/google.cloud.lustre.v1.LustrePath"
2157    }
2158}
2159
2160/// A collection of counters that report the progress of a transfer operation.
2161#[derive(Clone, Default, PartialEq)]
2162#[non_exhaustive]
2163pub struct TransferCounters {
2164    /// Objects found in the data source that are scheduled to be transferred,
2165    /// excluding any that are filtered based on object conditions or skipped due
2166    /// to sync.
2167    pub found_objects_count: i64,
2168
2169    /// Total number of bytes found in the data source that are scheduled to be
2170    /// transferred, excluding any that are filtered based on object conditions or
2171    /// skipped due to sync.
2172    pub bytes_found_count: i64,
2173
2174    /// Objects in the data source that are not transferred because they already
2175    /// exist in the data destination.
2176    pub objects_skipped_count: i64,
2177
2178    /// Bytes in the data source that are not transferred because they already
2179    /// exist in the data destination.
2180    pub bytes_skipped_count: i64,
2181
2182    /// Objects that are copied to the data destination.
2183    pub objects_copied_count: i64,
2184
2185    /// Bytes that are copied to the data destination.
2186    pub bytes_copied_count: i64,
2187
2188    /// Output only. Objects that are failed to write to the data destination.
2189    pub objects_failed_count: i64,
2190
2191    /// Output only. Bytes that are failed to write to the data destination.
2192    pub bytes_failed_count: i64,
2193
2194    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2195}
2196
2197impl TransferCounters {
2198    /// Creates a new default instance.
2199    pub fn new() -> Self {
2200        std::default::Default::default()
2201    }
2202
2203    /// Sets the value of [found_objects_count][crate::model::TransferCounters::found_objects_count].
2204    ///
2205    /// # Example
2206    /// ```ignore,no_run
2207    /// # use google_cloud_lustre_v1::model::TransferCounters;
2208    /// let x = TransferCounters::new().set_found_objects_count(42);
2209    /// ```
2210    pub fn set_found_objects_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2211        self.found_objects_count = v.into();
2212        self
2213    }
2214
2215    /// Sets the value of [bytes_found_count][crate::model::TransferCounters::bytes_found_count].
2216    ///
2217    /// # Example
2218    /// ```ignore,no_run
2219    /// # use google_cloud_lustre_v1::model::TransferCounters;
2220    /// let x = TransferCounters::new().set_bytes_found_count(42);
2221    /// ```
2222    pub fn set_bytes_found_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2223        self.bytes_found_count = v.into();
2224        self
2225    }
2226
2227    /// Sets the value of [objects_skipped_count][crate::model::TransferCounters::objects_skipped_count].
2228    ///
2229    /// # Example
2230    /// ```ignore,no_run
2231    /// # use google_cloud_lustre_v1::model::TransferCounters;
2232    /// let x = TransferCounters::new().set_objects_skipped_count(42);
2233    /// ```
2234    pub fn set_objects_skipped_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2235        self.objects_skipped_count = v.into();
2236        self
2237    }
2238
2239    /// Sets the value of [bytes_skipped_count][crate::model::TransferCounters::bytes_skipped_count].
2240    ///
2241    /// # Example
2242    /// ```ignore,no_run
2243    /// # use google_cloud_lustre_v1::model::TransferCounters;
2244    /// let x = TransferCounters::new().set_bytes_skipped_count(42);
2245    /// ```
2246    pub fn set_bytes_skipped_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2247        self.bytes_skipped_count = v.into();
2248        self
2249    }
2250
2251    /// Sets the value of [objects_copied_count][crate::model::TransferCounters::objects_copied_count].
2252    ///
2253    /// # Example
2254    /// ```ignore,no_run
2255    /// # use google_cloud_lustre_v1::model::TransferCounters;
2256    /// let x = TransferCounters::new().set_objects_copied_count(42);
2257    /// ```
2258    pub fn set_objects_copied_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2259        self.objects_copied_count = v.into();
2260        self
2261    }
2262
2263    /// Sets the value of [bytes_copied_count][crate::model::TransferCounters::bytes_copied_count].
2264    ///
2265    /// # Example
2266    /// ```ignore,no_run
2267    /// # use google_cloud_lustre_v1::model::TransferCounters;
2268    /// let x = TransferCounters::new().set_bytes_copied_count(42);
2269    /// ```
2270    pub fn set_bytes_copied_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2271        self.bytes_copied_count = v.into();
2272        self
2273    }
2274
2275    /// Sets the value of [objects_failed_count][crate::model::TransferCounters::objects_failed_count].
2276    ///
2277    /// # Example
2278    /// ```ignore,no_run
2279    /// # use google_cloud_lustre_v1::model::TransferCounters;
2280    /// let x = TransferCounters::new().set_objects_failed_count(42);
2281    /// ```
2282    pub fn set_objects_failed_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2283        self.objects_failed_count = v.into();
2284        self
2285    }
2286
2287    /// Sets the value of [bytes_failed_count][crate::model::TransferCounters::bytes_failed_count].
2288    ///
2289    /// # Example
2290    /// ```ignore,no_run
2291    /// # use google_cloud_lustre_v1::model::TransferCounters;
2292    /// let x = TransferCounters::new().set_bytes_failed_count(42);
2293    /// ```
2294    pub fn set_bytes_failed_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2295        self.bytes_failed_count = v.into();
2296        self
2297    }
2298}
2299
2300impl wkt::message::Message for TransferCounters {
2301    fn typename() -> &'static str {
2302        "type.googleapis.com/google.cloud.lustre.v1.TransferCounters"
2303    }
2304}
2305
2306/// An entry describing an error that has occurred.
2307#[derive(Clone, Default, PartialEq)]
2308#[non_exhaustive]
2309pub struct ErrorLogEntry {
2310    /// Required. A URL that refers to the target (a data source, a data sink,
2311    /// or an object) with which the error is associated.
2312    pub uri: std::string::String,
2313
2314    /// A list of messages that carry the error details.
2315    pub error_details: std::vec::Vec<std::string::String>,
2316
2317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2318}
2319
2320impl ErrorLogEntry {
2321    /// Creates a new default instance.
2322    pub fn new() -> Self {
2323        std::default::Default::default()
2324    }
2325
2326    /// Sets the value of [uri][crate::model::ErrorLogEntry::uri].
2327    ///
2328    /// # Example
2329    /// ```ignore,no_run
2330    /// # use google_cloud_lustre_v1::model::ErrorLogEntry;
2331    /// let x = ErrorLogEntry::new().set_uri("example");
2332    /// ```
2333    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2334        self.uri = v.into();
2335        self
2336    }
2337
2338    /// Sets the value of [error_details][crate::model::ErrorLogEntry::error_details].
2339    ///
2340    /// # Example
2341    /// ```ignore,no_run
2342    /// # use google_cloud_lustre_v1::model::ErrorLogEntry;
2343    /// let x = ErrorLogEntry::new().set_error_details(["a", "b", "c"]);
2344    /// ```
2345    pub fn set_error_details<T, V>(mut self, v: T) -> Self
2346    where
2347        T: std::iter::IntoIterator<Item = V>,
2348        V: std::convert::Into<std::string::String>,
2349    {
2350        use std::iter::Iterator;
2351        self.error_details = v.into_iter().map(|i| i.into()).collect();
2352        self
2353    }
2354}
2355
2356impl wkt::message::Message for ErrorLogEntry {
2357    fn typename() -> &'static str {
2358        "type.googleapis.com/google.cloud.lustre.v1.ErrorLogEntry"
2359    }
2360}
2361
2362/// A summary of errors by error code, plus a count and sample error log
2363/// entries.
2364#[derive(Clone, Default, PartialEq)]
2365#[non_exhaustive]
2366pub struct ErrorSummary {
2367    /// Required.
2368    pub error_code: google_cloud_rpc::model::Code,
2369
2370    /// Required. Count of this type of error.
2371    pub error_count: i64,
2372
2373    /// Error samples.
2374    ///
2375    /// At most 5 error log entries are recorded for a given
2376    /// error code for a single transfer operation.
2377    pub error_log_entries: std::vec::Vec<crate::model::ErrorLogEntry>,
2378
2379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2380}
2381
2382impl ErrorSummary {
2383    /// Creates a new default instance.
2384    pub fn new() -> Self {
2385        std::default::Default::default()
2386    }
2387
2388    /// Sets the value of [error_code][crate::model::ErrorSummary::error_code].
2389    ///
2390    /// # Example
2391    /// ```ignore,no_run
2392    /// # use google_cloud_lustre_v1::model::ErrorSummary;
2393    /// use google_cloud_rpc::model::Code;
2394    /// let x0 = ErrorSummary::new().set_error_code(Code::Cancelled);
2395    /// let x1 = ErrorSummary::new().set_error_code(Code::Unknown);
2396    /// let x2 = ErrorSummary::new().set_error_code(Code::InvalidArgument);
2397    /// ```
2398    pub fn set_error_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(
2399        mut self,
2400        v: T,
2401    ) -> Self {
2402        self.error_code = v.into();
2403        self
2404    }
2405
2406    /// Sets the value of [error_count][crate::model::ErrorSummary::error_count].
2407    ///
2408    /// # Example
2409    /// ```ignore,no_run
2410    /// # use google_cloud_lustre_v1::model::ErrorSummary;
2411    /// let x = ErrorSummary::new().set_error_count(42);
2412    /// ```
2413    pub fn set_error_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2414        self.error_count = v.into();
2415        self
2416    }
2417
2418    /// Sets the value of [error_log_entries][crate::model::ErrorSummary::error_log_entries].
2419    ///
2420    /// # Example
2421    /// ```ignore,no_run
2422    /// # use google_cloud_lustre_v1::model::ErrorSummary;
2423    /// use google_cloud_lustre_v1::model::ErrorLogEntry;
2424    /// let x = ErrorSummary::new()
2425    ///     .set_error_log_entries([
2426    ///         ErrorLogEntry::default()/* use setters */,
2427    ///         ErrorLogEntry::default()/* use (different) setters */,
2428    ///     ]);
2429    /// ```
2430    pub fn set_error_log_entries<T, V>(mut self, v: T) -> Self
2431    where
2432        T: std::iter::IntoIterator<Item = V>,
2433        V: std::convert::Into<crate::model::ErrorLogEntry>,
2434    {
2435        use std::iter::Iterator;
2436        self.error_log_entries = v.into_iter().map(|i| i.into()).collect();
2437        self
2438    }
2439}
2440
2441impl wkt::message::Message for ErrorSummary {
2442    fn typename() -> &'static str {
2443        "type.googleapis.com/google.cloud.lustre.v1.ErrorSummary"
2444    }
2445}
2446
2447/// Represents the metadata of the long-running transfer operation.
2448#[derive(Clone, Default, PartialEq)]
2449#[non_exhaustive]
2450pub struct TransferOperationMetadata {
2451    /// Output only. The progress of the transfer operation.
2452    pub counters: std::option::Option<crate::model::TransferCounters>,
2453
2454    /// Output only. The type of transfer occurring.
2455    pub transfer_type: crate::model::TransferType,
2456
2457    /// Output only. Error summary about the transfer operation
2458    pub error_summaries: std::vec::Vec<crate::model::ErrorSummary>,
2459
2460    /// The source of transfer operation.
2461    pub source: std::option::Option<crate::model::transfer_operation_metadata::Source>,
2462
2463    /// The destination of transfer operation.
2464    pub destination: std::option::Option<crate::model::transfer_operation_metadata::Destination>,
2465
2466    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2467}
2468
2469impl TransferOperationMetadata {
2470    /// Creates a new default instance.
2471    pub fn new() -> Self {
2472        std::default::Default::default()
2473    }
2474
2475    /// Sets the value of [counters][crate::model::TransferOperationMetadata::counters].
2476    ///
2477    /// # Example
2478    /// ```ignore,no_run
2479    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2480    /// use google_cloud_lustre_v1::model::TransferCounters;
2481    /// let x = TransferOperationMetadata::new().set_counters(TransferCounters::default()/* use setters */);
2482    /// ```
2483    pub fn set_counters<T>(mut self, v: T) -> Self
2484    where
2485        T: std::convert::Into<crate::model::TransferCounters>,
2486    {
2487        self.counters = std::option::Option::Some(v.into());
2488        self
2489    }
2490
2491    /// Sets or clears the value of [counters][crate::model::TransferOperationMetadata::counters].
2492    ///
2493    /// # Example
2494    /// ```ignore,no_run
2495    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2496    /// use google_cloud_lustre_v1::model::TransferCounters;
2497    /// let x = TransferOperationMetadata::new().set_or_clear_counters(Some(TransferCounters::default()/* use setters */));
2498    /// let x = TransferOperationMetadata::new().set_or_clear_counters(None::<TransferCounters>);
2499    /// ```
2500    pub fn set_or_clear_counters<T>(mut self, v: std::option::Option<T>) -> Self
2501    where
2502        T: std::convert::Into<crate::model::TransferCounters>,
2503    {
2504        self.counters = v.map(|x| x.into());
2505        self
2506    }
2507
2508    /// Sets the value of [transfer_type][crate::model::TransferOperationMetadata::transfer_type].
2509    ///
2510    /// # Example
2511    /// ```ignore,no_run
2512    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2513    /// use google_cloud_lustre_v1::model::TransferType;
2514    /// let x0 = TransferOperationMetadata::new().set_transfer_type(TransferType::Import);
2515    /// let x1 = TransferOperationMetadata::new().set_transfer_type(TransferType::Export);
2516    /// ```
2517    pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
2518        mut self,
2519        v: T,
2520    ) -> Self {
2521        self.transfer_type = v.into();
2522        self
2523    }
2524
2525    /// Sets the value of [error_summaries][crate::model::TransferOperationMetadata::error_summaries].
2526    ///
2527    /// # Example
2528    /// ```ignore,no_run
2529    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2530    /// use google_cloud_lustre_v1::model::ErrorSummary;
2531    /// let x = TransferOperationMetadata::new()
2532    ///     .set_error_summaries([
2533    ///         ErrorSummary::default()/* use setters */,
2534    ///         ErrorSummary::default()/* use (different) setters */,
2535    ///     ]);
2536    /// ```
2537    pub fn set_error_summaries<T, V>(mut self, v: T) -> Self
2538    where
2539        T: std::iter::IntoIterator<Item = V>,
2540        V: std::convert::Into<crate::model::ErrorSummary>,
2541    {
2542        use std::iter::Iterator;
2543        self.error_summaries = v.into_iter().map(|i| i.into()).collect();
2544        self
2545    }
2546
2547    /// Sets the value of [source][crate::model::TransferOperationMetadata::source].
2548    ///
2549    /// Note that all the setters affecting `source` are mutually
2550    /// exclusive.
2551    ///
2552    /// # Example
2553    /// ```ignore,no_run
2554    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2555    /// use google_cloud_lustre_v1::model::LustrePath;
2556    /// let x = TransferOperationMetadata::new().set_source(Some(
2557    ///     google_cloud_lustre_v1::model::transfer_operation_metadata::Source::SourceLustrePath(LustrePath::default().into())));
2558    /// ```
2559    pub fn set_source<
2560        T: std::convert::Into<std::option::Option<crate::model::transfer_operation_metadata::Source>>,
2561    >(
2562        mut self,
2563        v: T,
2564    ) -> Self {
2565        self.source = v.into();
2566        self
2567    }
2568
2569    /// The value of [source][crate::model::TransferOperationMetadata::source]
2570    /// if it holds a `SourceLustrePath`, `None` if the field is not set or
2571    /// holds a different branch.
2572    pub fn source_lustre_path(
2573        &self,
2574    ) -> std::option::Option<&std::boxed::Box<crate::model::LustrePath>> {
2575        #[allow(unreachable_patterns)]
2576        self.source.as_ref().and_then(|v| match v {
2577            crate::model::transfer_operation_metadata::Source::SourceLustrePath(v) => {
2578                std::option::Option::Some(v)
2579            }
2580            _ => std::option::Option::None,
2581        })
2582    }
2583
2584    /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
2585    /// to hold a `SourceLustrePath`.
2586    ///
2587    /// Note that all the setters affecting `source` are
2588    /// mutually exclusive.
2589    ///
2590    /// # Example
2591    /// ```ignore,no_run
2592    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2593    /// use google_cloud_lustre_v1::model::LustrePath;
2594    /// let x = TransferOperationMetadata::new().set_source_lustre_path(LustrePath::default()/* use setters */);
2595    /// assert!(x.source_lustre_path().is_some());
2596    /// assert!(x.source_gcs_path().is_none());
2597    /// ```
2598    pub fn set_source_lustre_path<
2599        T: std::convert::Into<std::boxed::Box<crate::model::LustrePath>>,
2600    >(
2601        mut self,
2602        v: T,
2603    ) -> Self {
2604        self.source = std::option::Option::Some(
2605            crate::model::transfer_operation_metadata::Source::SourceLustrePath(v.into()),
2606        );
2607        self
2608    }
2609
2610    /// The value of [source][crate::model::TransferOperationMetadata::source]
2611    /// if it holds a `SourceGcsPath`, `None` if the field is not set or
2612    /// holds a different branch.
2613    pub fn source_gcs_path(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsPath>> {
2614        #[allow(unreachable_patterns)]
2615        self.source.as_ref().and_then(|v| match v {
2616            crate::model::transfer_operation_metadata::Source::SourceGcsPath(v) => {
2617                std::option::Option::Some(v)
2618            }
2619            _ => std::option::Option::None,
2620        })
2621    }
2622
2623    /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
2624    /// to hold a `SourceGcsPath`.
2625    ///
2626    /// Note that all the setters affecting `source` are
2627    /// mutually exclusive.
2628    ///
2629    /// # Example
2630    /// ```ignore,no_run
2631    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2632    /// use google_cloud_lustre_v1::model::GcsPath;
2633    /// let x = TransferOperationMetadata::new().set_source_gcs_path(GcsPath::default()/* use setters */);
2634    /// assert!(x.source_gcs_path().is_some());
2635    /// assert!(x.source_lustre_path().is_none());
2636    /// ```
2637    pub fn set_source_gcs_path<T: std::convert::Into<std::boxed::Box<crate::model::GcsPath>>>(
2638        mut self,
2639        v: T,
2640    ) -> Self {
2641        self.source = std::option::Option::Some(
2642            crate::model::transfer_operation_metadata::Source::SourceGcsPath(v.into()),
2643        );
2644        self
2645    }
2646
2647    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination].
2648    ///
2649    /// Note that all the setters affecting `destination` are mutually
2650    /// exclusive.
2651    ///
2652    /// # Example
2653    /// ```ignore,no_run
2654    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2655    /// use google_cloud_lustre_v1::model::GcsPath;
2656    /// let x = TransferOperationMetadata::new().set_destination(Some(
2657    ///     google_cloud_lustre_v1::model::transfer_operation_metadata::Destination::DestinationGcsPath(GcsPath::default().into())));
2658    /// ```
2659    pub fn set_destination<
2660        T: std::convert::Into<
2661                std::option::Option<crate::model::transfer_operation_metadata::Destination>,
2662            >,
2663    >(
2664        mut self,
2665        v: T,
2666    ) -> Self {
2667        self.destination = v.into();
2668        self
2669    }
2670
2671    /// The value of [destination][crate::model::TransferOperationMetadata::destination]
2672    /// if it holds a `DestinationGcsPath`, `None` if the field is not set or
2673    /// holds a different branch.
2674    pub fn destination_gcs_path(
2675        &self,
2676    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsPath>> {
2677        #[allow(unreachable_patterns)]
2678        self.destination.as_ref().and_then(|v| match v {
2679            crate::model::transfer_operation_metadata::Destination::DestinationGcsPath(v) => {
2680                std::option::Option::Some(v)
2681            }
2682            _ => std::option::Option::None,
2683        })
2684    }
2685
2686    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
2687    /// to hold a `DestinationGcsPath`.
2688    ///
2689    /// Note that all the setters affecting `destination` are
2690    /// mutually exclusive.
2691    ///
2692    /// # Example
2693    /// ```ignore,no_run
2694    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2695    /// use google_cloud_lustre_v1::model::GcsPath;
2696    /// let x = TransferOperationMetadata::new().set_destination_gcs_path(GcsPath::default()/* use setters */);
2697    /// assert!(x.destination_gcs_path().is_some());
2698    /// assert!(x.destination_lustre_path().is_none());
2699    /// ```
2700    pub fn set_destination_gcs_path<
2701        T: std::convert::Into<std::boxed::Box<crate::model::GcsPath>>,
2702    >(
2703        mut self,
2704        v: T,
2705    ) -> Self {
2706        self.destination = std::option::Option::Some(
2707            crate::model::transfer_operation_metadata::Destination::DestinationGcsPath(v.into()),
2708        );
2709        self
2710    }
2711
2712    /// The value of [destination][crate::model::TransferOperationMetadata::destination]
2713    /// if it holds a `DestinationLustrePath`, `None` if the field is not set or
2714    /// holds a different branch.
2715    pub fn destination_lustre_path(
2716        &self,
2717    ) -> std::option::Option<&std::boxed::Box<crate::model::LustrePath>> {
2718        #[allow(unreachable_patterns)]
2719        self.destination.as_ref().and_then(|v| match v {
2720            crate::model::transfer_operation_metadata::Destination::DestinationLustrePath(v) => {
2721                std::option::Option::Some(v)
2722            }
2723            _ => std::option::Option::None,
2724        })
2725    }
2726
2727    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
2728    /// to hold a `DestinationLustrePath`.
2729    ///
2730    /// Note that all the setters affecting `destination` are
2731    /// mutually exclusive.
2732    ///
2733    /// # Example
2734    /// ```ignore,no_run
2735    /// # use google_cloud_lustre_v1::model::TransferOperationMetadata;
2736    /// use google_cloud_lustre_v1::model::LustrePath;
2737    /// let x = TransferOperationMetadata::new().set_destination_lustre_path(LustrePath::default()/* use setters */);
2738    /// assert!(x.destination_lustre_path().is_some());
2739    /// assert!(x.destination_gcs_path().is_none());
2740    /// ```
2741    pub fn set_destination_lustre_path<
2742        T: std::convert::Into<std::boxed::Box<crate::model::LustrePath>>,
2743    >(
2744        mut self,
2745        v: T,
2746    ) -> Self {
2747        self.destination = std::option::Option::Some(
2748            crate::model::transfer_operation_metadata::Destination::DestinationLustrePath(v.into()),
2749        );
2750        self
2751    }
2752}
2753
2754impl wkt::message::Message for TransferOperationMetadata {
2755    fn typename() -> &'static str {
2756        "type.googleapis.com/google.cloud.lustre.v1.TransferOperationMetadata"
2757    }
2758}
2759
2760/// Defines additional types related to [TransferOperationMetadata].
2761pub mod transfer_operation_metadata {
2762    #[allow(unused_imports)]
2763    use super::*;
2764
2765    /// The source of transfer operation.
2766    #[derive(Clone, Debug, PartialEq)]
2767    #[non_exhaustive]
2768    pub enum Source {
2769        /// Output only. Lustre source.
2770        SourceLustrePath(std::boxed::Box<crate::model::LustrePath>),
2771        /// Output only. Cloud Storage source.
2772        SourceGcsPath(std::boxed::Box<crate::model::GcsPath>),
2773    }
2774
2775    /// The destination of transfer operation.
2776    #[derive(Clone, Debug, PartialEq)]
2777    #[non_exhaustive]
2778    pub enum Destination {
2779        /// Output only. Cloud Storage destination.
2780        DestinationGcsPath(std::boxed::Box<crate::model::GcsPath>),
2781        /// Output only. Lustre destination.
2782        DestinationLustrePath(std::boxed::Box<crate::model::LustrePath>),
2783    }
2784}
2785
2786/// Type of transfer that occurred.
2787///
2788/// # Working with unknown values
2789///
2790/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2791/// additional enum variants at any time. Adding new variants is not considered
2792/// a breaking change. Applications should write their code in anticipation of:
2793///
2794/// - New values appearing in future releases of the client library, **and**
2795/// - New values received dynamically, without application changes.
2796///
2797/// Please consult the [Working with enums] section in the user guide for some
2798/// guidelines.
2799///
2800/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2801#[derive(Clone, Debug, PartialEq)]
2802#[non_exhaustive]
2803pub enum TransferType {
2804    /// Zero is an illegal value.
2805    Unspecified,
2806    /// Imports to Lustre.
2807    Import,
2808    /// Exports from Lustre.
2809    Export,
2810    /// If set, the enum was initialized with an unknown value.
2811    ///
2812    /// Applications can examine the value using [TransferType::value] or
2813    /// [TransferType::name].
2814    UnknownValue(transfer_type::UnknownValue),
2815}
2816
2817#[doc(hidden)]
2818pub mod transfer_type {
2819    #[allow(unused_imports)]
2820    use super::*;
2821    #[derive(Clone, Debug, PartialEq)]
2822    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2823}
2824
2825impl TransferType {
2826    /// Gets the enum value.
2827    ///
2828    /// Returns `None` if the enum contains an unknown value deserialized from
2829    /// the string representation of enums.
2830    pub fn value(&self) -> std::option::Option<i32> {
2831        match self {
2832            Self::Unspecified => std::option::Option::Some(0),
2833            Self::Import => std::option::Option::Some(1),
2834            Self::Export => std::option::Option::Some(2),
2835            Self::UnknownValue(u) => u.0.value(),
2836        }
2837    }
2838
2839    /// Gets the enum value as a string.
2840    ///
2841    /// Returns `None` if the enum contains an unknown value deserialized from
2842    /// the integer representation of enums.
2843    pub fn name(&self) -> std::option::Option<&str> {
2844        match self {
2845            Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
2846            Self::Import => std::option::Option::Some("IMPORT"),
2847            Self::Export => std::option::Option::Some("EXPORT"),
2848            Self::UnknownValue(u) => u.0.name(),
2849        }
2850    }
2851}
2852
2853impl std::default::Default for TransferType {
2854    fn default() -> Self {
2855        use std::convert::From;
2856        Self::from(0)
2857    }
2858}
2859
2860impl std::fmt::Display for TransferType {
2861    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2862        wkt::internal::display_enum(f, self.name(), self.value())
2863    }
2864}
2865
2866impl std::convert::From<i32> for TransferType {
2867    fn from(value: i32) -> Self {
2868        match value {
2869            0 => Self::Unspecified,
2870            1 => Self::Import,
2871            2 => Self::Export,
2872            _ => Self::UnknownValue(transfer_type::UnknownValue(
2873                wkt::internal::UnknownEnumValue::Integer(value),
2874            )),
2875        }
2876    }
2877}
2878
2879impl std::convert::From<&str> for TransferType {
2880    fn from(value: &str) -> Self {
2881        use std::string::ToString;
2882        match value {
2883            "TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
2884            "IMPORT" => Self::Import,
2885            "EXPORT" => Self::Export,
2886            _ => Self::UnknownValue(transfer_type::UnknownValue(
2887                wkt::internal::UnknownEnumValue::String(value.to_string()),
2888            )),
2889        }
2890    }
2891}
2892
2893impl serde::ser::Serialize for TransferType {
2894    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2895    where
2896        S: serde::Serializer,
2897    {
2898        match self {
2899            Self::Unspecified => serializer.serialize_i32(0),
2900            Self::Import => serializer.serialize_i32(1),
2901            Self::Export => serializer.serialize_i32(2),
2902            Self::UnknownValue(u) => u.0.serialize(serializer),
2903        }
2904    }
2905}
2906
2907impl<'de> serde::de::Deserialize<'de> for TransferType {
2908    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2909    where
2910        D: serde::Deserializer<'de>,
2911    {
2912        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
2913            ".google.cloud.lustre.v1.TransferType",
2914        ))
2915    }
2916}