1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Instance {
45 pub name: std::string::String,
48
49 pub description: std::string::String,
51
52 pub state: crate::model::instance::State,
54
55 pub create_time: std::option::Option<wkt::Timestamp>,
57
58 pub update_time: std::option::Option<wkt::Timestamp>,
60
61 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
66
67 pub capacity_gib: i64,
71
72 #[deprecated]
75 pub daos_version: std::string::String,
76
77 pub access_points: std::vec::Vec<std::string::String>,
79
80 pub network: std::string::String,
84
85 pub reserved_ip_range: std::string::String,
90
91 pub effective_reserved_ip_range: std::string::String,
95
96 pub file_stripe_level: crate::model::FileStripeLevel,
104
105 pub directory_stripe_level: crate::model::DirectoryStripeLevel,
114
115 pub deployment_type: crate::model::DeploymentType,
121
122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
123}
124
125impl Instance {
126 pub fn new() -> Self {
127 std::default::Default::default()
128 }
129
130 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.name = v.into();
133 self
134 }
135
136 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
138 self.description = v.into();
139 self
140 }
141
142 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
144 self.state = v.into();
145 self
146 }
147
148 pub fn set_create_time<T>(mut self, v: T) -> Self
150 where
151 T: std::convert::Into<wkt::Timestamp>,
152 {
153 self.create_time = std::option::Option::Some(v.into());
154 self
155 }
156
157 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
159 where
160 T: std::convert::Into<wkt::Timestamp>,
161 {
162 self.create_time = v.map(|x| x.into());
163 self
164 }
165
166 pub fn set_update_time<T>(mut self, v: T) -> Self
168 where
169 T: std::convert::Into<wkt::Timestamp>,
170 {
171 self.update_time = std::option::Option::Some(v.into());
172 self
173 }
174
175 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
177 where
178 T: std::convert::Into<wkt::Timestamp>,
179 {
180 self.update_time = v.map(|x| x.into());
181 self
182 }
183
184 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
186 where
187 T: std::iter::IntoIterator<Item = (K, V)>,
188 K: std::convert::Into<std::string::String>,
189 V: std::convert::Into<std::string::String>,
190 {
191 use std::iter::Iterator;
192 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
193 self
194 }
195
196 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
198 self.capacity_gib = v.into();
199 self
200 }
201
202 #[deprecated]
204 pub fn set_daos_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205 self.daos_version = v.into();
206 self
207 }
208
209 pub fn set_access_points<T, V>(mut self, v: T) -> Self
211 where
212 T: std::iter::IntoIterator<Item = V>,
213 V: std::convert::Into<std::string::String>,
214 {
215 use std::iter::Iterator;
216 self.access_points = v.into_iter().map(|i| i.into()).collect();
217 self
218 }
219
220 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
222 self.network = v.into();
223 self
224 }
225
226 pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
228 mut self,
229 v: T,
230 ) -> Self {
231 self.reserved_ip_range = v.into();
232 self
233 }
234
235 pub fn set_effective_reserved_ip_range<T: std::convert::Into<std::string::String>>(
237 mut self,
238 v: T,
239 ) -> Self {
240 self.effective_reserved_ip_range = v.into();
241 self
242 }
243
244 pub fn set_file_stripe_level<T: std::convert::Into<crate::model::FileStripeLevel>>(
246 mut self,
247 v: T,
248 ) -> Self {
249 self.file_stripe_level = v.into();
250 self
251 }
252
253 pub fn set_directory_stripe_level<T: std::convert::Into<crate::model::DirectoryStripeLevel>>(
255 mut self,
256 v: T,
257 ) -> Self {
258 self.directory_stripe_level = v.into();
259 self
260 }
261
262 pub fn set_deployment_type<T: std::convert::Into<crate::model::DeploymentType>>(
264 mut self,
265 v: T,
266 ) -> Self {
267 self.deployment_type = v.into();
268 self
269 }
270}
271
272impl wkt::message::Message for Instance {
273 fn typename() -> &'static str {
274 "type.googleapis.com/google.cloud.parallelstore.v1.Instance"
275 }
276}
277
278pub mod instance {
280 #[allow(unused_imports)]
281 use super::*;
282
283 #[derive(Clone, Debug, PartialEq)]
299 #[non_exhaustive]
300 pub enum State {
301 Unspecified,
303 Creating,
305 Active,
307 Deleting,
309 Failed,
311 Upgrading,
313 Repairing,
316 UnknownValue(state::UnknownValue),
321 }
322
323 #[doc(hidden)]
324 pub mod state {
325 #[allow(unused_imports)]
326 use super::*;
327 #[derive(Clone, Debug, PartialEq)]
328 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
329 }
330
331 impl State {
332 pub fn value(&self) -> std::option::Option<i32> {
337 match self {
338 Self::Unspecified => std::option::Option::Some(0),
339 Self::Creating => std::option::Option::Some(1),
340 Self::Active => std::option::Option::Some(2),
341 Self::Deleting => std::option::Option::Some(3),
342 Self::Failed => std::option::Option::Some(4),
343 Self::Upgrading => std::option::Option::Some(5),
344 Self::Repairing => std::option::Option::Some(6),
345 Self::UnknownValue(u) => u.0.value(),
346 }
347 }
348
349 pub fn name(&self) -> std::option::Option<&str> {
354 match self {
355 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
356 Self::Creating => std::option::Option::Some("CREATING"),
357 Self::Active => std::option::Option::Some("ACTIVE"),
358 Self::Deleting => std::option::Option::Some("DELETING"),
359 Self::Failed => std::option::Option::Some("FAILED"),
360 Self::Upgrading => std::option::Option::Some("UPGRADING"),
361 Self::Repairing => std::option::Option::Some("REPAIRING"),
362 Self::UnknownValue(u) => u.0.name(),
363 }
364 }
365 }
366
367 impl std::default::Default for State {
368 fn default() -> Self {
369 use std::convert::From;
370 Self::from(0)
371 }
372 }
373
374 impl std::fmt::Display for State {
375 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
376 wkt::internal::display_enum(f, self.name(), self.value())
377 }
378 }
379
380 impl std::convert::From<i32> for State {
381 fn from(value: i32) -> Self {
382 match value {
383 0 => Self::Unspecified,
384 1 => Self::Creating,
385 2 => Self::Active,
386 3 => Self::Deleting,
387 4 => Self::Failed,
388 5 => Self::Upgrading,
389 6 => Self::Repairing,
390 _ => Self::UnknownValue(state::UnknownValue(
391 wkt::internal::UnknownEnumValue::Integer(value),
392 )),
393 }
394 }
395 }
396
397 impl std::convert::From<&str> for State {
398 fn from(value: &str) -> Self {
399 use std::string::ToString;
400 match value {
401 "STATE_UNSPECIFIED" => Self::Unspecified,
402 "CREATING" => Self::Creating,
403 "ACTIVE" => Self::Active,
404 "DELETING" => Self::Deleting,
405 "FAILED" => Self::Failed,
406 "UPGRADING" => Self::Upgrading,
407 "REPAIRING" => Self::Repairing,
408 _ => Self::UnknownValue(state::UnknownValue(
409 wkt::internal::UnknownEnumValue::String(value.to_string()),
410 )),
411 }
412 }
413 }
414
415 impl serde::ser::Serialize for State {
416 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
417 where
418 S: serde::Serializer,
419 {
420 match self {
421 Self::Unspecified => serializer.serialize_i32(0),
422 Self::Creating => serializer.serialize_i32(1),
423 Self::Active => serializer.serialize_i32(2),
424 Self::Deleting => serializer.serialize_i32(3),
425 Self::Failed => serializer.serialize_i32(4),
426 Self::Upgrading => serializer.serialize_i32(5),
427 Self::Repairing => serializer.serialize_i32(6),
428 Self::UnknownValue(u) => u.0.serialize(serializer),
429 }
430 }
431 }
432
433 impl<'de> serde::de::Deserialize<'de> for State {
434 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
435 where
436 D: serde::Deserializer<'de>,
437 {
438 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
439 ".google.cloud.parallelstore.v1.Instance.State",
440 ))
441 }
442 }
443}
444
445#[derive(Clone, Default, PartialEq)]
447#[non_exhaustive]
448pub struct ListInstancesRequest {
449 pub parent: std::string::String,
455
456 pub page_size: i32,
459
460 pub page_token: std::string::String,
462
463 pub filter: std::string::String,
465
466 pub order_by: std::string::String,
468
469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
470}
471
472impl ListInstancesRequest {
473 pub fn new() -> Self {
474 std::default::Default::default()
475 }
476
477 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
479 self.parent = v.into();
480 self
481 }
482
483 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
485 self.page_size = v.into();
486 self
487 }
488
489 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
491 self.page_token = v.into();
492 self
493 }
494
495 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
497 self.filter = v.into();
498 self
499 }
500
501 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
503 self.order_by = v.into();
504 self
505 }
506}
507
508impl wkt::message::Message for ListInstancesRequest {
509 fn typename() -> &'static str {
510 "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesRequest"
511 }
512}
513
514#[derive(Clone, Default, PartialEq)]
519#[non_exhaustive]
520pub struct ListInstancesResponse {
521 pub instances: std::vec::Vec<crate::model::Instance>,
523
524 pub next_page_token: std::string::String,
526
527 pub unreachable: std::vec::Vec<std::string::String>,
529
530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
531}
532
533impl ListInstancesResponse {
534 pub fn new() -> Self {
535 std::default::Default::default()
536 }
537
538 pub fn set_instances<T, V>(mut self, v: T) -> Self
540 where
541 T: std::iter::IntoIterator<Item = V>,
542 V: std::convert::Into<crate::model::Instance>,
543 {
544 use std::iter::Iterator;
545 self.instances = v.into_iter().map(|i| i.into()).collect();
546 self
547 }
548
549 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
551 self.next_page_token = v.into();
552 self
553 }
554
555 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
557 where
558 T: std::iter::IntoIterator<Item = V>,
559 V: std::convert::Into<std::string::String>,
560 {
561 use std::iter::Iterator;
562 self.unreachable = v.into_iter().map(|i| i.into()).collect();
563 self
564 }
565}
566
567impl wkt::message::Message for ListInstancesResponse {
568 fn typename() -> &'static str {
569 "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesResponse"
570 }
571}
572
573#[doc(hidden)]
574impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
575 type PageItem = crate::model::Instance;
576
577 fn items(self) -> std::vec::Vec<Self::PageItem> {
578 self.instances
579 }
580
581 fn next_page_token(&self) -> std::string::String {
582 use std::clone::Clone;
583 self.next_page_token.clone()
584 }
585}
586
587#[derive(Clone, Default, PartialEq)]
589#[non_exhaustive]
590pub struct GetInstanceRequest {
591 pub name: std::string::String,
594
595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
596}
597
598impl GetInstanceRequest {
599 pub fn new() -> Self {
600 std::default::Default::default()
601 }
602
603 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
605 self.name = v.into();
606 self
607 }
608}
609
610impl wkt::message::Message for GetInstanceRequest {
611 fn typename() -> &'static str {
612 "type.googleapis.com/google.cloud.parallelstore.v1.GetInstanceRequest"
613 }
614}
615
616#[derive(Clone, Default, PartialEq)]
618#[non_exhaustive]
619pub struct CreateInstanceRequest {
620 pub parent: std::string::String,
624
625 pub instance_id: std::string::String,
633
634 pub instance: std::option::Option<crate::model::Instance>,
636
637 pub request_id: std::string::String,
651
652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
653}
654
655impl CreateInstanceRequest {
656 pub fn new() -> Self {
657 std::default::Default::default()
658 }
659
660 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
662 self.parent = v.into();
663 self
664 }
665
666 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
668 self.instance_id = v.into();
669 self
670 }
671
672 pub fn set_instance<T>(mut self, v: T) -> Self
674 where
675 T: std::convert::Into<crate::model::Instance>,
676 {
677 self.instance = std::option::Option::Some(v.into());
678 self
679 }
680
681 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
683 where
684 T: std::convert::Into<crate::model::Instance>,
685 {
686 self.instance = v.map(|x| x.into());
687 self
688 }
689
690 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
692 self.request_id = v.into();
693 self
694 }
695}
696
697impl wkt::message::Message for CreateInstanceRequest {
698 fn typename() -> &'static str {
699 "type.googleapis.com/google.cloud.parallelstore.v1.CreateInstanceRequest"
700 }
701}
702
703#[derive(Clone, Default, PartialEq)]
705#[non_exhaustive]
706pub struct UpdateInstanceRequest {
707 pub update_mask: std::option::Option<wkt::FieldMask>,
712
713 pub instance: std::option::Option<crate::model::Instance>,
715
716 pub request_id: std::string::String,
730
731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
732}
733
734impl UpdateInstanceRequest {
735 pub fn new() -> Self {
736 std::default::Default::default()
737 }
738
739 pub fn set_update_mask<T>(mut self, v: T) -> Self
741 where
742 T: std::convert::Into<wkt::FieldMask>,
743 {
744 self.update_mask = std::option::Option::Some(v.into());
745 self
746 }
747
748 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
750 where
751 T: std::convert::Into<wkt::FieldMask>,
752 {
753 self.update_mask = v.map(|x| x.into());
754 self
755 }
756
757 pub fn set_instance<T>(mut self, v: T) -> Self
759 where
760 T: std::convert::Into<crate::model::Instance>,
761 {
762 self.instance = std::option::Option::Some(v.into());
763 self
764 }
765
766 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
768 where
769 T: std::convert::Into<crate::model::Instance>,
770 {
771 self.instance = v.map(|x| x.into());
772 self
773 }
774
775 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
777 self.request_id = v.into();
778 self
779 }
780}
781
782impl wkt::message::Message for UpdateInstanceRequest {
783 fn typename() -> &'static str {
784 "type.googleapis.com/google.cloud.parallelstore.v1.UpdateInstanceRequest"
785 }
786}
787
788#[derive(Clone, Default, PartialEq)]
790#[non_exhaustive]
791pub struct DeleteInstanceRequest {
792 pub name: std::string::String,
794
795 pub request_id: std::string::String,
809
810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
811}
812
813impl DeleteInstanceRequest {
814 pub fn new() -> Self {
815 std::default::Default::default()
816 }
817
818 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
820 self.name = v.into();
821 self
822 }
823
824 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
826 self.request_id = v.into();
827 self
828 }
829}
830
831impl wkt::message::Message for DeleteInstanceRequest {
832 fn typename() -> &'static str {
833 "type.googleapis.com/google.cloud.parallelstore.v1.DeleteInstanceRequest"
834 }
835}
836
837#[derive(Clone, Default, PartialEq)]
839#[non_exhaustive]
840pub struct OperationMetadata {
841 pub create_time: std::option::Option<wkt::Timestamp>,
843
844 pub end_time: std::option::Option<wkt::Timestamp>,
846
847 pub target: std::string::String,
849
850 pub verb: std::string::String,
852
853 pub status_message: std::string::String,
855
856 pub requested_cancellation: bool,
865
866 pub api_version: std::string::String,
868
869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
870}
871
872impl OperationMetadata {
873 pub fn new() -> Self {
874 std::default::Default::default()
875 }
876
877 pub fn set_create_time<T>(mut self, v: T) -> Self
879 where
880 T: std::convert::Into<wkt::Timestamp>,
881 {
882 self.create_time = std::option::Option::Some(v.into());
883 self
884 }
885
886 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
888 where
889 T: std::convert::Into<wkt::Timestamp>,
890 {
891 self.create_time = v.map(|x| x.into());
892 self
893 }
894
895 pub fn set_end_time<T>(mut self, v: T) -> Self
897 where
898 T: std::convert::Into<wkt::Timestamp>,
899 {
900 self.end_time = std::option::Option::Some(v.into());
901 self
902 }
903
904 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
906 where
907 T: std::convert::Into<wkt::Timestamp>,
908 {
909 self.end_time = v.map(|x| x.into());
910 self
911 }
912
913 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
915 self.target = v.into();
916 self
917 }
918
919 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
921 self.verb = v.into();
922 self
923 }
924
925 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
927 self.status_message = v.into();
928 self
929 }
930
931 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
933 self.requested_cancellation = v.into();
934 self
935 }
936
937 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
939 self.api_version = v.into();
940 self
941 }
942}
943
944impl wkt::message::Message for OperationMetadata {
945 fn typename() -> &'static str {
946 "type.googleapis.com/google.cloud.parallelstore.v1.OperationMetadata"
947 }
948}
949
950#[derive(Clone, Default, PartialEq)]
952#[non_exhaustive]
953pub struct SourceGcsBucket {
954 pub uri: std::string::String,
958
959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
960}
961
962impl SourceGcsBucket {
963 pub fn new() -> Self {
964 std::default::Default::default()
965 }
966
967 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
969 self.uri = v.into();
970 self
971 }
972}
973
974impl wkt::message::Message for SourceGcsBucket {
975 fn typename() -> &'static str {
976 "type.googleapis.com/google.cloud.parallelstore.v1.SourceGcsBucket"
977 }
978}
979
980#[derive(Clone, Default, PartialEq)]
982#[non_exhaustive]
983pub struct DestinationGcsBucket {
984 pub uri: std::string::String,
988
989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
990}
991
992impl DestinationGcsBucket {
993 pub fn new() -> Self {
994 std::default::Default::default()
995 }
996
997 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
999 self.uri = v.into();
1000 self
1001 }
1002}
1003
1004impl wkt::message::Message for DestinationGcsBucket {
1005 fn typename() -> &'static str {
1006 "type.googleapis.com/google.cloud.parallelstore.v1.DestinationGcsBucket"
1007 }
1008}
1009
1010#[derive(Clone, Default, PartialEq)]
1012#[non_exhaustive]
1013pub struct SourceParallelstore {
1014 pub path: std::string::String,
1017
1018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1019}
1020
1021impl SourceParallelstore {
1022 pub fn new() -> Self {
1023 std::default::Default::default()
1024 }
1025
1026 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1028 self.path = v.into();
1029 self
1030 }
1031}
1032
1033impl wkt::message::Message for SourceParallelstore {
1034 fn typename() -> &'static str {
1035 "type.googleapis.com/google.cloud.parallelstore.v1.SourceParallelstore"
1036 }
1037}
1038
1039#[derive(Clone, Default, PartialEq)]
1041#[non_exhaustive]
1042pub struct DestinationParallelstore {
1043 pub path: std::string::String,
1046
1047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1048}
1049
1050impl DestinationParallelstore {
1051 pub fn new() -> Self {
1052 std::default::Default::default()
1053 }
1054
1055 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057 self.path = v.into();
1058 self
1059 }
1060}
1061
1062impl wkt::message::Message for DestinationParallelstore {
1063 fn typename() -> &'static str {
1064 "type.googleapis.com/google.cloud.parallelstore.v1.DestinationParallelstore"
1065 }
1066}
1067
1068#[derive(Clone, Default, PartialEq)]
1070#[non_exhaustive]
1071pub struct ImportDataRequest {
1072 pub name: std::string::String,
1074
1075 pub request_id: std::string::String,
1089
1090 pub service_account: std::string::String,
1102
1103 pub source: std::option::Option<crate::model::import_data_request::Source>,
1105
1106 pub destination: std::option::Option<crate::model::import_data_request::Destination>,
1108
1109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1110}
1111
1112impl ImportDataRequest {
1113 pub fn new() -> Self {
1114 std::default::Default::default()
1115 }
1116
1117 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1119 self.name = v.into();
1120 self
1121 }
1122
1123 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1125 self.request_id = v.into();
1126 self
1127 }
1128
1129 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.service_account = v.into();
1132 self
1133 }
1134
1135 pub fn set_source<
1140 T: std::convert::Into<std::option::Option<crate::model::import_data_request::Source>>,
1141 >(
1142 mut self,
1143 v: T,
1144 ) -> Self {
1145 self.source = v.into();
1146 self
1147 }
1148
1149 pub fn source_gcs_bucket(
1153 &self,
1154 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
1155 #[allow(unreachable_patterns)]
1156 self.source.as_ref().and_then(|v| match v {
1157 crate::model::import_data_request::Source::SourceGcsBucket(v) => {
1158 std::option::Option::Some(v)
1159 }
1160 _ => std::option::Option::None,
1161 })
1162 }
1163
1164 pub fn set_source_gcs_bucket<
1170 T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
1171 >(
1172 mut self,
1173 v: T,
1174 ) -> Self {
1175 self.source = std::option::Option::Some(
1176 crate::model::import_data_request::Source::SourceGcsBucket(v.into()),
1177 );
1178 self
1179 }
1180
1181 pub fn set_destination<
1186 T: std::convert::Into<std::option::Option<crate::model::import_data_request::Destination>>,
1187 >(
1188 mut self,
1189 v: T,
1190 ) -> Self {
1191 self.destination = v.into();
1192 self
1193 }
1194
1195 pub fn destination_parallelstore(
1199 &self,
1200 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
1201 #[allow(unreachable_patterns)]
1202 self.destination.as_ref().and_then(|v| match v {
1203 crate::model::import_data_request::Destination::DestinationParallelstore(v) => {
1204 std::option::Option::Some(v)
1205 }
1206 _ => std::option::Option::None,
1207 })
1208 }
1209
1210 pub fn set_destination_parallelstore<
1216 T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
1217 >(
1218 mut self,
1219 v: T,
1220 ) -> Self {
1221 self.destination = std::option::Option::Some(
1222 crate::model::import_data_request::Destination::DestinationParallelstore(v.into()),
1223 );
1224 self
1225 }
1226}
1227
1228impl wkt::message::Message for ImportDataRequest {
1229 fn typename() -> &'static str {
1230 "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataRequest"
1231 }
1232}
1233
1234pub mod import_data_request {
1236 #[allow(unused_imports)]
1237 use super::*;
1238
1239 #[derive(Clone, Debug, PartialEq)]
1241 #[non_exhaustive]
1242 pub enum Source {
1243 SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
1245 }
1246
1247 #[derive(Clone, Debug, PartialEq)]
1249 #[non_exhaustive]
1250 pub enum Destination {
1251 DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
1253 }
1254}
1255
1256#[derive(Clone, Default, PartialEq)]
1258#[non_exhaustive]
1259pub struct ExportDataRequest {
1260 pub name: std::string::String,
1262
1263 pub request_id: std::string::String,
1277
1278 pub service_account: std::string::String,
1289
1290 pub source: std::option::Option<crate::model::export_data_request::Source>,
1292
1293 pub destination: std::option::Option<crate::model::export_data_request::Destination>,
1295
1296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1297}
1298
1299impl ExportDataRequest {
1300 pub fn new() -> Self {
1301 std::default::Default::default()
1302 }
1303
1304 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1306 self.name = v.into();
1307 self
1308 }
1309
1310 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1312 self.request_id = v.into();
1313 self
1314 }
1315
1316 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1318 self.service_account = v.into();
1319 self
1320 }
1321
1322 pub fn set_source<
1327 T: std::convert::Into<std::option::Option<crate::model::export_data_request::Source>>,
1328 >(
1329 mut self,
1330 v: T,
1331 ) -> Self {
1332 self.source = v.into();
1333 self
1334 }
1335
1336 pub fn source_parallelstore(
1340 &self,
1341 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
1342 #[allow(unreachable_patterns)]
1343 self.source.as_ref().and_then(|v| match v {
1344 crate::model::export_data_request::Source::SourceParallelstore(v) => {
1345 std::option::Option::Some(v)
1346 }
1347 _ => std::option::Option::None,
1348 })
1349 }
1350
1351 pub fn set_source_parallelstore<
1357 T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
1358 >(
1359 mut self,
1360 v: T,
1361 ) -> Self {
1362 self.source = std::option::Option::Some(
1363 crate::model::export_data_request::Source::SourceParallelstore(v.into()),
1364 );
1365 self
1366 }
1367
1368 pub fn set_destination<
1373 T: std::convert::Into<std::option::Option<crate::model::export_data_request::Destination>>,
1374 >(
1375 mut self,
1376 v: T,
1377 ) -> Self {
1378 self.destination = v.into();
1379 self
1380 }
1381
1382 pub fn destination_gcs_bucket(
1386 &self,
1387 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
1388 #[allow(unreachable_patterns)]
1389 self.destination.as_ref().and_then(|v| match v {
1390 crate::model::export_data_request::Destination::DestinationGcsBucket(v) => {
1391 std::option::Option::Some(v)
1392 }
1393 _ => std::option::Option::None,
1394 })
1395 }
1396
1397 pub fn set_destination_gcs_bucket<
1403 T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
1404 >(
1405 mut self,
1406 v: T,
1407 ) -> Self {
1408 self.destination = std::option::Option::Some(
1409 crate::model::export_data_request::Destination::DestinationGcsBucket(v.into()),
1410 );
1411 self
1412 }
1413}
1414
1415impl wkt::message::Message for ExportDataRequest {
1416 fn typename() -> &'static str {
1417 "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataRequest"
1418 }
1419}
1420
1421pub mod export_data_request {
1423 #[allow(unused_imports)]
1424 use super::*;
1425
1426 #[derive(Clone, Debug, PartialEq)]
1428 #[non_exhaustive]
1429 pub enum Source {
1430 SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
1432 }
1433
1434 #[derive(Clone, Debug, PartialEq)]
1436 #[non_exhaustive]
1437 pub enum Destination {
1438 DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
1440 }
1441}
1442
1443#[derive(Clone, Default, PartialEq)]
1445#[non_exhaustive]
1446pub struct ImportDataResponse {
1447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1448}
1449
1450impl ImportDataResponse {
1451 pub fn new() -> Self {
1452 std::default::Default::default()
1453 }
1454}
1455
1456impl wkt::message::Message for ImportDataResponse {
1457 fn typename() -> &'static str {
1458 "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataResponse"
1459 }
1460}
1461
1462#[derive(Clone, Default, PartialEq)]
1464#[non_exhaustive]
1465pub struct TransferErrorLogEntry {
1466 pub uri: std::string::String,
1469
1470 pub error_details: std::vec::Vec<std::string::String>,
1472
1473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1474}
1475
1476impl TransferErrorLogEntry {
1477 pub fn new() -> Self {
1478 std::default::Default::default()
1479 }
1480
1481 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1483 self.uri = v.into();
1484 self
1485 }
1486
1487 pub fn set_error_details<T, V>(mut self, v: T) -> Self
1489 where
1490 T: std::iter::IntoIterator<Item = V>,
1491 V: std::convert::Into<std::string::String>,
1492 {
1493 use std::iter::Iterator;
1494 self.error_details = v.into_iter().map(|i| i.into()).collect();
1495 self
1496 }
1497}
1498
1499impl wkt::message::Message for TransferErrorLogEntry {
1500 fn typename() -> &'static str {
1501 "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorLogEntry"
1502 }
1503}
1504
1505#[derive(Clone, Default, PartialEq)]
1508#[non_exhaustive]
1509pub struct TransferErrorSummary {
1510 pub error_code: rpc::model::Code,
1512
1513 pub error_count: i64,
1515
1516 pub error_log_entries: std::vec::Vec<crate::model::TransferErrorLogEntry>,
1518
1519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1520}
1521
1522impl TransferErrorSummary {
1523 pub fn new() -> Self {
1524 std::default::Default::default()
1525 }
1526
1527 pub fn set_error_code<T: std::convert::Into<rpc::model::Code>>(mut self, v: T) -> Self {
1529 self.error_code = v.into();
1530 self
1531 }
1532
1533 pub fn set_error_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1535 self.error_count = v.into();
1536 self
1537 }
1538
1539 pub fn set_error_log_entries<T, V>(mut self, v: T) -> Self
1541 where
1542 T: std::iter::IntoIterator<Item = V>,
1543 V: std::convert::Into<crate::model::TransferErrorLogEntry>,
1544 {
1545 use std::iter::Iterator;
1546 self.error_log_entries = v.into_iter().map(|i| i.into()).collect();
1547 self
1548 }
1549}
1550
1551impl wkt::message::Message for TransferErrorSummary {
1552 fn typename() -> &'static str {
1553 "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorSummary"
1554 }
1555}
1556
1557#[derive(Clone, Default, PartialEq)]
1559#[non_exhaustive]
1560pub struct ImportDataMetadata {
1561 pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
1563
1564 pub create_time: std::option::Option<wkt::Timestamp>,
1566
1567 pub end_time: std::option::Option<wkt::Timestamp>,
1569
1570 pub target: std::string::String,
1572
1573 pub verb: std::string::String,
1575
1576 pub status_message: std::string::String,
1578
1579 pub requested_cancellation: bool,
1588
1589 pub api_version: std::string::String,
1591
1592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1593}
1594
1595impl ImportDataMetadata {
1596 pub fn new() -> Self {
1597 std::default::Default::default()
1598 }
1599
1600 pub fn set_operation_metadata<T>(mut self, v: T) -> Self
1602 where
1603 T: std::convert::Into<crate::model::TransferOperationMetadata>,
1604 {
1605 self.operation_metadata = std::option::Option::Some(v.into());
1606 self
1607 }
1608
1609 pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1611 where
1612 T: std::convert::Into<crate::model::TransferOperationMetadata>,
1613 {
1614 self.operation_metadata = v.map(|x| x.into());
1615 self
1616 }
1617
1618 pub fn set_create_time<T>(mut self, v: T) -> Self
1620 where
1621 T: std::convert::Into<wkt::Timestamp>,
1622 {
1623 self.create_time = std::option::Option::Some(v.into());
1624 self
1625 }
1626
1627 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1629 where
1630 T: std::convert::Into<wkt::Timestamp>,
1631 {
1632 self.create_time = v.map(|x| x.into());
1633 self
1634 }
1635
1636 pub fn set_end_time<T>(mut self, v: T) -> Self
1638 where
1639 T: std::convert::Into<wkt::Timestamp>,
1640 {
1641 self.end_time = std::option::Option::Some(v.into());
1642 self
1643 }
1644
1645 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1647 where
1648 T: std::convert::Into<wkt::Timestamp>,
1649 {
1650 self.end_time = v.map(|x| x.into());
1651 self
1652 }
1653
1654 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.target = v.into();
1657 self
1658 }
1659
1660 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1662 self.verb = v.into();
1663 self
1664 }
1665
1666 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1668 self.status_message = v.into();
1669 self
1670 }
1671
1672 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1674 self.requested_cancellation = v.into();
1675 self
1676 }
1677
1678 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1680 self.api_version = v.into();
1681 self
1682 }
1683}
1684
1685impl wkt::message::Message for ImportDataMetadata {
1686 fn typename() -> &'static str {
1687 "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataMetadata"
1688 }
1689}
1690
1691#[derive(Clone, Default, PartialEq)]
1693#[non_exhaustive]
1694pub struct ExportDataResponse {
1695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1696}
1697
1698impl ExportDataResponse {
1699 pub fn new() -> Self {
1700 std::default::Default::default()
1701 }
1702}
1703
1704impl wkt::message::Message for ExportDataResponse {
1705 fn typename() -> &'static str {
1706 "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataResponse"
1707 }
1708}
1709
1710#[derive(Clone, Default, PartialEq)]
1712#[non_exhaustive]
1713pub struct ExportDataMetadata {
1714 pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
1716
1717 pub create_time: std::option::Option<wkt::Timestamp>,
1719
1720 pub end_time: std::option::Option<wkt::Timestamp>,
1722
1723 pub target: std::string::String,
1725
1726 pub verb: std::string::String,
1728
1729 pub status_message: std::string::String,
1731
1732 pub requested_cancellation: bool,
1741
1742 pub api_version: std::string::String,
1744
1745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1746}
1747
1748impl ExportDataMetadata {
1749 pub fn new() -> Self {
1750 std::default::Default::default()
1751 }
1752
1753 pub fn set_operation_metadata<T>(mut self, v: T) -> Self
1755 where
1756 T: std::convert::Into<crate::model::TransferOperationMetadata>,
1757 {
1758 self.operation_metadata = std::option::Option::Some(v.into());
1759 self
1760 }
1761
1762 pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1764 where
1765 T: std::convert::Into<crate::model::TransferOperationMetadata>,
1766 {
1767 self.operation_metadata = v.map(|x| x.into());
1768 self
1769 }
1770
1771 pub fn set_create_time<T>(mut self, v: T) -> Self
1773 where
1774 T: std::convert::Into<wkt::Timestamp>,
1775 {
1776 self.create_time = std::option::Option::Some(v.into());
1777 self
1778 }
1779
1780 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1782 where
1783 T: std::convert::Into<wkt::Timestamp>,
1784 {
1785 self.create_time = v.map(|x| x.into());
1786 self
1787 }
1788
1789 pub fn set_end_time<T>(mut self, v: T) -> Self
1791 where
1792 T: std::convert::Into<wkt::Timestamp>,
1793 {
1794 self.end_time = std::option::Option::Some(v.into());
1795 self
1796 }
1797
1798 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1800 where
1801 T: std::convert::Into<wkt::Timestamp>,
1802 {
1803 self.end_time = v.map(|x| x.into());
1804 self
1805 }
1806
1807 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.target = v.into();
1810 self
1811 }
1812
1813 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1815 self.verb = v.into();
1816 self
1817 }
1818
1819 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1821 self.status_message = v.into();
1822 self
1823 }
1824
1825 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1827 self.requested_cancellation = v.into();
1828 self
1829 }
1830
1831 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1833 self.api_version = v.into();
1834 self
1835 }
1836}
1837
1838impl wkt::message::Message for ExportDataMetadata {
1839 fn typename() -> &'static str {
1840 "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataMetadata"
1841 }
1842}
1843
1844#[derive(Clone, Default, PartialEq)]
1846#[non_exhaustive]
1847pub struct TransferOperationMetadata {
1848 pub counters: std::option::Option<crate::model::TransferCounters>,
1850
1851 pub transfer_type: crate::model::TransferType,
1853
1854 pub error_summary: std::vec::Vec<crate::model::TransferErrorSummary>,
1857
1858 pub source: std::option::Option<crate::model::transfer_operation_metadata::Source>,
1860
1861 pub destination: std::option::Option<crate::model::transfer_operation_metadata::Destination>,
1863
1864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1865}
1866
1867impl TransferOperationMetadata {
1868 pub fn new() -> Self {
1869 std::default::Default::default()
1870 }
1871
1872 pub fn set_counters<T>(mut self, v: T) -> Self
1874 where
1875 T: std::convert::Into<crate::model::TransferCounters>,
1876 {
1877 self.counters = std::option::Option::Some(v.into());
1878 self
1879 }
1880
1881 pub fn set_or_clear_counters<T>(mut self, v: std::option::Option<T>) -> Self
1883 where
1884 T: std::convert::Into<crate::model::TransferCounters>,
1885 {
1886 self.counters = v.map(|x| x.into());
1887 self
1888 }
1889
1890 pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
1892 mut self,
1893 v: T,
1894 ) -> Self {
1895 self.transfer_type = v.into();
1896 self
1897 }
1898
1899 pub fn set_error_summary<T, V>(mut self, v: T) -> Self
1901 where
1902 T: std::iter::IntoIterator<Item = V>,
1903 V: std::convert::Into<crate::model::TransferErrorSummary>,
1904 {
1905 use std::iter::Iterator;
1906 self.error_summary = v.into_iter().map(|i| i.into()).collect();
1907 self
1908 }
1909
1910 pub fn set_source<
1915 T: std::convert::Into<std::option::Option<crate::model::transfer_operation_metadata::Source>>,
1916 >(
1917 mut self,
1918 v: T,
1919 ) -> Self {
1920 self.source = v.into();
1921 self
1922 }
1923
1924 pub fn source_parallelstore(
1928 &self,
1929 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
1930 #[allow(unreachable_patterns)]
1931 self.source.as_ref().and_then(|v| match v {
1932 crate::model::transfer_operation_metadata::Source::SourceParallelstore(v) => {
1933 std::option::Option::Some(v)
1934 }
1935 _ => std::option::Option::None,
1936 })
1937 }
1938
1939 pub fn set_source_parallelstore<
1945 T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
1946 >(
1947 mut self,
1948 v: T,
1949 ) -> Self {
1950 self.source = std::option::Option::Some(
1951 crate::model::transfer_operation_metadata::Source::SourceParallelstore(v.into()),
1952 );
1953 self
1954 }
1955
1956 pub fn source_gcs_bucket(
1960 &self,
1961 ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
1962 #[allow(unreachable_patterns)]
1963 self.source.as_ref().and_then(|v| match v {
1964 crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v) => {
1965 std::option::Option::Some(v)
1966 }
1967 _ => std::option::Option::None,
1968 })
1969 }
1970
1971 pub fn set_source_gcs_bucket<
1977 T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
1978 >(
1979 mut self,
1980 v: T,
1981 ) -> Self {
1982 self.source = std::option::Option::Some(
1983 crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v.into()),
1984 );
1985 self
1986 }
1987
1988 pub fn set_destination<
1993 T: std::convert::Into<
1994 std::option::Option<crate::model::transfer_operation_metadata::Destination>,
1995 >,
1996 >(
1997 mut self,
1998 v: T,
1999 ) -> Self {
2000 self.destination = v.into();
2001 self
2002 }
2003
2004 pub fn destination_gcs_bucket(
2008 &self,
2009 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
2010 #[allow(unreachable_patterns)]
2011 self.destination.as_ref().and_then(|v| match v {
2012 crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v) => {
2013 std::option::Option::Some(v)
2014 }
2015 _ => std::option::Option::None,
2016 })
2017 }
2018
2019 pub fn set_destination_gcs_bucket<
2025 T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
2026 >(
2027 mut self,
2028 v: T,
2029 ) -> Self {
2030 self.destination = std::option::Option::Some(
2031 crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v.into()),
2032 );
2033 self
2034 }
2035
2036 pub fn destination_parallelstore(
2040 &self,
2041 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
2042 #[allow(unreachable_patterns)]
2043 self.destination.as_ref().and_then(|v| match v {
2044 crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(v) => {
2045 std::option::Option::Some(v)
2046 }
2047 _ => std::option::Option::None,
2048 })
2049 }
2050
2051 pub fn set_destination_parallelstore<
2057 T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
2058 >(
2059 mut self,
2060 v: T,
2061 ) -> Self {
2062 self.destination = std::option::Option::Some(
2063 crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(
2064 v.into(),
2065 ),
2066 );
2067 self
2068 }
2069}
2070
2071impl wkt::message::Message for TransferOperationMetadata {
2072 fn typename() -> &'static str {
2073 "type.googleapis.com/google.cloud.parallelstore.v1.TransferOperationMetadata"
2074 }
2075}
2076
2077pub mod transfer_operation_metadata {
2079 #[allow(unused_imports)]
2080 use super::*;
2081
2082 #[derive(Clone, Debug, PartialEq)]
2084 #[non_exhaustive]
2085 pub enum Source {
2086 SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
2088 SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
2090 }
2091
2092 #[derive(Clone, Debug, PartialEq)]
2094 #[non_exhaustive]
2095 pub enum Destination {
2096 DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
2098 DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
2100 }
2101}
2102
2103#[derive(Clone, Default, PartialEq)]
2105#[non_exhaustive]
2106pub struct TransferCounters {
2107 pub objects_found: i64,
2111
2112 pub bytes_found: i64,
2116
2117 pub objects_skipped: i64,
2120
2121 pub bytes_skipped: i64,
2124
2125 pub objects_copied: i64,
2127
2128 pub bytes_copied: i64,
2130
2131 pub objects_failed: i64,
2133
2134 pub bytes_failed: i64,
2136
2137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2138}
2139
2140impl TransferCounters {
2141 pub fn new() -> Self {
2142 std::default::Default::default()
2143 }
2144
2145 pub fn set_objects_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2147 self.objects_found = v.into();
2148 self
2149 }
2150
2151 pub fn set_bytes_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2153 self.bytes_found = v.into();
2154 self
2155 }
2156
2157 pub fn set_objects_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2159 self.objects_skipped = v.into();
2160 self
2161 }
2162
2163 pub fn set_bytes_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2165 self.bytes_skipped = v.into();
2166 self
2167 }
2168
2169 pub fn set_objects_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2171 self.objects_copied = v.into();
2172 self
2173 }
2174
2175 pub fn set_bytes_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2177 self.bytes_copied = v.into();
2178 self
2179 }
2180
2181 pub fn set_objects_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2183 self.objects_failed = v.into();
2184 self
2185 }
2186
2187 pub fn set_bytes_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2189 self.bytes_failed = v.into();
2190 self
2191 }
2192}
2193
2194impl wkt::message::Message for TransferCounters {
2195 fn typename() -> &'static str {
2196 "type.googleapis.com/google.cloud.parallelstore.v1.TransferCounters"
2197 }
2198}
2199
2200#[derive(Clone, Debug, PartialEq)]
2216#[non_exhaustive]
2217pub enum TransferType {
2218 Unspecified,
2220 Import,
2222 Export,
2224 UnknownValue(transfer_type::UnknownValue),
2229}
2230
2231#[doc(hidden)]
2232pub mod transfer_type {
2233 #[allow(unused_imports)]
2234 use super::*;
2235 #[derive(Clone, Debug, PartialEq)]
2236 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2237}
2238
2239impl TransferType {
2240 pub fn value(&self) -> std::option::Option<i32> {
2245 match self {
2246 Self::Unspecified => std::option::Option::Some(0),
2247 Self::Import => std::option::Option::Some(1),
2248 Self::Export => std::option::Option::Some(2),
2249 Self::UnknownValue(u) => u.0.value(),
2250 }
2251 }
2252
2253 pub fn name(&self) -> std::option::Option<&str> {
2258 match self {
2259 Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
2260 Self::Import => std::option::Option::Some("IMPORT"),
2261 Self::Export => std::option::Option::Some("EXPORT"),
2262 Self::UnknownValue(u) => u.0.name(),
2263 }
2264 }
2265}
2266
2267impl std::default::Default for TransferType {
2268 fn default() -> Self {
2269 use std::convert::From;
2270 Self::from(0)
2271 }
2272}
2273
2274impl std::fmt::Display for TransferType {
2275 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2276 wkt::internal::display_enum(f, self.name(), self.value())
2277 }
2278}
2279
2280impl std::convert::From<i32> for TransferType {
2281 fn from(value: i32) -> Self {
2282 match value {
2283 0 => Self::Unspecified,
2284 1 => Self::Import,
2285 2 => Self::Export,
2286 _ => Self::UnknownValue(transfer_type::UnknownValue(
2287 wkt::internal::UnknownEnumValue::Integer(value),
2288 )),
2289 }
2290 }
2291}
2292
2293impl std::convert::From<&str> for TransferType {
2294 fn from(value: &str) -> Self {
2295 use std::string::ToString;
2296 match value {
2297 "TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
2298 "IMPORT" => Self::Import,
2299 "EXPORT" => Self::Export,
2300 _ => Self::UnknownValue(transfer_type::UnknownValue(
2301 wkt::internal::UnknownEnumValue::String(value.to_string()),
2302 )),
2303 }
2304 }
2305}
2306
2307impl serde::ser::Serialize for TransferType {
2308 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2309 where
2310 S: serde::Serializer,
2311 {
2312 match self {
2313 Self::Unspecified => serializer.serialize_i32(0),
2314 Self::Import => serializer.serialize_i32(1),
2315 Self::Export => serializer.serialize_i32(2),
2316 Self::UnknownValue(u) => u.0.serialize(serializer),
2317 }
2318 }
2319}
2320
2321impl<'de> serde::de::Deserialize<'de> for TransferType {
2322 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2323 where
2324 D: serde::Deserializer<'de>,
2325 {
2326 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
2327 ".google.cloud.parallelstore.v1.TransferType",
2328 ))
2329 }
2330}
2331
2332#[derive(Clone, Debug, PartialEq)]
2348#[non_exhaustive]
2349pub enum FileStripeLevel {
2350 Unspecified,
2352 Min,
2354 Balanced,
2356 Max,
2358 UnknownValue(file_stripe_level::UnknownValue),
2363}
2364
2365#[doc(hidden)]
2366pub mod file_stripe_level {
2367 #[allow(unused_imports)]
2368 use super::*;
2369 #[derive(Clone, Debug, PartialEq)]
2370 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2371}
2372
2373impl FileStripeLevel {
2374 pub fn value(&self) -> std::option::Option<i32> {
2379 match self {
2380 Self::Unspecified => std::option::Option::Some(0),
2381 Self::Min => std::option::Option::Some(1),
2382 Self::Balanced => std::option::Option::Some(2),
2383 Self::Max => std::option::Option::Some(3),
2384 Self::UnknownValue(u) => u.0.value(),
2385 }
2386 }
2387
2388 pub fn name(&self) -> std::option::Option<&str> {
2393 match self {
2394 Self::Unspecified => std::option::Option::Some("FILE_STRIPE_LEVEL_UNSPECIFIED"),
2395 Self::Min => std::option::Option::Some("FILE_STRIPE_LEVEL_MIN"),
2396 Self::Balanced => std::option::Option::Some("FILE_STRIPE_LEVEL_BALANCED"),
2397 Self::Max => std::option::Option::Some("FILE_STRIPE_LEVEL_MAX"),
2398 Self::UnknownValue(u) => u.0.name(),
2399 }
2400 }
2401}
2402
2403impl std::default::Default for FileStripeLevel {
2404 fn default() -> Self {
2405 use std::convert::From;
2406 Self::from(0)
2407 }
2408}
2409
2410impl std::fmt::Display for FileStripeLevel {
2411 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2412 wkt::internal::display_enum(f, self.name(), self.value())
2413 }
2414}
2415
2416impl std::convert::From<i32> for FileStripeLevel {
2417 fn from(value: i32) -> Self {
2418 match value {
2419 0 => Self::Unspecified,
2420 1 => Self::Min,
2421 2 => Self::Balanced,
2422 3 => Self::Max,
2423 _ => Self::UnknownValue(file_stripe_level::UnknownValue(
2424 wkt::internal::UnknownEnumValue::Integer(value),
2425 )),
2426 }
2427 }
2428}
2429
2430impl std::convert::From<&str> for FileStripeLevel {
2431 fn from(value: &str) -> Self {
2432 use std::string::ToString;
2433 match value {
2434 "FILE_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
2435 "FILE_STRIPE_LEVEL_MIN" => Self::Min,
2436 "FILE_STRIPE_LEVEL_BALANCED" => Self::Balanced,
2437 "FILE_STRIPE_LEVEL_MAX" => Self::Max,
2438 _ => Self::UnknownValue(file_stripe_level::UnknownValue(
2439 wkt::internal::UnknownEnumValue::String(value.to_string()),
2440 )),
2441 }
2442 }
2443}
2444
2445impl serde::ser::Serialize for FileStripeLevel {
2446 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2447 where
2448 S: serde::Serializer,
2449 {
2450 match self {
2451 Self::Unspecified => serializer.serialize_i32(0),
2452 Self::Min => serializer.serialize_i32(1),
2453 Self::Balanced => serializer.serialize_i32(2),
2454 Self::Max => serializer.serialize_i32(3),
2455 Self::UnknownValue(u) => u.0.serialize(serializer),
2456 }
2457 }
2458}
2459
2460impl<'de> serde::de::Deserialize<'de> for FileStripeLevel {
2461 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2462 where
2463 D: serde::Deserializer<'de>,
2464 {
2465 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileStripeLevel>::new(
2466 ".google.cloud.parallelstore.v1.FileStripeLevel",
2467 ))
2468 }
2469}
2470
2471#[derive(Clone, Debug, PartialEq)]
2487#[non_exhaustive]
2488pub enum DirectoryStripeLevel {
2489 Unspecified,
2491 Min,
2493 Balanced,
2495 Max,
2497 UnknownValue(directory_stripe_level::UnknownValue),
2502}
2503
2504#[doc(hidden)]
2505pub mod directory_stripe_level {
2506 #[allow(unused_imports)]
2507 use super::*;
2508 #[derive(Clone, Debug, PartialEq)]
2509 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2510}
2511
2512impl DirectoryStripeLevel {
2513 pub fn value(&self) -> std::option::Option<i32> {
2518 match self {
2519 Self::Unspecified => std::option::Option::Some(0),
2520 Self::Min => std::option::Option::Some(1),
2521 Self::Balanced => std::option::Option::Some(2),
2522 Self::Max => std::option::Option::Some(3),
2523 Self::UnknownValue(u) => u.0.value(),
2524 }
2525 }
2526
2527 pub fn name(&self) -> std::option::Option<&str> {
2532 match self {
2533 Self::Unspecified => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_UNSPECIFIED"),
2534 Self::Min => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MIN"),
2535 Self::Balanced => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_BALANCED"),
2536 Self::Max => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MAX"),
2537 Self::UnknownValue(u) => u.0.name(),
2538 }
2539 }
2540}
2541
2542impl std::default::Default for DirectoryStripeLevel {
2543 fn default() -> Self {
2544 use std::convert::From;
2545 Self::from(0)
2546 }
2547}
2548
2549impl std::fmt::Display for DirectoryStripeLevel {
2550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2551 wkt::internal::display_enum(f, self.name(), self.value())
2552 }
2553}
2554
2555impl std::convert::From<i32> for DirectoryStripeLevel {
2556 fn from(value: i32) -> Self {
2557 match value {
2558 0 => Self::Unspecified,
2559 1 => Self::Min,
2560 2 => Self::Balanced,
2561 3 => Self::Max,
2562 _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
2563 wkt::internal::UnknownEnumValue::Integer(value),
2564 )),
2565 }
2566 }
2567}
2568
2569impl std::convert::From<&str> for DirectoryStripeLevel {
2570 fn from(value: &str) -> Self {
2571 use std::string::ToString;
2572 match value {
2573 "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
2574 "DIRECTORY_STRIPE_LEVEL_MIN" => Self::Min,
2575 "DIRECTORY_STRIPE_LEVEL_BALANCED" => Self::Balanced,
2576 "DIRECTORY_STRIPE_LEVEL_MAX" => Self::Max,
2577 _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
2578 wkt::internal::UnknownEnumValue::String(value.to_string()),
2579 )),
2580 }
2581 }
2582}
2583
2584impl serde::ser::Serialize for DirectoryStripeLevel {
2585 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2586 where
2587 S: serde::Serializer,
2588 {
2589 match self {
2590 Self::Unspecified => serializer.serialize_i32(0),
2591 Self::Min => serializer.serialize_i32(1),
2592 Self::Balanced => serializer.serialize_i32(2),
2593 Self::Max => serializer.serialize_i32(3),
2594 Self::UnknownValue(u) => u.0.serialize(serializer),
2595 }
2596 }
2597}
2598
2599impl<'de> serde::de::Deserialize<'de> for DirectoryStripeLevel {
2600 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2601 where
2602 D: serde::Deserializer<'de>,
2603 {
2604 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryStripeLevel>::new(
2605 ".google.cloud.parallelstore.v1.DirectoryStripeLevel",
2606 ))
2607 }
2608}
2609
2610#[derive(Clone, Debug, PartialEq)]
2626#[non_exhaustive]
2627pub enum DeploymentType {
2628 Unspecified,
2631 Scratch,
2633 Persistent,
2635 UnknownValue(deployment_type::UnknownValue),
2640}
2641
2642#[doc(hidden)]
2643pub mod deployment_type {
2644 #[allow(unused_imports)]
2645 use super::*;
2646 #[derive(Clone, Debug, PartialEq)]
2647 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2648}
2649
2650impl DeploymentType {
2651 pub fn value(&self) -> std::option::Option<i32> {
2656 match self {
2657 Self::Unspecified => std::option::Option::Some(0),
2658 Self::Scratch => std::option::Option::Some(1),
2659 Self::Persistent => std::option::Option::Some(2),
2660 Self::UnknownValue(u) => u.0.value(),
2661 }
2662 }
2663
2664 pub fn name(&self) -> std::option::Option<&str> {
2669 match self {
2670 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_TYPE_UNSPECIFIED"),
2671 Self::Scratch => std::option::Option::Some("SCRATCH"),
2672 Self::Persistent => std::option::Option::Some("PERSISTENT"),
2673 Self::UnknownValue(u) => u.0.name(),
2674 }
2675 }
2676}
2677
2678impl std::default::Default for DeploymentType {
2679 fn default() -> Self {
2680 use std::convert::From;
2681 Self::from(0)
2682 }
2683}
2684
2685impl std::fmt::Display for DeploymentType {
2686 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2687 wkt::internal::display_enum(f, self.name(), self.value())
2688 }
2689}
2690
2691impl std::convert::From<i32> for DeploymentType {
2692 fn from(value: i32) -> Self {
2693 match value {
2694 0 => Self::Unspecified,
2695 1 => Self::Scratch,
2696 2 => Self::Persistent,
2697 _ => Self::UnknownValue(deployment_type::UnknownValue(
2698 wkt::internal::UnknownEnumValue::Integer(value),
2699 )),
2700 }
2701 }
2702}
2703
2704impl std::convert::From<&str> for DeploymentType {
2705 fn from(value: &str) -> Self {
2706 use std::string::ToString;
2707 match value {
2708 "DEPLOYMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
2709 "SCRATCH" => Self::Scratch,
2710 "PERSISTENT" => Self::Persistent,
2711 _ => Self::UnknownValue(deployment_type::UnknownValue(
2712 wkt::internal::UnknownEnumValue::String(value.to_string()),
2713 )),
2714 }
2715 }
2716}
2717
2718impl serde::ser::Serialize for DeploymentType {
2719 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2720 where
2721 S: serde::Serializer,
2722 {
2723 match self {
2724 Self::Unspecified => serializer.serialize_i32(0),
2725 Self::Scratch => serializer.serialize_i32(1),
2726 Self::Persistent => serializer.serialize_i32(2),
2727 Self::UnknownValue(u) => u.0.serialize(serializer),
2728 }
2729 }
2730}
2731
2732impl<'de> serde::de::Deserialize<'de> for DeploymentType {
2733 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2734 where
2735 D: serde::Deserializer<'de>,
2736 {
2737 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentType>::new(
2738 ".google.cloud.parallelstore.v1.DeploymentType",
2739 ))
2740 }
2741}