google_cloud_vmmigration_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// ReplicationCycle contains information about the current replication cycle
40/// status.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ReplicationCycle {
44 /// The identifier of the ReplicationCycle.
45 pub name: std::string::String,
46
47 /// The cycle's ordinal number.
48 pub cycle_number: i32,
49
50 /// The time the replication cycle has started.
51 pub start_time: std::option::Option<wkt::Timestamp>,
52
53 /// The time the replication cycle has ended.
54 pub end_time: std::option::Option<wkt::Timestamp>,
55
56 /// The accumulated duration the replication cycle was paused.
57 pub total_pause_duration: std::option::Option<wkt::Duration>,
58
59 /// The current progress in percentage of this cycle.
60 /// Was replaced by 'steps' field, which breaks down the cycle progression more
61 /// accurately.
62 #[deprecated]
63 pub progress_percent: i32,
64
65 /// The cycle's steps list representing its progress.
66 pub steps: std::vec::Vec<crate::model::CycleStep>,
67
68 /// State of the ReplicationCycle.
69 pub state: crate::model::replication_cycle::State,
70
71 /// Output only. Provides details on the state of the cycle in case of an
72 /// error.
73 pub error: std::option::Option<google_cloud_rpc::model::Status>,
74
75 /// Output only. Warnings that occurred during the cycle.
76 pub warnings: std::vec::Vec<crate::model::MigrationWarning>,
77
78 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
79}
80
81impl ReplicationCycle {
82 /// Creates a new default instance.
83 pub fn new() -> Self {
84 std::default::Default::default()
85 }
86
87 /// Sets the value of [name][crate::model::ReplicationCycle::name].
88 ///
89 /// # Example
90 /// ```ignore,no_run
91 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
92 /// # let project_id = "project_id";
93 /// # let location_id = "location_id";
94 /// # let source_id = "source_id";
95 /// # let migrating_vm_id = "migrating_vm_id";
96 /// # let replication_cycle_id = "replication_cycle_id";
97 /// let x = ReplicationCycle::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/replicationCycles/{replication_cycle_id}"));
98 /// ```
99 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100 self.name = v.into();
101 self
102 }
103
104 /// Sets the value of [cycle_number][crate::model::ReplicationCycle::cycle_number].
105 ///
106 /// # Example
107 /// ```ignore,no_run
108 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
109 /// let x = ReplicationCycle::new().set_cycle_number(42);
110 /// ```
111 pub fn set_cycle_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
112 self.cycle_number = v.into();
113 self
114 }
115
116 /// Sets the value of [start_time][crate::model::ReplicationCycle::start_time].
117 ///
118 /// # Example
119 /// ```ignore,no_run
120 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
121 /// use wkt::Timestamp;
122 /// let x = ReplicationCycle::new().set_start_time(Timestamp::default()/* use setters */);
123 /// ```
124 pub fn set_start_time<T>(mut self, v: T) -> Self
125 where
126 T: std::convert::Into<wkt::Timestamp>,
127 {
128 self.start_time = std::option::Option::Some(v.into());
129 self
130 }
131
132 /// Sets or clears the value of [start_time][crate::model::ReplicationCycle::start_time].
133 ///
134 /// # Example
135 /// ```ignore,no_run
136 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
137 /// use wkt::Timestamp;
138 /// let x = ReplicationCycle::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
139 /// let x = ReplicationCycle::new().set_or_clear_start_time(None::<Timestamp>);
140 /// ```
141 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
142 where
143 T: std::convert::Into<wkt::Timestamp>,
144 {
145 self.start_time = v.map(|x| x.into());
146 self
147 }
148
149 /// Sets the value of [end_time][crate::model::ReplicationCycle::end_time].
150 ///
151 /// # Example
152 /// ```ignore,no_run
153 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
154 /// use wkt::Timestamp;
155 /// let x = ReplicationCycle::new().set_end_time(Timestamp::default()/* use setters */);
156 /// ```
157 pub fn set_end_time<T>(mut self, v: T) -> Self
158 where
159 T: std::convert::Into<wkt::Timestamp>,
160 {
161 self.end_time = std::option::Option::Some(v.into());
162 self
163 }
164
165 /// Sets or clears the value of [end_time][crate::model::ReplicationCycle::end_time].
166 ///
167 /// # Example
168 /// ```ignore,no_run
169 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
170 /// use wkt::Timestamp;
171 /// let x = ReplicationCycle::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
172 /// let x = ReplicationCycle::new().set_or_clear_end_time(None::<Timestamp>);
173 /// ```
174 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
175 where
176 T: std::convert::Into<wkt::Timestamp>,
177 {
178 self.end_time = v.map(|x| x.into());
179 self
180 }
181
182 /// Sets the value of [total_pause_duration][crate::model::ReplicationCycle::total_pause_duration].
183 ///
184 /// # Example
185 /// ```ignore,no_run
186 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
187 /// use wkt::Duration;
188 /// let x = ReplicationCycle::new().set_total_pause_duration(Duration::default()/* use setters */);
189 /// ```
190 pub fn set_total_pause_duration<T>(mut self, v: T) -> Self
191 where
192 T: std::convert::Into<wkt::Duration>,
193 {
194 self.total_pause_duration = std::option::Option::Some(v.into());
195 self
196 }
197
198 /// Sets or clears the value of [total_pause_duration][crate::model::ReplicationCycle::total_pause_duration].
199 ///
200 /// # Example
201 /// ```ignore,no_run
202 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
203 /// use wkt::Duration;
204 /// let x = ReplicationCycle::new().set_or_clear_total_pause_duration(Some(Duration::default()/* use setters */));
205 /// let x = ReplicationCycle::new().set_or_clear_total_pause_duration(None::<Duration>);
206 /// ```
207 pub fn set_or_clear_total_pause_duration<T>(mut self, v: std::option::Option<T>) -> Self
208 where
209 T: std::convert::Into<wkt::Duration>,
210 {
211 self.total_pause_duration = v.map(|x| x.into());
212 self
213 }
214
215 /// Sets the value of [progress_percent][crate::model::ReplicationCycle::progress_percent].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
220 /// let x = ReplicationCycle::new().set_progress_percent(42);
221 /// ```
222 #[deprecated]
223 pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
224 self.progress_percent = v.into();
225 self
226 }
227
228 /// Sets the value of [steps][crate::model::ReplicationCycle::steps].
229 ///
230 /// # Example
231 /// ```ignore,no_run
232 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
233 /// use google_cloud_vmmigration_v1::model::CycleStep;
234 /// let x = ReplicationCycle::new()
235 /// .set_steps([
236 /// CycleStep::default()/* use setters */,
237 /// CycleStep::default()/* use (different) setters */,
238 /// ]);
239 /// ```
240 pub fn set_steps<T, V>(mut self, v: T) -> Self
241 where
242 T: std::iter::IntoIterator<Item = V>,
243 V: std::convert::Into<crate::model::CycleStep>,
244 {
245 use std::iter::Iterator;
246 self.steps = v.into_iter().map(|i| i.into()).collect();
247 self
248 }
249
250 /// Sets the value of [state][crate::model::ReplicationCycle::state].
251 ///
252 /// # Example
253 /// ```ignore,no_run
254 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
255 /// use google_cloud_vmmigration_v1::model::replication_cycle::State;
256 /// let x0 = ReplicationCycle::new().set_state(State::Running);
257 /// let x1 = ReplicationCycle::new().set_state(State::Paused);
258 /// let x2 = ReplicationCycle::new().set_state(State::Failed);
259 /// ```
260 pub fn set_state<T: std::convert::Into<crate::model::replication_cycle::State>>(
261 mut self,
262 v: T,
263 ) -> Self {
264 self.state = v.into();
265 self
266 }
267
268 /// Sets the value of [error][crate::model::ReplicationCycle::error].
269 ///
270 /// # Example
271 /// ```ignore,no_run
272 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
273 /// use google_cloud_rpc::model::Status;
274 /// let x = ReplicationCycle::new().set_error(Status::default()/* use setters */);
275 /// ```
276 pub fn set_error<T>(mut self, v: T) -> Self
277 where
278 T: std::convert::Into<google_cloud_rpc::model::Status>,
279 {
280 self.error = std::option::Option::Some(v.into());
281 self
282 }
283
284 /// Sets or clears the value of [error][crate::model::ReplicationCycle::error].
285 ///
286 /// # Example
287 /// ```ignore,no_run
288 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
289 /// use google_cloud_rpc::model::Status;
290 /// let x = ReplicationCycle::new().set_or_clear_error(Some(Status::default()/* use setters */));
291 /// let x = ReplicationCycle::new().set_or_clear_error(None::<Status>);
292 /// ```
293 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
294 where
295 T: std::convert::Into<google_cloud_rpc::model::Status>,
296 {
297 self.error = v.map(|x| x.into());
298 self
299 }
300
301 /// Sets the value of [warnings][crate::model::ReplicationCycle::warnings].
302 ///
303 /// # Example
304 /// ```ignore,no_run
305 /// # use google_cloud_vmmigration_v1::model::ReplicationCycle;
306 /// use google_cloud_vmmigration_v1::model::MigrationWarning;
307 /// let x = ReplicationCycle::new()
308 /// .set_warnings([
309 /// MigrationWarning::default()/* use setters */,
310 /// MigrationWarning::default()/* use (different) setters */,
311 /// ]);
312 /// ```
313 pub fn set_warnings<T, V>(mut self, v: T) -> Self
314 where
315 T: std::iter::IntoIterator<Item = V>,
316 V: std::convert::Into<crate::model::MigrationWarning>,
317 {
318 use std::iter::Iterator;
319 self.warnings = v.into_iter().map(|i| i.into()).collect();
320 self
321 }
322}
323
324impl wkt::message::Message for ReplicationCycle {
325 fn typename() -> &'static str {
326 "type.googleapis.com/google.cloud.vmmigration.v1.ReplicationCycle"
327 }
328}
329
330/// Defines additional types related to [ReplicationCycle].
331pub mod replication_cycle {
332 #[allow(unused_imports)]
333 use super::*;
334
335 /// Possible states of a replication cycle.
336 ///
337 /// # Working with unknown values
338 ///
339 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
340 /// additional enum variants at any time. Adding new variants is not considered
341 /// a breaking change. Applications should write their code in anticipation of:
342 ///
343 /// - New values appearing in future releases of the client library, **and**
344 /// - New values received dynamically, without application changes.
345 ///
346 /// Please consult the [Working with enums] section in the user guide for some
347 /// guidelines.
348 ///
349 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
350 #[derive(Clone, Debug, PartialEq)]
351 #[non_exhaustive]
352 pub enum State {
353 /// The state is unknown. This is used for API compatibility only and is not
354 /// used by the system.
355 Unspecified,
356 /// The replication cycle is running.
357 Running,
358 /// The replication cycle is paused.
359 Paused,
360 /// The replication cycle finished with errors.
361 Failed,
362 /// The replication cycle finished successfully.
363 Succeeded,
364 /// If set, the enum was initialized with an unknown value.
365 ///
366 /// Applications can examine the value using [State::value] or
367 /// [State::name].
368 UnknownValue(state::UnknownValue),
369 }
370
371 #[doc(hidden)]
372 pub mod state {
373 #[allow(unused_imports)]
374 use super::*;
375 #[derive(Clone, Debug, PartialEq)]
376 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
377 }
378
379 impl State {
380 /// Gets the enum value.
381 ///
382 /// Returns `None` if the enum contains an unknown value deserialized from
383 /// the string representation of enums.
384 pub fn value(&self) -> std::option::Option<i32> {
385 match self {
386 Self::Unspecified => std::option::Option::Some(0),
387 Self::Running => std::option::Option::Some(1),
388 Self::Paused => std::option::Option::Some(2),
389 Self::Failed => std::option::Option::Some(3),
390 Self::Succeeded => std::option::Option::Some(4),
391 Self::UnknownValue(u) => u.0.value(),
392 }
393 }
394
395 /// Gets the enum value as a string.
396 ///
397 /// Returns `None` if the enum contains an unknown value deserialized from
398 /// the integer representation of enums.
399 pub fn name(&self) -> std::option::Option<&str> {
400 match self {
401 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
402 Self::Running => std::option::Option::Some("RUNNING"),
403 Self::Paused => std::option::Option::Some("PAUSED"),
404 Self::Failed => std::option::Option::Some("FAILED"),
405 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
406 Self::UnknownValue(u) => u.0.name(),
407 }
408 }
409 }
410
411 impl std::default::Default for State {
412 fn default() -> Self {
413 use std::convert::From;
414 Self::from(0)
415 }
416 }
417
418 impl std::fmt::Display for State {
419 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
420 wkt::internal::display_enum(f, self.name(), self.value())
421 }
422 }
423
424 impl std::convert::From<i32> for State {
425 fn from(value: i32) -> Self {
426 match value {
427 0 => Self::Unspecified,
428 1 => Self::Running,
429 2 => Self::Paused,
430 3 => Self::Failed,
431 4 => Self::Succeeded,
432 _ => Self::UnknownValue(state::UnknownValue(
433 wkt::internal::UnknownEnumValue::Integer(value),
434 )),
435 }
436 }
437 }
438
439 impl std::convert::From<&str> for State {
440 fn from(value: &str) -> Self {
441 use std::string::ToString;
442 match value {
443 "STATE_UNSPECIFIED" => Self::Unspecified,
444 "RUNNING" => Self::Running,
445 "PAUSED" => Self::Paused,
446 "FAILED" => Self::Failed,
447 "SUCCEEDED" => Self::Succeeded,
448 _ => Self::UnknownValue(state::UnknownValue(
449 wkt::internal::UnknownEnumValue::String(value.to_string()),
450 )),
451 }
452 }
453 }
454
455 impl serde::ser::Serialize for State {
456 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
457 where
458 S: serde::Serializer,
459 {
460 match self {
461 Self::Unspecified => serializer.serialize_i32(0),
462 Self::Running => serializer.serialize_i32(1),
463 Self::Paused => serializer.serialize_i32(2),
464 Self::Failed => serializer.serialize_i32(3),
465 Self::Succeeded => serializer.serialize_i32(4),
466 Self::UnknownValue(u) => u.0.serialize(serializer),
467 }
468 }
469 }
470
471 impl<'de> serde::de::Deserialize<'de> for State {
472 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
473 where
474 D: serde::Deserializer<'de>,
475 {
476 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
477 ".google.cloud.vmmigration.v1.ReplicationCycle.State",
478 ))
479 }
480 }
481}
482
483/// CycleStep holds information about a step progress.
484#[derive(Clone, Default, PartialEq)]
485#[non_exhaustive]
486pub struct CycleStep {
487 /// The time the cycle step has started.
488 pub start_time: std::option::Option<wkt::Timestamp>,
489
490 /// The time the cycle step has ended.
491 pub end_time: std::option::Option<wkt::Timestamp>,
492
493 #[allow(missing_docs)]
494 pub step: std::option::Option<crate::model::cycle_step::Step>,
495
496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
497}
498
499impl CycleStep {
500 /// Creates a new default instance.
501 pub fn new() -> Self {
502 std::default::Default::default()
503 }
504
505 /// Sets the value of [start_time][crate::model::CycleStep::start_time].
506 ///
507 /// # Example
508 /// ```ignore,no_run
509 /// # use google_cloud_vmmigration_v1::model::CycleStep;
510 /// use wkt::Timestamp;
511 /// let x = CycleStep::new().set_start_time(Timestamp::default()/* use setters */);
512 /// ```
513 pub fn set_start_time<T>(mut self, v: T) -> Self
514 where
515 T: std::convert::Into<wkt::Timestamp>,
516 {
517 self.start_time = std::option::Option::Some(v.into());
518 self
519 }
520
521 /// Sets or clears the value of [start_time][crate::model::CycleStep::start_time].
522 ///
523 /// # Example
524 /// ```ignore,no_run
525 /// # use google_cloud_vmmigration_v1::model::CycleStep;
526 /// use wkt::Timestamp;
527 /// let x = CycleStep::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
528 /// let x = CycleStep::new().set_or_clear_start_time(None::<Timestamp>);
529 /// ```
530 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
531 where
532 T: std::convert::Into<wkt::Timestamp>,
533 {
534 self.start_time = v.map(|x| x.into());
535 self
536 }
537
538 /// Sets the value of [end_time][crate::model::CycleStep::end_time].
539 ///
540 /// # Example
541 /// ```ignore,no_run
542 /// # use google_cloud_vmmigration_v1::model::CycleStep;
543 /// use wkt::Timestamp;
544 /// let x = CycleStep::new().set_end_time(Timestamp::default()/* use setters */);
545 /// ```
546 pub fn set_end_time<T>(mut self, v: T) -> Self
547 where
548 T: std::convert::Into<wkt::Timestamp>,
549 {
550 self.end_time = std::option::Option::Some(v.into());
551 self
552 }
553
554 /// Sets or clears the value of [end_time][crate::model::CycleStep::end_time].
555 ///
556 /// # Example
557 /// ```ignore,no_run
558 /// # use google_cloud_vmmigration_v1::model::CycleStep;
559 /// use wkt::Timestamp;
560 /// let x = CycleStep::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
561 /// let x = CycleStep::new().set_or_clear_end_time(None::<Timestamp>);
562 /// ```
563 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
564 where
565 T: std::convert::Into<wkt::Timestamp>,
566 {
567 self.end_time = v.map(|x| x.into());
568 self
569 }
570
571 /// Sets the value of [step][crate::model::CycleStep::step].
572 ///
573 /// Note that all the setters affecting `step` are mutually
574 /// exclusive.
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_vmmigration_v1::model::CycleStep;
579 /// use google_cloud_vmmigration_v1::model::InitializingReplicationStep;
580 /// let x = CycleStep::new().set_step(Some(
581 /// google_cloud_vmmigration_v1::model::cycle_step::Step::InitializingReplication(InitializingReplicationStep::default().into())));
582 /// ```
583 pub fn set_step<T: std::convert::Into<std::option::Option<crate::model::cycle_step::Step>>>(
584 mut self,
585 v: T,
586 ) -> Self {
587 self.step = v.into();
588 self
589 }
590
591 /// The value of [step][crate::model::CycleStep::step]
592 /// if it holds a `InitializingReplication`, `None` if the field is not set or
593 /// holds a different branch.
594 pub fn initializing_replication(
595 &self,
596 ) -> std::option::Option<&std::boxed::Box<crate::model::InitializingReplicationStep>> {
597 #[allow(unreachable_patterns)]
598 self.step.as_ref().and_then(|v| match v {
599 crate::model::cycle_step::Step::InitializingReplication(v) => {
600 std::option::Option::Some(v)
601 }
602 _ => std::option::Option::None,
603 })
604 }
605
606 /// Sets the value of [step][crate::model::CycleStep::step]
607 /// to hold a `InitializingReplication`.
608 ///
609 /// Note that all the setters affecting `step` are
610 /// mutually exclusive.
611 ///
612 /// # Example
613 /// ```ignore,no_run
614 /// # use google_cloud_vmmigration_v1::model::CycleStep;
615 /// use google_cloud_vmmigration_v1::model::InitializingReplicationStep;
616 /// let x = CycleStep::new().set_initializing_replication(InitializingReplicationStep::default()/* use setters */);
617 /// assert!(x.initializing_replication().is_some());
618 /// assert!(x.replicating().is_none());
619 /// assert!(x.post_processing().is_none());
620 /// ```
621 pub fn set_initializing_replication<
622 T: std::convert::Into<std::boxed::Box<crate::model::InitializingReplicationStep>>,
623 >(
624 mut self,
625 v: T,
626 ) -> Self {
627 self.step = std::option::Option::Some(
628 crate::model::cycle_step::Step::InitializingReplication(v.into()),
629 );
630 self
631 }
632
633 /// The value of [step][crate::model::CycleStep::step]
634 /// if it holds a `Replicating`, `None` if the field is not set or
635 /// holds a different branch.
636 pub fn replicating(
637 &self,
638 ) -> std::option::Option<&std::boxed::Box<crate::model::ReplicatingStep>> {
639 #[allow(unreachable_patterns)]
640 self.step.as_ref().and_then(|v| match v {
641 crate::model::cycle_step::Step::Replicating(v) => std::option::Option::Some(v),
642 _ => std::option::Option::None,
643 })
644 }
645
646 /// Sets the value of [step][crate::model::CycleStep::step]
647 /// to hold a `Replicating`.
648 ///
649 /// Note that all the setters affecting `step` are
650 /// mutually exclusive.
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_vmmigration_v1::model::CycleStep;
655 /// use google_cloud_vmmigration_v1::model::ReplicatingStep;
656 /// let x = CycleStep::new().set_replicating(ReplicatingStep::default()/* use setters */);
657 /// assert!(x.replicating().is_some());
658 /// assert!(x.initializing_replication().is_none());
659 /// assert!(x.post_processing().is_none());
660 /// ```
661 pub fn set_replicating<
662 T: std::convert::Into<std::boxed::Box<crate::model::ReplicatingStep>>,
663 >(
664 mut self,
665 v: T,
666 ) -> Self {
667 self.step =
668 std::option::Option::Some(crate::model::cycle_step::Step::Replicating(v.into()));
669 self
670 }
671
672 /// The value of [step][crate::model::CycleStep::step]
673 /// if it holds a `PostProcessing`, `None` if the field is not set or
674 /// holds a different branch.
675 pub fn post_processing(
676 &self,
677 ) -> std::option::Option<&std::boxed::Box<crate::model::PostProcessingStep>> {
678 #[allow(unreachable_patterns)]
679 self.step.as_ref().and_then(|v| match v {
680 crate::model::cycle_step::Step::PostProcessing(v) => std::option::Option::Some(v),
681 _ => std::option::Option::None,
682 })
683 }
684
685 /// Sets the value of [step][crate::model::CycleStep::step]
686 /// to hold a `PostProcessing`.
687 ///
688 /// Note that all the setters affecting `step` are
689 /// mutually exclusive.
690 ///
691 /// # Example
692 /// ```ignore,no_run
693 /// # use google_cloud_vmmigration_v1::model::CycleStep;
694 /// use google_cloud_vmmigration_v1::model::PostProcessingStep;
695 /// let x = CycleStep::new().set_post_processing(PostProcessingStep::default()/* use setters */);
696 /// assert!(x.post_processing().is_some());
697 /// assert!(x.initializing_replication().is_none());
698 /// assert!(x.replicating().is_none());
699 /// ```
700 pub fn set_post_processing<
701 T: std::convert::Into<std::boxed::Box<crate::model::PostProcessingStep>>,
702 >(
703 mut self,
704 v: T,
705 ) -> Self {
706 self.step =
707 std::option::Option::Some(crate::model::cycle_step::Step::PostProcessing(v.into()));
708 self
709 }
710}
711
712impl wkt::message::Message for CycleStep {
713 fn typename() -> &'static str {
714 "type.googleapis.com/google.cloud.vmmigration.v1.CycleStep"
715 }
716}
717
718/// Defines additional types related to [CycleStep].
719pub mod cycle_step {
720 #[allow(unused_imports)]
721 use super::*;
722
723 #[allow(missing_docs)]
724 #[derive(Clone, Debug, PartialEq)]
725 #[non_exhaustive]
726 pub enum Step {
727 /// Initializing replication step.
728 InitializingReplication(std::boxed::Box<crate::model::InitializingReplicationStep>),
729 /// Replicating step.
730 Replicating(std::boxed::Box<crate::model::ReplicatingStep>),
731 /// Post processing step.
732 PostProcessing(std::boxed::Box<crate::model::PostProcessingStep>),
733 }
734}
735
736/// InitializingReplicationStep contains specific step details.
737#[derive(Clone, Default, PartialEq)]
738#[non_exhaustive]
739pub struct InitializingReplicationStep {
740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
741}
742
743impl InitializingReplicationStep {
744 /// Creates a new default instance.
745 pub fn new() -> Self {
746 std::default::Default::default()
747 }
748}
749
750impl wkt::message::Message for InitializingReplicationStep {
751 fn typename() -> &'static str {
752 "type.googleapis.com/google.cloud.vmmigration.v1.InitializingReplicationStep"
753 }
754}
755
756/// ReplicatingStep contains specific step details.
757#[derive(Clone, Default, PartialEq)]
758#[non_exhaustive]
759pub struct ReplicatingStep {
760 /// Total bytes to be handled in the step.
761 pub total_bytes: i64,
762
763 /// Replicated bytes in the step.
764 pub replicated_bytes: i64,
765
766 /// The source disks replication rate for the last 2 minutes in bytes per
767 /// second.
768 pub last_two_minutes_average_bytes_per_second: i64,
769
770 /// The source disks replication rate for the last 30 minutes in bytes per
771 /// second.
772 pub last_thirty_minutes_average_bytes_per_second: i64,
773
774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
775}
776
777impl ReplicatingStep {
778 /// Creates a new default instance.
779 pub fn new() -> Self {
780 std::default::Default::default()
781 }
782
783 /// Sets the value of [total_bytes][crate::model::ReplicatingStep::total_bytes].
784 ///
785 /// # Example
786 /// ```ignore,no_run
787 /// # use google_cloud_vmmigration_v1::model::ReplicatingStep;
788 /// let x = ReplicatingStep::new().set_total_bytes(42);
789 /// ```
790 pub fn set_total_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
791 self.total_bytes = v.into();
792 self
793 }
794
795 /// Sets the value of [replicated_bytes][crate::model::ReplicatingStep::replicated_bytes].
796 ///
797 /// # Example
798 /// ```ignore,no_run
799 /// # use google_cloud_vmmigration_v1::model::ReplicatingStep;
800 /// let x = ReplicatingStep::new().set_replicated_bytes(42);
801 /// ```
802 pub fn set_replicated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
803 self.replicated_bytes = v.into();
804 self
805 }
806
807 /// Sets the value of [last_two_minutes_average_bytes_per_second][crate::model::ReplicatingStep::last_two_minutes_average_bytes_per_second].
808 ///
809 /// # Example
810 /// ```ignore,no_run
811 /// # use google_cloud_vmmigration_v1::model::ReplicatingStep;
812 /// let x = ReplicatingStep::new().set_last_two_minutes_average_bytes_per_second(42);
813 /// ```
814 pub fn set_last_two_minutes_average_bytes_per_second<T: std::convert::Into<i64>>(
815 mut self,
816 v: T,
817 ) -> Self {
818 self.last_two_minutes_average_bytes_per_second = v.into();
819 self
820 }
821
822 /// Sets the value of [last_thirty_minutes_average_bytes_per_second][crate::model::ReplicatingStep::last_thirty_minutes_average_bytes_per_second].
823 ///
824 /// # Example
825 /// ```ignore,no_run
826 /// # use google_cloud_vmmigration_v1::model::ReplicatingStep;
827 /// let x = ReplicatingStep::new().set_last_thirty_minutes_average_bytes_per_second(42);
828 /// ```
829 pub fn set_last_thirty_minutes_average_bytes_per_second<T: std::convert::Into<i64>>(
830 mut self,
831 v: T,
832 ) -> Self {
833 self.last_thirty_minutes_average_bytes_per_second = v.into();
834 self
835 }
836}
837
838impl wkt::message::Message for ReplicatingStep {
839 fn typename() -> &'static str {
840 "type.googleapis.com/google.cloud.vmmigration.v1.ReplicatingStep"
841 }
842}
843
844/// PostProcessingStep contains specific step details.
845#[derive(Clone, Default, PartialEq)]
846#[non_exhaustive]
847pub struct PostProcessingStep {
848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
849}
850
851impl PostProcessingStep {
852 /// Creates a new default instance.
853 pub fn new() -> Self {
854 std::default::Default::default()
855 }
856}
857
858impl wkt::message::Message for PostProcessingStep {
859 fn typename() -> &'static str {
860 "type.googleapis.com/google.cloud.vmmigration.v1.PostProcessingStep"
861 }
862}
863
864/// ReplicationSync contain information about the last replica sync to the cloud.
865#[derive(Clone, Default, PartialEq)]
866#[non_exhaustive]
867pub struct ReplicationSync {
868 /// The most updated snapshot created time in the source that finished
869 /// replication.
870 pub last_sync_time: std::option::Option<wkt::Timestamp>,
871
872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
873}
874
875impl ReplicationSync {
876 /// Creates a new default instance.
877 pub fn new() -> Self {
878 std::default::Default::default()
879 }
880
881 /// Sets the value of [last_sync_time][crate::model::ReplicationSync::last_sync_time].
882 ///
883 /// # Example
884 /// ```ignore,no_run
885 /// # use google_cloud_vmmigration_v1::model::ReplicationSync;
886 /// use wkt::Timestamp;
887 /// let x = ReplicationSync::new().set_last_sync_time(Timestamp::default()/* use setters */);
888 /// ```
889 pub fn set_last_sync_time<T>(mut self, v: T) -> Self
890 where
891 T: std::convert::Into<wkt::Timestamp>,
892 {
893 self.last_sync_time = std::option::Option::Some(v.into());
894 self
895 }
896
897 /// Sets or clears the value of [last_sync_time][crate::model::ReplicationSync::last_sync_time].
898 ///
899 /// # Example
900 /// ```ignore,no_run
901 /// # use google_cloud_vmmigration_v1::model::ReplicationSync;
902 /// use wkt::Timestamp;
903 /// let x = ReplicationSync::new().set_or_clear_last_sync_time(Some(Timestamp::default()/* use setters */));
904 /// let x = ReplicationSync::new().set_or_clear_last_sync_time(None::<Timestamp>);
905 /// ```
906 pub fn set_or_clear_last_sync_time<T>(mut self, v: std::option::Option<T>) -> Self
907 where
908 T: std::convert::Into<wkt::Timestamp>,
909 {
910 self.last_sync_time = v.map(|x| x.into());
911 self
912 }
913}
914
915impl wkt::message::Message for ReplicationSync {
916 fn typename() -> &'static str {
917 "type.googleapis.com/google.cloud.vmmigration.v1.ReplicationSync"
918 }
919}
920
921/// MigratingVm describes the VM that will be migrated from a Source environment
922/// and its replication state.
923#[derive(Clone, Default, PartialEq)]
924#[non_exhaustive]
925pub struct MigratingVm {
926 /// Output only. The identifier of the MigratingVm.
927 pub name: std::string::String,
928
929 /// The unique ID of the VM in the source.
930 /// The VM's name in vSphere can be changed, so this is not the VM's name but
931 /// rather its moRef id. This id is of the form vm-\<num\>.
932 pub source_vm_id: std::string::String,
933
934 /// The display name attached to the MigratingVm by the user.
935 pub display_name: std::string::String,
936
937 /// The description attached to the migrating VM by the user.
938 pub description: std::string::String,
939
940 /// The replication schedule policy.
941 pub policy: std::option::Option<crate::model::SchedulePolicy>,
942
943 /// Output only. The time the migrating VM was created (this refers to this
944 /// resource and not to the time it was installed in the source).
945 pub create_time: std::option::Option<wkt::Timestamp>,
946
947 /// Output only. The last time the migrating VM resource was updated.
948 pub update_time: std::option::Option<wkt::Timestamp>,
949
950 /// Output only. The most updated snapshot created time in the source that
951 /// finished replication.
952 pub last_sync: std::option::Option<crate::model::ReplicationSync>,
953
954 /// Output only. State of the MigratingVm.
955 pub state: crate::model::migrating_vm::State,
956
957 /// Output only. The last time the migrating VM state was updated.
958 pub state_time: std::option::Option<wkt::Timestamp>,
959
960 /// Output only. Details of the current running replication cycle.
961 pub current_sync_info: std::option::Option<crate::model::ReplicationCycle>,
962
963 /// Output only. Details of the last replication cycle. This will be updated
964 /// whenever a replication cycle is finished and is not to be confused with
965 /// last_sync which is only updated on successful replication cycles.
966 pub last_replication_cycle: std::option::Option<crate::model::ReplicationCycle>,
967
968 /// Output only. The group this migrating vm is included in, if any. The group
969 /// is represented by the full path of the appropriate
970 /// [Group][google.cloud.vmmigration.v1.Group] resource.
971 ///
972 /// [google.cloud.vmmigration.v1.Group]: crate::model::Group
973 pub group: std::string::String,
974
975 /// The labels of the migrating VM.
976 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
977
978 /// Output only. The recent [clone jobs][google.cloud.vmmigration.v1.CloneJob]
979 /// performed on the migrating VM. This field holds the vm's last completed
980 /// clone job and the vm's running clone job, if one exists.
981 /// Note: To have this field populated you need to explicitly request it via
982 /// the "view" parameter of the Get/List request.
983 ///
984 /// [google.cloud.vmmigration.v1.CloneJob]: crate::model::CloneJob
985 pub recent_clone_jobs: std::vec::Vec<crate::model::CloneJob>,
986
987 /// Output only. Provides details on the state of the Migrating VM in case of
988 /// an error in replication.
989 pub error: std::option::Option<google_cloud_rpc::model::Status>,
990
991 /// Output only. The recent cutover jobs performed on the migrating VM.
992 /// This field holds the vm's last completed cutover job and the vm's
993 /// running cutover job, if one exists.
994 /// Note: To have this field populated you need to explicitly request it via
995 /// the "view" parameter of the Get/List request.
996 pub recent_cutover_jobs: std::vec::Vec<crate::model::CutoverJob>,
997
998 /// Output only. Provides details of future CutoverJobs of a MigratingVm.
999 /// Set to empty when cutover forecast is unavailable.
1000 pub cutover_forecast: std::option::Option<crate::model::CutoverForecast>,
1001
1002 /// Output only. Provides details about the expiration state of the migrating
1003 /// VM.
1004 pub expiration: std::option::Option<crate::model::migrating_vm::Expiration>,
1005
1006 /// The default configuration of the target VM that will be created in Google
1007 /// Cloud as a result of the migration.
1008 pub target_vm_defaults: std::option::Option<crate::model::migrating_vm::TargetVmDefaults>,
1009
1010 /// Details about the source VM.
1011 pub source_vm_details: std::option::Option<crate::model::migrating_vm::SourceVmDetails>,
1012
1013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1014}
1015
1016impl MigratingVm {
1017 /// Creates a new default instance.
1018 pub fn new() -> Self {
1019 std::default::Default::default()
1020 }
1021
1022 /// Sets the value of [name][crate::model::MigratingVm::name].
1023 ///
1024 /// # Example
1025 /// ```ignore,no_run
1026 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1027 /// # let project_id = "project_id";
1028 /// # let location_id = "location_id";
1029 /// # let source_id = "source_id";
1030 /// # let migrating_vm_id = "migrating_vm_id";
1031 /// let x = MigratingVm::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
1032 /// ```
1033 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1034 self.name = v.into();
1035 self
1036 }
1037
1038 /// Sets the value of [source_vm_id][crate::model::MigratingVm::source_vm_id].
1039 ///
1040 /// # Example
1041 /// ```ignore,no_run
1042 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1043 /// let x = MigratingVm::new().set_source_vm_id("example");
1044 /// ```
1045 pub fn set_source_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1046 self.source_vm_id = v.into();
1047 self
1048 }
1049
1050 /// Sets the value of [display_name][crate::model::MigratingVm::display_name].
1051 ///
1052 /// # Example
1053 /// ```ignore,no_run
1054 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1055 /// let x = MigratingVm::new().set_display_name("example");
1056 /// ```
1057 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1058 self.display_name = v.into();
1059 self
1060 }
1061
1062 /// Sets the value of [description][crate::model::MigratingVm::description].
1063 ///
1064 /// # Example
1065 /// ```ignore,no_run
1066 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1067 /// let x = MigratingVm::new().set_description("example");
1068 /// ```
1069 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1070 self.description = v.into();
1071 self
1072 }
1073
1074 /// Sets the value of [policy][crate::model::MigratingVm::policy].
1075 ///
1076 /// # Example
1077 /// ```ignore,no_run
1078 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1079 /// use google_cloud_vmmigration_v1::model::SchedulePolicy;
1080 /// let x = MigratingVm::new().set_policy(SchedulePolicy::default()/* use setters */);
1081 /// ```
1082 pub fn set_policy<T>(mut self, v: T) -> Self
1083 where
1084 T: std::convert::Into<crate::model::SchedulePolicy>,
1085 {
1086 self.policy = std::option::Option::Some(v.into());
1087 self
1088 }
1089
1090 /// Sets or clears the value of [policy][crate::model::MigratingVm::policy].
1091 ///
1092 /// # Example
1093 /// ```ignore,no_run
1094 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1095 /// use google_cloud_vmmigration_v1::model::SchedulePolicy;
1096 /// let x = MigratingVm::new().set_or_clear_policy(Some(SchedulePolicy::default()/* use setters */));
1097 /// let x = MigratingVm::new().set_or_clear_policy(None::<SchedulePolicy>);
1098 /// ```
1099 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1100 where
1101 T: std::convert::Into<crate::model::SchedulePolicy>,
1102 {
1103 self.policy = v.map(|x| x.into());
1104 self
1105 }
1106
1107 /// Sets the value of [create_time][crate::model::MigratingVm::create_time].
1108 ///
1109 /// # Example
1110 /// ```ignore,no_run
1111 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1112 /// use wkt::Timestamp;
1113 /// let x = MigratingVm::new().set_create_time(Timestamp::default()/* use setters */);
1114 /// ```
1115 pub fn set_create_time<T>(mut self, v: T) -> Self
1116 where
1117 T: std::convert::Into<wkt::Timestamp>,
1118 {
1119 self.create_time = std::option::Option::Some(v.into());
1120 self
1121 }
1122
1123 /// Sets or clears the value of [create_time][crate::model::MigratingVm::create_time].
1124 ///
1125 /// # Example
1126 /// ```ignore,no_run
1127 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1128 /// use wkt::Timestamp;
1129 /// let x = MigratingVm::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1130 /// let x = MigratingVm::new().set_or_clear_create_time(None::<Timestamp>);
1131 /// ```
1132 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1133 where
1134 T: std::convert::Into<wkt::Timestamp>,
1135 {
1136 self.create_time = v.map(|x| x.into());
1137 self
1138 }
1139
1140 /// Sets the value of [update_time][crate::model::MigratingVm::update_time].
1141 ///
1142 /// # Example
1143 /// ```ignore,no_run
1144 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1145 /// use wkt::Timestamp;
1146 /// let x = MigratingVm::new().set_update_time(Timestamp::default()/* use setters */);
1147 /// ```
1148 pub fn set_update_time<T>(mut self, v: T) -> Self
1149 where
1150 T: std::convert::Into<wkt::Timestamp>,
1151 {
1152 self.update_time = std::option::Option::Some(v.into());
1153 self
1154 }
1155
1156 /// Sets or clears the value of [update_time][crate::model::MigratingVm::update_time].
1157 ///
1158 /// # Example
1159 /// ```ignore,no_run
1160 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1161 /// use wkt::Timestamp;
1162 /// let x = MigratingVm::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1163 /// let x = MigratingVm::new().set_or_clear_update_time(None::<Timestamp>);
1164 /// ```
1165 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1166 where
1167 T: std::convert::Into<wkt::Timestamp>,
1168 {
1169 self.update_time = v.map(|x| x.into());
1170 self
1171 }
1172
1173 /// Sets the value of [last_sync][crate::model::MigratingVm::last_sync].
1174 ///
1175 /// # Example
1176 /// ```ignore,no_run
1177 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1178 /// use google_cloud_vmmigration_v1::model::ReplicationSync;
1179 /// let x = MigratingVm::new().set_last_sync(ReplicationSync::default()/* use setters */);
1180 /// ```
1181 pub fn set_last_sync<T>(mut self, v: T) -> Self
1182 where
1183 T: std::convert::Into<crate::model::ReplicationSync>,
1184 {
1185 self.last_sync = std::option::Option::Some(v.into());
1186 self
1187 }
1188
1189 /// Sets or clears the value of [last_sync][crate::model::MigratingVm::last_sync].
1190 ///
1191 /// # Example
1192 /// ```ignore,no_run
1193 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1194 /// use google_cloud_vmmigration_v1::model::ReplicationSync;
1195 /// let x = MigratingVm::new().set_or_clear_last_sync(Some(ReplicationSync::default()/* use setters */));
1196 /// let x = MigratingVm::new().set_or_clear_last_sync(None::<ReplicationSync>);
1197 /// ```
1198 pub fn set_or_clear_last_sync<T>(mut self, v: std::option::Option<T>) -> Self
1199 where
1200 T: std::convert::Into<crate::model::ReplicationSync>,
1201 {
1202 self.last_sync = v.map(|x| x.into());
1203 self
1204 }
1205
1206 /// Sets the value of [state][crate::model::MigratingVm::state].
1207 ///
1208 /// # Example
1209 /// ```ignore,no_run
1210 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1211 /// use google_cloud_vmmigration_v1::model::migrating_vm::State;
1212 /// let x0 = MigratingVm::new().set_state(State::Pending);
1213 /// let x1 = MigratingVm::new().set_state(State::Ready);
1214 /// let x2 = MigratingVm::new().set_state(State::FirstSync);
1215 /// ```
1216 pub fn set_state<T: std::convert::Into<crate::model::migrating_vm::State>>(
1217 mut self,
1218 v: T,
1219 ) -> Self {
1220 self.state = v.into();
1221 self
1222 }
1223
1224 /// Sets the value of [state_time][crate::model::MigratingVm::state_time].
1225 ///
1226 /// # Example
1227 /// ```ignore,no_run
1228 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1229 /// use wkt::Timestamp;
1230 /// let x = MigratingVm::new().set_state_time(Timestamp::default()/* use setters */);
1231 /// ```
1232 pub fn set_state_time<T>(mut self, v: T) -> Self
1233 where
1234 T: std::convert::Into<wkt::Timestamp>,
1235 {
1236 self.state_time = std::option::Option::Some(v.into());
1237 self
1238 }
1239
1240 /// Sets or clears the value of [state_time][crate::model::MigratingVm::state_time].
1241 ///
1242 /// # Example
1243 /// ```ignore,no_run
1244 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1245 /// use wkt::Timestamp;
1246 /// let x = MigratingVm::new().set_or_clear_state_time(Some(Timestamp::default()/* use setters */));
1247 /// let x = MigratingVm::new().set_or_clear_state_time(None::<Timestamp>);
1248 /// ```
1249 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
1250 where
1251 T: std::convert::Into<wkt::Timestamp>,
1252 {
1253 self.state_time = v.map(|x| x.into());
1254 self
1255 }
1256
1257 /// Sets the value of [current_sync_info][crate::model::MigratingVm::current_sync_info].
1258 ///
1259 /// # Example
1260 /// ```ignore,no_run
1261 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1262 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
1263 /// let x = MigratingVm::new().set_current_sync_info(ReplicationCycle::default()/* use setters */);
1264 /// ```
1265 pub fn set_current_sync_info<T>(mut self, v: T) -> Self
1266 where
1267 T: std::convert::Into<crate::model::ReplicationCycle>,
1268 {
1269 self.current_sync_info = std::option::Option::Some(v.into());
1270 self
1271 }
1272
1273 /// Sets or clears the value of [current_sync_info][crate::model::MigratingVm::current_sync_info].
1274 ///
1275 /// # Example
1276 /// ```ignore,no_run
1277 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1278 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
1279 /// let x = MigratingVm::new().set_or_clear_current_sync_info(Some(ReplicationCycle::default()/* use setters */));
1280 /// let x = MigratingVm::new().set_or_clear_current_sync_info(None::<ReplicationCycle>);
1281 /// ```
1282 pub fn set_or_clear_current_sync_info<T>(mut self, v: std::option::Option<T>) -> Self
1283 where
1284 T: std::convert::Into<crate::model::ReplicationCycle>,
1285 {
1286 self.current_sync_info = v.map(|x| x.into());
1287 self
1288 }
1289
1290 /// Sets the value of [last_replication_cycle][crate::model::MigratingVm::last_replication_cycle].
1291 ///
1292 /// # Example
1293 /// ```ignore,no_run
1294 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1295 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
1296 /// let x = MigratingVm::new().set_last_replication_cycle(ReplicationCycle::default()/* use setters */);
1297 /// ```
1298 pub fn set_last_replication_cycle<T>(mut self, v: T) -> Self
1299 where
1300 T: std::convert::Into<crate::model::ReplicationCycle>,
1301 {
1302 self.last_replication_cycle = std::option::Option::Some(v.into());
1303 self
1304 }
1305
1306 /// Sets or clears the value of [last_replication_cycle][crate::model::MigratingVm::last_replication_cycle].
1307 ///
1308 /// # Example
1309 /// ```ignore,no_run
1310 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1311 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
1312 /// let x = MigratingVm::new().set_or_clear_last_replication_cycle(Some(ReplicationCycle::default()/* use setters */));
1313 /// let x = MigratingVm::new().set_or_clear_last_replication_cycle(None::<ReplicationCycle>);
1314 /// ```
1315 pub fn set_or_clear_last_replication_cycle<T>(mut self, v: std::option::Option<T>) -> Self
1316 where
1317 T: std::convert::Into<crate::model::ReplicationCycle>,
1318 {
1319 self.last_replication_cycle = v.map(|x| x.into());
1320 self
1321 }
1322
1323 /// Sets the value of [group][crate::model::MigratingVm::group].
1324 ///
1325 /// # Example
1326 /// ```ignore,no_run
1327 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1328 /// # let project_id = "project_id";
1329 /// # let location_id = "location_id";
1330 /// let x = MigratingVm::new().set_group(format!("projects/{project_id}/locations/{location_id}"));
1331 /// ```
1332 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1333 self.group = v.into();
1334 self
1335 }
1336
1337 /// Sets the value of [labels][crate::model::MigratingVm::labels].
1338 ///
1339 /// # Example
1340 /// ```ignore,no_run
1341 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1342 /// let x = MigratingVm::new().set_labels([
1343 /// ("key0", "abc"),
1344 /// ("key1", "xyz"),
1345 /// ]);
1346 /// ```
1347 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1348 where
1349 T: std::iter::IntoIterator<Item = (K, V)>,
1350 K: std::convert::Into<std::string::String>,
1351 V: std::convert::Into<std::string::String>,
1352 {
1353 use std::iter::Iterator;
1354 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1355 self
1356 }
1357
1358 /// Sets the value of [recent_clone_jobs][crate::model::MigratingVm::recent_clone_jobs].
1359 ///
1360 /// # Example
1361 /// ```ignore,no_run
1362 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1363 /// use google_cloud_vmmigration_v1::model::CloneJob;
1364 /// let x = MigratingVm::new()
1365 /// .set_recent_clone_jobs([
1366 /// CloneJob::default()/* use setters */,
1367 /// CloneJob::default()/* use (different) setters */,
1368 /// ]);
1369 /// ```
1370 pub fn set_recent_clone_jobs<T, V>(mut self, v: T) -> Self
1371 where
1372 T: std::iter::IntoIterator<Item = V>,
1373 V: std::convert::Into<crate::model::CloneJob>,
1374 {
1375 use std::iter::Iterator;
1376 self.recent_clone_jobs = v.into_iter().map(|i| i.into()).collect();
1377 self
1378 }
1379
1380 /// Sets the value of [error][crate::model::MigratingVm::error].
1381 ///
1382 /// # Example
1383 /// ```ignore,no_run
1384 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1385 /// use google_cloud_rpc::model::Status;
1386 /// let x = MigratingVm::new().set_error(Status::default()/* use setters */);
1387 /// ```
1388 pub fn set_error<T>(mut self, v: T) -> Self
1389 where
1390 T: std::convert::Into<google_cloud_rpc::model::Status>,
1391 {
1392 self.error = std::option::Option::Some(v.into());
1393 self
1394 }
1395
1396 /// Sets or clears the value of [error][crate::model::MigratingVm::error].
1397 ///
1398 /// # Example
1399 /// ```ignore,no_run
1400 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1401 /// use google_cloud_rpc::model::Status;
1402 /// let x = MigratingVm::new().set_or_clear_error(Some(Status::default()/* use setters */));
1403 /// let x = MigratingVm::new().set_or_clear_error(None::<Status>);
1404 /// ```
1405 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1406 where
1407 T: std::convert::Into<google_cloud_rpc::model::Status>,
1408 {
1409 self.error = v.map(|x| x.into());
1410 self
1411 }
1412
1413 /// Sets the value of [recent_cutover_jobs][crate::model::MigratingVm::recent_cutover_jobs].
1414 ///
1415 /// # Example
1416 /// ```ignore,no_run
1417 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1418 /// use google_cloud_vmmigration_v1::model::CutoverJob;
1419 /// let x = MigratingVm::new()
1420 /// .set_recent_cutover_jobs([
1421 /// CutoverJob::default()/* use setters */,
1422 /// CutoverJob::default()/* use (different) setters */,
1423 /// ]);
1424 /// ```
1425 pub fn set_recent_cutover_jobs<T, V>(mut self, v: T) -> Self
1426 where
1427 T: std::iter::IntoIterator<Item = V>,
1428 V: std::convert::Into<crate::model::CutoverJob>,
1429 {
1430 use std::iter::Iterator;
1431 self.recent_cutover_jobs = v.into_iter().map(|i| i.into()).collect();
1432 self
1433 }
1434
1435 /// Sets the value of [cutover_forecast][crate::model::MigratingVm::cutover_forecast].
1436 ///
1437 /// # Example
1438 /// ```ignore,no_run
1439 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1440 /// use google_cloud_vmmigration_v1::model::CutoverForecast;
1441 /// let x = MigratingVm::new().set_cutover_forecast(CutoverForecast::default()/* use setters */);
1442 /// ```
1443 pub fn set_cutover_forecast<T>(mut self, v: T) -> Self
1444 where
1445 T: std::convert::Into<crate::model::CutoverForecast>,
1446 {
1447 self.cutover_forecast = std::option::Option::Some(v.into());
1448 self
1449 }
1450
1451 /// Sets or clears the value of [cutover_forecast][crate::model::MigratingVm::cutover_forecast].
1452 ///
1453 /// # Example
1454 /// ```ignore,no_run
1455 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1456 /// use google_cloud_vmmigration_v1::model::CutoverForecast;
1457 /// let x = MigratingVm::new().set_or_clear_cutover_forecast(Some(CutoverForecast::default()/* use setters */));
1458 /// let x = MigratingVm::new().set_or_clear_cutover_forecast(None::<CutoverForecast>);
1459 /// ```
1460 pub fn set_or_clear_cutover_forecast<T>(mut self, v: std::option::Option<T>) -> Self
1461 where
1462 T: std::convert::Into<crate::model::CutoverForecast>,
1463 {
1464 self.cutover_forecast = v.map(|x| x.into());
1465 self
1466 }
1467
1468 /// Sets the value of [expiration][crate::model::MigratingVm::expiration].
1469 ///
1470 /// # Example
1471 /// ```ignore,no_run
1472 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1473 /// use google_cloud_vmmigration_v1::model::migrating_vm::Expiration;
1474 /// let x = MigratingVm::new().set_expiration(Expiration::default()/* use setters */);
1475 /// ```
1476 pub fn set_expiration<T>(mut self, v: T) -> Self
1477 where
1478 T: std::convert::Into<crate::model::migrating_vm::Expiration>,
1479 {
1480 self.expiration = std::option::Option::Some(v.into());
1481 self
1482 }
1483
1484 /// Sets or clears the value of [expiration][crate::model::MigratingVm::expiration].
1485 ///
1486 /// # Example
1487 /// ```ignore,no_run
1488 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1489 /// use google_cloud_vmmigration_v1::model::migrating_vm::Expiration;
1490 /// let x = MigratingVm::new().set_or_clear_expiration(Some(Expiration::default()/* use setters */));
1491 /// let x = MigratingVm::new().set_or_clear_expiration(None::<Expiration>);
1492 /// ```
1493 pub fn set_or_clear_expiration<T>(mut self, v: std::option::Option<T>) -> Self
1494 where
1495 T: std::convert::Into<crate::model::migrating_vm::Expiration>,
1496 {
1497 self.expiration = v.map(|x| x.into());
1498 self
1499 }
1500
1501 /// Sets the value of [target_vm_defaults][crate::model::MigratingVm::target_vm_defaults].
1502 ///
1503 /// Note that all the setters affecting `target_vm_defaults` are mutually
1504 /// exclusive.
1505 ///
1506 /// # Example
1507 /// ```ignore,no_run
1508 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1509 /// use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
1510 /// let x = MigratingVm::new().set_target_vm_defaults(Some(
1511 /// google_cloud_vmmigration_v1::model::migrating_vm::TargetVmDefaults::ComputeEngineTargetDefaults(ComputeEngineTargetDefaults::default().into())));
1512 /// ```
1513 pub fn set_target_vm_defaults<
1514 T: std::convert::Into<std::option::Option<crate::model::migrating_vm::TargetVmDefaults>>,
1515 >(
1516 mut self,
1517 v: T,
1518 ) -> Self {
1519 self.target_vm_defaults = v.into();
1520 self
1521 }
1522
1523 /// The value of [target_vm_defaults][crate::model::MigratingVm::target_vm_defaults]
1524 /// if it holds a `ComputeEngineTargetDefaults`, `None` if the field is not set or
1525 /// holds a different branch.
1526 pub fn compute_engine_target_defaults(
1527 &self,
1528 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineTargetDefaults>> {
1529 #[allow(unreachable_patterns)]
1530 self.target_vm_defaults.as_ref().and_then(|v| match v {
1531 crate::model::migrating_vm::TargetVmDefaults::ComputeEngineTargetDefaults(v) => {
1532 std::option::Option::Some(v)
1533 }
1534 _ => std::option::Option::None,
1535 })
1536 }
1537
1538 /// Sets the value of [target_vm_defaults][crate::model::MigratingVm::target_vm_defaults]
1539 /// to hold a `ComputeEngineTargetDefaults`.
1540 ///
1541 /// Note that all the setters affecting `target_vm_defaults` are
1542 /// mutually exclusive.
1543 ///
1544 /// # Example
1545 /// ```ignore,no_run
1546 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1547 /// use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
1548 /// let x = MigratingVm::new().set_compute_engine_target_defaults(ComputeEngineTargetDefaults::default()/* use setters */);
1549 /// assert!(x.compute_engine_target_defaults().is_some());
1550 /// assert!(x.compute_engine_disks_target_defaults().is_none());
1551 /// ```
1552 pub fn set_compute_engine_target_defaults<
1553 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineTargetDefaults>>,
1554 >(
1555 mut self,
1556 v: T,
1557 ) -> Self {
1558 self.target_vm_defaults = std::option::Option::Some(
1559 crate::model::migrating_vm::TargetVmDefaults::ComputeEngineTargetDefaults(v.into()),
1560 );
1561 self
1562 }
1563
1564 /// The value of [target_vm_defaults][crate::model::MigratingVm::target_vm_defaults]
1565 /// if it holds a `ComputeEngineDisksTargetDefaults`, `None` if the field is not set or
1566 /// holds a different branch.
1567 pub fn compute_engine_disks_target_defaults(
1568 &self,
1569 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisksTargetDefaults>> {
1570 #[allow(unreachable_patterns)]
1571 self.target_vm_defaults.as_ref().and_then(|v| match v {
1572 crate::model::migrating_vm::TargetVmDefaults::ComputeEngineDisksTargetDefaults(v) => {
1573 std::option::Option::Some(v)
1574 }
1575 _ => std::option::Option::None,
1576 })
1577 }
1578
1579 /// Sets the value of [target_vm_defaults][crate::model::MigratingVm::target_vm_defaults]
1580 /// to hold a `ComputeEngineDisksTargetDefaults`.
1581 ///
1582 /// Note that all the setters affecting `target_vm_defaults` are
1583 /// mutually exclusive.
1584 ///
1585 /// # Example
1586 /// ```ignore,no_run
1587 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1588 /// use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
1589 /// let x = MigratingVm::new().set_compute_engine_disks_target_defaults(ComputeEngineDisksTargetDefaults::default()/* use setters */);
1590 /// assert!(x.compute_engine_disks_target_defaults().is_some());
1591 /// assert!(x.compute_engine_target_defaults().is_none());
1592 /// ```
1593 pub fn set_compute_engine_disks_target_defaults<
1594 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisksTargetDefaults>>,
1595 >(
1596 mut self,
1597 v: T,
1598 ) -> Self {
1599 self.target_vm_defaults = std::option::Option::Some(
1600 crate::model::migrating_vm::TargetVmDefaults::ComputeEngineDisksTargetDefaults(
1601 v.into(),
1602 ),
1603 );
1604 self
1605 }
1606
1607 /// Sets the value of [source_vm_details][crate::model::MigratingVm::source_vm_details].
1608 ///
1609 /// Note that all the setters affecting `source_vm_details` are mutually
1610 /// exclusive.
1611 ///
1612 /// # Example
1613 /// ```ignore,no_run
1614 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1615 /// use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
1616 /// let x = MigratingVm::new().set_source_vm_details(Some(
1617 /// google_cloud_vmmigration_v1::model::migrating_vm::SourceVmDetails::VmwareSourceVmDetails(VmwareSourceVmDetails::default().into())));
1618 /// ```
1619 pub fn set_source_vm_details<
1620 T: std::convert::Into<std::option::Option<crate::model::migrating_vm::SourceVmDetails>>,
1621 >(
1622 mut self,
1623 v: T,
1624 ) -> Self {
1625 self.source_vm_details = v.into();
1626 self
1627 }
1628
1629 /// The value of [source_vm_details][crate::model::MigratingVm::source_vm_details]
1630 /// if it holds a `VmwareSourceVmDetails`, `None` if the field is not set or
1631 /// holds a different branch.
1632 pub fn vmware_source_vm_details(
1633 &self,
1634 ) -> std::option::Option<&std::boxed::Box<crate::model::VmwareSourceVmDetails>> {
1635 #[allow(unreachable_patterns)]
1636 self.source_vm_details.as_ref().and_then(|v| match v {
1637 crate::model::migrating_vm::SourceVmDetails::VmwareSourceVmDetails(v) => {
1638 std::option::Option::Some(v)
1639 }
1640 _ => std::option::Option::None,
1641 })
1642 }
1643
1644 /// Sets the value of [source_vm_details][crate::model::MigratingVm::source_vm_details]
1645 /// to hold a `VmwareSourceVmDetails`.
1646 ///
1647 /// Note that all the setters affecting `source_vm_details` are
1648 /// mutually exclusive.
1649 ///
1650 /// # Example
1651 /// ```ignore,no_run
1652 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1653 /// use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
1654 /// let x = MigratingVm::new().set_vmware_source_vm_details(VmwareSourceVmDetails::default()/* use setters */);
1655 /// assert!(x.vmware_source_vm_details().is_some());
1656 /// assert!(x.aws_source_vm_details().is_none());
1657 /// assert!(x.azure_source_vm_details().is_none());
1658 /// ```
1659 pub fn set_vmware_source_vm_details<
1660 T: std::convert::Into<std::boxed::Box<crate::model::VmwareSourceVmDetails>>,
1661 >(
1662 mut self,
1663 v: T,
1664 ) -> Self {
1665 self.source_vm_details = std::option::Option::Some(
1666 crate::model::migrating_vm::SourceVmDetails::VmwareSourceVmDetails(v.into()),
1667 );
1668 self
1669 }
1670
1671 /// The value of [source_vm_details][crate::model::MigratingVm::source_vm_details]
1672 /// if it holds a `AwsSourceVmDetails`, `None` if the field is not set or
1673 /// holds a different branch.
1674 pub fn aws_source_vm_details(
1675 &self,
1676 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceVmDetails>> {
1677 #[allow(unreachable_patterns)]
1678 self.source_vm_details.as_ref().and_then(|v| match v {
1679 crate::model::migrating_vm::SourceVmDetails::AwsSourceVmDetails(v) => {
1680 std::option::Option::Some(v)
1681 }
1682 _ => std::option::Option::None,
1683 })
1684 }
1685
1686 /// Sets the value of [source_vm_details][crate::model::MigratingVm::source_vm_details]
1687 /// to hold a `AwsSourceVmDetails`.
1688 ///
1689 /// Note that all the setters affecting `source_vm_details` are
1690 /// mutually exclusive.
1691 ///
1692 /// # Example
1693 /// ```ignore,no_run
1694 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1695 /// use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
1696 /// let x = MigratingVm::new().set_aws_source_vm_details(AwsSourceVmDetails::default()/* use setters */);
1697 /// assert!(x.aws_source_vm_details().is_some());
1698 /// assert!(x.vmware_source_vm_details().is_none());
1699 /// assert!(x.azure_source_vm_details().is_none());
1700 /// ```
1701 pub fn set_aws_source_vm_details<
1702 T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceVmDetails>>,
1703 >(
1704 mut self,
1705 v: T,
1706 ) -> Self {
1707 self.source_vm_details = std::option::Option::Some(
1708 crate::model::migrating_vm::SourceVmDetails::AwsSourceVmDetails(v.into()),
1709 );
1710 self
1711 }
1712
1713 /// The value of [source_vm_details][crate::model::MigratingVm::source_vm_details]
1714 /// if it holds a `AzureSourceVmDetails`, `None` if the field is not set or
1715 /// holds a different branch.
1716 pub fn azure_source_vm_details(
1717 &self,
1718 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureSourceVmDetails>> {
1719 #[allow(unreachable_patterns)]
1720 self.source_vm_details.as_ref().and_then(|v| match v {
1721 crate::model::migrating_vm::SourceVmDetails::AzureSourceVmDetails(v) => {
1722 std::option::Option::Some(v)
1723 }
1724 _ => std::option::Option::None,
1725 })
1726 }
1727
1728 /// Sets the value of [source_vm_details][crate::model::MigratingVm::source_vm_details]
1729 /// to hold a `AzureSourceVmDetails`.
1730 ///
1731 /// Note that all the setters affecting `source_vm_details` are
1732 /// mutually exclusive.
1733 ///
1734 /// # Example
1735 /// ```ignore,no_run
1736 /// # use google_cloud_vmmigration_v1::model::MigratingVm;
1737 /// use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
1738 /// let x = MigratingVm::new().set_azure_source_vm_details(AzureSourceVmDetails::default()/* use setters */);
1739 /// assert!(x.azure_source_vm_details().is_some());
1740 /// assert!(x.vmware_source_vm_details().is_none());
1741 /// assert!(x.aws_source_vm_details().is_none());
1742 /// ```
1743 pub fn set_azure_source_vm_details<
1744 T: std::convert::Into<std::boxed::Box<crate::model::AzureSourceVmDetails>>,
1745 >(
1746 mut self,
1747 v: T,
1748 ) -> Self {
1749 self.source_vm_details = std::option::Option::Some(
1750 crate::model::migrating_vm::SourceVmDetails::AzureSourceVmDetails(v.into()),
1751 );
1752 self
1753 }
1754}
1755
1756impl wkt::message::Message for MigratingVm {
1757 fn typename() -> &'static str {
1758 "type.googleapis.com/google.cloud.vmmigration.v1.MigratingVm"
1759 }
1760}
1761
1762/// Defines additional types related to [MigratingVm].
1763pub mod migrating_vm {
1764 #[allow(unused_imports)]
1765 use super::*;
1766
1767 /// Expiration holds information about the expiration of a MigratingVm.
1768 #[derive(Clone, Default, PartialEq)]
1769 #[non_exhaustive]
1770 pub struct Expiration {
1771 /// Output only. Timestamp of when this resource is considered expired.
1772 pub expire_time: std::option::Option<wkt::Timestamp>,
1773
1774 /// Output only. The number of times expiration was extended.
1775 pub extension_count: i32,
1776
1777 /// Output only. Describes whether the expiration can be extended.
1778 pub extendable: bool,
1779
1780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1781 }
1782
1783 impl Expiration {
1784 /// Creates a new default instance.
1785 pub fn new() -> Self {
1786 std::default::Default::default()
1787 }
1788
1789 /// Sets the value of [expire_time][crate::model::migrating_vm::Expiration::expire_time].
1790 ///
1791 /// # Example
1792 /// ```ignore,no_run
1793 /// # use google_cloud_vmmigration_v1::model::migrating_vm::Expiration;
1794 /// use wkt::Timestamp;
1795 /// let x = Expiration::new().set_expire_time(Timestamp::default()/* use setters */);
1796 /// ```
1797 pub fn set_expire_time<T>(mut self, v: T) -> Self
1798 where
1799 T: std::convert::Into<wkt::Timestamp>,
1800 {
1801 self.expire_time = std::option::Option::Some(v.into());
1802 self
1803 }
1804
1805 /// Sets or clears the value of [expire_time][crate::model::migrating_vm::Expiration::expire_time].
1806 ///
1807 /// # Example
1808 /// ```ignore,no_run
1809 /// # use google_cloud_vmmigration_v1::model::migrating_vm::Expiration;
1810 /// use wkt::Timestamp;
1811 /// let x = Expiration::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
1812 /// let x = Expiration::new().set_or_clear_expire_time(None::<Timestamp>);
1813 /// ```
1814 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
1815 where
1816 T: std::convert::Into<wkt::Timestamp>,
1817 {
1818 self.expire_time = v.map(|x| x.into());
1819 self
1820 }
1821
1822 /// Sets the value of [extension_count][crate::model::migrating_vm::Expiration::extension_count].
1823 ///
1824 /// # Example
1825 /// ```ignore,no_run
1826 /// # use google_cloud_vmmigration_v1::model::migrating_vm::Expiration;
1827 /// let x = Expiration::new().set_extension_count(42);
1828 /// ```
1829 pub fn set_extension_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1830 self.extension_count = v.into();
1831 self
1832 }
1833
1834 /// Sets the value of [extendable][crate::model::migrating_vm::Expiration::extendable].
1835 ///
1836 /// # Example
1837 /// ```ignore,no_run
1838 /// # use google_cloud_vmmigration_v1::model::migrating_vm::Expiration;
1839 /// let x = Expiration::new().set_extendable(true);
1840 /// ```
1841 pub fn set_extendable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1842 self.extendable = v.into();
1843 self
1844 }
1845 }
1846
1847 impl wkt::message::Message for Expiration {
1848 fn typename() -> &'static str {
1849 "type.googleapis.com/google.cloud.vmmigration.v1.MigratingVm.Expiration"
1850 }
1851 }
1852
1853 /// The possible values of the state/health of source VM.
1854 ///
1855 /// # Working with unknown values
1856 ///
1857 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1858 /// additional enum variants at any time. Adding new variants is not considered
1859 /// a breaking change. Applications should write their code in anticipation of:
1860 ///
1861 /// - New values appearing in future releases of the client library, **and**
1862 /// - New values received dynamically, without application changes.
1863 ///
1864 /// Please consult the [Working with enums] section in the user guide for some
1865 /// guidelines.
1866 ///
1867 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1868 #[derive(Clone, Debug, PartialEq)]
1869 #[non_exhaustive]
1870 pub enum State {
1871 /// The state was not sampled by the health checks yet.
1872 Unspecified,
1873 /// The VM in the source is being verified.
1874 Pending,
1875 /// The source VM was verified, and it's ready to start replication.
1876 Ready,
1877 /// Migration is going through the first sync cycle.
1878 FirstSync,
1879 /// The replication is active, and it's running or scheduled to run.
1880 Active,
1881 /// The source VM is being turned off, and a final replication is currently
1882 /// running.
1883 CuttingOver,
1884 /// The source VM was stopped and replicated. The replication is currently
1885 /// paused.
1886 Cutover,
1887 /// A cutover job is active and replication cycle is running the final sync.
1888 FinalSync,
1889 /// The replication was paused by the user and no cycles are scheduled to
1890 /// run.
1891 Paused,
1892 /// The migrating VM is being finalized and migration resources are being
1893 /// removed.
1894 Finalizing,
1895 /// The replication process is done. The migrating VM is finalized and no
1896 /// longer consumes billable resources.
1897 Finalized,
1898 /// The replication process encountered an unrecoverable error and was
1899 /// aborted.
1900 Error,
1901 /// The migrating VM has passed its expiration date. It might be possible to
1902 /// bring it back to "Active" state by updating the TTL field. For more
1903 /// information, see the documentation.
1904 Expired,
1905 /// The migrating VM's has been finalized and migration resources have been
1906 /// removed.
1907 FinalizedExpired,
1908 /// If set, the enum was initialized with an unknown value.
1909 ///
1910 /// Applications can examine the value using [State::value] or
1911 /// [State::name].
1912 UnknownValue(state::UnknownValue),
1913 }
1914
1915 #[doc(hidden)]
1916 pub mod state {
1917 #[allow(unused_imports)]
1918 use super::*;
1919 #[derive(Clone, Debug, PartialEq)]
1920 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1921 }
1922
1923 impl State {
1924 /// Gets the enum value.
1925 ///
1926 /// Returns `None` if the enum contains an unknown value deserialized from
1927 /// the string representation of enums.
1928 pub fn value(&self) -> std::option::Option<i32> {
1929 match self {
1930 Self::Unspecified => std::option::Option::Some(0),
1931 Self::Pending => std::option::Option::Some(1),
1932 Self::Ready => std::option::Option::Some(2),
1933 Self::FirstSync => std::option::Option::Some(3),
1934 Self::Active => std::option::Option::Some(4),
1935 Self::CuttingOver => std::option::Option::Some(7),
1936 Self::Cutover => std::option::Option::Some(8),
1937 Self::FinalSync => std::option::Option::Some(9),
1938 Self::Paused => std::option::Option::Some(10),
1939 Self::Finalizing => std::option::Option::Some(11),
1940 Self::Finalized => std::option::Option::Some(12),
1941 Self::Error => std::option::Option::Some(13),
1942 Self::Expired => std::option::Option::Some(14),
1943 Self::FinalizedExpired => std::option::Option::Some(17),
1944 Self::UnknownValue(u) => u.0.value(),
1945 }
1946 }
1947
1948 /// Gets the enum value as a string.
1949 ///
1950 /// Returns `None` if the enum contains an unknown value deserialized from
1951 /// the integer representation of enums.
1952 pub fn name(&self) -> std::option::Option<&str> {
1953 match self {
1954 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1955 Self::Pending => std::option::Option::Some("PENDING"),
1956 Self::Ready => std::option::Option::Some("READY"),
1957 Self::FirstSync => std::option::Option::Some("FIRST_SYNC"),
1958 Self::Active => std::option::Option::Some("ACTIVE"),
1959 Self::CuttingOver => std::option::Option::Some("CUTTING_OVER"),
1960 Self::Cutover => std::option::Option::Some("CUTOVER"),
1961 Self::FinalSync => std::option::Option::Some("FINAL_SYNC"),
1962 Self::Paused => std::option::Option::Some("PAUSED"),
1963 Self::Finalizing => std::option::Option::Some("FINALIZING"),
1964 Self::Finalized => std::option::Option::Some("FINALIZED"),
1965 Self::Error => std::option::Option::Some("ERROR"),
1966 Self::Expired => std::option::Option::Some("EXPIRED"),
1967 Self::FinalizedExpired => std::option::Option::Some("FINALIZED_EXPIRED"),
1968 Self::UnknownValue(u) => u.0.name(),
1969 }
1970 }
1971 }
1972
1973 impl std::default::Default for State {
1974 fn default() -> Self {
1975 use std::convert::From;
1976 Self::from(0)
1977 }
1978 }
1979
1980 impl std::fmt::Display for State {
1981 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1982 wkt::internal::display_enum(f, self.name(), self.value())
1983 }
1984 }
1985
1986 impl std::convert::From<i32> for State {
1987 fn from(value: i32) -> Self {
1988 match value {
1989 0 => Self::Unspecified,
1990 1 => Self::Pending,
1991 2 => Self::Ready,
1992 3 => Self::FirstSync,
1993 4 => Self::Active,
1994 7 => Self::CuttingOver,
1995 8 => Self::Cutover,
1996 9 => Self::FinalSync,
1997 10 => Self::Paused,
1998 11 => Self::Finalizing,
1999 12 => Self::Finalized,
2000 13 => Self::Error,
2001 14 => Self::Expired,
2002 17 => Self::FinalizedExpired,
2003 _ => Self::UnknownValue(state::UnknownValue(
2004 wkt::internal::UnknownEnumValue::Integer(value),
2005 )),
2006 }
2007 }
2008 }
2009
2010 impl std::convert::From<&str> for State {
2011 fn from(value: &str) -> Self {
2012 use std::string::ToString;
2013 match value {
2014 "STATE_UNSPECIFIED" => Self::Unspecified,
2015 "PENDING" => Self::Pending,
2016 "READY" => Self::Ready,
2017 "FIRST_SYNC" => Self::FirstSync,
2018 "ACTIVE" => Self::Active,
2019 "CUTTING_OVER" => Self::CuttingOver,
2020 "CUTOVER" => Self::Cutover,
2021 "FINAL_SYNC" => Self::FinalSync,
2022 "PAUSED" => Self::Paused,
2023 "FINALIZING" => Self::Finalizing,
2024 "FINALIZED" => Self::Finalized,
2025 "ERROR" => Self::Error,
2026 "EXPIRED" => Self::Expired,
2027 "FINALIZED_EXPIRED" => Self::FinalizedExpired,
2028 _ => Self::UnknownValue(state::UnknownValue(
2029 wkt::internal::UnknownEnumValue::String(value.to_string()),
2030 )),
2031 }
2032 }
2033 }
2034
2035 impl serde::ser::Serialize for State {
2036 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2037 where
2038 S: serde::Serializer,
2039 {
2040 match self {
2041 Self::Unspecified => serializer.serialize_i32(0),
2042 Self::Pending => serializer.serialize_i32(1),
2043 Self::Ready => serializer.serialize_i32(2),
2044 Self::FirstSync => serializer.serialize_i32(3),
2045 Self::Active => serializer.serialize_i32(4),
2046 Self::CuttingOver => serializer.serialize_i32(7),
2047 Self::Cutover => serializer.serialize_i32(8),
2048 Self::FinalSync => serializer.serialize_i32(9),
2049 Self::Paused => serializer.serialize_i32(10),
2050 Self::Finalizing => serializer.serialize_i32(11),
2051 Self::Finalized => serializer.serialize_i32(12),
2052 Self::Error => serializer.serialize_i32(13),
2053 Self::Expired => serializer.serialize_i32(14),
2054 Self::FinalizedExpired => serializer.serialize_i32(17),
2055 Self::UnknownValue(u) => u.0.serialize(serializer),
2056 }
2057 }
2058 }
2059
2060 impl<'de> serde::de::Deserialize<'de> for State {
2061 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2062 where
2063 D: serde::Deserializer<'de>,
2064 {
2065 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2066 ".google.cloud.vmmigration.v1.MigratingVm.State",
2067 ))
2068 }
2069 }
2070
2071 /// The default configuration of the target VM that will be created in Google
2072 /// Cloud as a result of the migration.
2073 #[derive(Clone, Debug, PartialEq)]
2074 #[non_exhaustive]
2075 pub enum TargetVmDefaults {
2076 /// Details of the target VM in Compute Engine.
2077 ComputeEngineTargetDefaults(std::boxed::Box<crate::model::ComputeEngineTargetDefaults>),
2078 /// Details of the target Persistent Disks in Compute Engine.
2079 ComputeEngineDisksTargetDefaults(
2080 std::boxed::Box<crate::model::ComputeEngineDisksTargetDefaults>,
2081 ),
2082 }
2083
2084 /// Details about the source VM.
2085 #[derive(Clone, Debug, PartialEq)]
2086 #[non_exhaustive]
2087 pub enum SourceVmDetails {
2088 /// Output only. Details of the VM from a Vmware source.
2089 VmwareSourceVmDetails(std::boxed::Box<crate::model::VmwareSourceVmDetails>),
2090 /// Output only. Details of the VM from an AWS source.
2091 AwsSourceVmDetails(std::boxed::Box<crate::model::AwsSourceVmDetails>),
2092 /// Output only. Details of the VM from an Azure source.
2093 AzureSourceVmDetails(std::boxed::Box<crate::model::AzureSourceVmDetails>),
2094 }
2095}
2096
2097/// CutoverForecast holds information about future CutoverJobs of a MigratingVm.
2098#[derive(Clone, Default, PartialEq)]
2099#[non_exhaustive]
2100pub struct CutoverForecast {
2101 /// Output only. Estimation of the CutoverJob duration.
2102 pub estimated_cutover_job_duration: std::option::Option<wkt::Duration>,
2103
2104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2105}
2106
2107impl CutoverForecast {
2108 /// Creates a new default instance.
2109 pub fn new() -> Self {
2110 std::default::Default::default()
2111 }
2112
2113 /// Sets the value of [estimated_cutover_job_duration][crate::model::CutoverForecast::estimated_cutover_job_duration].
2114 ///
2115 /// # Example
2116 /// ```ignore,no_run
2117 /// # use google_cloud_vmmigration_v1::model::CutoverForecast;
2118 /// use wkt::Duration;
2119 /// let x = CutoverForecast::new().set_estimated_cutover_job_duration(Duration::default()/* use setters */);
2120 /// ```
2121 pub fn set_estimated_cutover_job_duration<T>(mut self, v: T) -> Self
2122 where
2123 T: std::convert::Into<wkt::Duration>,
2124 {
2125 self.estimated_cutover_job_duration = std::option::Option::Some(v.into());
2126 self
2127 }
2128
2129 /// Sets or clears the value of [estimated_cutover_job_duration][crate::model::CutoverForecast::estimated_cutover_job_duration].
2130 ///
2131 /// # Example
2132 /// ```ignore,no_run
2133 /// # use google_cloud_vmmigration_v1::model::CutoverForecast;
2134 /// use wkt::Duration;
2135 /// let x = CutoverForecast::new().set_or_clear_estimated_cutover_job_duration(Some(Duration::default()/* use setters */));
2136 /// let x = CutoverForecast::new().set_or_clear_estimated_cutover_job_duration(None::<Duration>);
2137 /// ```
2138 pub fn set_or_clear_estimated_cutover_job_duration<T>(
2139 mut self,
2140 v: std::option::Option<T>,
2141 ) -> Self
2142 where
2143 T: std::convert::Into<wkt::Duration>,
2144 {
2145 self.estimated_cutover_job_duration = v.map(|x| x.into());
2146 self
2147 }
2148}
2149
2150impl wkt::message::Message for CutoverForecast {
2151 fn typename() -> &'static str {
2152 "type.googleapis.com/google.cloud.vmmigration.v1.CutoverForecast"
2153 }
2154}
2155
2156/// CloneJob describes the process of creating a clone of a
2157/// [MigratingVM][google.cloud.vmmigration.v1.MigratingVm] to the
2158/// requested target based on the latest successful uploaded snapshots.
2159/// While the migration cycles of a MigratingVm take place, it is possible to
2160/// verify the uploaded VM can be started in the cloud, by creating a clone. The
2161/// clone can be created without any downtime, and it is created using the latest
2162/// snapshots which are already in the cloud. The cloneJob is only responsible
2163/// for its work, not its products, which means once it is finished, it will
2164/// never touch the instance it created. It will only delete it in case of the
2165/// CloneJob being cancelled or upon failure to clone.
2166///
2167/// [google.cloud.vmmigration.v1.MigratingVm]: crate::model::MigratingVm
2168#[derive(Clone, Default, PartialEq)]
2169#[non_exhaustive]
2170pub struct CloneJob {
2171 /// Output only. The time the clone job was created (as an API call, not when
2172 /// it was actually created in the target).
2173 pub create_time: std::option::Option<wkt::Timestamp>,
2174
2175 /// Output only. The time the clone job was ended.
2176 pub end_time: std::option::Option<wkt::Timestamp>,
2177
2178 /// Output only. The name of the clone.
2179 pub name: std::string::String,
2180
2181 /// Output only. State of the clone job.
2182 pub state: crate::model::clone_job::State,
2183
2184 /// Output only. The time the state was last updated.
2185 pub state_time: std::option::Option<wkt::Timestamp>,
2186
2187 /// Output only. Provides details for the errors that led to the Clone Job's
2188 /// state.
2189 pub error: std::option::Option<google_cloud_rpc::model::Status>,
2190
2191 /// Output only. The clone steps list representing its progress.
2192 pub steps: std::vec::Vec<crate::model::CloneStep>,
2193
2194 /// Details of the VM to create as the target of this clone job.
2195 pub target_vm_details: std::option::Option<crate::model::clone_job::TargetVmDetails>,
2196
2197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2198}
2199
2200impl CloneJob {
2201 /// Creates a new default instance.
2202 pub fn new() -> Self {
2203 std::default::Default::default()
2204 }
2205
2206 /// Sets the value of [create_time][crate::model::CloneJob::create_time].
2207 ///
2208 /// # Example
2209 /// ```ignore,no_run
2210 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2211 /// use wkt::Timestamp;
2212 /// let x = CloneJob::new().set_create_time(Timestamp::default()/* use setters */);
2213 /// ```
2214 pub fn set_create_time<T>(mut self, v: T) -> Self
2215 where
2216 T: std::convert::Into<wkt::Timestamp>,
2217 {
2218 self.create_time = std::option::Option::Some(v.into());
2219 self
2220 }
2221
2222 /// Sets or clears the value of [create_time][crate::model::CloneJob::create_time].
2223 ///
2224 /// # Example
2225 /// ```ignore,no_run
2226 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2227 /// use wkt::Timestamp;
2228 /// let x = CloneJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2229 /// let x = CloneJob::new().set_or_clear_create_time(None::<Timestamp>);
2230 /// ```
2231 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2232 where
2233 T: std::convert::Into<wkt::Timestamp>,
2234 {
2235 self.create_time = v.map(|x| x.into());
2236 self
2237 }
2238
2239 /// Sets the value of [end_time][crate::model::CloneJob::end_time].
2240 ///
2241 /// # Example
2242 /// ```ignore,no_run
2243 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2244 /// use wkt::Timestamp;
2245 /// let x = CloneJob::new().set_end_time(Timestamp::default()/* use setters */);
2246 /// ```
2247 pub fn set_end_time<T>(mut self, v: T) -> Self
2248 where
2249 T: std::convert::Into<wkt::Timestamp>,
2250 {
2251 self.end_time = std::option::Option::Some(v.into());
2252 self
2253 }
2254
2255 /// Sets or clears the value of [end_time][crate::model::CloneJob::end_time].
2256 ///
2257 /// # Example
2258 /// ```ignore,no_run
2259 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2260 /// use wkt::Timestamp;
2261 /// let x = CloneJob::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2262 /// let x = CloneJob::new().set_or_clear_end_time(None::<Timestamp>);
2263 /// ```
2264 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2265 where
2266 T: std::convert::Into<wkt::Timestamp>,
2267 {
2268 self.end_time = v.map(|x| x.into());
2269 self
2270 }
2271
2272 /// Sets the value of [name][crate::model::CloneJob::name].
2273 ///
2274 /// # Example
2275 /// ```ignore,no_run
2276 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2277 /// # let project_id = "project_id";
2278 /// # let location_id = "location_id";
2279 /// # let source_id = "source_id";
2280 /// # let migrating_vm_id = "migrating_vm_id";
2281 /// # let clone_job_id = "clone_job_id";
2282 /// let x = CloneJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/cloneJobs/{clone_job_id}"));
2283 /// ```
2284 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2285 self.name = v.into();
2286 self
2287 }
2288
2289 /// Sets the value of [state][crate::model::CloneJob::state].
2290 ///
2291 /// # Example
2292 /// ```ignore,no_run
2293 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2294 /// use google_cloud_vmmigration_v1::model::clone_job::State;
2295 /// let x0 = CloneJob::new().set_state(State::Pending);
2296 /// let x1 = CloneJob::new().set_state(State::Active);
2297 /// let x2 = CloneJob::new().set_state(State::Failed);
2298 /// ```
2299 pub fn set_state<T: std::convert::Into<crate::model::clone_job::State>>(
2300 mut self,
2301 v: T,
2302 ) -> Self {
2303 self.state = v.into();
2304 self
2305 }
2306
2307 /// Sets the value of [state_time][crate::model::CloneJob::state_time].
2308 ///
2309 /// # Example
2310 /// ```ignore,no_run
2311 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2312 /// use wkt::Timestamp;
2313 /// let x = CloneJob::new().set_state_time(Timestamp::default()/* use setters */);
2314 /// ```
2315 pub fn set_state_time<T>(mut self, v: T) -> Self
2316 where
2317 T: std::convert::Into<wkt::Timestamp>,
2318 {
2319 self.state_time = std::option::Option::Some(v.into());
2320 self
2321 }
2322
2323 /// Sets or clears the value of [state_time][crate::model::CloneJob::state_time].
2324 ///
2325 /// # Example
2326 /// ```ignore,no_run
2327 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2328 /// use wkt::Timestamp;
2329 /// let x = CloneJob::new().set_or_clear_state_time(Some(Timestamp::default()/* use setters */));
2330 /// let x = CloneJob::new().set_or_clear_state_time(None::<Timestamp>);
2331 /// ```
2332 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
2333 where
2334 T: std::convert::Into<wkt::Timestamp>,
2335 {
2336 self.state_time = v.map(|x| x.into());
2337 self
2338 }
2339
2340 /// Sets the value of [error][crate::model::CloneJob::error].
2341 ///
2342 /// # Example
2343 /// ```ignore,no_run
2344 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2345 /// use google_cloud_rpc::model::Status;
2346 /// let x = CloneJob::new().set_error(Status::default()/* use setters */);
2347 /// ```
2348 pub fn set_error<T>(mut self, v: T) -> Self
2349 where
2350 T: std::convert::Into<google_cloud_rpc::model::Status>,
2351 {
2352 self.error = std::option::Option::Some(v.into());
2353 self
2354 }
2355
2356 /// Sets or clears the value of [error][crate::model::CloneJob::error].
2357 ///
2358 /// # Example
2359 /// ```ignore,no_run
2360 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2361 /// use google_cloud_rpc::model::Status;
2362 /// let x = CloneJob::new().set_or_clear_error(Some(Status::default()/* use setters */));
2363 /// let x = CloneJob::new().set_or_clear_error(None::<Status>);
2364 /// ```
2365 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2366 where
2367 T: std::convert::Into<google_cloud_rpc::model::Status>,
2368 {
2369 self.error = v.map(|x| x.into());
2370 self
2371 }
2372
2373 /// Sets the value of [steps][crate::model::CloneJob::steps].
2374 ///
2375 /// # Example
2376 /// ```ignore,no_run
2377 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2378 /// use google_cloud_vmmigration_v1::model::CloneStep;
2379 /// let x = CloneJob::new()
2380 /// .set_steps([
2381 /// CloneStep::default()/* use setters */,
2382 /// CloneStep::default()/* use (different) setters */,
2383 /// ]);
2384 /// ```
2385 pub fn set_steps<T, V>(mut self, v: T) -> Self
2386 where
2387 T: std::iter::IntoIterator<Item = V>,
2388 V: std::convert::Into<crate::model::CloneStep>,
2389 {
2390 use std::iter::Iterator;
2391 self.steps = v.into_iter().map(|i| i.into()).collect();
2392 self
2393 }
2394
2395 /// Sets the value of [target_vm_details][crate::model::CloneJob::target_vm_details].
2396 ///
2397 /// Note that all the setters affecting `target_vm_details` are mutually
2398 /// exclusive.
2399 ///
2400 /// # Example
2401 /// ```ignore,no_run
2402 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2403 /// use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
2404 /// let x = CloneJob::new().set_target_vm_details(Some(
2405 /// google_cloud_vmmigration_v1::model::clone_job::TargetVmDetails::ComputeEngineTargetDetails(ComputeEngineTargetDetails::default().into())));
2406 /// ```
2407 pub fn set_target_vm_details<
2408 T: std::convert::Into<std::option::Option<crate::model::clone_job::TargetVmDetails>>,
2409 >(
2410 mut self,
2411 v: T,
2412 ) -> Self {
2413 self.target_vm_details = v.into();
2414 self
2415 }
2416
2417 /// The value of [target_vm_details][crate::model::CloneJob::target_vm_details]
2418 /// if it holds a `ComputeEngineTargetDetails`, `None` if the field is not set or
2419 /// holds a different branch.
2420 pub fn compute_engine_target_details(
2421 &self,
2422 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineTargetDetails>> {
2423 #[allow(unreachable_patterns)]
2424 self.target_vm_details.as_ref().and_then(|v| match v {
2425 crate::model::clone_job::TargetVmDetails::ComputeEngineTargetDetails(v) => {
2426 std::option::Option::Some(v)
2427 }
2428 _ => std::option::Option::None,
2429 })
2430 }
2431
2432 /// Sets the value of [target_vm_details][crate::model::CloneJob::target_vm_details]
2433 /// to hold a `ComputeEngineTargetDetails`.
2434 ///
2435 /// Note that all the setters affecting `target_vm_details` are
2436 /// mutually exclusive.
2437 ///
2438 /// # Example
2439 /// ```ignore,no_run
2440 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2441 /// use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
2442 /// let x = CloneJob::new().set_compute_engine_target_details(ComputeEngineTargetDetails::default()/* use setters */);
2443 /// assert!(x.compute_engine_target_details().is_some());
2444 /// assert!(x.compute_engine_disks_target_details().is_none());
2445 /// ```
2446 pub fn set_compute_engine_target_details<
2447 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineTargetDetails>>,
2448 >(
2449 mut self,
2450 v: T,
2451 ) -> Self {
2452 self.target_vm_details = std::option::Option::Some(
2453 crate::model::clone_job::TargetVmDetails::ComputeEngineTargetDetails(v.into()),
2454 );
2455 self
2456 }
2457
2458 /// The value of [target_vm_details][crate::model::CloneJob::target_vm_details]
2459 /// if it holds a `ComputeEngineDisksTargetDetails`, `None` if the field is not set or
2460 /// holds a different branch.
2461 pub fn compute_engine_disks_target_details(
2462 &self,
2463 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>> {
2464 #[allow(unreachable_patterns)]
2465 self.target_vm_details.as_ref().and_then(|v| match v {
2466 crate::model::clone_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v) => {
2467 std::option::Option::Some(v)
2468 }
2469 _ => std::option::Option::None,
2470 })
2471 }
2472
2473 /// Sets the value of [target_vm_details][crate::model::CloneJob::target_vm_details]
2474 /// to hold a `ComputeEngineDisksTargetDetails`.
2475 ///
2476 /// Note that all the setters affecting `target_vm_details` are
2477 /// mutually exclusive.
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_vmmigration_v1::model::CloneJob;
2482 /// use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDetails;
2483 /// let x = CloneJob::new().set_compute_engine_disks_target_details(ComputeEngineDisksTargetDetails::default()/* use setters */);
2484 /// assert!(x.compute_engine_disks_target_details().is_some());
2485 /// assert!(x.compute_engine_target_details().is_none());
2486 /// ```
2487 pub fn set_compute_engine_disks_target_details<
2488 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>>,
2489 >(
2490 mut self,
2491 v: T,
2492 ) -> Self {
2493 self.target_vm_details = std::option::Option::Some(
2494 crate::model::clone_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v.into()),
2495 );
2496 self
2497 }
2498}
2499
2500impl wkt::message::Message for CloneJob {
2501 fn typename() -> &'static str {
2502 "type.googleapis.com/google.cloud.vmmigration.v1.CloneJob"
2503 }
2504}
2505
2506/// Defines additional types related to [CloneJob].
2507pub mod clone_job {
2508 #[allow(unused_imports)]
2509 use super::*;
2510
2511 /// Possible states of the clone job.
2512 ///
2513 /// # Working with unknown values
2514 ///
2515 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2516 /// additional enum variants at any time. Adding new variants is not considered
2517 /// a breaking change. Applications should write their code in anticipation of:
2518 ///
2519 /// - New values appearing in future releases of the client library, **and**
2520 /// - New values received dynamically, without application changes.
2521 ///
2522 /// Please consult the [Working with enums] section in the user guide for some
2523 /// guidelines.
2524 ///
2525 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2526 #[derive(Clone, Debug, PartialEq)]
2527 #[non_exhaustive]
2528 pub enum State {
2529 /// The state is unknown. This is used for API compatibility only and is not
2530 /// used by the system.
2531 Unspecified,
2532 /// The clone job has not yet started.
2533 Pending,
2534 /// The clone job is active and running.
2535 Active,
2536 /// The clone job finished with errors.
2537 Failed,
2538 /// The clone job finished successfully.
2539 Succeeded,
2540 /// The clone job was cancelled.
2541 Cancelled,
2542 /// The clone job is being cancelled.
2543 Cancelling,
2544 /// OS adaptation is running as part of the clone job to generate license.
2545 AdaptingOs,
2546 /// If set, the enum was initialized with an unknown value.
2547 ///
2548 /// Applications can examine the value using [State::value] or
2549 /// [State::name].
2550 UnknownValue(state::UnknownValue),
2551 }
2552
2553 #[doc(hidden)]
2554 pub mod state {
2555 #[allow(unused_imports)]
2556 use super::*;
2557 #[derive(Clone, Debug, PartialEq)]
2558 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2559 }
2560
2561 impl State {
2562 /// Gets the enum value.
2563 ///
2564 /// Returns `None` if the enum contains an unknown value deserialized from
2565 /// the string representation of enums.
2566 pub fn value(&self) -> std::option::Option<i32> {
2567 match self {
2568 Self::Unspecified => std::option::Option::Some(0),
2569 Self::Pending => std::option::Option::Some(1),
2570 Self::Active => std::option::Option::Some(2),
2571 Self::Failed => std::option::Option::Some(3),
2572 Self::Succeeded => std::option::Option::Some(4),
2573 Self::Cancelled => std::option::Option::Some(5),
2574 Self::Cancelling => std::option::Option::Some(6),
2575 Self::AdaptingOs => std::option::Option::Some(7),
2576 Self::UnknownValue(u) => u.0.value(),
2577 }
2578 }
2579
2580 /// Gets the enum value as a string.
2581 ///
2582 /// Returns `None` if the enum contains an unknown value deserialized from
2583 /// the integer representation of enums.
2584 pub fn name(&self) -> std::option::Option<&str> {
2585 match self {
2586 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2587 Self::Pending => std::option::Option::Some("PENDING"),
2588 Self::Active => std::option::Option::Some("ACTIVE"),
2589 Self::Failed => std::option::Option::Some("FAILED"),
2590 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
2591 Self::Cancelled => std::option::Option::Some("CANCELLED"),
2592 Self::Cancelling => std::option::Option::Some("CANCELLING"),
2593 Self::AdaptingOs => std::option::Option::Some("ADAPTING_OS"),
2594 Self::UnknownValue(u) => u.0.name(),
2595 }
2596 }
2597 }
2598
2599 impl std::default::Default for State {
2600 fn default() -> Self {
2601 use std::convert::From;
2602 Self::from(0)
2603 }
2604 }
2605
2606 impl std::fmt::Display for State {
2607 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2608 wkt::internal::display_enum(f, self.name(), self.value())
2609 }
2610 }
2611
2612 impl std::convert::From<i32> for State {
2613 fn from(value: i32) -> Self {
2614 match value {
2615 0 => Self::Unspecified,
2616 1 => Self::Pending,
2617 2 => Self::Active,
2618 3 => Self::Failed,
2619 4 => Self::Succeeded,
2620 5 => Self::Cancelled,
2621 6 => Self::Cancelling,
2622 7 => Self::AdaptingOs,
2623 _ => Self::UnknownValue(state::UnknownValue(
2624 wkt::internal::UnknownEnumValue::Integer(value),
2625 )),
2626 }
2627 }
2628 }
2629
2630 impl std::convert::From<&str> for State {
2631 fn from(value: &str) -> Self {
2632 use std::string::ToString;
2633 match value {
2634 "STATE_UNSPECIFIED" => Self::Unspecified,
2635 "PENDING" => Self::Pending,
2636 "ACTIVE" => Self::Active,
2637 "FAILED" => Self::Failed,
2638 "SUCCEEDED" => Self::Succeeded,
2639 "CANCELLED" => Self::Cancelled,
2640 "CANCELLING" => Self::Cancelling,
2641 "ADAPTING_OS" => Self::AdaptingOs,
2642 _ => Self::UnknownValue(state::UnknownValue(
2643 wkt::internal::UnknownEnumValue::String(value.to_string()),
2644 )),
2645 }
2646 }
2647 }
2648
2649 impl serde::ser::Serialize for State {
2650 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2651 where
2652 S: serde::Serializer,
2653 {
2654 match self {
2655 Self::Unspecified => serializer.serialize_i32(0),
2656 Self::Pending => serializer.serialize_i32(1),
2657 Self::Active => serializer.serialize_i32(2),
2658 Self::Failed => serializer.serialize_i32(3),
2659 Self::Succeeded => serializer.serialize_i32(4),
2660 Self::Cancelled => serializer.serialize_i32(5),
2661 Self::Cancelling => serializer.serialize_i32(6),
2662 Self::AdaptingOs => serializer.serialize_i32(7),
2663 Self::UnknownValue(u) => u.0.serialize(serializer),
2664 }
2665 }
2666 }
2667
2668 impl<'de> serde::de::Deserialize<'de> for State {
2669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2670 where
2671 D: serde::Deserializer<'de>,
2672 {
2673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2674 ".google.cloud.vmmigration.v1.CloneJob.State",
2675 ))
2676 }
2677 }
2678
2679 /// Details of the VM to create as the target of this clone job.
2680 #[derive(Clone, Debug, PartialEq)]
2681 #[non_exhaustive]
2682 pub enum TargetVmDetails {
2683 /// Output only. Details of the target VM in Compute Engine.
2684 ComputeEngineTargetDetails(std::boxed::Box<crate::model::ComputeEngineTargetDetails>),
2685 /// Output only. Details of the target Persistent Disks in Compute Engine.
2686 ComputeEngineDisksTargetDetails(
2687 std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>,
2688 ),
2689 }
2690}
2691
2692/// CloneStep holds information about the clone step progress.
2693#[derive(Clone, Default, PartialEq)]
2694#[non_exhaustive]
2695pub struct CloneStep {
2696 /// The time the step has started.
2697 pub start_time: std::option::Option<wkt::Timestamp>,
2698
2699 /// The time the step has ended.
2700 pub end_time: std::option::Option<wkt::Timestamp>,
2701
2702 #[allow(missing_docs)]
2703 pub step: std::option::Option<crate::model::clone_step::Step>,
2704
2705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2706}
2707
2708impl CloneStep {
2709 /// Creates a new default instance.
2710 pub fn new() -> Self {
2711 std::default::Default::default()
2712 }
2713
2714 /// Sets the value of [start_time][crate::model::CloneStep::start_time].
2715 ///
2716 /// # Example
2717 /// ```ignore,no_run
2718 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2719 /// use wkt::Timestamp;
2720 /// let x = CloneStep::new().set_start_time(Timestamp::default()/* use setters */);
2721 /// ```
2722 pub fn set_start_time<T>(mut self, v: T) -> Self
2723 where
2724 T: std::convert::Into<wkt::Timestamp>,
2725 {
2726 self.start_time = std::option::Option::Some(v.into());
2727 self
2728 }
2729
2730 /// Sets or clears the value of [start_time][crate::model::CloneStep::start_time].
2731 ///
2732 /// # Example
2733 /// ```ignore,no_run
2734 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2735 /// use wkt::Timestamp;
2736 /// let x = CloneStep::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
2737 /// let x = CloneStep::new().set_or_clear_start_time(None::<Timestamp>);
2738 /// ```
2739 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2740 where
2741 T: std::convert::Into<wkt::Timestamp>,
2742 {
2743 self.start_time = v.map(|x| x.into());
2744 self
2745 }
2746
2747 /// Sets the value of [end_time][crate::model::CloneStep::end_time].
2748 ///
2749 /// # Example
2750 /// ```ignore,no_run
2751 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2752 /// use wkt::Timestamp;
2753 /// let x = CloneStep::new().set_end_time(Timestamp::default()/* use setters */);
2754 /// ```
2755 pub fn set_end_time<T>(mut self, v: T) -> Self
2756 where
2757 T: std::convert::Into<wkt::Timestamp>,
2758 {
2759 self.end_time = std::option::Option::Some(v.into());
2760 self
2761 }
2762
2763 /// Sets or clears the value of [end_time][crate::model::CloneStep::end_time].
2764 ///
2765 /// # Example
2766 /// ```ignore,no_run
2767 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2768 /// use wkt::Timestamp;
2769 /// let x = CloneStep::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2770 /// let x = CloneStep::new().set_or_clear_end_time(None::<Timestamp>);
2771 /// ```
2772 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2773 where
2774 T: std::convert::Into<wkt::Timestamp>,
2775 {
2776 self.end_time = v.map(|x| x.into());
2777 self
2778 }
2779
2780 /// Sets the value of [step][crate::model::CloneStep::step].
2781 ///
2782 /// Note that all the setters affecting `step` are mutually
2783 /// exclusive.
2784 ///
2785 /// # Example
2786 /// ```ignore,no_run
2787 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2788 /// use google_cloud_vmmigration_v1::model::AdaptingOSStep;
2789 /// let x = CloneStep::new().set_step(Some(
2790 /// google_cloud_vmmigration_v1::model::clone_step::Step::AdaptingOs(AdaptingOSStep::default().into())));
2791 /// ```
2792 pub fn set_step<T: std::convert::Into<std::option::Option<crate::model::clone_step::Step>>>(
2793 mut self,
2794 v: T,
2795 ) -> Self {
2796 self.step = v.into();
2797 self
2798 }
2799
2800 /// The value of [step][crate::model::CloneStep::step]
2801 /// if it holds a `AdaptingOs`, `None` if the field is not set or
2802 /// holds a different branch.
2803 pub fn adapting_os(
2804 &self,
2805 ) -> std::option::Option<&std::boxed::Box<crate::model::AdaptingOSStep>> {
2806 #[allow(unreachable_patterns)]
2807 self.step.as_ref().and_then(|v| match v {
2808 crate::model::clone_step::Step::AdaptingOs(v) => std::option::Option::Some(v),
2809 _ => std::option::Option::None,
2810 })
2811 }
2812
2813 /// Sets the value of [step][crate::model::CloneStep::step]
2814 /// to hold a `AdaptingOs`.
2815 ///
2816 /// Note that all the setters affecting `step` are
2817 /// mutually exclusive.
2818 ///
2819 /// # Example
2820 /// ```ignore,no_run
2821 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2822 /// use google_cloud_vmmigration_v1::model::AdaptingOSStep;
2823 /// let x = CloneStep::new().set_adapting_os(AdaptingOSStep::default()/* use setters */);
2824 /// assert!(x.adapting_os().is_some());
2825 /// assert!(x.preparing_vm_disks().is_none());
2826 /// assert!(x.instantiating_migrated_vm().is_none());
2827 /// ```
2828 pub fn set_adapting_os<T: std::convert::Into<std::boxed::Box<crate::model::AdaptingOSStep>>>(
2829 mut self,
2830 v: T,
2831 ) -> Self {
2832 self.step = std::option::Option::Some(crate::model::clone_step::Step::AdaptingOs(v.into()));
2833 self
2834 }
2835
2836 /// The value of [step][crate::model::CloneStep::step]
2837 /// if it holds a `PreparingVmDisks`, `None` if the field is not set or
2838 /// holds a different branch.
2839 pub fn preparing_vm_disks(
2840 &self,
2841 ) -> std::option::Option<&std::boxed::Box<crate::model::PreparingVMDisksStep>> {
2842 #[allow(unreachable_patterns)]
2843 self.step.as_ref().and_then(|v| match v {
2844 crate::model::clone_step::Step::PreparingVmDisks(v) => std::option::Option::Some(v),
2845 _ => std::option::Option::None,
2846 })
2847 }
2848
2849 /// Sets the value of [step][crate::model::CloneStep::step]
2850 /// to hold a `PreparingVmDisks`.
2851 ///
2852 /// Note that all the setters affecting `step` are
2853 /// mutually exclusive.
2854 ///
2855 /// # Example
2856 /// ```ignore,no_run
2857 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2858 /// use google_cloud_vmmigration_v1::model::PreparingVMDisksStep;
2859 /// let x = CloneStep::new().set_preparing_vm_disks(PreparingVMDisksStep::default()/* use setters */);
2860 /// assert!(x.preparing_vm_disks().is_some());
2861 /// assert!(x.adapting_os().is_none());
2862 /// assert!(x.instantiating_migrated_vm().is_none());
2863 /// ```
2864 pub fn set_preparing_vm_disks<
2865 T: std::convert::Into<std::boxed::Box<crate::model::PreparingVMDisksStep>>,
2866 >(
2867 mut self,
2868 v: T,
2869 ) -> Self {
2870 self.step =
2871 std::option::Option::Some(crate::model::clone_step::Step::PreparingVmDisks(v.into()));
2872 self
2873 }
2874
2875 /// The value of [step][crate::model::CloneStep::step]
2876 /// if it holds a `InstantiatingMigratedVm`, `None` if the field is not set or
2877 /// holds a different branch.
2878 pub fn instantiating_migrated_vm(
2879 &self,
2880 ) -> std::option::Option<&std::boxed::Box<crate::model::InstantiatingMigratedVMStep>> {
2881 #[allow(unreachable_patterns)]
2882 self.step.as_ref().and_then(|v| match v {
2883 crate::model::clone_step::Step::InstantiatingMigratedVm(v) => {
2884 std::option::Option::Some(v)
2885 }
2886 _ => std::option::Option::None,
2887 })
2888 }
2889
2890 /// Sets the value of [step][crate::model::CloneStep::step]
2891 /// to hold a `InstantiatingMigratedVm`.
2892 ///
2893 /// Note that all the setters affecting `step` are
2894 /// mutually exclusive.
2895 ///
2896 /// # Example
2897 /// ```ignore,no_run
2898 /// # use google_cloud_vmmigration_v1::model::CloneStep;
2899 /// use google_cloud_vmmigration_v1::model::InstantiatingMigratedVMStep;
2900 /// let x = CloneStep::new().set_instantiating_migrated_vm(InstantiatingMigratedVMStep::default()/* use setters */);
2901 /// assert!(x.instantiating_migrated_vm().is_some());
2902 /// assert!(x.adapting_os().is_none());
2903 /// assert!(x.preparing_vm_disks().is_none());
2904 /// ```
2905 pub fn set_instantiating_migrated_vm<
2906 T: std::convert::Into<std::boxed::Box<crate::model::InstantiatingMigratedVMStep>>,
2907 >(
2908 mut self,
2909 v: T,
2910 ) -> Self {
2911 self.step = std::option::Option::Some(
2912 crate::model::clone_step::Step::InstantiatingMigratedVm(v.into()),
2913 );
2914 self
2915 }
2916}
2917
2918impl wkt::message::Message for CloneStep {
2919 fn typename() -> &'static str {
2920 "type.googleapis.com/google.cloud.vmmigration.v1.CloneStep"
2921 }
2922}
2923
2924/// Defines additional types related to [CloneStep].
2925pub mod clone_step {
2926 #[allow(unused_imports)]
2927 use super::*;
2928
2929 #[allow(missing_docs)]
2930 #[derive(Clone, Debug, PartialEq)]
2931 #[non_exhaustive]
2932 pub enum Step {
2933 /// Adapting OS step.
2934 AdaptingOs(std::boxed::Box<crate::model::AdaptingOSStep>),
2935 /// Preparing VM disks step.
2936 PreparingVmDisks(std::boxed::Box<crate::model::PreparingVMDisksStep>),
2937 /// Instantiating migrated VM step.
2938 InstantiatingMigratedVm(std::boxed::Box<crate::model::InstantiatingMigratedVMStep>),
2939 }
2940}
2941
2942/// AdaptingOSStep contains specific step details.
2943#[derive(Clone, Default, PartialEq)]
2944#[non_exhaustive]
2945pub struct AdaptingOSStep {
2946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2947}
2948
2949impl AdaptingOSStep {
2950 /// Creates a new default instance.
2951 pub fn new() -> Self {
2952 std::default::Default::default()
2953 }
2954}
2955
2956impl wkt::message::Message for AdaptingOSStep {
2957 fn typename() -> &'static str {
2958 "type.googleapis.com/google.cloud.vmmigration.v1.AdaptingOSStep"
2959 }
2960}
2961
2962/// PreparingVMDisksStep contains specific step details.
2963#[derive(Clone, Default, PartialEq)]
2964#[non_exhaustive]
2965pub struct PreparingVMDisksStep {
2966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2967}
2968
2969impl PreparingVMDisksStep {
2970 /// Creates a new default instance.
2971 pub fn new() -> Self {
2972 std::default::Default::default()
2973 }
2974}
2975
2976impl wkt::message::Message for PreparingVMDisksStep {
2977 fn typename() -> &'static str {
2978 "type.googleapis.com/google.cloud.vmmigration.v1.PreparingVMDisksStep"
2979 }
2980}
2981
2982/// InstantiatingMigratedVMStep contains specific step details.
2983#[derive(Clone, Default, PartialEq)]
2984#[non_exhaustive]
2985pub struct InstantiatingMigratedVMStep {
2986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2987}
2988
2989impl InstantiatingMigratedVMStep {
2990 /// Creates a new default instance.
2991 pub fn new() -> Self {
2992 std::default::Default::default()
2993 }
2994}
2995
2996impl wkt::message::Message for InstantiatingMigratedVMStep {
2997 fn typename() -> &'static str {
2998 "type.googleapis.com/google.cloud.vmmigration.v1.InstantiatingMigratedVMStep"
2999 }
3000}
3001
3002/// CutoverJob message describes a cutover of a migrating VM. The CutoverJob is
3003/// the operation of shutting down the VM, creating a snapshot and
3004/// cloning the VM using the replicated snapshot.
3005#[derive(Clone, Default, PartialEq)]
3006#[non_exhaustive]
3007pub struct CutoverJob {
3008 /// Output only. The time the cutover job was created (as an API call, not when
3009 /// it was actually created in the target).
3010 pub create_time: std::option::Option<wkt::Timestamp>,
3011
3012 /// Output only. The time the cutover job had finished.
3013 pub end_time: std::option::Option<wkt::Timestamp>,
3014
3015 /// Output only. The name of the cutover job.
3016 pub name: std::string::String,
3017
3018 /// Output only. State of the cutover job.
3019 pub state: crate::model::cutover_job::State,
3020
3021 /// Output only. The time the state was last updated.
3022 pub state_time: std::option::Option<wkt::Timestamp>,
3023
3024 /// Output only. The current progress in percentage of the cutover job.
3025 pub progress_percent: i32,
3026
3027 /// Output only. Provides details for the errors that led to the Cutover Job's
3028 /// state.
3029 pub error: std::option::Option<google_cloud_rpc::model::Status>,
3030
3031 /// Output only. A message providing possible extra details about the current
3032 /// state.
3033 pub state_message: std::string::String,
3034
3035 /// Output only. The cutover steps list representing its progress.
3036 pub steps: std::vec::Vec<crate::model::CutoverStep>,
3037
3038 /// Details of the VM to create as the target of this cutover job.
3039 pub target_vm_details: std::option::Option<crate::model::cutover_job::TargetVmDetails>,
3040
3041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3042}
3043
3044impl CutoverJob {
3045 /// Creates a new default instance.
3046 pub fn new() -> Self {
3047 std::default::Default::default()
3048 }
3049
3050 /// Sets the value of [create_time][crate::model::CutoverJob::create_time].
3051 ///
3052 /// # Example
3053 /// ```ignore,no_run
3054 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3055 /// use wkt::Timestamp;
3056 /// let x = CutoverJob::new().set_create_time(Timestamp::default()/* use setters */);
3057 /// ```
3058 pub fn set_create_time<T>(mut self, v: T) -> Self
3059 where
3060 T: std::convert::Into<wkt::Timestamp>,
3061 {
3062 self.create_time = std::option::Option::Some(v.into());
3063 self
3064 }
3065
3066 /// Sets or clears the value of [create_time][crate::model::CutoverJob::create_time].
3067 ///
3068 /// # Example
3069 /// ```ignore,no_run
3070 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3071 /// use wkt::Timestamp;
3072 /// let x = CutoverJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3073 /// let x = CutoverJob::new().set_or_clear_create_time(None::<Timestamp>);
3074 /// ```
3075 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3076 where
3077 T: std::convert::Into<wkt::Timestamp>,
3078 {
3079 self.create_time = v.map(|x| x.into());
3080 self
3081 }
3082
3083 /// Sets the value of [end_time][crate::model::CutoverJob::end_time].
3084 ///
3085 /// # Example
3086 /// ```ignore,no_run
3087 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3088 /// use wkt::Timestamp;
3089 /// let x = CutoverJob::new().set_end_time(Timestamp::default()/* use setters */);
3090 /// ```
3091 pub fn set_end_time<T>(mut self, v: T) -> Self
3092 where
3093 T: std::convert::Into<wkt::Timestamp>,
3094 {
3095 self.end_time = std::option::Option::Some(v.into());
3096 self
3097 }
3098
3099 /// Sets or clears the value of [end_time][crate::model::CutoverJob::end_time].
3100 ///
3101 /// # Example
3102 /// ```ignore,no_run
3103 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3104 /// use wkt::Timestamp;
3105 /// let x = CutoverJob::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3106 /// let x = CutoverJob::new().set_or_clear_end_time(None::<Timestamp>);
3107 /// ```
3108 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3109 where
3110 T: std::convert::Into<wkt::Timestamp>,
3111 {
3112 self.end_time = v.map(|x| x.into());
3113 self
3114 }
3115
3116 /// Sets the value of [name][crate::model::CutoverJob::name].
3117 ///
3118 /// # Example
3119 /// ```ignore,no_run
3120 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3121 /// # let project_id = "project_id";
3122 /// # let location_id = "location_id";
3123 /// # let source_id = "source_id";
3124 /// # let migrating_vm_id = "migrating_vm_id";
3125 /// # let cutover_job_id = "cutover_job_id";
3126 /// let x = CutoverJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/cutoverJobs/{cutover_job_id}"));
3127 /// ```
3128 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3129 self.name = v.into();
3130 self
3131 }
3132
3133 /// Sets the value of [state][crate::model::CutoverJob::state].
3134 ///
3135 /// # Example
3136 /// ```ignore,no_run
3137 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3138 /// use google_cloud_vmmigration_v1::model::cutover_job::State;
3139 /// let x0 = CutoverJob::new().set_state(State::Pending);
3140 /// let x1 = CutoverJob::new().set_state(State::Failed);
3141 /// let x2 = CutoverJob::new().set_state(State::Succeeded);
3142 /// ```
3143 pub fn set_state<T: std::convert::Into<crate::model::cutover_job::State>>(
3144 mut self,
3145 v: T,
3146 ) -> Self {
3147 self.state = v.into();
3148 self
3149 }
3150
3151 /// Sets the value of [state_time][crate::model::CutoverJob::state_time].
3152 ///
3153 /// # Example
3154 /// ```ignore,no_run
3155 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3156 /// use wkt::Timestamp;
3157 /// let x = CutoverJob::new().set_state_time(Timestamp::default()/* use setters */);
3158 /// ```
3159 pub fn set_state_time<T>(mut self, v: T) -> Self
3160 where
3161 T: std::convert::Into<wkt::Timestamp>,
3162 {
3163 self.state_time = std::option::Option::Some(v.into());
3164 self
3165 }
3166
3167 /// Sets or clears the value of [state_time][crate::model::CutoverJob::state_time].
3168 ///
3169 /// # Example
3170 /// ```ignore,no_run
3171 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3172 /// use wkt::Timestamp;
3173 /// let x = CutoverJob::new().set_or_clear_state_time(Some(Timestamp::default()/* use setters */));
3174 /// let x = CutoverJob::new().set_or_clear_state_time(None::<Timestamp>);
3175 /// ```
3176 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
3177 where
3178 T: std::convert::Into<wkt::Timestamp>,
3179 {
3180 self.state_time = v.map(|x| x.into());
3181 self
3182 }
3183
3184 /// Sets the value of [progress_percent][crate::model::CutoverJob::progress_percent].
3185 ///
3186 /// # Example
3187 /// ```ignore,no_run
3188 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3189 /// let x = CutoverJob::new().set_progress_percent(42);
3190 /// ```
3191 pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3192 self.progress_percent = v.into();
3193 self
3194 }
3195
3196 /// Sets the value of [error][crate::model::CutoverJob::error].
3197 ///
3198 /// # Example
3199 /// ```ignore,no_run
3200 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3201 /// use google_cloud_rpc::model::Status;
3202 /// let x = CutoverJob::new().set_error(Status::default()/* use setters */);
3203 /// ```
3204 pub fn set_error<T>(mut self, v: T) -> Self
3205 where
3206 T: std::convert::Into<google_cloud_rpc::model::Status>,
3207 {
3208 self.error = std::option::Option::Some(v.into());
3209 self
3210 }
3211
3212 /// Sets or clears the value of [error][crate::model::CutoverJob::error].
3213 ///
3214 /// # Example
3215 /// ```ignore,no_run
3216 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3217 /// use google_cloud_rpc::model::Status;
3218 /// let x = CutoverJob::new().set_or_clear_error(Some(Status::default()/* use setters */));
3219 /// let x = CutoverJob::new().set_or_clear_error(None::<Status>);
3220 /// ```
3221 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
3222 where
3223 T: std::convert::Into<google_cloud_rpc::model::Status>,
3224 {
3225 self.error = v.map(|x| x.into());
3226 self
3227 }
3228
3229 /// Sets the value of [state_message][crate::model::CutoverJob::state_message].
3230 ///
3231 /// # Example
3232 /// ```ignore,no_run
3233 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3234 /// let x = CutoverJob::new().set_state_message("example");
3235 /// ```
3236 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3237 self.state_message = v.into();
3238 self
3239 }
3240
3241 /// Sets the value of [steps][crate::model::CutoverJob::steps].
3242 ///
3243 /// # Example
3244 /// ```ignore,no_run
3245 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3246 /// use google_cloud_vmmigration_v1::model::CutoverStep;
3247 /// let x = CutoverJob::new()
3248 /// .set_steps([
3249 /// CutoverStep::default()/* use setters */,
3250 /// CutoverStep::default()/* use (different) setters */,
3251 /// ]);
3252 /// ```
3253 pub fn set_steps<T, V>(mut self, v: T) -> Self
3254 where
3255 T: std::iter::IntoIterator<Item = V>,
3256 V: std::convert::Into<crate::model::CutoverStep>,
3257 {
3258 use std::iter::Iterator;
3259 self.steps = v.into_iter().map(|i| i.into()).collect();
3260 self
3261 }
3262
3263 /// Sets the value of [target_vm_details][crate::model::CutoverJob::target_vm_details].
3264 ///
3265 /// Note that all the setters affecting `target_vm_details` are mutually
3266 /// exclusive.
3267 ///
3268 /// # Example
3269 /// ```ignore,no_run
3270 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3271 /// use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
3272 /// let x = CutoverJob::new().set_target_vm_details(Some(
3273 /// google_cloud_vmmigration_v1::model::cutover_job::TargetVmDetails::ComputeEngineTargetDetails(ComputeEngineTargetDetails::default().into())));
3274 /// ```
3275 pub fn set_target_vm_details<
3276 T: std::convert::Into<std::option::Option<crate::model::cutover_job::TargetVmDetails>>,
3277 >(
3278 mut self,
3279 v: T,
3280 ) -> Self {
3281 self.target_vm_details = v.into();
3282 self
3283 }
3284
3285 /// The value of [target_vm_details][crate::model::CutoverJob::target_vm_details]
3286 /// if it holds a `ComputeEngineTargetDetails`, `None` if the field is not set or
3287 /// holds a different branch.
3288 pub fn compute_engine_target_details(
3289 &self,
3290 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineTargetDetails>> {
3291 #[allow(unreachable_patterns)]
3292 self.target_vm_details.as_ref().and_then(|v| match v {
3293 crate::model::cutover_job::TargetVmDetails::ComputeEngineTargetDetails(v) => {
3294 std::option::Option::Some(v)
3295 }
3296 _ => std::option::Option::None,
3297 })
3298 }
3299
3300 /// Sets the value of [target_vm_details][crate::model::CutoverJob::target_vm_details]
3301 /// to hold a `ComputeEngineTargetDetails`.
3302 ///
3303 /// Note that all the setters affecting `target_vm_details` are
3304 /// mutually exclusive.
3305 ///
3306 /// # Example
3307 /// ```ignore,no_run
3308 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3309 /// use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
3310 /// let x = CutoverJob::new().set_compute_engine_target_details(ComputeEngineTargetDetails::default()/* use setters */);
3311 /// assert!(x.compute_engine_target_details().is_some());
3312 /// assert!(x.compute_engine_disks_target_details().is_none());
3313 /// ```
3314 pub fn set_compute_engine_target_details<
3315 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineTargetDetails>>,
3316 >(
3317 mut self,
3318 v: T,
3319 ) -> Self {
3320 self.target_vm_details = std::option::Option::Some(
3321 crate::model::cutover_job::TargetVmDetails::ComputeEngineTargetDetails(v.into()),
3322 );
3323 self
3324 }
3325
3326 /// The value of [target_vm_details][crate::model::CutoverJob::target_vm_details]
3327 /// if it holds a `ComputeEngineDisksTargetDetails`, `None` if the field is not set or
3328 /// holds a different branch.
3329 pub fn compute_engine_disks_target_details(
3330 &self,
3331 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>> {
3332 #[allow(unreachable_patterns)]
3333 self.target_vm_details.as_ref().and_then(|v| match v {
3334 crate::model::cutover_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v) => {
3335 std::option::Option::Some(v)
3336 }
3337 _ => std::option::Option::None,
3338 })
3339 }
3340
3341 /// Sets the value of [target_vm_details][crate::model::CutoverJob::target_vm_details]
3342 /// to hold a `ComputeEngineDisksTargetDetails`.
3343 ///
3344 /// Note that all the setters affecting `target_vm_details` are
3345 /// mutually exclusive.
3346 ///
3347 /// # Example
3348 /// ```ignore,no_run
3349 /// # use google_cloud_vmmigration_v1::model::CutoverJob;
3350 /// use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDetails;
3351 /// let x = CutoverJob::new().set_compute_engine_disks_target_details(ComputeEngineDisksTargetDetails::default()/* use setters */);
3352 /// assert!(x.compute_engine_disks_target_details().is_some());
3353 /// assert!(x.compute_engine_target_details().is_none());
3354 /// ```
3355 pub fn set_compute_engine_disks_target_details<
3356 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>>,
3357 >(
3358 mut self,
3359 v: T,
3360 ) -> Self {
3361 self.target_vm_details = std::option::Option::Some(
3362 crate::model::cutover_job::TargetVmDetails::ComputeEngineDisksTargetDetails(v.into()),
3363 );
3364 self
3365 }
3366}
3367
3368impl wkt::message::Message for CutoverJob {
3369 fn typename() -> &'static str {
3370 "type.googleapis.com/google.cloud.vmmigration.v1.CutoverJob"
3371 }
3372}
3373
3374/// Defines additional types related to [CutoverJob].
3375pub mod cutover_job {
3376 #[allow(unused_imports)]
3377 use super::*;
3378
3379 /// Possible states of the cutover job.
3380 ///
3381 /// # Working with unknown values
3382 ///
3383 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3384 /// additional enum variants at any time. Adding new variants is not considered
3385 /// a breaking change. Applications should write their code in anticipation of:
3386 ///
3387 /// - New values appearing in future releases of the client library, **and**
3388 /// - New values received dynamically, without application changes.
3389 ///
3390 /// Please consult the [Working with enums] section in the user guide for some
3391 /// guidelines.
3392 ///
3393 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3394 #[derive(Clone, Debug, PartialEq)]
3395 #[non_exhaustive]
3396 pub enum State {
3397 /// The state is unknown. This is used for API compatibility only and is not
3398 /// used by the system.
3399 Unspecified,
3400 /// The cutover job has not yet started.
3401 Pending,
3402 /// The cutover job finished with errors.
3403 Failed,
3404 /// The cutover job finished successfully.
3405 Succeeded,
3406 /// The cutover job was cancelled.
3407 Cancelled,
3408 /// The cutover job is being cancelled.
3409 Cancelling,
3410 /// The cutover job is active and running.
3411 Active,
3412 /// OS adaptation is running as part of the cutover job to generate license.
3413 AdaptingOs,
3414 /// If set, the enum was initialized with an unknown value.
3415 ///
3416 /// Applications can examine the value using [State::value] or
3417 /// [State::name].
3418 UnknownValue(state::UnknownValue),
3419 }
3420
3421 #[doc(hidden)]
3422 pub mod state {
3423 #[allow(unused_imports)]
3424 use super::*;
3425 #[derive(Clone, Debug, PartialEq)]
3426 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3427 }
3428
3429 impl State {
3430 /// Gets the enum value.
3431 ///
3432 /// Returns `None` if the enum contains an unknown value deserialized from
3433 /// the string representation of enums.
3434 pub fn value(&self) -> std::option::Option<i32> {
3435 match self {
3436 Self::Unspecified => std::option::Option::Some(0),
3437 Self::Pending => std::option::Option::Some(1),
3438 Self::Failed => std::option::Option::Some(2),
3439 Self::Succeeded => std::option::Option::Some(3),
3440 Self::Cancelled => std::option::Option::Some(4),
3441 Self::Cancelling => std::option::Option::Some(5),
3442 Self::Active => std::option::Option::Some(6),
3443 Self::AdaptingOs => std::option::Option::Some(7),
3444 Self::UnknownValue(u) => u.0.value(),
3445 }
3446 }
3447
3448 /// Gets the enum value as a string.
3449 ///
3450 /// Returns `None` if the enum contains an unknown value deserialized from
3451 /// the integer representation of enums.
3452 pub fn name(&self) -> std::option::Option<&str> {
3453 match self {
3454 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3455 Self::Pending => std::option::Option::Some("PENDING"),
3456 Self::Failed => std::option::Option::Some("FAILED"),
3457 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
3458 Self::Cancelled => std::option::Option::Some("CANCELLED"),
3459 Self::Cancelling => std::option::Option::Some("CANCELLING"),
3460 Self::Active => std::option::Option::Some("ACTIVE"),
3461 Self::AdaptingOs => std::option::Option::Some("ADAPTING_OS"),
3462 Self::UnknownValue(u) => u.0.name(),
3463 }
3464 }
3465 }
3466
3467 impl std::default::Default for State {
3468 fn default() -> Self {
3469 use std::convert::From;
3470 Self::from(0)
3471 }
3472 }
3473
3474 impl std::fmt::Display for State {
3475 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3476 wkt::internal::display_enum(f, self.name(), self.value())
3477 }
3478 }
3479
3480 impl std::convert::From<i32> for State {
3481 fn from(value: i32) -> Self {
3482 match value {
3483 0 => Self::Unspecified,
3484 1 => Self::Pending,
3485 2 => Self::Failed,
3486 3 => Self::Succeeded,
3487 4 => Self::Cancelled,
3488 5 => Self::Cancelling,
3489 6 => Self::Active,
3490 7 => Self::AdaptingOs,
3491 _ => Self::UnknownValue(state::UnknownValue(
3492 wkt::internal::UnknownEnumValue::Integer(value),
3493 )),
3494 }
3495 }
3496 }
3497
3498 impl std::convert::From<&str> for State {
3499 fn from(value: &str) -> Self {
3500 use std::string::ToString;
3501 match value {
3502 "STATE_UNSPECIFIED" => Self::Unspecified,
3503 "PENDING" => Self::Pending,
3504 "FAILED" => Self::Failed,
3505 "SUCCEEDED" => Self::Succeeded,
3506 "CANCELLED" => Self::Cancelled,
3507 "CANCELLING" => Self::Cancelling,
3508 "ACTIVE" => Self::Active,
3509 "ADAPTING_OS" => Self::AdaptingOs,
3510 _ => Self::UnknownValue(state::UnknownValue(
3511 wkt::internal::UnknownEnumValue::String(value.to_string()),
3512 )),
3513 }
3514 }
3515 }
3516
3517 impl serde::ser::Serialize for State {
3518 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3519 where
3520 S: serde::Serializer,
3521 {
3522 match self {
3523 Self::Unspecified => serializer.serialize_i32(0),
3524 Self::Pending => serializer.serialize_i32(1),
3525 Self::Failed => serializer.serialize_i32(2),
3526 Self::Succeeded => serializer.serialize_i32(3),
3527 Self::Cancelled => serializer.serialize_i32(4),
3528 Self::Cancelling => serializer.serialize_i32(5),
3529 Self::Active => serializer.serialize_i32(6),
3530 Self::AdaptingOs => serializer.serialize_i32(7),
3531 Self::UnknownValue(u) => u.0.serialize(serializer),
3532 }
3533 }
3534 }
3535
3536 impl<'de> serde::de::Deserialize<'de> for State {
3537 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3538 where
3539 D: serde::Deserializer<'de>,
3540 {
3541 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3542 ".google.cloud.vmmigration.v1.CutoverJob.State",
3543 ))
3544 }
3545 }
3546
3547 /// Details of the VM to create as the target of this cutover job.
3548 #[derive(Clone, Debug, PartialEq)]
3549 #[non_exhaustive]
3550 pub enum TargetVmDetails {
3551 /// Output only. Details of the target VM in Compute Engine.
3552 ComputeEngineTargetDetails(std::boxed::Box<crate::model::ComputeEngineTargetDetails>),
3553 /// Output only. Details of the target Persistent Disks in Compute Engine.
3554 ComputeEngineDisksTargetDetails(
3555 std::boxed::Box<crate::model::ComputeEngineDisksTargetDetails>,
3556 ),
3557 }
3558}
3559
3560/// CutoverStep holds information about the cutover step progress.
3561#[derive(Clone, Default, PartialEq)]
3562#[non_exhaustive]
3563pub struct CutoverStep {
3564 /// The time the step has started.
3565 pub start_time: std::option::Option<wkt::Timestamp>,
3566
3567 /// The time the step has ended.
3568 pub end_time: std::option::Option<wkt::Timestamp>,
3569
3570 #[allow(missing_docs)]
3571 pub step: std::option::Option<crate::model::cutover_step::Step>,
3572
3573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3574}
3575
3576impl CutoverStep {
3577 /// Creates a new default instance.
3578 pub fn new() -> Self {
3579 std::default::Default::default()
3580 }
3581
3582 /// Sets the value of [start_time][crate::model::CutoverStep::start_time].
3583 ///
3584 /// # Example
3585 /// ```ignore,no_run
3586 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3587 /// use wkt::Timestamp;
3588 /// let x = CutoverStep::new().set_start_time(Timestamp::default()/* use setters */);
3589 /// ```
3590 pub fn set_start_time<T>(mut self, v: T) -> Self
3591 where
3592 T: std::convert::Into<wkt::Timestamp>,
3593 {
3594 self.start_time = std::option::Option::Some(v.into());
3595 self
3596 }
3597
3598 /// Sets or clears the value of [start_time][crate::model::CutoverStep::start_time].
3599 ///
3600 /// # Example
3601 /// ```ignore,no_run
3602 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3603 /// use wkt::Timestamp;
3604 /// let x = CutoverStep::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3605 /// let x = CutoverStep::new().set_or_clear_start_time(None::<Timestamp>);
3606 /// ```
3607 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3608 where
3609 T: std::convert::Into<wkt::Timestamp>,
3610 {
3611 self.start_time = v.map(|x| x.into());
3612 self
3613 }
3614
3615 /// Sets the value of [end_time][crate::model::CutoverStep::end_time].
3616 ///
3617 /// # Example
3618 /// ```ignore,no_run
3619 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3620 /// use wkt::Timestamp;
3621 /// let x = CutoverStep::new().set_end_time(Timestamp::default()/* use setters */);
3622 /// ```
3623 pub fn set_end_time<T>(mut self, v: T) -> Self
3624 where
3625 T: std::convert::Into<wkt::Timestamp>,
3626 {
3627 self.end_time = std::option::Option::Some(v.into());
3628 self
3629 }
3630
3631 /// Sets or clears the value of [end_time][crate::model::CutoverStep::end_time].
3632 ///
3633 /// # Example
3634 /// ```ignore,no_run
3635 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3636 /// use wkt::Timestamp;
3637 /// let x = CutoverStep::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3638 /// let x = CutoverStep::new().set_or_clear_end_time(None::<Timestamp>);
3639 /// ```
3640 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3641 where
3642 T: std::convert::Into<wkt::Timestamp>,
3643 {
3644 self.end_time = v.map(|x| x.into());
3645 self
3646 }
3647
3648 /// Sets the value of [step][crate::model::CutoverStep::step].
3649 ///
3650 /// Note that all the setters affecting `step` are mutually
3651 /// exclusive.
3652 ///
3653 /// # Example
3654 /// ```ignore,no_run
3655 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3656 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
3657 /// let x = CutoverStep::new().set_step(Some(
3658 /// google_cloud_vmmigration_v1::model::cutover_step::Step::PreviousReplicationCycle(ReplicationCycle::default().into())));
3659 /// ```
3660 pub fn set_step<
3661 T: std::convert::Into<std::option::Option<crate::model::cutover_step::Step>>,
3662 >(
3663 mut self,
3664 v: T,
3665 ) -> Self {
3666 self.step = v.into();
3667 self
3668 }
3669
3670 /// The value of [step][crate::model::CutoverStep::step]
3671 /// if it holds a `PreviousReplicationCycle`, `None` if the field is not set or
3672 /// holds a different branch.
3673 pub fn previous_replication_cycle(
3674 &self,
3675 ) -> std::option::Option<&std::boxed::Box<crate::model::ReplicationCycle>> {
3676 #[allow(unreachable_patterns)]
3677 self.step.as_ref().and_then(|v| match v {
3678 crate::model::cutover_step::Step::PreviousReplicationCycle(v) => {
3679 std::option::Option::Some(v)
3680 }
3681 _ => std::option::Option::None,
3682 })
3683 }
3684
3685 /// Sets the value of [step][crate::model::CutoverStep::step]
3686 /// to hold a `PreviousReplicationCycle`.
3687 ///
3688 /// Note that all the setters affecting `step` are
3689 /// mutually exclusive.
3690 ///
3691 /// # Example
3692 /// ```ignore,no_run
3693 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3694 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
3695 /// let x = CutoverStep::new().set_previous_replication_cycle(ReplicationCycle::default()/* use setters */);
3696 /// assert!(x.previous_replication_cycle().is_some());
3697 /// assert!(x.shutting_down_source_vm().is_none());
3698 /// assert!(x.final_sync().is_none());
3699 /// assert!(x.preparing_vm_disks().is_none());
3700 /// assert!(x.instantiating_migrated_vm().is_none());
3701 /// ```
3702 pub fn set_previous_replication_cycle<
3703 T: std::convert::Into<std::boxed::Box<crate::model::ReplicationCycle>>,
3704 >(
3705 mut self,
3706 v: T,
3707 ) -> Self {
3708 self.step = std::option::Option::Some(
3709 crate::model::cutover_step::Step::PreviousReplicationCycle(v.into()),
3710 );
3711 self
3712 }
3713
3714 /// The value of [step][crate::model::CutoverStep::step]
3715 /// if it holds a `ShuttingDownSourceVm`, `None` if the field is not set or
3716 /// holds a different branch.
3717 pub fn shutting_down_source_vm(
3718 &self,
3719 ) -> std::option::Option<&std::boxed::Box<crate::model::ShuttingDownSourceVMStep>> {
3720 #[allow(unreachable_patterns)]
3721 self.step.as_ref().and_then(|v| match v {
3722 crate::model::cutover_step::Step::ShuttingDownSourceVm(v) => {
3723 std::option::Option::Some(v)
3724 }
3725 _ => std::option::Option::None,
3726 })
3727 }
3728
3729 /// Sets the value of [step][crate::model::CutoverStep::step]
3730 /// to hold a `ShuttingDownSourceVm`.
3731 ///
3732 /// Note that all the setters affecting `step` are
3733 /// mutually exclusive.
3734 ///
3735 /// # Example
3736 /// ```ignore,no_run
3737 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3738 /// use google_cloud_vmmigration_v1::model::ShuttingDownSourceVMStep;
3739 /// let x = CutoverStep::new().set_shutting_down_source_vm(ShuttingDownSourceVMStep::default()/* use setters */);
3740 /// assert!(x.shutting_down_source_vm().is_some());
3741 /// assert!(x.previous_replication_cycle().is_none());
3742 /// assert!(x.final_sync().is_none());
3743 /// assert!(x.preparing_vm_disks().is_none());
3744 /// assert!(x.instantiating_migrated_vm().is_none());
3745 /// ```
3746 pub fn set_shutting_down_source_vm<
3747 T: std::convert::Into<std::boxed::Box<crate::model::ShuttingDownSourceVMStep>>,
3748 >(
3749 mut self,
3750 v: T,
3751 ) -> Self {
3752 self.step = std::option::Option::Some(
3753 crate::model::cutover_step::Step::ShuttingDownSourceVm(v.into()),
3754 );
3755 self
3756 }
3757
3758 /// The value of [step][crate::model::CutoverStep::step]
3759 /// if it holds a `FinalSync`, `None` if the field is not set or
3760 /// holds a different branch.
3761 pub fn final_sync(
3762 &self,
3763 ) -> std::option::Option<&std::boxed::Box<crate::model::ReplicationCycle>> {
3764 #[allow(unreachable_patterns)]
3765 self.step.as_ref().and_then(|v| match v {
3766 crate::model::cutover_step::Step::FinalSync(v) => std::option::Option::Some(v),
3767 _ => std::option::Option::None,
3768 })
3769 }
3770
3771 /// Sets the value of [step][crate::model::CutoverStep::step]
3772 /// to hold a `FinalSync`.
3773 ///
3774 /// Note that all the setters affecting `step` are
3775 /// mutually exclusive.
3776 ///
3777 /// # Example
3778 /// ```ignore,no_run
3779 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3780 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
3781 /// let x = CutoverStep::new().set_final_sync(ReplicationCycle::default()/* use setters */);
3782 /// assert!(x.final_sync().is_some());
3783 /// assert!(x.previous_replication_cycle().is_none());
3784 /// assert!(x.shutting_down_source_vm().is_none());
3785 /// assert!(x.preparing_vm_disks().is_none());
3786 /// assert!(x.instantiating_migrated_vm().is_none());
3787 /// ```
3788 pub fn set_final_sync<
3789 T: std::convert::Into<std::boxed::Box<crate::model::ReplicationCycle>>,
3790 >(
3791 mut self,
3792 v: T,
3793 ) -> Self {
3794 self.step =
3795 std::option::Option::Some(crate::model::cutover_step::Step::FinalSync(v.into()));
3796 self
3797 }
3798
3799 /// The value of [step][crate::model::CutoverStep::step]
3800 /// if it holds a `PreparingVmDisks`, `None` if the field is not set or
3801 /// holds a different branch.
3802 pub fn preparing_vm_disks(
3803 &self,
3804 ) -> std::option::Option<&std::boxed::Box<crate::model::PreparingVMDisksStep>> {
3805 #[allow(unreachable_patterns)]
3806 self.step.as_ref().and_then(|v| match v {
3807 crate::model::cutover_step::Step::PreparingVmDisks(v) => std::option::Option::Some(v),
3808 _ => std::option::Option::None,
3809 })
3810 }
3811
3812 /// Sets the value of [step][crate::model::CutoverStep::step]
3813 /// to hold a `PreparingVmDisks`.
3814 ///
3815 /// Note that all the setters affecting `step` are
3816 /// mutually exclusive.
3817 ///
3818 /// # Example
3819 /// ```ignore,no_run
3820 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3821 /// use google_cloud_vmmigration_v1::model::PreparingVMDisksStep;
3822 /// let x = CutoverStep::new().set_preparing_vm_disks(PreparingVMDisksStep::default()/* use setters */);
3823 /// assert!(x.preparing_vm_disks().is_some());
3824 /// assert!(x.previous_replication_cycle().is_none());
3825 /// assert!(x.shutting_down_source_vm().is_none());
3826 /// assert!(x.final_sync().is_none());
3827 /// assert!(x.instantiating_migrated_vm().is_none());
3828 /// ```
3829 pub fn set_preparing_vm_disks<
3830 T: std::convert::Into<std::boxed::Box<crate::model::PreparingVMDisksStep>>,
3831 >(
3832 mut self,
3833 v: T,
3834 ) -> Self {
3835 self.step =
3836 std::option::Option::Some(crate::model::cutover_step::Step::PreparingVmDisks(v.into()));
3837 self
3838 }
3839
3840 /// The value of [step][crate::model::CutoverStep::step]
3841 /// if it holds a `InstantiatingMigratedVm`, `None` if the field is not set or
3842 /// holds a different branch.
3843 pub fn instantiating_migrated_vm(
3844 &self,
3845 ) -> std::option::Option<&std::boxed::Box<crate::model::InstantiatingMigratedVMStep>> {
3846 #[allow(unreachable_patterns)]
3847 self.step.as_ref().and_then(|v| match v {
3848 crate::model::cutover_step::Step::InstantiatingMigratedVm(v) => {
3849 std::option::Option::Some(v)
3850 }
3851 _ => std::option::Option::None,
3852 })
3853 }
3854
3855 /// Sets the value of [step][crate::model::CutoverStep::step]
3856 /// to hold a `InstantiatingMigratedVm`.
3857 ///
3858 /// Note that all the setters affecting `step` are
3859 /// mutually exclusive.
3860 ///
3861 /// # Example
3862 /// ```ignore,no_run
3863 /// # use google_cloud_vmmigration_v1::model::CutoverStep;
3864 /// use google_cloud_vmmigration_v1::model::InstantiatingMigratedVMStep;
3865 /// let x = CutoverStep::new().set_instantiating_migrated_vm(InstantiatingMigratedVMStep::default()/* use setters */);
3866 /// assert!(x.instantiating_migrated_vm().is_some());
3867 /// assert!(x.previous_replication_cycle().is_none());
3868 /// assert!(x.shutting_down_source_vm().is_none());
3869 /// assert!(x.final_sync().is_none());
3870 /// assert!(x.preparing_vm_disks().is_none());
3871 /// ```
3872 pub fn set_instantiating_migrated_vm<
3873 T: std::convert::Into<std::boxed::Box<crate::model::InstantiatingMigratedVMStep>>,
3874 >(
3875 mut self,
3876 v: T,
3877 ) -> Self {
3878 self.step = std::option::Option::Some(
3879 crate::model::cutover_step::Step::InstantiatingMigratedVm(v.into()),
3880 );
3881 self
3882 }
3883}
3884
3885impl wkt::message::Message for CutoverStep {
3886 fn typename() -> &'static str {
3887 "type.googleapis.com/google.cloud.vmmigration.v1.CutoverStep"
3888 }
3889}
3890
3891/// Defines additional types related to [CutoverStep].
3892pub mod cutover_step {
3893 #[allow(unused_imports)]
3894 use super::*;
3895
3896 #[allow(missing_docs)]
3897 #[derive(Clone, Debug, PartialEq)]
3898 #[non_exhaustive]
3899 pub enum Step {
3900 /// A replication cycle prior cutover step.
3901 PreviousReplicationCycle(std::boxed::Box<crate::model::ReplicationCycle>),
3902 /// Shutting down VM step.
3903 ShuttingDownSourceVm(std::boxed::Box<crate::model::ShuttingDownSourceVMStep>),
3904 /// Final sync step.
3905 FinalSync(std::boxed::Box<crate::model::ReplicationCycle>),
3906 /// Preparing VM disks step.
3907 PreparingVmDisks(std::boxed::Box<crate::model::PreparingVMDisksStep>),
3908 /// Instantiating migrated VM step.
3909 InstantiatingMigratedVm(std::boxed::Box<crate::model::InstantiatingMigratedVMStep>),
3910 }
3911}
3912
3913/// ShuttingDownSourceVMStep contains specific step details.
3914#[derive(Clone, Default, PartialEq)]
3915#[non_exhaustive]
3916pub struct ShuttingDownSourceVMStep {
3917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3918}
3919
3920impl ShuttingDownSourceVMStep {
3921 /// Creates a new default instance.
3922 pub fn new() -> Self {
3923 std::default::Default::default()
3924 }
3925}
3926
3927impl wkt::message::Message for ShuttingDownSourceVMStep {
3928 fn typename() -> &'static str {
3929 "type.googleapis.com/google.cloud.vmmigration.v1.ShuttingDownSourceVMStep"
3930 }
3931}
3932
3933/// Request message for 'CreateCloneJob' request.
3934#[derive(Clone, Default, PartialEq)]
3935#[non_exhaustive]
3936pub struct CreateCloneJobRequest {
3937 /// Required. The Clone's parent.
3938 pub parent: std::string::String,
3939
3940 /// Required. The clone job identifier.
3941 pub clone_job_id: std::string::String,
3942
3943 /// Required. The clone request body.
3944 pub clone_job: std::option::Option<crate::model::CloneJob>,
3945
3946 /// A request ID to identify requests. Specify a unique request ID
3947 /// so that if you must retry your request, the server will know to ignore
3948 /// the request if it has already been completed. The server will guarantee
3949 /// that for at least 60 minutes since the first request.
3950 ///
3951 /// For example, consider a situation where you make an initial request and
3952 /// the request times out. If you make the request again with the same request
3953 /// ID, the server can check if original operation with the same request ID
3954 /// was received, and if so, will ignore the second request. This prevents
3955 /// clients from accidentally creating duplicate commitments.
3956 ///
3957 /// The request ID must be a valid UUID with the exception that zero UUID is
3958 /// not supported (00000000-0000-0000-0000-000000000000).
3959 pub request_id: std::string::String,
3960
3961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3962}
3963
3964impl CreateCloneJobRequest {
3965 /// Creates a new default instance.
3966 pub fn new() -> Self {
3967 std::default::Default::default()
3968 }
3969
3970 /// Sets the value of [parent][crate::model::CreateCloneJobRequest::parent].
3971 ///
3972 /// # Example
3973 /// ```ignore,no_run
3974 /// # use google_cloud_vmmigration_v1::model::CreateCloneJobRequest;
3975 /// # let project_id = "project_id";
3976 /// # let location_id = "location_id";
3977 /// # let source_id = "source_id";
3978 /// # let migrating_vm_id = "migrating_vm_id";
3979 /// let x = CreateCloneJobRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
3980 /// ```
3981 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.parent = v.into();
3983 self
3984 }
3985
3986 /// Sets the value of [clone_job_id][crate::model::CreateCloneJobRequest::clone_job_id].
3987 ///
3988 /// # Example
3989 /// ```ignore,no_run
3990 /// # use google_cloud_vmmigration_v1::model::CreateCloneJobRequest;
3991 /// let x = CreateCloneJobRequest::new().set_clone_job_id("example");
3992 /// ```
3993 pub fn set_clone_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3994 self.clone_job_id = v.into();
3995 self
3996 }
3997
3998 /// Sets the value of [clone_job][crate::model::CreateCloneJobRequest::clone_job].
3999 ///
4000 /// # Example
4001 /// ```ignore,no_run
4002 /// # use google_cloud_vmmigration_v1::model::CreateCloneJobRequest;
4003 /// use google_cloud_vmmigration_v1::model::CloneJob;
4004 /// let x = CreateCloneJobRequest::new().set_clone_job(CloneJob::default()/* use setters */);
4005 /// ```
4006 pub fn set_clone_job<T>(mut self, v: T) -> Self
4007 where
4008 T: std::convert::Into<crate::model::CloneJob>,
4009 {
4010 self.clone_job = std::option::Option::Some(v.into());
4011 self
4012 }
4013
4014 /// Sets or clears the value of [clone_job][crate::model::CreateCloneJobRequest::clone_job].
4015 ///
4016 /// # Example
4017 /// ```ignore,no_run
4018 /// # use google_cloud_vmmigration_v1::model::CreateCloneJobRequest;
4019 /// use google_cloud_vmmigration_v1::model::CloneJob;
4020 /// let x = CreateCloneJobRequest::new().set_or_clear_clone_job(Some(CloneJob::default()/* use setters */));
4021 /// let x = CreateCloneJobRequest::new().set_or_clear_clone_job(None::<CloneJob>);
4022 /// ```
4023 pub fn set_or_clear_clone_job<T>(mut self, v: std::option::Option<T>) -> Self
4024 where
4025 T: std::convert::Into<crate::model::CloneJob>,
4026 {
4027 self.clone_job = v.map(|x| x.into());
4028 self
4029 }
4030
4031 /// Sets the value of [request_id][crate::model::CreateCloneJobRequest::request_id].
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_vmmigration_v1::model::CreateCloneJobRequest;
4036 /// let x = CreateCloneJobRequest::new().set_request_id("example");
4037 /// ```
4038 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4039 self.request_id = v.into();
4040 self
4041 }
4042}
4043
4044impl wkt::message::Message for CreateCloneJobRequest {
4045 fn typename() -> &'static str {
4046 "type.googleapis.com/google.cloud.vmmigration.v1.CreateCloneJobRequest"
4047 }
4048}
4049
4050/// Request message for 'CancelCloneJob' request.
4051#[derive(Clone, Default, PartialEq)]
4052#[non_exhaustive]
4053pub struct CancelCloneJobRequest {
4054 /// Required. The clone job id
4055 pub name: std::string::String,
4056
4057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4058}
4059
4060impl CancelCloneJobRequest {
4061 /// Creates a new default instance.
4062 pub fn new() -> Self {
4063 std::default::Default::default()
4064 }
4065
4066 /// Sets the value of [name][crate::model::CancelCloneJobRequest::name].
4067 ///
4068 /// # Example
4069 /// ```ignore,no_run
4070 /// # use google_cloud_vmmigration_v1::model::CancelCloneJobRequest;
4071 /// # let project_id = "project_id";
4072 /// # let location_id = "location_id";
4073 /// # let source_id = "source_id";
4074 /// # let migrating_vm_id = "migrating_vm_id";
4075 /// # let clone_job_id = "clone_job_id";
4076 /// let x = CancelCloneJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/cloneJobs/{clone_job_id}"));
4077 /// ```
4078 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4079 self.name = v.into();
4080 self
4081 }
4082}
4083
4084impl wkt::message::Message for CancelCloneJobRequest {
4085 fn typename() -> &'static str {
4086 "type.googleapis.com/google.cloud.vmmigration.v1.CancelCloneJobRequest"
4087 }
4088}
4089
4090/// Response message for 'CancelCloneJob' request.
4091#[derive(Clone, Default, PartialEq)]
4092#[non_exhaustive]
4093pub struct CancelCloneJobResponse {
4094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4095}
4096
4097impl CancelCloneJobResponse {
4098 /// Creates a new default instance.
4099 pub fn new() -> Self {
4100 std::default::Default::default()
4101 }
4102}
4103
4104impl wkt::message::Message for CancelCloneJobResponse {
4105 fn typename() -> &'static str {
4106 "type.googleapis.com/google.cloud.vmmigration.v1.CancelCloneJobResponse"
4107 }
4108}
4109
4110/// Request message for 'ListCloneJobsRequest' request.
4111#[derive(Clone, Default, PartialEq)]
4112#[non_exhaustive]
4113pub struct ListCloneJobsRequest {
4114 /// Required. The parent, which owns this collection of source VMs.
4115 pub parent: std::string::String,
4116
4117 /// Optional. The maximum number of clone jobs to return. The service may
4118 /// return fewer than this value. If unspecified, at most 500 clone jobs will
4119 /// be returned. The maximum value is 1000; values above 1000 will be coerced
4120 /// to 1000.
4121 pub page_size: i32,
4122
4123 /// Required. A page token, received from a previous `ListCloneJobs` call.
4124 /// Provide this to retrieve the subsequent page.
4125 ///
4126 /// When paginating, all other parameters provided to `ListCloneJobs` must
4127 /// match the call that provided the page token.
4128 pub page_token: std::string::String,
4129
4130 /// Optional. The filter request.
4131 pub filter: std::string::String,
4132
4133 /// Optional. the order by fields for the result.
4134 pub order_by: std::string::String,
4135
4136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4137}
4138
4139impl ListCloneJobsRequest {
4140 /// Creates a new default instance.
4141 pub fn new() -> Self {
4142 std::default::Default::default()
4143 }
4144
4145 /// Sets the value of [parent][crate::model::ListCloneJobsRequest::parent].
4146 ///
4147 /// # Example
4148 /// ```ignore,no_run
4149 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsRequest;
4150 /// # let project_id = "project_id";
4151 /// # let location_id = "location_id";
4152 /// # let source_id = "source_id";
4153 /// # let migrating_vm_id = "migrating_vm_id";
4154 /// let x = ListCloneJobsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
4155 /// ```
4156 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4157 self.parent = v.into();
4158 self
4159 }
4160
4161 /// Sets the value of [page_size][crate::model::ListCloneJobsRequest::page_size].
4162 ///
4163 /// # Example
4164 /// ```ignore,no_run
4165 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsRequest;
4166 /// let x = ListCloneJobsRequest::new().set_page_size(42);
4167 /// ```
4168 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4169 self.page_size = v.into();
4170 self
4171 }
4172
4173 /// Sets the value of [page_token][crate::model::ListCloneJobsRequest::page_token].
4174 ///
4175 /// # Example
4176 /// ```ignore,no_run
4177 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsRequest;
4178 /// let x = ListCloneJobsRequest::new().set_page_token("example");
4179 /// ```
4180 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4181 self.page_token = v.into();
4182 self
4183 }
4184
4185 /// Sets the value of [filter][crate::model::ListCloneJobsRequest::filter].
4186 ///
4187 /// # Example
4188 /// ```ignore,no_run
4189 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsRequest;
4190 /// let x = ListCloneJobsRequest::new().set_filter("example");
4191 /// ```
4192 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4193 self.filter = v.into();
4194 self
4195 }
4196
4197 /// Sets the value of [order_by][crate::model::ListCloneJobsRequest::order_by].
4198 ///
4199 /// # Example
4200 /// ```ignore,no_run
4201 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsRequest;
4202 /// let x = ListCloneJobsRequest::new().set_order_by("example");
4203 /// ```
4204 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4205 self.order_by = v.into();
4206 self
4207 }
4208}
4209
4210impl wkt::message::Message for ListCloneJobsRequest {
4211 fn typename() -> &'static str {
4212 "type.googleapis.com/google.cloud.vmmigration.v1.ListCloneJobsRequest"
4213 }
4214}
4215
4216/// Response message for 'ListCloneJobs' request.
4217#[derive(Clone, Default, PartialEq)]
4218#[non_exhaustive]
4219pub struct ListCloneJobsResponse {
4220 /// Output only. The list of clone jobs response.
4221 pub clone_jobs: std::vec::Vec<crate::model::CloneJob>,
4222
4223 /// Output only. A token, which can be sent as `page_token` to retrieve the
4224 /// next page. If this field is omitted, there are no subsequent pages.
4225 pub next_page_token: std::string::String,
4226
4227 /// Output only. Locations that could not be reached.
4228 pub unreachable: std::vec::Vec<std::string::String>,
4229
4230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4231}
4232
4233impl ListCloneJobsResponse {
4234 /// Creates a new default instance.
4235 pub fn new() -> Self {
4236 std::default::Default::default()
4237 }
4238
4239 /// Sets the value of [clone_jobs][crate::model::ListCloneJobsResponse::clone_jobs].
4240 ///
4241 /// # Example
4242 /// ```ignore,no_run
4243 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsResponse;
4244 /// use google_cloud_vmmigration_v1::model::CloneJob;
4245 /// let x = ListCloneJobsResponse::new()
4246 /// .set_clone_jobs([
4247 /// CloneJob::default()/* use setters */,
4248 /// CloneJob::default()/* use (different) setters */,
4249 /// ]);
4250 /// ```
4251 pub fn set_clone_jobs<T, V>(mut self, v: T) -> Self
4252 where
4253 T: std::iter::IntoIterator<Item = V>,
4254 V: std::convert::Into<crate::model::CloneJob>,
4255 {
4256 use std::iter::Iterator;
4257 self.clone_jobs = v.into_iter().map(|i| i.into()).collect();
4258 self
4259 }
4260
4261 /// Sets the value of [next_page_token][crate::model::ListCloneJobsResponse::next_page_token].
4262 ///
4263 /// # Example
4264 /// ```ignore,no_run
4265 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsResponse;
4266 /// let x = ListCloneJobsResponse::new().set_next_page_token("example");
4267 /// ```
4268 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4269 self.next_page_token = v.into();
4270 self
4271 }
4272
4273 /// Sets the value of [unreachable][crate::model::ListCloneJobsResponse::unreachable].
4274 ///
4275 /// # Example
4276 /// ```ignore,no_run
4277 /// # use google_cloud_vmmigration_v1::model::ListCloneJobsResponse;
4278 /// let x = ListCloneJobsResponse::new().set_unreachable(["a", "b", "c"]);
4279 /// ```
4280 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4281 where
4282 T: std::iter::IntoIterator<Item = V>,
4283 V: std::convert::Into<std::string::String>,
4284 {
4285 use std::iter::Iterator;
4286 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4287 self
4288 }
4289}
4290
4291impl wkt::message::Message for ListCloneJobsResponse {
4292 fn typename() -> &'static str {
4293 "type.googleapis.com/google.cloud.vmmigration.v1.ListCloneJobsResponse"
4294 }
4295}
4296
4297#[doc(hidden)]
4298impl google_cloud_gax::paginator::internal::PageableResponse for ListCloneJobsResponse {
4299 type PageItem = crate::model::CloneJob;
4300
4301 fn items(self) -> std::vec::Vec<Self::PageItem> {
4302 self.clone_jobs
4303 }
4304
4305 fn next_page_token(&self) -> std::string::String {
4306 use std::clone::Clone;
4307 self.next_page_token.clone()
4308 }
4309}
4310
4311/// Request message for 'GetCloneJob' request.
4312#[derive(Clone, Default, PartialEq)]
4313#[non_exhaustive]
4314pub struct GetCloneJobRequest {
4315 /// Required. The name of the CloneJob.
4316 pub name: std::string::String,
4317
4318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4319}
4320
4321impl GetCloneJobRequest {
4322 /// Creates a new default instance.
4323 pub fn new() -> Self {
4324 std::default::Default::default()
4325 }
4326
4327 /// Sets the value of [name][crate::model::GetCloneJobRequest::name].
4328 ///
4329 /// # Example
4330 /// ```ignore,no_run
4331 /// # use google_cloud_vmmigration_v1::model::GetCloneJobRequest;
4332 /// # let project_id = "project_id";
4333 /// # let location_id = "location_id";
4334 /// # let source_id = "source_id";
4335 /// # let migrating_vm_id = "migrating_vm_id";
4336 /// # let clone_job_id = "clone_job_id";
4337 /// let x = GetCloneJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/cloneJobs/{clone_job_id}"));
4338 /// ```
4339 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.name = v.into();
4341 self
4342 }
4343}
4344
4345impl wkt::message::Message for GetCloneJobRequest {
4346 fn typename() -> &'static str {
4347 "type.googleapis.com/google.cloud.vmmigration.v1.GetCloneJobRequest"
4348 }
4349}
4350
4351/// Source message describes a specific vm migration Source resource. It contains
4352/// the source environment information.
4353#[derive(Clone, Default, PartialEq)]
4354#[non_exhaustive]
4355pub struct Source {
4356 /// Output only. The Source name.
4357 pub name: std::string::String,
4358
4359 /// Output only. The create time timestamp.
4360 pub create_time: std::option::Option<wkt::Timestamp>,
4361
4362 /// Output only. The update time timestamp.
4363 pub update_time: std::option::Option<wkt::Timestamp>,
4364
4365 /// The labels of the source.
4366 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4367
4368 /// User-provided description of the source.
4369 pub description: std::string::String,
4370
4371 /// Optional. Immutable. The encryption details of the source data stored by
4372 /// the service.
4373 pub encryption: std::option::Option<crate::model::Encryption>,
4374
4375 #[allow(missing_docs)]
4376 pub source_details: std::option::Option<crate::model::source::SourceDetails>,
4377
4378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4379}
4380
4381impl Source {
4382 /// Creates a new default instance.
4383 pub fn new() -> Self {
4384 std::default::Default::default()
4385 }
4386
4387 /// Sets the value of [name][crate::model::Source::name].
4388 ///
4389 /// # Example
4390 /// ```ignore,no_run
4391 /// # use google_cloud_vmmigration_v1::model::Source;
4392 /// # let project_id = "project_id";
4393 /// # let location_id = "location_id";
4394 /// # let source_id = "source_id";
4395 /// let x = Source::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
4396 /// ```
4397 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398 self.name = v.into();
4399 self
4400 }
4401
4402 /// Sets the value of [create_time][crate::model::Source::create_time].
4403 ///
4404 /// # Example
4405 /// ```ignore,no_run
4406 /// # use google_cloud_vmmigration_v1::model::Source;
4407 /// use wkt::Timestamp;
4408 /// let x = Source::new().set_create_time(Timestamp::default()/* use setters */);
4409 /// ```
4410 pub fn set_create_time<T>(mut self, v: T) -> Self
4411 where
4412 T: std::convert::Into<wkt::Timestamp>,
4413 {
4414 self.create_time = std::option::Option::Some(v.into());
4415 self
4416 }
4417
4418 /// Sets or clears the value of [create_time][crate::model::Source::create_time].
4419 ///
4420 /// # Example
4421 /// ```ignore,no_run
4422 /// # use google_cloud_vmmigration_v1::model::Source;
4423 /// use wkt::Timestamp;
4424 /// let x = Source::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4425 /// let x = Source::new().set_or_clear_create_time(None::<Timestamp>);
4426 /// ```
4427 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4428 where
4429 T: std::convert::Into<wkt::Timestamp>,
4430 {
4431 self.create_time = v.map(|x| x.into());
4432 self
4433 }
4434
4435 /// Sets the value of [update_time][crate::model::Source::update_time].
4436 ///
4437 /// # Example
4438 /// ```ignore,no_run
4439 /// # use google_cloud_vmmigration_v1::model::Source;
4440 /// use wkt::Timestamp;
4441 /// let x = Source::new().set_update_time(Timestamp::default()/* use setters */);
4442 /// ```
4443 pub fn set_update_time<T>(mut self, v: T) -> Self
4444 where
4445 T: std::convert::Into<wkt::Timestamp>,
4446 {
4447 self.update_time = std::option::Option::Some(v.into());
4448 self
4449 }
4450
4451 /// Sets or clears the value of [update_time][crate::model::Source::update_time].
4452 ///
4453 /// # Example
4454 /// ```ignore,no_run
4455 /// # use google_cloud_vmmigration_v1::model::Source;
4456 /// use wkt::Timestamp;
4457 /// let x = Source::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4458 /// let x = Source::new().set_or_clear_update_time(None::<Timestamp>);
4459 /// ```
4460 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4461 where
4462 T: std::convert::Into<wkt::Timestamp>,
4463 {
4464 self.update_time = v.map(|x| x.into());
4465 self
4466 }
4467
4468 /// Sets the value of [labels][crate::model::Source::labels].
4469 ///
4470 /// # Example
4471 /// ```ignore,no_run
4472 /// # use google_cloud_vmmigration_v1::model::Source;
4473 /// let x = Source::new().set_labels([
4474 /// ("key0", "abc"),
4475 /// ("key1", "xyz"),
4476 /// ]);
4477 /// ```
4478 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4479 where
4480 T: std::iter::IntoIterator<Item = (K, V)>,
4481 K: std::convert::Into<std::string::String>,
4482 V: std::convert::Into<std::string::String>,
4483 {
4484 use std::iter::Iterator;
4485 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4486 self
4487 }
4488
4489 /// Sets the value of [description][crate::model::Source::description].
4490 ///
4491 /// # Example
4492 /// ```ignore,no_run
4493 /// # use google_cloud_vmmigration_v1::model::Source;
4494 /// let x = Source::new().set_description("example");
4495 /// ```
4496 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4497 self.description = v.into();
4498 self
4499 }
4500
4501 /// Sets the value of [encryption][crate::model::Source::encryption].
4502 ///
4503 /// # Example
4504 /// ```ignore,no_run
4505 /// # use google_cloud_vmmigration_v1::model::Source;
4506 /// use google_cloud_vmmigration_v1::model::Encryption;
4507 /// let x = Source::new().set_encryption(Encryption::default()/* use setters */);
4508 /// ```
4509 pub fn set_encryption<T>(mut self, v: T) -> Self
4510 where
4511 T: std::convert::Into<crate::model::Encryption>,
4512 {
4513 self.encryption = std::option::Option::Some(v.into());
4514 self
4515 }
4516
4517 /// Sets or clears the value of [encryption][crate::model::Source::encryption].
4518 ///
4519 /// # Example
4520 /// ```ignore,no_run
4521 /// # use google_cloud_vmmigration_v1::model::Source;
4522 /// use google_cloud_vmmigration_v1::model::Encryption;
4523 /// let x = Source::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
4524 /// let x = Source::new().set_or_clear_encryption(None::<Encryption>);
4525 /// ```
4526 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
4527 where
4528 T: std::convert::Into<crate::model::Encryption>,
4529 {
4530 self.encryption = v.map(|x| x.into());
4531 self
4532 }
4533
4534 /// Sets the value of [source_details][crate::model::Source::source_details].
4535 ///
4536 /// Note that all the setters affecting `source_details` are mutually
4537 /// exclusive.
4538 ///
4539 /// # Example
4540 /// ```ignore,no_run
4541 /// # use google_cloud_vmmigration_v1::model::Source;
4542 /// use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4543 /// let x = Source::new().set_source_details(Some(
4544 /// google_cloud_vmmigration_v1::model::source::SourceDetails::Vmware(VmwareSourceDetails::default().into())));
4545 /// ```
4546 pub fn set_source_details<
4547 T: std::convert::Into<std::option::Option<crate::model::source::SourceDetails>>,
4548 >(
4549 mut self,
4550 v: T,
4551 ) -> Self {
4552 self.source_details = v.into();
4553 self
4554 }
4555
4556 /// The value of [source_details][crate::model::Source::source_details]
4557 /// if it holds a `Vmware`, `None` if the field is not set or
4558 /// holds a different branch.
4559 pub fn vmware(
4560 &self,
4561 ) -> std::option::Option<&std::boxed::Box<crate::model::VmwareSourceDetails>> {
4562 #[allow(unreachable_patterns)]
4563 self.source_details.as_ref().and_then(|v| match v {
4564 crate::model::source::SourceDetails::Vmware(v) => std::option::Option::Some(v),
4565 _ => std::option::Option::None,
4566 })
4567 }
4568
4569 /// Sets the value of [source_details][crate::model::Source::source_details]
4570 /// to hold a `Vmware`.
4571 ///
4572 /// Note that all the setters affecting `source_details` are
4573 /// mutually exclusive.
4574 ///
4575 /// # Example
4576 /// ```ignore,no_run
4577 /// # use google_cloud_vmmigration_v1::model::Source;
4578 /// use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4579 /// let x = Source::new().set_vmware(VmwareSourceDetails::default()/* use setters */);
4580 /// assert!(x.vmware().is_some());
4581 /// assert!(x.aws().is_none());
4582 /// assert!(x.azure().is_none());
4583 /// ```
4584 pub fn set_vmware<T: std::convert::Into<std::boxed::Box<crate::model::VmwareSourceDetails>>>(
4585 mut self,
4586 v: T,
4587 ) -> Self {
4588 self.source_details =
4589 std::option::Option::Some(crate::model::source::SourceDetails::Vmware(v.into()));
4590 self
4591 }
4592
4593 /// The value of [source_details][crate::model::Source::source_details]
4594 /// if it holds a `Aws`, `None` if the field is not set or
4595 /// holds a different branch.
4596 pub fn aws(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceDetails>> {
4597 #[allow(unreachable_patterns)]
4598 self.source_details.as_ref().and_then(|v| match v {
4599 crate::model::source::SourceDetails::Aws(v) => std::option::Option::Some(v),
4600 _ => std::option::Option::None,
4601 })
4602 }
4603
4604 /// Sets the value of [source_details][crate::model::Source::source_details]
4605 /// to hold a `Aws`.
4606 ///
4607 /// Note that all the setters affecting `source_details` are
4608 /// mutually exclusive.
4609 ///
4610 /// # Example
4611 /// ```ignore,no_run
4612 /// # use google_cloud_vmmigration_v1::model::Source;
4613 /// use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4614 /// let x = Source::new().set_aws(AwsSourceDetails::default()/* use setters */);
4615 /// assert!(x.aws().is_some());
4616 /// assert!(x.vmware().is_none());
4617 /// assert!(x.azure().is_none());
4618 /// ```
4619 pub fn set_aws<T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceDetails>>>(
4620 mut self,
4621 v: T,
4622 ) -> Self {
4623 self.source_details =
4624 std::option::Option::Some(crate::model::source::SourceDetails::Aws(v.into()));
4625 self
4626 }
4627
4628 /// The value of [source_details][crate::model::Source::source_details]
4629 /// if it holds a `Azure`, `None` if the field is not set or
4630 /// holds a different branch.
4631 pub fn azure(&self) -> std::option::Option<&std::boxed::Box<crate::model::AzureSourceDetails>> {
4632 #[allow(unreachable_patterns)]
4633 self.source_details.as_ref().and_then(|v| match v {
4634 crate::model::source::SourceDetails::Azure(v) => std::option::Option::Some(v),
4635 _ => std::option::Option::None,
4636 })
4637 }
4638
4639 /// Sets the value of [source_details][crate::model::Source::source_details]
4640 /// to hold a `Azure`.
4641 ///
4642 /// Note that all the setters affecting `source_details` are
4643 /// mutually exclusive.
4644 ///
4645 /// # Example
4646 /// ```ignore,no_run
4647 /// # use google_cloud_vmmigration_v1::model::Source;
4648 /// use google_cloud_vmmigration_v1::model::AzureSourceDetails;
4649 /// let x = Source::new().set_azure(AzureSourceDetails::default()/* use setters */);
4650 /// assert!(x.azure().is_some());
4651 /// assert!(x.vmware().is_none());
4652 /// assert!(x.aws().is_none());
4653 /// ```
4654 pub fn set_azure<T: std::convert::Into<std::boxed::Box<crate::model::AzureSourceDetails>>>(
4655 mut self,
4656 v: T,
4657 ) -> Self {
4658 self.source_details =
4659 std::option::Option::Some(crate::model::source::SourceDetails::Azure(v.into()));
4660 self
4661 }
4662}
4663
4664impl wkt::message::Message for Source {
4665 fn typename() -> &'static str {
4666 "type.googleapis.com/google.cloud.vmmigration.v1.Source"
4667 }
4668}
4669
4670/// Defines additional types related to [Source].
4671pub mod source {
4672 #[allow(unused_imports)]
4673 use super::*;
4674
4675 #[allow(missing_docs)]
4676 #[derive(Clone, Debug, PartialEq)]
4677 #[non_exhaustive]
4678 pub enum SourceDetails {
4679 /// Vmware type source details.
4680 Vmware(std::boxed::Box<crate::model::VmwareSourceDetails>),
4681 /// AWS type source details.
4682 Aws(std::boxed::Box<crate::model::AwsSourceDetails>),
4683 /// Azure type source details.
4684 Azure(std::boxed::Box<crate::model::AzureSourceDetails>),
4685 }
4686}
4687
4688/// Encryption message describes the details of the applied encryption.
4689#[derive(Clone, Default, PartialEq)]
4690#[non_exhaustive]
4691pub struct Encryption {
4692 /// Required. The name of the encryption key that is stored in Google Cloud
4693 /// KMS.
4694 pub kms_key: std::string::String,
4695
4696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4697}
4698
4699impl Encryption {
4700 /// Creates a new default instance.
4701 pub fn new() -> Self {
4702 std::default::Default::default()
4703 }
4704
4705 /// Sets the value of [kms_key][crate::model::Encryption::kms_key].
4706 ///
4707 /// # Example
4708 /// ```ignore,no_run
4709 /// # use google_cloud_vmmigration_v1::model::Encryption;
4710 /// let x = Encryption::new().set_kms_key("example");
4711 /// ```
4712 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4713 self.kms_key = v.into();
4714 self
4715 }
4716}
4717
4718impl wkt::message::Message for Encryption {
4719 fn typename() -> &'static str {
4720 "type.googleapis.com/google.cloud.vmmigration.v1.Encryption"
4721 }
4722}
4723
4724/// VmwareSourceDetails message describes a specific source details for the
4725/// vmware source type.
4726#[derive(Clone, Default, PartialEq)]
4727#[non_exhaustive]
4728pub struct VmwareSourceDetails {
4729 /// The credentials username.
4730 pub username: std::string::String,
4731
4732 /// Input only. The credentials password. This is write only and can not be
4733 /// read in a GET operation.
4734 pub password: std::string::String,
4735
4736 /// The ip address of the vcenter this Source represents.
4737 pub vcenter_ip: std::string::String,
4738
4739 /// The thumbprint representing the certificate for the vcenter.
4740 pub thumbprint: std::string::String,
4741
4742 /// The hostname of the vcenter.
4743 pub resolved_vcenter_host: std::string::String,
4744
4745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4746}
4747
4748impl VmwareSourceDetails {
4749 /// Creates a new default instance.
4750 pub fn new() -> Self {
4751 std::default::Default::default()
4752 }
4753
4754 /// Sets the value of [username][crate::model::VmwareSourceDetails::username].
4755 ///
4756 /// # Example
4757 /// ```ignore,no_run
4758 /// # use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4759 /// let x = VmwareSourceDetails::new().set_username("example");
4760 /// ```
4761 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4762 self.username = v.into();
4763 self
4764 }
4765
4766 /// Sets the value of [password][crate::model::VmwareSourceDetails::password].
4767 ///
4768 /// # Example
4769 /// ```ignore,no_run
4770 /// # use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4771 /// let x = VmwareSourceDetails::new().set_password("example");
4772 /// ```
4773 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4774 self.password = v.into();
4775 self
4776 }
4777
4778 /// Sets the value of [vcenter_ip][crate::model::VmwareSourceDetails::vcenter_ip].
4779 ///
4780 /// # Example
4781 /// ```ignore,no_run
4782 /// # use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4783 /// let x = VmwareSourceDetails::new().set_vcenter_ip("example");
4784 /// ```
4785 pub fn set_vcenter_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786 self.vcenter_ip = v.into();
4787 self
4788 }
4789
4790 /// Sets the value of [thumbprint][crate::model::VmwareSourceDetails::thumbprint].
4791 ///
4792 /// # Example
4793 /// ```ignore,no_run
4794 /// # use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4795 /// let x = VmwareSourceDetails::new().set_thumbprint("example");
4796 /// ```
4797 pub fn set_thumbprint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4798 self.thumbprint = v.into();
4799 self
4800 }
4801
4802 /// Sets the value of [resolved_vcenter_host][crate::model::VmwareSourceDetails::resolved_vcenter_host].
4803 ///
4804 /// # Example
4805 /// ```ignore,no_run
4806 /// # use google_cloud_vmmigration_v1::model::VmwareSourceDetails;
4807 /// let x = VmwareSourceDetails::new().set_resolved_vcenter_host("example");
4808 /// ```
4809 pub fn set_resolved_vcenter_host<T: std::convert::Into<std::string::String>>(
4810 mut self,
4811 v: T,
4812 ) -> Self {
4813 self.resolved_vcenter_host = v.into();
4814 self
4815 }
4816}
4817
4818impl wkt::message::Message for VmwareSourceDetails {
4819 fn typename() -> &'static str {
4820 "type.googleapis.com/google.cloud.vmmigration.v1.VmwareSourceDetails"
4821 }
4822}
4823
4824/// AwsSourceDetails message describes a specific source details for the
4825/// AWS source type.
4826#[derive(Clone, Default, PartialEq)]
4827#[non_exhaustive]
4828pub struct AwsSourceDetails {
4829 /// Immutable. The AWS region that the source VMs will be migrated from.
4830 pub aws_region: std::string::String,
4831
4832 /// Output only. State of the source as determined by the health check.
4833 pub state: crate::model::aws_source_details::State,
4834
4835 /// Output only. Provides details on the state of the Source in case of an
4836 /// error.
4837 pub error: std::option::Option<google_cloud_rpc::model::Status>,
4838
4839 /// AWS resource tags to limit the scope of the source inventory.
4840 pub inventory_tag_list: std::vec::Vec<crate::model::aws_source_details::Tag>,
4841
4842 /// AWS security group names to limit the scope of the source
4843 /// inventory.
4844 pub inventory_security_group_names: std::vec::Vec<std::string::String>,
4845
4846 /// User specified tags to add to every M2VM generated resource in AWS.
4847 /// These tags will be set in addition to the default tags that are set as part
4848 /// of the migration process. The tags must not begin with the reserved prefix
4849 /// `m2vm`.
4850 pub migration_resources_user_tags:
4851 std::collections::HashMap<std::string::String, std::string::String>,
4852
4853 /// Output only. The source's public IP. All communication initiated by this
4854 /// source will originate from this IP.
4855 pub public_ip: std::string::String,
4856
4857 #[allow(missing_docs)]
4858 pub credentials_type: std::option::Option<crate::model::aws_source_details::CredentialsType>,
4859
4860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4861}
4862
4863impl AwsSourceDetails {
4864 /// Creates a new default instance.
4865 pub fn new() -> Self {
4866 std::default::Default::default()
4867 }
4868
4869 /// Sets the value of [aws_region][crate::model::AwsSourceDetails::aws_region].
4870 ///
4871 /// # Example
4872 /// ```ignore,no_run
4873 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4874 /// let x = AwsSourceDetails::new().set_aws_region("example");
4875 /// ```
4876 pub fn set_aws_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4877 self.aws_region = v.into();
4878 self
4879 }
4880
4881 /// Sets the value of [state][crate::model::AwsSourceDetails::state].
4882 ///
4883 /// # Example
4884 /// ```ignore,no_run
4885 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4886 /// use google_cloud_vmmigration_v1::model::aws_source_details::State;
4887 /// let x0 = AwsSourceDetails::new().set_state(State::Pending);
4888 /// let x1 = AwsSourceDetails::new().set_state(State::Failed);
4889 /// let x2 = AwsSourceDetails::new().set_state(State::Active);
4890 /// ```
4891 pub fn set_state<T: std::convert::Into<crate::model::aws_source_details::State>>(
4892 mut self,
4893 v: T,
4894 ) -> Self {
4895 self.state = v.into();
4896 self
4897 }
4898
4899 /// Sets the value of [error][crate::model::AwsSourceDetails::error].
4900 ///
4901 /// # Example
4902 /// ```ignore,no_run
4903 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4904 /// use google_cloud_rpc::model::Status;
4905 /// let x = AwsSourceDetails::new().set_error(Status::default()/* use setters */);
4906 /// ```
4907 pub fn set_error<T>(mut self, v: T) -> Self
4908 where
4909 T: std::convert::Into<google_cloud_rpc::model::Status>,
4910 {
4911 self.error = std::option::Option::Some(v.into());
4912 self
4913 }
4914
4915 /// Sets or clears the value of [error][crate::model::AwsSourceDetails::error].
4916 ///
4917 /// # Example
4918 /// ```ignore,no_run
4919 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4920 /// use google_cloud_rpc::model::Status;
4921 /// let x = AwsSourceDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
4922 /// let x = AwsSourceDetails::new().set_or_clear_error(None::<Status>);
4923 /// ```
4924 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4925 where
4926 T: std::convert::Into<google_cloud_rpc::model::Status>,
4927 {
4928 self.error = v.map(|x| x.into());
4929 self
4930 }
4931
4932 /// Sets the value of [inventory_tag_list][crate::model::AwsSourceDetails::inventory_tag_list].
4933 ///
4934 /// # Example
4935 /// ```ignore,no_run
4936 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4937 /// use google_cloud_vmmigration_v1::model::aws_source_details::Tag;
4938 /// let x = AwsSourceDetails::new()
4939 /// .set_inventory_tag_list([
4940 /// Tag::default()/* use setters */,
4941 /// Tag::default()/* use (different) setters */,
4942 /// ]);
4943 /// ```
4944 pub fn set_inventory_tag_list<T, V>(mut self, v: T) -> Self
4945 where
4946 T: std::iter::IntoIterator<Item = V>,
4947 V: std::convert::Into<crate::model::aws_source_details::Tag>,
4948 {
4949 use std::iter::Iterator;
4950 self.inventory_tag_list = v.into_iter().map(|i| i.into()).collect();
4951 self
4952 }
4953
4954 /// Sets the value of [inventory_security_group_names][crate::model::AwsSourceDetails::inventory_security_group_names].
4955 ///
4956 /// # Example
4957 /// ```ignore,no_run
4958 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4959 /// let x = AwsSourceDetails::new().set_inventory_security_group_names(["a", "b", "c"]);
4960 /// ```
4961 pub fn set_inventory_security_group_names<T, V>(mut self, v: T) -> Self
4962 where
4963 T: std::iter::IntoIterator<Item = V>,
4964 V: std::convert::Into<std::string::String>,
4965 {
4966 use std::iter::Iterator;
4967 self.inventory_security_group_names = v.into_iter().map(|i| i.into()).collect();
4968 self
4969 }
4970
4971 /// Sets the value of [migration_resources_user_tags][crate::model::AwsSourceDetails::migration_resources_user_tags].
4972 ///
4973 /// # Example
4974 /// ```ignore,no_run
4975 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4976 /// let x = AwsSourceDetails::new().set_migration_resources_user_tags([
4977 /// ("key0", "abc"),
4978 /// ("key1", "xyz"),
4979 /// ]);
4980 /// ```
4981 pub fn set_migration_resources_user_tags<T, K, V>(mut self, v: T) -> Self
4982 where
4983 T: std::iter::IntoIterator<Item = (K, V)>,
4984 K: std::convert::Into<std::string::String>,
4985 V: std::convert::Into<std::string::String>,
4986 {
4987 use std::iter::Iterator;
4988 self.migration_resources_user_tags =
4989 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4990 self
4991 }
4992
4993 /// Sets the value of [public_ip][crate::model::AwsSourceDetails::public_ip].
4994 ///
4995 /// # Example
4996 /// ```ignore,no_run
4997 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
4998 /// let x = AwsSourceDetails::new().set_public_ip("example");
4999 /// ```
5000 pub fn set_public_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.public_ip = v.into();
5002 self
5003 }
5004
5005 /// Sets the value of [credentials_type][crate::model::AwsSourceDetails::credentials_type].
5006 ///
5007 /// Note that all the setters affecting `credentials_type` are mutually
5008 /// exclusive.
5009 ///
5010 /// # Example
5011 /// ```ignore,no_run
5012 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
5013 /// use google_cloud_vmmigration_v1::model::aws_source_details::AccessKeyCredentials;
5014 /// let x = AwsSourceDetails::new().set_credentials_type(Some(
5015 /// google_cloud_vmmigration_v1::model::aws_source_details::CredentialsType::AccessKeyCreds(AccessKeyCredentials::default().into())));
5016 /// ```
5017 pub fn set_credentials_type<
5018 T: std::convert::Into<std::option::Option<crate::model::aws_source_details::CredentialsType>>,
5019 >(
5020 mut self,
5021 v: T,
5022 ) -> Self {
5023 self.credentials_type = v.into();
5024 self
5025 }
5026
5027 /// The value of [credentials_type][crate::model::AwsSourceDetails::credentials_type]
5028 /// if it holds a `AccessKeyCreds`, `None` if the field is not set or
5029 /// holds a different branch.
5030 pub fn access_key_creds(
5031 &self,
5032 ) -> std::option::Option<&std::boxed::Box<crate::model::aws_source_details::AccessKeyCredentials>>
5033 {
5034 #[allow(unreachable_patterns)]
5035 self.credentials_type.as_ref().and_then(|v| match v {
5036 crate::model::aws_source_details::CredentialsType::AccessKeyCreds(v) => {
5037 std::option::Option::Some(v)
5038 }
5039 _ => std::option::Option::None,
5040 })
5041 }
5042
5043 /// Sets the value of [credentials_type][crate::model::AwsSourceDetails::credentials_type]
5044 /// to hold a `AccessKeyCreds`.
5045 ///
5046 /// Note that all the setters affecting `credentials_type` are
5047 /// mutually exclusive.
5048 ///
5049 /// # Example
5050 /// ```ignore,no_run
5051 /// # use google_cloud_vmmigration_v1::model::AwsSourceDetails;
5052 /// use google_cloud_vmmigration_v1::model::aws_source_details::AccessKeyCredentials;
5053 /// let x = AwsSourceDetails::new().set_access_key_creds(AccessKeyCredentials::default()/* use setters */);
5054 /// assert!(x.access_key_creds().is_some());
5055 /// ```
5056 pub fn set_access_key_creds<
5057 T: std::convert::Into<std::boxed::Box<crate::model::aws_source_details::AccessKeyCredentials>>,
5058 >(
5059 mut self,
5060 v: T,
5061 ) -> Self {
5062 self.credentials_type = std::option::Option::Some(
5063 crate::model::aws_source_details::CredentialsType::AccessKeyCreds(v.into()),
5064 );
5065 self
5066 }
5067}
5068
5069impl wkt::message::Message for AwsSourceDetails {
5070 fn typename() -> &'static str {
5071 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDetails"
5072 }
5073}
5074
5075/// Defines additional types related to [AwsSourceDetails].
5076pub mod aws_source_details {
5077 #[allow(unused_imports)]
5078 use super::*;
5079
5080 /// Message describing AWS Credentials using access key id and secret.
5081 #[derive(Clone, Default, PartialEq)]
5082 #[non_exhaustive]
5083 pub struct AccessKeyCredentials {
5084 /// AWS access key ID.
5085 pub access_key_id: std::string::String,
5086
5087 /// Input only. AWS secret access key.
5088 pub secret_access_key: std::string::String,
5089
5090 /// Input only. AWS session token.
5091 /// Used only when AWS security token service (STS) is responsible for
5092 /// creating the temporary credentials.
5093 pub session_token: std::string::String,
5094
5095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5096 }
5097
5098 impl AccessKeyCredentials {
5099 /// Creates a new default instance.
5100 pub fn new() -> Self {
5101 std::default::Default::default()
5102 }
5103
5104 /// Sets the value of [access_key_id][crate::model::aws_source_details::AccessKeyCredentials::access_key_id].
5105 ///
5106 /// # Example
5107 /// ```ignore,no_run
5108 /// # use google_cloud_vmmigration_v1::model::aws_source_details::AccessKeyCredentials;
5109 /// let x = AccessKeyCredentials::new().set_access_key_id("example");
5110 /// ```
5111 pub fn set_access_key_id<T: std::convert::Into<std::string::String>>(
5112 mut self,
5113 v: T,
5114 ) -> Self {
5115 self.access_key_id = v.into();
5116 self
5117 }
5118
5119 /// Sets the value of [secret_access_key][crate::model::aws_source_details::AccessKeyCredentials::secret_access_key].
5120 ///
5121 /// # Example
5122 /// ```ignore,no_run
5123 /// # use google_cloud_vmmigration_v1::model::aws_source_details::AccessKeyCredentials;
5124 /// let x = AccessKeyCredentials::new().set_secret_access_key("example");
5125 /// ```
5126 pub fn set_secret_access_key<T: std::convert::Into<std::string::String>>(
5127 mut self,
5128 v: T,
5129 ) -> Self {
5130 self.secret_access_key = v.into();
5131 self
5132 }
5133
5134 /// Sets the value of [session_token][crate::model::aws_source_details::AccessKeyCredentials::session_token].
5135 ///
5136 /// # Example
5137 /// ```ignore,no_run
5138 /// # use google_cloud_vmmigration_v1::model::aws_source_details::AccessKeyCredentials;
5139 /// let x = AccessKeyCredentials::new().set_session_token("example");
5140 /// ```
5141 pub fn set_session_token<T: std::convert::Into<std::string::String>>(
5142 mut self,
5143 v: T,
5144 ) -> Self {
5145 self.session_token = v.into();
5146 self
5147 }
5148 }
5149
5150 impl wkt::message::Message for AccessKeyCredentials {
5151 fn typename() -> &'static str {
5152 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDetails.AccessKeyCredentials"
5153 }
5154 }
5155
5156 /// Tag is an AWS tag representation.
5157 #[derive(Clone, Default, PartialEq)]
5158 #[non_exhaustive]
5159 pub struct Tag {
5160 /// Required. Key of tag.
5161 pub key: std::string::String,
5162
5163 /// Required. Value of tag.
5164 pub value: std::string::String,
5165
5166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5167 }
5168
5169 impl Tag {
5170 /// Creates a new default instance.
5171 pub fn new() -> Self {
5172 std::default::Default::default()
5173 }
5174
5175 /// Sets the value of [key][crate::model::aws_source_details::Tag::key].
5176 ///
5177 /// # Example
5178 /// ```ignore,no_run
5179 /// # use google_cloud_vmmigration_v1::model::aws_source_details::Tag;
5180 /// let x = Tag::new().set_key("example");
5181 /// ```
5182 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5183 self.key = v.into();
5184 self
5185 }
5186
5187 /// Sets the value of [value][crate::model::aws_source_details::Tag::value].
5188 ///
5189 /// # Example
5190 /// ```ignore,no_run
5191 /// # use google_cloud_vmmigration_v1::model::aws_source_details::Tag;
5192 /// let x = Tag::new().set_value("example");
5193 /// ```
5194 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5195 self.value = v.into();
5196 self
5197 }
5198 }
5199
5200 impl wkt::message::Message for Tag {
5201 fn typename() -> &'static str {
5202 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDetails.Tag"
5203 }
5204 }
5205
5206 /// The possible values of the state.
5207 ///
5208 /// # Working with unknown values
5209 ///
5210 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5211 /// additional enum variants at any time. Adding new variants is not considered
5212 /// a breaking change. Applications should write their code in anticipation of:
5213 ///
5214 /// - New values appearing in future releases of the client library, **and**
5215 /// - New values received dynamically, without application changes.
5216 ///
5217 /// Please consult the [Working with enums] section in the user guide for some
5218 /// guidelines.
5219 ///
5220 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5221 #[derive(Clone, Debug, PartialEq)]
5222 #[non_exhaustive]
5223 pub enum State {
5224 /// The state is unknown. This is used for API compatibility only and is not
5225 /// used by the system.
5226 Unspecified,
5227 /// The state was not sampled by the health checks yet.
5228 Pending,
5229 /// The source is available but might not be usable yet due to invalid
5230 /// credentials or another reason.
5231 /// The error message will contain further details.
5232 Failed,
5233 /// The source exists and its credentials were verified.
5234 Active,
5235 /// If set, the enum was initialized with an unknown value.
5236 ///
5237 /// Applications can examine the value using [State::value] or
5238 /// [State::name].
5239 UnknownValue(state::UnknownValue),
5240 }
5241
5242 #[doc(hidden)]
5243 pub mod state {
5244 #[allow(unused_imports)]
5245 use super::*;
5246 #[derive(Clone, Debug, PartialEq)]
5247 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5248 }
5249
5250 impl State {
5251 /// Gets the enum value.
5252 ///
5253 /// Returns `None` if the enum contains an unknown value deserialized from
5254 /// the string representation of enums.
5255 pub fn value(&self) -> std::option::Option<i32> {
5256 match self {
5257 Self::Unspecified => std::option::Option::Some(0),
5258 Self::Pending => std::option::Option::Some(1),
5259 Self::Failed => std::option::Option::Some(2),
5260 Self::Active => std::option::Option::Some(3),
5261 Self::UnknownValue(u) => u.0.value(),
5262 }
5263 }
5264
5265 /// Gets the enum value as a string.
5266 ///
5267 /// Returns `None` if the enum contains an unknown value deserialized from
5268 /// the integer representation of enums.
5269 pub fn name(&self) -> std::option::Option<&str> {
5270 match self {
5271 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5272 Self::Pending => std::option::Option::Some("PENDING"),
5273 Self::Failed => std::option::Option::Some("FAILED"),
5274 Self::Active => std::option::Option::Some("ACTIVE"),
5275 Self::UnknownValue(u) => u.0.name(),
5276 }
5277 }
5278 }
5279
5280 impl std::default::Default for State {
5281 fn default() -> Self {
5282 use std::convert::From;
5283 Self::from(0)
5284 }
5285 }
5286
5287 impl std::fmt::Display for State {
5288 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5289 wkt::internal::display_enum(f, self.name(), self.value())
5290 }
5291 }
5292
5293 impl std::convert::From<i32> for State {
5294 fn from(value: i32) -> Self {
5295 match value {
5296 0 => Self::Unspecified,
5297 1 => Self::Pending,
5298 2 => Self::Failed,
5299 3 => Self::Active,
5300 _ => Self::UnknownValue(state::UnknownValue(
5301 wkt::internal::UnknownEnumValue::Integer(value),
5302 )),
5303 }
5304 }
5305 }
5306
5307 impl std::convert::From<&str> for State {
5308 fn from(value: &str) -> Self {
5309 use std::string::ToString;
5310 match value {
5311 "STATE_UNSPECIFIED" => Self::Unspecified,
5312 "PENDING" => Self::Pending,
5313 "FAILED" => Self::Failed,
5314 "ACTIVE" => Self::Active,
5315 _ => Self::UnknownValue(state::UnknownValue(
5316 wkt::internal::UnknownEnumValue::String(value.to_string()),
5317 )),
5318 }
5319 }
5320 }
5321
5322 impl serde::ser::Serialize for State {
5323 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5324 where
5325 S: serde::Serializer,
5326 {
5327 match self {
5328 Self::Unspecified => serializer.serialize_i32(0),
5329 Self::Pending => serializer.serialize_i32(1),
5330 Self::Failed => serializer.serialize_i32(2),
5331 Self::Active => serializer.serialize_i32(3),
5332 Self::UnknownValue(u) => u.0.serialize(serializer),
5333 }
5334 }
5335 }
5336
5337 impl<'de> serde::de::Deserialize<'de> for State {
5338 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5339 where
5340 D: serde::Deserializer<'de>,
5341 {
5342 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5343 ".google.cloud.vmmigration.v1.AwsSourceDetails.State",
5344 ))
5345 }
5346 }
5347
5348 #[allow(missing_docs)]
5349 #[derive(Clone, Debug, PartialEq)]
5350 #[non_exhaustive]
5351 pub enum CredentialsType {
5352 /// AWS Credentials using access key id and secret.
5353 AccessKeyCreds(std::boxed::Box<crate::model::aws_source_details::AccessKeyCredentials>),
5354 }
5355}
5356
5357/// AzureSourceDetails message describes a specific source details for the
5358/// Azure source type.
5359#[derive(Clone, Default, PartialEq)]
5360#[non_exhaustive]
5361pub struct AzureSourceDetails {
5362 /// Immutable. Azure subscription ID.
5363 pub subscription_id: std::string::String,
5364
5365 /// Immutable. The Azure location (region) that the source VMs will be migrated
5366 /// from.
5367 pub azure_location: std::string::String,
5368
5369 /// Output only. State of the source as determined by the health check.
5370 pub state: crate::model::azure_source_details::State,
5371
5372 /// Output only. Provides details on the state of the Source in case of an
5373 /// error.
5374 pub error: std::option::Option<google_cloud_rpc::model::Status>,
5375
5376 /// User specified tags to add to every M2VM generated resource in Azure.
5377 /// These tags will be set in addition to the default tags that are set as part
5378 /// of the migration process. The tags must not begin with the reserved prefix
5379 /// `m4ce` or `m2vm`.
5380 pub migration_resources_user_tags:
5381 std::collections::HashMap<std::string::String, std::string::String>,
5382
5383 /// Output only. The ID of the Azure resource group that contains all resources
5384 /// related to the migration process of this source.
5385 pub resource_group_id: std::string::String,
5386
5387 #[allow(missing_docs)]
5388 pub credentials_type: std::option::Option<crate::model::azure_source_details::CredentialsType>,
5389
5390 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5391}
5392
5393impl AzureSourceDetails {
5394 /// Creates a new default instance.
5395 pub fn new() -> Self {
5396 std::default::Default::default()
5397 }
5398
5399 /// Sets the value of [subscription_id][crate::model::AzureSourceDetails::subscription_id].
5400 ///
5401 /// # Example
5402 /// ```ignore,no_run
5403 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5404 /// let x = AzureSourceDetails::new().set_subscription_id("example");
5405 /// ```
5406 pub fn set_subscription_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5407 self.subscription_id = v.into();
5408 self
5409 }
5410
5411 /// Sets the value of [azure_location][crate::model::AzureSourceDetails::azure_location].
5412 ///
5413 /// # Example
5414 /// ```ignore,no_run
5415 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5416 /// let x = AzureSourceDetails::new().set_azure_location("example");
5417 /// ```
5418 pub fn set_azure_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5419 self.azure_location = v.into();
5420 self
5421 }
5422
5423 /// Sets the value of [state][crate::model::AzureSourceDetails::state].
5424 ///
5425 /// # Example
5426 /// ```ignore,no_run
5427 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5428 /// use google_cloud_vmmigration_v1::model::azure_source_details::State;
5429 /// let x0 = AzureSourceDetails::new().set_state(State::Pending);
5430 /// let x1 = AzureSourceDetails::new().set_state(State::Failed);
5431 /// let x2 = AzureSourceDetails::new().set_state(State::Active);
5432 /// ```
5433 pub fn set_state<T: std::convert::Into<crate::model::azure_source_details::State>>(
5434 mut self,
5435 v: T,
5436 ) -> Self {
5437 self.state = v.into();
5438 self
5439 }
5440
5441 /// Sets the value of [error][crate::model::AzureSourceDetails::error].
5442 ///
5443 /// # Example
5444 /// ```ignore,no_run
5445 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5446 /// use google_cloud_rpc::model::Status;
5447 /// let x = AzureSourceDetails::new().set_error(Status::default()/* use setters */);
5448 /// ```
5449 pub fn set_error<T>(mut self, v: T) -> Self
5450 where
5451 T: std::convert::Into<google_cloud_rpc::model::Status>,
5452 {
5453 self.error = std::option::Option::Some(v.into());
5454 self
5455 }
5456
5457 /// Sets or clears the value of [error][crate::model::AzureSourceDetails::error].
5458 ///
5459 /// # Example
5460 /// ```ignore,no_run
5461 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5462 /// use google_cloud_rpc::model::Status;
5463 /// let x = AzureSourceDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
5464 /// let x = AzureSourceDetails::new().set_or_clear_error(None::<Status>);
5465 /// ```
5466 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
5467 where
5468 T: std::convert::Into<google_cloud_rpc::model::Status>,
5469 {
5470 self.error = v.map(|x| x.into());
5471 self
5472 }
5473
5474 /// Sets the value of [migration_resources_user_tags][crate::model::AzureSourceDetails::migration_resources_user_tags].
5475 ///
5476 /// # Example
5477 /// ```ignore,no_run
5478 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5479 /// let x = AzureSourceDetails::new().set_migration_resources_user_tags([
5480 /// ("key0", "abc"),
5481 /// ("key1", "xyz"),
5482 /// ]);
5483 /// ```
5484 pub fn set_migration_resources_user_tags<T, K, V>(mut self, v: T) -> Self
5485 where
5486 T: std::iter::IntoIterator<Item = (K, V)>,
5487 K: std::convert::Into<std::string::String>,
5488 V: std::convert::Into<std::string::String>,
5489 {
5490 use std::iter::Iterator;
5491 self.migration_resources_user_tags =
5492 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5493 self
5494 }
5495
5496 /// Sets the value of [resource_group_id][crate::model::AzureSourceDetails::resource_group_id].
5497 ///
5498 /// # Example
5499 /// ```ignore,no_run
5500 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5501 /// let x = AzureSourceDetails::new().set_resource_group_id("example");
5502 /// ```
5503 pub fn set_resource_group_id<T: std::convert::Into<std::string::String>>(
5504 mut self,
5505 v: T,
5506 ) -> Self {
5507 self.resource_group_id = v.into();
5508 self
5509 }
5510
5511 /// Sets the value of [credentials_type][crate::model::AzureSourceDetails::credentials_type].
5512 ///
5513 /// Note that all the setters affecting `credentials_type` are mutually
5514 /// exclusive.
5515 ///
5516 /// # Example
5517 /// ```ignore,no_run
5518 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5519 /// use google_cloud_vmmigration_v1::model::azure_source_details::ClientSecretCredentials;
5520 /// let x = AzureSourceDetails::new().set_credentials_type(Some(
5521 /// google_cloud_vmmigration_v1::model::azure_source_details::CredentialsType::ClientSecretCreds(ClientSecretCredentials::default().into())));
5522 /// ```
5523 pub fn set_credentials_type<
5524 T: std::convert::Into<
5525 std::option::Option<crate::model::azure_source_details::CredentialsType>,
5526 >,
5527 >(
5528 mut self,
5529 v: T,
5530 ) -> Self {
5531 self.credentials_type = v.into();
5532 self
5533 }
5534
5535 /// The value of [credentials_type][crate::model::AzureSourceDetails::credentials_type]
5536 /// if it holds a `ClientSecretCreds`, `None` if the field is not set or
5537 /// holds a different branch.
5538 pub fn client_secret_creds(
5539 &self,
5540 ) -> std::option::Option<
5541 &std::boxed::Box<crate::model::azure_source_details::ClientSecretCredentials>,
5542 > {
5543 #[allow(unreachable_patterns)]
5544 self.credentials_type.as_ref().and_then(|v| match v {
5545 crate::model::azure_source_details::CredentialsType::ClientSecretCreds(v) => {
5546 std::option::Option::Some(v)
5547 }
5548 _ => std::option::Option::None,
5549 })
5550 }
5551
5552 /// Sets the value of [credentials_type][crate::model::AzureSourceDetails::credentials_type]
5553 /// to hold a `ClientSecretCreds`.
5554 ///
5555 /// Note that all the setters affecting `credentials_type` are
5556 /// mutually exclusive.
5557 ///
5558 /// # Example
5559 /// ```ignore,no_run
5560 /// # use google_cloud_vmmigration_v1::model::AzureSourceDetails;
5561 /// use google_cloud_vmmigration_v1::model::azure_source_details::ClientSecretCredentials;
5562 /// let x = AzureSourceDetails::new().set_client_secret_creds(ClientSecretCredentials::default()/* use setters */);
5563 /// assert!(x.client_secret_creds().is_some());
5564 /// ```
5565 pub fn set_client_secret_creds<
5566 T: std::convert::Into<
5567 std::boxed::Box<crate::model::azure_source_details::ClientSecretCredentials>,
5568 >,
5569 >(
5570 mut self,
5571 v: T,
5572 ) -> Self {
5573 self.credentials_type = std::option::Option::Some(
5574 crate::model::azure_source_details::CredentialsType::ClientSecretCreds(v.into()),
5575 );
5576 self
5577 }
5578}
5579
5580impl wkt::message::Message for AzureSourceDetails {
5581 fn typename() -> &'static str {
5582 "type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceDetails"
5583 }
5584}
5585
5586/// Defines additional types related to [AzureSourceDetails].
5587pub mod azure_source_details {
5588 #[allow(unused_imports)]
5589 use super::*;
5590
5591 /// Message describing Azure Credentials using tenant ID, client ID and secret.
5592 #[derive(Clone, Default, PartialEq)]
5593 #[non_exhaustive]
5594 pub struct ClientSecretCredentials {
5595 /// Azure tenant ID.
5596 pub tenant_id: std::string::String,
5597
5598 /// Azure client ID.
5599 pub client_id: std::string::String,
5600
5601 /// Input only. Azure client secret.
5602 pub client_secret: std::string::String,
5603
5604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5605 }
5606
5607 impl ClientSecretCredentials {
5608 /// Creates a new default instance.
5609 pub fn new() -> Self {
5610 std::default::Default::default()
5611 }
5612
5613 /// Sets the value of [tenant_id][crate::model::azure_source_details::ClientSecretCredentials::tenant_id].
5614 ///
5615 /// # Example
5616 /// ```ignore,no_run
5617 /// # use google_cloud_vmmigration_v1::model::azure_source_details::ClientSecretCredentials;
5618 /// let x = ClientSecretCredentials::new().set_tenant_id("example");
5619 /// ```
5620 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5621 self.tenant_id = v.into();
5622 self
5623 }
5624
5625 /// Sets the value of [client_id][crate::model::azure_source_details::ClientSecretCredentials::client_id].
5626 ///
5627 /// # Example
5628 /// ```ignore,no_run
5629 /// # use google_cloud_vmmigration_v1::model::azure_source_details::ClientSecretCredentials;
5630 /// let x = ClientSecretCredentials::new().set_client_id("example");
5631 /// ```
5632 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5633 self.client_id = v.into();
5634 self
5635 }
5636
5637 /// Sets the value of [client_secret][crate::model::azure_source_details::ClientSecretCredentials::client_secret].
5638 ///
5639 /// # Example
5640 /// ```ignore,no_run
5641 /// # use google_cloud_vmmigration_v1::model::azure_source_details::ClientSecretCredentials;
5642 /// let x = ClientSecretCredentials::new().set_client_secret("example");
5643 /// ```
5644 pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
5645 mut self,
5646 v: T,
5647 ) -> Self {
5648 self.client_secret = v.into();
5649 self
5650 }
5651 }
5652
5653 impl wkt::message::Message for ClientSecretCredentials {
5654 fn typename() -> &'static str {
5655 "type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentials"
5656 }
5657 }
5658
5659 /// The possible values of the state.
5660 ///
5661 /// # Working with unknown values
5662 ///
5663 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5664 /// additional enum variants at any time. Adding new variants is not considered
5665 /// a breaking change. Applications should write their code in anticipation of:
5666 ///
5667 /// - New values appearing in future releases of the client library, **and**
5668 /// - New values received dynamically, without application changes.
5669 ///
5670 /// Please consult the [Working with enums] section in the user guide for some
5671 /// guidelines.
5672 ///
5673 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5674 #[derive(Clone, Debug, PartialEq)]
5675 #[non_exhaustive]
5676 pub enum State {
5677 /// The state is unknown. This is used for API compatibility only and is not
5678 /// used by the system.
5679 Unspecified,
5680 /// The state was not sampled by the health checks yet.
5681 Pending,
5682 /// The source is available but might not be usable yet due to invalid
5683 /// credentials or another reason.
5684 /// The error message will contain further details.
5685 Failed,
5686 /// The source exists and its credentials were verified.
5687 Active,
5688 /// If set, the enum was initialized with an unknown value.
5689 ///
5690 /// Applications can examine the value using [State::value] or
5691 /// [State::name].
5692 UnknownValue(state::UnknownValue),
5693 }
5694
5695 #[doc(hidden)]
5696 pub mod state {
5697 #[allow(unused_imports)]
5698 use super::*;
5699 #[derive(Clone, Debug, PartialEq)]
5700 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5701 }
5702
5703 impl State {
5704 /// Gets the enum value.
5705 ///
5706 /// Returns `None` if the enum contains an unknown value deserialized from
5707 /// the string representation of enums.
5708 pub fn value(&self) -> std::option::Option<i32> {
5709 match self {
5710 Self::Unspecified => std::option::Option::Some(0),
5711 Self::Pending => std::option::Option::Some(1),
5712 Self::Failed => std::option::Option::Some(2),
5713 Self::Active => std::option::Option::Some(3),
5714 Self::UnknownValue(u) => u.0.value(),
5715 }
5716 }
5717
5718 /// Gets the enum value as a string.
5719 ///
5720 /// Returns `None` if the enum contains an unknown value deserialized from
5721 /// the integer representation of enums.
5722 pub fn name(&self) -> std::option::Option<&str> {
5723 match self {
5724 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5725 Self::Pending => std::option::Option::Some("PENDING"),
5726 Self::Failed => std::option::Option::Some("FAILED"),
5727 Self::Active => std::option::Option::Some("ACTIVE"),
5728 Self::UnknownValue(u) => u.0.name(),
5729 }
5730 }
5731 }
5732
5733 impl std::default::Default for State {
5734 fn default() -> Self {
5735 use std::convert::From;
5736 Self::from(0)
5737 }
5738 }
5739
5740 impl std::fmt::Display for State {
5741 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5742 wkt::internal::display_enum(f, self.name(), self.value())
5743 }
5744 }
5745
5746 impl std::convert::From<i32> for State {
5747 fn from(value: i32) -> Self {
5748 match value {
5749 0 => Self::Unspecified,
5750 1 => Self::Pending,
5751 2 => Self::Failed,
5752 3 => Self::Active,
5753 _ => Self::UnknownValue(state::UnknownValue(
5754 wkt::internal::UnknownEnumValue::Integer(value),
5755 )),
5756 }
5757 }
5758 }
5759
5760 impl std::convert::From<&str> for State {
5761 fn from(value: &str) -> Self {
5762 use std::string::ToString;
5763 match value {
5764 "STATE_UNSPECIFIED" => Self::Unspecified,
5765 "PENDING" => Self::Pending,
5766 "FAILED" => Self::Failed,
5767 "ACTIVE" => Self::Active,
5768 _ => Self::UnknownValue(state::UnknownValue(
5769 wkt::internal::UnknownEnumValue::String(value.to_string()),
5770 )),
5771 }
5772 }
5773 }
5774
5775 impl serde::ser::Serialize for State {
5776 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5777 where
5778 S: serde::Serializer,
5779 {
5780 match self {
5781 Self::Unspecified => serializer.serialize_i32(0),
5782 Self::Pending => serializer.serialize_i32(1),
5783 Self::Failed => serializer.serialize_i32(2),
5784 Self::Active => serializer.serialize_i32(3),
5785 Self::UnknownValue(u) => u.0.serialize(serializer),
5786 }
5787 }
5788 }
5789
5790 impl<'de> serde::de::Deserialize<'de> for State {
5791 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5792 where
5793 D: serde::Deserializer<'de>,
5794 {
5795 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5796 ".google.cloud.vmmigration.v1.AzureSourceDetails.State",
5797 ))
5798 }
5799 }
5800
5801 #[allow(missing_docs)]
5802 #[derive(Clone, Debug, PartialEq)]
5803 #[non_exhaustive]
5804 pub enum CredentialsType {
5805 /// Azure Credentials using tenant ID, client ID and secret.
5806 ClientSecretCreds(
5807 std::boxed::Box<crate::model::azure_source_details::ClientSecretCredentials>,
5808 ),
5809 }
5810}
5811
5812/// DatacenterConnector message describes a connector between the Source and
5813/// Google Cloud, which is installed on a vmware datacenter (an OVA vm installed
5814/// by the user) to connect the Datacenter to Google Cloud and support vm
5815/// migration data transfer.
5816#[derive(Clone, Default, PartialEq)]
5817#[non_exhaustive]
5818pub struct DatacenterConnector {
5819 /// Output only. The time the connector was created (as an API call, not when
5820 /// it was actually installed).
5821 pub create_time: std::option::Option<wkt::Timestamp>,
5822
5823 /// Output only. The last time the connector was updated with an API call.
5824 pub update_time: std::option::Option<wkt::Timestamp>,
5825
5826 /// Output only. The connector's name.
5827 pub name: std::string::String,
5828
5829 /// Immutable. A unique key for this connector. This key is internal to the OVA
5830 /// connector and is supplied with its creation during the registration process
5831 /// and can not be modified.
5832 pub registration_id: std::string::String,
5833
5834 /// The service account to use in the connector when communicating with the
5835 /// cloud.
5836 pub service_account: std::string::String,
5837
5838 /// The version running in the DatacenterConnector. This is supplied by the OVA
5839 /// connector during the registration process and can not be modified.
5840 pub version: std::string::String,
5841
5842 /// Output only. The communication channel between the datacenter connector and
5843 /// Google Cloud.
5844 pub bucket: std::string::String,
5845
5846 /// Output only. State of the DatacenterConnector, as determined by the health
5847 /// checks.
5848 pub state: crate::model::datacenter_connector::State,
5849
5850 /// Output only. The time the state was last set.
5851 pub state_time: std::option::Option<wkt::Timestamp>,
5852
5853 /// Output only. Provides details on the state of the Datacenter Connector in
5854 /// case of an error.
5855 pub error: std::option::Option<google_cloud_rpc::model::Status>,
5856
5857 /// Output only. Appliance OVA version.
5858 /// This is the OVA which is manually installed by the user and contains the
5859 /// infrastructure for the automatically updatable components on the appliance.
5860 pub appliance_infrastructure_version: std::string::String,
5861
5862 /// Output only. Appliance last installed update bundle version.
5863 /// This is the version of the automatically updatable components on the
5864 /// appliance.
5865 pub appliance_software_version: std::string::String,
5866
5867 /// Output only. The available versions for updating this appliance.
5868 pub available_versions: std::option::Option<crate::model::AvailableUpdates>,
5869
5870 /// Output only. The status of the current / last upgradeAppliance operation.
5871 pub upgrade_status: std::option::Option<crate::model::UpgradeStatus>,
5872
5873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5874}
5875
5876impl DatacenterConnector {
5877 /// Creates a new default instance.
5878 pub fn new() -> Self {
5879 std::default::Default::default()
5880 }
5881
5882 /// Sets the value of [create_time][crate::model::DatacenterConnector::create_time].
5883 ///
5884 /// # Example
5885 /// ```ignore,no_run
5886 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5887 /// use wkt::Timestamp;
5888 /// let x = DatacenterConnector::new().set_create_time(Timestamp::default()/* use setters */);
5889 /// ```
5890 pub fn set_create_time<T>(mut self, v: T) -> Self
5891 where
5892 T: std::convert::Into<wkt::Timestamp>,
5893 {
5894 self.create_time = std::option::Option::Some(v.into());
5895 self
5896 }
5897
5898 /// Sets or clears the value of [create_time][crate::model::DatacenterConnector::create_time].
5899 ///
5900 /// # Example
5901 /// ```ignore,no_run
5902 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5903 /// use wkt::Timestamp;
5904 /// let x = DatacenterConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5905 /// let x = DatacenterConnector::new().set_or_clear_create_time(None::<Timestamp>);
5906 /// ```
5907 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5908 where
5909 T: std::convert::Into<wkt::Timestamp>,
5910 {
5911 self.create_time = v.map(|x| x.into());
5912 self
5913 }
5914
5915 /// Sets the value of [update_time][crate::model::DatacenterConnector::update_time].
5916 ///
5917 /// # Example
5918 /// ```ignore,no_run
5919 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5920 /// use wkt::Timestamp;
5921 /// let x = DatacenterConnector::new().set_update_time(Timestamp::default()/* use setters */);
5922 /// ```
5923 pub fn set_update_time<T>(mut self, v: T) -> Self
5924 where
5925 T: std::convert::Into<wkt::Timestamp>,
5926 {
5927 self.update_time = std::option::Option::Some(v.into());
5928 self
5929 }
5930
5931 /// Sets or clears the value of [update_time][crate::model::DatacenterConnector::update_time].
5932 ///
5933 /// # Example
5934 /// ```ignore,no_run
5935 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5936 /// use wkt::Timestamp;
5937 /// let x = DatacenterConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5938 /// let x = DatacenterConnector::new().set_or_clear_update_time(None::<Timestamp>);
5939 /// ```
5940 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5941 where
5942 T: std::convert::Into<wkt::Timestamp>,
5943 {
5944 self.update_time = v.map(|x| x.into());
5945 self
5946 }
5947
5948 /// Sets the value of [name][crate::model::DatacenterConnector::name].
5949 ///
5950 /// # Example
5951 /// ```ignore,no_run
5952 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5953 /// # let project_id = "project_id";
5954 /// # let location_id = "location_id";
5955 /// # let source_id = "source_id";
5956 /// # let datacenter_connector_id = "datacenter_connector_id";
5957 /// let x = DatacenterConnector::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/datacenterConnectors/{datacenter_connector_id}"));
5958 /// ```
5959 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5960 self.name = v.into();
5961 self
5962 }
5963
5964 /// Sets the value of [registration_id][crate::model::DatacenterConnector::registration_id].
5965 ///
5966 /// # Example
5967 /// ```ignore,no_run
5968 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5969 /// let x = DatacenterConnector::new().set_registration_id("example");
5970 /// ```
5971 pub fn set_registration_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5972 self.registration_id = v.into();
5973 self
5974 }
5975
5976 /// Sets the value of [service_account][crate::model::DatacenterConnector::service_account].
5977 ///
5978 /// # Example
5979 /// ```ignore,no_run
5980 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5981 /// let x = DatacenterConnector::new().set_service_account("example");
5982 /// ```
5983 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5984 self.service_account = v.into();
5985 self
5986 }
5987
5988 /// Sets the value of [version][crate::model::DatacenterConnector::version].
5989 ///
5990 /// # Example
5991 /// ```ignore,no_run
5992 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
5993 /// let x = DatacenterConnector::new().set_version("example");
5994 /// ```
5995 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5996 self.version = v.into();
5997 self
5998 }
5999
6000 /// Sets the value of [bucket][crate::model::DatacenterConnector::bucket].
6001 ///
6002 /// # Example
6003 /// ```ignore,no_run
6004 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6005 /// let x = DatacenterConnector::new().set_bucket("example");
6006 /// ```
6007 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6008 self.bucket = v.into();
6009 self
6010 }
6011
6012 /// Sets the value of [state][crate::model::DatacenterConnector::state].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6017 /// use google_cloud_vmmigration_v1::model::datacenter_connector::State;
6018 /// let x0 = DatacenterConnector::new().set_state(State::Pending);
6019 /// let x1 = DatacenterConnector::new().set_state(State::Offline);
6020 /// let x2 = DatacenterConnector::new().set_state(State::Failed);
6021 /// ```
6022 pub fn set_state<T: std::convert::Into<crate::model::datacenter_connector::State>>(
6023 mut self,
6024 v: T,
6025 ) -> Self {
6026 self.state = v.into();
6027 self
6028 }
6029
6030 /// Sets the value of [state_time][crate::model::DatacenterConnector::state_time].
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6035 /// use wkt::Timestamp;
6036 /// let x = DatacenterConnector::new().set_state_time(Timestamp::default()/* use setters */);
6037 /// ```
6038 pub fn set_state_time<T>(mut self, v: T) -> Self
6039 where
6040 T: std::convert::Into<wkt::Timestamp>,
6041 {
6042 self.state_time = std::option::Option::Some(v.into());
6043 self
6044 }
6045
6046 /// Sets or clears the value of [state_time][crate::model::DatacenterConnector::state_time].
6047 ///
6048 /// # Example
6049 /// ```ignore,no_run
6050 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6051 /// use wkt::Timestamp;
6052 /// let x = DatacenterConnector::new().set_or_clear_state_time(Some(Timestamp::default()/* use setters */));
6053 /// let x = DatacenterConnector::new().set_or_clear_state_time(None::<Timestamp>);
6054 /// ```
6055 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
6056 where
6057 T: std::convert::Into<wkt::Timestamp>,
6058 {
6059 self.state_time = v.map(|x| x.into());
6060 self
6061 }
6062
6063 /// Sets the value of [error][crate::model::DatacenterConnector::error].
6064 ///
6065 /// # Example
6066 /// ```ignore,no_run
6067 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6068 /// use google_cloud_rpc::model::Status;
6069 /// let x = DatacenterConnector::new().set_error(Status::default()/* use setters */);
6070 /// ```
6071 pub fn set_error<T>(mut self, v: T) -> Self
6072 where
6073 T: std::convert::Into<google_cloud_rpc::model::Status>,
6074 {
6075 self.error = std::option::Option::Some(v.into());
6076 self
6077 }
6078
6079 /// Sets or clears the value of [error][crate::model::DatacenterConnector::error].
6080 ///
6081 /// # Example
6082 /// ```ignore,no_run
6083 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6084 /// use google_cloud_rpc::model::Status;
6085 /// let x = DatacenterConnector::new().set_or_clear_error(Some(Status::default()/* use setters */));
6086 /// let x = DatacenterConnector::new().set_or_clear_error(None::<Status>);
6087 /// ```
6088 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
6089 where
6090 T: std::convert::Into<google_cloud_rpc::model::Status>,
6091 {
6092 self.error = v.map(|x| x.into());
6093 self
6094 }
6095
6096 /// Sets the value of [appliance_infrastructure_version][crate::model::DatacenterConnector::appliance_infrastructure_version].
6097 ///
6098 /// # Example
6099 /// ```ignore,no_run
6100 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6101 /// let x = DatacenterConnector::new().set_appliance_infrastructure_version("example");
6102 /// ```
6103 pub fn set_appliance_infrastructure_version<T: std::convert::Into<std::string::String>>(
6104 mut self,
6105 v: T,
6106 ) -> Self {
6107 self.appliance_infrastructure_version = v.into();
6108 self
6109 }
6110
6111 /// Sets the value of [appliance_software_version][crate::model::DatacenterConnector::appliance_software_version].
6112 ///
6113 /// # Example
6114 /// ```ignore,no_run
6115 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6116 /// let x = DatacenterConnector::new().set_appliance_software_version("example");
6117 /// ```
6118 pub fn set_appliance_software_version<T: std::convert::Into<std::string::String>>(
6119 mut self,
6120 v: T,
6121 ) -> Self {
6122 self.appliance_software_version = v.into();
6123 self
6124 }
6125
6126 /// Sets the value of [available_versions][crate::model::DatacenterConnector::available_versions].
6127 ///
6128 /// # Example
6129 /// ```ignore,no_run
6130 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6131 /// use google_cloud_vmmigration_v1::model::AvailableUpdates;
6132 /// let x = DatacenterConnector::new().set_available_versions(AvailableUpdates::default()/* use setters */);
6133 /// ```
6134 pub fn set_available_versions<T>(mut self, v: T) -> Self
6135 where
6136 T: std::convert::Into<crate::model::AvailableUpdates>,
6137 {
6138 self.available_versions = std::option::Option::Some(v.into());
6139 self
6140 }
6141
6142 /// Sets or clears the value of [available_versions][crate::model::DatacenterConnector::available_versions].
6143 ///
6144 /// # Example
6145 /// ```ignore,no_run
6146 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6147 /// use google_cloud_vmmigration_v1::model::AvailableUpdates;
6148 /// let x = DatacenterConnector::new().set_or_clear_available_versions(Some(AvailableUpdates::default()/* use setters */));
6149 /// let x = DatacenterConnector::new().set_or_clear_available_versions(None::<AvailableUpdates>);
6150 /// ```
6151 pub fn set_or_clear_available_versions<T>(mut self, v: std::option::Option<T>) -> Self
6152 where
6153 T: std::convert::Into<crate::model::AvailableUpdates>,
6154 {
6155 self.available_versions = v.map(|x| x.into());
6156 self
6157 }
6158
6159 /// Sets the value of [upgrade_status][crate::model::DatacenterConnector::upgrade_status].
6160 ///
6161 /// # Example
6162 /// ```ignore,no_run
6163 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6164 /// use google_cloud_vmmigration_v1::model::UpgradeStatus;
6165 /// let x = DatacenterConnector::new().set_upgrade_status(UpgradeStatus::default()/* use setters */);
6166 /// ```
6167 pub fn set_upgrade_status<T>(mut self, v: T) -> Self
6168 where
6169 T: std::convert::Into<crate::model::UpgradeStatus>,
6170 {
6171 self.upgrade_status = std::option::Option::Some(v.into());
6172 self
6173 }
6174
6175 /// Sets or clears the value of [upgrade_status][crate::model::DatacenterConnector::upgrade_status].
6176 ///
6177 /// # Example
6178 /// ```ignore,no_run
6179 /// # use google_cloud_vmmigration_v1::model::DatacenterConnector;
6180 /// use google_cloud_vmmigration_v1::model::UpgradeStatus;
6181 /// let x = DatacenterConnector::new().set_or_clear_upgrade_status(Some(UpgradeStatus::default()/* use setters */));
6182 /// let x = DatacenterConnector::new().set_or_clear_upgrade_status(None::<UpgradeStatus>);
6183 /// ```
6184 pub fn set_or_clear_upgrade_status<T>(mut self, v: std::option::Option<T>) -> Self
6185 where
6186 T: std::convert::Into<crate::model::UpgradeStatus>,
6187 {
6188 self.upgrade_status = v.map(|x| x.into());
6189 self
6190 }
6191}
6192
6193impl wkt::message::Message for DatacenterConnector {
6194 fn typename() -> &'static str {
6195 "type.googleapis.com/google.cloud.vmmigration.v1.DatacenterConnector"
6196 }
6197}
6198
6199/// Defines additional types related to [DatacenterConnector].
6200pub mod datacenter_connector {
6201 #[allow(unused_imports)]
6202 use super::*;
6203
6204 /// The possible values of the state.
6205 ///
6206 /// # Working with unknown values
6207 ///
6208 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6209 /// additional enum variants at any time. Adding new variants is not considered
6210 /// a breaking change. Applications should write their code in anticipation of:
6211 ///
6212 /// - New values appearing in future releases of the client library, **and**
6213 /// - New values received dynamically, without application changes.
6214 ///
6215 /// Please consult the [Working with enums] section in the user guide for some
6216 /// guidelines.
6217 ///
6218 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6219 #[derive(Clone, Debug, PartialEq)]
6220 #[non_exhaustive]
6221 pub enum State {
6222 /// The state is unknown. This is used for API compatibility only and is not
6223 /// used by the system.
6224 Unspecified,
6225 /// The state was not sampled by the health checks yet.
6226 Pending,
6227 /// The source was sampled by health checks and is not available.
6228 Offline,
6229 /// The source is available but might not be usable yet due to unvalidated
6230 /// credentials or another reason. The credentials referred to are the ones
6231 /// to the Source. The error message will contain further details.
6232 Failed,
6233 /// The source exists and its credentials were verified.
6234 Active,
6235 /// If set, the enum was initialized with an unknown value.
6236 ///
6237 /// Applications can examine the value using [State::value] or
6238 /// [State::name].
6239 UnknownValue(state::UnknownValue),
6240 }
6241
6242 #[doc(hidden)]
6243 pub mod state {
6244 #[allow(unused_imports)]
6245 use super::*;
6246 #[derive(Clone, Debug, PartialEq)]
6247 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6248 }
6249
6250 impl State {
6251 /// Gets the enum value.
6252 ///
6253 /// Returns `None` if the enum contains an unknown value deserialized from
6254 /// the string representation of enums.
6255 pub fn value(&self) -> std::option::Option<i32> {
6256 match self {
6257 Self::Unspecified => std::option::Option::Some(0),
6258 Self::Pending => std::option::Option::Some(1),
6259 Self::Offline => std::option::Option::Some(2),
6260 Self::Failed => std::option::Option::Some(3),
6261 Self::Active => std::option::Option::Some(4),
6262 Self::UnknownValue(u) => u.0.value(),
6263 }
6264 }
6265
6266 /// Gets the enum value as a string.
6267 ///
6268 /// Returns `None` if the enum contains an unknown value deserialized from
6269 /// the integer representation of enums.
6270 pub fn name(&self) -> std::option::Option<&str> {
6271 match self {
6272 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6273 Self::Pending => std::option::Option::Some("PENDING"),
6274 Self::Offline => std::option::Option::Some("OFFLINE"),
6275 Self::Failed => std::option::Option::Some("FAILED"),
6276 Self::Active => std::option::Option::Some("ACTIVE"),
6277 Self::UnknownValue(u) => u.0.name(),
6278 }
6279 }
6280 }
6281
6282 impl std::default::Default for State {
6283 fn default() -> Self {
6284 use std::convert::From;
6285 Self::from(0)
6286 }
6287 }
6288
6289 impl std::fmt::Display for State {
6290 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6291 wkt::internal::display_enum(f, self.name(), self.value())
6292 }
6293 }
6294
6295 impl std::convert::From<i32> for State {
6296 fn from(value: i32) -> Self {
6297 match value {
6298 0 => Self::Unspecified,
6299 1 => Self::Pending,
6300 2 => Self::Offline,
6301 3 => Self::Failed,
6302 4 => Self::Active,
6303 _ => Self::UnknownValue(state::UnknownValue(
6304 wkt::internal::UnknownEnumValue::Integer(value),
6305 )),
6306 }
6307 }
6308 }
6309
6310 impl std::convert::From<&str> for State {
6311 fn from(value: &str) -> Self {
6312 use std::string::ToString;
6313 match value {
6314 "STATE_UNSPECIFIED" => Self::Unspecified,
6315 "PENDING" => Self::Pending,
6316 "OFFLINE" => Self::Offline,
6317 "FAILED" => Self::Failed,
6318 "ACTIVE" => Self::Active,
6319 _ => Self::UnknownValue(state::UnknownValue(
6320 wkt::internal::UnknownEnumValue::String(value.to_string()),
6321 )),
6322 }
6323 }
6324 }
6325
6326 impl serde::ser::Serialize for State {
6327 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6328 where
6329 S: serde::Serializer,
6330 {
6331 match self {
6332 Self::Unspecified => serializer.serialize_i32(0),
6333 Self::Pending => serializer.serialize_i32(1),
6334 Self::Offline => serializer.serialize_i32(2),
6335 Self::Failed => serializer.serialize_i32(3),
6336 Self::Active => serializer.serialize_i32(4),
6337 Self::UnknownValue(u) => u.0.serialize(serializer),
6338 }
6339 }
6340 }
6341
6342 impl<'de> serde::de::Deserialize<'de> for State {
6343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6344 where
6345 D: serde::Deserializer<'de>,
6346 {
6347 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6348 ".google.cloud.vmmigration.v1.DatacenterConnector.State",
6349 ))
6350 }
6351 }
6352}
6353
6354/// UpgradeStatus contains information about upgradeAppliance operation.
6355#[derive(Clone, Default, PartialEq)]
6356#[non_exhaustive]
6357pub struct UpgradeStatus {
6358 /// The version to upgrade to.
6359 pub version: std::string::String,
6360
6361 /// The state of the upgradeAppliance operation.
6362 pub state: crate::model::upgrade_status::State,
6363
6364 /// Output only. Provides details on the state of the upgrade operation in case
6365 /// of an error.
6366 pub error: std::option::Option<google_cloud_rpc::model::Status>,
6367
6368 /// The time the operation was started.
6369 pub start_time: std::option::Option<wkt::Timestamp>,
6370
6371 /// The version from which we upgraded.
6372 pub previous_version: std::string::String,
6373
6374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6375}
6376
6377impl UpgradeStatus {
6378 /// Creates a new default instance.
6379 pub fn new() -> Self {
6380 std::default::Default::default()
6381 }
6382
6383 /// Sets the value of [version][crate::model::UpgradeStatus::version].
6384 ///
6385 /// # Example
6386 /// ```ignore,no_run
6387 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6388 /// let x = UpgradeStatus::new().set_version("example");
6389 /// ```
6390 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6391 self.version = v.into();
6392 self
6393 }
6394
6395 /// Sets the value of [state][crate::model::UpgradeStatus::state].
6396 ///
6397 /// # Example
6398 /// ```ignore,no_run
6399 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6400 /// use google_cloud_vmmigration_v1::model::upgrade_status::State;
6401 /// let x0 = UpgradeStatus::new().set_state(State::Running);
6402 /// let x1 = UpgradeStatus::new().set_state(State::Failed);
6403 /// let x2 = UpgradeStatus::new().set_state(State::Succeeded);
6404 /// ```
6405 pub fn set_state<T: std::convert::Into<crate::model::upgrade_status::State>>(
6406 mut self,
6407 v: T,
6408 ) -> Self {
6409 self.state = v.into();
6410 self
6411 }
6412
6413 /// Sets the value of [error][crate::model::UpgradeStatus::error].
6414 ///
6415 /// # Example
6416 /// ```ignore,no_run
6417 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6418 /// use google_cloud_rpc::model::Status;
6419 /// let x = UpgradeStatus::new().set_error(Status::default()/* use setters */);
6420 /// ```
6421 pub fn set_error<T>(mut self, v: T) -> Self
6422 where
6423 T: std::convert::Into<google_cloud_rpc::model::Status>,
6424 {
6425 self.error = std::option::Option::Some(v.into());
6426 self
6427 }
6428
6429 /// Sets or clears the value of [error][crate::model::UpgradeStatus::error].
6430 ///
6431 /// # Example
6432 /// ```ignore,no_run
6433 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6434 /// use google_cloud_rpc::model::Status;
6435 /// let x = UpgradeStatus::new().set_or_clear_error(Some(Status::default()/* use setters */));
6436 /// let x = UpgradeStatus::new().set_or_clear_error(None::<Status>);
6437 /// ```
6438 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
6439 where
6440 T: std::convert::Into<google_cloud_rpc::model::Status>,
6441 {
6442 self.error = v.map(|x| x.into());
6443 self
6444 }
6445
6446 /// Sets the value of [start_time][crate::model::UpgradeStatus::start_time].
6447 ///
6448 /// # Example
6449 /// ```ignore,no_run
6450 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6451 /// use wkt::Timestamp;
6452 /// let x = UpgradeStatus::new().set_start_time(Timestamp::default()/* use setters */);
6453 /// ```
6454 pub fn set_start_time<T>(mut self, v: T) -> Self
6455 where
6456 T: std::convert::Into<wkt::Timestamp>,
6457 {
6458 self.start_time = std::option::Option::Some(v.into());
6459 self
6460 }
6461
6462 /// Sets or clears the value of [start_time][crate::model::UpgradeStatus::start_time].
6463 ///
6464 /// # Example
6465 /// ```ignore,no_run
6466 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6467 /// use wkt::Timestamp;
6468 /// let x = UpgradeStatus::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
6469 /// let x = UpgradeStatus::new().set_or_clear_start_time(None::<Timestamp>);
6470 /// ```
6471 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6472 where
6473 T: std::convert::Into<wkt::Timestamp>,
6474 {
6475 self.start_time = v.map(|x| x.into());
6476 self
6477 }
6478
6479 /// Sets the value of [previous_version][crate::model::UpgradeStatus::previous_version].
6480 ///
6481 /// # Example
6482 /// ```ignore,no_run
6483 /// # use google_cloud_vmmigration_v1::model::UpgradeStatus;
6484 /// let x = UpgradeStatus::new().set_previous_version("example");
6485 /// ```
6486 pub fn set_previous_version<T: std::convert::Into<std::string::String>>(
6487 mut self,
6488 v: T,
6489 ) -> Self {
6490 self.previous_version = v.into();
6491 self
6492 }
6493}
6494
6495impl wkt::message::Message for UpgradeStatus {
6496 fn typename() -> &'static str {
6497 "type.googleapis.com/google.cloud.vmmigration.v1.UpgradeStatus"
6498 }
6499}
6500
6501/// Defines additional types related to [UpgradeStatus].
6502pub mod upgrade_status {
6503 #[allow(unused_imports)]
6504 use super::*;
6505
6506 /// The possible values of the state.
6507 ///
6508 /// # Working with unknown values
6509 ///
6510 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6511 /// additional enum variants at any time. Adding new variants is not considered
6512 /// a breaking change. Applications should write their code in anticipation of:
6513 ///
6514 /// - New values appearing in future releases of the client library, **and**
6515 /// - New values received dynamically, without application changes.
6516 ///
6517 /// Please consult the [Working with enums] section in the user guide for some
6518 /// guidelines.
6519 ///
6520 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6521 #[derive(Clone, Debug, PartialEq)]
6522 #[non_exhaustive]
6523 pub enum State {
6524 /// The state was not sampled by the health checks yet.
6525 Unspecified,
6526 /// The upgrade has started.
6527 Running,
6528 /// The upgrade failed.
6529 Failed,
6530 /// The upgrade finished successfully.
6531 Succeeded,
6532 /// If set, the enum was initialized with an unknown value.
6533 ///
6534 /// Applications can examine the value using [State::value] or
6535 /// [State::name].
6536 UnknownValue(state::UnknownValue),
6537 }
6538
6539 #[doc(hidden)]
6540 pub mod state {
6541 #[allow(unused_imports)]
6542 use super::*;
6543 #[derive(Clone, Debug, PartialEq)]
6544 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6545 }
6546
6547 impl State {
6548 /// Gets the enum value.
6549 ///
6550 /// Returns `None` if the enum contains an unknown value deserialized from
6551 /// the string representation of enums.
6552 pub fn value(&self) -> std::option::Option<i32> {
6553 match self {
6554 Self::Unspecified => std::option::Option::Some(0),
6555 Self::Running => std::option::Option::Some(1),
6556 Self::Failed => std::option::Option::Some(2),
6557 Self::Succeeded => std::option::Option::Some(3),
6558 Self::UnknownValue(u) => u.0.value(),
6559 }
6560 }
6561
6562 /// Gets the enum value as a string.
6563 ///
6564 /// Returns `None` if the enum contains an unknown value deserialized from
6565 /// the integer representation of enums.
6566 pub fn name(&self) -> std::option::Option<&str> {
6567 match self {
6568 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6569 Self::Running => std::option::Option::Some("RUNNING"),
6570 Self::Failed => std::option::Option::Some("FAILED"),
6571 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6572 Self::UnknownValue(u) => u.0.name(),
6573 }
6574 }
6575 }
6576
6577 impl std::default::Default for State {
6578 fn default() -> Self {
6579 use std::convert::From;
6580 Self::from(0)
6581 }
6582 }
6583
6584 impl std::fmt::Display for State {
6585 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6586 wkt::internal::display_enum(f, self.name(), self.value())
6587 }
6588 }
6589
6590 impl std::convert::From<i32> for State {
6591 fn from(value: i32) -> Self {
6592 match value {
6593 0 => Self::Unspecified,
6594 1 => Self::Running,
6595 2 => Self::Failed,
6596 3 => Self::Succeeded,
6597 _ => Self::UnknownValue(state::UnknownValue(
6598 wkt::internal::UnknownEnumValue::Integer(value),
6599 )),
6600 }
6601 }
6602 }
6603
6604 impl std::convert::From<&str> for State {
6605 fn from(value: &str) -> Self {
6606 use std::string::ToString;
6607 match value {
6608 "STATE_UNSPECIFIED" => Self::Unspecified,
6609 "RUNNING" => Self::Running,
6610 "FAILED" => Self::Failed,
6611 "SUCCEEDED" => Self::Succeeded,
6612 _ => Self::UnknownValue(state::UnknownValue(
6613 wkt::internal::UnknownEnumValue::String(value.to_string()),
6614 )),
6615 }
6616 }
6617 }
6618
6619 impl serde::ser::Serialize for State {
6620 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6621 where
6622 S: serde::Serializer,
6623 {
6624 match self {
6625 Self::Unspecified => serializer.serialize_i32(0),
6626 Self::Running => serializer.serialize_i32(1),
6627 Self::Failed => serializer.serialize_i32(2),
6628 Self::Succeeded => serializer.serialize_i32(3),
6629 Self::UnknownValue(u) => u.0.serialize(serializer),
6630 }
6631 }
6632 }
6633
6634 impl<'de> serde::de::Deserialize<'de> for State {
6635 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6636 where
6637 D: serde::Deserializer<'de>,
6638 {
6639 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6640 ".google.cloud.vmmigration.v1.UpgradeStatus.State",
6641 ))
6642 }
6643 }
6644}
6645
6646/// Holds information about the available versions for upgrade.
6647#[derive(Clone, Default, PartialEq)]
6648#[non_exhaustive]
6649pub struct AvailableUpdates {
6650 /// The newest deployable version of the appliance.
6651 /// The current appliance can't be updated into this version, and the owner
6652 /// must manually deploy this OVA to a new appliance.
6653 pub new_deployable_appliance: std::option::Option<crate::model::ApplianceVersion>,
6654
6655 /// The latest version for in place update.
6656 /// The current appliance can be updated to this version using the API or m4c
6657 /// CLI.
6658 pub in_place_update: std::option::Option<crate::model::ApplianceVersion>,
6659
6660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6661}
6662
6663impl AvailableUpdates {
6664 /// Creates a new default instance.
6665 pub fn new() -> Self {
6666 std::default::Default::default()
6667 }
6668
6669 /// Sets the value of [new_deployable_appliance][crate::model::AvailableUpdates::new_deployable_appliance].
6670 ///
6671 /// # Example
6672 /// ```ignore,no_run
6673 /// # use google_cloud_vmmigration_v1::model::AvailableUpdates;
6674 /// use google_cloud_vmmigration_v1::model::ApplianceVersion;
6675 /// let x = AvailableUpdates::new().set_new_deployable_appliance(ApplianceVersion::default()/* use setters */);
6676 /// ```
6677 pub fn set_new_deployable_appliance<T>(mut self, v: T) -> Self
6678 where
6679 T: std::convert::Into<crate::model::ApplianceVersion>,
6680 {
6681 self.new_deployable_appliance = std::option::Option::Some(v.into());
6682 self
6683 }
6684
6685 /// Sets or clears the value of [new_deployable_appliance][crate::model::AvailableUpdates::new_deployable_appliance].
6686 ///
6687 /// # Example
6688 /// ```ignore,no_run
6689 /// # use google_cloud_vmmigration_v1::model::AvailableUpdates;
6690 /// use google_cloud_vmmigration_v1::model::ApplianceVersion;
6691 /// let x = AvailableUpdates::new().set_or_clear_new_deployable_appliance(Some(ApplianceVersion::default()/* use setters */));
6692 /// let x = AvailableUpdates::new().set_or_clear_new_deployable_appliance(None::<ApplianceVersion>);
6693 /// ```
6694 pub fn set_or_clear_new_deployable_appliance<T>(mut self, v: std::option::Option<T>) -> Self
6695 where
6696 T: std::convert::Into<crate::model::ApplianceVersion>,
6697 {
6698 self.new_deployable_appliance = v.map(|x| x.into());
6699 self
6700 }
6701
6702 /// Sets the value of [in_place_update][crate::model::AvailableUpdates::in_place_update].
6703 ///
6704 /// # Example
6705 /// ```ignore,no_run
6706 /// # use google_cloud_vmmigration_v1::model::AvailableUpdates;
6707 /// use google_cloud_vmmigration_v1::model::ApplianceVersion;
6708 /// let x = AvailableUpdates::new().set_in_place_update(ApplianceVersion::default()/* use setters */);
6709 /// ```
6710 pub fn set_in_place_update<T>(mut self, v: T) -> Self
6711 where
6712 T: std::convert::Into<crate::model::ApplianceVersion>,
6713 {
6714 self.in_place_update = std::option::Option::Some(v.into());
6715 self
6716 }
6717
6718 /// Sets or clears the value of [in_place_update][crate::model::AvailableUpdates::in_place_update].
6719 ///
6720 /// # Example
6721 /// ```ignore,no_run
6722 /// # use google_cloud_vmmigration_v1::model::AvailableUpdates;
6723 /// use google_cloud_vmmigration_v1::model::ApplianceVersion;
6724 /// let x = AvailableUpdates::new().set_or_clear_in_place_update(Some(ApplianceVersion::default()/* use setters */));
6725 /// let x = AvailableUpdates::new().set_or_clear_in_place_update(None::<ApplianceVersion>);
6726 /// ```
6727 pub fn set_or_clear_in_place_update<T>(mut self, v: std::option::Option<T>) -> Self
6728 where
6729 T: std::convert::Into<crate::model::ApplianceVersion>,
6730 {
6731 self.in_place_update = v.map(|x| x.into());
6732 self
6733 }
6734}
6735
6736impl wkt::message::Message for AvailableUpdates {
6737 fn typename() -> &'static str {
6738 "type.googleapis.com/google.cloud.vmmigration.v1.AvailableUpdates"
6739 }
6740}
6741
6742/// Describes an appliance version.
6743#[derive(Clone, Default, PartialEq)]
6744#[non_exhaustive]
6745pub struct ApplianceVersion {
6746 /// The appliance version.
6747 pub version: std::string::String,
6748
6749 /// A link for downloading the version.
6750 pub uri: std::string::String,
6751
6752 /// Determine whether it's critical to upgrade the appliance to this version.
6753 pub critical: bool,
6754
6755 /// Link to a page that contains the version release notes.
6756 pub release_notes_uri: std::string::String,
6757
6758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6759}
6760
6761impl ApplianceVersion {
6762 /// Creates a new default instance.
6763 pub fn new() -> Self {
6764 std::default::Default::default()
6765 }
6766
6767 /// Sets the value of [version][crate::model::ApplianceVersion::version].
6768 ///
6769 /// # Example
6770 /// ```ignore,no_run
6771 /// # use google_cloud_vmmigration_v1::model::ApplianceVersion;
6772 /// let x = ApplianceVersion::new().set_version("example");
6773 /// ```
6774 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6775 self.version = v.into();
6776 self
6777 }
6778
6779 /// Sets the value of [uri][crate::model::ApplianceVersion::uri].
6780 ///
6781 /// # Example
6782 /// ```ignore,no_run
6783 /// # use google_cloud_vmmigration_v1::model::ApplianceVersion;
6784 /// let x = ApplianceVersion::new().set_uri("example");
6785 /// ```
6786 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6787 self.uri = v.into();
6788 self
6789 }
6790
6791 /// Sets the value of [critical][crate::model::ApplianceVersion::critical].
6792 ///
6793 /// # Example
6794 /// ```ignore,no_run
6795 /// # use google_cloud_vmmigration_v1::model::ApplianceVersion;
6796 /// let x = ApplianceVersion::new().set_critical(true);
6797 /// ```
6798 pub fn set_critical<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6799 self.critical = v.into();
6800 self
6801 }
6802
6803 /// Sets the value of [release_notes_uri][crate::model::ApplianceVersion::release_notes_uri].
6804 ///
6805 /// # Example
6806 /// ```ignore,no_run
6807 /// # use google_cloud_vmmigration_v1::model::ApplianceVersion;
6808 /// let x = ApplianceVersion::new().set_release_notes_uri("example");
6809 /// ```
6810 pub fn set_release_notes_uri<T: std::convert::Into<std::string::String>>(
6811 mut self,
6812 v: T,
6813 ) -> Self {
6814 self.release_notes_uri = v.into();
6815 self
6816 }
6817}
6818
6819impl wkt::message::Message for ApplianceVersion {
6820 fn typename() -> &'static str {
6821 "type.googleapis.com/google.cloud.vmmigration.v1.ApplianceVersion"
6822 }
6823}
6824
6825/// Request message for 'ListSources' request.
6826#[derive(Clone, Default, PartialEq)]
6827#[non_exhaustive]
6828pub struct ListSourcesRequest {
6829 /// Required. The parent, which owns this collection of sources.
6830 pub parent: std::string::String,
6831
6832 /// Optional. The maximum number of sources to return. The service may return
6833 /// fewer than this value. If unspecified, at most 500 sources will be
6834 /// returned. The maximum value is 1000; values above 1000 will be coerced to
6835 /// 1000.
6836 pub page_size: i32,
6837
6838 /// Required. A page token, received from a previous `ListSources` call.
6839 /// Provide this to retrieve the subsequent page.
6840 ///
6841 /// When paginating, all other parameters provided to `ListSources` must
6842 /// match the call that provided the page token.
6843 pub page_token: std::string::String,
6844
6845 /// Optional. The filter request.
6846 pub filter: std::string::String,
6847
6848 /// Optional. the order by fields for the result.
6849 pub order_by: std::string::String,
6850
6851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6852}
6853
6854impl ListSourcesRequest {
6855 /// Creates a new default instance.
6856 pub fn new() -> Self {
6857 std::default::Default::default()
6858 }
6859
6860 /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
6861 ///
6862 /// # Example
6863 /// ```ignore,no_run
6864 /// # use google_cloud_vmmigration_v1::model::ListSourcesRequest;
6865 /// # let project_id = "project_id";
6866 /// # let location_id = "location_id";
6867 /// let x = ListSourcesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6868 /// ```
6869 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6870 self.parent = v.into();
6871 self
6872 }
6873
6874 /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
6875 ///
6876 /// # Example
6877 /// ```ignore,no_run
6878 /// # use google_cloud_vmmigration_v1::model::ListSourcesRequest;
6879 /// let x = ListSourcesRequest::new().set_page_size(42);
6880 /// ```
6881 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6882 self.page_size = v.into();
6883 self
6884 }
6885
6886 /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
6887 ///
6888 /// # Example
6889 /// ```ignore,no_run
6890 /// # use google_cloud_vmmigration_v1::model::ListSourcesRequest;
6891 /// let x = ListSourcesRequest::new().set_page_token("example");
6892 /// ```
6893 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6894 self.page_token = v.into();
6895 self
6896 }
6897
6898 /// Sets the value of [filter][crate::model::ListSourcesRequest::filter].
6899 ///
6900 /// # Example
6901 /// ```ignore,no_run
6902 /// # use google_cloud_vmmigration_v1::model::ListSourcesRequest;
6903 /// let x = ListSourcesRequest::new().set_filter("example");
6904 /// ```
6905 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6906 self.filter = v.into();
6907 self
6908 }
6909
6910 /// Sets the value of [order_by][crate::model::ListSourcesRequest::order_by].
6911 ///
6912 /// # Example
6913 /// ```ignore,no_run
6914 /// # use google_cloud_vmmigration_v1::model::ListSourcesRequest;
6915 /// let x = ListSourcesRequest::new().set_order_by("example");
6916 /// ```
6917 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6918 self.order_by = v.into();
6919 self
6920 }
6921}
6922
6923impl wkt::message::Message for ListSourcesRequest {
6924 fn typename() -> &'static str {
6925 "type.googleapis.com/google.cloud.vmmigration.v1.ListSourcesRequest"
6926 }
6927}
6928
6929/// Response message for 'ListSources' request.
6930#[derive(Clone, Default, PartialEq)]
6931#[non_exhaustive]
6932pub struct ListSourcesResponse {
6933 /// Output only. The list of sources response.
6934 pub sources: std::vec::Vec<crate::model::Source>,
6935
6936 /// Output only. A token, which can be sent as `page_token` to retrieve the
6937 /// next page. If this field is omitted, there are no subsequent pages.
6938 pub next_page_token: std::string::String,
6939
6940 /// Output only. Locations that could not be reached.
6941 pub unreachable: std::vec::Vec<std::string::String>,
6942
6943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6944}
6945
6946impl ListSourcesResponse {
6947 /// Creates a new default instance.
6948 pub fn new() -> Self {
6949 std::default::Default::default()
6950 }
6951
6952 /// Sets the value of [sources][crate::model::ListSourcesResponse::sources].
6953 ///
6954 /// # Example
6955 /// ```ignore,no_run
6956 /// # use google_cloud_vmmigration_v1::model::ListSourcesResponse;
6957 /// use google_cloud_vmmigration_v1::model::Source;
6958 /// let x = ListSourcesResponse::new()
6959 /// .set_sources([
6960 /// Source::default()/* use setters */,
6961 /// Source::default()/* use (different) setters */,
6962 /// ]);
6963 /// ```
6964 pub fn set_sources<T, V>(mut self, v: T) -> Self
6965 where
6966 T: std::iter::IntoIterator<Item = V>,
6967 V: std::convert::Into<crate::model::Source>,
6968 {
6969 use std::iter::Iterator;
6970 self.sources = v.into_iter().map(|i| i.into()).collect();
6971 self
6972 }
6973
6974 /// Sets the value of [next_page_token][crate::model::ListSourcesResponse::next_page_token].
6975 ///
6976 /// # Example
6977 /// ```ignore,no_run
6978 /// # use google_cloud_vmmigration_v1::model::ListSourcesResponse;
6979 /// let x = ListSourcesResponse::new().set_next_page_token("example");
6980 /// ```
6981 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6982 self.next_page_token = v.into();
6983 self
6984 }
6985
6986 /// Sets the value of [unreachable][crate::model::ListSourcesResponse::unreachable].
6987 ///
6988 /// # Example
6989 /// ```ignore,no_run
6990 /// # use google_cloud_vmmigration_v1::model::ListSourcesResponse;
6991 /// let x = ListSourcesResponse::new().set_unreachable(["a", "b", "c"]);
6992 /// ```
6993 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6994 where
6995 T: std::iter::IntoIterator<Item = V>,
6996 V: std::convert::Into<std::string::String>,
6997 {
6998 use std::iter::Iterator;
6999 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7000 self
7001 }
7002}
7003
7004impl wkt::message::Message for ListSourcesResponse {
7005 fn typename() -> &'static str {
7006 "type.googleapis.com/google.cloud.vmmigration.v1.ListSourcesResponse"
7007 }
7008}
7009
7010#[doc(hidden)]
7011impl google_cloud_gax::paginator::internal::PageableResponse for ListSourcesResponse {
7012 type PageItem = crate::model::Source;
7013
7014 fn items(self) -> std::vec::Vec<Self::PageItem> {
7015 self.sources
7016 }
7017
7018 fn next_page_token(&self) -> std::string::String {
7019 use std::clone::Clone;
7020 self.next_page_token.clone()
7021 }
7022}
7023
7024/// Request message for 'GetSource' request.
7025#[derive(Clone, Default, PartialEq)]
7026#[non_exhaustive]
7027pub struct GetSourceRequest {
7028 /// Required. The Source name.
7029 pub name: std::string::String,
7030
7031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7032}
7033
7034impl GetSourceRequest {
7035 /// Creates a new default instance.
7036 pub fn new() -> Self {
7037 std::default::Default::default()
7038 }
7039
7040 /// Sets the value of [name][crate::model::GetSourceRequest::name].
7041 ///
7042 /// # Example
7043 /// ```ignore,no_run
7044 /// # use google_cloud_vmmigration_v1::model::GetSourceRequest;
7045 /// # let project_id = "project_id";
7046 /// # let location_id = "location_id";
7047 /// # let source_id = "source_id";
7048 /// let x = GetSourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
7049 /// ```
7050 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7051 self.name = v.into();
7052 self
7053 }
7054}
7055
7056impl wkt::message::Message for GetSourceRequest {
7057 fn typename() -> &'static str {
7058 "type.googleapis.com/google.cloud.vmmigration.v1.GetSourceRequest"
7059 }
7060}
7061
7062/// Request message for 'CreateSource' request.
7063#[derive(Clone, Default, PartialEq)]
7064#[non_exhaustive]
7065pub struct CreateSourceRequest {
7066 /// Required. The Source's parent.
7067 pub parent: std::string::String,
7068
7069 /// Required. The source identifier.
7070 pub source_id: std::string::String,
7071
7072 /// Required. The create request body.
7073 pub source: std::option::Option<crate::model::Source>,
7074
7075 /// A request ID to identify requests. Specify a unique request ID
7076 /// so that if you must retry your request, the server will know to ignore
7077 /// the request if it has already been completed. The server will guarantee
7078 /// that for at least 60 minutes since the first request.
7079 ///
7080 /// For example, consider a situation where you make an initial request and
7081 /// the request times out. If you make the request again with the same request
7082 /// ID, the server can check if original operation with the same request ID
7083 /// was received, and if so, will ignore the second request. This prevents
7084 /// clients from accidentally creating duplicate commitments.
7085 ///
7086 /// The request ID must be a valid UUID with the exception that zero UUID is
7087 /// not supported (00000000-0000-0000-0000-000000000000).
7088 pub request_id: std::string::String,
7089
7090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7091}
7092
7093impl CreateSourceRequest {
7094 /// Creates a new default instance.
7095 pub fn new() -> Self {
7096 std::default::Default::default()
7097 }
7098
7099 /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
7100 ///
7101 /// # Example
7102 /// ```ignore,no_run
7103 /// # use google_cloud_vmmigration_v1::model::CreateSourceRequest;
7104 /// # let project_id = "project_id";
7105 /// # let location_id = "location_id";
7106 /// let x = CreateSourceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
7107 /// ```
7108 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7109 self.parent = v.into();
7110 self
7111 }
7112
7113 /// Sets the value of [source_id][crate::model::CreateSourceRequest::source_id].
7114 ///
7115 /// # Example
7116 /// ```ignore,no_run
7117 /// # use google_cloud_vmmigration_v1::model::CreateSourceRequest;
7118 /// let x = CreateSourceRequest::new().set_source_id("example");
7119 /// ```
7120 pub fn set_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7121 self.source_id = v.into();
7122 self
7123 }
7124
7125 /// Sets the value of [source][crate::model::CreateSourceRequest::source].
7126 ///
7127 /// # Example
7128 /// ```ignore,no_run
7129 /// # use google_cloud_vmmigration_v1::model::CreateSourceRequest;
7130 /// use google_cloud_vmmigration_v1::model::Source;
7131 /// let x = CreateSourceRequest::new().set_source(Source::default()/* use setters */);
7132 /// ```
7133 pub fn set_source<T>(mut self, v: T) -> Self
7134 where
7135 T: std::convert::Into<crate::model::Source>,
7136 {
7137 self.source = std::option::Option::Some(v.into());
7138 self
7139 }
7140
7141 /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
7142 ///
7143 /// # Example
7144 /// ```ignore,no_run
7145 /// # use google_cloud_vmmigration_v1::model::CreateSourceRequest;
7146 /// use google_cloud_vmmigration_v1::model::Source;
7147 /// let x = CreateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
7148 /// let x = CreateSourceRequest::new().set_or_clear_source(None::<Source>);
7149 /// ```
7150 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
7151 where
7152 T: std::convert::Into<crate::model::Source>,
7153 {
7154 self.source = v.map(|x| x.into());
7155 self
7156 }
7157
7158 /// Sets the value of [request_id][crate::model::CreateSourceRequest::request_id].
7159 ///
7160 /// # Example
7161 /// ```ignore,no_run
7162 /// # use google_cloud_vmmigration_v1::model::CreateSourceRequest;
7163 /// let x = CreateSourceRequest::new().set_request_id("example");
7164 /// ```
7165 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7166 self.request_id = v.into();
7167 self
7168 }
7169}
7170
7171impl wkt::message::Message for CreateSourceRequest {
7172 fn typename() -> &'static str {
7173 "type.googleapis.com/google.cloud.vmmigration.v1.CreateSourceRequest"
7174 }
7175}
7176
7177/// Update message for 'UpdateSources' request.
7178#[derive(Clone, Default, PartialEq)]
7179#[non_exhaustive]
7180pub struct UpdateSourceRequest {
7181 /// Field mask is used to specify the fields to be overwritten in the
7182 /// Source resource by the update.
7183 /// The fields specified in the update_mask are relative to the resource, not
7184 /// the full request. A field will be overwritten if it is in the mask. If the
7185 /// user does not provide a mask then all fields will be overwritten.
7186 pub update_mask: std::option::Option<wkt::FieldMask>,
7187
7188 /// Required. The update request body.
7189 pub source: std::option::Option<crate::model::Source>,
7190
7191 /// A request ID to identify requests. Specify a unique request ID
7192 /// so that if you must retry your request, the server will know to ignore
7193 /// the request if it has already been completed. The server will guarantee
7194 /// that for at least 60 minutes since the first request.
7195 ///
7196 /// For example, consider a situation where you make an initial request and
7197 /// the request times out. If you make the request again with the same request
7198 /// ID, the server can check if original operation with the same request ID
7199 /// was received, and if so, will ignore the second request. This prevents
7200 /// clients from accidentally creating duplicate commitments.
7201 ///
7202 /// The request ID must be a valid UUID with the exception that zero UUID is
7203 /// not supported (00000000-0000-0000-0000-000000000000).
7204 pub request_id: std::string::String,
7205
7206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7207}
7208
7209impl UpdateSourceRequest {
7210 /// Creates a new default instance.
7211 pub fn new() -> Self {
7212 std::default::Default::default()
7213 }
7214
7215 /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
7216 ///
7217 /// # Example
7218 /// ```ignore,no_run
7219 /// # use google_cloud_vmmigration_v1::model::UpdateSourceRequest;
7220 /// use wkt::FieldMask;
7221 /// let x = UpdateSourceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7222 /// ```
7223 pub fn set_update_mask<T>(mut self, v: T) -> Self
7224 where
7225 T: std::convert::Into<wkt::FieldMask>,
7226 {
7227 self.update_mask = std::option::Option::Some(v.into());
7228 self
7229 }
7230
7231 /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
7232 ///
7233 /// # Example
7234 /// ```ignore,no_run
7235 /// # use google_cloud_vmmigration_v1::model::UpdateSourceRequest;
7236 /// use wkt::FieldMask;
7237 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7238 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7239 /// ```
7240 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7241 where
7242 T: std::convert::Into<wkt::FieldMask>,
7243 {
7244 self.update_mask = v.map(|x| x.into());
7245 self
7246 }
7247
7248 /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
7249 ///
7250 /// # Example
7251 /// ```ignore,no_run
7252 /// # use google_cloud_vmmigration_v1::model::UpdateSourceRequest;
7253 /// use google_cloud_vmmigration_v1::model::Source;
7254 /// let x = UpdateSourceRequest::new().set_source(Source::default()/* use setters */);
7255 /// ```
7256 pub fn set_source<T>(mut self, v: T) -> Self
7257 where
7258 T: std::convert::Into<crate::model::Source>,
7259 {
7260 self.source = std::option::Option::Some(v.into());
7261 self
7262 }
7263
7264 /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
7265 ///
7266 /// # Example
7267 /// ```ignore,no_run
7268 /// # use google_cloud_vmmigration_v1::model::UpdateSourceRequest;
7269 /// use google_cloud_vmmigration_v1::model::Source;
7270 /// let x = UpdateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
7271 /// let x = UpdateSourceRequest::new().set_or_clear_source(None::<Source>);
7272 /// ```
7273 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
7274 where
7275 T: std::convert::Into<crate::model::Source>,
7276 {
7277 self.source = v.map(|x| x.into());
7278 self
7279 }
7280
7281 /// Sets the value of [request_id][crate::model::UpdateSourceRequest::request_id].
7282 ///
7283 /// # Example
7284 /// ```ignore,no_run
7285 /// # use google_cloud_vmmigration_v1::model::UpdateSourceRequest;
7286 /// let x = UpdateSourceRequest::new().set_request_id("example");
7287 /// ```
7288 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7289 self.request_id = v.into();
7290 self
7291 }
7292}
7293
7294impl wkt::message::Message for UpdateSourceRequest {
7295 fn typename() -> &'static str {
7296 "type.googleapis.com/google.cloud.vmmigration.v1.UpdateSourceRequest"
7297 }
7298}
7299
7300/// Request message for 'DeleteSource' request.
7301#[derive(Clone, Default, PartialEq)]
7302#[non_exhaustive]
7303pub struct DeleteSourceRequest {
7304 /// Required. The Source name.
7305 pub name: std::string::String,
7306
7307 /// Optional. A request ID to identify requests. Specify a unique request ID
7308 /// so that if you must retry your request, the server will know to ignore
7309 /// the request if it has already been completed. The server will guarantee
7310 /// that for at least 60 minutes after the first request.
7311 ///
7312 /// For example, consider a situation where you make an initial request and
7313 /// the request times out. If you make the request again with the same request
7314 /// ID, the server can check if original operation with the same request ID
7315 /// was received, and if so, will ignore the second request. This prevents
7316 /// clients from accidentally creating duplicate commitments.
7317 ///
7318 /// The request ID must be a valid UUID with the exception that zero UUID is
7319 /// not supported (00000000-0000-0000-0000-000000000000).
7320 pub request_id: std::string::String,
7321
7322 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7323}
7324
7325impl DeleteSourceRequest {
7326 /// Creates a new default instance.
7327 pub fn new() -> Self {
7328 std::default::Default::default()
7329 }
7330
7331 /// Sets the value of [name][crate::model::DeleteSourceRequest::name].
7332 ///
7333 /// # Example
7334 /// ```ignore,no_run
7335 /// # use google_cloud_vmmigration_v1::model::DeleteSourceRequest;
7336 /// # let project_id = "project_id";
7337 /// # let location_id = "location_id";
7338 /// # let source_id = "source_id";
7339 /// let x = DeleteSourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
7340 /// ```
7341 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7342 self.name = v.into();
7343 self
7344 }
7345
7346 /// Sets the value of [request_id][crate::model::DeleteSourceRequest::request_id].
7347 ///
7348 /// # Example
7349 /// ```ignore,no_run
7350 /// # use google_cloud_vmmigration_v1::model::DeleteSourceRequest;
7351 /// let x = DeleteSourceRequest::new().set_request_id("example");
7352 /// ```
7353 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7354 self.request_id = v.into();
7355 self
7356 }
7357}
7358
7359impl wkt::message::Message for DeleteSourceRequest {
7360 fn typename() -> &'static str {
7361 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteSourceRequest"
7362 }
7363}
7364
7365/// Request message for
7366/// [fetchInventory][google.cloud.vmmigration.v1.VmMigration.FetchInventory].
7367///
7368/// [google.cloud.vmmigration.v1.VmMigration.FetchInventory]: crate::client::VmMigration::fetch_inventory
7369#[derive(Clone, Default, PartialEq)]
7370#[non_exhaustive]
7371pub struct FetchInventoryRequest {
7372 /// Required. The name of the Source.
7373 pub source: std::string::String,
7374
7375 /// If this flag is set to true, the source will be queried instead of using
7376 /// cached results. Using this flag will make the call slower.
7377 pub force_refresh: bool,
7378
7379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7380}
7381
7382impl FetchInventoryRequest {
7383 /// Creates a new default instance.
7384 pub fn new() -> Self {
7385 std::default::Default::default()
7386 }
7387
7388 /// Sets the value of [source][crate::model::FetchInventoryRequest::source].
7389 ///
7390 /// # Example
7391 /// ```ignore,no_run
7392 /// # use google_cloud_vmmigration_v1::model::FetchInventoryRequest;
7393 /// # let project_id = "project_id";
7394 /// # let location_id = "location_id";
7395 /// # let source_id = "source_id";
7396 /// let x = FetchInventoryRequest::new().set_source(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
7397 /// ```
7398 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7399 self.source = v.into();
7400 self
7401 }
7402
7403 /// Sets the value of [force_refresh][crate::model::FetchInventoryRequest::force_refresh].
7404 ///
7405 /// # Example
7406 /// ```ignore,no_run
7407 /// # use google_cloud_vmmigration_v1::model::FetchInventoryRequest;
7408 /// let x = FetchInventoryRequest::new().set_force_refresh(true);
7409 /// ```
7410 pub fn set_force_refresh<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7411 self.force_refresh = v.into();
7412 self
7413 }
7414}
7415
7416impl wkt::message::Message for FetchInventoryRequest {
7417 fn typename() -> &'static str {
7418 "type.googleapis.com/google.cloud.vmmigration.v1.FetchInventoryRequest"
7419 }
7420}
7421
7422/// VmwareVmDetails describes a VM in vCenter.
7423#[derive(Clone, Default, PartialEq)]
7424#[non_exhaustive]
7425pub struct VmwareVmDetails {
7426 /// The VM's id in the source (note that this is not the MigratingVm's id).
7427 /// This is the moref id of the VM.
7428 pub vm_id: std::string::String,
7429
7430 /// The id of the vCenter's datacenter this VM is contained in.
7431 pub datacenter_id: std::string::String,
7432
7433 /// The descriptive name of the vCenter's datacenter this VM is contained in.
7434 pub datacenter_description: std::string::String,
7435
7436 /// The unique identifier of the VM in vCenter.
7437 pub uuid: std::string::String,
7438
7439 /// The display name of the VM. Note that this is not necessarily unique.
7440 pub display_name: std::string::String,
7441
7442 /// The power state of the VM at the moment list was taken.
7443 pub power_state: crate::model::vmware_vm_details::PowerState,
7444
7445 /// The number of cpus in the VM.
7446 pub cpu_count: i32,
7447
7448 /// The size of the memory of the VM in MB.
7449 pub memory_mb: i32,
7450
7451 /// The number of disks the VM has.
7452 pub disk_count: i32,
7453
7454 /// The total size of the storage allocated to the VM in MB.
7455 pub committed_storage_mb: i64,
7456
7457 /// The VM's OS. See for example
7458 /// <https://vdc-repo.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html>
7459 /// for types of strings this might hold.
7460 pub guest_description: std::string::String,
7461
7462 /// Output only. The VM Boot Option.
7463 pub boot_option: crate::model::vmware_vm_details::BootOption,
7464
7465 /// Output only. The CPU architecture.
7466 pub architecture: crate::model::vmware_vm_details::VmArchitecture,
7467
7468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7469}
7470
7471impl VmwareVmDetails {
7472 /// Creates a new default instance.
7473 pub fn new() -> Self {
7474 std::default::Default::default()
7475 }
7476
7477 /// Sets the value of [vm_id][crate::model::VmwareVmDetails::vm_id].
7478 ///
7479 /// # Example
7480 /// ```ignore,no_run
7481 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7482 /// let x = VmwareVmDetails::new().set_vm_id("example");
7483 /// ```
7484 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7485 self.vm_id = v.into();
7486 self
7487 }
7488
7489 /// Sets the value of [datacenter_id][crate::model::VmwareVmDetails::datacenter_id].
7490 ///
7491 /// # Example
7492 /// ```ignore,no_run
7493 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7494 /// let x = VmwareVmDetails::new().set_datacenter_id("example");
7495 /// ```
7496 pub fn set_datacenter_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7497 self.datacenter_id = v.into();
7498 self
7499 }
7500
7501 /// Sets the value of [datacenter_description][crate::model::VmwareVmDetails::datacenter_description].
7502 ///
7503 /// # Example
7504 /// ```ignore,no_run
7505 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7506 /// let x = VmwareVmDetails::new().set_datacenter_description("example");
7507 /// ```
7508 pub fn set_datacenter_description<T: std::convert::Into<std::string::String>>(
7509 mut self,
7510 v: T,
7511 ) -> Self {
7512 self.datacenter_description = v.into();
7513 self
7514 }
7515
7516 /// Sets the value of [uuid][crate::model::VmwareVmDetails::uuid].
7517 ///
7518 /// # Example
7519 /// ```ignore,no_run
7520 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7521 /// let x = VmwareVmDetails::new().set_uuid("example");
7522 /// ```
7523 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7524 self.uuid = v.into();
7525 self
7526 }
7527
7528 /// Sets the value of [display_name][crate::model::VmwareVmDetails::display_name].
7529 ///
7530 /// # Example
7531 /// ```ignore,no_run
7532 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7533 /// let x = VmwareVmDetails::new().set_display_name("example");
7534 /// ```
7535 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7536 self.display_name = v.into();
7537 self
7538 }
7539
7540 /// Sets the value of [power_state][crate::model::VmwareVmDetails::power_state].
7541 ///
7542 /// # Example
7543 /// ```ignore,no_run
7544 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7545 /// use google_cloud_vmmigration_v1::model::vmware_vm_details::PowerState;
7546 /// let x0 = VmwareVmDetails::new().set_power_state(PowerState::On);
7547 /// let x1 = VmwareVmDetails::new().set_power_state(PowerState::Off);
7548 /// let x2 = VmwareVmDetails::new().set_power_state(PowerState::Suspended);
7549 /// ```
7550 pub fn set_power_state<T: std::convert::Into<crate::model::vmware_vm_details::PowerState>>(
7551 mut self,
7552 v: T,
7553 ) -> Self {
7554 self.power_state = v.into();
7555 self
7556 }
7557
7558 /// Sets the value of [cpu_count][crate::model::VmwareVmDetails::cpu_count].
7559 ///
7560 /// # Example
7561 /// ```ignore,no_run
7562 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7563 /// let x = VmwareVmDetails::new().set_cpu_count(42);
7564 /// ```
7565 pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7566 self.cpu_count = v.into();
7567 self
7568 }
7569
7570 /// Sets the value of [memory_mb][crate::model::VmwareVmDetails::memory_mb].
7571 ///
7572 /// # Example
7573 /// ```ignore,no_run
7574 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7575 /// let x = VmwareVmDetails::new().set_memory_mb(42);
7576 /// ```
7577 pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7578 self.memory_mb = v.into();
7579 self
7580 }
7581
7582 /// Sets the value of [disk_count][crate::model::VmwareVmDetails::disk_count].
7583 ///
7584 /// # Example
7585 /// ```ignore,no_run
7586 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7587 /// let x = VmwareVmDetails::new().set_disk_count(42);
7588 /// ```
7589 pub fn set_disk_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7590 self.disk_count = v.into();
7591 self
7592 }
7593
7594 /// Sets the value of [committed_storage_mb][crate::model::VmwareVmDetails::committed_storage_mb].
7595 ///
7596 /// # Example
7597 /// ```ignore,no_run
7598 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7599 /// let x = VmwareVmDetails::new().set_committed_storage_mb(42);
7600 /// ```
7601 pub fn set_committed_storage_mb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7602 self.committed_storage_mb = v.into();
7603 self
7604 }
7605
7606 /// Sets the value of [guest_description][crate::model::VmwareVmDetails::guest_description].
7607 ///
7608 /// # Example
7609 /// ```ignore,no_run
7610 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7611 /// let x = VmwareVmDetails::new().set_guest_description("example");
7612 /// ```
7613 pub fn set_guest_description<T: std::convert::Into<std::string::String>>(
7614 mut self,
7615 v: T,
7616 ) -> Self {
7617 self.guest_description = v.into();
7618 self
7619 }
7620
7621 /// Sets the value of [boot_option][crate::model::VmwareVmDetails::boot_option].
7622 ///
7623 /// # Example
7624 /// ```ignore,no_run
7625 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7626 /// use google_cloud_vmmigration_v1::model::vmware_vm_details::BootOption;
7627 /// let x0 = VmwareVmDetails::new().set_boot_option(BootOption::Efi);
7628 /// let x1 = VmwareVmDetails::new().set_boot_option(BootOption::Bios);
7629 /// ```
7630 pub fn set_boot_option<T: std::convert::Into<crate::model::vmware_vm_details::BootOption>>(
7631 mut self,
7632 v: T,
7633 ) -> Self {
7634 self.boot_option = v.into();
7635 self
7636 }
7637
7638 /// Sets the value of [architecture][crate::model::VmwareVmDetails::architecture].
7639 ///
7640 /// # Example
7641 /// ```ignore,no_run
7642 /// # use google_cloud_vmmigration_v1::model::VmwareVmDetails;
7643 /// use google_cloud_vmmigration_v1::model::vmware_vm_details::VmArchitecture;
7644 /// let x0 = VmwareVmDetails::new().set_architecture(VmArchitecture::X86Family);
7645 /// let x1 = VmwareVmDetails::new().set_architecture(VmArchitecture::Arm64);
7646 /// ```
7647 pub fn set_architecture<
7648 T: std::convert::Into<crate::model::vmware_vm_details::VmArchitecture>,
7649 >(
7650 mut self,
7651 v: T,
7652 ) -> Self {
7653 self.architecture = v.into();
7654 self
7655 }
7656}
7657
7658impl wkt::message::Message for VmwareVmDetails {
7659 fn typename() -> &'static str {
7660 "type.googleapis.com/google.cloud.vmmigration.v1.VmwareVmDetails"
7661 }
7662}
7663
7664/// Defines additional types related to [VmwareVmDetails].
7665pub mod vmware_vm_details {
7666 #[allow(unused_imports)]
7667 use super::*;
7668
7669 /// Possible values for the power state of the VM.
7670 ///
7671 /// # Working with unknown values
7672 ///
7673 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7674 /// additional enum variants at any time. Adding new variants is not considered
7675 /// a breaking change. Applications should write their code in anticipation of:
7676 ///
7677 /// - New values appearing in future releases of the client library, **and**
7678 /// - New values received dynamically, without application changes.
7679 ///
7680 /// Please consult the [Working with enums] section in the user guide for some
7681 /// guidelines.
7682 ///
7683 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7684 #[derive(Clone, Debug, PartialEq)]
7685 #[non_exhaustive]
7686 pub enum PowerState {
7687 /// Power state is not specified.
7688 Unspecified,
7689 /// The VM is turned ON.
7690 On,
7691 /// The VM is turned OFF.
7692 Off,
7693 /// The VM is suspended. This is similar to hibernation or sleep mode.
7694 Suspended,
7695 /// If set, the enum was initialized with an unknown value.
7696 ///
7697 /// Applications can examine the value using [PowerState::value] or
7698 /// [PowerState::name].
7699 UnknownValue(power_state::UnknownValue),
7700 }
7701
7702 #[doc(hidden)]
7703 pub mod power_state {
7704 #[allow(unused_imports)]
7705 use super::*;
7706 #[derive(Clone, Debug, PartialEq)]
7707 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7708 }
7709
7710 impl PowerState {
7711 /// Gets the enum value.
7712 ///
7713 /// Returns `None` if the enum contains an unknown value deserialized from
7714 /// the string representation of enums.
7715 pub fn value(&self) -> std::option::Option<i32> {
7716 match self {
7717 Self::Unspecified => std::option::Option::Some(0),
7718 Self::On => std::option::Option::Some(1),
7719 Self::Off => std::option::Option::Some(2),
7720 Self::Suspended => std::option::Option::Some(3),
7721 Self::UnknownValue(u) => u.0.value(),
7722 }
7723 }
7724
7725 /// Gets the enum value as a string.
7726 ///
7727 /// Returns `None` if the enum contains an unknown value deserialized from
7728 /// the integer representation of enums.
7729 pub fn name(&self) -> std::option::Option<&str> {
7730 match self {
7731 Self::Unspecified => std::option::Option::Some("POWER_STATE_UNSPECIFIED"),
7732 Self::On => std::option::Option::Some("ON"),
7733 Self::Off => std::option::Option::Some("OFF"),
7734 Self::Suspended => std::option::Option::Some("SUSPENDED"),
7735 Self::UnknownValue(u) => u.0.name(),
7736 }
7737 }
7738 }
7739
7740 impl std::default::Default for PowerState {
7741 fn default() -> Self {
7742 use std::convert::From;
7743 Self::from(0)
7744 }
7745 }
7746
7747 impl std::fmt::Display for PowerState {
7748 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7749 wkt::internal::display_enum(f, self.name(), self.value())
7750 }
7751 }
7752
7753 impl std::convert::From<i32> for PowerState {
7754 fn from(value: i32) -> Self {
7755 match value {
7756 0 => Self::Unspecified,
7757 1 => Self::On,
7758 2 => Self::Off,
7759 3 => Self::Suspended,
7760 _ => Self::UnknownValue(power_state::UnknownValue(
7761 wkt::internal::UnknownEnumValue::Integer(value),
7762 )),
7763 }
7764 }
7765 }
7766
7767 impl std::convert::From<&str> for PowerState {
7768 fn from(value: &str) -> Self {
7769 use std::string::ToString;
7770 match value {
7771 "POWER_STATE_UNSPECIFIED" => Self::Unspecified,
7772 "ON" => Self::On,
7773 "OFF" => Self::Off,
7774 "SUSPENDED" => Self::Suspended,
7775 _ => Self::UnknownValue(power_state::UnknownValue(
7776 wkt::internal::UnknownEnumValue::String(value.to_string()),
7777 )),
7778 }
7779 }
7780 }
7781
7782 impl serde::ser::Serialize for PowerState {
7783 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7784 where
7785 S: serde::Serializer,
7786 {
7787 match self {
7788 Self::Unspecified => serializer.serialize_i32(0),
7789 Self::On => serializer.serialize_i32(1),
7790 Self::Off => serializer.serialize_i32(2),
7791 Self::Suspended => serializer.serialize_i32(3),
7792 Self::UnknownValue(u) => u.0.serialize(serializer),
7793 }
7794 }
7795 }
7796
7797 impl<'de> serde::de::Deserialize<'de> for PowerState {
7798 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7799 where
7800 D: serde::Deserializer<'de>,
7801 {
7802 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PowerState>::new(
7803 ".google.cloud.vmmigration.v1.VmwareVmDetails.PowerState",
7804 ))
7805 }
7806 }
7807
7808 /// Possible values for vm boot option.
7809 ///
7810 /// # Working with unknown values
7811 ///
7812 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7813 /// additional enum variants at any time. Adding new variants is not considered
7814 /// a breaking change. Applications should write their code in anticipation of:
7815 ///
7816 /// - New values appearing in future releases of the client library, **and**
7817 /// - New values received dynamically, without application changes.
7818 ///
7819 /// Please consult the [Working with enums] section in the user guide for some
7820 /// guidelines.
7821 ///
7822 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7823 #[derive(Clone, Debug, PartialEq)]
7824 #[non_exhaustive]
7825 pub enum BootOption {
7826 /// The boot option is unknown.
7827 Unspecified,
7828 /// The boot option is EFI.
7829 Efi,
7830 /// The boot option is BIOS.
7831 Bios,
7832 /// If set, the enum was initialized with an unknown value.
7833 ///
7834 /// Applications can examine the value using [BootOption::value] or
7835 /// [BootOption::name].
7836 UnknownValue(boot_option::UnknownValue),
7837 }
7838
7839 #[doc(hidden)]
7840 pub mod boot_option {
7841 #[allow(unused_imports)]
7842 use super::*;
7843 #[derive(Clone, Debug, PartialEq)]
7844 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7845 }
7846
7847 impl BootOption {
7848 /// Gets the enum value.
7849 ///
7850 /// Returns `None` if the enum contains an unknown value deserialized from
7851 /// the string representation of enums.
7852 pub fn value(&self) -> std::option::Option<i32> {
7853 match self {
7854 Self::Unspecified => std::option::Option::Some(0),
7855 Self::Efi => std::option::Option::Some(1),
7856 Self::Bios => std::option::Option::Some(2),
7857 Self::UnknownValue(u) => u.0.value(),
7858 }
7859 }
7860
7861 /// Gets the enum value as a string.
7862 ///
7863 /// Returns `None` if the enum contains an unknown value deserialized from
7864 /// the integer representation of enums.
7865 pub fn name(&self) -> std::option::Option<&str> {
7866 match self {
7867 Self::Unspecified => std::option::Option::Some("BOOT_OPTION_UNSPECIFIED"),
7868 Self::Efi => std::option::Option::Some("EFI"),
7869 Self::Bios => std::option::Option::Some("BIOS"),
7870 Self::UnknownValue(u) => u.0.name(),
7871 }
7872 }
7873 }
7874
7875 impl std::default::Default for BootOption {
7876 fn default() -> Self {
7877 use std::convert::From;
7878 Self::from(0)
7879 }
7880 }
7881
7882 impl std::fmt::Display for BootOption {
7883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7884 wkt::internal::display_enum(f, self.name(), self.value())
7885 }
7886 }
7887
7888 impl std::convert::From<i32> for BootOption {
7889 fn from(value: i32) -> Self {
7890 match value {
7891 0 => Self::Unspecified,
7892 1 => Self::Efi,
7893 2 => Self::Bios,
7894 _ => Self::UnknownValue(boot_option::UnknownValue(
7895 wkt::internal::UnknownEnumValue::Integer(value),
7896 )),
7897 }
7898 }
7899 }
7900
7901 impl std::convert::From<&str> for BootOption {
7902 fn from(value: &str) -> Self {
7903 use std::string::ToString;
7904 match value {
7905 "BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
7906 "EFI" => Self::Efi,
7907 "BIOS" => Self::Bios,
7908 _ => Self::UnknownValue(boot_option::UnknownValue(
7909 wkt::internal::UnknownEnumValue::String(value.to_string()),
7910 )),
7911 }
7912 }
7913 }
7914
7915 impl serde::ser::Serialize for BootOption {
7916 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7917 where
7918 S: serde::Serializer,
7919 {
7920 match self {
7921 Self::Unspecified => serializer.serialize_i32(0),
7922 Self::Efi => serializer.serialize_i32(1),
7923 Self::Bios => serializer.serialize_i32(2),
7924 Self::UnknownValue(u) => u.0.serialize(serializer),
7925 }
7926 }
7927 }
7928
7929 impl<'de> serde::de::Deserialize<'de> for BootOption {
7930 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7931 where
7932 D: serde::Deserializer<'de>,
7933 {
7934 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootOption>::new(
7935 ".google.cloud.vmmigration.v1.VmwareVmDetails.BootOption",
7936 ))
7937 }
7938 }
7939
7940 /// Possible values for the VM architecture.
7941 ///
7942 /// # Working with unknown values
7943 ///
7944 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7945 /// additional enum variants at any time. Adding new variants is not considered
7946 /// a breaking change. Applications should write their code in anticipation of:
7947 ///
7948 /// - New values appearing in future releases of the client library, **and**
7949 /// - New values received dynamically, without application changes.
7950 ///
7951 /// Please consult the [Working with enums] section in the user guide for some
7952 /// guidelines.
7953 ///
7954 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7955 #[derive(Clone, Debug, PartialEq)]
7956 #[non_exhaustive]
7957 pub enum VmArchitecture {
7958 /// The architecture is unknown.
7959 Unspecified,
7960 /// The architecture is one of the x86 architectures.
7961 X86Family,
7962 /// The architecture is ARM64.
7963 Arm64,
7964 /// If set, the enum was initialized with an unknown value.
7965 ///
7966 /// Applications can examine the value using [VmArchitecture::value] or
7967 /// [VmArchitecture::name].
7968 UnknownValue(vm_architecture::UnknownValue),
7969 }
7970
7971 #[doc(hidden)]
7972 pub mod vm_architecture {
7973 #[allow(unused_imports)]
7974 use super::*;
7975 #[derive(Clone, Debug, PartialEq)]
7976 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7977 }
7978
7979 impl VmArchitecture {
7980 /// Gets the enum value.
7981 ///
7982 /// Returns `None` if the enum contains an unknown value deserialized from
7983 /// the string representation of enums.
7984 pub fn value(&self) -> std::option::Option<i32> {
7985 match self {
7986 Self::Unspecified => std::option::Option::Some(0),
7987 Self::X86Family => std::option::Option::Some(1),
7988 Self::Arm64 => std::option::Option::Some(2),
7989 Self::UnknownValue(u) => u.0.value(),
7990 }
7991 }
7992
7993 /// Gets the enum value as a string.
7994 ///
7995 /// Returns `None` if the enum contains an unknown value deserialized from
7996 /// the integer representation of enums.
7997 pub fn name(&self) -> std::option::Option<&str> {
7998 match self {
7999 Self::Unspecified => std::option::Option::Some("VM_ARCHITECTURE_UNSPECIFIED"),
8000 Self::X86Family => std::option::Option::Some("VM_ARCHITECTURE_X86_FAMILY"),
8001 Self::Arm64 => std::option::Option::Some("VM_ARCHITECTURE_ARM64"),
8002 Self::UnknownValue(u) => u.0.name(),
8003 }
8004 }
8005 }
8006
8007 impl std::default::Default for VmArchitecture {
8008 fn default() -> Self {
8009 use std::convert::From;
8010 Self::from(0)
8011 }
8012 }
8013
8014 impl std::fmt::Display for VmArchitecture {
8015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8016 wkt::internal::display_enum(f, self.name(), self.value())
8017 }
8018 }
8019
8020 impl std::convert::From<i32> for VmArchitecture {
8021 fn from(value: i32) -> Self {
8022 match value {
8023 0 => Self::Unspecified,
8024 1 => Self::X86Family,
8025 2 => Self::Arm64,
8026 _ => Self::UnknownValue(vm_architecture::UnknownValue(
8027 wkt::internal::UnknownEnumValue::Integer(value),
8028 )),
8029 }
8030 }
8031 }
8032
8033 impl std::convert::From<&str> for VmArchitecture {
8034 fn from(value: &str) -> Self {
8035 use std::string::ToString;
8036 match value {
8037 "VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
8038 "VM_ARCHITECTURE_X86_FAMILY" => Self::X86Family,
8039 "VM_ARCHITECTURE_ARM64" => Self::Arm64,
8040 _ => Self::UnknownValue(vm_architecture::UnknownValue(
8041 wkt::internal::UnknownEnumValue::String(value.to_string()),
8042 )),
8043 }
8044 }
8045 }
8046
8047 impl serde::ser::Serialize for VmArchitecture {
8048 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8049 where
8050 S: serde::Serializer,
8051 {
8052 match self {
8053 Self::Unspecified => serializer.serialize_i32(0),
8054 Self::X86Family => serializer.serialize_i32(1),
8055 Self::Arm64 => serializer.serialize_i32(2),
8056 Self::UnknownValue(u) => u.0.serialize(serializer),
8057 }
8058 }
8059 }
8060
8061 impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
8062 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8063 where
8064 D: serde::Deserializer<'de>,
8065 {
8066 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
8067 ".google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitecture",
8068 ))
8069 }
8070 }
8071}
8072
8073/// AwsVmDetails describes a VM in AWS.
8074#[derive(Clone, Default, PartialEq)]
8075#[non_exhaustive]
8076pub struct AwsVmDetails {
8077 /// The VM ID in AWS.
8078 pub vm_id: std::string::String,
8079
8080 /// The display name of the VM. Note that this value is not necessarily unique.
8081 pub display_name: std::string::String,
8082
8083 /// The id of the AWS's source this VM is connected to.
8084 pub source_id: std::string::String,
8085
8086 /// The descriptive name of the AWS's source this VM is connected to.
8087 pub source_description: std::string::String,
8088
8089 /// Output only. The power state of the VM at the moment list was taken.
8090 pub power_state: crate::model::aws_vm_details::PowerState,
8091
8092 /// The number of CPU cores the VM has.
8093 pub cpu_count: i32,
8094
8095 /// The memory size of the VM in MB.
8096 pub memory_mb: i32,
8097
8098 /// The number of disks the VM has.
8099 pub disk_count: i32,
8100
8101 /// The total size of the storage allocated to the VM in MB.
8102 pub committed_storage_mb: i64,
8103
8104 /// The VM's OS.
8105 pub os_description: std::string::String,
8106
8107 /// The VM Boot Option.
8108 pub boot_option: crate::model::aws_vm_details::BootOption,
8109
8110 /// The instance type of the VM.
8111 pub instance_type: std::string::String,
8112
8113 /// The VPC ID the VM belongs to.
8114 pub vpc_id: std::string::String,
8115
8116 /// The security groups the VM belongs to.
8117 pub security_groups: std::vec::Vec<crate::model::AwsSecurityGroup>,
8118
8119 /// The tags of the VM.
8120 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
8121
8122 /// The AWS zone of the VM.
8123 pub zone: std::string::String,
8124
8125 /// The virtualization type.
8126 pub virtualization_type: crate::model::aws_vm_details::VmVirtualizationType,
8127
8128 /// The CPU architecture.
8129 pub architecture: crate::model::aws_vm_details::VmArchitecture,
8130
8131 /// The number of vCPUs the VM has. It is calculated as the
8132 /// number of CPU cores * threads per CPU the VM has.
8133 pub vcpu_count: i32,
8134
8135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8136}
8137
8138impl AwsVmDetails {
8139 /// Creates a new default instance.
8140 pub fn new() -> Self {
8141 std::default::Default::default()
8142 }
8143
8144 /// Sets the value of [vm_id][crate::model::AwsVmDetails::vm_id].
8145 ///
8146 /// # Example
8147 /// ```ignore,no_run
8148 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8149 /// let x = AwsVmDetails::new().set_vm_id("example");
8150 /// ```
8151 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8152 self.vm_id = v.into();
8153 self
8154 }
8155
8156 /// Sets the value of [display_name][crate::model::AwsVmDetails::display_name].
8157 ///
8158 /// # Example
8159 /// ```ignore,no_run
8160 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8161 /// let x = AwsVmDetails::new().set_display_name("example");
8162 /// ```
8163 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8164 self.display_name = v.into();
8165 self
8166 }
8167
8168 /// Sets the value of [source_id][crate::model::AwsVmDetails::source_id].
8169 ///
8170 /// # Example
8171 /// ```ignore,no_run
8172 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8173 /// let x = AwsVmDetails::new().set_source_id("example");
8174 /// ```
8175 pub fn set_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8176 self.source_id = v.into();
8177 self
8178 }
8179
8180 /// Sets the value of [source_description][crate::model::AwsVmDetails::source_description].
8181 ///
8182 /// # Example
8183 /// ```ignore,no_run
8184 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8185 /// let x = AwsVmDetails::new().set_source_description("example");
8186 /// ```
8187 pub fn set_source_description<T: std::convert::Into<std::string::String>>(
8188 mut self,
8189 v: T,
8190 ) -> Self {
8191 self.source_description = v.into();
8192 self
8193 }
8194
8195 /// Sets the value of [power_state][crate::model::AwsVmDetails::power_state].
8196 ///
8197 /// # Example
8198 /// ```ignore,no_run
8199 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8200 /// use google_cloud_vmmigration_v1::model::aws_vm_details::PowerState;
8201 /// let x0 = AwsVmDetails::new().set_power_state(PowerState::On);
8202 /// let x1 = AwsVmDetails::new().set_power_state(PowerState::Off);
8203 /// let x2 = AwsVmDetails::new().set_power_state(PowerState::Suspended);
8204 /// ```
8205 pub fn set_power_state<T: std::convert::Into<crate::model::aws_vm_details::PowerState>>(
8206 mut self,
8207 v: T,
8208 ) -> Self {
8209 self.power_state = v.into();
8210 self
8211 }
8212
8213 /// Sets the value of [cpu_count][crate::model::AwsVmDetails::cpu_count].
8214 ///
8215 /// # Example
8216 /// ```ignore,no_run
8217 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8218 /// let x = AwsVmDetails::new().set_cpu_count(42);
8219 /// ```
8220 pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8221 self.cpu_count = v.into();
8222 self
8223 }
8224
8225 /// Sets the value of [memory_mb][crate::model::AwsVmDetails::memory_mb].
8226 ///
8227 /// # Example
8228 /// ```ignore,no_run
8229 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8230 /// let x = AwsVmDetails::new().set_memory_mb(42);
8231 /// ```
8232 pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8233 self.memory_mb = v.into();
8234 self
8235 }
8236
8237 /// Sets the value of [disk_count][crate::model::AwsVmDetails::disk_count].
8238 ///
8239 /// # Example
8240 /// ```ignore,no_run
8241 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8242 /// let x = AwsVmDetails::new().set_disk_count(42);
8243 /// ```
8244 pub fn set_disk_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8245 self.disk_count = v.into();
8246 self
8247 }
8248
8249 /// Sets the value of [committed_storage_mb][crate::model::AwsVmDetails::committed_storage_mb].
8250 ///
8251 /// # Example
8252 /// ```ignore,no_run
8253 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8254 /// let x = AwsVmDetails::new().set_committed_storage_mb(42);
8255 /// ```
8256 pub fn set_committed_storage_mb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8257 self.committed_storage_mb = v.into();
8258 self
8259 }
8260
8261 /// Sets the value of [os_description][crate::model::AwsVmDetails::os_description].
8262 ///
8263 /// # Example
8264 /// ```ignore,no_run
8265 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8266 /// let x = AwsVmDetails::new().set_os_description("example");
8267 /// ```
8268 pub fn set_os_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8269 self.os_description = v.into();
8270 self
8271 }
8272
8273 /// Sets the value of [boot_option][crate::model::AwsVmDetails::boot_option].
8274 ///
8275 /// # Example
8276 /// ```ignore,no_run
8277 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8278 /// use google_cloud_vmmigration_v1::model::aws_vm_details::BootOption;
8279 /// let x0 = AwsVmDetails::new().set_boot_option(BootOption::Efi);
8280 /// let x1 = AwsVmDetails::new().set_boot_option(BootOption::Bios);
8281 /// ```
8282 pub fn set_boot_option<T: std::convert::Into<crate::model::aws_vm_details::BootOption>>(
8283 mut self,
8284 v: T,
8285 ) -> Self {
8286 self.boot_option = v.into();
8287 self
8288 }
8289
8290 /// Sets the value of [instance_type][crate::model::AwsVmDetails::instance_type].
8291 ///
8292 /// # Example
8293 /// ```ignore,no_run
8294 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8295 /// let x = AwsVmDetails::new().set_instance_type("example");
8296 /// ```
8297 pub fn set_instance_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8298 self.instance_type = v.into();
8299 self
8300 }
8301
8302 /// Sets the value of [vpc_id][crate::model::AwsVmDetails::vpc_id].
8303 ///
8304 /// # Example
8305 /// ```ignore,no_run
8306 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8307 /// let x = AwsVmDetails::new().set_vpc_id("example");
8308 /// ```
8309 pub fn set_vpc_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8310 self.vpc_id = v.into();
8311 self
8312 }
8313
8314 /// Sets the value of [security_groups][crate::model::AwsVmDetails::security_groups].
8315 ///
8316 /// # Example
8317 /// ```ignore,no_run
8318 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8319 /// use google_cloud_vmmigration_v1::model::AwsSecurityGroup;
8320 /// let x = AwsVmDetails::new()
8321 /// .set_security_groups([
8322 /// AwsSecurityGroup::default()/* use setters */,
8323 /// AwsSecurityGroup::default()/* use (different) setters */,
8324 /// ]);
8325 /// ```
8326 pub fn set_security_groups<T, V>(mut self, v: T) -> Self
8327 where
8328 T: std::iter::IntoIterator<Item = V>,
8329 V: std::convert::Into<crate::model::AwsSecurityGroup>,
8330 {
8331 use std::iter::Iterator;
8332 self.security_groups = v.into_iter().map(|i| i.into()).collect();
8333 self
8334 }
8335
8336 /// Sets the value of [tags][crate::model::AwsVmDetails::tags].
8337 ///
8338 /// # Example
8339 /// ```ignore,no_run
8340 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8341 /// let x = AwsVmDetails::new().set_tags([
8342 /// ("key0", "abc"),
8343 /// ("key1", "xyz"),
8344 /// ]);
8345 /// ```
8346 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
8347 where
8348 T: std::iter::IntoIterator<Item = (K, V)>,
8349 K: std::convert::Into<std::string::String>,
8350 V: std::convert::Into<std::string::String>,
8351 {
8352 use std::iter::Iterator;
8353 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8354 self
8355 }
8356
8357 /// Sets the value of [zone][crate::model::AwsVmDetails::zone].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8362 /// let x = AwsVmDetails::new().set_zone("example");
8363 /// ```
8364 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8365 self.zone = v.into();
8366 self
8367 }
8368
8369 /// Sets the value of [virtualization_type][crate::model::AwsVmDetails::virtualization_type].
8370 ///
8371 /// # Example
8372 /// ```ignore,no_run
8373 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8374 /// use google_cloud_vmmigration_v1::model::aws_vm_details::VmVirtualizationType;
8375 /// let x0 = AwsVmDetails::new().set_virtualization_type(VmVirtualizationType::Hvm);
8376 /// let x1 = AwsVmDetails::new().set_virtualization_type(VmVirtualizationType::Paravirtual);
8377 /// ```
8378 pub fn set_virtualization_type<
8379 T: std::convert::Into<crate::model::aws_vm_details::VmVirtualizationType>,
8380 >(
8381 mut self,
8382 v: T,
8383 ) -> Self {
8384 self.virtualization_type = v.into();
8385 self
8386 }
8387
8388 /// Sets the value of [architecture][crate::model::AwsVmDetails::architecture].
8389 ///
8390 /// # Example
8391 /// ```ignore,no_run
8392 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8393 /// use google_cloud_vmmigration_v1::model::aws_vm_details::VmArchitecture;
8394 /// let x0 = AwsVmDetails::new().set_architecture(VmArchitecture::I386);
8395 /// let x1 = AwsVmDetails::new().set_architecture(VmArchitecture::X8664);
8396 /// let x2 = AwsVmDetails::new().set_architecture(VmArchitecture::Arm64);
8397 /// ```
8398 pub fn set_architecture<T: std::convert::Into<crate::model::aws_vm_details::VmArchitecture>>(
8399 mut self,
8400 v: T,
8401 ) -> Self {
8402 self.architecture = v.into();
8403 self
8404 }
8405
8406 /// Sets the value of [vcpu_count][crate::model::AwsVmDetails::vcpu_count].
8407 ///
8408 /// # Example
8409 /// ```ignore,no_run
8410 /// # use google_cloud_vmmigration_v1::model::AwsVmDetails;
8411 /// let x = AwsVmDetails::new().set_vcpu_count(42);
8412 /// ```
8413 pub fn set_vcpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8414 self.vcpu_count = v.into();
8415 self
8416 }
8417}
8418
8419impl wkt::message::Message for AwsVmDetails {
8420 fn typename() -> &'static str {
8421 "type.googleapis.com/google.cloud.vmmigration.v1.AwsVmDetails"
8422 }
8423}
8424
8425/// Defines additional types related to [AwsVmDetails].
8426pub mod aws_vm_details {
8427 #[allow(unused_imports)]
8428 use super::*;
8429
8430 /// Possible values for the power state of the VM.
8431 ///
8432 /// # Working with unknown values
8433 ///
8434 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8435 /// additional enum variants at any time. Adding new variants is not considered
8436 /// a breaking change. Applications should write their code in anticipation of:
8437 ///
8438 /// - New values appearing in future releases of the client library, **and**
8439 /// - New values received dynamically, without application changes.
8440 ///
8441 /// Please consult the [Working with enums] section in the user guide for some
8442 /// guidelines.
8443 ///
8444 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8445 #[derive(Clone, Debug, PartialEq)]
8446 #[non_exhaustive]
8447 pub enum PowerState {
8448 /// Power state is not specified.
8449 Unspecified,
8450 /// The VM is turned on.
8451 On,
8452 /// The VM is turned off.
8453 Off,
8454 /// The VM is suspended. This is similar to hibernation or sleep
8455 /// mode.
8456 Suspended,
8457 /// The VM is starting.
8458 Pending,
8459 /// If set, the enum was initialized with an unknown value.
8460 ///
8461 /// Applications can examine the value using [PowerState::value] or
8462 /// [PowerState::name].
8463 UnknownValue(power_state::UnknownValue),
8464 }
8465
8466 #[doc(hidden)]
8467 pub mod power_state {
8468 #[allow(unused_imports)]
8469 use super::*;
8470 #[derive(Clone, Debug, PartialEq)]
8471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8472 }
8473
8474 impl PowerState {
8475 /// Gets the enum value.
8476 ///
8477 /// Returns `None` if the enum contains an unknown value deserialized from
8478 /// the string representation of enums.
8479 pub fn value(&self) -> std::option::Option<i32> {
8480 match self {
8481 Self::Unspecified => std::option::Option::Some(0),
8482 Self::On => std::option::Option::Some(1),
8483 Self::Off => std::option::Option::Some(2),
8484 Self::Suspended => std::option::Option::Some(3),
8485 Self::Pending => std::option::Option::Some(4),
8486 Self::UnknownValue(u) => u.0.value(),
8487 }
8488 }
8489
8490 /// Gets the enum value as a string.
8491 ///
8492 /// Returns `None` if the enum contains an unknown value deserialized from
8493 /// the integer representation of enums.
8494 pub fn name(&self) -> std::option::Option<&str> {
8495 match self {
8496 Self::Unspecified => std::option::Option::Some("POWER_STATE_UNSPECIFIED"),
8497 Self::On => std::option::Option::Some("ON"),
8498 Self::Off => std::option::Option::Some("OFF"),
8499 Self::Suspended => std::option::Option::Some("SUSPENDED"),
8500 Self::Pending => std::option::Option::Some("PENDING"),
8501 Self::UnknownValue(u) => u.0.name(),
8502 }
8503 }
8504 }
8505
8506 impl std::default::Default for PowerState {
8507 fn default() -> Self {
8508 use std::convert::From;
8509 Self::from(0)
8510 }
8511 }
8512
8513 impl std::fmt::Display for PowerState {
8514 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8515 wkt::internal::display_enum(f, self.name(), self.value())
8516 }
8517 }
8518
8519 impl std::convert::From<i32> for PowerState {
8520 fn from(value: i32) -> Self {
8521 match value {
8522 0 => Self::Unspecified,
8523 1 => Self::On,
8524 2 => Self::Off,
8525 3 => Self::Suspended,
8526 4 => Self::Pending,
8527 _ => Self::UnknownValue(power_state::UnknownValue(
8528 wkt::internal::UnknownEnumValue::Integer(value),
8529 )),
8530 }
8531 }
8532 }
8533
8534 impl std::convert::From<&str> for PowerState {
8535 fn from(value: &str) -> Self {
8536 use std::string::ToString;
8537 match value {
8538 "POWER_STATE_UNSPECIFIED" => Self::Unspecified,
8539 "ON" => Self::On,
8540 "OFF" => Self::Off,
8541 "SUSPENDED" => Self::Suspended,
8542 "PENDING" => Self::Pending,
8543 _ => Self::UnknownValue(power_state::UnknownValue(
8544 wkt::internal::UnknownEnumValue::String(value.to_string()),
8545 )),
8546 }
8547 }
8548 }
8549
8550 impl serde::ser::Serialize for PowerState {
8551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8552 where
8553 S: serde::Serializer,
8554 {
8555 match self {
8556 Self::Unspecified => serializer.serialize_i32(0),
8557 Self::On => serializer.serialize_i32(1),
8558 Self::Off => serializer.serialize_i32(2),
8559 Self::Suspended => serializer.serialize_i32(3),
8560 Self::Pending => serializer.serialize_i32(4),
8561 Self::UnknownValue(u) => u.0.serialize(serializer),
8562 }
8563 }
8564 }
8565
8566 impl<'de> serde::de::Deserialize<'de> for PowerState {
8567 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8568 where
8569 D: serde::Deserializer<'de>,
8570 {
8571 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PowerState>::new(
8572 ".google.cloud.vmmigration.v1.AwsVmDetails.PowerState",
8573 ))
8574 }
8575 }
8576
8577 /// The possible values for the vm boot option.
8578 ///
8579 /// # Working with unknown values
8580 ///
8581 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8582 /// additional enum variants at any time. Adding new variants is not considered
8583 /// a breaking change. Applications should write their code in anticipation of:
8584 ///
8585 /// - New values appearing in future releases of the client library, **and**
8586 /// - New values received dynamically, without application changes.
8587 ///
8588 /// Please consult the [Working with enums] section in the user guide for some
8589 /// guidelines.
8590 ///
8591 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8592 #[derive(Clone, Debug, PartialEq)]
8593 #[non_exhaustive]
8594 pub enum BootOption {
8595 /// The boot option is unknown.
8596 Unspecified,
8597 /// The boot option is UEFI.
8598 Efi,
8599 /// The boot option is LEGACY-BIOS.
8600 Bios,
8601 /// If set, the enum was initialized with an unknown value.
8602 ///
8603 /// Applications can examine the value using [BootOption::value] or
8604 /// [BootOption::name].
8605 UnknownValue(boot_option::UnknownValue),
8606 }
8607
8608 #[doc(hidden)]
8609 pub mod boot_option {
8610 #[allow(unused_imports)]
8611 use super::*;
8612 #[derive(Clone, Debug, PartialEq)]
8613 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8614 }
8615
8616 impl BootOption {
8617 /// Gets the enum value.
8618 ///
8619 /// Returns `None` if the enum contains an unknown value deserialized from
8620 /// the string representation of enums.
8621 pub fn value(&self) -> std::option::Option<i32> {
8622 match self {
8623 Self::Unspecified => std::option::Option::Some(0),
8624 Self::Efi => std::option::Option::Some(1),
8625 Self::Bios => std::option::Option::Some(2),
8626 Self::UnknownValue(u) => u.0.value(),
8627 }
8628 }
8629
8630 /// Gets the enum value as a string.
8631 ///
8632 /// Returns `None` if the enum contains an unknown value deserialized from
8633 /// the integer representation of enums.
8634 pub fn name(&self) -> std::option::Option<&str> {
8635 match self {
8636 Self::Unspecified => std::option::Option::Some("BOOT_OPTION_UNSPECIFIED"),
8637 Self::Efi => std::option::Option::Some("EFI"),
8638 Self::Bios => std::option::Option::Some("BIOS"),
8639 Self::UnknownValue(u) => u.0.name(),
8640 }
8641 }
8642 }
8643
8644 impl std::default::Default for BootOption {
8645 fn default() -> Self {
8646 use std::convert::From;
8647 Self::from(0)
8648 }
8649 }
8650
8651 impl std::fmt::Display for BootOption {
8652 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8653 wkt::internal::display_enum(f, self.name(), self.value())
8654 }
8655 }
8656
8657 impl std::convert::From<i32> for BootOption {
8658 fn from(value: i32) -> Self {
8659 match value {
8660 0 => Self::Unspecified,
8661 1 => Self::Efi,
8662 2 => Self::Bios,
8663 _ => Self::UnknownValue(boot_option::UnknownValue(
8664 wkt::internal::UnknownEnumValue::Integer(value),
8665 )),
8666 }
8667 }
8668 }
8669
8670 impl std::convert::From<&str> for BootOption {
8671 fn from(value: &str) -> Self {
8672 use std::string::ToString;
8673 match value {
8674 "BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
8675 "EFI" => Self::Efi,
8676 "BIOS" => Self::Bios,
8677 _ => Self::UnknownValue(boot_option::UnknownValue(
8678 wkt::internal::UnknownEnumValue::String(value.to_string()),
8679 )),
8680 }
8681 }
8682 }
8683
8684 impl serde::ser::Serialize for BootOption {
8685 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8686 where
8687 S: serde::Serializer,
8688 {
8689 match self {
8690 Self::Unspecified => serializer.serialize_i32(0),
8691 Self::Efi => serializer.serialize_i32(1),
8692 Self::Bios => serializer.serialize_i32(2),
8693 Self::UnknownValue(u) => u.0.serialize(serializer),
8694 }
8695 }
8696 }
8697
8698 impl<'de> serde::de::Deserialize<'de> for BootOption {
8699 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8700 where
8701 D: serde::Deserializer<'de>,
8702 {
8703 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootOption>::new(
8704 ".google.cloud.vmmigration.v1.AwsVmDetails.BootOption",
8705 ))
8706 }
8707 }
8708
8709 /// Possible values for the virtualization types of the VM.
8710 ///
8711 /// # Working with unknown values
8712 ///
8713 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8714 /// additional enum variants at any time. Adding new variants is not considered
8715 /// a breaking change. Applications should write their code in anticipation of:
8716 ///
8717 /// - New values appearing in future releases of the client library, **and**
8718 /// - New values received dynamically, without application changes.
8719 ///
8720 /// Please consult the [Working with enums] section in the user guide for some
8721 /// guidelines.
8722 ///
8723 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8724 #[derive(Clone, Debug, PartialEq)]
8725 #[non_exhaustive]
8726 pub enum VmVirtualizationType {
8727 /// The virtualization type is unknown.
8728 Unspecified,
8729 /// The virtualziation type is HVM.
8730 Hvm,
8731 /// The virtualziation type is PARAVIRTUAL.
8732 Paravirtual,
8733 /// If set, the enum was initialized with an unknown value.
8734 ///
8735 /// Applications can examine the value using [VmVirtualizationType::value] or
8736 /// [VmVirtualizationType::name].
8737 UnknownValue(vm_virtualization_type::UnknownValue),
8738 }
8739
8740 #[doc(hidden)]
8741 pub mod vm_virtualization_type {
8742 #[allow(unused_imports)]
8743 use super::*;
8744 #[derive(Clone, Debug, PartialEq)]
8745 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8746 }
8747
8748 impl VmVirtualizationType {
8749 /// Gets the enum value.
8750 ///
8751 /// Returns `None` if the enum contains an unknown value deserialized from
8752 /// the string representation of enums.
8753 pub fn value(&self) -> std::option::Option<i32> {
8754 match self {
8755 Self::Unspecified => std::option::Option::Some(0),
8756 Self::Hvm => std::option::Option::Some(1),
8757 Self::Paravirtual => std::option::Option::Some(2),
8758 Self::UnknownValue(u) => u.0.value(),
8759 }
8760 }
8761
8762 /// Gets the enum value as a string.
8763 ///
8764 /// Returns `None` if the enum contains an unknown value deserialized from
8765 /// the integer representation of enums.
8766 pub fn name(&self) -> std::option::Option<&str> {
8767 match self {
8768 Self::Unspecified => {
8769 std::option::Option::Some("VM_VIRTUALIZATION_TYPE_UNSPECIFIED")
8770 }
8771 Self::Hvm => std::option::Option::Some("HVM"),
8772 Self::Paravirtual => std::option::Option::Some("PARAVIRTUAL"),
8773 Self::UnknownValue(u) => u.0.name(),
8774 }
8775 }
8776 }
8777
8778 impl std::default::Default for VmVirtualizationType {
8779 fn default() -> Self {
8780 use std::convert::From;
8781 Self::from(0)
8782 }
8783 }
8784
8785 impl std::fmt::Display for VmVirtualizationType {
8786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8787 wkt::internal::display_enum(f, self.name(), self.value())
8788 }
8789 }
8790
8791 impl std::convert::From<i32> for VmVirtualizationType {
8792 fn from(value: i32) -> Self {
8793 match value {
8794 0 => Self::Unspecified,
8795 1 => Self::Hvm,
8796 2 => Self::Paravirtual,
8797 _ => Self::UnknownValue(vm_virtualization_type::UnknownValue(
8798 wkt::internal::UnknownEnumValue::Integer(value),
8799 )),
8800 }
8801 }
8802 }
8803
8804 impl std::convert::From<&str> for VmVirtualizationType {
8805 fn from(value: &str) -> Self {
8806 use std::string::ToString;
8807 match value {
8808 "VM_VIRTUALIZATION_TYPE_UNSPECIFIED" => Self::Unspecified,
8809 "HVM" => Self::Hvm,
8810 "PARAVIRTUAL" => Self::Paravirtual,
8811 _ => Self::UnknownValue(vm_virtualization_type::UnknownValue(
8812 wkt::internal::UnknownEnumValue::String(value.to_string()),
8813 )),
8814 }
8815 }
8816 }
8817
8818 impl serde::ser::Serialize for VmVirtualizationType {
8819 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8820 where
8821 S: serde::Serializer,
8822 {
8823 match self {
8824 Self::Unspecified => serializer.serialize_i32(0),
8825 Self::Hvm => serializer.serialize_i32(1),
8826 Self::Paravirtual => serializer.serialize_i32(2),
8827 Self::UnknownValue(u) => u.0.serialize(serializer),
8828 }
8829 }
8830 }
8831
8832 impl<'de> serde::de::Deserialize<'de> for VmVirtualizationType {
8833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8834 where
8835 D: serde::Deserializer<'de>,
8836 {
8837 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmVirtualizationType>::new(
8838 ".google.cloud.vmmigration.v1.AwsVmDetails.VmVirtualizationType",
8839 ))
8840 }
8841 }
8842
8843 /// Possible values for the architectures of the VM.
8844 ///
8845 /// # Working with unknown values
8846 ///
8847 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8848 /// additional enum variants at any time. Adding new variants is not considered
8849 /// a breaking change. Applications should write their code in anticipation of:
8850 ///
8851 /// - New values appearing in future releases of the client library, **and**
8852 /// - New values received dynamically, without application changes.
8853 ///
8854 /// Please consult the [Working with enums] section in the user guide for some
8855 /// guidelines.
8856 ///
8857 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8858 #[derive(Clone, Debug, PartialEq)]
8859 #[non_exhaustive]
8860 pub enum VmArchitecture {
8861 /// The architecture is unknown.
8862 Unspecified,
8863 /// The architecture is I386.
8864 I386,
8865 /// The architecture is X86_64.
8866 X8664,
8867 /// The architecture is ARM64.
8868 Arm64,
8869 /// The architecture is X86_64_MAC.
8870 X8664Mac,
8871 /// If set, the enum was initialized with an unknown value.
8872 ///
8873 /// Applications can examine the value using [VmArchitecture::value] or
8874 /// [VmArchitecture::name].
8875 UnknownValue(vm_architecture::UnknownValue),
8876 }
8877
8878 #[doc(hidden)]
8879 pub mod vm_architecture {
8880 #[allow(unused_imports)]
8881 use super::*;
8882 #[derive(Clone, Debug, PartialEq)]
8883 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8884 }
8885
8886 impl VmArchitecture {
8887 /// Gets the enum value.
8888 ///
8889 /// Returns `None` if the enum contains an unknown value deserialized from
8890 /// the string representation of enums.
8891 pub fn value(&self) -> std::option::Option<i32> {
8892 match self {
8893 Self::Unspecified => std::option::Option::Some(0),
8894 Self::I386 => std::option::Option::Some(1),
8895 Self::X8664 => std::option::Option::Some(2),
8896 Self::Arm64 => std::option::Option::Some(3),
8897 Self::X8664Mac => std::option::Option::Some(4),
8898 Self::UnknownValue(u) => u.0.value(),
8899 }
8900 }
8901
8902 /// Gets the enum value as a string.
8903 ///
8904 /// Returns `None` if the enum contains an unknown value deserialized from
8905 /// the integer representation of enums.
8906 pub fn name(&self) -> std::option::Option<&str> {
8907 match self {
8908 Self::Unspecified => std::option::Option::Some("VM_ARCHITECTURE_UNSPECIFIED"),
8909 Self::I386 => std::option::Option::Some("I386"),
8910 Self::X8664 => std::option::Option::Some("X86_64"),
8911 Self::Arm64 => std::option::Option::Some("ARM64"),
8912 Self::X8664Mac => std::option::Option::Some("X86_64_MAC"),
8913 Self::UnknownValue(u) => u.0.name(),
8914 }
8915 }
8916 }
8917
8918 impl std::default::Default for VmArchitecture {
8919 fn default() -> Self {
8920 use std::convert::From;
8921 Self::from(0)
8922 }
8923 }
8924
8925 impl std::fmt::Display for VmArchitecture {
8926 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8927 wkt::internal::display_enum(f, self.name(), self.value())
8928 }
8929 }
8930
8931 impl std::convert::From<i32> for VmArchitecture {
8932 fn from(value: i32) -> Self {
8933 match value {
8934 0 => Self::Unspecified,
8935 1 => Self::I386,
8936 2 => Self::X8664,
8937 3 => Self::Arm64,
8938 4 => Self::X8664Mac,
8939 _ => Self::UnknownValue(vm_architecture::UnknownValue(
8940 wkt::internal::UnknownEnumValue::Integer(value),
8941 )),
8942 }
8943 }
8944 }
8945
8946 impl std::convert::From<&str> for VmArchitecture {
8947 fn from(value: &str) -> Self {
8948 use std::string::ToString;
8949 match value {
8950 "VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
8951 "I386" => Self::I386,
8952 "X86_64" => Self::X8664,
8953 "ARM64" => Self::Arm64,
8954 "X86_64_MAC" => Self::X8664Mac,
8955 _ => Self::UnknownValue(vm_architecture::UnknownValue(
8956 wkt::internal::UnknownEnumValue::String(value.to_string()),
8957 )),
8958 }
8959 }
8960 }
8961
8962 impl serde::ser::Serialize for VmArchitecture {
8963 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8964 where
8965 S: serde::Serializer,
8966 {
8967 match self {
8968 Self::Unspecified => serializer.serialize_i32(0),
8969 Self::I386 => serializer.serialize_i32(1),
8970 Self::X8664 => serializer.serialize_i32(2),
8971 Self::Arm64 => serializer.serialize_i32(3),
8972 Self::X8664Mac => serializer.serialize_i32(4),
8973 Self::UnknownValue(u) => u.0.serialize(serializer),
8974 }
8975 }
8976 }
8977
8978 impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
8979 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8980 where
8981 D: serde::Deserializer<'de>,
8982 {
8983 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
8984 ".google.cloud.vmmigration.v1.AwsVmDetails.VmArchitecture",
8985 ))
8986 }
8987 }
8988}
8989
8990/// AwsSecurityGroup describes a security group of an AWS VM.
8991#[derive(Clone, Default, PartialEq)]
8992#[non_exhaustive]
8993pub struct AwsSecurityGroup {
8994 /// The AWS security group id.
8995 pub id: std::string::String,
8996
8997 /// The AWS security group name.
8998 pub name: std::string::String,
8999
9000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9001}
9002
9003impl AwsSecurityGroup {
9004 /// Creates a new default instance.
9005 pub fn new() -> Self {
9006 std::default::Default::default()
9007 }
9008
9009 /// Sets the value of [id][crate::model::AwsSecurityGroup::id].
9010 ///
9011 /// # Example
9012 /// ```ignore,no_run
9013 /// # use google_cloud_vmmigration_v1::model::AwsSecurityGroup;
9014 /// let x = AwsSecurityGroup::new().set_id("example");
9015 /// ```
9016 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9017 self.id = v.into();
9018 self
9019 }
9020
9021 /// Sets the value of [name][crate::model::AwsSecurityGroup::name].
9022 ///
9023 /// # Example
9024 /// ```ignore,no_run
9025 /// # use google_cloud_vmmigration_v1::model::AwsSecurityGroup;
9026 /// let x = AwsSecurityGroup::new().set_name("example");
9027 /// ```
9028 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9029 self.name = v.into();
9030 self
9031 }
9032}
9033
9034impl wkt::message::Message for AwsSecurityGroup {
9035 fn typename() -> &'static str {
9036 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSecurityGroup"
9037 }
9038}
9039
9040/// AzureVmDetails describes a VM in Azure.
9041#[derive(Clone, Default, PartialEq)]
9042#[non_exhaustive]
9043pub struct AzureVmDetails {
9044 /// The VM full path in Azure.
9045 pub vm_id: std::string::String,
9046
9047 /// The power state of the VM at the moment list was taken.
9048 pub power_state: crate::model::azure_vm_details::PowerState,
9049
9050 /// VM size as configured in Azure. Determines the VM's hardware spec.
9051 pub vm_size: std::string::String,
9052
9053 /// The number of cpus the VM has.
9054 pub cpu_count: i32,
9055
9056 /// The memory size of the VM in MB.
9057 pub memory_mb: i32,
9058
9059 /// The number of disks the VM has, including OS disk.
9060 pub disk_count: i32,
9061
9062 /// The total size of the storage allocated to the VM in MB.
9063 pub committed_storage_mb: i64,
9064
9065 /// Description of the OS disk.
9066 pub os_disk: std::option::Option<crate::model::azure_vm_details::OSDisk>,
9067
9068 /// Description of the data disks.
9069 pub disks: std::vec::Vec<crate::model::azure_vm_details::Disk>,
9070
9071 /// Description of the OS.
9072 pub os_description: std::option::Option<crate::model::azure_vm_details::OSDescription>,
9073
9074 /// The VM Boot Option.
9075 pub boot_option: crate::model::azure_vm_details::BootOption,
9076
9077 /// The tags of the VM.
9078 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
9079
9080 /// The VM's ComputerName.
9081 pub computer_name: std::string::String,
9082
9083 /// The CPU architecture.
9084 pub architecture: crate::model::azure_vm_details::VmArchitecture,
9085
9086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9087}
9088
9089impl AzureVmDetails {
9090 /// Creates a new default instance.
9091 pub fn new() -> Self {
9092 std::default::Default::default()
9093 }
9094
9095 /// Sets the value of [vm_id][crate::model::AzureVmDetails::vm_id].
9096 ///
9097 /// # Example
9098 /// ```ignore,no_run
9099 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9100 /// let x = AzureVmDetails::new().set_vm_id("example");
9101 /// ```
9102 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9103 self.vm_id = v.into();
9104 self
9105 }
9106
9107 /// Sets the value of [power_state][crate::model::AzureVmDetails::power_state].
9108 ///
9109 /// # Example
9110 /// ```ignore,no_run
9111 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9112 /// use google_cloud_vmmigration_v1::model::azure_vm_details::PowerState;
9113 /// let x0 = AzureVmDetails::new().set_power_state(PowerState::Starting);
9114 /// let x1 = AzureVmDetails::new().set_power_state(PowerState::Running);
9115 /// let x2 = AzureVmDetails::new().set_power_state(PowerState::Stopping);
9116 /// ```
9117 pub fn set_power_state<T: std::convert::Into<crate::model::azure_vm_details::PowerState>>(
9118 mut self,
9119 v: T,
9120 ) -> Self {
9121 self.power_state = v.into();
9122 self
9123 }
9124
9125 /// Sets the value of [vm_size][crate::model::AzureVmDetails::vm_size].
9126 ///
9127 /// # Example
9128 /// ```ignore,no_run
9129 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9130 /// let x = AzureVmDetails::new().set_vm_size("example");
9131 /// ```
9132 pub fn set_vm_size<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9133 self.vm_size = v.into();
9134 self
9135 }
9136
9137 /// Sets the value of [cpu_count][crate::model::AzureVmDetails::cpu_count].
9138 ///
9139 /// # Example
9140 /// ```ignore,no_run
9141 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9142 /// let x = AzureVmDetails::new().set_cpu_count(42);
9143 /// ```
9144 pub fn set_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9145 self.cpu_count = v.into();
9146 self
9147 }
9148
9149 /// Sets the value of [memory_mb][crate::model::AzureVmDetails::memory_mb].
9150 ///
9151 /// # Example
9152 /// ```ignore,no_run
9153 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9154 /// let x = AzureVmDetails::new().set_memory_mb(42);
9155 /// ```
9156 pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9157 self.memory_mb = v.into();
9158 self
9159 }
9160
9161 /// Sets the value of [disk_count][crate::model::AzureVmDetails::disk_count].
9162 ///
9163 /// # Example
9164 /// ```ignore,no_run
9165 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9166 /// let x = AzureVmDetails::new().set_disk_count(42);
9167 /// ```
9168 pub fn set_disk_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9169 self.disk_count = v.into();
9170 self
9171 }
9172
9173 /// Sets the value of [committed_storage_mb][crate::model::AzureVmDetails::committed_storage_mb].
9174 ///
9175 /// # Example
9176 /// ```ignore,no_run
9177 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9178 /// let x = AzureVmDetails::new().set_committed_storage_mb(42);
9179 /// ```
9180 pub fn set_committed_storage_mb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9181 self.committed_storage_mb = v.into();
9182 self
9183 }
9184
9185 /// Sets the value of [os_disk][crate::model::AzureVmDetails::os_disk].
9186 ///
9187 /// # Example
9188 /// ```ignore,no_run
9189 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9190 /// use google_cloud_vmmigration_v1::model::azure_vm_details::OSDisk;
9191 /// let x = AzureVmDetails::new().set_os_disk(OSDisk::default()/* use setters */);
9192 /// ```
9193 pub fn set_os_disk<T>(mut self, v: T) -> Self
9194 where
9195 T: std::convert::Into<crate::model::azure_vm_details::OSDisk>,
9196 {
9197 self.os_disk = std::option::Option::Some(v.into());
9198 self
9199 }
9200
9201 /// Sets or clears the value of [os_disk][crate::model::AzureVmDetails::os_disk].
9202 ///
9203 /// # Example
9204 /// ```ignore,no_run
9205 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9206 /// use google_cloud_vmmigration_v1::model::azure_vm_details::OSDisk;
9207 /// let x = AzureVmDetails::new().set_or_clear_os_disk(Some(OSDisk::default()/* use setters */));
9208 /// let x = AzureVmDetails::new().set_or_clear_os_disk(None::<OSDisk>);
9209 /// ```
9210 pub fn set_or_clear_os_disk<T>(mut self, v: std::option::Option<T>) -> Self
9211 where
9212 T: std::convert::Into<crate::model::azure_vm_details::OSDisk>,
9213 {
9214 self.os_disk = v.map(|x| x.into());
9215 self
9216 }
9217
9218 /// Sets the value of [disks][crate::model::AzureVmDetails::disks].
9219 ///
9220 /// # Example
9221 /// ```ignore,no_run
9222 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9223 /// use google_cloud_vmmigration_v1::model::azure_vm_details::Disk;
9224 /// let x = AzureVmDetails::new()
9225 /// .set_disks([
9226 /// Disk::default()/* use setters */,
9227 /// Disk::default()/* use (different) setters */,
9228 /// ]);
9229 /// ```
9230 pub fn set_disks<T, V>(mut self, v: T) -> Self
9231 where
9232 T: std::iter::IntoIterator<Item = V>,
9233 V: std::convert::Into<crate::model::azure_vm_details::Disk>,
9234 {
9235 use std::iter::Iterator;
9236 self.disks = v.into_iter().map(|i| i.into()).collect();
9237 self
9238 }
9239
9240 /// Sets the value of [os_description][crate::model::AzureVmDetails::os_description].
9241 ///
9242 /// # Example
9243 /// ```ignore,no_run
9244 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9245 /// use google_cloud_vmmigration_v1::model::azure_vm_details::OSDescription;
9246 /// let x = AzureVmDetails::new().set_os_description(OSDescription::default()/* use setters */);
9247 /// ```
9248 pub fn set_os_description<T>(mut self, v: T) -> Self
9249 where
9250 T: std::convert::Into<crate::model::azure_vm_details::OSDescription>,
9251 {
9252 self.os_description = std::option::Option::Some(v.into());
9253 self
9254 }
9255
9256 /// Sets or clears the value of [os_description][crate::model::AzureVmDetails::os_description].
9257 ///
9258 /// # Example
9259 /// ```ignore,no_run
9260 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9261 /// use google_cloud_vmmigration_v1::model::azure_vm_details::OSDescription;
9262 /// let x = AzureVmDetails::new().set_or_clear_os_description(Some(OSDescription::default()/* use setters */));
9263 /// let x = AzureVmDetails::new().set_or_clear_os_description(None::<OSDescription>);
9264 /// ```
9265 pub fn set_or_clear_os_description<T>(mut self, v: std::option::Option<T>) -> Self
9266 where
9267 T: std::convert::Into<crate::model::azure_vm_details::OSDescription>,
9268 {
9269 self.os_description = v.map(|x| x.into());
9270 self
9271 }
9272
9273 /// Sets the value of [boot_option][crate::model::AzureVmDetails::boot_option].
9274 ///
9275 /// # Example
9276 /// ```ignore,no_run
9277 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9278 /// use google_cloud_vmmigration_v1::model::azure_vm_details::BootOption;
9279 /// let x0 = AzureVmDetails::new().set_boot_option(BootOption::Efi);
9280 /// let x1 = AzureVmDetails::new().set_boot_option(BootOption::Bios);
9281 /// ```
9282 pub fn set_boot_option<T: std::convert::Into<crate::model::azure_vm_details::BootOption>>(
9283 mut self,
9284 v: T,
9285 ) -> Self {
9286 self.boot_option = v.into();
9287 self
9288 }
9289
9290 /// Sets the value of [tags][crate::model::AzureVmDetails::tags].
9291 ///
9292 /// # Example
9293 /// ```ignore,no_run
9294 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9295 /// let x = AzureVmDetails::new().set_tags([
9296 /// ("key0", "abc"),
9297 /// ("key1", "xyz"),
9298 /// ]);
9299 /// ```
9300 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
9301 where
9302 T: std::iter::IntoIterator<Item = (K, V)>,
9303 K: std::convert::Into<std::string::String>,
9304 V: std::convert::Into<std::string::String>,
9305 {
9306 use std::iter::Iterator;
9307 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9308 self
9309 }
9310
9311 /// Sets the value of [computer_name][crate::model::AzureVmDetails::computer_name].
9312 ///
9313 /// # Example
9314 /// ```ignore,no_run
9315 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9316 /// let x = AzureVmDetails::new().set_computer_name("example");
9317 /// ```
9318 pub fn set_computer_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9319 self.computer_name = v.into();
9320 self
9321 }
9322
9323 /// Sets the value of [architecture][crate::model::AzureVmDetails::architecture].
9324 ///
9325 /// # Example
9326 /// ```ignore,no_run
9327 /// # use google_cloud_vmmigration_v1::model::AzureVmDetails;
9328 /// use google_cloud_vmmigration_v1::model::azure_vm_details::VmArchitecture;
9329 /// let x0 = AzureVmDetails::new().set_architecture(VmArchitecture::X86Family);
9330 /// let x1 = AzureVmDetails::new().set_architecture(VmArchitecture::Arm64);
9331 /// ```
9332 pub fn set_architecture<
9333 T: std::convert::Into<crate::model::azure_vm_details::VmArchitecture>,
9334 >(
9335 mut self,
9336 v: T,
9337 ) -> Self {
9338 self.architecture = v.into();
9339 self
9340 }
9341}
9342
9343impl wkt::message::Message for AzureVmDetails {
9344 fn typename() -> &'static str {
9345 "type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails"
9346 }
9347}
9348
9349/// Defines additional types related to [AzureVmDetails].
9350pub mod azure_vm_details {
9351 #[allow(unused_imports)]
9352 use super::*;
9353
9354 /// A message describing the OS disk.
9355 #[derive(Clone, Default, PartialEq)]
9356 #[non_exhaustive]
9357 pub struct OSDisk {
9358 /// The disk's type.
9359 pub r#type: std::string::String,
9360
9361 /// The disk's full name.
9362 pub name: std::string::String,
9363
9364 /// The disk's size in GB.
9365 pub size_gb: i32,
9366
9367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9368 }
9369
9370 impl OSDisk {
9371 /// Creates a new default instance.
9372 pub fn new() -> Self {
9373 std::default::Default::default()
9374 }
9375
9376 /// Sets the value of [r#type][crate::model::azure_vm_details::OSDisk::type].
9377 ///
9378 /// # Example
9379 /// ```ignore,no_run
9380 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDisk;
9381 /// let x = OSDisk::new().set_type("example");
9382 /// ```
9383 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9384 self.r#type = v.into();
9385 self
9386 }
9387
9388 /// Sets the value of [name][crate::model::azure_vm_details::OSDisk::name].
9389 ///
9390 /// # Example
9391 /// ```ignore,no_run
9392 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDisk;
9393 /// let x = OSDisk::new().set_name("example");
9394 /// ```
9395 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9396 self.name = v.into();
9397 self
9398 }
9399
9400 /// Sets the value of [size_gb][crate::model::azure_vm_details::OSDisk::size_gb].
9401 ///
9402 /// # Example
9403 /// ```ignore,no_run
9404 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDisk;
9405 /// let x = OSDisk::new().set_size_gb(42);
9406 /// ```
9407 pub fn set_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9408 self.size_gb = v.into();
9409 self
9410 }
9411 }
9412
9413 impl wkt::message::Message for OSDisk {
9414 fn typename() -> &'static str {
9415 "type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails.OSDisk"
9416 }
9417 }
9418
9419 /// A message describing a data disk.
9420 #[derive(Clone, Default, PartialEq)]
9421 #[non_exhaustive]
9422 pub struct Disk {
9423 /// The disk name.
9424 pub name: std::string::String,
9425
9426 /// The disk size in GB.
9427 pub size_gb: i32,
9428
9429 /// The disk's Logical Unit Number (LUN).
9430 pub lun: i32,
9431
9432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9433 }
9434
9435 impl Disk {
9436 /// Creates a new default instance.
9437 pub fn new() -> Self {
9438 std::default::Default::default()
9439 }
9440
9441 /// Sets the value of [name][crate::model::azure_vm_details::Disk::name].
9442 ///
9443 /// # Example
9444 /// ```ignore,no_run
9445 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::Disk;
9446 /// let x = Disk::new().set_name("example");
9447 /// ```
9448 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9449 self.name = v.into();
9450 self
9451 }
9452
9453 /// Sets the value of [size_gb][crate::model::azure_vm_details::Disk::size_gb].
9454 ///
9455 /// # Example
9456 /// ```ignore,no_run
9457 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::Disk;
9458 /// let x = Disk::new().set_size_gb(42);
9459 /// ```
9460 pub fn set_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9461 self.size_gb = v.into();
9462 self
9463 }
9464
9465 /// Sets the value of [lun][crate::model::azure_vm_details::Disk::lun].
9466 ///
9467 /// # Example
9468 /// ```ignore,no_run
9469 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::Disk;
9470 /// let x = Disk::new().set_lun(42);
9471 /// ```
9472 pub fn set_lun<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9473 self.lun = v.into();
9474 self
9475 }
9476 }
9477
9478 impl wkt::message::Message for Disk {
9479 fn typename() -> &'static str {
9480 "type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails.Disk"
9481 }
9482 }
9483
9484 /// A message describing the VM's OS. Including OS, Publisher, Offer and Plan
9485 /// if applicable.
9486 #[derive(Clone, Default, PartialEq)]
9487 #[non_exhaustive]
9488 pub struct OSDescription {
9489 /// OS type.
9490 pub r#type: std::string::String,
9491
9492 /// OS publisher.
9493 pub publisher: std::string::String,
9494
9495 /// OS offer.
9496 pub offer: std::string::String,
9497
9498 /// OS plan.
9499 pub plan: std::string::String,
9500
9501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9502 }
9503
9504 impl OSDescription {
9505 /// Creates a new default instance.
9506 pub fn new() -> Self {
9507 std::default::Default::default()
9508 }
9509
9510 /// Sets the value of [r#type][crate::model::azure_vm_details::OSDescription::type].
9511 ///
9512 /// # Example
9513 /// ```ignore,no_run
9514 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDescription;
9515 /// let x = OSDescription::new().set_type("example");
9516 /// ```
9517 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9518 self.r#type = v.into();
9519 self
9520 }
9521
9522 /// Sets the value of [publisher][crate::model::azure_vm_details::OSDescription::publisher].
9523 ///
9524 /// # Example
9525 /// ```ignore,no_run
9526 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDescription;
9527 /// let x = OSDescription::new().set_publisher("example");
9528 /// ```
9529 pub fn set_publisher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9530 self.publisher = v.into();
9531 self
9532 }
9533
9534 /// Sets the value of [offer][crate::model::azure_vm_details::OSDescription::offer].
9535 ///
9536 /// # Example
9537 /// ```ignore,no_run
9538 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDescription;
9539 /// let x = OSDescription::new().set_offer("example");
9540 /// ```
9541 pub fn set_offer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9542 self.offer = v.into();
9543 self
9544 }
9545
9546 /// Sets the value of [plan][crate::model::azure_vm_details::OSDescription::plan].
9547 ///
9548 /// # Example
9549 /// ```ignore,no_run
9550 /// # use google_cloud_vmmigration_v1::model::azure_vm_details::OSDescription;
9551 /// let x = OSDescription::new().set_plan("example");
9552 /// ```
9553 pub fn set_plan<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9554 self.plan = v.into();
9555 self
9556 }
9557 }
9558
9559 impl wkt::message::Message for OSDescription {
9560 fn typename() -> &'static str {
9561 "type.googleapis.com/google.cloud.vmmigration.v1.AzureVmDetails.OSDescription"
9562 }
9563 }
9564
9565 /// Possible values for the power state of the VM.
9566 ///
9567 /// # Working with unknown values
9568 ///
9569 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9570 /// additional enum variants at any time. Adding new variants is not considered
9571 /// a breaking change. Applications should write their code in anticipation of:
9572 ///
9573 /// - New values appearing in future releases of the client library, **and**
9574 /// - New values received dynamically, without application changes.
9575 ///
9576 /// Please consult the [Working with enums] section in the user guide for some
9577 /// guidelines.
9578 ///
9579 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9580 #[derive(Clone, Debug, PartialEq)]
9581 #[non_exhaustive]
9582 pub enum PowerState {
9583 /// Power state is not specified.
9584 Unspecified,
9585 /// The VM is starting.
9586 Starting,
9587 /// The VM is running.
9588 Running,
9589 /// The VM is stopping.
9590 Stopping,
9591 /// The VM is stopped.
9592 Stopped,
9593 /// The VM is deallocating.
9594 Deallocating,
9595 /// The VM is deallocated.
9596 Deallocated,
9597 /// The VM's power state is unknown.
9598 Unknown,
9599 /// If set, the enum was initialized with an unknown value.
9600 ///
9601 /// Applications can examine the value using [PowerState::value] or
9602 /// [PowerState::name].
9603 UnknownValue(power_state::UnknownValue),
9604 }
9605
9606 #[doc(hidden)]
9607 pub mod power_state {
9608 #[allow(unused_imports)]
9609 use super::*;
9610 #[derive(Clone, Debug, PartialEq)]
9611 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9612 }
9613
9614 impl PowerState {
9615 /// Gets the enum value.
9616 ///
9617 /// Returns `None` if the enum contains an unknown value deserialized from
9618 /// the string representation of enums.
9619 pub fn value(&self) -> std::option::Option<i32> {
9620 match self {
9621 Self::Unspecified => std::option::Option::Some(0),
9622 Self::Starting => std::option::Option::Some(1),
9623 Self::Running => std::option::Option::Some(2),
9624 Self::Stopping => std::option::Option::Some(3),
9625 Self::Stopped => std::option::Option::Some(4),
9626 Self::Deallocating => std::option::Option::Some(5),
9627 Self::Deallocated => std::option::Option::Some(6),
9628 Self::Unknown => std::option::Option::Some(7),
9629 Self::UnknownValue(u) => u.0.value(),
9630 }
9631 }
9632
9633 /// Gets the enum value as a string.
9634 ///
9635 /// Returns `None` if the enum contains an unknown value deserialized from
9636 /// the integer representation of enums.
9637 pub fn name(&self) -> std::option::Option<&str> {
9638 match self {
9639 Self::Unspecified => std::option::Option::Some("POWER_STATE_UNSPECIFIED"),
9640 Self::Starting => std::option::Option::Some("STARTING"),
9641 Self::Running => std::option::Option::Some("RUNNING"),
9642 Self::Stopping => std::option::Option::Some("STOPPING"),
9643 Self::Stopped => std::option::Option::Some("STOPPED"),
9644 Self::Deallocating => std::option::Option::Some("DEALLOCATING"),
9645 Self::Deallocated => std::option::Option::Some("DEALLOCATED"),
9646 Self::Unknown => std::option::Option::Some("UNKNOWN"),
9647 Self::UnknownValue(u) => u.0.name(),
9648 }
9649 }
9650 }
9651
9652 impl std::default::Default for PowerState {
9653 fn default() -> Self {
9654 use std::convert::From;
9655 Self::from(0)
9656 }
9657 }
9658
9659 impl std::fmt::Display for PowerState {
9660 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9661 wkt::internal::display_enum(f, self.name(), self.value())
9662 }
9663 }
9664
9665 impl std::convert::From<i32> for PowerState {
9666 fn from(value: i32) -> Self {
9667 match value {
9668 0 => Self::Unspecified,
9669 1 => Self::Starting,
9670 2 => Self::Running,
9671 3 => Self::Stopping,
9672 4 => Self::Stopped,
9673 5 => Self::Deallocating,
9674 6 => Self::Deallocated,
9675 7 => Self::Unknown,
9676 _ => Self::UnknownValue(power_state::UnknownValue(
9677 wkt::internal::UnknownEnumValue::Integer(value),
9678 )),
9679 }
9680 }
9681 }
9682
9683 impl std::convert::From<&str> for PowerState {
9684 fn from(value: &str) -> Self {
9685 use std::string::ToString;
9686 match value {
9687 "POWER_STATE_UNSPECIFIED" => Self::Unspecified,
9688 "STARTING" => Self::Starting,
9689 "RUNNING" => Self::Running,
9690 "STOPPING" => Self::Stopping,
9691 "STOPPED" => Self::Stopped,
9692 "DEALLOCATING" => Self::Deallocating,
9693 "DEALLOCATED" => Self::Deallocated,
9694 "UNKNOWN" => Self::Unknown,
9695 _ => Self::UnknownValue(power_state::UnknownValue(
9696 wkt::internal::UnknownEnumValue::String(value.to_string()),
9697 )),
9698 }
9699 }
9700 }
9701
9702 impl serde::ser::Serialize for PowerState {
9703 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9704 where
9705 S: serde::Serializer,
9706 {
9707 match self {
9708 Self::Unspecified => serializer.serialize_i32(0),
9709 Self::Starting => serializer.serialize_i32(1),
9710 Self::Running => serializer.serialize_i32(2),
9711 Self::Stopping => serializer.serialize_i32(3),
9712 Self::Stopped => serializer.serialize_i32(4),
9713 Self::Deallocating => serializer.serialize_i32(5),
9714 Self::Deallocated => serializer.serialize_i32(6),
9715 Self::Unknown => serializer.serialize_i32(7),
9716 Self::UnknownValue(u) => u.0.serialize(serializer),
9717 }
9718 }
9719 }
9720
9721 impl<'de> serde::de::Deserialize<'de> for PowerState {
9722 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9723 where
9724 D: serde::Deserializer<'de>,
9725 {
9726 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PowerState>::new(
9727 ".google.cloud.vmmigration.v1.AzureVmDetails.PowerState",
9728 ))
9729 }
9730 }
9731
9732 /// The possible values for the vm boot option.
9733 ///
9734 /// # Working with unknown values
9735 ///
9736 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9737 /// additional enum variants at any time. Adding new variants is not considered
9738 /// a breaking change. Applications should write their code in anticipation of:
9739 ///
9740 /// - New values appearing in future releases of the client library, **and**
9741 /// - New values received dynamically, without application changes.
9742 ///
9743 /// Please consult the [Working with enums] section in the user guide for some
9744 /// guidelines.
9745 ///
9746 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9747 #[derive(Clone, Debug, PartialEq)]
9748 #[non_exhaustive]
9749 pub enum BootOption {
9750 /// The boot option is unknown.
9751 Unspecified,
9752 /// The boot option is UEFI.
9753 Efi,
9754 /// The boot option is BIOS.
9755 Bios,
9756 /// If set, the enum was initialized with an unknown value.
9757 ///
9758 /// Applications can examine the value using [BootOption::value] or
9759 /// [BootOption::name].
9760 UnknownValue(boot_option::UnknownValue),
9761 }
9762
9763 #[doc(hidden)]
9764 pub mod boot_option {
9765 #[allow(unused_imports)]
9766 use super::*;
9767 #[derive(Clone, Debug, PartialEq)]
9768 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9769 }
9770
9771 impl BootOption {
9772 /// Gets the enum value.
9773 ///
9774 /// Returns `None` if the enum contains an unknown value deserialized from
9775 /// the string representation of enums.
9776 pub fn value(&self) -> std::option::Option<i32> {
9777 match self {
9778 Self::Unspecified => std::option::Option::Some(0),
9779 Self::Efi => std::option::Option::Some(1),
9780 Self::Bios => std::option::Option::Some(2),
9781 Self::UnknownValue(u) => u.0.value(),
9782 }
9783 }
9784
9785 /// Gets the enum value as a string.
9786 ///
9787 /// Returns `None` if the enum contains an unknown value deserialized from
9788 /// the integer representation of enums.
9789 pub fn name(&self) -> std::option::Option<&str> {
9790 match self {
9791 Self::Unspecified => std::option::Option::Some("BOOT_OPTION_UNSPECIFIED"),
9792 Self::Efi => std::option::Option::Some("EFI"),
9793 Self::Bios => std::option::Option::Some("BIOS"),
9794 Self::UnknownValue(u) => u.0.name(),
9795 }
9796 }
9797 }
9798
9799 impl std::default::Default for BootOption {
9800 fn default() -> Self {
9801 use std::convert::From;
9802 Self::from(0)
9803 }
9804 }
9805
9806 impl std::fmt::Display for BootOption {
9807 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9808 wkt::internal::display_enum(f, self.name(), self.value())
9809 }
9810 }
9811
9812 impl std::convert::From<i32> for BootOption {
9813 fn from(value: i32) -> Self {
9814 match value {
9815 0 => Self::Unspecified,
9816 1 => Self::Efi,
9817 2 => Self::Bios,
9818 _ => Self::UnknownValue(boot_option::UnknownValue(
9819 wkt::internal::UnknownEnumValue::Integer(value),
9820 )),
9821 }
9822 }
9823 }
9824
9825 impl std::convert::From<&str> for BootOption {
9826 fn from(value: &str) -> Self {
9827 use std::string::ToString;
9828 match value {
9829 "BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
9830 "EFI" => Self::Efi,
9831 "BIOS" => Self::Bios,
9832 _ => Self::UnknownValue(boot_option::UnknownValue(
9833 wkt::internal::UnknownEnumValue::String(value.to_string()),
9834 )),
9835 }
9836 }
9837 }
9838
9839 impl serde::ser::Serialize for BootOption {
9840 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9841 where
9842 S: serde::Serializer,
9843 {
9844 match self {
9845 Self::Unspecified => serializer.serialize_i32(0),
9846 Self::Efi => serializer.serialize_i32(1),
9847 Self::Bios => serializer.serialize_i32(2),
9848 Self::UnknownValue(u) => u.0.serialize(serializer),
9849 }
9850 }
9851 }
9852
9853 impl<'de> serde::de::Deserialize<'de> for BootOption {
9854 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9855 where
9856 D: serde::Deserializer<'de>,
9857 {
9858 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootOption>::new(
9859 ".google.cloud.vmmigration.v1.AzureVmDetails.BootOption",
9860 ))
9861 }
9862 }
9863
9864 /// Possible values for the VM architecture.
9865 ///
9866 /// # Working with unknown values
9867 ///
9868 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9869 /// additional enum variants at any time. Adding new variants is not considered
9870 /// a breaking change. Applications should write their code in anticipation of:
9871 ///
9872 /// - New values appearing in future releases of the client library, **and**
9873 /// - New values received dynamically, without application changes.
9874 ///
9875 /// Please consult the [Working with enums] section in the user guide for some
9876 /// guidelines.
9877 ///
9878 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9879 #[derive(Clone, Debug, PartialEq)]
9880 #[non_exhaustive]
9881 pub enum VmArchitecture {
9882 /// The architecture is unknown.
9883 Unspecified,
9884 /// The architecture is one of the x86 architectures.
9885 X86Family,
9886 /// The architecture is ARM64.
9887 Arm64,
9888 /// If set, the enum was initialized with an unknown value.
9889 ///
9890 /// Applications can examine the value using [VmArchitecture::value] or
9891 /// [VmArchitecture::name].
9892 UnknownValue(vm_architecture::UnknownValue),
9893 }
9894
9895 #[doc(hidden)]
9896 pub mod vm_architecture {
9897 #[allow(unused_imports)]
9898 use super::*;
9899 #[derive(Clone, Debug, PartialEq)]
9900 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9901 }
9902
9903 impl VmArchitecture {
9904 /// Gets the enum value.
9905 ///
9906 /// Returns `None` if the enum contains an unknown value deserialized from
9907 /// the string representation of enums.
9908 pub fn value(&self) -> std::option::Option<i32> {
9909 match self {
9910 Self::Unspecified => std::option::Option::Some(0),
9911 Self::X86Family => std::option::Option::Some(1),
9912 Self::Arm64 => std::option::Option::Some(2),
9913 Self::UnknownValue(u) => u.0.value(),
9914 }
9915 }
9916
9917 /// Gets the enum value as a string.
9918 ///
9919 /// Returns `None` if the enum contains an unknown value deserialized from
9920 /// the integer representation of enums.
9921 pub fn name(&self) -> std::option::Option<&str> {
9922 match self {
9923 Self::Unspecified => std::option::Option::Some("VM_ARCHITECTURE_UNSPECIFIED"),
9924 Self::X86Family => std::option::Option::Some("VM_ARCHITECTURE_X86_FAMILY"),
9925 Self::Arm64 => std::option::Option::Some("VM_ARCHITECTURE_ARM64"),
9926 Self::UnknownValue(u) => u.0.name(),
9927 }
9928 }
9929 }
9930
9931 impl std::default::Default for VmArchitecture {
9932 fn default() -> Self {
9933 use std::convert::From;
9934 Self::from(0)
9935 }
9936 }
9937
9938 impl std::fmt::Display for VmArchitecture {
9939 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9940 wkt::internal::display_enum(f, self.name(), self.value())
9941 }
9942 }
9943
9944 impl std::convert::From<i32> for VmArchitecture {
9945 fn from(value: i32) -> Self {
9946 match value {
9947 0 => Self::Unspecified,
9948 1 => Self::X86Family,
9949 2 => Self::Arm64,
9950 _ => Self::UnknownValue(vm_architecture::UnknownValue(
9951 wkt::internal::UnknownEnumValue::Integer(value),
9952 )),
9953 }
9954 }
9955 }
9956
9957 impl std::convert::From<&str> for VmArchitecture {
9958 fn from(value: &str) -> Self {
9959 use std::string::ToString;
9960 match value {
9961 "VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
9962 "VM_ARCHITECTURE_X86_FAMILY" => Self::X86Family,
9963 "VM_ARCHITECTURE_ARM64" => Self::Arm64,
9964 _ => Self::UnknownValue(vm_architecture::UnknownValue(
9965 wkt::internal::UnknownEnumValue::String(value.to_string()),
9966 )),
9967 }
9968 }
9969 }
9970
9971 impl serde::ser::Serialize for VmArchitecture {
9972 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9973 where
9974 S: serde::Serializer,
9975 {
9976 match self {
9977 Self::Unspecified => serializer.serialize_i32(0),
9978 Self::X86Family => serializer.serialize_i32(1),
9979 Self::Arm64 => serializer.serialize_i32(2),
9980 Self::UnknownValue(u) => u.0.serialize(serializer),
9981 }
9982 }
9983 }
9984
9985 impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
9986 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9987 where
9988 D: serde::Deserializer<'de>,
9989 {
9990 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
9991 ".google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture",
9992 ))
9993 }
9994 }
9995}
9996
9997/// VmwareVmsDetails describes VMs in vCenter.
9998#[derive(Clone, Default, PartialEq)]
9999#[non_exhaustive]
10000pub struct VmwareVmsDetails {
10001 /// The details of the vmware VMs.
10002 pub details: std::vec::Vec<crate::model::VmwareVmDetails>,
10003
10004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10005}
10006
10007impl VmwareVmsDetails {
10008 /// Creates a new default instance.
10009 pub fn new() -> Self {
10010 std::default::Default::default()
10011 }
10012
10013 /// Sets the value of [details][crate::model::VmwareVmsDetails::details].
10014 ///
10015 /// # Example
10016 /// ```ignore,no_run
10017 /// # use google_cloud_vmmigration_v1::model::VmwareVmsDetails;
10018 /// use google_cloud_vmmigration_v1::model::VmwareVmDetails;
10019 /// let x = VmwareVmsDetails::new()
10020 /// .set_details([
10021 /// VmwareVmDetails::default()/* use setters */,
10022 /// VmwareVmDetails::default()/* use (different) setters */,
10023 /// ]);
10024 /// ```
10025 pub fn set_details<T, V>(mut self, v: T) -> Self
10026 where
10027 T: std::iter::IntoIterator<Item = V>,
10028 V: std::convert::Into<crate::model::VmwareVmDetails>,
10029 {
10030 use std::iter::Iterator;
10031 self.details = v.into_iter().map(|i| i.into()).collect();
10032 self
10033 }
10034}
10035
10036impl wkt::message::Message for VmwareVmsDetails {
10037 fn typename() -> &'static str {
10038 "type.googleapis.com/google.cloud.vmmigration.v1.VmwareVmsDetails"
10039 }
10040}
10041
10042/// AWSVmsDetails describes VMs in AWS.
10043#[derive(Clone, Default, PartialEq)]
10044#[non_exhaustive]
10045pub struct AwsVmsDetails {
10046 /// The details of the AWS VMs.
10047 pub details: std::vec::Vec<crate::model::AwsVmDetails>,
10048
10049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10050}
10051
10052impl AwsVmsDetails {
10053 /// Creates a new default instance.
10054 pub fn new() -> Self {
10055 std::default::Default::default()
10056 }
10057
10058 /// Sets the value of [details][crate::model::AwsVmsDetails::details].
10059 ///
10060 /// # Example
10061 /// ```ignore,no_run
10062 /// # use google_cloud_vmmigration_v1::model::AwsVmsDetails;
10063 /// use google_cloud_vmmigration_v1::model::AwsVmDetails;
10064 /// let x = AwsVmsDetails::new()
10065 /// .set_details([
10066 /// AwsVmDetails::default()/* use setters */,
10067 /// AwsVmDetails::default()/* use (different) setters */,
10068 /// ]);
10069 /// ```
10070 pub fn set_details<T, V>(mut self, v: T) -> Self
10071 where
10072 T: std::iter::IntoIterator<Item = V>,
10073 V: std::convert::Into<crate::model::AwsVmDetails>,
10074 {
10075 use std::iter::Iterator;
10076 self.details = v.into_iter().map(|i| i.into()).collect();
10077 self
10078 }
10079}
10080
10081impl wkt::message::Message for AwsVmsDetails {
10082 fn typename() -> &'static str {
10083 "type.googleapis.com/google.cloud.vmmigration.v1.AwsVmsDetails"
10084 }
10085}
10086
10087/// AzureVmsDetails describes VMs in Azure.
10088#[derive(Clone, Default, PartialEq)]
10089#[non_exhaustive]
10090pub struct AzureVmsDetails {
10091 /// The details of the Azure VMs.
10092 pub details: std::vec::Vec<crate::model::AzureVmDetails>,
10093
10094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10095}
10096
10097impl AzureVmsDetails {
10098 /// Creates a new default instance.
10099 pub fn new() -> Self {
10100 std::default::Default::default()
10101 }
10102
10103 /// Sets the value of [details][crate::model::AzureVmsDetails::details].
10104 ///
10105 /// # Example
10106 /// ```ignore,no_run
10107 /// # use google_cloud_vmmigration_v1::model::AzureVmsDetails;
10108 /// use google_cloud_vmmigration_v1::model::AzureVmDetails;
10109 /// let x = AzureVmsDetails::new()
10110 /// .set_details([
10111 /// AzureVmDetails::default()/* use setters */,
10112 /// AzureVmDetails::default()/* use (different) setters */,
10113 /// ]);
10114 /// ```
10115 pub fn set_details<T, V>(mut self, v: T) -> Self
10116 where
10117 T: std::iter::IntoIterator<Item = V>,
10118 V: std::convert::Into<crate::model::AzureVmDetails>,
10119 {
10120 use std::iter::Iterator;
10121 self.details = v.into_iter().map(|i| i.into()).collect();
10122 self
10123 }
10124}
10125
10126impl wkt::message::Message for AzureVmsDetails {
10127 fn typename() -> &'static str {
10128 "type.googleapis.com/google.cloud.vmmigration.v1.AzureVmsDetails"
10129 }
10130}
10131
10132/// Response message for
10133/// [fetchInventory][google.cloud.vmmigration.v1.VmMigration.FetchInventory].
10134///
10135/// [google.cloud.vmmigration.v1.VmMigration.FetchInventory]: crate::client::VmMigration::fetch_inventory
10136#[derive(Clone, Default, PartialEq)]
10137#[non_exhaustive]
10138pub struct FetchInventoryResponse {
10139 /// Output only. The timestamp when the source was last queried (if the result
10140 /// is from the cache).
10141 pub update_time: std::option::Option<wkt::Timestamp>,
10142
10143 #[allow(missing_docs)]
10144 pub source_vms: std::option::Option<crate::model::fetch_inventory_response::SourceVms>,
10145
10146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10147}
10148
10149impl FetchInventoryResponse {
10150 /// Creates a new default instance.
10151 pub fn new() -> Self {
10152 std::default::Default::default()
10153 }
10154
10155 /// Sets the value of [update_time][crate::model::FetchInventoryResponse::update_time].
10156 ///
10157 /// # Example
10158 /// ```ignore,no_run
10159 /// # use google_cloud_vmmigration_v1::model::FetchInventoryResponse;
10160 /// use wkt::Timestamp;
10161 /// let x = FetchInventoryResponse::new().set_update_time(Timestamp::default()/* use setters */);
10162 /// ```
10163 pub fn set_update_time<T>(mut self, v: T) -> Self
10164 where
10165 T: std::convert::Into<wkt::Timestamp>,
10166 {
10167 self.update_time = std::option::Option::Some(v.into());
10168 self
10169 }
10170
10171 /// Sets or clears the value of [update_time][crate::model::FetchInventoryResponse::update_time].
10172 ///
10173 /// # Example
10174 /// ```ignore,no_run
10175 /// # use google_cloud_vmmigration_v1::model::FetchInventoryResponse;
10176 /// use wkt::Timestamp;
10177 /// let x = FetchInventoryResponse::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10178 /// let x = FetchInventoryResponse::new().set_or_clear_update_time(None::<Timestamp>);
10179 /// ```
10180 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10181 where
10182 T: std::convert::Into<wkt::Timestamp>,
10183 {
10184 self.update_time = v.map(|x| x.into());
10185 self
10186 }
10187
10188 /// Sets the value of [source_vms][crate::model::FetchInventoryResponse::source_vms].
10189 ///
10190 /// Note that all the setters affecting `source_vms` are mutually
10191 /// exclusive.
10192 ///
10193 /// # Example
10194 /// ```ignore,no_run
10195 /// # use google_cloud_vmmigration_v1::model::FetchInventoryResponse;
10196 /// use google_cloud_vmmigration_v1::model::VmwareVmsDetails;
10197 /// let x = FetchInventoryResponse::new().set_source_vms(Some(
10198 /// google_cloud_vmmigration_v1::model::fetch_inventory_response::SourceVms::VmwareVms(VmwareVmsDetails::default().into())));
10199 /// ```
10200 pub fn set_source_vms<
10201 T: std::convert::Into<std::option::Option<crate::model::fetch_inventory_response::SourceVms>>,
10202 >(
10203 mut self,
10204 v: T,
10205 ) -> Self {
10206 self.source_vms = v.into();
10207 self
10208 }
10209
10210 /// The value of [source_vms][crate::model::FetchInventoryResponse::source_vms]
10211 /// if it holds a `VmwareVms`, `None` if the field is not set or
10212 /// holds a different branch.
10213 pub fn vmware_vms(
10214 &self,
10215 ) -> std::option::Option<&std::boxed::Box<crate::model::VmwareVmsDetails>> {
10216 #[allow(unreachable_patterns)]
10217 self.source_vms.as_ref().and_then(|v| match v {
10218 crate::model::fetch_inventory_response::SourceVms::VmwareVms(v) => {
10219 std::option::Option::Some(v)
10220 }
10221 _ => std::option::Option::None,
10222 })
10223 }
10224
10225 /// Sets the value of [source_vms][crate::model::FetchInventoryResponse::source_vms]
10226 /// to hold a `VmwareVms`.
10227 ///
10228 /// Note that all the setters affecting `source_vms` are
10229 /// mutually exclusive.
10230 ///
10231 /// # Example
10232 /// ```ignore,no_run
10233 /// # use google_cloud_vmmigration_v1::model::FetchInventoryResponse;
10234 /// use google_cloud_vmmigration_v1::model::VmwareVmsDetails;
10235 /// let x = FetchInventoryResponse::new().set_vmware_vms(VmwareVmsDetails::default()/* use setters */);
10236 /// assert!(x.vmware_vms().is_some());
10237 /// assert!(x.aws_vms().is_none());
10238 /// assert!(x.azure_vms().is_none());
10239 /// ```
10240 pub fn set_vmware_vms<
10241 T: std::convert::Into<std::boxed::Box<crate::model::VmwareVmsDetails>>,
10242 >(
10243 mut self,
10244 v: T,
10245 ) -> Self {
10246 self.source_vms = std::option::Option::Some(
10247 crate::model::fetch_inventory_response::SourceVms::VmwareVms(v.into()),
10248 );
10249 self
10250 }
10251
10252 /// The value of [source_vms][crate::model::FetchInventoryResponse::source_vms]
10253 /// if it holds a `AwsVms`, `None` if the field is not set or
10254 /// holds a different branch.
10255 pub fn aws_vms(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsVmsDetails>> {
10256 #[allow(unreachable_patterns)]
10257 self.source_vms.as_ref().and_then(|v| match v {
10258 crate::model::fetch_inventory_response::SourceVms::AwsVms(v) => {
10259 std::option::Option::Some(v)
10260 }
10261 _ => std::option::Option::None,
10262 })
10263 }
10264
10265 /// Sets the value of [source_vms][crate::model::FetchInventoryResponse::source_vms]
10266 /// to hold a `AwsVms`.
10267 ///
10268 /// Note that all the setters affecting `source_vms` are
10269 /// mutually exclusive.
10270 ///
10271 /// # Example
10272 /// ```ignore,no_run
10273 /// # use google_cloud_vmmigration_v1::model::FetchInventoryResponse;
10274 /// use google_cloud_vmmigration_v1::model::AwsVmsDetails;
10275 /// let x = FetchInventoryResponse::new().set_aws_vms(AwsVmsDetails::default()/* use setters */);
10276 /// assert!(x.aws_vms().is_some());
10277 /// assert!(x.vmware_vms().is_none());
10278 /// assert!(x.azure_vms().is_none());
10279 /// ```
10280 pub fn set_aws_vms<T: std::convert::Into<std::boxed::Box<crate::model::AwsVmsDetails>>>(
10281 mut self,
10282 v: T,
10283 ) -> Self {
10284 self.source_vms = std::option::Option::Some(
10285 crate::model::fetch_inventory_response::SourceVms::AwsVms(v.into()),
10286 );
10287 self
10288 }
10289
10290 /// The value of [source_vms][crate::model::FetchInventoryResponse::source_vms]
10291 /// if it holds a `AzureVms`, `None` if the field is not set or
10292 /// holds a different branch.
10293 pub fn azure_vms(
10294 &self,
10295 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureVmsDetails>> {
10296 #[allow(unreachable_patterns)]
10297 self.source_vms.as_ref().and_then(|v| match v {
10298 crate::model::fetch_inventory_response::SourceVms::AzureVms(v) => {
10299 std::option::Option::Some(v)
10300 }
10301 _ => std::option::Option::None,
10302 })
10303 }
10304
10305 /// Sets the value of [source_vms][crate::model::FetchInventoryResponse::source_vms]
10306 /// to hold a `AzureVms`.
10307 ///
10308 /// Note that all the setters affecting `source_vms` are
10309 /// mutually exclusive.
10310 ///
10311 /// # Example
10312 /// ```ignore,no_run
10313 /// # use google_cloud_vmmigration_v1::model::FetchInventoryResponse;
10314 /// use google_cloud_vmmigration_v1::model::AzureVmsDetails;
10315 /// let x = FetchInventoryResponse::new().set_azure_vms(AzureVmsDetails::default()/* use setters */);
10316 /// assert!(x.azure_vms().is_some());
10317 /// assert!(x.vmware_vms().is_none());
10318 /// assert!(x.aws_vms().is_none());
10319 /// ```
10320 pub fn set_azure_vms<T: std::convert::Into<std::boxed::Box<crate::model::AzureVmsDetails>>>(
10321 mut self,
10322 v: T,
10323 ) -> Self {
10324 self.source_vms = std::option::Option::Some(
10325 crate::model::fetch_inventory_response::SourceVms::AzureVms(v.into()),
10326 );
10327 self
10328 }
10329}
10330
10331impl wkt::message::Message for FetchInventoryResponse {
10332 fn typename() -> &'static str {
10333 "type.googleapis.com/google.cloud.vmmigration.v1.FetchInventoryResponse"
10334 }
10335}
10336
10337/// Defines additional types related to [FetchInventoryResponse].
10338pub mod fetch_inventory_response {
10339 #[allow(unused_imports)]
10340 use super::*;
10341
10342 #[allow(missing_docs)]
10343 #[derive(Clone, Debug, PartialEq)]
10344 #[non_exhaustive]
10345 pub enum SourceVms {
10346 /// The description of the VMs in a Source of type Vmware.
10347 VmwareVms(std::boxed::Box<crate::model::VmwareVmsDetails>),
10348 /// The description of the VMs in a Source of type AWS.
10349 AwsVms(std::boxed::Box<crate::model::AwsVmsDetails>),
10350 /// The description of the VMs in a Source of type Azure.
10351 AzureVms(std::boxed::Box<crate::model::AzureVmsDetails>),
10352 }
10353}
10354
10355/// Request message for
10356/// [fetchStorageInventory][google.cloud.vmmigration.v1.VmMigration.FetchStorageInventory].
10357///
10358/// [google.cloud.vmmigration.v1.VmMigration.FetchStorageInventory]: crate::client::VmMigration::fetch_storage_inventory
10359#[derive(Clone, Default, PartialEq)]
10360#[non_exhaustive]
10361pub struct FetchStorageInventoryRequest {
10362 /// Required. The name of the Source.
10363 pub source: std::string::String,
10364
10365 /// Required. The type of the storage inventory to fetch.
10366 pub r#type: crate::model::fetch_storage_inventory_request::StorageType,
10367
10368 /// Optional. If this flag is set to true, the source will be queried instead
10369 /// of using cached results. Using this flag will make the call slower.
10370 pub force_refresh: bool,
10371
10372 /// Optional. The maximum number of VMs to return. The service may return
10373 /// fewer than this value.
10374 pub page_size: i32,
10375
10376 /// Optional. A page token, received from a previous `FetchStorageInventory`
10377 /// call. Provide this to retrieve the subsequent page. When paginating, all
10378 /// other parameters provided to `FetchStorageInventory` must match the call
10379 /// that provided the page token.
10380 pub page_token: std::string::String,
10381
10382 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10383}
10384
10385impl FetchStorageInventoryRequest {
10386 /// Creates a new default instance.
10387 pub fn new() -> Self {
10388 std::default::Default::default()
10389 }
10390
10391 /// Sets the value of [source][crate::model::FetchStorageInventoryRequest::source].
10392 ///
10393 /// # Example
10394 /// ```ignore,no_run
10395 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryRequest;
10396 /// # let project_id = "project_id";
10397 /// # let location_id = "location_id";
10398 /// # let source_id = "source_id";
10399 /// let x = FetchStorageInventoryRequest::new().set_source(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
10400 /// ```
10401 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10402 self.source = v.into();
10403 self
10404 }
10405
10406 /// Sets the value of [r#type][crate::model::FetchStorageInventoryRequest::type].
10407 ///
10408 /// # Example
10409 /// ```ignore,no_run
10410 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryRequest;
10411 /// use google_cloud_vmmigration_v1::model::fetch_storage_inventory_request::StorageType;
10412 /// let x0 = FetchStorageInventoryRequest::new().set_type(StorageType::Disks);
10413 /// let x1 = FetchStorageInventoryRequest::new().set_type(StorageType::Snapshots);
10414 /// ```
10415 pub fn set_type<
10416 T: std::convert::Into<crate::model::fetch_storage_inventory_request::StorageType>,
10417 >(
10418 mut self,
10419 v: T,
10420 ) -> Self {
10421 self.r#type = v.into();
10422 self
10423 }
10424
10425 /// Sets the value of [force_refresh][crate::model::FetchStorageInventoryRequest::force_refresh].
10426 ///
10427 /// # Example
10428 /// ```ignore,no_run
10429 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryRequest;
10430 /// let x = FetchStorageInventoryRequest::new().set_force_refresh(true);
10431 /// ```
10432 pub fn set_force_refresh<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10433 self.force_refresh = v.into();
10434 self
10435 }
10436
10437 /// Sets the value of [page_size][crate::model::FetchStorageInventoryRequest::page_size].
10438 ///
10439 /// # Example
10440 /// ```ignore,no_run
10441 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryRequest;
10442 /// let x = FetchStorageInventoryRequest::new().set_page_size(42);
10443 /// ```
10444 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10445 self.page_size = v.into();
10446 self
10447 }
10448
10449 /// Sets the value of [page_token][crate::model::FetchStorageInventoryRequest::page_token].
10450 ///
10451 /// # Example
10452 /// ```ignore,no_run
10453 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryRequest;
10454 /// let x = FetchStorageInventoryRequest::new().set_page_token("example");
10455 /// ```
10456 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10457 self.page_token = v.into();
10458 self
10459 }
10460}
10461
10462impl wkt::message::Message for FetchStorageInventoryRequest {
10463 fn typename() -> &'static str {
10464 "type.googleapis.com/google.cloud.vmmigration.v1.FetchStorageInventoryRequest"
10465 }
10466}
10467
10468/// Defines additional types related to [FetchStorageInventoryRequest].
10469pub mod fetch_storage_inventory_request {
10470 #[allow(unused_imports)]
10471 use super::*;
10472
10473 /// The type of the storage inventory to fetch.
10474 ///
10475 /// # Working with unknown values
10476 ///
10477 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10478 /// additional enum variants at any time. Adding new variants is not considered
10479 /// a breaking change. Applications should write their code in anticipation of:
10480 ///
10481 /// - New values appearing in future releases of the client library, **and**
10482 /// - New values received dynamically, without application changes.
10483 ///
10484 /// Please consult the [Working with enums] section in the user guide for some
10485 /// guidelines.
10486 ///
10487 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10488 #[derive(Clone, Debug, PartialEq)]
10489 #[non_exhaustive]
10490 pub enum StorageType {
10491 /// The type is unspecified.
10492 Unspecified,
10493 /// The type is disks.
10494 Disks,
10495 /// The type is snapshots.
10496 Snapshots,
10497 /// If set, the enum was initialized with an unknown value.
10498 ///
10499 /// Applications can examine the value using [StorageType::value] or
10500 /// [StorageType::name].
10501 UnknownValue(storage_type::UnknownValue),
10502 }
10503
10504 #[doc(hidden)]
10505 pub mod storage_type {
10506 #[allow(unused_imports)]
10507 use super::*;
10508 #[derive(Clone, Debug, PartialEq)]
10509 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10510 }
10511
10512 impl StorageType {
10513 /// Gets the enum value.
10514 ///
10515 /// Returns `None` if the enum contains an unknown value deserialized from
10516 /// the string representation of enums.
10517 pub fn value(&self) -> std::option::Option<i32> {
10518 match self {
10519 Self::Unspecified => std::option::Option::Some(0),
10520 Self::Disks => std::option::Option::Some(1),
10521 Self::Snapshots => std::option::Option::Some(2),
10522 Self::UnknownValue(u) => u.0.value(),
10523 }
10524 }
10525
10526 /// Gets the enum value as a string.
10527 ///
10528 /// Returns `None` if the enum contains an unknown value deserialized from
10529 /// the integer representation of enums.
10530 pub fn name(&self) -> std::option::Option<&str> {
10531 match self {
10532 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
10533 Self::Disks => std::option::Option::Some("DISKS"),
10534 Self::Snapshots => std::option::Option::Some("SNAPSHOTS"),
10535 Self::UnknownValue(u) => u.0.name(),
10536 }
10537 }
10538 }
10539
10540 impl std::default::Default for StorageType {
10541 fn default() -> Self {
10542 use std::convert::From;
10543 Self::from(0)
10544 }
10545 }
10546
10547 impl std::fmt::Display for StorageType {
10548 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10549 wkt::internal::display_enum(f, self.name(), self.value())
10550 }
10551 }
10552
10553 impl std::convert::From<i32> for StorageType {
10554 fn from(value: i32) -> Self {
10555 match value {
10556 0 => Self::Unspecified,
10557 1 => Self::Disks,
10558 2 => Self::Snapshots,
10559 _ => Self::UnknownValue(storage_type::UnknownValue(
10560 wkt::internal::UnknownEnumValue::Integer(value),
10561 )),
10562 }
10563 }
10564 }
10565
10566 impl std::convert::From<&str> for StorageType {
10567 fn from(value: &str) -> Self {
10568 use std::string::ToString;
10569 match value {
10570 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
10571 "DISKS" => Self::Disks,
10572 "SNAPSHOTS" => Self::Snapshots,
10573 _ => Self::UnknownValue(storage_type::UnknownValue(
10574 wkt::internal::UnknownEnumValue::String(value.to_string()),
10575 )),
10576 }
10577 }
10578 }
10579
10580 impl serde::ser::Serialize for StorageType {
10581 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10582 where
10583 S: serde::Serializer,
10584 {
10585 match self {
10586 Self::Unspecified => serializer.serialize_i32(0),
10587 Self::Disks => serializer.serialize_i32(1),
10588 Self::Snapshots => serializer.serialize_i32(2),
10589 Self::UnknownValue(u) => u.0.serialize(serializer),
10590 }
10591 }
10592 }
10593
10594 impl<'de> serde::de::Deserialize<'de> for StorageType {
10595 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10596 where
10597 D: serde::Deserializer<'de>,
10598 {
10599 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
10600 ".google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageType",
10601 ))
10602 }
10603 }
10604}
10605
10606/// Response message for
10607/// [fetchStorageInventory][google.cloud.vmmigration.v1.VmMigration.FetchStorageInventory].
10608///
10609/// [google.cloud.vmmigration.v1.VmMigration.FetchStorageInventory]: crate::client::VmMigration::fetch_storage_inventory
10610#[derive(Clone, Default, PartialEq)]
10611#[non_exhaustive]
10612pub struct FetchStorageInventoryResponse {
10613 /// The list of storage resources in the source.
10614 pub resources: std::vec::Vec<crate::model::SourceStorageResource>,
10615
10616 /// Output only. The timestamp when the source was last queried (if the result
10617 /// is from the cache).
10618 pub update_time: std::option::Option<wkt::Timestamp>,
10619
10620 /// Output only. A token, which can be sent as `page_token` to retrieve the
10621 /// next page. If this field is omitted, there are no subsequent pages.
10622 pub next_page_token: std::string::String,
10623
10624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10625}
10626
10627impl FetchStorageInventoryResponse {
10628 /// Creates a new default instance.
10629 pub fn new() -> Self {
10630 std::default::Default::default()
10631 }
10632
10633 /// Sets the value of [resources][crate::model::FetchStorageInventoryResponse::resources].
10634 ///
10635 /// # Example
10636 /// ```ignore,no_run
10637 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryResponse;
10638 /// use google_cloud_vmmigration_v1::model::SourceStorageResource;
10639 /// let x = FetchStorageInventoryResponse::new()
10640 /// .set_resources([
10641 /// SourceStorageResource::default()/* use setters */,
10642 /// SourceStorageResource::default()/* use (different) setters */,
10643 /// ]);
10644 /// ```
10645 pub fn set_resources<T, V>(mut self, v: T) -> Self
10646 where
10647 T: std::iter::IntoIterator<Item = V>,
10648 V: std::convert::Into<crate::model::SourceStorageResource>,
10649 {
10650 use std::iter::Iterator;
10651 self.resources = v.into_iter().map(|i| i.into()).collect();
10652 self
10653 }
10654
10655 /// Sets the value of [update_time][crate::model::FetchStorageInventoryResponse::update_time].
10656 ///
10657 /// # Example
10658 /// ```ignore,no_run
10659 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryResponse;
10660 /// use wkt::Timestamp;
10661 /// let x = FetchStorageInventoryResponse::new().set_update_time(Timestamp::default()/* use setters */);
10662 /// ```
10663 pub fn set_update_time<T>(mut self, v: T) -> Self
10664 where
10665 T: std::convert::Into<wkt::Timestamp>,
10666 {
10667 self.update_time = std::option::Option::Some(v.into());
10668 self
10669 }
10670
10671 /// Sets or clears the value of [update_time][crate::model::FetchStorageInventoryResponse::update_time].
10672 ///
10673 /// # Example
10674 /// ```ignore,no_run
10675 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryResponse;
10676 /// use wkt::Timestamp;
10677 /// let x = FetchStorageInventoryResponse::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10678 /// let x = FetchStorageInventoryResponse::new().set_or_clear_update_time(None::<Timestamp>);
10679 /// ```
10680 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10681 where
10682 T: std::convert::Into<wkt::Timestamp>,
10683 {
10684 self.update_time = v.map(|x| x.into());
10685 self
10686 }
10687
10688 /// Sets the value of [next_page_token][crate::model::FetchStorageInventoryResponse::next_page_token].
10689 ///
10690 /// # Example
10691 /// ```ignore,no_run
10692 /// # use google_cloud_vmmigration_v1::model::FetchStorageInventoryResponse;
10693 /// let x = FetchStorageInventoryResponse::new().set_next_page_token("example");
10694 /// ```
10695 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10696 self.next_page_token = v.into();
10697 self
10698 }
10699}
10700
10701impl wkt::message::Message for FetchStorageInventoryResponse {
10702 fn typename() -> &'static str {
10703 "type.googleapis.com/google.cloud.vmmigration.v1.FetchStorageInventoryResponse"
10704 }
10705}
10706
10707#[doc(hidden)]
10708impl google_cloud_gax::paginator::internal::PageableResponse for FetchStorageInventoryResponse {
10709 type PageItem = crate::model::SourceStorageResource;
10710
10711 fn items(self) -> std::vec::Vec<Self::PageItem> {
10712 self.resources
10713 }
10714
10715 fn next_page_token(&self) -> std::string::String {
10716 use std::clone::Clone;
10717 self.next_page_token.clone()
10718 }
10719}
10720
10721/// SourceStorageResource describes a storage resource in the source.
10722#[derive(Clone, Default, PartialEq)]
10723#[non_exhaustive]
10724pub struct SourceStorageResource {
10725 /// Source storage resource details.
10726 pub storage_resource:
10727 std::option::Option<crate::model::source_storage_resource::StorageResource>,
10728
10729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10730}
10731
10732impl SourceStorageResource {
10733 /// Creates a new default instance.
10734 pub fn new() -> Self {
10735 std::default::Default::default()
10736 }
10737
10738 /// Sets the value of [storage_resource][crate::model::SourceStorageResource::storage_resource].
10739 ///
10740 /// Note that all the setters affecting `storage_resource` are mutually
10741 /// exclusive.
10742 ///
10743 /// # Example
10744 /// ```ignore,no_run
10745 /// # use google_cloud_vmmigration_v1::model::SourceStorageResource;
10746 /// use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
10747 /// let x = SourceStorageResource::new().set_storage_resource(Some(
10748 /// google_cloud_vmmigration_v1::model::source_storage_resource::StorageResource::AwsDiskDetails(AwsSourceDiskDetails::default().into())));
10749 /// ```
10750 pub fn set_storage_resource<
10751 T: std::convert::Into<
10752 std::option::Option<crate::model::source_storage_resource::StorageResource>,
10753 >,
10754 >(
10755 mut self,
10756 v: T,
10757 ) -> Self {
10758 self.storage_resource = v.into();
10759 self
10760 }
10761
10762 /// The value of [storage_resource][crate::model::SourceStorageResource::storage_resource]
10763 /// if it holds a `AwsDiskDetails`, `None` if the field is not set or
10764 /// holds a different branch.
10765 pub fn aws_disk_details(
10766 &self,
10767 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceDiskDetails>> {
10768 #[allow(unreachable_patterns)]
10769 self.storage_resource.as_ref().and_then(|v| match v {
10770 crate::model::source_storage_resource::StorageResource::AwsDiskDetails(v) => {
10771 std::option::Option::Some(v)
10772 }
10773 _ => std::option::Option::None,
10774 })
10775 }
10776
10777 /// Sets the value of [storage_resource][crate::model::SourceStorageResource::storage_resource]
10778 /// to hold a `AwsDiskDetails`.
10779 ///
10780 /// Note that all the setters affecting `storage_resource` are
10781 /// mutually exclusive.
10782 ///
10783 /// # Example
10784 /// ```ignore,no_run
10785 /// # use google_cloud_vmmigration_v1::model::SourceStorageResource;
10786 /// use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
10787 /// let x = SourceStorageResource::new().set_aws_disk_details(AwsSourceDiskDetails::default()/* use setters */);
10788 /// assert!(x.aws_disk_details().is_some());
10789 /// ```
10790 pub fn set_aws_disk_details<
10791 T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceDiskDetails>>,
10792 >(
10793 mut self,
10794 v: T,
10795 ) -> Self {
10796 self.storage_resource = std::option::Option::Some(
10797 crate::model::source_storage_resource::StorageResource::AwsDiskDetails(v.into()),
10798 );
10799 self
10800 }
10801}
10802
10803impl wkt::message::Message for SourceStorageResource {
10804 fn typename() -> &'static str {
10805 "type.googleapis.com/google.cloud.vmmigration.v1.SourceStorageResource"
10806 }
10807}
10808
10809/// Defines additional types related to [SourceStorageResource].
10810pub mod source_storage_resource {
10811 #[allow(unused_imports)]
10812 use super::*;
10813
10814 /// Source storage resource details.
10815 #[derive(Clone, Debug, PartialEq)]
10816 #[non_exhaustive]
10817 pub enum StorageResource {
10818 /// Source AWS volume details.
10819 AwsDiskDetails(std::boxed::Box<crate::model::AwsSourceDiskDetails>),
10820 }
10821}
10822
10823/// Utilization report details the utilization (CPU, memory, etc.) of selected
10824/// source VMs.
10825#[derive(Clone, Default, PartialEq)]
10826#[non_exhaustive]
10827pub struct UtilizationReport {
10828 /// Output only. The report unique name.
10829 pub name: std::string::String,
10830
10831 /// The report display name, as assigned by the user.
10832 pub display_name: std::string::String,
10833
10834 /// Output only. Current state of the report.
10835 pub state: crate::model::utilization_report::State,
10836
10837 /// Output only. The time the state was last set.
10838 pub state_time: std::option::Option<wkt::Timestamp>,
10839
10840 /// Output only. Provides details on the state of the report in case of an
10841 /// error.
10842 pub error: std::option::Option<google_cloud_rpc::model::Status>,
10843
10844 /// Output only. The time the report was created (this refers to the time of
10845 /// the request, not the time the report creation completed).
10846 pub create_time: std::option::Option<wkt::Timestamp>,
10847
10848 /// Time frame of the report.
10849 pub time_frame: crate::model::utilization_report::TimeFrame,
10850
10851 /// Output only. The point in time when the time frame ends. Notice that the
10852 /// time frame is counted backwards. For instance if the "frame_end_time" value
10853 /// is 2021/01/20 and the time frame is WEEK then the report covers the week
10854 /// between 2021/01/20 and 2021/01/14.
10855 pub frame_end_time: std::option::Option<wkt::Timestamp>,
10856
10857 /// Output only. Total number of VMs included in the report.
10858 pub vm_count: i32,
10859
10860 /// List of utilization information per VM.
10861 /// When sent as part of the request, the "vm_id" field is used in order to
10862 /// specify which VMs to include in the report. In that case all other fields
10863 /// are ignored.
10864 pub vms: std::vec::Vec<crate::model::VmUtilizationInfo>,
10865
10866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10867}
10868
10869impl UtilizationReport {
10870 /// Creates a new default instance.
10871 pub fn new() -> Self {
10872 std::default::Default::default()
10873 }
10874
10875 /// Sets the value of [name][crate::model::UtilizationReport::name].
10876 ///
10877 /// # Example
10878 /// ```ignore,no_run
10879 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10880 /// # let project_id = "project_id";
10881 /// # let location_id = "location_id";
10882 /// # let source_id = "source_id";
10883 /// # let utilization_report_id = "utilization_report_id";
10884 /// let x = UtilizationReport::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/utilizationReports/{utilization_report_id}"));
10885 /// ```
10886 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10887 self.name = v.into();
10888 self
10889 }
10890
10891 /// Sets the value of [display_name][crate::model::UtilizationReport::display_name].
10892 ///
10893 /// # Example
10894 /// ```ignore,no_run
10895 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10896 /// let x = UtilizationReport::new().set_display_name("example");
10897 /// ```
10898 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10899 self.display_name = v.into();
10900 self
10901 }
10902
10903 /// Sets the value of [state][crate::model::UtilizationReport::state].
10904 ///
10905 /// # Example
10906 /// ```ignore,no_run
10907 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10908 /// use google_cloud_vmmigration_v1::model::utilization_report::State;
10909 /// let x0 = UtilizationReport::new().set_state(State::Creating);
10910 /// let x1 = UtilizationReport::new().set_state(State::Succeeded);
10911 /// let x2 = UtilizationReport::new().set_state(State::Failed);
10912 /// ```
10913 pub fn set_state<T: std::convert::Into<crate::model::utilization_report::State>>(
10914 mut self,
10915 v: T,
10916 ) -> Self {
10917 self.state = v.into();
10918 self
10919 }
10920
10921 /// Sets the value of [state_time][crate::model::UtilizationReport::state_time].
10922 ///
10923 /// # Example
10924 /// ```ignore,no_run
10925 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10926 /// use wkt::Timestamp;
10927 /// let x = UtilizationReport::new().set_state_time(Timestamp::default()/* use setters */);
10928 /// ```
10929 pub fn set_state_time<T>(mut self, v: T) -> Self
10930 where
10931 T: std::convert::Into<wkt::Timestamp>,
10932 {
10933 self.state_time = std::option::Option::Some(v.into());
10934 self
10935 }
10936
10937 /// Sets or clears the value of [state_time][crate::model::UtilizationReport::state_time].
10938 ///
10939 /// # Example
10940 /// ```ignore,no_run
10941 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10942 /// use wkt::Timestamp;
10943 /// let x = UtilizationReport::new().set_or_clear_state_time(Some(Timestamp::default()/* use setters */));
10944 /// let x = UtilizationReport::new().set_or_clear_state_time(None::<Timestamp>);
10945 /// ```
10946 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
10947 where
10948 T: std::convert::Into<wkt::Timestamp>,
10949 {
10950 self.state_time = v.map(|x| x.into());
10951 self
10952 }
10953
10954 /// Sets the value of [error][crate::model::UtilizationReport::error].
10955 ///
10956 /// # Example
10957 /// ```ignore,no_run
10958 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10959 /// use google_cloud_rpc::model::Status;
10960 /// let x = UtilizationReport::new().set_error(Status::default()/* use setters */);
10961 /// ```
10962 pub fn set_error<T>(mut self, v: T) -> Self
10963 where
10964 T: std::convert::Into<google_cloud_rpc::model::Status>,
10965 {
10966 self.error = std::option::Option::Some(v.into());
10967 self
10968 }
10969
10970 /// Sets or clears the value of [error][crate::model::UtilizationReport::error].
10971 ///
10972 /// # Example
10973 /// ```ignore,no_run
10974 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10975 /// use google_cloud_rpc::model::Status;
10976 /// let x = UtilizationReport::new().set_or_clear_error(Some(Status::default()/* use setters */));
10977 /// let x = UtilizationReport::new().set_or_clear_error(None::<Status>);
10978 /// ```
10979 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
10980 where
10981 T: std::convert::Into<google_cloud_rpc::model::Status>,
10982 {
10983 self.error = v.map(|x| x.into());
10984 self
10985 }
10986
10987 /// Sets the value of [create_time][crate::model::UtilizationReport::create_time].
10988 ///
10989 /// # Example
10990 /// ```ignore,no_run
10991 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
10992 /// use wkt::Timestamp;
10993 /// let x = UtilizationReport::new().set_create_time(Timestamp::default()/* use setters */);
10994 /// ```
10995 pub fn set_create_time<T>(mut self, v: T) -> Self
10996 where
10997 T: std::convert::Into<wkt::Timestamp>,
10998 {
10999 self.create_time = std::option::Option::Some(v.into());
11000 self
11001 }
11002
11003 /// Sets or clears the value of [create_time][crate::model::UtilizationReport::create_time].
11004 ///
11005 /// # Example
11006 /// ```ignore,no_run
11007 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
11008 /// use wkt::Timestamp;
11009 /// let x = UtilizationReport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11010 /// let x = UtilizationReport::new().set_or_clear_create_time(None::<Timestamp>);
11011 /// ```
11012 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11013 where
11014 T: std::convert::Into<wkt::Timestamp>,
11015 {
11016 self.create_time = v.map(|x| x.into());
11017 self
11018 }
11019
11020 /// Sets the value of [time_frame][crate::model::UtilizationReport::time_frame].
11021 ///
11022 /// # Example
11023 /// ```ignore,no_run
11024 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
11025 /// use google_cloud_vmmigration_v1::model::utilization_report::TimeFrame;
11026 /// let x0 = UtilizationReport::new().set_time_frame(TimeFrame::Week);
11027 /// let x1 = UtilizationReport::new().set_time_frame(TimeFrame::Month);
11028 /// let x2 = UtilizationReport::new().set_time_frame(TimeFrame::Year);
11029 /// ```
11030 pub fn set_time_frame<T: std::convert::Into<crate::model::utilization_report::TimeFrame>>(
11031 mut self,
11032 v: T,
11033 ) -> Self {
11034 self.time_frame = v.into();
11035 self
11036 }
11037
11038 /// Sets the value of [frame_end_time][crate::model::UtilizationReport::frame_end_time].
11039 ///
11040 /// # Example
11041 /// ```ignore,no_run
11042 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
11043 /// use wkt::Timestamp;
11044 /// let x = UtilizationReport::new().set_frame_end_time(Timestamp::default()/* use setters */);
11045 /// ```
11046 pub fn set_frame_end_time<T>(mut self, v: T) -> Self
11047 where
11048 T: std::convert::Into<wkt::Timestamp>,
11049 {
11050 self.frame_end_time = std::option::Option::Some(v.into());
11051 self
11052 }
11053
11054 /// Sets or clears the value of [frame_end_time][crate::model::UtilizationReport::frame_end_time].
11055 ///
11056 /// # Example
11057 /// ```ignore,no_run
11058 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
11059 /// use wkt::Timestamp;
11060 /// let x = UtilizationReport::new().set_or_clear_frame_end_time(Some(Timestamp::default()/* use setters */));
11061 /// let x = UtilizationReport::new().set_or_clear_frame_end_time(None::<Timestamp>);
11062 /// ```
11063 pub fn set_or_clear_frame_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11064 where
11065 T: std::convert::Into<wkt::Timestamp>,
11066 {
11067 self.frame_end_time = v.map(|x| x.into());
11068 self
11069 }
11070
11071 /// Sets the value of [vm_count][crate::model::UtilizationReport::vm_count].
11072 ///
11073 /// # Example
11074 /// ```ignore,no_run
11075 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
11076 /// let x = UtilizationReport::new().set_vm_count(42);
11077 /// ```
11078 pub fn set_vm_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11079 self.vm_count = v.into();
11080 self
11081 }
11082
11083 /// Sets the value of [vms][crate::model::UtilizationReport::vms].
11084 ///
11085 /// # Example
11086 /// ```ignore,no_run
11087 /// # use google_cloud_vmmigration_v1::model::UtilizationReport;
11088 /// use google_cloud_vmmigration_v1::model::VmUtilizationInfo;
11089 /// let x = UtilizationReport::new()
11090 /// .set_vms([
11091 /// VmUtilizationInfo::default()/* use setters */,
11092 /// VmUtilizationInfo::default()/* use (different) setters */,
11093 /// ]);
11094 /// ```
11095 pub fn set_vms<T, V>(mut self, v: T) -> Self
11096 where
11097 T: std::iter::IntoIterator<Item = V>,
11098 V: std::convert::Into<crate::model::VmUtilizationInfo>,
11099 {
11100 use std::iter::Iterator;
11101 self.vms = v.into_iter().map(|i| i.into()).collect();
11102 self
11103 }
11104}
11105
11106impl wkt::message::Message for UtilizationReport {
11107 fn typename() -> &'static str {
11108 "type.googleapis.com/google.cloud.vmmigration.v1.UtilizationReport"
11109 }
11110}
11111
11112/// Defines additional types related to [UtilizationReport].
11113pub mod utilization_report {
11114 #[allow(unused_imports)]
11115 use super::*;
11116
11117 /// Utilization report state.
11118 ///
11119 /// # Working with unknown values
11120 ///
11121 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11122 /// additional enum variants at any time. Adding new variants is not considered
11123 /// a breaking change. Applications should write their code in anticipation of:
11124 ///
11125 /// - New values appearing in future releases of the client library, **and**
11126 /// - New values received dynamically, without application changes.
11127 ///
11128 /// Please consult the [Working with enums] section in the user guide for some
11129 /// guidelines.
11130 ///
11131 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11132 #[derive(Clone, Debug, PartialEq)]
11133 #[non_exhaustive]
11134 pub enum State {
11135 /// The state is unknown. This value is not in use.
11136 Unspecified,
11137 /// The report is in the making.
11138 Creating,
11139 /// Report creation completed successfully.
11140 Succeeded,
11141 /// Report creation failed.
11142 Failed,
11143 /// If set, the enum was initialized with an unknown value.
11144 ///
11145 /// Applications can examine the value using [State::value] or
11146 /// [State::name].
11147 UnknownValue(state::UnknownValue),
11148 }
11149
11150 #[doc(hidden)]
11151 pub mod state {
11152 #[allow(unused_imports)]
11153 use super::*;
11154 #[derive(Clone, Debug, PartialEq)]
11155 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11156 }
11157
11158 impl State {
11159 /// Gets the enum value.
11160 ///
11161 /// Returns `None` if the enum contains an unknown value deserialized from
11162 /// the string representation of enums.
11163 pub fn value(&self) -> std::option::Option<i32> {
11164 match self {
11165 Self::Unspecified => std::option::Option::Some(0),
11166 Self::Creating => std::option::Option::Some(1),
11167 Self::Succeeded => std::option::Option::Some(2),
11168 Self::Failed => std::option::Option::Some(3),
11169 Self::UnknownValue(u) => u.0.value(),
11170 }
11171 }
11172
11173 /// Gets the enum value as a string.
11174 ///
11175 /// Returns `None` if the enum contains an unknown value deserialized from
11176 /// the integer representation of enums.
11177 pub fn name(&self) -> std::option::Option<&str> {
11178 match self {
11179 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11180 Self::Creating => std::option::Option::Some("CREATING"),
11181 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
11182 Self::Failed => std::option::Option::Some("FAILED"),
11183 Self::UnknownValue(u) => u.0.name(),
11184 }
11185 }
11186 }
11187
11188 impl std::default::Default for State {
11189 fn default() -> Self {
11190 use std::convert::From;
11191 Self::from(0)
11192 }
11193 }
11194
11195 impl std::fmt::Display for State {
11196 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11197 wkt::internal::display_enum(f, self.name(), self.value())
11198 }
11199 }
11200
11201 impl std::convert::From<i32> for State {
11202 fn from(value: i32) -> Self {
11203 match value {
11204 0 => Self::Unspecified,
11205 1 => Self::Creating,
11206 2 => Self::Succeeded,
11207 3 => Self::Failed,
11208 _ => Self::UnknownValue(state::UnknownValue(
11209 wkt::internal::UnknownEnumValue::Integer(value),
11210 )),
11211 }
11212 }
11213 }
11214
11215 impl std::convert::From<&str> for State {
11216 fn from(value: &str) -> Self {
11217 use std::string::ToString;
11218 match value {
11219 "STATE_UNSPECIFIED" => Self::Unspecified,
11220 "CREATING" => Self::Creating,
11221 "SUCCEEDED" => Self::Succeeded,
11222 "FAILED" => Self::Failed,
11223 _ => Self::UnknownValue(state::UnknownValue(
11224 wkt::internal::UnknownEnumValue::String(value.to_string()),
11225 )),
11226 }
11227 }
11228 }
11229
11230 impl serde::ser::Serialize for State {
11231 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11232 where
11233 S: serde::Serializer,
11234 {
11235 match self {
11236 Self::Unspecified => serializer.serialize_i32(0),
11237 Self::Creating => serializer.serialize_i32(1),
11238 Self::Succeeded => serializer.serialize_i32(2),
11239 Self::Failed => serializer.serialize_i32(3),
11240 Self::UnknownValue(u) => u.0.serialize(serializer),
11241 }
11242 }
11243 }
11244
11245 impl<'de> serde::de::Deserialize<'de> for State {
11246 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11247 where
11248 D: serde::Deserializer<'de>,
11249 {
11250 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11251 ".google.cloud.vmmigration.v1.UtilizationReport.State",
11252 ))
11253 }
11254 }
11255
11256 /// Report time frame options.
11257 ///
11258 /// # Working with unknown values
11259 ///
11260 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11261 /// additional enum variants at any time. Adding new variants is not considered
11262 /// a breaking change. Applications should write their code in anticipation of:
11263 ///
11264 /// - New values appearing in future releases of the client library, **and**
11265 /// - New values received dynamically, without application changes.
11266 ///
11267 /// Please consult the [Working with enums] section in the user guide for some
11268 /// guidelines.
11269 ///
11270 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11271 #[derive(Clone, Debug, PartialEq)]
11272 #[non_exhaustive]
11273 pub enum TimeFrame {
11274 /// The time frame was not specified and will default to WEEK.
11275 Unspecified,
11276 /// One week.
11277 Week,
11278 /// One month.
11279 Month,
11280 /// One year.
11281 Year,
11282 /// If set, the enum was initialized with an unknown value.
11283 ///
11284 /// Applications can examine the value using [TimeFrame::value] or
11285 /// [TimeFrame::name].
11286 UnknownValue(time_frame::UnknownValue),
11287 }
11288
11289 #[doc(hidden)]
11290 pub mod time_frame {
11291 #[allow(unused_imports)]
11292 use super::*;
11293 #[derive(Clone, Debug, PartialEq)]
11294 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11295 }
11296
11297 impl TimeFrame {
11298 /// Gets the enum value.
11299 ///
11300 /// Returns `None` if the enum contains an unknown value deserialized from
11301 /// the string representation of enums.
11302 pub fn value(&self) -> std::option::Option<i32> {
11303 match self {
11304 Self::Unspecified => std::option::Option::Some(0),
11305 Self::Week => std::option::Option::Some(1),
11306 Self::Month => std::option::Option::Some(2),
11307 Self::Year => std::option::Option::Some(3),
11308 Self::UnknownValue(u) => u.0.value(),
11309 }
11310 }
11311
11312 /// Gets the enum value as a string.
11313 ///
11314 /// Returns `None` if the enum contains an unknown value deserialized from
11315 /// the integer representation of enums.
11316 pub fn name(&self) -> std::option::Option<&str> {
11317 match self {
11318 Self::Unspecified => std::option::Option::Some("TIME_FRAME_UNSPECIFIED"),
11319 Self::Week => std::option::Option::Some("WEEK"),
11320 Self::Month => std::option::Option::Some("MONTH"),
11321 Self::Year => std::option::Option::Some("YEAR"),
11322 Self::UnknownValue(u) => u.0.name(),
11323 }
11324 }
11325 }
11326
11327 impl std::default::Default for TimeFrame {
11328 fn default() -> Self {
11329 use std::convert::From;
11330 Self::from(0)
11331 }
11332 }
11333
11334 impl std::fmt::Display for TimeFrame {
11335 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11336 wkt::internal::display_enum(f, self.name(), self.value())
11337 }
11338 }
11339
11340 impl std::convert::From<i32> for TimeFrame {
11341 fn from(value: i32) -> Self {
11342 match value {
11343 0 => Self::Unspecified,
11344 1 => Self::Week,
11345 2 => Self::Month,
11346 3 => Self::Year,
11347 _ => Self::UnknownValue(time_frame::UnknownValue(
11348 wkt::internal::UnknownEnumValue::Integer(value),
11349 )),
11350 }
11351 }
11352 }
11353
11354 impl std::convert::From<&str> for TimeFrame {
11355 fn from(value: &str) -> Self {
11356 use std::string::ToString;
11357 match value {
11358 "TIME_FRAME_UNSPECIFIED" => Self::Unspecified,
11359 "WEEK" => Self::Week,
11360 "MONTH" => Self::Month,
11361 "YEAR" => Self::Year,
11362 _ => Self::UnknownValue(time_frame::UnknownValue(
11363 wkt::internal::UnknownEnumValue::String(value.to_string()),
11364 )),
11365 }
11366 }
11367 }
11368
11369 impl serde::ser::Serialize for TimeFrame {
11370 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11371 where
11372 S: serde::Serializer,
11373 {
11374 match self {
11375 Self::Unspecified => serializer.serialize_i32(0),
11376 Self::Week => serializer.serialize_i32(1),
11377 Self::Month => serializer.serialize_i32(2),
11378 Self::Year => serializer.serialize_i32(3),
11379 Self::UnknownValue(u) => u.0.serialize(serializer),
11380 }
11381 }
11382 }
11383
11384 impl<'de> serde::de::Deserialize<'de> for TimeFrame {
11385 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11386 where
11387 D: serde::Deserializer<'de>,
11388 {
11389 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TimeFrame>::new(
11390 ".google.cloud.vmmigration.v1.UtilizationReport.TimeFrame",
11391 ))
11392 }
11393 }
11394}
11395
11396/// Utilization information of a single VM.
11397#[derive(Clone, Default, PartialEq)]
11398#[non_exhaustive]
11399pub struct VmUtilizationInfo {
11400 /// The VM's ID in the source.
11401 pub vm_id: std::string::String,
11402
11403 /// Utilization metrics for this VM.
11404 pub utilization: std::option::Option<crate::model::VmUtilizationMetrics>,
11405
11406 #[allow(missing_docs)]
11407 pub vm_details: std::option::Option<crate::model::vm_utilization_info::VmDetails>,
11408
11409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11410}
11411
11412impl VmUtilizationInfo {
11413 /// Creates a new default instance.
11414 pub fn new() -> Self {
11415 std::default::Default::default()
11416 }
11417
11418 /// Sets the value of [vm_id][crate::model::VmUtilizationInfo::vm_id].
11419 ///
11420 /// # Example
11421 /// ```ignore,no_run
11422 /// # use google_cloud_vmmigration_v1::model::VmUtilizationInfo;
11423 /// let x = VmUtilizationInfo::new().set_vm_id("example");
11424 /// ```
11425 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11426 self.vm_id = v.into();
11427 self
11428 }
11429
11430 /// Sets the value of [utilization][crate::model::VmUtilizationInfo::utilization].
11431 ///
11432 /// # Example
11433 /// ```ignore,no_run
11434 /// # use google_cloud_vmmigration_v1::model::VmUtilizationInfo;
11435 /// use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11436 /// let x = VmUtilizationInfo::new().set_utilization(VmUtilizationMetrics::default()/* use setters */);
11437 /// ```
11438 pub fn set_utilization<T>(mut self, v: T) -> Self
11439 where
11440 T: std::convert::Into<crate::model::VmUtilizationMetrics>,
11441 {
11442 self.utilization = std::option::Option::Some(v.into());
11443 self
11444 }
11445
11446 /// Sets or clears the value of [utilization][crate::model::VmUtilizationInfo::utilization].
11447 ///
11448 /// # Example
11449 /// ```ignore,no_run
11450 /// # use google_cloud_vmmigration_v1::model::VmUtilizationInfo;
11451 /// use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11452 /// let x = VmUtilizationInfo::new().set_or_clear_utilization(Some(VmUtilizationMetrics::default()/* use setters */));
11453 /// let x = VmUtilizationInfo::new().set_or_clear_utilization(None::<VmUtilizationMetrics>);
11454 /// ```
11455 pub fn set_or_clear_utilization<T>(mut self, v: std::option::Option<T>) -> Self
11456 where
11457 T: std::convert::Into<crate::model::VmUtilizationMetrics>,
11458 {
11459 self.utilization = v.map(|x| x.into());
11460 self
11461 }
11462
11463 /// Sets the value of [vm_details][crate::model::VmUtilizationInfo::vm_details].
11464 ///
11465 /// Note that all the setters affecting `vm_details` are mutually
11466 /// exclusive.
11467 ///
11468 /// # Example
11469 /// ```ignore,no_run
11470 /// # use google_cloud_vmmigration_v1::model::VmUtilizationInfo;
11471 /// use google_cloud_vmmigration_v1::model::VmwareVmDetails;
11472 /// let x = VmUtilizationInfo::new().set_vm_details(Some(
11473 /// google_cloud_vmmigration_v1::model::vm_utilization_info::VmDetails::VmwareVmDetails(VmwareVmDetails::default().into())));
11474 /// ```
11475 pub fn set_vm_details<
11476 T: std::convert::Into<std::option::Option<crate::model::vm_utilization_info::VmDetails>>,
11477 >(
11478 mut self,
11479 v: T,
11480 ) -> Self {
11481 self.vm_details = v.into();
11482 self
11483 }
11484
11485 /// The value of [vm_details][crate::model::VmUtilizationInfo::vm_details]
11486 /// if it holds a `VmwareVmDetails`, `None` if the field is not set or
11487 /// holds a different branch.
11488 pub fn vmware_vm_details(
11489 &self,
11490 ) -> std::option::Option<&std::boxed::Box<crate::model::VmwareVmDetails>> {
11491 #[allow(unreachable_patterns)]
11492 self.vm_details.as_ref().and_then(|v| match v {
11493 crate::model::vm_utilization_info::VmDetails::VmwareVmDetails(v) => {
11494 std::option::Option::Some(v)
11495 }
11496 _ => std::option::Option::None,
11497 })
11498 }
11499
11500 /// Sets the value of [vm_details][crate::model::VmUtilizationInfo::vm_details]
11501 /// to hold a `VmwareVmDetails`.
11502 ///
11503 /// Note that all the setters affecting `vm_details` are
11504 /// mutually exclusive.
11505 ///
11506 /// # Example
11507 /// ```ignore,no_run
11508 /// # use google_cloud_vmmigration_v1::model::VmUtilizationInfo;
11509 /// use google_cloud_vmmigration_v1::model::VmwareVmDetails;
11510 /// let x = VmUtilizationInfo::new().set_vmware_vm_details(VmwareVmDetails::default()/* use setters */);
11511 /// assert!(x.vmware_vm_details().is_some());
11512 /// ```
11513 pub fn set_vmware_vm_details<
11514 T: std::convert::Into<std::boxed::Box<crate::model::VmwareVmDetails>>,
11515 >(
11516 mut self,
11517 v: T,
11518 ) -> Self {
11519 self.vm_details = std::option::Option::Some(
11520 crate::model::vm_utilization_info::VmDetails::VmwareVmDetails(v.into()),
11521 );
11522 self
11523 }
11524}
11525
11526impl wkt::message::Message for VmUtilizationInfo {
11527 fn typename() -> &'static str {
11528 "type.googleapis.com/google.cloud.vmmigration.v1.VmUtilizationInfo"
11529 }
11530}
11531
11532/// Defines additional types related to [VmUtilizationInfo].
11533pub mod vm_utilization_info {
11534 #[allow(unused_imports)]
11535 use super::*;
11536
11537 #[allow(missing_docs)]
11538 #[derive(Clone, Debug, PartialEq)]
11539 #[non_exhaustive]
11540 pub enum VmDetails {
11541 /// The description of the VM in a Source of type Vmware.
11542 VmwareVmDetails(std::boxed::Box<crate::model::VmwareVmDetails>),
11543 }
11544}
11545
11546/// Utilization metrics values for a single VM.
11547#[derive(Clone, Default, PartialEq)]
11548#[non_exhaustive]
11549pub struct VmUtilizationMetrics {
11550 /// Max CPU usage, percent.
11551 pub cpu_max_percent: i32,
11552
11553 /// Average CPU usage, percent.
11554 pub cpu_average_percent: i32,
11555
11556 /// Max memory usage, percent.
11557 pub memory_max_percent: i32,
11558
11559 /// Average memory usage, percent.
11560 pub memory_average_percent: i32,
11561
11562 /// Max disk IO rate, in kilobytes per second.
11563 pub disk_io_rate_max_kbps: i64,
11564
11565 /// Average disk IO rate, in kilobytes per second.
11566 pub disk_io_rate_average_kbps: i64,
11567
11568 /// Max network throughput (combined transmit-rates and receive-rates), in
11569 /// kilobytes per second.
11570 pub network_throughput_max_kbps: i64,
11571
11572 /// Average network throughput (combined transmit-rates and receive-rates), in
11573 /// kilobytes per second.
11574 pub network_throughput_average_kbps: i64,
11575
11576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11577}
11578
11579impl VmUtilizationMetrics {
11580 /// Creates a new default instance.
11581 pub fn new() -> Self {
11582 std::default::Default::default()
11583 }
11584
11585 /// Sets the value of [cpu_max_percent][crate::model::VmUtilizationMetrics::cpu_max_percent].
11586 ///
11587 /// # Example
11588 /// ```ignore,no_run
11589 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11590 /// let x = VmUtilizationMetrics::new().set_cpu_max_percent(42);
11591 /// ```
11592 pub fn set_cpu_max_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11593 self.cpu_max_percent = v.into();
11594 self
11595 }
11596
11597 /// Sets the value of [cpu_average_percent][crate::model::VmUtilizationMetrics::cpu_average_percent].
11598 ///
11599 /// # Example
11600 /// ```ignore,no_run
11601 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11602 /// let x = VmUtilizationMetrics::new().set_cpu_average_percent(42);
11603 /// ```
11604 pub fn set_cpu_average_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11605 self.cpu_average_percent = v.into();
11606 self
11607 }
11608
11609 /// Sets the value of [memory_max_percent][crate::model::VmUtilizationMetrics::memory_max_percent].
11610 ///
11611 /// # Example
11612 /// ```ignore,no_run
11613 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11614 /// let x = VmUtilizationMetrics::new().set_memory_max_percent(42);
11615 /// ```
11616 pub fn set_memory_max_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11617 self.memory_max_percent = v.into();
11618 self
11619 }
11620
11621 /// Sets the value of [memory_average_percent][crate::model::VmUtilizationMetrics::memory_average_percent].
11622 ///
11623 /// # Example
11624 /// ```ignore,no_run
11625 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11626 /// let x = VmUtilizationMetrics::new().set_memory_average_percent(42);
11627 /// ```
11628 pub fn set_memory_average_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11629 self.memory_average_percent = v.into();
11630 self
11631 }
11632
11633 /// Sets the value of [disk_io_rate_max_kbps][crate::model::VmUtilizationMetrics::disk_io_rate_max_kbps].
11634 ///
11635 /// # Example
11636 /// ```ignore,no_run
11637 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11638 /// let x = VmUtilizationMetrics::new().set_disk_io_rate_max_kbps(42);
11639 /// ```
11640 pub fn set_disk_io_rate_max_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11641 self.disk_io_rate_max_kbps = v.into();
11642 self
11643 }
11644
11645 /// Sets the value of [disk_io_rate_average_kbps][crate::model::VmUtilizationMetrics::disk_io_rate_average_kbps].
11646 ///
11647 /// # Example
11648 /// ```ignore,no_run
11649 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11650 /// let x = VmUtilizationMetrics::new().set_disk_io_rate_average_kbps(42);
11651 /// ```
11652 pub fn set_disk_io_rate_average_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11653 self.disk_io_rate_average_kbps = v.into();
11654 self
11655 }
11656
11657 /// Sets the value of [network_throughput_max_kbps][crate::model::VmUtilizationMetrics::network_throughput_max_kbps].
11658 ///
11659 /// # Example
11660 /// ```ignore,no_run
11661 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11662 /// let x = VmUtilizationMetrics::new().set_network_throughput_max_kbps(42);
11663 /// ```
11664 pub fn set_network_throughput_max_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11665 self.network_throughput_max_kbps = v.into();
11666 self
11667 }
11668
11669 /// Sets the value of [network_throughput_average_kbps][crate::model::VmUtilizationMetrics::network_throughput_average_kbps].
11670 ///
11671 /// # Example
11672 /// ```ignore,no_run
11673 /// # use google_cloud_vmmigration_v1::model::VmUtilizationMetrics;
11674 /// let x = VmUtilizationMetrics::new().set_network_throughput_average_kbps(42);
11675 /// ```
11676 pub fn set_network_throughput_average_kbps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11677 self.network_throughput_average_kbps = v.into();
11678 self
11679 }
11680}
11681
11682impl wkt::message::Message for VmUtilizationMetrics {
11683 fn typename() -> &'static str {
11684 "type.googleapis.com/google.cloud.vmmigration.v1.VmUtilizationMetrics"
11685 }
11686}
11687
11688/// Request message for 'ListUtilizationReports' request.
11689#[derive(Clone, Default, PartialEq)]
11690#[non_exhaustive]
11691pub struct ListUtilizationReportsRequest {
11692 /// Required. The Utilization Reports parent.
11693 pub parent: std::string::String,
11694
11695 /// Optional. The level of details of each report.
11696 /// Defaults to BASIC.
11697 pub view: crate::model::UtilizationReportView,
11698
11699 /// Optional. The maximum number of reports to return. The service may return
11700 /// fewer than this value. If unspecified, at most 500 reports will be
11701 /// returned. The maximum value is 1000; values above 1000 will be coerced to
11702 /// 1000.
11703 pub page_size: i32,
11704
11705 /// Required. A page token, received from a previous `ListUtilizationReports`
11706 /// call. Provide this to retrieve the subsequent page.
11707 ///
11708 /// When paginating, all other parameters provided to `ListUtilizationReports`
11709 /// must match the call that provided the page token.
11710 pub page_token: std::string::String,
11711
11712 /// Optional. The filter request.
11713 pub filter: std::string::String,
11714
11715 /// Optional. the order by fields for the result.
11716 pub order_by: std::string::String,
11717
11718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11719}
11720
11721impl ListUtilizationReportsRequest {
11722 /// Creates a new default instance.
11723 pub fn new() -> Self {
11724 std::default::Default::default()
11725 }
11726
11727 /// Sets the value of [parent][crate::model::ListUtilizationReportsRequest::parent].
11728 ///
11729 /// # Example
11730 /// ```ignore,no_run
11731 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsRequest;
11732 /// # let project_id = "project_id";
11733 /// # let location_id = "location_id";
11734 /// # let source_id = "source_id";
11735 /// let x = ListUtilizationReportsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
11736 /// ```
11737 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11738 self.parent = v.into();
11739 self
11740 }
11741
11742 /// Sets the value of [view][crate::model::ListUtilizationReportsRequest::view].
11743 ///
11744 /// # Example
11745 /// ```ignore,no_run
11746 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsRequest;
11747 /// use google_cloud_vmmigration_v1::model::UtilizationReportView;
11748 /// let x0 = ListUtilizationReportsRequest::new().set_view(UtilizationReportView::Basic);
11749 /// let x1 = ListUtilizationReportsRequest::new().set_view(UtilizationReportView::Full);
11750 /// ```
11751 pub fn set_view<T: std::convert::Into<crate::model::UtilizationReportView>>(
11752 mut self,
11753 v: T,
11754 ) -> Self {
11755 self.view = v.into();
11756 self
11757 }
11758
11759 /// Sets the value of [page_size][crate::model::ListUtilizationReportsRequest::page_size].
11760 ///
11761 /// # Example
11762 /// ```ignore,no_run
11763 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsRequest;
11764 /// let x = ListUtilizationReportsRequest::new().set_page_size(42);
11765 /// ```
11766 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11767 self.page_size = v.into();
11768 self
11769 }
11770
11771 /// Sets the value of [page_token][crate::model::ListUtilizationReportsRequest::page_token].
11772 ///
11773 /// # Example
11774 /// ```ignore,no_run
11775 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsRequest;
11776 /// let x = ListUtilizationReportsRequest::new().set_page_token("example");
11777 /// ```
11778 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11779 self.page_token = v.into();
11780 self
11781 }
11782
11783 /// Sets the value of [filter][crate::model::ListUtilizationReportsRequest::filter].
11784 ///
11785 /// # Example
11786 /// ```ignore,no_run
11787 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsRequest;
11788 /// let x = ListUtilizationReportsRequest::new().set_filter("example");
11789 /// ```
11790 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11791 self.filter = v.into();
11792 self
11793 }
11794
11795 /// Sets the value of [order_by][crate::model::ListUtilizationReportsRequest::order_by].
11796 ///
11797 /// # Example
11798 /// ```ignore,no_run
11799 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsRequest;
11800 /// let x = ListUtilizationReportsRequest::new().set_order_by("example");
11801 /// ```
11802 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11803 self.order_by = v.into();
11804 self
11805 }
11806}
11807
11808impl wkt::message::Message for ListUtilizationReportsRequest {
11809 fn typename() -> &'static str {
11810 "type.googleapis.com/google.cloud.vmmigration.v1.ListUtilizationReportsRequest"
11811 }
11812}
11813
11814/// Response message for 'ListUtilizationReports' request.
11815#[derive(Clone, Default, PartialEq)]
11816#[non_exhaustive]
11817pub struct ListUtilizationReportsResponse {
11818 /// Output only. The list of reports.
11819 pub utilization_reports: std::vec::Vec<crate::model::UtilizationReport>,
11820
11821 /// Output only. A token, which can be sent as `page_token` to retrieve the
11822 /// next page. If this field is omitted, there are no subsequent pages.
11823 pub next_page_token: std::string::String,
11824
11825 /// Output only. Locations that could not be reached.
11826 pub unreachable: std::vec::Vec<std::string::String>,
11827
11828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11829}
11830
11831impl ListUtilizationReportsResponse {
11832 /// Creates a new default instance.
11833 pub fn new() -> Self {
11834 std::default::Default::default()
11835 }
11836
11837 /// Sets the value of [utilization_reports][crate::model::ListUtilizationReportsResponse::utilization_reports].
11838 ///
11839 /// # Example
11840 /// ```ignore,no_run
11841 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsResponse;
11842 /// use google_cloud_vmmigration_v1::model::UtilizationReport;
11843 /// let x = ListUtilizationReportsResponse::new()
11844 /// .set_utilization_reports([
11845 /// UtilizationReport::default()/* use setters */,
11846 /// UtilizationReport::default()/* use (different) setters */,
11847 /// ]);
11848 /// ```
11849 pub fn set_utilization_reports<T, V>(mut self, v: T) -> Self
11850 where
11851 T: std::iter::IntoIterator<Item = V>,
11852 V: std::convert::Into<crate::model::UtilizationReport>,
11853 {
11854 use std::iter::Iterator;
11855 self.utilization_reports = v.into_iter().map(|i| i.into()).collect();
11856 self
11857 }
11858
11859 /// Sets the value of [next_page_token][crate::model::ListUtilizationReportsResponse::next_page_token].
11860 ///
11861 /// # Example
11862 /// ```ignore,no_run
11863 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsResponse;
11864 /// let x = ListUtilizationReportsResponse::new().set_next_page_token("example");
11865 /// ```
11866 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11867 self.next_page_token = v.into();
11868 self
11869 }
11870
11871 /// Sets the value of [unreachable][crate::model::ListUtilizationReportsResponse::unreachable].
11872 ///
11873 /// # Example
11874 /// ```ignore,no_run
11875 /// # use google_cloud_vmmigration_v1::model::ListUtilizationReportsResponse;
11876 /// let x = ListUtilizationReportsResponse::new().set_unreachable(["a", "b", "c"]);
11877 /// ```
11878 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11879 where
11880 T: std::iter::IntoIterator<Item = V>,
11881 V: std::convert::Into<std::string::String>,
11882 {
11883 use std::iter::Iterator;
11884 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11885 self
11886 }
11887}
11888
11889impl wkt::message::Message for ListUtilizationReportsResponse {
11890 fn typename() -> &'static str {
11891 "type.googleapis.com/google.cloud.vmmigration.v1.ListUtilizationReportsResponse"
11892 }
11893}
11894
11895#[doc(hidden)]
11896impl google_cloud_gax::paginator::internal::PageableResponse for ListUtilizationReportsResponse {
11897 type PageItem = crate::model::UtilizationReport;
11898
11899 fn items(self) -> std::vec::Vec<Self::PageItem> {
11900 self.utilization_reports
11901 }
11902
11903 fn next_page_token(&self) -> std::string::String {
11904 use std::clone::Clone;
11905 self.next_page_token.clone()
11906 }
11907}
11908
11909/// Request message for 'GetUtilizationReport' request.
11910#[derive(Clone, Default, PartialEq)]
11911#[non_exhaustive]
11912pub struct GetUtilizationReportRequest {
11913 /// Required. The Utilization Report name.
11914 pub name: std::string::String,
11915
11916 /// Optional. The level of details of the report.
11917 /// Defaults to FULL
11918 pub view: crate::model::UtilizationReportView,
11919
11920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11921}
11922
11923impl GetUtilizationReportRequest {
11924 /// Creates a new default instance.
11925 pub fn new() -> Self {
11926 std::default::Default::default()
11927 }
11928
11929 /// Sets the value of [name][crate::model::GetUtilizationReportRequest::name].
11930 ///
11931 /// # Example
11932 /// ```ignore,no_run
11933 /// # use google_cloud_vmmigration_v1::model::GetUtilizationReportRequest;
11934 /// # let project_id = "project_id";
11935 /// # let location_id = "location_id";
11936 /// # let source_id = "source_id";
11937 /// # let utilization_report_id = "utilization_report_id";
11938 /// let x = GetUtilizationReportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/utilizationReports/{utilization_report_id}"));
11939 /// ```
11940 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11941 self.name = v.into();
11942 self
11943 }
11944
11945 /// Sets the value of [view][crate::model::GetUtilizationReportRequest::view].
11946 ///
11947 /// # Example
11948 /// ```ignore,no_run
11949 /// # use google_cloud_vmmigration_v1::model::GetUtilizationReportRequest;
11950 /// use google_cloud_vmmigration_v1::model::UtilizationReportView;
11951 /// let x0 = GetUtilizationReportRequest::new().set_view(UtilizationReportView::Basic);
11952 /// let x1 = GetUtilizationReportRequest::new().set_view(UtilizationReportView::Full);
11953 /// ```
11954 pub fn set_view<T: std::convert::Into<crate::model::UtilizationReportView>>(
11955 mut self,
11956 v: T,
11957 ) -> Self {
11958 self.view = v.into();
11959 self
11960 }
11961}
11962
11963impl wkt::message::Message for GetUtilizationReportRequest {
11964 fn typename() -> &'static str {
11965 "type.googleapis.com/google.cloud.vmmigration.v1.GetUtilizationReportRequest"
11966 }
11967}
11968
11969/// Request message for 'CreateUtilizationReport' request.
11970#[derive(Clone, Default, PartialEq)]
11971#[non_exhaustive]
11972pub struct CreateUtilizationReportRequest {
11973 /// Required. The Utilization Report's parent.
11974 pub parent: std::string::String,
11975
11976 /// Required. The report to create.
11977 pub utilization_report: std::option::Option<crate::model::UtilizationReport>,
11978
11979 /// Required. The ID to use for the report, which will become the final
11980 /// component of the reports's resource name.
11981 ///
11982 /// This value maximum length is 63 characters, and valid characters
11983 /// are /[a-z][0-9]-/. It must start with an english letter and must not
11984 /// end with a hyphen.
11985 pub utilization_report_id: std::string::String,
11986
11987 /// A request ID to identify requests. Specify a unique request ID
11988 /// so that if you must retry your request, the server will know to ignore
11989 /// the request if it has already been completed. The server will guarantee
11990 /// that for at least 60 minutes since the first request.
11991 ///
11992 /// For example, consider a situation where you make an initial request and
11993 /// the request times out. If you make the request again with the same request
11994 /// ID, the server can check if original operation with the same request ID
11995 /// was received, and if so, will ignore the second request. This prevents
11996 /// clients from accidentally creating duplicate commitments.
11997 ///
11998 /// The request ID must be a valid UUID with the exception that zero UUID is
11999 /// not supported (00000000-0000-0000-0000-000000000000).
12000 pub request_id: std::string::String,
12001
12002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12003}
12004
12005impl CreateUtilizationReportRequest {
12006 /// Creates a new default instance.
12007 pub fn new() -> Self {
12008 std::default::Default::default()
12009 }
12010
12011 /// Sets the value of [parent][crate::model::CreateUtilizationReportRequest::parent].
12012 ///
12013 /// # Example
12014 /// ```ignore,no_run
12015 /// # use google_cloud_vmmigration_v1::model::CreateUtilizationReportRequest;
12016 /// # let project_id = "project_id";
12017 /// # let location_id = "location_id";
12018 /// # let source_id = "source_id";
12019 /// let x = CreateUtilizationReportRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
12020 /// ```
12021 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12022 self.parent = v.into();
12023 self
12024 }
12025
12026 /// Sets the value of [utilization_report][crate::model::CreateUtilizationReportRequest::utilization_report].
12027 ///
12028 /// # Example
12029 /// ```ignore,no_run
12030 /// # use google_cloud_vmmigration_v1::model::CreateUtilizationReportRequest;
12031 /// use google_cloud_vmmigration_v1::model::UtilizationReport;
12032 /// let x = CreateUtilizationReportRequest::new().set_utilization_report(UtilizationReport::default()/* use setters */);
12033 /// ```
12034 pub fn set_utilization_report<T>(mut self, v: T) -> Self
12035 where
12036 T: std::convert::Into<crate::model::UtilizationReport>,
12037 {
12038 self.utilization_report = std::option::Option::Some(v.into());
12039 self
12040 }
12041
12042 /// Sets or clears the value of [utilization_report][crate::model::CreateUtilizationReportRequest::utilization_report].
12043 ///
12044 /// # Example
12045 /// ```ignore,no_run
12046 /// # use google_cloud_vmmigration_v1::model::CreateUtilizationReportRequest;
12047 /// use google_cloud_vmmigration_v1::model::UtilizationReport;
12048 /// let x = CreateUtilizationReportRequest::new().set_or_clear_utilization_report(Some(UtilizationReport::default()/* use setters */));
12049 /// let x = CreateUtilizationReportRequest::new().set_or_clear_utilization_report(None::<UtilizationReport>);
12050 /// ```
12051 pub fn set_or_clear_utilization_report<T>(mut self, v: std::option::Option<T>) -> Self
12052 where
12053 T: std::convert::Into<crate::model::UtilizationReport>,
12054 {
12055 self.utilization_report = v.map(|x| x.into());
12056 self
12057 }
12058
12059 /// Sets the value of [utilization_report_id][crate::model::CreateUtilizationReportRequest::utilization_report_id].
12060 ///
12061 /// # Example
12062 /// ```ignore,no_run
12063 /// # use google_cloud_vmmigration_v1::model::CreateUtilizationReportRequest;
12064 /// let x = CreateUtilizationReportRequest::new().set_utilization_report_id("example");
12065 /// ```
12066 pub fn set_utilization_report_id<T: std::convert::Into<std::string::String>>(
12067 mut self,
12068 v: T,
12069 ) -> Self {
12070 self.utilization_report_id = v.into();
12071 self
12072 }
12073
12074 /// Sets the value of [request_id][crate::model::CreateUtilizationReportRequest::request_id].
12075 ///
12076 /// # Example
12077 /// ```ignore,no_run
12078 /// # use google_cloud_vmmigration_v1::model::CreateUtilizationReportRequest;
12079 /// let x = CreateUtilizationReportRequest::new().set_request_id("example");
12080 /// ```
12081 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12082 self.request_id = v.into();
12083 self
12084 }
12085}
12086
12087impl wkt::message::Message for CreateUtilizationReportRequest {
12088 fn typename() -> &'static str {
12089 "type.googleapis.com/google.cloud.vmmigration.v1.CreateUtilizationReportRequest"
12090 }
12091}
12092
12093/// Request message for 'DeleteUtilizationReport' request.
12094#[derive(Clone, Default, PartialEq)]
12095#[non_exhaustive]
12096pub struct DeleteUtilizationReportRequest {
12097 /// Required. The Utilization Report name.
12098 pub name: std::string::String,
12099
12100 /// Optional. A request ID to identify requests. Specify a unique request ID
12101 /// so that if you must retry your request, the server will know to ignore
12102 /// the request if it has already been completed. The server will guarantee
12103 /// that for at least 60 minutes after the first request.
12104 ///
12105 /// For example, consider a situation where you make an initial request and
12106 /// the request times out. If you make the request again with the same request
12107 /// ID, the server can check if original operation with the same request ID
12108 /// was received, and if so, will ignore the second request. This prevents
12109 /// clients from accidentally creating duplicate commitments.
12110 ///
12111 /// The request ID must be a valid UUID with the exception that zero UUID is
12112 /// not supported (00000000-0000-0000-0000-000000000000).
12113 pub request_id: std::string::String,
12114
12115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12116}
12117
12118impl DeleteUtilizationReportRequest {
12119 /// Creates a new default instance.
12120 pub fn new() -> Self {
12121 std::default::Default::default()
12122 }
12123
12124 /// Sets the value of [name][crate::model::DeleteUtilizationReportRequest::name].
12125 ///
12126 /// # Example
12127 /// ```ignore,no_run
12128 /// # use google_cloud_vmmigration_v1::model::DeleteUtilizationReportRequest;
12129 /// # let project_id = "project_id";
12130 /// # let location_id = "location_id";
12131 /// # let source_id = "source_id";
12132 /// # let utilization_report_id = "utilization_report_id";
12133 /// let x = DeleteUtilizationReportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/utilizationReports/{utilization_report_id}"));
12134 /// ```
12135 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12136 self.name = v.into();
12137 self
12138 }
12139
12140 /// Sets the value of [request_id][crate::model::DeleteUtilizationReportRequest::request_id].
12141 ///
12142 /// # Example
12143 /// ```ignore,no_run
12144 /// # use google_cloud_vmmigration_v1::model::DeleteUtilizationReportRequest;
12145 /// let x = DeleteUtilizationReportRequest::new().set_request_id("example");
12146 /// ```
12147 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12148 self.request_id = v.into();
12149 self
12150 }
12151}
12152
12153impl wkt::message::Message for DeleteUtilizationReportRequest {
12154 fn typename() -> &'static str {
12155 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteUtilizationReportRequest"
12156 }
12157}
12158
12159/// Response message for 'ListDatacenterConnectors' request.
12160#[derive(Clone, Default, PartialEq)]
12161#[non_exhaustive]
12162pub struct ListDatacenterConnectorsResponse {
12163 /// Output only. The list of sources response.
12164 pub datacenter_connectors: std::vec::Vec<crate::model::DatacenterConnector>,
12165
12166 /// Output only. A token, which can be sent as `page_token` to retrieve the
12167 /// next page. If this field is omitted, there are no subsequent pages.
12168 pub next_page_token: std::string::String,
12169
12170 /// Output only. Locations that could not be reached.
12171 pub unreachable: std::vec::Vec<std::string::String>,
12172
12173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12174}
12175
12176impl ListDatacenterConnectorsResponse {
12177 /// Creates a new default instance.
12178 pub fn new() -> Self {
12179 std::default::Default::default()
12180 }
12181
12182 /// Sets the value of [datacenter_connectors][crate::model::ListDatacenterConnectorsResponse::datacenter_connectors].
12183 ///
12184 /// # Example
12185 /// ```ignore,no_run
12186 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsResponse;
12187 /// use google_cloud_vmmigration_v1::model::DatacenterConnector;
12188 /// let x = ListDatacenterConnectorsResponse::new()
12189 /// .set_datacenter_connectors([
12190 /// DatacenterConnector::default()/* use setters */,
12191 /// DatacenterConnector::default()/* use (different) setters */,
12192 /// ]);
12193 /// ```
12194 pub fn set_datacenter_connectors<T, V>(mut self, v: T) -> Self
12195 where
12196 T: std::iter::IntoIterator<Item = V>,
12197 V: std::convert::Into<crate::model::DatacenterConnector>,
12198 {
12199 use std::iter::Iterator;
12200 self.datacenter_connectors = v.into_iter().map(|i| i.into()).collect();
12201 self
12202 }
12203
12204 /// Sets the value of [next_page_token][crate::model::ListDatacenterConnectorsResponse::next_page_token].
12205 ///
12206 /// # Example
12207 /// ```ignore,no_run
12208 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsResponse;
12209 /// let x = ListDatacenterConnectorsResponse::new().set_next_page_token("example");
12210 /// ```
12211 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12212 self.next_page_token = v.into();
12213 self
12214 }
12215
12216 /// Sets the value of [unreachable][crate::model::ListDatacenterConnectorsResponse::unreachable].
12217 ///
12218 /// # Example
12219 /// ```ignore,no_run
12220 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsResponse;
12221 /// let x = ListDatacenterConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
12222 /// ```
12223 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12224 where
12225 T: std::iter::IntoIterator<Item = V>,
12226 V: std::convert::Into<std::string::String>,
12227 {
12228 use std::iter::Iterator;
12229 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12230 self
12231 }
12232}
12233
12234impl wkt::message::Message for ListDatacenterConnectorsResponse {
12235 fn typename() -> &'static str {
12236 "type.googleapis.com/google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse"
12237 }
12238}
12239
12240#[doc(hidden)]
12241impl google_cloud_gax::paginator::internal::PageableResponse for ListDatacenterConnectorsResponse {
12242 type PageItem = crate::model::DatacenterConnector;
12243
12244 fn items(self) -> std::vec::Vec<Self::PageItem> {
12245 self.datacenter_connectors
12246 }
12247
12248 fn next_page_token(&self) -> std::string::String {
12249 use std::clone::Clone;
12250 self.next_page_token.clone()
12251 }
12252}
12253
12254/// Request message for 'GetDatacenterConnector' request.
12255#[derive(Clone, Default, PartialEq)]
12256#[non_exhaustive]
12257pub struct GetDatacenterConnectorRequest {
12258 /// Required. The name of the DatacenterConnector.
12259 pub name: std::string::String,
12260
12261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12262}
12263
12264impl GetDatacenterConnectorRequest {
12265 /// Creates a new default instance.
12266 pub fn new() -> Self {
12267 std::default::Default::default()
12268 }
12269
12270 /// Sets the value of [name][crate::model::GetDatacenterConnectorRequest::name].
12271 ///
12272 /// # Example
12273 /// ```ignore,no_run
12274 /// # use google_cloud_vmmigration_v1::model::GetDatacenterConnectorRequest;
12275 /// # let project_id = "project_id";
12276 /// # let location_id = "location_id";
12277 /// # let source_id = "source_id";
12278 /// # let datacenter_connector_id = "datacenter_connector_id";
12279 /// let x = GetDatacenterConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/datacenterConnectors/{datacenter_connector_id}"));
12280 /// ```
12281 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12282 self.name = v.into();
12283 self
12284 }
12285}
12286
12287impl wkt::message::Message for GetDatacenterConnectorRequest {
12288 fn typename() -> &'static str {
12289 "type.googleapis.com/google.cloud.vmmigration.v1.GetDatacenterConnectorRequest"
12290 }
12291}
12292
12293/// Request message for 'CreateDatacenterConnector' request.
12294#[derive(Clone, Default, PartialEq)]
12295#[non_exhaustive]
12296pub struct CreateDatacenterConnectorRequest {
12297 /// Required. The DatacenterConnector's parent.
12298 /// Required. The Source in where the new DatacenterConnector will be created.
12299 /// For example:
12300 /// `projects/my-project/locations/us-central1/sources/my-source`
12301 pub parent: std::string::String,
12302
12303 /// Required. The datacenterConnector identifier.
12304 pub datacenter_connector_id: std::string::String,
12305
12306 /// Required. The create request body.
12307 pub datacenter_connector: std::option::Option<crate::model::DatacenterConnector>,
12308
12309 /// A request ID to identify requests. Specify a unique request ID
12310 /// so that if you must retry your request, the server will know to ignore
12311 /// the request if it has already been completed. The server will guarantee
12312 /// that for at least 60 minutes since the first request.
12313 ///
12314 /// For example, consider a situation where you make an initial request and
12315 /// the request times out. If you make the request again with the same request
12316 /// ID, the server can check if original operation with the same request ID
12317 /// was received, and if so, will ignore the second request. This prevents
12318 /// clients from accidentally creating duplicate commitments.
12319 ///
12320 /// The request ID must be a valid UUID with the exception that zero UUID is
12321 /// not supported (00000000-0000-0000-0000-000000000000).
12322 pub request_id: std::string::String,
12323
12324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12325}
12326
12327impl CreateDatacenterConnectorRequest {
12328 /// Creates a new default instance.
12329 pub fn new() -> Self {
12330 std::default::Default::default()
12331 }
12332
12333 /// Sets the value of [parent][crate::model::CreateDatacenterConnectorRequest::parent].
12334 ///
12335 /// # Example
12336 /// ```ignore,no_run
12337 /// # use google_cloud_vmmigration_v1::model::CreateDatacenterConnectorRequest;
12338 /// # let project_id = "project_id";
12339 /// # let location_id = "location_id";
12340 /// # let source_id = "source_id";
12341 /// let x = CreateDatacenterConnectorRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
12342 /// ```
12343 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12344 self.parent = v.into();
12345 self
12346 }
12347
12348 /// Sets the value of [datacenter_connector_id][crate::model::CreateDatacenterConnectorRequest::datacenter_connector_id].
12349 ///
12350 /// # Example
12351 /// ```ignore,no_run
12352 /// # use google_cloud_vmmigration_v1::model::CreateDatacenterConnectorRequest;
12353 /// let x = CreateDatacenterConnectorRequest::new().set_datacenter_connector_id("example");
12354 /// ```
12355 pub fn set_datacenter_connector_id<T: std::convert::Into<std::string::String>>(
12356 mut self,
12357 v: T,
12358 ) -> Self {
12359 self.datacenter_connector_id = v.into();
12360 self
12361 }
12362
12363 /// Sets the value of [datacenter_connector][crate::model::CreateDatacenterConnectorRequest::datacenter_connector].
12364 ///
12365 /// # Example
12366 /// ```ignore,no_run
12367 /// # use google_cloud_vmmigration_v1::model::CreateDatacenterConnectorRequest;
12368 /// use google_cloud_vmmigration_v1::model::DatacenterConnector;
12369 /// let x = CreateDatacenterConnectorRequest::new().set_datacenter_connector(DatacenterConnector::default()/* use setters */);
12370 /// ```
12371 pub fn set_datacenter_connector<T>(mut self, v: T) -> Self
12372 where
12373 T: std::convert::Into<crate::model::DatacenterConnector>,
12374 {
12375 self.datacenter_connector = std::option::Option::Some(v.into());
12376 self
12377 }
12378
12379 /// Sets or clears the value of [datacenter_connector][crate::model::CreateDatacenterConnectorRequest::datacenter_connector].
12380 ///
12381 /// # Example
12382 /// ```ignore,no_run
12383 /// # use google_cloud_vmmigration_v1::model::CreateDatacenterConnectorRequest;
12384 /// use google_cloud_vmmigration_v1::model::DatacenterConnector;
12385 /// let x = CreateDatacenterConnectorRequest::new().set_or_clear_datacenter_connector(Some(DatacenterConnector::default()/* use setters */));
12386 /// let x = CreateDatacenterConnectorRequest::new().set_or_clear_datacenter_connector(None::<DatacenterConnector>);
12387 /// ```
12388 pub fn set_or_clear_datacenter_connector<T>(mut self, v: std::option::Option<T>) -> Self
12389 where
12390 T: std::convert::Into<crate::model::DatacenterConnector>,
12391 {
12392 self.datacenter_connector = v.map(|x| x.into());
12393 self
12394 }
12395
12396 /// Sets the value of [request_id][crate::model::CreateDatacenterConnectorRequest::request_id].
12397 ///
12398 /// # Example
12399 /// ```ignore,no_run
12400 /// # use google_cloud_vmmigration_v1::model::CreateDatacenterConnectorRequest;
12401 /// let x = CreateDatacenterConnectorRequest::new().set_request_id("example");
12402 /// ```
12403 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12404 self.request_id = v.into();
12405 self
12406 }
12407}
12408
12409impl wkt::message::Message for CreateDatacenterConnectorRequest {
12410 fn typename() -> &'static str {
12411 "type.googleapis.com/google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest"
12412 }
12413}
12414
12415/// Request message for 'DeleteDatacenterConnector' request.
12416#[derive(Clone, Default, PartialEq)]
12417#[non_exhaustive]
12418pub struct DeleteDatacenterConnectorRequest {
12419 /// Required. The DatacenterConnector name.
12420 pub name: std::string::String,
12421
12422 /// A request ID to identify requests. Specify a unique request ID
12423 /// so that if you must retry your request, the server will know to ignore
12424 /// the request if it has already been completed. The server will guarantee
12425 /// that for at least 60 minutes after the first request.
12426 ///
12427 /// For example, consider a situation where you make an initial request and
12428 /// the request times out. If you make the request again with the same request
12429 /// ID, the server can check if original operation with the same request ID
12430 /// was received, and if so, will ignore the second request. This prevents
12431 /// clients from accidentally creating duplicate commitments.
12432 ///
12433 /// The request ID must be a valid UUID with the exception that zero UUID is
12434 /// not supported (00000000-0000-0000-0000-000000000000).
12435 pub request_id: std::string::String,
12436
12437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12438}
12439
12440impl DeleteDatacenterConnectorRequest {
12441 /// Creates a new default instance.
12442 pub fn new() -> Self {
12443 std::default::Default::default()
12444 }
12445
12446 /// Sets the value of [name][crate::model::DeleteDatacenterConnectorRequest::name].
12447 ///
12448 /// # Example
12449 /// ```ignore,no_run
12450 /// # use google_cloud_vmmigration_v1::model::DeleteDatacenterConnectorRequest;
12451 /// # let project_id = "project_id";
12452 /// # let location_id = "location_id";
12453 /// # let source_id = "source_id";
12454 /// # let datacenter_connector_id = "datacenter_connector_id";
12455 /// let x = DeleteDatacenterConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/datacenterConnectors/{datacenter_connector_id}"));
12456 /// ```
12457 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12458 self.name = v.into();
12459 self
12460 }
12461
12462 /// Sets the value of [request_id][crate::model::DeleteDatacenterConnectorRequest::request_id].
12463 ///
12464 /// # Example
12465 /// ```ignore,no_run
12466 /// # use google_cloud_vmmigration_v1::model::DeleteDatacenterConnectorRequest;
12467 /// let x = DeleteDatacenterConnectorRequest::new().set_request_id("example");
12468 /// ```
12469 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12470 self.request_id = v.into();
12471 self
12472 }
12473}
12474
12475impl wkt::message::Message for DeleteDatacenterConnectorRequest {
12476 fn typename() -> &'static str {
12477 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest"
12478 }
12479}
12480
12481/// Request message for 'UpgradeAppliance' request.
12482#[derive(Clone, Default, PartialEq)]
12483#[non_exhaustive]
12484pub struct UpgradeApplianceRequest {
12485 /// Required. The DatacenterConnector name.
12486 pub datacenter_connector: std::string::String,
12487
12488 /// A request ID to identify requests. Specify a unique request ID
12489 /// so that if you must retry your request, the server will know to ignore
12490 /// the request if it has already been completed. The server will guarantee
12491 /// that for at least 60 minutes after the first request.
12492 ///
12493 /// For example, consider a situation where you make an initial request and
12494 /// the request times out. If you make the request again with the same request
12495 /// ID, the server can check if original operation with the same request ID
12496 /// was received, and if so, will ignore the second request. This prevents
12497 /// clients from accidentally creating duplicate commitments.
12498 ///
12499 /// The request ID must be a valid UUID with the exception that zero UUID is
12500 /// not supported (00000000-0000-0000-0000-000000000000).
12501 pub request_id: std::string::String,
12502
12503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12504}
12505
12506impl UpgradeApplianceRequest {
12507 /// Creates a new default instance.
12508 pub fn new() -> Self {
12509 std::default::Default::default()
12510 }
12511
12512 /// Sets the value of [datacenter_connector][crate::model::UpgradeApplianceRequest::datacenter_connector].
12513 ///
12514 /// # Example
12515 /// ```ignore,no_run
12516 /// # use google_cloud_vmmigration_v1::model::UpgradeApplianceRequest;
12517 /// # let project_id = "project_id";
12518 /// # let location_id = "location_id";
12519 /// # let source_id = "source_id";
12520 /// # let datacenter_connector_id = "datacenter_connector_id";
12521 /// let x = UpgradeApplianceRequest::new().set_datacenter_connector(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/datacenterConnectors/{datacenter_connector_id}"));
12522 /// ```
12523 pub fn set_datacenter_connector<T: std::convert::Into<std::string::String>>(
12524 mut self,
12525 v: T,
12526 ) -> Self {
12527 self.datacenter_connector = v.into();
12528 self
12529 }
12530
12531 /// Sets the value of [request_id][crate::model::UpgradeApplianceRequest::request_id].
12532 ///
12533 /// # Example
12534 /// ```ignore,no_run
12535 /// # use google_cloud_vmmigration_v1::model::UpgradeApplianceRequest;
12536 /// let x = UpgradeApplianceRequest::new().set_request_id("example");
12537 /// ```
12538 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12539 self.request_id = v.into();
12540 self
12541 }
12542}
12543
12544impl wkt::message::Message for UpgradeApplianceRequest {
12545 fn typename() -> &'static str {
12546 "type.googleapis.com/google.cloud.vmmigration.v1.UpgradeApplianceRequest"
12547 }
12548}
12549
12550/// Response message for 'UpgradeAppliance' request.
12551#[derive(Clone, Default, PartialEq)]
12552#[non_exhaustive]
12553pub struct UpgradeApplianceResponse {
12554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12555}
12556
12557impl UpgradeApplianceResponse {
12558 /// Creates a new default instance.
12559 pub fn new() -> Self {
12560 std::default::Default::default()
12561 }
12562}
12563
12564impl wkt::message::Message for UpgradeApplianceResponse {
12565 fn typename() -> &'static str {
12566 "type.googleapis.com/google.cloud.vmmigration.v1.UpgradeApplianceResponse"
12567 }
12568}
12569
12570/// Request message for 'ListDatacenterConnectors' request.
12571#[derive(Clone, Default, PartialEq)]
12572#[non_exhaustive]
12573pub struct ListDatacenterConnectorsRequest {
12574 /// Required. The parent, which owns this collection of connectors.
12575 pub parent: std::string::String,
12576
12577 /// Optional. The maximum number of connectors to return. The service may
12578 /// return fewer than this value. If unspecified, at most 500 sources will be
12579 /// returned. The maximum value is 1000; values above 1000 will be coerced to
12580 /// 1000.
12581 pub page_size: i32,
12582
12583 /// Required. A page token, received from a previous `ListDatacenterConnectors`
12584 /// call. Provide this to retrieve the subsequent page.
12585 ///
12586 /// When paginating, all other parameters provided to
12587 /// `ListDatacenterConnectors` must match the call that provided the page
12588 /// token.
12589 pub page_token: std::string::String,
12590
12591 /// Optional. The filter request.
12592 pub filter: std::string::String,
12593
12594 /// Optional. the order by fields for the result.
12595 pub order_by: std::string::String,
12596
12597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12598}
12599
12600impl ListDatacenterConnectorsRequest {
12601 /// Creates a new default instance.
12602 pub fn new() -> Self {
12603 std::default::Default::default()
12604 }
12605
12606 /// Sets the value of [parent][crate::model::ListDatacenterConnectorsRequest::parent].
12607 ///
12608 /// # Example
12609 /// ```ignore,no_run
12610 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsRequest;
12611 /// # let project_id = "project_id";
12612 /// # let location_id = "location_id";
12613 /// # let source_id = "source_id";
12614 /// let x = ListDatacenterConnectorsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
12615 /// ```
12616 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12617 self.parent = v.into();
12618 self
12619 }
12620
12621 /// Sets the value of [page_size][crate::model::ListDatacenterConnectorsRequest::page_size].
12622 ///
12623 /// # Example
12624 /// ```ignore,no_run
12625 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsRequest;
12626 /// let x = ListDatacenterConnectorsRequest::new().set_page_size(42);
12627 /// ```
12628 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12629 self.page_size = v.into();
12630 self
12631 }
12632
12633 /// Sets the value of [page_token][crate::model::ListDatacenterConnectorsRequest::page_token].
12634 ///
12635 /// # Example
12636 /// ```ignore,no_run
12637 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsRequest;
12638 /// let x = ListDatacenterConnectorsRequest::new().set_page_token("example");
12639 /// ```
12640 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12641 self.page_token = v.into();
12642 self
12643 }
12644
12645 /// Sets the value of [filter][crate::model::ListDatacenterConnectorsRequest::filter].
12646 ///
12647 /// # Example
12648 /// ```ignore,no_run
12649 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsRequest;
12650 /// let x = ListDatacenterConnectorsRequest::new().set_filter("example");
12651 /// ```
12652 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12653 self.filter = v.into();
12654 self
12655 }
12656
12657 /// Sets the value of [order_by][crate::model::ListDatacenterConnectorsRequest::order_by].
12658 ///
12659 /// # Example
12660 /// ```ignore,no_run
12661 /// # use google_cloud_vmmigration_v1::model::ListDatacenterConnectorsRequest;
12662 /// let x = ListDatacenterConnectorsRequest::new().set_order_by("example");
12663 /// ```
12664 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12665 self.order_by = v.into();
12666 self
12667 }
12668}
12669
12670impl wkt::message::Message for ListDatacenterConnectorsRequest {
12671 fn typename() -> &'static str {
12672 "type.googleapis.com/google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest"
12673 }
12674}
12675
12676/// ComputeEngineTargetDefaults is a collection of details for creating a VM in a
12677/// target Compute Engine project.
12678#[derive(Clone, Default, PartialEq)]
12679#[non_exhaustive]
12680pub struct ComputeEngineTargetDefaults {
12681 /// The name of the VM to create.
12682 pub vm_name: std::string::String,
12683
12684 /// The full path of the resource of type TargetProject which represents the
12685 /// Compute Engine project in which to create this VM.
12686 pub target_project: std::string::String,
12687
12688 /// The zone in which to create the VM.
12689 pub zone: std::string::String,
12690
12691 /// The machine type series to create the VM with.
12692 pub machine_type_series: std::string::String,
12693
12694 /// The machine type to create the VM with.
12695 pub machine_type: std::string::String,
12696
12697 /// A list of network tags to associate with the VM.
12698 pub network_tags: std::vec::Vec<std::string::String>,
12699
12700 /// List of NICs connected to this VM.
12701 pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
12702
12703 /// Optional. The service account to associate the VM with.
12704 pub service_account: std::string::String,
12705
12706 /// The disk type to use in the VM.
12707 pub disk_type: crate::model::ComputeEngineDiskType,
12708
12709 /// A map of labels to associate with the VM.
12710 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12711
12712 /// The license type to use in OS adaptation.
12713 pub license_type: crate::model::ComputeEngineLicenseType,
12714
12715 /// Output only. The OS license returned from the adaptation module report.
12716 pub applied_license: std::option::Option<crate::model::AppliedLicense>,
12717
12718 /// Compute instance scheduling information (if empty default is used).
12719 pub compute_scheduling: std::option::Option<crate::model::ComputeScheduling>,
12720
12721 /// Defines whether the instance has Secure Boot enabled.
12722 /// This can be set to true only if the VM boot option is EFI.
12723 pub secure_boot: bool,
12724
12725 /// Optional. Defines whether the instance has vTPM enabled.
12726 /// This can be set to true only if the VM boot option is EFI.
12727 pub enable_vtpm: bool,
12728
12729 /// Optional. Defines whether the instance has integrity monitoring enabled.
12730 /// This can be set to true only if the VM boot option is EFI, and vTPM is
12731 /// enabled.
12732 pub enable_integrity_monitoring: bool,
12733
12734 /// Output only. The VM Boot Option, as set in the source VM.
12735 pub boot_option: crate::model::ComputeEngineBootOption,
12736
12737 /// The metadata key/value pairs to assign to the VM.
12738 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
12739
12740 /// Additional licenses to assign to the VM.
12741 pub additional_licenses: std::vec::Vec<std::string::String>,
12742
12743 /// The hostname to assign to the VM.
12744 pub hostname: std::string::String,
12745
12746 /// Optional. Immutable. The encryption to apply to the VM disks.
12747 pub encryption: std::option::Option<crate::model::Encryption>,
12748
12749 /// Optional. By default the virtual machine will keep its existing boot
12750 /// option. Setting this property will trigger an internal process which will
12751 /// convert the virtual machine from using the existing boot option to another.
12752 pub boot_conversion: crate::model::BootConversion,
12753
12754 /// Optional. AdaptationModifiers are the set of modifiers used during OS
12755 /// adaptation.
12756 pub adaptation_modifiers: std::vec::Vec<crate::model::AdaptationModifier>,
12757
12758 /// Optional. Additional replica zones of the target regional disks.
12759 /// If this list is not empty a regional disk will be created. The first
12760 /// supported zone would be the one stated in the
12761 /// [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.zone] field.
12762 /// The rest are taken from this list. Please refer to the [regional disk
12763 /// creation
12764 /// API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources)
12765 /// for further details about regional vs zonal disks. If not specified, a
12766 /// zonal disk will be created in the same zone the VM is created.
12767 ///
12768 /// [google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.zone]: crate::model::ComputeEngineTargetDefaults::zone
12769 pub disk_replica_zones: std::vec::Vec<std::string::String>,
12770
12771 /// Optional. If specified this will be the storage pool in which the disk is
12772 /// created. This is the full path of the storage pool resource, for example:
12773 /// "projects/my-project/zones/us-central1-a/storagePools/my-storage-pool".
12774 /// The storage pool must be in the same project and zone as the target disks.
12775 /// The storage pool's type must match the disk type.
12776 pub storage_pool: std::string::String,
12777
12778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12779}
12780
12781impl ComputeEngineTargetDefaults {
12782 /// Creates a new default instance.
12783 pub fn new() -> Self {
12784 std::default::Default::default()
12785 }
12786
12787 /// Sets the value of [vm_name][crate::model::ComputeEngineTargetDefaults::vm_name].
12788 ///
12789 /// # Example
12790 /// ```ignore,no_run
12791 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12792 /// let x = ComputeEngineTargetDefaults::new().set_vm_name("example");
12793 /// ```
12794 pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12795 self.vm_name = v.into();
12796 self
12797 }
12798
12799 /// Sets the value of [target_project][crate::model::ComputeEngineTargetDefaults::target_project].
12800 ///
12801 /// # Example
12802 /// ```ignore,no_run
12803 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12804 /// # let project_id = "project_id";
12805 /// # let location_id = "location_id";
12806 /// # let target_project_id = "target_project_id";
12807 /// let x = ComputeEngineTargetDefaults::new().set_target_project(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
12808 /// ```
12809 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12810 self.target_project = v.into();
12811 self
12812 }
12813
12814 /// Sets the value of [zone][crate::model::ComputeEngineTargetDefaults::zone].
12815 ///
12816 /// # Example
12817 /// ```ignore,no_run
12818 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12819 /// let x = ComputeEngineTargetDefaults::new().set_zone("example");
12820 /// ```
12821 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12822 self.zone = v.into();
12823 self
12824 }
12825
12826 /// Sets the value of [machine_type_series][crate::model::ComputeEngineTargetDefaults::machine_type_series].
12827 ///
12828 /// # Example
12829 /// ```ignore,no_run
12830 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12831 /// let x = ComputeEngineTargetDefaults::new().set_machine_type_series("example");
12832 /// ```
12833 pub fn set_machine_type_series<T: std::convert::Into<std::string::String>>(
12834 mut self,
12835 v: T,
12836 ) -> Self {
12837 self.machine_type_series = v.into();
12838 self
12839 }
12840
12841 /// Sets the value of [machine_type][crate::model::ComputeEngineTargetDefaults::machine_type].
12842 ///
12843 /// # Example
12844 /// ```ignore,no_run
12845 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12846 /// let x = ComputeEngineTargetDefaults::new().set_machine_type("example");
12847 /// ```
12848 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12849 self.machine_type = v.into();
12850 self
12851 }
12852
12853 /// Sets the value of [network_tags][crate::model::ComputeEngineTargetDefaults::network_tags].
12854 ///
12855 /// # Example
12856 /// ```ignore,no_run
12857 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12858 /// let x = ComputeEngineTargetDefaults::new().set_network_tags(["a", "b", "c"]);
12859 /// ```
12860 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
12861 where
12862 T: std::iter::IntoIterator<Item = V>,
12863 V: std::convert::Into<std::string::String>,
12864 {
12865 use std::iter::Iterator;
12866 self.network_tags = v.into_iter().map(|i| i.into()).collect();
12867 self
12868 }
12869
12870 /// Sets the value of [network_interfaces][crate::model::ComputeEngineTargetDefaults::network_interfaces].
12871 ///
12872 /// # Example
12873 /// ```ignore,no_run
12874 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12875 /// use google_cloud_vmmigration_v1::model::NetworkInterface;
12876 /// let x = ComputeEngineTargetDefaults::new()
12877 /// .set_network_interfaces([
12878 /// NetworkInterface::default()/* use setters */,
12879 /// NetworkInterface::default()/* use (different) setters */,
12880 /// ]);
12881 /// ```
12882 pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
12883 where
12884 T: std::iter::IntoIterator<Item = V>,
12885 V: std::convert::Into<crate::model::NetworkInterface>,
12886 {
12887 use std::iter::Iterator;
12888 self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
12889 self
12890 }
12891
12892 /// Sets the value of [service_account][crate::model::ComputeEngineTargetDefaults::service_account].
12893 ///
12894 /// # Example
12895 /// ```ignore,no_run
12896 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12897 /// let x = ComputeEngineTargetDefaults::new().set_service_account("example");
12898 /// ```
12899 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12900 self.service_account = v.into();
12901 self
12902 }
12903
12904 /// Sets the value of [disk_type][crate::model::ComputeEngineTargetDefaults::disk_type].
12905 ///
12906 /// # Example
12907 /// ```ignore,no_run
12908 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12909 /// use google_cloud_vmmigration_v1::model::ComputeEngineDiskType;
12910 /// let x0 = ComputeEngineTargetDefaults::new().set_disk_type(ComputeEngineDiskType::Standard);
12911 /// let x1 = ComputeEngineTargetDefaults::new().set_disk_type(ComputeEngineDiskType::Ssd);
12912 /// let x2 = ComputeEngineTargetDefaults::new().set_disk_type(ComputeEngineDiskType::Balanced);
12913 /// ```
12914 pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
12915 mut self,
12916 v: T,
12917 ) -> Self {
12918 self.disk_type = v.into();
12919 self
12920 }
12921
12922 /// Sets the value of [labels][crate::model::ComputeEngineTargetDefaults::labels].
12923 ///
12924 /// # Example
12925 /// ```ignore,no_run
12926 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12927 /// let x = ComputeEngineTargetDefaults::new().set_labels([
12928 /// ("key0", "abc"),
12929 /// ("key1", "xyz"),
12930 /// ]);
12931 /// ```
12932 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12933 where
12934 T: std::iter::IntoIterator<Item = (K, V)>,
12935 K: std::convert::Into<std::string::String>,
12936 V: std::convert::Into<std::string::String>,
12937 {
12938 use std::iter::Iterator;
12939 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12940 self
12941 }
12942
12943 /// Sets the value of [license_type][crate::model::ComputeEngineTargetDefaults::license_type].
12944 ///
12945 /// # Example
12946 /// ```ignore,no_run
12947 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12948 /// use google_cloud_vmmigration_v1::model::ComputeEngineLicenseType;
12949 /// let x0 = ComputeEngineTargetDefaults::new().set_license_type(ComputeEngineLicenseType::Payg);
12950 /// let x1 = ComputeEngineTargetDefaults::new().set_license_type(ComputeEngineLicenseType::Byol);
12951 /// ```
12952 pub fn set_license_type<T: std::convert::Into<crate::model::ComputeEngineLicenseType>>(
12953 mut self,
12954 v: T,
12955 ) -> Self {
12956 self.license_type = v.into();
12957 self
12958 }
12959
12960 /// Sets the value of [applied_license][crate::model::ComputeEngineTargetDefaults::applied_license].
12961 ///
12962 /// # Example
12963 /// ```ignore,no_run
12964 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12965 /// use google_cloud_vmmigration_v1::model::AppliedLicense;
12966 /// let x = ComputeEngineTargetDefaults::new().set_applied_license(AppliedLicense::default()/* use setters */);
12967 /// ```
12968 pub fn set_applied_license<T>(mut self, v: T) -> Self
12969 where
12970 T: std::convert::Into<crate::model::AppliedLicense>,
12971 {
12972 self.applied_license = std::option::Option::Some(v.into());
12973 self
12974 }
12975
12976 /// Sets or clears the value of [applied_license][crate::model::ComputeEngineTargetDefaults::applied_license].
12977 ///
12978 /// # Example
12979 /// ```ignore,no_run
12980 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12981 /// use google_cloud_vmmigration_v1::model::AppliedLicense;
12982 /// let x = ComputeEngineTargetDefaults::new().set_or_clear_applied_license(Some(AppliedLicense::default()/* use setters */));
12983 /// let x = ComputeEngineTargetDefaults::new().set_or_clear_applied_license(None::<AppliedLicense>);
12984 /// ```
12985 pub fn set_or_clear_applied_license<T>(mut self, v: std::option::Option<T>) -> Self
12986 where
12987 T: std::convert::Into<crate::model::AppliedLicense>,
12988 {
12989 self.applied_license = v.map(|x| x.into());
12990 self
12991 }
12992
12993 /// Sets the value of [compute_scheduling][crate::model::ComputeEngineTargetDefaults::compute_scheduling].
12994 ///
12995 /// # Example
12996 /// ```ignore,no_run
12997 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
12998 /// use google_cloud_vmmigration_v1::model::ComputeScheduling;
12999 /// let x = ComputeEngineTargetDefaults::new().set_compute_scheduling(ComputeScheduling::default()/* use setters */);
13000 /// ```
13001 pub fn set_compute_scheduling<T>(mut self, v: T) -> Self
13002 where
13003 T: std::convert::Into<crate::model::ComputeScheduling>,
13004 {
13005 self.compute_scheduling = std::option::Option::Some(v.into());
13006 self
13007 }
13008
13009 /// Sets or clears the value of [compute_scheduling][crate::model::ComputeEngineTargetDefaults::compute_scheduling].
13010 ///
13011 /// # Example
13012 /// ```ignore,no_run
13013 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13014 /// use google_cloud_vmmigration_v1::model::ComputeScheduling;
13015 /// let x = ComputeEngineTargetDefaults::new().set_or_clear_compute_scheduling(Some(ComputeScheduling::default()/* use setters */));
13016 /// let x = ComputeEngineTargetDefaults::new().set_or_clear_compute_scheduling(None::<ComputeScheduling>);
13017 /// ```
13018 pub fn set_or_clear_compute_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
13019 where
13020 T: std::convert::Into<crate::model::ComputeScheduling>,
13021 {
13022 self.compute_scheduling = v.map(|x| x.into());
13023 self
13024 }
13025
13026 /// Sets the value of [secure_boot][crate::model::ComputeEngineTargetDefaults::secure_boot].
13027 ///
13028 /// # Example
13029 /// ```ignore,no_run
13030 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13031 /// let x = ComputeEngineTargetDefaults::new().set_secure_boot(true);
13032 /// ```
13033 pub fn set_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13034 self.secure_boot = v.into();
13035 self
13036 }
13037
13038 /// Sets the value of [enable_vtpm][crate::model::ComputeEngineTargetDefaults::enable_vtpm].
13039 ///
13040 /// # Example
13041 /// ```ignore,no_run
13042 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13043 /// let x = ComputeEngineTargetDefaults::new().set_enable_vtpm(true);
13044 /// ```
13045 pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13046 self.enable_vtpm = v.into();
13047 self
13048 }
13049
13050 /// Sets the value of [enable_integrity_monitoring][crate::model::ComputeEngineTargetDefaults::enable_integrity_monitoring].
13051 ///
13052 /// # Example
13053 /// ```ignore,no_run
13054 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13055 /// let x = ComputeEngineTargetDefaults::new().set_enable_integrity_monitoring(true);
13056 /// ```
13057 pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13058 self.enable_integrity_monitoring = v.into();
13059 self
13060 }
13061
13062 /// Sets the value of [boot_option][crate::model::ComputeEngineTargetDefaults::boot_option].
13063 ///
13064 /// # Example
13065 /// ```ignore,no_run
13066 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13067 /// use google_cloud_vmmigration_v1::model::ComputeEngineBootOption;
13068 /// let x0 = ComputeEngineTargetDefaults::new().set_boot_option(ComputeEngineBootOption::Efi);
13069 /// let x1 = ComputeEngineTargetDefaults::new().set_boot_option(ComputeEngineBootOption::Bios);
13070 /// ```
13071 pub fn set_boot_option<T: std::convert::Into<crate::model::ComputeEngineBootOption>>(
13072 mut self,
13073 v: T,
13074 ) -> Self {
13075 self.boot_option = v.into();
13076 self
13077 }
13078
13079 /// Sets the value of [metadata][crate::model::ComputeEngineTargetDefaults::metadata].
13080 ///
13081 /// # Example
13082 /// ```ignore,no_run
13083 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13084 /// let x = ComputeEngineTargetDefaults::new().set_metadata([
13085 /// ("key0", "abc"),
13086 /// ("key1", "xyz"),
13087 /// ]);
13088 /// ```
13089 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
13090 where
13091 T: std::iter::IntoIterator<Item = (K, V)>,
13092 K: std::convert::Into<std::string::String>,
13093 V: std::convert::Into<std::string::String>,
13094 {
13095 use std::iter::Iterator;
13096 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13097 self
13098 }
13099
13100 /// Sets the value of [additional_licenses][crate::model::ComputeEngineTargetDefaults::additional_licenses].
13101 ///
13102 /// # Example
13103 /// ```ignore,no_run
13104 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13105 /// let x = ComputeEngineTargetDefaults::new().set_additional_licenses(["a", "b", "c"]);
13106 /// ```
13107 pub fn set_additional_licenses<T, V>(mut self, v: T) -> Self
13108 where
13109 T: std::iter::IntoIterator<Item = V>,
13110 V: std::convert::Into<std::string::String>,
13111 {
13112 use std::iter::Iterator;
13113 self.additional_licenses = v.into_iter().map(|i| i.into()).collect();
13114 self
13115 }
13116
13117 /// Sets the value of [hostname][crate::model::ComputeEngineTargetDefaults::hostname].
13118 ///
13119 /// # Example
13120 /// ```ignore,no_run
13121 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13122 /// let x = ComputeEngineTargetDefaults::new().set_hostname("example");
13123 /// ```
13124 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13125 self.hostname = v.into();
13126 self
13127 }
13128
13129 /// Sets the value of [encryption][crate::model::ComputeEngineTargetDefaults::encryption].
13130 ///
13131 /// # Example
13132 /// ```ignore,no_run
13133 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13134 /// use google_cloud_vmmigration_v1::model::Encryption;
13135 /// let x = ComputeEngineTargetDefaults::new().set_encryption(Encryption::default()/* use setters */);
13136 /// ```
13137 pub fn set_encryption<T>(mut self, v: T) -> Self
13138 where
13139 T: std::convert::Into<crate::model::Encryption>,
13140 {
13141 self.encryption = std::option::Option::Some(v.into());
13142 self
13143 }
13144
13145 /// Sets or clears the value of [encryption][crate::model::ComputeEngineTargetDefaults::encryption].
13146 ///
13147 /// # Example
13148 /// ```ignore,no_run
13149 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13150 /// use google_cloud_vmmigration_v1::model::Encryption;
13151 /// let x = ComputeEngineTargetDefaults::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
13152 /// let x = ComputeEngineTargetDefaults::new().set_or_clear_encryption(None::<Encryption>);
13153 /// ```
13154 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
13155 where
13156 T: std::convert::Into<crate::model::Encryption>,
13157 {
13158 self.encryption = v.map(|x| x.into());
13159 self
13160 }
13161
13162 /// Sets the value of [boot_conversion][crate::model::ComputeEngineTargetDefaults::boot_conversion].
13163 ///
13164 /// # Example
13165 /// ```ignore,no_run
13166 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13167 /// use google_cloud_vmmigration_v1::model::BootConversion;
13168 /// let x0 = ComputeEngineTargetDefaults::new().set_boot_conversion(BootConversion::None);
13169 /// let x1 = ComputeEngineTargetDefaults::new().set_boot_conversion(BootConversion::BiosToEfi);
13170 /// ```
13171 pub fn set_boot_conversion<T: std::convert::Into<crate::model::BootConversion>>(
13172 mut self,
13173 v: T,
13174 ) -> Self {
13175 self.boot_conversion = v.into();
13176 self
13177 }
13178
13179 /// Sets the value of [adaptation_modifiers][crate::model::ComputeEngineTargetDefaults::adaptation_modifiers].
13180 ///
13181 /// # Example
13182 /// ```ignore,no_run
13183 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13184 /// use google_cloud_vmmigration_v1::model::AdaptationModifier;
13185 /// let x = ComputeEngineTargetDefaults::new()
13186 /// .set_adaptation_modifiers([
13187 /// AdaptationModifier::default()/* use setters */,
13188 /// AdaptationModifier::default()/* use (different) setters */,
13189 /// ]);
13190 /// ```
13191 pub fn set_adaptation_modifiers<T, V>(mut self, v: T) -> Self
13192 where
13193 T: std::iter::IntoIterator<Item = V>,
13194 V: std::convert::Into<crate::model::AdaptationModifier>,
13195 {
13196 use std::iter::Iterator;
13197 self.adaptation_modifiers = v.into_iter().map(|i| i.into()).collect();
13198 self
13199 }
13200
13201 /// Sets the value of [disk_replica_zones][crate::model::ComputeEngineTargetDefaults::disk_replica_zones].
13202 ///
13203 /// # Example
13204 /// ```ignore,no_run
13205 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13206 /// let x = ComputeEngineTargetDefaults::new().set_disk_replica_zones(["a", "b", "c"]);
13207 /// ```
13208 pub fn set_disk_replica_zones<T, V>(mut self, v: T) -> Self
13209 where
13210 T: std::iter::IntoIterator<Item = V>,
13211 V: std::convert::Into<std::string::String>,
13212 {
13213 use std::iter::Iterator;
13214 self.disk_replica_zones = v.into_iter().map(|i| i.into()).collect();
13215 self
13216 }
13217
13218 /// Sets the value of [storage_pool][crate::model::ComputeEngineTargetDefaults::storage_pool].
13219 ///
13220 /// # Example
13221 /// ```ignore,no_run
13222 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDefaults;
13223 /// let x = ComputeEngineTargetDefaults::new().set_storage_pool("example");
13224 /// ```
13225 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13226 self.storage_pool = v.into();
13227 self
13228 }
13229}
13230
13231impl wkt::message::Message for ComputeEngineTargetDefaults {
13232 fn typename() -> &'static str {
13233 "type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineTargetDefaults"
13234 }
13235}
13236
13237/// AdaptationModifier a modifier to be used for configuration of the OS
13238/// adaptation process.
13239#[derive(Clone, Default, PartialEq)]
13240#[non_exhaustive]
13241pub struct AdaptationModifier {
13242 /// Optional. The modifier name.
13243 pub modifier: std::string::String,
13244
13245 /// Optional. The value of the modifier.
13246 /// The actual value depends on the modifier and can also be empty.
13247 pub value: std::string::String,
13248
13249 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13250}
13251
13252impl AdaptationModifier {
13253 /// Creates a new default instance.
13254 pub fn new() -> Self {
13255 std::default::Default::default()
13256 }
13257
13258 /// Sets the value of [modifier][crate::model::AdaptationModifier::modifier].
13259 ///
13260 /// # Example
13261 /// ```ignore,no_run
13262 /// # use google_cloud_vmmigration_v1::model::AdaptationModifier;
13263 /// let x = AdaptationModifier::new().set_modifier("example");
13264 /// ```
13265 pub fn set_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13266 self.modifier = v.into();
13267 self
13268 }
13269
13270 /// Sets the value of [value][crate::model::AdaptationModifier::value].
13271 ///
13272 /// # Example
13273 /// ```ignore,no_run
13274 /// # use google_cloud_vmmigration_v1::model::AdaptationModifier;
13275 /// let x = AdaptationModifier::new().set_value("example");
13276 /// ```
13277 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13278 self.value = v.into();
13279 self
13280 }
13281}
13282
13283impl wkt::message::Message for AdaptationModifier {
13284 fn typename() -> &'static str {
13285 "type.googleapis.com/google.cloud.vmmigration.v1.AdaptationModifier"
13286 }
13287}
13288
13289/// ComputeEngineTargetDetails is a collection of details for creating a VM in a
13290/// target Compute Engine project.
13291#[derive(Clone, Default, PartialEq)]
13292#[non_exhaustive]
13293pub struct ComputeEngineTargetDetails {
13294 /// The name of the VM to create.
13295 pub vm_name: std::string::String,
13296
13297 /// The Google Cloud target project ID or project name.
13298 pub project: std::string::String,
13299
13300 /// The zone in which to create the VM.
13301 pub zone: std::string::String,
13302
13303 /// The machine type series to create the VM with.
13304 pub machine_type_series: std::string::String,
13305
13306 /// The machine type to create the VM with.
13307 pub machine_type: std::string::String,
13308
13309 /// A list of network tags to associate with the VM.
13310 pub network_tags: std::vec::Vec<std::string::String>,
13311
13312 /// List of NICs connected to this VM.
13313 pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
13314
13315 /// The service account to associate the VM with.
13316 pub service_account: std::string::String,
13317
13318 /// The disk type to use in the VM.
13319 pub disk_type: crate::model::ComputeEngineDiskType,
13320
13321 /// A map of labels to associate with the VM.
13322 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13323
13324 /// The license type to use in OS adaptation.
13325 pub license_type: crate::model::ComputeEngineLicenseType,
13326
13327 /// The OS license returned from the adaptation module report.
13328 pub applied_license: std::option::Option<crate::model::AppliedLicense>,
13329
13330 /// Compute instance scheduling information (if empty default is used).
13331 pub compute_scheduling: std::option::Option<crate::model::ComputeScheduling>,
13332
13333 /// Defines whether the instance has Secure Boot enabled.
13334 /// This can be set to true only if the VM boot option is EFI.
13335 pub secure_boot: bool,
13336
13337 /// Optional. Defines whether the instance has vTPM enabled.
13338 pub enable_vtpm: bool,
13339
13340 /// Optional. Defines whether the instance has integrity monitoring enabled.
13341 pub enable_integrity_monitoring: bool,
13342
13343 /// The VM Boot Option, as set in the source VM.
13344 pub boot_option: crate::model::ComputeEngineBootOption,
13345
13346 /// The metadata key/value pairs to assign to the VM.
13347 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
13348
13349 /// Additional licenses to assign to the VM.
13350 pub additional_licenses: std::vec::Vec<std::string::String>,
13351
13352 /// The hostname to assign to the VM.
13353 pub hostname: std::string::String,
13354
13355 /// Optional. The encryption to apply to the VM disks.
13356 pub encryption: std::option::Option<crate::model::Encryption>,
13357
13358 /// Optional. By default the virtual machine will keep its existing boot
13359 /// option. Setting this property will trigger an internal process which will
13360 /// convert the virtual machine from using the existing boot option to another.
13361 pub boot_conversion: crate::model::BootConversion,
13362
13363 /// Optional. Modifiers to be used as configuration of the OS adaptation
13364 /// process.
13365 pub adaptation_modifiers: std::vec::Vec<crate::model::AdaptationModifier>,
13366
13367 /// Optional. Additional replica zones of the target regional disks.
13368 /// If this list is not empty a regional disk will be created. The first
13369 /// supported zone would be the one stated in the
13370 /// [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDetails.zone] field.
13371 /// The rest are taken from this list. Please refer to the [regional disk
13372 /// creation
13373 /// API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources)
13374 /// for further details about regional vs zonal disks. If not specified, a
13375 /// zonal disk will be created in the same zone the VM is created.
13376 ///
13377 /// [google.cloud.vmmigration.v1.ComputeEngineTargetDetails.zone]: crate::model::ComputeEngineTargetDetails::zone
13378 pub disk_replica_zones: std::vec::Vec<std::string::String>,
13379
13380 /// Optional. The storage pool used for the VM disks.
13381 /// If specified this will be the storage pool in which the disk is created.
13382 /// This is the full path of the storage pool resource, for example:
13383 /// "projects/my-project/zones/us-central1-a/storagePools/my-storage-pool".
13384 /// The storage pool must be in the same project and zone as the target disks.
13385 /// The storage pool's type must match the disk type.
13386 pub storage_pool: std::string::String,
13387
13388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13389}
13390
13391impl ComputeEngineTargetDetails {
13392 /// Creates a new default instance.
13393 pub fn new() -> Self {
13394 std::default::Default::default()
13395 }
13396
13397 /// Sets the value of [vm_name][crate::model::ComputeEngineTargetDetails::vm_name].
13398 ///
13399 /// # Example
13400 /// ```ignore,no_run
13401 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13402 /// let x = ComputeEngineTargetDetails::new().set_vm_name("example");
13403 /// ```
13404 pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13405 self.vm_name = v.into();
13406 self
13407 }
13408
13409 /// Sets the value of [project][crate::model::ComputeEngineTargetDetails::project].
13410 ///
13411 /// # Example
13412 /// ```ignore,no_run
13413 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13414 /// let x = ComputeEngineTargetDetails::new().set_project("example");
13415 /// ```
13416 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13417 self.project = v.into();
13418 self
13419 }
13420
13421 /// Sets the value of [zone][crate::model::ComputeEngineTargetDetails::zone].
13422 ///
13423 /// # Example
13424 /// ```ignore,no_run
13425 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13426 /// let x = ComputeEngineTargetDetails::new().set_zone("example");
13427 /// ```
13428 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13429 self.zone = v.into();
13430 self
13431 }
13432
13433 /// Sets the value of [machine_type_series][crate::model::ComputeEngineTargetDetails::machine_type_series].
13434 ///
13435 /// # Example
13436 /// ```ignore,no_run
13437 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13438 /// let x = ComputeEngineTargetDetails::new().set_machine_type_series("example");
13439 /// ```
13440 pub fn set_machine_type_series<T: std::convert::Into<std::string::String>>(
13441 mut self,
13442 v: T,
13443 ) -> Self {
13444 self.machine_type_series = v.into();
13445 self
13446 }
13447
13448 /// Sets the value of [machine_type][crate::model::ComputeEngineTargetDetails::machine_type].
13449 ///
13450 /// # Example
13451 /// ```ignore,no_run
13452 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13453 /// let x = ComputeEngineTargetDetails::new().set_machine_type("example");
13454 /// ```
13455 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13456 self.machine_type = v.into();
13457 self
13458 }
13459
13460 /// Sets the value of [network_tags][crate::model::ComputeEngineTargetDetails::network_tags].
13461 ///
13462 /// # Example
13463 /// ```ignore,no_run
13464 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13465 /// let x = ComputeEngineTargetDetails::new().set_network_tags(["a", "b", "c"]);
13466 /// ```
13467 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
13468 where
13469 T: std::iter::IntoIterator<Item = V>,
13470 V: std::convert::Into<std::string::String>,
13471 {
13472 use std::iter::Iterator;
13473 self.network_tags = v.into_iter().map(|i| i.into()).collect();
13474 self
13475 }
13476
13477 /// Sets the value of [network_interfaces][crate::model::ComputeEngineTargetDetails::network_interfaces].
13478 ///
13479 /// # Example
13480 /// ```ignore,no_run
13481 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13482 /// use google_cloud_vmmigration_v1::model::NetworkInterface;
13483 /// let x = ComputeEngineTargetDetails::new()
13484 /// .set_network_interfaces([
13485 /// NetworkInterface::default()/* use setters */,
13486 /// NetworkInterface::default()/* use (different) setters */,
13487 /// ]);
13488 /// ```
13489 pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
13490 where
13491 T: std::iter::IntoIterator<Item = V>,
13492 V: std::convert::Into<crate::model::NetworkInterface>,
13493 {
13494 use std::iter::Iterator;
13495 self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
13496 self
13497 }
13498
13499 /// Sets the value of [service_account][crate::model::ComputeEngineTargetDetails::service_account].
13500 ///
13501 /// # Example
13502 /// ```ignore,no_run
13503 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13504 /// let x = ComputeEngineTargetDetails::new().set_service_account("example");
13505 /// ```
13506 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13507 self.service_account = v.into();
13508 self
13509 }
13510
13511 /// Sets the value of [disk_type][crate::model::ComputeEngineTargetDetails::disk_type].
13512 ///
13513 /// # Example
13514 /// ```ignore,no_run
13515 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13516 /// use google_cloud_vmmigration_v1::model::ComputeEngineDiskType;
13517 /// let x0 = ComputeEngineTargetDetails::new().set_disk_type(ComputeEngineDiskType::Standard);
13518 /// let x1 = ComputeEngineTargetDetails::new().set_disk_type(ComputeEngineDiskType::Ssd);
13519 /// let x2 = ComputeEngineTargetDetails::new().set_disk_type(ComputeEngineDiskType::Balanced);
13520 /// ```
13521 pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
13522 mut self,
13523 v: T,
13524 ) -> Self {
13525 self.disk_type = v.into();
13526 self
13527 }
13528
13529 /// Sets the value of [labels][crate::model::ComputeEngineTargetDetails::labels].
13530 ///
13531 /// # Example
13532 /// ```ignore,no_run
13533 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13534 /// let x = ComputeEngineTargetDetails::new().set_labels([
13535 /// ("key0", "abc"),
13536 /// ("key1", "xyz"),
13537 /// ]);
13538 /// ```
13539 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13540 where
13541 T: std::iter::IntoIterator<Item = (K, V)>,
13542 K: std::convert::Into<std::string::String>,
13543 V: std::convert::Into<std::string::String>,
13544 {
13545 use std::iter::Iterator;
13546 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13547 self
13548 }
13549
13550 /// Sets the value of [license_type][crate::model::ComputeEngineTargetDetails::license_type].
13551 ///
13552 /// # Example
13553 /// ```ignore,no_run
13554 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13555 /// use google_cloud_vmmigration_v1::model::ComputeEngineLicenseType;
13556 /// let x0 = ComputeEngineTargetDetails::new().set_license_type(ComputeEngineLicenseType::Payg);
13557 /// let x1 = ComputeEngineTargetDetails::new().set_license_type(ComputeEngineLicenseType::Byol);
13558 /// ```
13559 pub fn set_license_type<T: std::convert::Into<crate::model::ComputeEngineLicenseType>>(
13560 mut self,
13561 v: T,
13562 ) -> Self {
13563 self.license_type = v.into();
13564 self
13565 }
13566
13567 /// Sets the value of [applied_license][crate::model::ComputeEngineTargetDetails::applied_license].
13568 ///
13569 /// # Example
13570 /// ```ignore,no_run
13571 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13572 /// use google_cloud_vmmigration_v1::model::AppliedLicense;
13573 /// let x = ComputeEngineTargetDetails::new().set_applied_license(AppliedLicense::default()/* use setters */);
13574 /// ```
13575 pub fn set_applied_license<T>(mut self, v: T) -> Self
13576 where
13577 T: std::convert::Into<crate::model::AppliedLicense>,
13578 {
13579 self.applied_license = std::option::Option::Some(v.into());
13580 self
13581 }
13582
13583 /// Sets or clears the value of [applied_license][crate::model::ComputeEngineTargetDetails::applied_license].
13584 ///
13585 /// # Example
13586 /// ```ignore,no_run
13587 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13588 /// use google_cloud_vmmigration_v1::model::AppliedLicense;
13589 /// let x = ComputeEngineTargetDetails::new().set_or_clear_applied_license(Some(AppliedLicense::default()/* use setters */));
13590 /// let x = ComputeEngineTargetDetails::new().set_or_clear_applied_license(None::<AppliedLicense>);
13591 /// ```
13592 pub fn set_or_clear_applied_license<T>(mut self, v: std::option::Option<T>) -> Self
13593 where
13594 T: std::convert::Into<crate::model::AppliedLicense>,
13595 {
13596 self.applied_license = v.map(|x| x.into());
13597 self
13598 }
13599
13600 /// Sets the value of [compute_scheduling][crate::model::ComputeEngineTargetDetails::compute_scheduling].
13601 ///
13602 /// # Example
13603 /// ```ignore,no_run
13604 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13605 /// use google_cloud_vmmigration_v1::model::ComputeScheduling;
13606 /// let x = ComputeEngineTargetDetails::new().set_compute_scheduling(ComputeScheduling::default()/* use setters */);
13607 /// ```
13608 pub fn set_compute_scheduling<T>(mut self, v: T) -> Self
13609 where
13610 T: std::convert::Into<crate::model::ComputeScheduling>,
13611 {
13612 self.compute_scheduling = std::option::Option::Some(v.into());
13613 self
13614 }
13615
13616 /// Sets or clears the value of [compute_scheduling][crate::model::ComputeEngineTargetDetails::compute_scheduling].
13617 ///
13618 /// # Example
13619 /// ```ignore,no_run
13620 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13621 /// use google_cloud_vmmigration_v1::model::ComputeScheduling;
13622 /// let x = ComputeEngineTargetDetails::new().set_or_clear_compute_scheduling(Some(ComputeScheduling::default()/* use setters */));
13623 /// let x = ComputeEngineTargetDetails::new().set_or_clear_compute_scheduling(None::<ComputeScheduling>);
13624 /// ```
13625 pub fn set_or_clear_compute_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
13626 where
13627 T: std::convert::Into<crate::model::ComputeScheduling>,
13628 {
13629 self.compute_scheduling = v.map(|x| x.into());
13630 self
13631 }
13632
13633 /// Sets the value of [secure_boot][crate::model::ComputeEngineTargetDetails::secure_boot].
13634 ///
13635 /// # Example
13636 /// ```ignore,no_run
13637 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13638 /// let x = ComputeEngineTargetDetails::new().set_secure_boot(true);
13639 /// ```
13640 pub fn set_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13641 self.secure_boot = v.into();
13642 self
13643 }
13644
13645 /// Sets the value of [enable_vtpm][crate::model::ComputeEngineTargetDetails::enable_vtpm].
13646 ///
13647 /// # Example
13648 /// ```ignore,no_run
13649 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13650 /// let x = ComputeEngineTargetDetails::new().set_enable_vtpm(true);
13651 /// ```
13652 pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13653 self.enable_vtpm = v.into();
13654 self
13655 }
13656
13657 /// Sets the value of [enable_integrity_monitoring][crate::model::ComputeEngineTargetDetails::enable_integrity_monitoring].
13658 ///
13659 /// # Example
13660 /// ```ignore,no_run
13661 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13662 /// let x = ComputeEngineTargetDetails::new().set_enable_integrity_monitoring(true);
13663 /// ```
13664 pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13665 self.enable_integrity_monitoring = v.into();
13666 self
13667 }
13668
13669 /// Sets the value of [boot_option][crate::model::ComputeEngineTargetDetails::boot_option].
13670 ///
13671 /// # Example
13672 /// ```ignore,no_run
13673 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13674 /// use google_cloud_vmmigration_v1::model::ComputeEngineBootOption;
13675 /// let x0 = ComputeEngineTargetDetails::new().set_boot_option(ComputeEngineBootOption::Efi);
13676 /// let x1 = ComputeEngineTargetDetails::new().set_boot_option(ComputeEngineBootOption::Bios);
13677 /// ```
13678 pub fn set_boot_option<T: std::convert::Into<crate::model::ComputeEngineBootOption>>(
13679 mut self,
13680 v: T,
13681 ) -> Self {
13682 self.boot_option = v.into();
13683 self
13684 }
13685
13686 /// Sets the value of [metadata][crate::model::ComputeEngineTargetDetails::metadata].
13687 ///
13688 /// # Example
13689 /// ```ignore,no_run
13690 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13691 /// let x = ComputeEngineTargetDetails::new().set_metadata([
13692 /// ("key0", "abc"),
13693 /// ("key1", "xyz"),
13694 /// ]);
13695 /// ```
13696 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
13697 where
13698 T: std::iter::IntoIterator<Item = (K, V)>,
13699 K: std::convert::Into<std::string::String>,
13700 V: std::convert::Into<std::string::String>,
13701 {
13702 use std::iter::Iterator;
13703 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13704 self
13705 }
13706
13707 /// Sets the value of [additional_licenses][crate::model::ComputeEngineTargetDetails::additional_licenses].
13708 ///
13709 /// # Example
13710 /// ```ignore,no_run
13711 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13712 /// let x = ComputeEngineTargetDetails::new().set_additional_licenses(["a", "b", "c"]);
13713 /// ```
13714 pub fn set_additional_licenses<T, V>(mut self, v: T) -> Self
13715 where
13716 T: std::iter::IntoIterator<Item = V>,
13717 V: std::convert::Into<std::string::String>,
13718 {
13719 use std::iter::Iterator;
13720 self.additional_licenses = v.into_iter().map(|i| i.into()).collect();
13721 self
13722 }
13723
13724 /// Sets the value of [hostname][crate::model::ComputeEngineTargetDetails::hostname].
13725 ///
13726 /// # Example
13727 /// ```ignore,no_run
13728 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13729 /// let x = ComputeEngineTargetDetails::new().set_hostname("example");
13730 /// ```
13731 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13732 self.hostname = v.into();
13733 self
13734 }
13735
13736 /// Sets the value of [encryption][crate::model::ComputeEngineTargetDetails::encryption].
13737 ///
13738 /// # Example
13739 /// ```ignore,no_run
13740 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13741 /// use google_cloud_vmmigration_v1::model::Encryption;
13742 /// let x = ComputeEngineTargetDetails::new().set_encryption(Encryption::default()/* use setters */);
13743 /// ```
13744 pub fn set_encryption<T>(mut self, v: T) -> Self
13745 where
13746 T: std::convert::Into<crate::model::Encryption>,
13747 {
13748 self.encryption = std::option::Option::Some(v.into());
13749 self
13750 }
13751
13752 /// Sets or clears the value of [encryption][crate::model::ComputeEngineTargetDetails::encryption].
13753 ///
13754 /// # Example
13755 /// ```ignore,no_run
13756 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13757 /// use google_cloud_vmmigration_v1::model::Encryption;
13758 /// let x = ComputeEngineTargetDetails::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
13759 /// let x = ComputeEngineTargetDetails::new().set_or_clear_encryption(None::<Encryption>);
13760 /// ```
13761 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
13762 where
13763 T: std::convert::Into<crate::model::Encryption>,
13764 {
13765 self.encryption = v.map(|x| x.into());
13766 self
13767 }
13768
13769 /// Sets the value of [boot_conversion][crate::model::ComputeEngineTargetDetails::boot_conversion].
13770 ///
13771 /// # Example
13772 /// ```ignore,no_run
13773 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13774 /// use google_cloud_vmmigration_v1::model::BootConversion;
13775 /// let x0 = ComputeEngineTargetDetails::new().set_boot_conversion(BootConversion::None);
13776 /// let x1 = ComputeEngineTargetDetails::new().set_boot_conversion(BootConversion::BiosToEfi);
13777 /// ```
13778 pub fn set_boot_conversion<T: std::convert::Into<crate::model::BootConversion>>(
13779 mut self,
13780 v: T,
13781 ) -> Self {
13782 self.boot_conversion = v.into();
13783 self
13784 }
13785
13786 /// Sets the value of [adaptation_modifiers][crate::model::ComputeEngineTargetDetails::adaptation_modifiers].
13787 ///
13788 /// # Example
13789 /// ```ignore,no_run
13790 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13791 /// use google_cloud_vmmigration_v1::model::AdaptationModifier;
13792 /// let x = ComputeEngineTargetDetails::new()
13793 /// .set_adaptation_modifiers([
13794 /// AdaptationModifier::default()/* use setters */,
13795 /// AdaptationModifier::default()/* use (different) setters */,
13796 /// ]);
13797 /// ```
13798 pub fn set_adaptation_modifiers<T, V>(mut self, v: T) -> Self
13799 where
13800 T: std::iter::IntoIterator<Item = V>,
13801 V: std::convert::Into<crate::model::AdaptationModifier>,
13802 {
13803 use std::iter::Iterator;
13804 self.adaptation_modifiers = v.into_iter().map(|i| i.into()).collect();
13805 self
13806 }
13807
13808 /// Sets the value of [disk_replica_zones][crate::model::ComputeEngineTargetDetails::disk_replica_zones].
13809 ///
13810 /// # Example
13811 /// ```ignore,no_run
13812 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13813 /// let x = ComputeEngineTargetDetails::new().set_disk_replica_zones(["a", "b", "c"]);
13814 /// ```
13815 pub fn set_disk_replica_zones<T, V>(mut self, v: T) -> Self
13816 where
13817 T: std::iter::IntoIterator<Item = V>,
13818 V: std::convert::Into<std::string::String>,
13819 {
13820 use std::iter::Iterator;
13821 self.disk_replica_zones = v.into_iter().map(|i| i.into()).collect();
13822 self
13823 }
13824
13825 /// Sets the value of [storage_pool][crate::model::ComputeEngineTargetDetails::storage_pool].
13826 ///
13827 /// # Example
13828 /// ```ignore,no_run
13829 /// # use google_cloud_vmmigration_v1::model::ComputeEngineTargetDetails;
13830 /// let x = ComputeEngineTargetDetails::new().set_storage_pool("example");
13831 /// ```
13832 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13833 self.storage_pool = v.into();
13834 self
13835 }
13836}
13837
13838impl wkt::message::Message for ComputeEngineTargetDetails {
13839 fn typename() -> &'static str {
13840 "type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineTargetDetails"
13841 }
13842}
13843
13844/// NetworkInterface represents a NIC of a VM.
13845#[derive(Clone, Default, PartialEq)]
13846#[non_exhaustive]
13847pub struct NetworkInterface {
13848 /// Optional. The network to connect the NIC to.
13849 pub network: std::string::String,
13850
13851 /// Optional. The subnetwork to connect the NIC to.
13852 pub subnetwork: std::string::String,
13853
13854 /// Optional. The internal IP to define in the NIC.
13855 /// The formats accepted are: `ephemeral` \ ipv4 address \ a named address
13856 /// resource full path.
13857 pub internal_ip: std::string::String,
13858
13859 /// Optional. The external IP to define in the NIC.
13860 pub external_ip: std::string::String,
13861
13862 /// Optional. The networking tier used for optimizing connectivity between
13863 /// instances and systems on the internet. Applies only for external ephemeral
13864 /// IP addresses. If left empty, will default to PREMIUM.
13865 pub network_tier: crate::model::ComputeEngineNetworkTier,
13866
13867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13868}
13869
13870impl NetworkInterface {
13871 /// Creates a new default instance.
13872 pub fn new() -> Self {
13873 std::default::Default::default()
13874 }
13875
13876 /// Sets the value of [network][crate::model::NetworkInterface::network].
13877 ///
13878 /// # Example
13879 /// ```ignore,no_run
13880 /// # use google_cloud_vmmigration_v1::model::NetworkInterface;
13881 /// let x = NetworkInterface::new().set_network("example");
13882 /// ```
13883 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13884 self.network = v.into();
13885 self
13886 }
13887
13888 /// Sets the value of [subnetwork][crate::model::NetworkInterface::subnetwork].
13889 ///
13890 /// # Example
13891 /// ```ignore,no_run
13892 /// # use google_cloud_vmmigration_v1::model::NetworkInterface;
13893 /// let x = NetworkInterface::new().set_subnetwork("example");
13894 /// ```
13895 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13896 self.subnetwork = v.into();
13897 self
13898 }
13899
13900 /// Sets the value of [internal_ip][crate::model::NetworkInterface::internal_ip].
13901 ///
13902 /// # Example
13903 /// ```ignore,no_run
13904 /// # use google_cloud_vmmigration_v1::model::NetworkInterface;
13905 /// let x = NetworkInterface::new().set_internal_ip("example");
13906 /// ```
13907 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13908 self.internal_ip = v.into();
13909 self
13910 }
13911
13912 /// Sets the value of [external_ip][crate::model::NetworkInterface::external_ip].
13913 ///
13914 /// # Example
13915 /// ```ignore,no_run
13916 /// # use google_cloud_vmmigration_v1::model::NetworkInterface;
13917 /// let x = NetworkInterface::new().set_external_ip("example");
13918 /// ```
13919 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13920 self.external_ip = v.into();
13921 self
13922 }
13923
13924 /// Sets the value of [network_tier][crate::model::NetworkInterface::network_tier].
13925 ///
13926 /// # Example
13927 /// ```ignore,no_run
13928 /// # use google_cloud_vmmigration_v1::model::NetworkInterface;
13929 /// use google_cloud_vmmigration_v1::model::ComputeEngineNetworkTier;
13930 /// let x0 = NetworkInterface::new().set_network_tier(ComputeEngineNetworkTier::NetworkTierStandard);
13931 /// let x1 = NetworkInterface::new().set_network_tier(ComputeEngineNetworkTier::NetworkTierPremium);
13932 /// ```
13933 pub fn set_network_tier<T: std::convert::Into<crate::model::ComputeEngineNetworkTier>>(
13934 mut self,
13935 v: T,
13936 ) -> Self {
13937 self.network_tier = v.into();
13938 self
13939 }
13940}
13941
13942impl wkt::message::Message for NetworkInterface {
13943 fn typename() -> &'static str {
13944 "type.googleapis.com/google.cloud.vmmigration.v1.NetworkInterface"
13945 }
13946}
13947
13948/// AppliedLicense holds the license data returned by adaptation module report.
13949#[derive(Clone, Default, PartialEq)]
13950#[non_exhaustive]
13951pub struct AppliedLicense {
13952 /// The license type that was used in OS adaptation.
13953 pub r#type: crate::model::applied_license::Type,
13954
13955 /// The OS license returned from the adaptation module's report.
13956 pub os_license: std::string::String,
13957
13958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13959}
13960
13961impl AppliedLicense {
13962 /// Creates a new default instance.
13963 pub fn new() -> Self {
13964 std::default::Default::default()
13965 }
13966
13967 /// Sets the value of [r#type][crate::model::AppliedLicense::type].
13968 ///
13969 /// # Example
13970 /// ```ignore,no_run
13971 /// # use google_cloud_vmmigration_v1::model::AppliedLicense;
13972 /// use google_cloud_vmmigration_v1::model::applied_license::Type;
13973 /// let x0 = AppliedLicense::new().set_type(Type::None);
13974 /// let x1 = AppliedLicense::new().set_type(Type::Payg);
13975 /// let x2 = AppliedLicense::new().set_type(Type::Byol);
13976 /// ```
13977 pub fn set_type<T: std::convert::Into<crate::model::applied_license::Type>>(
13978 mut self,
13979 v: T,
13980 ) -> Self {
13981 self.r#type = v.into();
13982 self
13983 }
13984
13985 /// Sets the value of [os_license][crate::model::AppliedLicense::os_license].
13986 ///
13987 /// # Example
13988 /// ```ignore,no_run
13989 /// # use google_cloud_vmmigration_v1::model::AppliedLicense;
13990 /// let x = AppliedLicense::new().set_os_license("example");
13991 /// ```
13992 pub fn set_os_license<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13993 self.os_license = v.into();
13994 self
13995 }
13996}
13997
13998impl wkt::message::Message for AppliedLicense {
13999 fn typename() -> &'static str {
14000 "type.googleapis.com/google.cloud.vmmigration.v1.AppliedLicense"
14001 }
14002}
14003
14004/// Defines additional types related to [AppliedLicense].
14005pub mod applied_license {
14006 #[allow(unused_imports)]
14007 use super::*;
14008
14009 /// License types used in OS adaptation.
14010 ///
14011 /// # Working with unknown values
14012 ///
14013 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14014 /// additional enum variants at any time. Adding new variants is not considered
14015 /// a breaking change. Applications should write their code in anticipation of:
14016 ///
14017 /// - New values appearing in future releases of the client library, **and**
14018 /// - New values received dynamically, without application changes.
14019 ///
14020 /// Please consult the [Working with enums] section in the user guide for some
14021 /// guidelines.
14022 ///
14023 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14024 #[derive(Clone, Debug, PartialEq)]
14025 #[non_exhaustive]
14026 pub enum Type {
14027 /// Unspecified license for the OS.
14028 Unspecified,
14029 /// No license available for the OS.
14030 None,
14031 /// The license type is Pay As You Go license type.
14032 Payg,
14033 /// The license type is Bring Your Own License type.
14034 Byol,
14035 /// If set, the enum was initialized with an unknown value.
14036 ///
14037 /// Applications can examine the value using [Type::value] or
14038 /// [Type::name].
14039 UnknownValue(r#type::UnknownValue),
14040 }
14041
14042 #[doc(hidden)]
14043 pub mod r#type {
14044 #[allow(unused_imports)]
14045 use super::*;
14046 #[derive(Clone, Debug, PartialEq)]
14047 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14048 }
14049
14050 impl Type {
14051 /// Gets the enum value.
14052 ///
14053 /// Returns `None` if the enum contains an unknown value deserialized from
14054 /// the string representation of enums.
14055 pub fn value(&self) -> std::option::Option<i32> {
14056 match self {
14057 Self::Unspecified => std::option::Option::Some(0),
14058 Self::None => std::option::Option::Some(1),
14059 Self::Payg => std::option::Option::Some(2),
14060 Self::Byol => std::option::Option::Some(3),
14061 Self::UnknownValue(u) => u.0.value(),
14062 }
14063 }
14064
14065 /// Gets the enum value as a string.
14066 ///
14067 /// Returns `None` if the enum contains an unknown value deserialized from
14068 /// the integer representation of enums.
14069 pub fn name(&self) -> std::option::Option<&str> {
14070 match self {
14071 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
14072 Self::None => std::option::Option::Some("NONE"),
14073 Self::Payg => std::option::Option::Some("PAYG"),
14074 Self::Byol => std::option::Option::Some("BYOL"),
14075 Self::UnknownValue(u) => u.0.name(),
14076 }
14077 }
14078 }
14079
14080 impl std::default::Default for Type {
14081 fn default() -> Self {
14082 use std::convert::From;
14083 Self::from(0)
14084 }
14085 }
14086
14087 impl std::fmt::Display for Type {
14088 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14089 wkt::internal::display_enum(f, self.name(), self.value())
14090 }
14091 }
14092
14093 impl std::convert::From<i32> for Type {
14094 fn from(value: i32) -> Self {
14095 match value {
14096 0 => Self::Unspecified,
14097 1 => Self::None,
14098 2 => Self::Payg,
14099 3 => Self::Byol,
14100 _ => Self::UnknownValue(r#type::UnknownValue(
14101 wkt::internal::UnknownEnumValue::Integer(value),
14102 )),
14103 }
14104 }
14105 }
14106
14107 impl std::convert::From<&str> for Type {
14108 fn from(value: &str) -> Self {
14109 use std::string::ToString;
14110 match value {
14111 "TYPE_UNSPECIFIED" => Self::Unspecified,
14112 "NONE" => Self::None,
14113 "PAYG" => Self::Payg,
14114 "BYOL" => Self::Byol,
14115 _ => Self::UnknownValue(r#type::UnknownValue(
14116 wkt::internal::UnknownEnumValue::String(value.to_string()),
14117 )),
14118 }
14119 }
14120 }
14121
14122 impl serde::ser::Serialize for Type {
14123 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14124 where
14125 S: serde::Serializer,
14126 {
14127 match self {
14128 Self::Unspecified => serializer.serialize_i32(0),
14129 Self::None => serializer.serialize_i32(1),
14130 Self::Payg => serializer.serialize_i32(2),
14131 Self::Byol => serializer.serialize_i32(3),
14132 Self::UnknownValue(u) => u.0.serialize(serializer),
14133 }
14134 }
14135 }
14136
14137 impl<'de> serde::de::Deserialize<'de> for Type {
14138 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14139 where
14140 D: serde::Deserializer<'de>,
14141 {
14142 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
14143 ".google.cloud.vmmigration.v1.AppliedLicense.Type",
14144 ))
14145 }
14146 }
14147}
14148
14149/// Node Affinity: the configuration of desired nodes onto which this Instance
14150/// could be scheduled. Based on
14151/// <https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling>
14152#[derive(Clone, Default, PartialEq)]
14153#[non_exhaustive]
14154pub struct SchedulingNodeAffinity {
14155 /// The label key of Node resource to reference.
14156 pub key: std::string::String,
14157
14158 /// The operator to use for the node resources specified in the `values`
14159 /// parameter.
14160 pub operator: crate::model::scheduling_node_affinity::Operator,
14161
14162 /// Corresponds to the label values of Node resource.
14163 pub values: std::vec::Vec<std::string::String>,
14164
14165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14166}
14167
14168impl SchedulingNodeAffinity {
14169 /// Creates a new default instance.
14170 pub fn new() -> Self {
14171 std::default::Default::default()
14172 }
14173
14174 /// Sets the value of [key][crate::model::SchedulingNodeAffinity::key].
14175 ///
14176 /// # Example
14177 /// ```ignore,no_run
14178 /// # use google_cloud_vmmigration_v1::model::SchedulingNodeAffinity;
14179 /// let x = SchedulingNodeAffinity::new().set_key("example");
14180 /// ```
14181 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14182 self.key = v.into();
14183 self
14184 }
14185
14186 /// Sets the value of [operator][crate::model::SchedulingNodeAffinity::operator].
14187 ///
14188 /// # Example
14189 /// ```ignore,no_run
14190 /// # use google_cloud_vmmigration_v1::model::SchedulingNodeAffinity;
14191 /// use google_cloud_vmmigration_v1::model::scheduling_node_affinity::Operator;
14192 /// let x0 = SchedulingNodeAffinity::new().set_operator(Operator::In);
14193 /// let x1 = SchedulingNodeAffinity::new().set_operator(Operator::NotIn);
14194 /// ```
14195 pub fn set_operator<T: std::convert::Into<crate::model::scheduling_node_affinity::Operator>>(
14196 mut self,
14197 v: T,
14198 ) -> Self {
14199 self.operator = v.into();
14200 self
14201 }
14202
14203 /// Sets the value of [values][crate::model::SchedulingNodeAffinity::values].
14204 ///
14205 /// # Example
14206 /// ```ignore,no_run
14207 /// # use google_cloud_vmmigration_v1::model::SchedulingNodeAffinity;
14208 /// let x = SchedulingNodeAffinity::new().set_values(["a", "b", "c"]);
14209 /// ```
14210 pub fn set_values<T, V>(mut self, v: T) -> Self
14211 where
14212 T: std::iter::IntoIterator<Item = V>,
14213 V: std::convert::Into<std::string::String>,
14214 {
14215 use std::iter::Iterator;
14216 self.values = v.into_iter().map(|i| i.into()).collect();
14217 self
14218 }
14219}
14220
14221impl wkt::message::Message for SchedulingNodeAffinity {
14222 fn typename() -> &'static str {
14223 "type.googleapis.com/google.cloud.vmmigration.v1.SchedulingNodeAffinity"
14224 }
14225}
14226
14227/// Defines additional types related to [SchedulingNodeAffinity].
14228pub mod scheduling_node_affinity {
14229 #[allow(unused_imports)]
14230 use super::*;
14231
14232 /// Possible types of node selection operators. Valid operators are IN for
14233 /// affinity and NOT_IN for anti-affinity.
14234 ///
14235 /// # Working with unknown values
14236 ///
14237 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14238 /// additional enum variants at any time. Adding new variants is not considered
14239 /// a breaking change. Applications should write their code in anticipation of:
14240 ///
14241 /// - New values appearing in future releases of the client library, **and**
14242 /// - New values received dynamically, without application changes.
14243 ///
14244 /// Please consult the [Working with enums] section in the user guide for some
14245 /// guidelines.
14246 ///
14247 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14248 #[derive(Clone, Debug, PartialEq)]
14249 #[non_exhaustive]
14250 pub enum Operator {
14251 /// An unknown, unexpected behavior.
14252 Unspecified,
14253 /// The node resource group should be in these resources affinity.
14254 In,
14255 /// The node resource group should not be in these resources affinity.
14256 NotIn,
14257 /// If set, the enum was initialized with an unknown value.
14258 ///
14259 /// Applications can examine the value using [Operator::value] or
14260 /// [Operator::name].
14261 UnknownValue(operator::UnknownValue),
14262 }
14263
14264 #[doc(hidden)]
14265 pub mod operator {
14266 #[allow(unused_imports)]
14267 use super::*;
14268 #[derive(Clone, Debug, PartialEq)]
14269 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14270 }
14271
14272 impl Operator {
14273 /// Gets the enum value.
14274 ///
14275 /// Returns `None` if the enum contains an unknown value deserialized from
14276 /// the string representation of enums.
14277 pub fn value(&self) -> std::option::Option<i32> {
14278 match self {
14279 Self::Unspecified => std::option::Option::Some(0),
14280 Self::In => std::option::Option::Some(1),
14281 Self::NotIn => std::option::Option::Some(2),
14282 Self::UnknownValue(u) => u.0.value(),
14283 }
14284 }
14285
14286 /// Gets the enum value as a string.
14287 ///
14288 /// Returns `None` if the enum contains an unknown value deserialized from
14289 /// the integer representation of enums.
14290 pub fn name(&self) -> std::option::Option<&str> {
14291 match self {
14292 Self::Unspecified => std::option::Option::Some("OPERATOR_UNSPECIFIED"),
14293 Self::In => std::option::Option::Some("IN"),
14294 Self::NotIn => std::option::Option::Some("NOT_IN"),
14295 Self::UnknownValue(u) => u.0.name(),
14296 }
14297 }
14298 }
14299
14300 impl std::default::Default for Operator {
14301 fn default() -> Self {
14302 use std::convert::From;
14303 Self::from(0)
14304 }
14305 }
14306
14307 impl std::fmt::Display for Operator {
14308 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14309 wkt::internal::display_enum(f, self.name(), self.value())
14310 }
14311 }
14312
14313 impl std::convert::From<i32> for Operator {
14314 fn from(value: i32) -> Self {
14315 match value {
14316 0 => Self::Unspecified,
14317 1 => Self::In,
14318 2 => Self::NotIn,
14319 _ => Self::UnknownValue(operator::UnknownValue(
14320 wkt::internal::UnknownEnumValue::Integer(value),
14321 )),
14322 }
14323 }
14324 }
14325
14326 impl std::convert::From<&str> for Operator {
14327 fn from(value: &str) -> Self {
14328 use std::string::ToString;
14329 match value {
14330 "OPERATOR_UNSPECIFIED" => Self::Unspecified,
14331 "IN" => Self::In,
14332 "NOT_IN" => Self::NotIn,
14333 _ => Self::UnknownValue(operator::UnknownValue(
14334 wkt::internal::UnknownEnumValue::String(value.to_string()),
14335 )),
14336 }
14337 }
14338 }
14339
14340 impl serde::ser::Serialize for Operator {
14341 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14342 where
14343 S: serde::Serializer,
14344 {
14345 match self {
14346 Self::Unspecified => serializer.serialize_i32(0),
14347 Self::In => serializer.serialize_i32(1),
14348 Self::NotIn => serializer.serialize_i32(2),
14349 Self::UnknownValue(u) => u.0.serialize(serializer),
14350 }
14351 }
14352 }
14353
14354 impl<'de> serde::de::Deserialize<'de> for Operator {
14355 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14356 where
14357 D: serde::Deserializer<'de>,
14358 {
14359 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operator>::new(
14360 ".google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator",
14361 ))
14362 }
14363 }
14364}
14365
14366/// Scheduling information for VM on maintenance/restart behaviour and
14367/// node allocation in sole tenant nodes.
14368/// Options for instance behavior when the host machine undergoes
14369/// maintenance that may temporarily impact instance performance.
14370#[derive(Clone, Default, PartialEq)]
14371#[non_exhaustive]
14372pub struct ComputeScheduling {
14373 /// How the instance should behave when the host machine undergoes
14374 /// maintenance that may temporarily impact instance performance.
14375 pub on_host_maintenance: crate::model::compute_scheduling::OnHostMaintenance,
14376
14377 /// Whether the Instance should be automatically restarted whenever it is
14378 /// terminated by Compute Engine (not terminated by user).
14379 /// This configuration is identical to `automaticRestart` field in Compute
14380 /// Engine create instance under scheduling.
14381 /// It was changed to an enum (instead of a boolean) to match the default
14382 /// value in Compute Engine which is automatic restart.
14383 pub restart_type: crate::model::compute_scheduling::RestartType,
14384
14385 /// A set of node affinity and anti-affinity configurations for sole tenant
14386 /// nodes.
14387 pub node_affinities: std::vec::Vec<crate::model::SchedulingNodeAffinity>,
14388
14389 /// The minimum number of virtual CPUs this instance will consume when
14390 /// running on a sole-tenant node. Ignored if no node_affinites are
14391 /// configured.
14392 pub min_node_cpus: i32,
14393
14394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14395}
14396
14397impl ComputeScheduling {
14398 /// Creates a new default instance.
14399 pub fn new() -> Self {
14400 std::default::Default::default()
14401 }
14402
14403 /// Sets the value of [on_host_maintenance][crate::model::ComputeScheduling::on_host_maintenance].
14404 ///
14405 /// # Example
14406 /// ```ignore,no_run
14407 /// # use google_cloud_vmmigration_v1::model::ComputeScheduling;
14408 /// use google_cloud_vmmigration_v1::model::compute_scheduling::OnHostMaintenance;
14409 /// let x0 = ComputeScheduling::new().set_on_host_maintenance(OnHostMaintenance::Terminate);
14410 /// let x1 = ComputeScheduling::new().set_on_host_maintenance(OnHostMaintenance::Migrate);
14411 /// ```
14412 pub fn set_on_host_maintenance<
14413 T: std::convert::Into<crate::model::compute_scheduling::OnHostMaintenance>,
14414 >(
14415 mut self,
14416 v: T,
14417 ) -> Self {
14418 self.on_host_maintenance = v.into();
14419 self
14420 }
14421
14422 /// Sets the value of [restart_type][crate::model::ComputeScheduling::restart_type].
14423 ///
14424 /// # Example
14425 /// ```ignore,no_run
14426 /// # use google_cloud_vmmigration_v1::model::ComputeScheduling;
14427 /// use google_cloud_vmmigration_v1::model::compute_scheduling::RestartType;
14428 /// let x0 = ComputeScheduling::new().set_restart_type(RestartType::AutomaticRestart);
14429 /// let x1 = ComputeScheduling::new().set_restart_type(RestartType::NoAutomaticRestart);
14430 /// ```
14431 pub fn set_restart_type<
14432 T: std::convert::Into<crate::model::compute_scheduling::RestartType>,
14433 >(
14434 mut self,
14435 v: T,
14436 ) -> Self {
14437 self.restart_type = v.into();
14438 self
14439 }
14440
14441 /// Sets the value of [node_affinities][crate::model::ComputeScheduling::node_affinities].
14442 ///
14443 /// # Example
14444 /// ```ignore,no_run
14445 /// # use google_cloud_vmmigration_v1::model::ComputeScheduling;
14446 /// use google_cloud_vmmigration_v1::model::SchedulingNodeAffinity;
14447 /// let x = ComputeScheduling::new()
14448 /// .set_node_affinities([
14449 /// SchedulingNodeAffinity::default()/* use setters */,
14450 /// SchedulingNodeAffinity::default()/* use (different) setters */,
14451 /// ]);
14452 /// ```
14453 pub fn set_node_affinities<T, V>(mut self, v: T) -> Self
14454 where
14455 T: std::iter::IntoIterator<Item = V>,
14456 V: std::convert::Into<crate::model::SchedulingNodeAffinity>,
14457 {
14458 use std::iter::Iterator;
14459 self.node_affinities = v.into_iter().map(|i| i.into()).collect();
14460 self
14461 }
14462
14463 /// Sets the value of [min_node_cpus][crate::model::ComputeScheduling::min_node_cpus].
14464 ///
14465 /// # Example
14466 /// ```ignore,no_run
14467 /// # use google_cloud_vmmigration_v1::model::ComputeScheduling;
14468 /// let x = ComputeScheduling::new().set_min_node_cpus(42);
14469 /// ```
14470 pub fn set_min_node_cpus<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14471 self.min_node_cpus = v.into();
14472 self
14473 }
14474}
14475
14476impl wkt::message::Message for ComputeScheduling {
14477 fn typename() -> &'static str {
14478 "type.googleapis.com/google.cloud.vmmigration.v1.ComputeScheduling"
14479 }
14480}
14481
14482/// Defines additional types related to [ComputeScheduling].
14483pub mod compute_scheduling {
14484 #[allow(unused_imports)]
14485 use super::*;
14486
14487 /// Enum for [OnHostMaintenance].
14488 ///
14489 /// # Working with unknown values
14490 ///
14491 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14492 /// additional enum variants at any time. Adding new variants is not considered
14493 /// a breaking change. Applications should write their code in anticipation of:
14494 ///
14495 /// - New values appearing in future releases of the client library, **and**
14496 /// - New values received dynamically, without application changes.
14497 ///
14498 /// Please consult the [Working with enums] section in the user guide for some
14499 /// guidelines.
14500 ///
14501 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14502 #[derive(Clone, Debug, PartialEq)]
14503 #[non_exhaustive]
14504 pub enum OnHostMaintenance {
14505 /// An unknown, unexpected behavior.
14506 Unspecified,
14507 /// Terminate the instance when the host machine undergoes maintenance.
14508 Terminate,
14509 /// Migrate the instance when the host machine undergoes maintenance.
14510 Migrate,
14511 /// If set, the enum was initialized with an unknown value.
14512 ///
14513 /// Applications can examine the value using [OnHostMaintenance::value] or
14514 /// [OnHostMaintenance::name].
14515 UnknownValue(on_host_maintenance::UnknownValue),
14516 }
14517
14518 #[doc(hidden)]
14519 pub mod on_host_maintenance {
14520 #[allow(unused_imports)]
14521 use super::*;
14522 #[derive(Clone, Debug, PartialEq)]
14523 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14524 }
14525
14526 impl OnHostMaintenance {
14527 /// Gets the enum value.
14528 ///
14529 /// Returns `None` if the enum contains an unknown value deserialized from
14530 /// the string representation of enums.
14531 pub fn value(&self) -> std::option::Option<i32> {
14532 match self {
14533 Self::Unspecified => std::option::Option::Some(0),
14534 Self::Terminate => std::option::Option::Some(1),
14535 Self::Migrate => std::option::Option::Some(2),
14536 Self::UnknownValue(u) => u.0.value(),
14537 }
14538 }
14539
14540 /// Gets the enum value as a string.
14541 ///
14542 /// Returns `None` if the enum contains an unknown value deserialized from
14543 /// the integer representation of enums.
14544 pub fn name(&self) -> std::option::Option<&str> {
14545 match self {
14546 Self::Unspecified => std::option::Option::Some("ON_HOST_MAINTENANCE_UNSPECIFIED"),
14547 Self::Terminate => std::option::Option::Some("TERMINATE"),
14548 Self::Migrate => std::option::Option::Some("MIGRATE"),
14549 Self::UnknownValue(u) => u.0.name(),
14550 }
14551 }
14552 }
14553
14554 impl std::default::Default for OnHostMaintenance {
14555 fn default() -> Self {
14556 use std::convert::From;
14557 Self::from(0)
14558 }
14559 }
14560
14561 impl std::fmt::Display for OnHostMaintenance {
14562 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14563 wkt::internal::display_enum(f, self.name(), self.value())
14564 }
14565 }
14566
14567 impl std::convert::From<i32> for OnHostMaintenance {
14568 fn from(value: i32) -> Self {
14569 match value {
14570 0 => Self::Unspecified,
14571 1 => Self::Terminate,
14572 2 => Self::Migrate,
14573 _ => Self::UnknownValue(on_host_maintenance::UnknownValue(
14574 wkt::internal::UnknownEnumValue::Integer(value),
14575 )),
14576 }
14577 }
14578 }
14579
14580 impl std::convert::From<&str> for OnHostMaintenance {
14581 fn from(value: &str) -> Self {
14582 use std::string::ToString;
14583 match value {
14584 "ON_HOST_MAINTENANCE_UNSPECIFIED" => Self::Unspecified,
14585 "TERMINATE" => Self::Terminate,
14586 "MIGRATE" => Self::Migrate,
14587 _ => Self::UnknownValue(on_host_maintenance::UnknownValue(
14588 wkt::internal::UnknownEnumValue::String(value.to_string()),
14589 )),
14590 }
14591 }
14592 }
14593
14594 impl serde::ser::Serialize for OnHostMaintenance {
14595 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14596 where
14597 S: serde::Serializer,
14598 {
14599 match self {
14600 Self::Unspecified => serializer.serialize_i32(0),
14601 Self::Terminate => serializer.serialize_i32(1),
14602 Self::Migrate => serializer.serialize_i32(2),
14603 Self::UnknownValue(u) => u.0.serialize(serializer),
14604 }
14605 }
14606 }
14607
14608 impl<'de> serde::de::Deserialize<'de> for OnHostMaintenance {
14609 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14610 where
14611 D: serde::Deserializer<'de>,
14612 {
14613 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OnHostMaintenance>::new(
14614 ".google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance",
14615 ))
14616 }
14617 }
14618
14619 /// Defines whether the Instance should be automatically restarted whenever
14620 /// it is terminated by Compute Engine (not terminated by user).
14621 ///
14622 /// # Working with unknown values
14623 ///
14624 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14625 /// additional enum variants at any time. Adding new variants is not considered
14626 /// a breaking change. Applications should write their code in anticipation of:
14627 ///
14628 /// - New values appearing in future releases of the client library, **and**
14629 /// - New values received dynamically, without application changes.
14630 ///
14631 /// Please consult the [Working with enums] section in the user guide for some
14632 /// guidelines.
14633 ///
14634 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14635 #[derive(Clone, Debug, PartialEq)]
14636 #[non_exhaustive]
14637 pub enum RestartType {
14638 /// Unspecified behavior. This will use the default.
14639 Unspecified,
14640 /// The Instance should be automatically restarted whenever it is
14641 /// terminated by Compute Engine.
14642 AutomaticRestart,
14643 /// The Instance isn't automatically restarted whenever it is
14644 /// terminated by Compute Engine.
14645 NoAutomaticRestart,
14646 /// If set, the enum was initialized with an unknown value.
14647 ///
14648 /// Applications can examine the value using [RestartType::value] or
14649 /// [RestartType::name].
14650 UnknownValue(restart_type::UnknownValue),
14651 }
14652
14653 #[doc(hidden)]
14654 pub mod restart_type {
14655 #[allow(unused_imports)]
14656 use super::*;
14657 #[derive(Clone, Debug, PartialEq)]
14658 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14659 }
14660
14661 impl RestartType {
14662 /// Gets the enum value.
14663 ///
14664 /// Returns `None` if the enum contains an unknown value deserialized from
14665 /// the string representation of enums.
14666 pub fn value(&self) -> std::option::Option<i32> {
14667 match self {
14668 Self::Unspecified => std::option::Option::Some(0),
14669 Self::AutomaticRestart => std::option::Option::Some(1),
14670 Self::NoAutomaticRestart => std::option::Option::Some(2),
14671 Self::UnknownValue(u) => u.0.value(),
14672 }
14673 }
14674
14675 /// Gets the enum value as a string.
14676 ///
14677 /// Returns `None` if the enum contains an unknown value deserialized from
14678 /// the integer representation of enums.
14679 pub fn name(&self) -> std::option::Option<&str> {
14680 match self {
14681 Self::Unspecified => std::option::Option::Some("RESTART_TYPE_UNSPECIFIED"),
14682 Self::AutomaticRestart => std::option::Option::Some("AUTOMATIC_RESTART"),
14683 Self::NoAutomaticRestart => std::option::Option::Some("NO_AUTOMATIC_RESTART"),
14684 Self::UnknownValue(u) => u.0.name(),
14685 }
14686 }
14687 }
14688
14689 impl std::default::Default for RestartType {
14690 fn default() -> Self {
14691 use std::convert::From;
14692 Self::from(0)
14693 }
14694 }
14695
14696 impl std::fmt::Display for RestartType {
14697 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14698 wkt::internal::display_enum(f, self.name(), self.value())
14699 }
14700 }
14701
14702 impl std::convert::From<i32> for RestartType {
14703 fn from(value: i32) -> Self {
14704 match value {
14705 0 => Self::Unspecified,
14706 1 => Self::AutomaticRestart,
14707 2 => Self::NoAutomaticRestart,
14708 _ => Self::UnknownValue(restart_type::UnknownValue(
14709 wkt::internal::UnknownEnumValue::Integer(value),
14710 )),
14711 }
14712 }
14713 }
14714
14715 impl std::convert::From<&str> for RestartType {
14716 fn from(value: &str) -> Self {
14717 use std::string::ToString;
14718 match value {
14719 "RESTART_TYPE_UNSPECIFIED" => Self::Unspecified,
14720 "AUTOMATIC_RESTART" => Self::AutomaticRestart,
14721 "NO_AUTOMATIC_RESTART" => Self::NoAutomaticRestart,
14722 _ => Self::UnknownValue(restart_type::UnknownValue(
14723 wkt::internal::UnknownEnumValue::String(value.to_string()),
14724 )),
14725 }
14726 }
14727 }
14728
14729 impl serde::ser::Serialize for RestartType {
14730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14731 where
14732 S: serde::Serializer,
14733 {
14734 match self {
14735 Self::Unspecified => serializer.serialize_i32(0),
14736 Self::AutomaticRestart => serializer.serialize_i32(1),
14737 Self::NoAutomaticRestart => serializer.serialize_i32(2),
14738 Self::UnknownValue(u) => u.0.serialize(serializer),
14739 }
14740 }
14741 }
14742
14743 impl<'de> serde::de::Deserialize<'de> for RestartType {
14744 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14745 where
14746 D: serde::Deserializer<'de>,
14747 {
14748 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestartType>::new(
14749 ".google.cloud.vmmigration.v1.ComputeScheduling.RestartType",
14750 ))
14751 }
14752 }
14753}
14754
14755/// ComputeEngineDisksTargetDefaults is a collection of details for creating
14756/// Persistent Disks in a target Compute Engine project.
14757#[derive(Clone, Default, PartialEq)]
14758#[non_exhaustive]
14759pub struct ComputeEngineDisksTargetDefaults {
14760 /// The full path of the resource of type TargetProject which represents the
14761 /// Compute Engine project in which to create the Persistent Disks.
14762 pub target_project: std::string::String,
14763
14764 /// The details of each Persistent Disk to create.
14765 pub disks: std::vec::Vec<crate::model::PersistentDiskDefaults>,
14766
14767 #[allow(missing_docs)]
14768 pub location: std::option::Option<crate::model::compute_engine_disks_target_defaults::Location>,
14769
14770 /// Details of the VM to attach the disks to as the target of this migration.
14771 pub vm_target:
14772 std::option::Option<crate::model::compute_engine_disks_target_defaults::VmTarget>,
14773
14774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14775}
14776
14777impl ComputeEngineDisksTargetDefaults {
14778 /// Creates a new default instance.
14779 pub fn new() -> Self {
14780 std::default::Default::default()
14781 }
14782
14783 /// Sets the value of [target_project][crate::model::ComputeEngineDisksTargetDefaults::target_project].
14784 ///
14785 /// # Example
14786 /// ```ignore,no_run
14787 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14788 /// # let project_id = "project_id";
14789 /// # let location_id = "location_id";
14790 /// # let target_project_id = "target_project_id";
14791 /// let x = ComputeEngineDisksTargetDefaults::new().set_target_project(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
14792 /// ```
14793 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14794 self.target_project = v.into();
14795 self
14796 }
14797
14798 /// Sets the value of [disks][crate::model::ComputeEngineDisksTargetDefaults::disks].
14799 ///
14800 /// # Example
14801 /// ```ignore,no_run
14802 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14803 /// use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
14804 /// let x = ComputeEngineDisksTargetDefaults::new()
14805 /// .set_disks([
14806 /// PersistentDiskDefaults::default()/* use setters */,
14807 /// PersistentDiskDefaults::default()/* use (different) setters */,
14808 /// ]);
14809 /// ```
14810 pub fn set_disks<T, V>(mut self, v: T) -> Self
14811 where
14812 T: std::iter::IntoIterator<Item = V>,
14813 V: std::convert::Into<crate::model::PersistentDiskDefaults>,
14814 {
14815 use std::iter::Iterator;
14816 self.disks = v.into_iter().map(|i| i.into()).collect();
14817 self
14818 }
14819
14820 /// Sets the value of [location][crate::model::ComputeEngineDisksTargetDefaults::location].
14821 ///
14822 /// Note that all the setters affecting `location` are mutually
14823 /// exclusive.
14824 ///
14825 /// # Example
14826 /// ```ignore,no_run
14827 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14828 /// use google_cloud_vmmigration_v1::model::compute_engine_disks_target_defaults::Location;
14829 /// let x = ComputeEngineDisksTargetDefaults::new().set_location(Some(Location::Zone("example".to_string())));
14830 /// ```
14831 pub fn set_location<
14832 T: std::convert::Into<
14833 std::option::Option<crate::model::compute_engine_disks_target_defaults::Location>,
14834 >,
14835 >(
14836 mut self,
14837 v: T,
14838 ) -> Self {
14839 self.location = v.into();
14840 self
14841 }
14842
14843 /// The value of [location][crate::model::ComputeEngineDisksTargetDefaults::location]
14844 /// if it holds a `Zone`, `None` if the field is not set or
14845 /// holds a different branch.
14846 pub fn zone(&self) -> std::option::Option<&std::string::String> {
14847 #[allow(unreachable_patterns)]
14848 self.location.as_ref().and_then(|v| match v {
14849 crate::model::compute_engine_disks_target_defaults::Location::Zone(v) => {
14850 std::option::Option::Some(v)
14851 }
14852 _ => std::option::Option::None,
14853 })
14854 }
14855
14856 /// Sets the value of [location][crate::model::ComputeEngineDisksTargetDefaults::location]
14857 /// to hold a `Zone`.
14858 ///
14859 /// Note that all the setters affecting `location` are
14860 /// mutually exclusive.
14861 ///
14862 /// # Example
14863 /// ```ignore,no_run
14864 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14865 /// let x = ComputeEngineDisksTargetDefaults::new().set_zone("example");
14866 /// assert!(x.zone().is_some());
14867 /// ```
14868 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14869 self.location = std::option::Option::Some(
14870 crate::model::compute_engine_disks_target_defaults::Location::Zone(v.into()),
14871 );
14872 self
14873 }
14874
14875 /// Sets the value of [vm_target][crate::model::ComputeEngineDisksTargetDefaults::vm_target].
14876 ///
14877 /// Note that all the setters affecting `vm_target` are mutually
14878 /// exclusive.
14879 ///
14880 /// # Example
14881 /// ```ignore,no_run
14882 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14883 /// use google_cloud_vmmigration_v1::model::DisksMigrationDisksTargetDefaults;
14884 /// let x = ComputeEngineDisksTargetDefaults::new().set_vm_target(Some(
14885 /// google_cloud_vmmigration_v1::model::compute_engine_disks_target_defaults::VmTarget::DisksTargetDefaults(DisksMigrationDisksTargetDefaults::default().into())));
14886 /// ```
14887 pub fn set_vm_target<
14888 T: std::convert::Into<
14889 std::option::Option<crate::model::compute_engine_disks_target_defaults::VmTarget>,
14890 >,
14891 >(
14892 mut self,
14893 v: T,
14894 ) -> Self {
14895 self.vm_target = v.into();
14896 self
14897 }
14898
14899 /// The value of [vm_target][crate::model::ComputeEngineDisksTargetDefaults::vm_target]
14900 /// if it holds a `DisksTargetDefaults`, `None` if the field is not set or
14901 /// holds a different branch.
14902 pub fn disks_target_defaults(
14903 &self,
14904 ) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationDisksTargetDefaults>>
14905 {
14906 #[allow(unreachable_patterns)]
14907 self.vm_target.as_ref().and_then(|v| match v {
14908 crate::model::compute_engine_disks_target_defaults::VmTarget::DisksTargetDefaults(
14909 v,
14910 ) => std::option::Option::Some(v),
14911 _ => std::option::Option::None,
14912 })
14913 }
14914
14915 /// Sets the value of [vm_target][crate::model::ComputeEngineDisksTargetDefaults::vm_target]
14916 /// to hold a `DisksTargetDefaults`.
14917 ///
14918 /// Note that all the setters affecting `vm_target` are
14919 /// mutually exclusive.
14920 ///
14921 /// # Example
14922 /// ```ignore,no_run
14923 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14924 /// use google_cloud_vmmigration_v1::model::DisksMigrationDisksTargetDefaults;
14925 /// let x = ComputeEngineDisksTargetDefaults::new().set_disks_target_defaults(DisksMigrationDisksTargetDefaults::default()/* use setters */);
14926 /// assert!(x.disks_target_defaults().is_some());
14927 /// assert!(x.vm_target_defaults().is_none());
14928 /// ```
14929 pub fn set_disks_target_defaults<
14930 T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationDisksTargetDefaults>>,
14931 >(
14932 mut self,
14933 v: T,
14934 ) -> Self {
14935 self.vm_target = std::option::Option::Some(
14936 crate::model::compute_engine_disks_target_defaults::VmTarget::DisksTargetDefaults(
14937 v.into(),
14938 ),
14939 );
14940 self
14941 }
14942
14943 /// The value of [vm_target][crate::model::ComputeEngineDisksTargetDefaults::vm_target]
14944 /// if it holds a `VmTargetDefaults`, `None` if the field is not set or
14945 /// holds a different branch.
14946 pub fn vm_target_defaults(
14947 &self,
14948 ) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationVmTargetDefaults>> {
14949 #[allow(unreachable_patterns)]
14950 self.vm_target.as_ref().and_then(|v| match v {
14951 crate::model::compute_engine_disks_target_defaults::VmTarget::VmTargetDefaults(v) => {
14952 std::option::Option::Some(v)
14953 }
14954 _ => std::option::Option::None,
14955 })
14956 }
14957
14958 /// Sets the value of [vm_target][crate::model::ComputeEngineDisksTargetDefaults::vm_target]
14959 /// to hold a `VmTargetDefaults`.
14960 ///
14961 /// Note that all the setters affecting `vm_target` are
14962 /// mutually exclusive.
14963 ///
14964 /// # Example
14965 /// ```ignore,no_run
14966 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDefaults;
14967 /// use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
14968 /// let x = ComputeEngineDisksTargetDefaults::new().set_vm_target_defaults(DisksMigrationVmTargetDefaults::default()/* use setters */);
14969 /// assert!(x.vm_target_defaults().is_some());
14970 /// assert!(x.disks_target_defaults().is_none());
14971 /// ```
14972 pub fn set_vm_target_defaults<
14973 T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationVmTargetDefaults>>,
14974 >(
14975 mut self,
14976 v: T,
14977 ) -> Self {
14978 self.vm_target = std::option::Option::Some(
14979 crate::model::compute_engine_disks_target_defaults::VmTarget::VmTargetDefaults(
14980 v.into(),
14981 ),
14982 );
14983 self
14984 }
14985}
14986
14987impl wkt::message::Message for ComputeEngineDisksTargetDefaults {
14988 fn typename() -> &'static str {
14989 "type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaults"
14990 }
14991}
14992
14993/// Defines additional types related to [ComputeEngineDisksTargetDefaults].
14994pub mod compute_engine_disks_target_defaults {
14995 #[allow(unused_imports)]
14996 use super::*;
14997
14998 #[allow(missing_docs)]
14999 #[derive(Clone, Debug, PartialEq)]
15000 #[non_exhaustive]
15001 pub enum Location {
15002 /// The zone in which to create the Persistent Disks.
15003 Zone(std::string::String),
15004 }
15005
15006 /// Details of the VM to attach the disks to as the target of this migration.
15007 #[derive(Clone, Debug, PartialEq)]
15008 #[non_exhaustive]
15009 pub enum VmTarget {
15010 /// Details of the disk only migration target.
15011 DisksTargetDefaults(std::boxed::Box<crate::model::DisksMigrationDisksTargetDefaults>),
15012 /// Details of the VM migration target.
15013 VmTargetDefaults(std::boxed::Box<crate::model::DisksMigrationVmTargetDefaults>),
15014 }
15015}
15016
15017/// Details for creation of a Persistent Disk.
15018#[derive(Clone, Default, PartialEq)]
15019#[non_exhaustive]
15020pub struct PersistentDiskDefaults {
15021 /// Required. The ordinal number of the source VM disk.
15022 pub source_disk_number: i32,
15023
15024 /// Optional. The name of the Persistent Disk to create.
15025 pub disk_name: std::string::String,
15026
15027 /// The disk type to use.
15028 pub disk_type: crate::model::ComputeEngineDiskType,
15029
15030 /// A map of labels to associate with the Persistent Disk.
15031 pub additional_labels: std::collections::HashMap<std::string::String, std::string::String>,
15032
15033 /// Optional. The encryption to apply to the disk.
15034 pub encryption: std::option::Option<crate::model::Encryption>,
15035
15036 /// Optional. Details for attachment of the disk to a VM.
15037 /// Used when the disk is set to be attached to a target VM.
15038 pub vm_attachment_details: std::option::Option<crate::model::VmAttachmentDetails>,
15039
15040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15041}
15042
15043impl PersistentDiskDefaults {
15044 /// Creates a new default instance.
15045 pub fn new() -> Self {
15046 std::default::Default::default()
15047 }
15048
15049 /// Sets the value of [source_disk_number][crate::model::PersistentDiskDefaults::source_disk_number].
15050 ///
15051 /// # Example
15052 /// ```ignore,no_run
15053 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15054 /// let x = PersistentDiskDefaults::new().set_source_disk_number(42);
15055 /// ```
15056 pub fn set_source_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15057 self.source_disk_number = v.into();
15058 self
15059 }
15060
15061 /// Sets the value of [disk_name][crate::model::PersistentDiskDefaults::disk_name].
15062 ///
15063 /// # Example
15064 /// ```ignore,no_run
15065 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15066 /// let x = PersistentDiskDefaults::new().set_disk_name("example");
15067 /// ```
15068 pub fn set_disk_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15069 self.disk_name = v.into();
15070 self
15071 }
15072
15073 /// Sets the value of [disk_type][crate::model::PersistentDiskDefaults::disk_type].
15074 ///
15075 /// # Example
15076 /// ```ignore,no_run
15077 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15078 /// use google_cloud_vmmigration_v1::model::ComputeEngineDiskType;
15079 /// let x0 = PersistentDiskDefaults::new().set_disk_type(ComputeEngineDiskType::Standard);
15080 /// let x1 = PersistentDiskDefaults::new().set_disk_type(ComputeEngineDiskType::Ssd);
15081 /// let x2 = PersistentDiskDefaults::new().set_disk_type(ComputeEngineDiskType::Balanced);
15082 /// ```
15083 pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
15084 mut self,
15085 v: T,
15086 ) -> Self {
15087 self.disk_type = v.into();
15088 self
15089 }
15090
15091 /// Sets the value of [additional_labels][crate::model::PersistentDiskDefaults::additional_labels].
15092 ///
15093 /// # Example
15094 /// ```ignore,no_run
15095 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15096 /// let x = PersistentDiskDefaults::new().set_additional_labels([
15097 /// ("key0", "abc"),
15098 /// ("key1", "xyz"),
15099 /// ]);
15100 /// ```
15101 pub fn set_additional_labels<T, K, V>(mut self, v: T) -> Self
15102 where
15103 T: std::iter::IntoIterator<Item = (K, V)>,
15104 K: std::convert::Into<std::string::String>,
15105 V: std::convert::Into<std::string::String>,
15106 {
15107 use std::iter::Iterator;
15108 self.additional_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15109 self
15110 }
15111
15112 /// Sets the value of [encryption][crate::model::PersistentDiskDefaults::encryption].
15113 ///
15114 /// # Example
15115 /// ```ignore,no_run
15116 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15117 /// use google_cloud_vmmigration_v1::model::Encryption;
15118 /// let x = PersistentDiskDefaults::new().set_encryption(Encryption::default()/* use setters */);
15119 /// ```
15120 pub fn set_encryption<T>(mut self, v: T) -> Self
15121 where
15122 T: std::convert::Into<crate::model::Encryption>,
15123 {
15124 self.encryption = std::option::Option::Some(v.into());
15125 self
15126 }
15127
15128 /// Sets or clears the value of [encryption][crate::model::PersistentDiskDefaults::encryption].
15129 ///
15130 /// # Example
15131 /// ```ignore,no_run
15132 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15133 /// use google_cloud_vmmigration_v1::model::Encryption;
15134 /// let x = PersistentDiskDefaults::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
15135 /// let x = PersistentDiskDefaults::new().set_or_clear_encryption(None::<Encryption>);
15136 /// ```
15137 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
15138 where
15139 T: std::convert::Into<crate::model::Encryption>,
15140 {
15141 self.encryption = v.map(|x| x.into());
15142 self
15143 }
15144
15145 /// Sets the value of [vm_attachment_details][crate::model::PersistentDiskDefaults::vm_attachment_details].
15146 ///
15147 /// # Example
15148 /// ```ignore,no_run
15149 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15150 /// use google_cloud_vmmigration_v1::model::VmAttachmentDetails;
15151 /// let x = PersistentDiskDefaults::new().set_vm_attachment_details(VmAttachmentDetails::default()/* use setters */);
15152 /// ```
15153 pub fn set_vm_attachment_details<T>(mut self, v: T) -> Self
15154 where
15155 T: std::convert::Into<crate::model::VmAttachmentDetails>,
15156 {
15157 self.vm_attachment_details = std::option::Option::Some(v.into());
15158 self
15159 }
15160
15161 /// Sets or clears the value of [vm_attachment_details][crate::model::PersistentDiskDefaults::vm_attachment_details].
15162 ///
15163 /// # Example
15164 /// ```ignore,no_run
15165 /// # use google_cloud_vmmigration_v1::model::PersistentDiskDefaults;
15166 /// use google_cloud_vmmigration_v1::model::VmAttachmentDetails;
15167 /// let x = PersistentDiskDefaults::new().set_or_clear_vm_attachment_details(Some(VmAttachmentDetails::default()/* use setters */));
15168 /// let x = PersistentDiskDefaults::new().set_or_clear_vm_attachment_details(None::<VmAttachmentDetails>);
15169 /// ```
15170 pub fn set_or_clear_vm_attachment_details<T>(mut self, v: std::option::Option<T>) -> Self
15171 where
15172 T: std::convert::Into<crate::model::VmAttachmentDetails>,
15173 {
15174 self.vm_attachment_details = v.map(|x| x.into());
15175 self
15176 }
15177}
15178
15179impl wkt::message::Message for PersistentDiskDefaults {
15180 fn typename() -> &'static str {
15181 "type.googleapis.com/google.cloud.vmmigration.v1.PersistentDiskDefaults"
15182 }
15183}
15184
15185/// Details for attachment of the disk to a VM.
15186#[derive(Clone, Default, PartialEq)]
15187#[non_exhaustive]
15188pub struct VmAttachmentDetails {
15189 /// Optional. Specifies a unique device name of your choice that is reflected
15190 /// into the /dev/disk/by-id/google-* tree of a Linux operating system running
15191 /// within the instance. If not specified, the server chooses a default device
15192 /// name to apply to this disk, in the form persistent-disk-x, where x is a
15193 /// number assigned by Google Compute Engine. This field is only applicable for
15194 /// persistent disks.
15195 pub device_name: std::string::String,
15196
15197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15198}
15199
15200impl VmAttachmentDetails {
15201 /// Creates a new default instance.
15202 pub fn new() -> Self {
15203 std::default::Default::default()
15204 }
15205
15206 /// Sets the value of [device_name][crate::model::VmAttachmentDetails::device_name].
15207 ///
15208 /// # Example
15209 /// ```ignore,no_run
15210 /// # use google_cloud_vmmigration_v1::model::VmAttachmentDetails;
15211 /// let x = VmAttachmentDetails::new().set_device_name("example");
15212 /// ```
15213 pub fn set_device_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15214 self.device_name = v.into();
15215 self
15216 }
15217}
15218
15219impl wkt::message::Message for VmAttachmentDetails {
15220 fn typename() -> &'static str {
15221 "type.googleapis.com/google.cloud.vmmigration.v1.VmAttachmentDetails"
15222 }
15223}
15224
15225/// Details for a disk only migration.
15226#[derive(Clone, Default, PartialEq)]
15227#[non_exhaustive]
15228pub struct DisksMigrationDisksTargetDefaults {
15229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15230}
15231
15232impl DisksMigrationDisksTargetDefaults {
15233 /// Creates a new default instance.
15234 pub fn new() -> Self {
15235 std::default::Default::default()
15236 }
15237}
15238
15239impl wkt::message::Message for DisksMigrationDisksTargetDefaults {
15240 fn typename() -> &'static str {
15241 "type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaults"
15242 }
15243}
15244
15245/// Details for creation of a VM that migrated data disks will be attached to.
15246#[derive(Clone, Default, PartialEq)]
15247#[non_exhaustive]
15248pub struct DisksMigrationVmTargetDefaults {
15249 /// Required. The name of the VM to create.
15250 pub vm_name: std::string::String,
15251
15252 /// Optional. The machine type series to create the VM with.
15253 /// For presentation only.
15254 pub machine_type_series: std::string::String,
15255
15256 /// Required. The machine type to create the VM with.
15257 pub machine_type: std::string::String,
15258
15259 /// Optional. A list of network tags to associate with the VM.
15260 pub network_tags: std::vec::Vec<std::string::String>,
15261
15262 /// Optional. NICs to attach to the VM.
15263 pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
15264
15265 /// Optional. The service account to associate the VM with.
15266 pub service_account: std::string::String,
15267
15268 /// Optional. Compute instance scheduling information (if empty default is
15269 /// used).
15270 pub compute_scheduling: std::option::Option<crate::model::ComputeScheduling>,
15271
15272 /// Optional. Defines whether the instance has Secure Boot enabled.
15273 /// This can be set to true only if the VM boot option is EFI.
15274 pub secure_boot: bool,
15275
15276 /// Optional. Defines whether the instance has vTPM enabled.
15277 pub enable_vtpm: bool,
15278
15279 /// Optional. Defines whether the instance has integrity monitoring enabled.
15280 pub enable_integrity_monitoring: bool,
15281
15282 /// Optional. The metadata key/value pairs to assign to the VM.
15283 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
15284
15285 /// Optional. Additional licenses to assign to the VM.
15286 pub additional_licenses: std::vec::Vec<std::string::String>,
15287
15288 /// Optional. The hostname to assign to the VM.
15289 pub hostname: std::string::String,
15290
15291 /// Optional. A map of labels to associate with the VM.
15292 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15293
15294 /// Optional. Details of the boot disk of the VM.
15295 pub boot_disk_defaults: std::option::Option<crate::model::BootDiskDefaults>,
15296
15297 /// Optional. The encryption to apply to the VM.
15298 pub encryption: std::option::Option<crate::model::Encryption>,
15299
15300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15301}
15302
15303impl DisksMigrationVmTargetDefaults {
15304 /// Creates a new default instance.
15305 pub fn new() -> Self {
15306 std::default::Default::default()
15307 }
15308
15309 /// Sets the value of [vm_name][crate::model::DisksMigrationVmTargetDefaults::vm_name].
15310 ///
15311 /// # Example
15312 /// ```ignore,no_run
15313 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15314 /// let x = DisksMigrationVmTargetDefaults::new().set_vm_name("example");
15315 /// ```
15316 pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15317 self.vm_name = v.into();
15318 self
15319 }
15320
15321 /// Sets the value of [machine_type_series][crate::model::DisksMigrationVmTargetDefaults::machine_type_series].
15322 ///
15323 /// # Example
15324 /// ```ignore,no_run
15325 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15326 /// let x = DisksMigrationVmTargetDefaults::new().set_machine_type_series("example");
15327 /// ```
15328 pub fn set_machine_type_series<T: std::convert::Into<std::string::String>>(
15329 mut self,
15330 v: T,
15331 ) -> Self {
15332 self.machine_type_series = v.into();
15333 self
15334 }
15335
15336 /// Sets the value of [machine_type][crate::model::DisksMigrationVmTargetDefaults::machine_type].
15337 ///
15338 /// # Example
15339 /// ```ignore,no_run
15340 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15341 /// let x = DisksMigrationVmTargetDefaults::new().set_machine_type("example");
15342 /// ```
15343 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15344 self.machine_type = v.into();
15345 self
15346 }
15347
15348 /// Sets the value of [network_tags][crate::model::DisksMigrationVmTargetDefaults::network_tags].
15349 ///
15350 /// # Example
15351 /// ```ignore,no_run
15352 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15353 /// let x = DisksMigrationVmTargetDefaults::new().set_network_tags(["a", "b", "c"]);
15354 /// ```
15355 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
15356 where
15357 T: std::iter::IntoIterator<Item = V>,
15358 V: std::convert::Into<std::string::String>,
15359 {
15360 use std::iter::Iterator;
15361 self.network_tags = v.into_iter().map(|i| i.into()).collect();
15362 self
15363 }
15364
15365 /// Sets the value of [network_interfaces][crate::model::DisksMigrationVmTargetDefaults::network_interfaces].
15366 ///
15367 /// # Example
15368 /// ```ignore,no_run
15369 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15370 /// use google_cloud_vmmigration_v1::model::NetworkInterface;
15371 /// let x = DisksMigrationVmTargetDefaults::new()
15372 /// .set_network_interfaces([
15373 /// NetworkInterface::default()/* use setters */,
15374 /// NetworkInterface::default()/* use (different) setters */,
15375 /// ]);
15376 /// ```
15377 pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
15378 where
15379 T: std::iter::IntoIterator<Item = V>,
15380 V: std::convert::Into<crate::model::NetworkInterface>,
15381 {
15382 use std::iter::Iterator;
15383 self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
15384 self
15385 }
15386
15387 /// Sets the value of [service_account][crate::model::DisksMigrationVmTargetDefaults::service_account].
15388 ///
15389 /// # Example
15390 /// ```ignore,no_run
15391 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15392 /// let x = DisksMigrationVmTargetDefaults::new().set_service_account("example");
15393 /// ```
15394 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15395 self.service_account = v.into();
15396 self
15397 }
15398
15399 /// Sets the value of [compute_scheduling][crate::model::DisksMigrationVmTargetDefaults::compute_scheduling].
15400 ///
15401 /// # Example
15402 /// ```ignore,no_run
15403 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15404 /// use google_cloud_vmmigration_v1::model::ComputeScheduling;
15405 /// let x = DisksMigrationVmTargetDefaults::new().set_compute_scheduling(ComputeScheduling::default()/* use setters */);
15406 /// ```
15407 pub fn set_compute_scheduling<T>(mut self, v: T) -> Self
15408 where
15409 T: std::convert::Into<crate::model::ComputeScheduling>,
15410 {
15411 self.compute_scheduling = std::option::Option::Some(v.into());
15412 self
15413 }
15414
15415 /// Sets or clears the value of [compute_scheduling][crate::model::DisksMigrationVmTargetDefaults::compute_scheduling].
15416 ///
15417 /// # Example
15418 /// ```ignore,no_run
15419 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15420 /// use google_cloud_vmmigration_v1::model::ComputeScheduling;
15421 /// let x = DisksMigrationVmTargetDefaults::new().set_or_clear_compute_scheduling(Some(ComputeScheduling::default()/* use setters */));
15422 /// let x = DisksMigrationVmTargetDefaults::new().set_or_clear_compute_scheduling(None::<ComputeScheduling>);
15423 /// ```
15424 pub fn set_or_clear_compute_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
15425 where
15426 T: std::convert::Into<crate::model::ComputeScheduling>,
15427 {
15428 self.compute_scheduling = v.map(|x| x.into());
15429 self
15430 }
15431
15432 /// Sets the value of [secure_boot][crate::model::DisksMigrationVmTargetDefaults::secure_boot].
15433 ///
15434 /// # Example
15435 /// ```ignore,no_run
15436 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15437 /// let x = DisksMigrationVmTargetDefaults::new().set_secure_boot(true);
15438 /// ```
15439 pub fn set_secure_boot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15440 self.secure_boot = v.into();
15441 self
15442 }
15443
15444 /// Sets the value of [enable_vtpm][crate::model::DisksMigrationVmTargetDefaults::enable_vtpm].
15445 ///
15446 /// # Example
15447 /// ```ignore,no_run
15448 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15449 /// let x = DisksMigrationVmTargetDefaults::new().set_enable_vtpm(true);
15450 /// ```
15451 pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15452 self.enable_vtpm = v.into();
15453 self
15454 }
15455
15456 /// Sets the value of [enable_integrity_monitoring][crate::model::DisksMigrationVmTargetDefaults::enable_integrity_monitoring].
15457 ///
15458 /// # Example
15459 /// ```ignore,no_run
15460 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15461 /// let x = DisksMigrationVmTargetDefaults::new().set_enable_integrity_monitoring(true);
15462 /// ```
15463 pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15464 self.enable_integrity_monitoring = v.into();
15465 self
15466 }
15467
15468 /// Sets the value of [metadata][crate::model::DisksMigrationVmTargetDefaults::metadata].
15469 ///
15470 /// # Example
15471 /// ```ignore,no_run
15472 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15473 /// let x = DisksMigrationVmTargetDefaults::new().set_metadata([
15474 /// ("key0", "abc"),
15475 /// ("key1", "xyz"),
15476 /// ]);
15477 /// ```
15478 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
15479 where
15480 T: std::iter::IntoIterator<Item = (K, V)>,
15481 K: std::convert::Into<std::string::String>,
15482 V: std::convert::Into<std::string::String>,
15483 {
15484 use std::iter::Iterator;
15485 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15486 self
15487 }
15488
15489 /// Sets the value of [additional_licenses][crate::model::DisksMigrationVmTargetDefaults::additional_licenses].
15490 ///
15491 /// # Example
15492 /// ```ignore,no_run
15493 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15494 /// let x = DisksMigrationVmTargetDefaults::new().set_additional_licenses(["a", "b", "c"]);
15495 /// ```
15496 pub fn set_additional_licenses<T, V>(mut self, v: T) -> Self
15497 where
15498 T: std::iter::IntoIterator<Item = V>,
15499 V: std::convert::Into<std::string::String>,
15500 {
15501 use std::iter::Iterator;
15502 self.additional_licenses = v.into_iter().map(|i| i.into()).collect();
15503 self
15504 }
15505
15506 /// Sets the value of [hostname][crate::model::DisksMigrationVmTargetDefaults::hostname].
15507 ///
15508 /// # Example
15509 /// ```ignore,no_run
15510 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15511 /// let x = DisksMigrationVmTargetDefaults::new().set_hostname("example");
15512 /// ```
15513 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15514 self.hostname = v.into();
15515 self
15516 }
15517
15518 /// Sets the value of [labels][crate::model::DisksMigrationVmTargetDefaults::labels].
15519 ///
15520 /// # Example
15521 /// ```ignore,no_run
15522 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15523 /// let x = DisksMigrationVmTargetDefaults::new().set_labels([
15524 /// ("key0", "abc"),
15525 /// ("key1", "xyz"),
15526 /// ]);
15527 /// ```
15528 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15529 where
15530 T: std::iter::IntoIterator<Item = (K, V)>,
15531 K: std::convert::Into<std::string::String>,
15532 V: std::convert::Into<std::string::String>,
15533 {
15534 use std::iter::Iterator;
15535 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15536 self
15537 }
15538
15539 /// Sets the value of [boot_disk_defaults][crate::model::DisksMigrationVmTargetDefaults::boot_disk_defaults].
15540 ///
15541 /// # Example
15542 /// ```ignore,no_run
15543 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15544 /// use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15545 /// let x = DisksMigrationVmTargetDefaults::new().set_boot_disk_defaults(BootDiskDefaults::default()/* use setters */);
15546 /// ```
15547 pub fn set_boot_disk_defaults<T>(mut self, v: T) -> Self
15548 where
15549 T: std::convert::Into<crate::model::BootDiskDefaults>,
15550 {
15551 self.boot_disk_defaults = std::option::Option::Some(v.into());
15552 self
15553 }
15554
15555 /// Sets or clears the value of [boot_disk_defaults][crate::model::DisksMigrationVmTargetDefaults::boot_disk_defaults].
15556 ///
15557 /// # Example
15558 /// ```ignore,no_run
15559 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15560 /// use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15561 /// let x = DisksMigrationVmTargetDefaults::new().set_or_clear_boot_disk_defaults(Some(BootDiskDefaults::default()/* use setters */));
15562 /// let x = DisksMigrationVmTargetDefaults::new().set_or_clear_boot_disk_defaults(None::<BootDiskDefaults>);
15563 /// ```
15564 pub fn set_or_clear_boot_disk_defaults<T>(mut self, v: std::option::Option<T>) -> Self
15565 where
15566 T: std::convert::Into<crate::model::BootDiskDefaults>,
15567 {
15568 self.boot_disk_defaults = v.map(|x| x.into());
15569 self
15570 }
15571
15572 /// Sets the value of [encryption][crate::model::DisksMigrationVmTargetDefaults::encryption].
15573 ///
15574 /// # Example
15575 /// ```ignore,no_run
15576 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15577 /// use google_cloud_vmmigration_v1::model::Encryption;
15578 /// let x = DisksMigrationVmTargetDefaults::new().set_encryption(Encryption::default()/* use setters */);
15579 /// ```
15580 pub fn set_encryption<T>(mut self, v: T) -> Self
15581 where
15582 T: std::convert::Into<crate::model::Encryption>,
15583 {
15584 self.encryption = std::option::Option::Some(v.into());
15585 self
15586 }
15587
15588 /// Sets or clears the value of [encryption][crate::model::DisksMigrationVmTargetDefaults::encryption].
15589 ///
15590 /// # Example
15591 /// ```ignore,no_run
15592 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDefaults;
15593 /// use google_cloud_vmmigration_v1::model::Encryption;
15594 /// let x = DisksMigrationVmTargetDefaults::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
15595 /// let x = DisksMigrationVmTargetDefaults::new().set_or_clear_encryption(None::<Encryption>);
15596 /// ```
15597 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
15598 where
15599 T: std::convert::Into<crate::model::Encryption>,
15600 {
15601 self.encryption = v.map(|x| x.into());
15602 self
15603 }
15604}
15605
15606impl wkt::message::Message for DisksMigrationVmTargetDefaults {
15607 fn typename() -> &'static str {
15608 "type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults"
15609 }
15610}
15611
15612/// BootDiskDefaults hold information about the boot disk of a VM.
15613#[derive(Clone, Default, PartialEq)]
15614#[non_exhaustive]
15615pub struct BootDiskDefaults {
15616 /// Optional. The name of the disk.
15617 pub disk_name: std::string::String,
15618
15619 /// Optional. The type of disk provisioning to use for the VM.
15620 pub disk_type: crate::model::ComputeEngineDiskType,
15621
15622 /// Optional. Specifies a unique device name of your choice that is reflected
15623 /// into the /dev/disk/by-id/google-* tree of a Linux operating system running
15624 /// within the instance. If not specified, the server chooses a default device
15625 /// name to apply to this disk, in the form persistent-disk-x, where x is a
15626 /// number assigned by Google Compute Engine. This field is only applicable for
15627 /// persistent disks.
15628 pub device_name: std::string::String,
15629
15630 /// Optional. The encryption to apply to the boot disk.
15631 pub encryption: std::option::Option<crate::model::Encryption>,
15632
15633 #[allow(missing_docs)]
15634 pub source: std::option::Option<crate::model::boot_disk_defaults::Source>,
15635
15636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15637}
15638
15639impl BootDiskDefaults {
15640 /// Creates a new default instance.
15641 pub fn new() -> Self {
15642 std::default::Default::default()
15643 }
15644
15645 /// Sets the value of [disk_name][crate::model::BootDiskDefaults::disk_name].
15646 ///
15647 /// # Example
15648 /// ```ignore,no_run
15649 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15650 /// let x = BootDiskDefaults::new().set_disk_name("example");
15651 /// ```
15652 pub fn set_disk_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15653 self.disk_name = v.into();
15654 self
15655 }
15656
15657 /// Sets the value of [disk_type][crate::model::BootDiskDefaults::disk_type].
15658 ///
15659 /// # Example
15660 /// ```ignore,no_run
15661 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15662 /// use google_cloud_vmmigration_v1::model::ComputeEngineDiskType;
15663 /// let x0 = BootDiskDefaults::new().set_disk_type(ComputeEngineDiskType::Standard);
15664 /// let x1 = BootDiskDefaults::new().set_disk_type(ComputeEngineDiskType::Ssd);
15665 /// let x2 = BootDiskDefaults::new().set_disk_type(ComputeEngineDiskType::Balanced);
15666 /// ```
15667 pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
15668 mut self,
15669 v: T,
15670 ) -> Self {
15671 self.disk_type = v.into();
15672 self
15673 }
15674
15675 /// Sets the value of [device_name][crate::model::BootDiskDefaults::device_name].
15676 ///
15677 /// # Example
15678 /// ```ignore,no_run
15679 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15680 /// let x = BootDiskDefaults::new().set_device_name("example");
15681 /// ```
15682 pub fn set_device_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15683 self.device_name = v.into();
15684 self
15685 }
15686
15687 /// Sets the value of [encryption][crate::model::BootDiskDefaults::encryption].
15688 ///
15689 /// # Example
15690 /// ```ignore,no_run
15691 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15692 /// use google_cloud_vmmigration_v1::model::Encryption;
15693 /// let x = BootDiskDefaults::new().set_encryption(Encryption::default()/* use setters */);
15694 /// ```
15695 pub fn set_encryption<T>(mut self, v: T) -> Self
15696 where
15697 T: std::convert::Into<crate::model::Encryption>,
15698 {
15699 self.encryption = std::option::Option::Some(v.into());
15700 self
15701 }
15702
15703 /// Sets or clears the value of [encryption][crate::model::BootDiskDefaults::encryption].
15704 ///
15705 /// # Example
15706 /// ```ignore,no_run
15707 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15708 /// use google_cloud_vmmigration_v1::model::Encryption;
15709 /// let x = BootDiskDefaults::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
15710 /// let x = BootDiskDefaults::new().set_or_clear_encryption(None::<Encryption>);
15711 /// ```
15712 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
15713 where
15714 T: std::convert::Into<crate::model::Encryption>,
15715 {
15716 self.encryption = v.map(|x| x.into());
15717 self
15718 }
15719
15720 /// Sets the value of [source][crate::model::BootDiskDefaults::source].
15721 ///
15722 /// Note that all the setters affecting `source` are mutually
15723 /// exclusive.
15724 ///
15725 /// # Example
15726 /// ```ignore,no_run
15727 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15728 /// use google_cloud_vmmigration_v1::model::boot_disk_defaults::DiskImageDefaults;
15729 /// let x = BootDiskDefaults::new().set_source(Some(
15730 /// google_cloud_vmmigration_v1::model::boot_disk_defaults::Source::Image(DiskImageDefaults::default().into())));
15731 /// ```
15732 pub fn set_source<
15733 T: std::convert::Into<std::option::Option<crate::model::boot_disk_defaults::Source>>,
15734 >(
15735 mut self,
15736 v: T,
15737 ) -> Self {
15738 self.source = v.into();
15739 self
15740 }
15741
15742 /// The value of [source][crate::model::BootDiskDefaults::source]
15743 /// if it holds a `Image`, `None` if the field is not set or
15744 /// holds a different branch.
15745 pub fn image(
15746 &self,
15747 ) -> std::option::Option<&std::boxed::Box<crate::model::boot_disk_defaults::DiskImageDefaults>>
15748 {
15749 #[allow(unreachable_patterns)]
15750 self.source.as_ref().and_then(|v| match v {
15751 crate::model::boot_disk_defaults::Source::Image(v) => std::option::Option::Some(v),
15752 _ => std::option::Option::None,
15753 })
15754 }
15755
15756 /// Sets the value of [source][crate::model::BootDiskDefaults::source]
15757 /// to hold a `Image`.
15758 ///
15759 /// Note that all the setters affecting `source` are
15760 /// mutually exclusive.
15761 ///
15762 /// # Example
15763 /// ```ignore,no_run
15764 /// # use google_cloud_vmmigration_v1::model::BootDiskDefaults;
15765 /// use google_cloud_vmmigration_v1::model::boot_disk_defaults::DiskImageDefaults;
15766 /// let x = BootDiskDefaults::new().set_image(DiskImageDefaults::default()/* use setters */);
15767 /// assert!(x.image().is_some());
15768 /// ```
15769 pub fn set_image<
15770 T: std::convert::Into<std::boxed::Box<crate::model::boot_disk_defaults::DiskImageDefaults>>,
15771 >(
15772 mut self,
15773 v: T,
15774 ) -> Self {
15775 self.source =
15776 std::option::Option::Some(crate::model::boot_disk_defaults::Source::Image(v.into()));
15777 self
15778 }
15779}
15780
15781impl wkt::message::Message for BootDiskDefaults {
15782 fn typename() -> &'static str {
15783 "type.googleapis.com/google.cloud.vmmigration.v1.BootDiskDefaults"
15784 }
15785}
15786
15787/// Defines additional types related to [BootDiskDefaults].
15788pub mod boot_disk_defaults {
15789 #[allow(unused_imports)]
15790 use super::*;
15791
15792 /// Contains details about the image source used to create the disk.
15793 #[derive(Clone, Default, PartialEq)]
15794 #[non_exhaustive]
15795 pub struct DiskImageDefaults {
15796 /// Required. The Image resource used when creating the disk.
15797 pub source_image: std::string::String,
15798
15799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15800 }
15801
15802 impl DiskImageDefaults {
15803 /// Creates a new default instance.
15804 pub fn new() -> Self {
15805 std::default::Default::default()
15806 }
15807
15808 /// Sets the value of [source_image][crate::model::boot_disk_defaults::DiskImageDefaults::source_image].
15809 ///
15810 /// # Example
15811 /// ```ignore,no_run
15812 /// # use google_cloud_vmmigration_v1::model::boot_disk_defaults::DiskImageDefaults;
15813 /// let x = DiskImageDefaults::new().set_source_image("example");
15814 /// ```
15815 pub fn set_source_image<T: std::convert::Into<std::string::String>>(
15816 mut self,
15817 v: T,
15818 ) -> Self {
15819 self.source_image = v.into();
15820 self
15821 }
15822 }
15823
15824 impl wkt::message::Message for DiskImageDefaults {
15825 fn typename() -> &'static str {
15826 "type.googleapis.com/google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaults"
15827 }
15828 }
15829
15830 #[allow(missing_docs)]
15831 #[derive(Clone, Debug, PartialEq)]
15832 #[non_exhaustive]
15833 pub enum Source {
15834 /// The image to use when creating the disk.
15835 Image(std::boxed::Box<crate::model::boot_disk_defaults::DiskImageDefaults>),
15836 }
15837}
15838
15839/// ComputeEngineDisksTargetDetails is a collection of created Persistent Disks
15840/// details.
15841#[derive(Clone, Default, PartialEq)]
15842#[non_exhaustive]
15843pub struct ComputeEngineDisksTargetDetails {
15844 /// The details of each created Persistent Disk.
15845 pub disks: std::vec::Vec<crate::model::PersistentDisk>,
15846
15847 /// Details of the VM the disks are attached to.
15848 pub vm_target: std::option::Option<crate::model::compute_engine_disks_target_details::VmTarget>,
15849
15850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15851}
15852
15853impl ComputeEngineDisksTargetDetails {
15854 /// Creates a new default instance.
15855 pub fn new() -> Self {
15856 std::default::Default::default()
15857 }
15858
15859 /// Sets the value of [disks][crate::model::ComputeEngineDisksTargetDetails::disks].
15860 ///
15861 /// # Example
15862 /// ```ignore,no_run
15863 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDetails;
15864 /// use google_cloud_vmmigration_v1::model::PersistentDisk;
15865 /// let x = ComputeEngineDisksTargetDetails::new()
15866 /// .set_disks([
15867 /// PersistentDisk::default()/* use setters */,
15868 /// PersistentDisk::default()/* use (different) setters */,
15869 /// ]);
15870 /// ```
15871 pub fn set_disks<T, V>(mut self, v: T) -> Self
15872 where
15873 T: std::iter::IntoIterator<Item = V>,
15874 V: std::convert::Into<crate::model::PersistentDisk>,
15875 {
15876 use std::iter::Iterator;
15877 self.disks = v.into_iter().map(|i| i.into()).collect();
15878 self
15879 }
15880
15881 /// Sets the value of [vm_target][crate::model::ComputeEngineDisksTargetDetails::vm_target].
15882 ///
15883 /// Note that all the setters affecting `vm_target` are mutually
15884 /// exclusive.
15885 ///
15886 /// # Example
15887 /// ```ignore,no_run
15888 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDetails;
15889 /// use google_cloud_vmmigration_v1::model::DisksMigrationDisksTargetDetails;
15890 /// let x = ComputeEngineDisksTargetDetails::new().set_vm_target(Some(
15891 /// google_cloud_vmmigration_v1::model::compute_engine_disks_target_details::VmTarget::DisksTargetDetails(DisksMigrationDisksTargetDetails::default().into())));
15892 /// ```
15893 pub fn set_vm_target<
15894 T: std::convert::Into<
15895 std::option::Option<crate::model::compute_engine_disks_target_details::VmTarget>,
15896 >,
15897 >(
15898 mut self,
15899 v: T,
15900 ) -> Self {
15901 self.vm_target = v.into();
15902 self
15903 }
15904
15905 /// The value of [vm_target][crate::model::ComputeEngineDisksTargetDetails::vm_target]
15906 /// if it holds a `DisksTargetDetails`, `None` if the field is not set or
15907 /// holds a different branch.
15908 pub fn disks_target_details(
15909 &self,
15910 ) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationDisksTargetDetails>> {
15911 #[allow(unreachable_patterns)]
15912 self.vm_target.as_ref().and_then(|v| match v {
15913 crate::model::compute_engine_disks_target_details::VmTarget::DisksTargetDetails(v) => {
15914 std::option::Option::Some(v)
15915 }
15916 _ => std::option::Option::None,
15917 })
15918 }
15919
15920 /// Sets the value of [vm_target][crate::model::ComputeEngineDisksTargetDetails::vm_target]
15921 /// to hold a `DisksTargetDetails`.
15922 ///
15923 /// Note that all the setters affecting `vm_target` are
15924 /// mutually exclusive.
15925 ///
15926 /// # Example
15927 /// ```ignore,no_run
15928 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDetails;
15929 /// use google_cloud_vmmigration_v1::model::DisksMigrationDisksTargetDetails;
15930 /// let x = ComputeEngineDisksTargetDetails::new().set_disks_target_details(DisksMigrationDisksTargetDetails::default()/* use setters */);
15931 /// assert!(x.disks_target_details().is_some());
15932 /// assert!(x.vm_target_details().is_none());
15933 /// ```
15934 pub fn set_disks_target_details<
15935 T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationDisksTargetDetails>>,
15936 >(
15937 mut self,
15938 v: T,
15939 ) -> Self {
15940 self.vm_target = std::option::Option::Some(
15941 crate::model::compute_engine_disks_target_details::VmTarget::DisksTargetDetails(
15942 v.into(),
15943 ),
15944 );
15945 self
15946 }
15947
15948 /// The value of [vm_target][crate::model::ComputeEngineDisksTargetDetails::vm_target]
15949 /// if it holds a `VmTargetDetails`, `None` if the field is not set or
15950 /// holds a different branch.
15951 pub fn vm_target_details(
15952 &self,
15953 ) -> std::option::Option<&std::boxed::Box<crate::model::DisksMigrationVmTargetDetails>> {
15954 #[allow(unreachable_patterns)]
15955 self.vm_target.as_ref().and_then(|v| match v {
15956 crate::model::compute_engine_disks_target_details::VmTarget::VmTargetDetails(v) => {
15957 std::option::Option::Some(v)
15958 }
15959 _ => std::option::Option::None,
15960 })
15961 }
15962
15963 /// Sets the value of [vm_target][crate::model::ComputeEngineDisksTargetDetails::vm_target]
15964 /// to hold a `VmTargetDetails`.
15965 ///
15966 /// Note that all the setters affecting `vm_target` are
15967 /// mutually exclusive.
15968 ///
15969 /// # Example
15970 /// ```ignore,no_run
15971 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisksTargetDetails;
15972 /// use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDetails;
15973 /// let x = ComputeEngineDisksTargetDetails::new().set_vm_target_details(DisksMigrationVmTargetDetails::default()/* use setters */);
15974 /// assert!(x.vm_target_details().is_some());
15975 /// assert!(x.disks_target_details().is_none());
15976 /// ```
15977 pub fn set_vm_target_details<
15978 T: std::convert::Into<std::boxed::Box<crate::model::DisksMigrationVmTargetDetails>>,
15979 >(
15980 mut self,
15981 v: T,
15982 ) -> Self {
15983 self.vm_target = std::option::Option::Some(
15984 crate::model::compute_engine_disks_target_details::VmTarget::VmTargetDetails(v.into()),
15985 );
15986 self
15987 }
15988}
15989
15990impl wkt::message::Message for ComputeEngineDisksTargetDetails {
15991 fn typename() -> &'static str {
15992 "type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails"
15993 }
15994}
15995
15996/// Defines additional types related to [ComputeEngineDisksTargetDetails].
15997pub mod compute_engine_disks_target_details {
15998 #[allow(unused_imports)]
15999 use super::*;
16000
16001 /// Details of the VM the disks are attached to.
16002 #[derive(Clone, Debug, PartialEq)]
16003 #[non_exhaustive]
16004 pub enum VmTarget {
16005 /// Details of the disks-only migration target.
16006 DisksTargetDetails(std::boxed::Box<crate::model::DisksMigrationDisksTargetDetails>),
16007 /// Details for the VM the migrated data disks are attached to.
16008 VmTargetDetails(std::boxed::Box<crate::model::DisksMigrationVmTargetDetails>),
16009 }
16010}
16011
16012/// Details of a created Persistent Disk.
16013#[derive(Clone, Default, PartialEq)]
16014#[non_exhaustive]
16015pub struct PersistentDisk {
16016 /// The ordinal number of the source VM disk.
16017 pub source_disk_number: i32,
16018
16019 /// The URI of the Persistent Disk.
16020 pub disk_uri: std::string::String,
16021
16022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16023}
16024
16025impl PersistentDisk {
16026 /// Creates a new default instance.
16027 pub fn new() -> Self {
16028 std::default::Default::default()
16029 }
16030
16031 /// Sets the value of [source_disk_number][crate::model::PersistentDisk::source_disk_number].
16032 ///
16033 /// # Example
16034 /// ```ignore,no_run
16035 /// # use google_cloud_vmmigration_v1::model::PersistentDisk;
16036 /// let x = PersistentDisk::new().set_source_disk_number(42);
16037 /// ```
16038 pub fn set_source_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16039 self.source_disk_number = v.into();
16040 self
16041 }
16042
16043 /// Sets the value of [disk_uri][crate::model::PersistentDisk::disk_uri].
16044 ///
16045 /// # Example
16046 /// ```ignore,no_run
16047 /// # use google_cloud_vmmigration_v1::model::PersistentDisk;
16048 /// let x = PersistentDisk::new().set_disk_uri("example");
16049 /// ```
16050 pub fn set_disk_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16051 self.disk_uri = v.into();
16052 self
16053 }
16054}
16055
16056impl wkt::message::Message for PersistentDisk {
16057 fn typename() -> &'static str {
16058 "type.googleapis.com/google.cloud.vmmigration.v1.PersistentDisk"
16059 }
16060}
16061
16062/// Details for a disks-only migration.
16063#[derive(Clone, Default, PartialEq)]
16064#[non_exhaustive]
16065pub struct DisksMigrationDisksTargetDetails {
16066 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16067}
16068
16069impl DisksMigrationDisksTargetDetails {
16070 /// Creates a new default instance.
16071 pub fn new() -> Self {
16072 std::default::Default::default()
16073 }
16074}
16075
16076impl wkt::message::Message for DisksMigrationDisksTargetDetails {
16077 fn typename() -> &'static str {
16078 "type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetails"
16079 }
16080}
16081
16082/// Details for the VM created VM as part of disks migration.
16083#[derive(Clone, Default, PartialEq)]
16084#[non_exhaustive]
16085pub struct DisksMigrationVmTargetDetails {
16086 /// Output only. The URI of the Compute Engine VM.
16087 pub vm_uri: std::string::String,
16088
16089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16090}
16091
16092impl DisksMigrationVmTargetDetails {
16093 /// Creates a new default instance.
16094 pub fn new() -> Self {
16095 std::default::Default::default()
16096 }
16097
16098 /// Sets the value of [vm_uri][crate::model::DisksMigrationVmTargetDetails::vm_uri].
16099 ///
16100 /// # Example
16101 /// ```ignore,no_run
16102 /// # use google_cloud_vmmigration_v1::model::DisksMigrationVmTargetDetails;
16103 /// let x = DisksMigrationVmTargetDetails::new().set_vm_uri("example");
16104 /// ```
16105 pub fn set_vm_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16106 self.vm_uri = v.into();
16107 self
16108 }
16109}
16110
16111impl wkt::message::Message for DisksMigrationVmTargetDetails {
16112 fn typename() -> &'static str {
16113 "type.googleapis.com/google.cloud.vmmigration.v1.DisksMigrationVmTargetDetails"
16114 }
16115}
16116
16117/// A policy for scheduling replications.
16118#[derive(Clone, Default, PartialEq)]
16119#[non_exhaustive]
16120pub struct SchedulePolicy {
16121 /// The idle duration between replication stages.
16122 pub idle_duration: std::option::Option<wkt::Duration>,
16123
16124 /// A flag to indicate whether to skip OS adaptation during the replication
16125 /// sync. OS adaptation is a process where the VM's operating system undergoes
16126 /// changes and adaptations to fully function on Compute Engine.
16127 pub skip_os_adaptation: bool,
16128
16129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16130}
16131
16132impl SchedulePolicy {
16133 /// Creates a new default instance.
16134 pub fn new() -> Self {
16135 std::default::Default::default()
16136 }
16137
16138 /// Sets the value of [idle_duration][crate::model::SchedulePolicy::idle_duration].
16139 ///
16140 /// # Example
16141 /// ```ignore,no_run
16142 /// # use google_cloud_vmmigration_v1::model::SchedulePolicy;
16143 /// use wkt::Duration;
16144 /// let x = SchedulePolicy::new().set_idle_duration(Duration::default()/* use setters */);
16145 /// ```
16146 pub fn set_idle_duration<T>(mut self, v: T) -> Self
16147 where
16148 T: std::convert::Into<wkt::Duration>,
16149 {
16150 self.idle_duration = std::option::Option::Some(v.into());
16151 self
16152 }
16153
16154 /// Sets or clears the value of [idle_duration][crate::model::SchedulePolicy::idle_duration].
16155 ///
16156 /// # Example
16157 /// ```ignore,no_run
16158 /// # use google_cloud_vmmigration_v1::model::SchedulePolicy;
16159 /// use wkt::Duration;
16160 /// let x = SchedulePolicy::new().set_or_clear_idle_duration(Some(Duration::default()/* use setters */));
16161 /// let x = SchedulePolicy::new().set_or_clear_idle_duration(None::<Duration>);
16162 /// ```
16163 pub fn set_or_clear_idle_duration<T>(mut self, v: std::option::Option<T>) -> Self
16164 where
16165 T: std::convert::Into<wkt::Duration>,
16166 {
16167 self.idle_duration = v.map(|x| x.into());
16168 self
16169 }
16170
16171 /// Sets the value of [skip_os_adaptation][crate::model::SchedulePolicy::skip_os_adaptation].
16172 ///
16173 /// # Example
16174 /// ```ignore,no_run
16175 /// # use google_cloud_vmmigration_v1::model::SchedulePolicy;
16176 /// let x = SchedulePolicy::new().set_skip_os_adaptation(true);
16177 /// ```
16178 pub fn set_skip_os_adaptation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16179 self.skip_os_adaptation = v.into();
16180 self
16181 }
16182}
16183
16184impl wkt::message::Message for SchedulePolicy {
16185 fn typename() -> &'static str {
16186 "type.googleapis.com/google.cloud.vmmigration.v1.SchedulePolicy"
16187 }
16188}
16189
16190/// Request message for 'CreateMigratingVm' request.
16191#[derive(Clone, Default, PartialEq)]
16192#[non_exhaustive]
16193pub struct CreateMigratingVmRequest {
16194 /// Required. The MigratingVm's parent.
16195 pub parent: std::string::String,
16196
16197 /// Required. The migratingVm identifier.
16198 pub migrating_vm_id: std::string::String,
16199
16200 /// Required. The create request body.
16201 pub migrating_vm: std::option::Option<crate::model::MigratingVm>,
16202
16203 /// A request ID to identify requests. Specify a unique request ID
16204 /// so that if you must retry your request, the server will know to ignore
16205 /// the request if it has already been completed. The server will guarantee
16206 /// that for at least 60 minutes since the first request.
16207 ///
16208 /// For example, consider a situation where you make an initial request and
16209 /// the request times out. If you make the request again with the same request
16210 /// ID, the server can check if original operation with the same request ID
16211 /// was received, and if so, will ignore the second request. This prevents
16212 /// clients from accidentally creating duplicate commitments.
16213 ///
16214 /// The request ID must be a valid UUID with the exception that zero UUID is
16215 /// not supported (00000000-0000-0000-0000-000000000000).
16216 pub request_id: std::string::String,
16217
16218 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16219}
16220
16221impl CreateMigratingVmRequest {
16222 /// Creates a new default instance.
16223 pub fn new() -> Self {
16224 std::default::Default::default()
16225 }
16226
16227 /// Sets the value of [parent][crate::model::CreateMigratingVmRequest::parent].
16228 ///
16229 /// # Example
16230 /// ```ignore,no_run
16231 /// # use google_cloud_vmmigration_v1::model::CreateMigratingVmRequest;
16232 /// # let project_id = "project_id";
16233 /// # let location_id = "location_id";
16234 /// # let source_id = "source_id";
16235 /// let x = CreateMigratingVmRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
16236 /// ```
16237 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16238 self.parent = v.into();
16239 self
16240 }
16241
16242 /// Sets the value of [migrating_vm_id][crate::model::CreateMigratingVmRequest::migrating_vm_id].
16243 ///
16244 /// # Example
16245 /// ```ignore,no_run
16246 /// # use google_cloud_vmmigration_v1::model::CreateMigratingVmRequest;
16247 /// let x = CreateMigratingVmRequest::new().set_migrating_vm_id("example");
16248 /// ```
16249 pub fn set_migrating_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16250 self.migrating_vm_id = v.into();
16251 self
16252 }
16253
16254 /// Sets the value of [migrating_vm][crate::model::CreateMigratingVmRequest::migrating_vm].
16255 ///
16256 /// # Example
16257 /// ```ignore,no_run
16258 /// # use google_cloud_vmmigration_v1::model::CreateMigratingVmRequest;
16259 /// use google_cloud_vmmigration_v1::model::MigratingVm;
16260 /// let x = CreateMigratingVmRequest::new().set_migrating_vm(MigratingVm::default()/* use setters */);
16261 /// ```
16262 pub fn set_migrating_vm<T>(mut self, v: T) -> Self
16263 where
16264 T: std::convert::Into<crate::model::MigratingVm>,
16265 {
16266 self.migrating_vm = std::option::Option::Some(v.into());
16267 self
16268 }
16269
16270 /// Sets or clears the value of [migrating_vm][crate::model::CreateMigratingVmRequest::migrating_vm].
16271 ///
16272 /// # Example
16273 /// ```ignore,no_run
16274 /// # use google_cloud_vmmigration_v1::model::CreateMigratingVmRequest;
16275 /// use google_cloud_vmmigration_v1::model::MigratingVm;
16276 /// let x = CreateMigratingVmRequest::new().set_or_clear_migrating_vm(Some(MigratingVm::default()/* use setters */));
16277 /// let x = CreateMigratingVmRequest::new().set_or_clear_migrating_vm(None::<MigratingVm>);
16278 /// ```
16279 pub fn set_or_clear_migrating_vm<T>(mut self, v: std::option::Option<T>) -> Self
16280 where
16281 T: std::convert::Into<crate::model::MigratingVm>,
16282 {
16283 self.migrating_vm = v.map(|x| x.into());
16284 self
16285 }
16286
16287 /// Sets the value of [request_id][crate::model::CreateMigratingVmRequest::request_id].
16288 ///
16289 /// # Example
16290 /// ```ignore,no_run
16291 /// # use google_cloud_vmmigration_v1::model::CreateMigratingVmRequest;
16292 /// let x = CreateMigratingVmRequest::new().set_request_id("example");
16293 /// ```
16294 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16295 self.request_id = v.into();
16296 self
16297 }
16298}
16299
16300impl wkt::message::Message for CreateMigratingVmRequest {
16301 fn typename() -> &'static str {
16302 "type.googleapis.com/google.cloud.vmmigration.v1.CreateMigratingVmRequest"
16303 }
16304}
16305
16306/// Request message for 'LisMigratingVmsRequest' request.
16307#[derive(Clone, Default, PartialEq)]
16308#[non_exhaustive]
16309pub struct ListMigratingVmsRequest {
16310 /// Required. The parent, which owns this collection of MigratingVms.
16311 pub parent: std::string::String,
16312
16313 /// Optional. The maximum number of migrating VMs to return. The service may
16314 /// return fewer than this value. If unspecified, at most 500 migrating VMs
16315 /// will be returned. The maximum value is 1000; values above 1000 will be
16316 /// coerced to 1000.
16317 pub page_size: i32,
16318
16319 /// Required. A page token, received from a previous `ListMigratingVms` call.
16320 /// Provide this to retrieve the subsequent page.
16321 ///
16322 /// When paginating, all other parameters provided to `ListMigratingVms`
16323 /// must match the call that provided the page token.
16324 pub page_token: std::string::String,
16325
16326 /// Optional. The filter request.
16327 pub filter: std::string::String,
16328
16329 /// Optional. the order by fields for the result.
16330 pub order_by: std::string::String,
16331
16332 /// Optional. The level of details of each migrating VM.
16333 pub view: crate::model::MigratingVmView,
16334
16335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16336}
16337
16338impl ListMigratingVmsRequest {
16339 /// Creates a new default instance.
16340 pub fn new() -> Self {
16341 std::default::Default::default()
16342 }
16343
16344 /// Sets the value of [parent][crate::model::ListMigratingVmsRequest::parent].
16345 ///
16346 /// # Example
16347 /// ```ignore,no_run
16348 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsRequest;
16349 /// # let project_id = "project_id";
16350 /// # let location_id = "location_id";
16351 /// # let source_id = "source_id";
16352 /// let x = ListMigratingVmsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
16353 /// ```
16354 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16355 self.parent = v.into();
16356 self
16357 }
16358
16359 /// Sets the value of [page_size][crate::model::ListMigratingVmsRequest::page_size].
16360 ///
16361 /// # Example
16362 /// ```ignore,no_run
16363 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsRequest;
16364 /// let x = ListMigratingVmsRequest::new().set_page_size(42);
16365 /// ```
16366 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16367 self.page_size = v.into();
16368 self
16369 }
16370
16371 /// Sets the value of [page_token][crate::model::ListMigratingVmsRequest::page_token].
16372 ///
16373 /// # Example
16374 /// ```ignore,no_run
16375 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsRequest;
16376 /// let x = ListMigratingVmsRequest::new().set_page_token("example");
16377 /// ```
16378 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16379 self.page_token = v.into();
16380 self
16381 }
16382
16383 /// Sets the value of [filter][crate::model::ListMigratingVmsRequest::filter].
16384 ///
16385 /// # Example
16386 /// ```ignore,no_run
16387 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsRequest;
16388 /// let x = ListMigratingVmsRequest::new().set_filter("example");
16389 /// ```
16390 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16391 self.filter = v.into();
16392 self
16393 }
16394
16395 /// Sets the value of [order_by][crate::model::ListMigratingVmsRequest::order_by].
16396 ///
16397 /// # Example
16398 /// ```ignore,no_run
16399 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsRequest;
16400 /// let x = ListMigratingVmsRequest::new().set_order_by("example");
16401 /// ```
16402 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16403 self.order_by = v.into();
16404 self
16405 }
16406
16407 /// Sets the value of [view][crate::model::ListMigratingVmsRequest::view].
16408 ///
16409 /// # Example
16410 /// ```ignore,no_run
16411 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsRequest;
16412 /// use google_cloud_vmmigration_v1::model::MigratingVmView;
16413 /// let x0 = ListMigratingVmsRequest::new().set_view(MigratingVmView::Basic);
16414 /// let x1 = ListMigratingVmsRequest::new().set_view(MigratingVmView::Full);
16415 /// ```
16416 pub fn set_view<T: std::convert::Into<crate::model::MigratingVmView>>(mut self, v: T) -> Self {
16417 self.view = v.into();
16418 self
16419 }
16420}
16421
16422impl wkt::message::Message for ListMigratingVmsRequest {
16423 fn typename() -> &'static str {
16424 "type.googleapis.com/google.cloud.vmmigration.v1.ListMigratingVmsRequest"
16425 }
16426}
16427
16428/// Response message for 'ListMigratingVms' request.
16429#[derive(Clone, Default, PartialEq)]
16430#[non_exhaustive]
16431pub struct ListMigratingVmsResponse {
16432 /// Output only. The list of Migrating VMs response.
16433 pub migrating_vms: std::vec::Vec<crate::model::MigratingVm>,
16434
16435 /// Output only. A token, which can be sent as `page_token` to retrieve the
16436 /// next page. If this field is omitted, there are no subsequent pages.
16437 pub next_page_token: std::string::String,
16438
16439 /// Output only. Locations that could not be reached.
16440 pub unreachable: std::vec::Vec<std::string::String>,
16441
16442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16443}
16444
16445impl ListMigratingVmsResponse {
16446 /// Creates a new default instance.
16447 pub fn new() -> Self {
16448 std::default::Default::default()
16449 }
16450
16451 /// Sets the value of [migrating_vms][crate::model::ListMigratingVmsResponse::migrating_vms].
16452 ///
16453 /// # Example
16454 /// ```ignore,no_run
16455 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsResponse;
16456 /// use google_cloud_vmmigration_v1::model::MigratingVm;
16457 /// let x = ListMigratingVmsResponse::new()
16458 /// .set_migrating_vms([
16459 /// MigratingVm::default()/* use setters */,
16460 /// MigratingVm::default()/* use (different) setters */,
16461 /// ]);
16462 /// ```
16463 pub fn set_migrating_vms<T, V>(mut self, v: T) -> Self
16464 where
16465 T: std::iter::IntoIterator<Item = V>,
16466 V: std::convert::Into<crate::model::MigratingVm>,
16467 {
16468 use std::iter::Iterator;
16469 self.migrating_vms = v.into_iter().map(|i| i.into()).collect();
16470 self
16471 }
16472
16473 /// Sets the value of [next_page_token][crate::model::ListMigratingVmsResponse::next_page_token].
16474 ///
16475 /// # Example
16476 /// ```ignore,no_run
16477 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsResponse;
16478 /// let x = ListMigratingVmsResponse::new().set_next_page_token("example");
16479 /// ```
16480 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16481 self.next_page_token = v.into();
16482 self
16483 }
16484
16485 /// Sets the value of [unreachable][crate::model::ListMigratingVmsResponse::unreachable].
16486 ///
16487 /// # Example
16488 /// ```ignore,no_run
16489 /// # use google_cloud_vmmigration_v1::model::ListMigratingVmsResponse;
16490 /// let x = ListMigratingVmsResponse::new().set_unreachable(["a", "b", "c"]);
16491 /// ```
16492 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16493 where
16494 T: std::iter::IntoIterator<Item = V>,
16495 V: std::convert::Into<std::string::String>,
16496 {
16497 use std::iter::Iterator;
16498 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16499 self
16500 }
16501}
16502
16503impl wkt::message::Message for ListMigratingVmsResponse {
16504 fn typename() -> &'static str {
16505 "type.googleapis.com/google.cloud.vmmigration.v1.ListMigratingVmsResponse"
16506 }
16507}
16508
16509#[doc(hidden)]
16510impl google_cloud_gax::paginator::internal::PageableResponse for ListMigratingVmsResponse {
16511 type PageItem = crate::model::MigratingVm;
16512
16513 fn items(self) -> std::vec::Vec<Self::PageItem> {
16514 self.migrating_vms
16515 }
16516
16517 fn next_page_token(&self) -> std::string::String {
16518 use std::clone::Clone;
16519 self.next_page_token.clone()
16520 }
16521}
16522
16523/// Request message for 'GetMigratingVm' request.
16524#[derive(Clone, Default, PartialEq)]
16525#[non_exhaustive]
16526pub struct GetMigratingVmRequest {
16527 /// Required. The name of the MigratingVm.
16528 pub name: std::string::String,
16529
16530 /// Optional. The level of details of the migrating VM.
16531 pub view: crate::model::MigratingVmView,
16532
16533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16534}
16535
16536impl GetMigratingVmRequest {
16537 /// Creates a new default instance.
16538 pub fn new() -> Self {
16539 std::default::Default::default()
16540 }
16541
16542 /// Sets the value of [name][crate::model::GetMigratingVmRequest::name].
16543 ///
16544 /// # Example
16545 /// ```ignore,no_run
16546 /// # use google_cloud_vmmigration_v1::model::GetMigratingVmRequest;
16547 /// # let project_id = "project_id";
16548 /// # let location_id = "location_id";
16549 /// # let source_id = "source_id";
16550 /// # let migrating_vm_id = "migrating_vm_id";
16551 /// let x = GetMigratingVmRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16552 /// ```
16553 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16554 self.name = v.into();
16555 self
16556 }
16557
16558 /// Sets the value of [view][crate::model::GetMigratingVmRequest::view].
16559 ///
16560 /// # Example
16561 /// ```ignore,no_run
16562 /// # use google_cloud_vmmigration_v1::model::GetMigratingVmRequest;
16563 /// use google_cloud_vmmigration_v1::model::MigratingVmView;
16564 /// let x0 = GetMigratingVmRequest::new().set_view(MigratingVmView::Basic);
16565 /// let x1 = GetMigratingVmRequest::new().set_view(MigratingVmView::Full);
16566 /// ```
16567 pub fn set_view<T: std::convert::Into<crate::model::MigratingVmView>>(mut self, v: T) -> Self {
16568 self.view = v.into();
16569 self
16570 }
16571}
16572
16573impl wkt::message::Message for GetMigratingVmRequest {
16574 fn typename() -> &'static str {
16575 "type.googleapis.com/google.cloud.vmmigration.v1.GetMigratingVmRequest"
16576 }
16577}
16578
16579/// Request message for 'UpdateMigratingVm' request.
16580#[derive(Clone, Default, PartialEq)]
16581#[non_exhaustive]
16582pub struct UpdateMigratingVmRequest {
16583 /// Field mask is used to specify the fields to be overwritten in the
16584 /// MigratingVm resource by the update.
16585 /// The fields specified in the update_mask are relative to the resource, not
16586 /// the full request. A field will be overwritten if it is in the mask. If the
16587 /// user does not provide a mask then all fields will be overwritten.
16588 pub update_mask: std::option::Option<wkt::FieldMask>,
16589
16590 /// Required. The update request body.
16591 pub migrating_vm: std::option::Option<crate::model::MigratingVm>,
16592
16593 /// A request ID to identify requests. Specify a unique request ID
16594 /// so that if you must retry your request, the server will know to ignore
16595 /// the request if it has already been completed. The server will guarantee
16596 /// that for at least 60 minutes since the first request.
16597 ///
16598 /// For example, consider a situation where you make an initial request and
16599 /// the request times out. If you make the request again with the same request
16600 /// ID, the server can check if original operation with the same request ID
16601 /// was received, and if so, will ignore the second request. This prevents
16602 /// clients from accidentally creating duplicate commitments.
16603 ///
16604 /// The request ID must be a valid UUID with the exception that zero UUID is
16605 /// not supported (00000000-0000-0000-0000-000000000000).
16606 pub request_id: std::string::String,
16607
16608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16609}
16610
16611impl UpdateMigratingVmRequest {
16612 /// Creates a new default instance.
16613 pub fn new() -> Self {
16614 std::default::Default::default()
16615 }
16616
16617 /// Sets the value of [update_mask][crate::model::UpdateMigratingVmRequest::update_mask].
16618 ///
16619 /// # Example
16620 /// ```ignore,no_run
16621 /// # use google_cloud_vmmigration_v1::model::UpdateMigratingVmRequest;
16622 /// use wkt::FieldMask;
16623 /// let x = UpdateMigratingVmRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16624 /// ```
16625 pub fn set_update_mask<T>(mut self, v: T) -> Self
16626 where
16627 T: std::convert::Into<wkt::FieldMask>,
16628 {
16629 self.update_mask = std::option::Option::Some(v.into());
16630 self
16631 }
16632
16633 /// Sets or clears the value of [update_mask][crate::model::UpdateMigratingVmRequest::update_mask].
16634 ///
16635 /// # Example
16636 /// ```ignore,no_run
16637 /// # use google_cloud_vmmigration_v1::model::UpdateMigratingVmRequest;
16638 /// use wkt::FieldMask;
16639 /// let x = UpdateMigratingVmRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16640 /// let x = UpdateMigratingVmRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16641 /// ```
16642 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16643 where
16644 T: std::convert::Into<wkt::FieldMask>,
16645 {
16646 self.update_mask = v.map(|x| x.into());
16647 self
16648 }
16649
16650 /// Sets the value of [migrating_vm][crate::model::UpdateMigratingVmRequest::migrating_vm].
16651 ///
16652 /// # Example
16653 /// ```ignore,no_run
16654 /// # use google_cloud_vmmigration_v1::model::UpdateMigratingVmRequest;
16655 /// use google_cloud_vmmigration_v1::model::MigratingVm;
16656 /// let x = UpdateMigratingVmRequest::new().set_migrating_vm(MigratingVm::default()/* use setters */);
16657 /// ```
16658 pub fn set_migrating_vm<T>(mut self, v: T) -> Self
16659 where
16660 T: std::convert::Into<crate::model::MigratingVm>,
16661 {
16662 self.migrating_vm = std::option::Option::Some(v.into());
16663 self
16664 }
16665
16666 /// Sets or clears the value of [migrating_vm][crate::model::UpdateMigratingVmRequest::migrating_vm].
16667 ///
16668 /// # Example
16669 /// ```ignore,no_run
16670 /// # use google_cloud_vmmigration_v1::model::UpdateMigratingVmRequest;
16671 /// use google_cloud_vmmigration_v1::model::MigratingVm;
16672 /// let x = UpdateMigratingVmRequest::new().set_or_clear_migrating_vm(Some(MigratingVm::default()/* use setters */));
16673 /// let x = UpdateMigratingVmRequest::new().set_or_clear_migrating_vm(None::<MigratingVm>);
16674 /// ```
16675 pub fn set_or_clear_migrating_vm<T>(mut self, v: std::option::Option<T>) -> Self
16676 where
16677 T: std::convert::Into<crate::model::MigratingVm>,
16678 {
16679 self.migrating_vm = v.map(|x| x.into());
16680 self
16681 }
16682
16683 /// Sets the value of [request_id][crate::model::UpdateMigratingVmRequest::request_id].
16684 ///
16685 /// # Example
16686 /// ```ignore,no_run
16687 /// # use google_cloud_vmmigration_v1::model::UpdateMigratingVmRequest;
16688 /// let x = UpdateMigratingVmRequest::new().set_request_id("example");
16689 /// ```
16690 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16691 self.request_id = v.into();
16692 self
16693 }
16694}
16695
16696impl wkt::message::Message for UpdateMigratingVmRequest {
16697 fn typename() -> &'static str {
16698 "type.googleapis.com/google.cloud.vmmigration.v1.UpdateMigratingVmRequest"
16699 }
16700}
16701
16702/// Request message for 'DeleteMigratingVm' request.
16703#[derive(Clone, Default, PartialEq)]
16704#[non_exhaustive]
16705pub struct DeleteMigratingVmRequest {
16706 /// Required. The name of the MigratingVm.
16707 pub name: std::string::String,
16708
16709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16710}
16711
16712impl DeleteMigratingVmRequest {
16713 /// Creates a new default instance.
16714 pub fn new() -> Self {
16715 std::default::Default::default()
16716 }
16717
16718 /// Sets the value of [name][crate::model::DeleteMigratingVmRequest::name].
16719 ///
16720 /// # Example
16721 /// ```ignore,no_run
16722 /// # use google_cloud_vmmigration_v1::model::DeleteMigratingVmRequest;
16723 /// # let project_id = "project_id";
16724 /// # let location_id = "location_id";
16725 /// # let source_id = "source_id";
16726 /// # let migrating_vm_id = "migrating_vm_id";
16727 /// let x = DeleteMigratingVmRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16728 /// ```
16729 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16730 self.name = v.into();
16731 self
16732 }
16733}
16734
16735impl wkt::message::Message for DeleteMigratingVmRequest {
16736 fn typename() -> &'static str {
16737 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteMigratingVmRequest"
16738 }
16739}
16740
16741/// Request message for 'StartMigrationRequest' request.
16742#[derive(Clone, Default, PartialEq)]
16743#[non_exhaustive]
16744pub struct StartMigrationRequest {
16745 /// Required. The name of the MigratingVm.
16746 pub migrating_vm: std::string::String,
16747
16748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16749}
16750
16751impl StartMigrationRequest {
16752 /// Creates a new default instance.
16753 pub fn new() -> Self {
16754 std::default::Default::default()
16755 }
16756
16757 /// Sets the value of [migrating_vm][crate::model::StartMigrationRequest::migrating_vm].
16758 ///
16759 /// # Example
16760 /// ```ignore,no_run
16761 /// # use google_cloud_vmmigration_v1::model::StartMigrationRequest;
16762 /// # let project_id = "project_id";
16763 /// # let location_id = "location_id";
16764 /// # let source_id = "source_id";
16765 /// # let migrating_vm_id = "migrating_vm_id";
16766 /// let x = StartMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16767 /// ```
16768 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16769 self.migrating_vm = v.into();
16770 self
16771 }
16772}
16773
16774impl wkt::message::Message for StartMigrationRequest {
16775 fn typename() -> &'static str {
16776 "type.googleapis.com/google.cloud.vmmigration.v1.StartMigrationRequest"
16777 }
16778}
16779
16780/// Response message for 'StartMigration' request.
16781#[derive(Clone, Default, PartialEq)]
16782#[non_exhaustive]
16783pub struct StartMigrationResponse {
16784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16785}
16786
16787impl StartMigrationResponse {
16788 /// Creates a new default instance.
16789 pub fn new() -> Self {
16790 std::default::Default::default()
16791 }
16792}
16793
16794impl wkt::message::Message for StartMigrationResponse {
16795 fn typename() -> &'static str {
16796 "type.googleapis.com/google.cloud.vmmigration.v1.StartMigrationResponse"
16797 }
16798}
16799
16800/// Request message for 'PauseMigration' request.
16801#[derive(Clone, Default, PartialEq)]
16802#[non_exhaustive]
16803pub struct PauseMigrationRequest {
16804 /// Required. The name of the MigratingVm.
16805 pub migrating_vm: std::string::String,
16806
16807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16808}
16809
16810impl PauseMigrationRequest {
16811 /// Creates a new default instance.
16812 pub fn new() -> Self {
16813 std::default::Default::default()
16814 }
16815
16816 /// Sets the value of [migrating_vm][crate::model::PauseMigrationRequest::migrating_vm].
16817 ///
16818 /// # Example
16819 /// ```ignore,no_run
16820 /// # use google_cloud_vmmigration_v1::model::PauseMigrationRequest;
16821 /// # let project_id = "project_id";
16822 /// # let location_id = "location_id";
16823 /// # let source_id = "source_id";
16824 /// # let migrating_vm_id = "migrating_vm_id";
16825 /// let x = PauseMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16826 /// ```
16827 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16828 self.migrating_vm = v.into();
16829 self
16830 }
16831}
16832
16833impl wkt::message::Message for PauseMigrationRequest {
16834 fn typename() -> &'static str {
16835 "type.googleapis.com/google.cloud.vmmigration.v1.PauseMigrationRequest"
16836 }
16837}
16838
16839/// Response message for 'PauseMigration' request.
16840#[derive(Clone, Default, PartialEq)]
16841#[non_exhaustive]
16842pub struct PauseMigrationResponse {
16843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16844}
16845
16846impl PauseMigrationResponse {
16847 /// Creates a new default instance.
16848 pub fn new() -> Self {
16849 std::default::Default::default()
16850 }
16851}
16852
16853impl wkt::message::Message for PauseMigrationResponse {
16854 fn typename() -> &'static str {
16855 "type.googleapis.com/google.cloud.vmmigration.v1.PauseMigrationResponse"
16856 }
16857}
16858
16859/// Request message for 'ResumeMigration' request.
16860#[derive(Clone, Default, PartialEq)]
16861#[non_exhaustive]
16862pub struct ResumeMigrationRequest {
16863 /// Required. The name of the MigratingVm.
16864 pub migrating_vm: std::string::String,
16865
16866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16867}
16868
16869impl ResumeMigrationRequest {
16870 /// Creates a new default instance.
16871 pub fn new() -> Self {
16872 std::default::Default::default()
16873 }
16874
16875 /// Sets the value of [migrating_vm][crate::model::ResumeMigrationRequest::migrating_vm].
16876 ///
16877 /// # Example
16878 /// ```ignore,no_run
16879 /// # use google_cloud_vmmigration_v1::model::ResumeMigrationRequest;
16880 /// # let project_id = "project_id";
16881 /// # let location_id = "location_id";
16882 /// # let source_id = "source_id";
16883 /// # let migrating_vm_id = "migrating_vm_id";
16884 /// let x = ResumeMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16885 /// ```
16886 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16887 self.migrating_vm = v.into();
16888 self
16889 }
16890}
16891
16892impl wkt::message::Message for ResumeMigrationRequest {
16893 fn typename() -> &'static str {
16894 "type.googleapis.com/google.cloud.vmmigration.v1.ResumeMigrationRequest"
16895 }
16896}
16897
16898/// Response message for 'ResumeMigration' request.
16899#[derive(Clone, Default, PartialEq)]
16900#[non_exhaustive]
16901pub struct ResumeMigrationResponse {
16902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16903}
16904
16905impl ResumeMigrationResponse {
16906 /// Creates a new default instance.
16907 pub fn new() -> Self {
16908 std::default::Default::default()
16909 }
16910}
16911
16912impl wkt::message::Message for ResumeMigrationResponse {
16913 fn typename() -> &'static str {
16914 "type.googleapis.com/google.cloud.vmmigration.v1.ResumeMigrationResponse"
16915 }
16916}
16917
16918/// Request message for 'FinalizeMigration' request.
16919#[derive(Clone, Default, PartialEq)]
16920#[non_exhaustive]
16921pub struct FinalizeMigrationRequest {
16922 /// Required. The name of the MigratingVm.
16923 pub migrating_vm: std::string::String,
16924
16925 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16926}
16927
16928impl FinalizeMigrationRequest {
16929 /// Creates a new default instance.
16930 pub fn new() -> Self {
16931 std::default::Default::default()
16932 }
16933
16934 /// Sets the value of [migrating_vm][crate::model::FinalizeMigrationRequest::migrating_vm].
16935 ///
16936 /// # Example
16937 /// ```ignore,no_run
16938 /// # use google_cloud_vmmigration_v1::model::FinalizeMigrationRequest;
16939 /// # let project_id = "project_id";
16940 /// # let location_id = "location_id";
16941 /// # let source_id = "source_id";
16942 /// # let migrating_vm_id = "migrating_vm_id";
16943 /// let x = FinalizeMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16944 /// ```
16945 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16946 self.migrating_vm = v.into();
16947 self
16948 }
16949}
16950
16951impl wkt::message::Message for FinalizeMigrationRequest {
16952 fn typename() -> &'static str {
16953 "type.googleapis.com/google.cloud.vmmigration.v1.FinalizeMigrationRequest"
16954 }
16955}
16956
16957/// Request message for 'ExtendMigrationRequest' request.
16958#[derive(Clone, Default, PartialEq)]
16959#[non_exhaustive]
16960pub struct ExtendMigrationRequest {
16961 /// Required. The name of the MigratingVm.
16962 pub migrating_vm: std::string::String,
16963
16964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16965}
16966
16967impl ExtendMigrationRequest {
16968 /// Creates a new default instance.
16969 pub fn new() -> Self {
16970 std::default::Default::default()
16971 }
16972
16973 /// Sets the value of [migrating_vm][crate::model::ExtendMigrationRequest::migrating_vm].
16974 ///
16975 /// # Example
16976 /// ```ignore,no_run
16977 /// # use google_cloud_vmmigration_v1::model::ExtendMigrationRequest;
16978 /// # let project_id = "project_id";
16979 /// # let location_id = "location_id";
16980 /// # let source_id = "source_id";
16981 /// # let migrating_vm_id = "migrating_vm_id";
16982 /// let x = ExtendMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
16983 /// ```
16984 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16985 self.migrating_vm = v.into();
16986 self
16987 }
16988}
16989
16990impl wkt::message::Message for ExtendMigrationRequest {
16991 fn typename() -> &'static str {
16992 "type.googleapis.com/google.cloud.vmmigration.v1.ExtendMigrationRequest"
16993 }
16994}
16995
16996/// Response message for 'ExtendMigration' request.
16997#[derive(Clone, Default, PartialEq)]
16998#[non_exhaustive]
16999pub struct ExtendMigrationResponse {
17000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17001}
17002
17003impl ExtendMigrationResponse {
17004 /// Creates a new default instance.
17005 pub fn new() -> Self {
17006 std::default::Default::default()
17007 }
17008}
17009
17010impl wkt::message::Message for ExtendMigrationResponse {
17011 fn typename() -> &'static str {
17012 "type.googleapis.com/google.cloud.vmmigration.v1.ExtendMigrationResponse"
17013 }
17014}
17015
17016/// Response message for 'FinalizeMigration' request.
17017#[derive(Clone, Default, PartialEq)]
17018#[non_exhaustive]
17019pub struct FinalizeMigrationResponse {
17020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17021}
17022
17023impl FinalizeMigrationResponse {
17024 /// Creates a new default instance.
17025 pub fn new() -> Self {
17026 std::default::Default::default()
17027 }
17028}
17029
17030impl wkt::message::Message for FinalizeMigrationResponse {
17031 fn typename() -> &'static str {
17032 "type.googleapis.com/google.cloud.vmmigration.v1.FinalizeMigrationResponse"
17033 }
17034}
17035
17036/// TargetProject message represents a target Compute Engine project for a
17037/// migration or a clone.
17038#[derive(Clone, Default, PartialEq)]
17039#[non_exhaustive]
17040pub struct TargetProject {
17041 /// Output only. The name of the target project.
17042 pub name: std::string::String,
17043
17044 /// Required. The target project ID (number) or project name.
17045 pub project: std::string::String,
17046
17047 /// The target project's description.
17048 pub description: std::string::String,
17049
17050 /// Output only. The time this target project resource was created (not related
17051 /// to when the Compute Engine project it points to was created).
17052 pub create_time: std::option::Option<wkt::Timestamp>,
17053
17054 /// Output only. The last time the target project resource was updated.
17055 pub update_time: std::option::Option<wkt::Timestamp>,
17056
17057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17058}
17059
17060impl TargetProject {
17061 /// Creates a new default instance.
17062 pub fn new() -> Self {
17063 std::default::Default::default()
17064 }
17065
17066 /// Sets the value of [name][crate::model::TargetProject::name].
17067 ///
17068 /// # Example
17069 /// ```ignore,no_run
17070 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17071 /// # let project_id = "project_id";
17072 /// # let location_id = "location_id";
17073 /// # let target_project_id = "target_project_id";
17074 /// let x = TargetProject::new().set_name(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
17075 /// ```
17076 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17077 self.name = v.into();
17078 self
17079 }
17080
17081 /// Sets the value of [project][crate::model::TargetProject::project].
17082 ///
17083 /// # Example
17084 /// ```ignore,no_run
17085 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17086 /// let x = TargetProject::new().set_project("example");
17087 /// ```
17088 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17089 self.project = v.into();
17090 self
17091 }
17092
17093 /// Sets the value of [description][crate::model::TargetProject::description].
17094 ///
17095 /// # Example
17096 /// ```ignore,no_run
17097 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17098 /// let x = TargetProject::new().set_description("example");
17099 /// ```
17100 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17101 self.description = v.into();
17102 self
17103 }
17104
17105 /// Sets the value of [create_time][crate::model::TargetProject::create_time].
17106 ///
17107 /// # Example
17108 /// ```ignore,no_run
17109 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17110 /// use wkt::Timestamp;
17111 /// let x = TargetProject::new().set_create_time(Timestamp::default()/* use setters */);
17112 /// ```
17113 pub fn set_create_time<T>(mut self, v: T) -> Self
17114 where
17115 T: std::convert::Into<wkt::Timestamp>,
17116 {
17117 self.create_time = std::option::Option::Some(v.into());
17118 self
17119 }
17120
17121 /// Sets or clears the value of [create_time][crate::model::TargetProject::create_time].
17122 ///
17123 /// # Example
17124 /// ```ignore,no_run
17125 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17126 /// use wkt::Timestamp;
17127 /// let x = TargetProject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17128 /// let x = TargetProject::new().set_or_clear_create_time(None::<Timestamp>);
17129 /// ```
17130 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17131 where
17132 T: std::convert::Into<wkt::Timestamp>,
17133 {
17134 self.create_time = v.map(|x| x.into());
17135 self
17136 }
17137
17138 /// Sets the value of [update_time][crate::model::TargetProject::update_time].
17139 ///
17140 /// # Example
17141 /// ```ignore,no_run
17142 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17143 /// use wkt::Timestamp;
17144 /// let x = TargetProject::new().set_update_time(Timestamp::default()/* use setters */);
17145 /// ```
17146 pub fn set_update_time<T>(mut self, v: T) -> Self
17147 where
17148 T: std::convert::Into<wkt::Timestamp>,
17149 {
17150 self.update_time = std::option::Option::Some(v.into());
17151 self
17152 }
17153
17154 /// Sets or clears the value of [update_time][crate::model::TargetProject::update_time].
17155 ///
17156 /// # Example
17157 /// ```ignore,no_run
17158 /// # use google_cloud_vmmigration_v1::model::TargetProject;
17159 /// use wkt::Timestamp;
17160 /// let x = TargetProject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17161 /// let x = TargetProject::new().set_or_clear_update_time(None::<Timestamp>);
17162 /// ```
17163 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17164 where
17165 T: std::convert::Into<wkt::Timestamp>,
17166 {
17167 self.update_time = v.map(|x| x.into());
17168 self
17169 }
17170}
17171
17172impl wkt::message::Message for TargetProject {
17173 fn typename() -> &'static str {
17174 "type.googleapis.com/google.cloud.vmmigration.v1.TargetProject"
17175 }
17176}
17177
17178/// Request message for 'GetTargetProject' call.
17179#[derive(Clone, Default, PartialEq)]
17180#[non_exhaustive]
17181pub struct GetTargetProjectRequest {
17182 /// Required. The TargetProject name.
17183 pub name: std::string::String,
17184
17185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17186}
17187
17188impl GetTargetProjectRequest {
17189 /// Creates a new default instance.
17190 pub fn new() -> Self {
17191 std::default::Default::default()
17192 }
17193
17194 /// Sets the value of [name][crate::model::GetTargetProjectRequest::name].
17195 ///
17196 /// # Example
17197 /// ```ignore,no_run
17198 /// # use google_cloud_vmmigration_v1::model::GetTargetProjectRequest;
17199 /// # let project_id = "project_id";
17200 /// # let location_id = "location_id";
17201 /// # let target_project_id = "target_project_id";
17202 /// let x = GetTargetProjectRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
17203 /// ```
17204 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17205 self.name = v.into();
17206 self
17207 }
17208}
17209
17210impl wkt::message::Message for GetTargetProjectRequest {
17211 fn typename() -> &'static str {
17212 "type.googleapis.com/google.cloud.vmmigration.v1.GetTargetProjectRequest"
17213 }
17214}
17215
17216/// Request message for 'ListTargetProjects' call.
17217#[derive(Clone, Default, PartialEq)]
17218#[non_exhaustive]
17219pub struct ListTargetProjectsRequest {
17220 /// Required. The parent, which owns this collection of targets.
17221 pub parent: std::string::String,
17222
17223 /// Optional. The maximum number of targets to return. The service may return
17224 /// fewer than this value. If unspecified, at most 500 targets will be
17225 /// returned. The maximum value is 1000; values above 1000 will be coerced to
17226 /// 1000.
17227 pub page_size: i32,
17228
17229 /// Required. A page token, received from a previous `ListTargets` call.
17230 /// Provide this to retrieve the subsequent page.
17231 ///
17232 /// When paginating, all other parameters provided to `ListTargets` must
17233 /// match the call that provided the page token.
17234 pub page_token: std::string::String,
17235
17236 /// Optional. The filter request.
17237 pub filter: std::string::String,
17238
17239 /// Optional. the order by fields for the result.
17240 pub order_by: std::string::String,
17241
17242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17243}
17244
17245impl ListTargetProjectsRequest {
17246 /// Creates a new default instance.
17247 pub fn new() -> Self {
17248 std::default::Default::default()
17249 }
17250
17251 /// Sets the value of [parent][crate::model::ListTargetProjectsRequest::parent].
17252 ///
17253 /// # Example
17254 /// ```ignore,no_run
17255 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsRequest;
17256 /// # let project_id = "project_id";
17257 /// # let location_id = "location_id";
17258 /// let x = ListTargetProjectsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17259 /// ```
17260 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17261 self.parent = v.into();
17262 self
17263 }
17264
17265 /// Sets the value of [page_size][crate::model::ListTargetProjectsRequest::page_size].
17266 ///
17267 /// # Example
17268 /// ```ignore,no_run
17269 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsRequest;
17270 /// let x = ListTargetProjectsRequest::new().set_page_size(42);
17271 /// ```
17272 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17273 self.page_size = v.into();
17274 self
17275 }
17276
17277 /// Sets the value of [page_token][crate::model::ListTargetProjectsRequest::page_token].
17278 ///
17279 /// # Example
17280 /// ```ignore,no_run
17281 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsRequest;
17282 /// let x = ListTargetProjectsRequest::new().set_page_token("example");
17283 /// ```
17284 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17285 self.page_token = v.into();
17286 self
17287 }
17288
17289 /// Sets the value of [filter][crate::model::ListTargetProjectsRequest::filter].
17290 ///
17291 /// # Example
17292 /// ```ignore,no_run
17293 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsRequest;
17294 /// let x = ListTargetProjectsRequest::new().set_filter("example");
17295 /// ```
17296 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17297 self.filter = v.into();
17298 self
17299 }
17300
17301 /// Sets the value of [order_by][crate::model::ListTargetProjectsRequest::order_by].
17302 ///
17303 /// # Example
17304 /// ```ignore,no_run
17305 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsRequest;
17306 /// let x = ListTargetProjectsRequest::new().set_order_by("example");
17307 /// ```
17308 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17309 self.order_by = v.into();
17310 self
17311 }
17312}
17313
17314impl wkt::message::Message for ListTargetProjectsRequest {
17315 fn typename() -> &'static str {
17316 "type.googleapis.com/google.cloud.vmmigration.v1.ListTargetProjectsRequest"
17317 }
17318}
17319
17320/// Response message for 'ListTargetProjects' call.
17321#[derive(Clone, Default, PartialEq)]
17322#[non_exhaustive]
17323pub struct ListTargetProjectsResponse {
17324 /// Output only. The list of target response.
17325 pub target_projects: std::vec::Vec<crate::model::TargetProject>,
17326
17327 /// Output only. A token, which can be sent as `page_token` to retrieve the
17328 /// next page. If this field is omitted, there are no subsequent pages.
17329 pub next_page_token: std::string::String,
17330
17331 /// Output only. Locations that could not be reached.
17332 pub unreachable: std::vec::Vec<std::string::String>,
17333
17334 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17335}
17336
17337impl ListTargetProjectsResponse {
17338 /// Creates a new default instance.
17339 pub fn new() -> Self {
17340 std::default::Default::default()
17341 }
17342
17343 /// Sets the value of [target_projects][crate::model::ListTargetProjectsResponse::target_projects].
17344 ///
17345 /// # Example
17346 /// ```ignore,no_run
17347 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsResponse;
17348 /// use google_cloud_vmmigration_v1::model::TargetProject;
17349 /// let x = ListTargetProjectsResponse::new()
17350 /// .set_target_projects([
17351 /// TargetProject::default()/* use setters */,
17352 /// TargetProject::default()/* use (different) setters */,
17353 /// ]);
17354 /// ```
17355 pub fn set_target_projects<T, V>(mut self, v: T) -> Self
17356 where
17357 T: std::iter::IntoIterator<Item = V>,
17358 V: std::convert::Into<crate::model::TargetProject>,
17359 {
17360 use std::iter::Iterator;
17361 self.target_projects = v.into_iter().map(|i| i.into()).collect();
17362 self
17363 }
17364
17365 /// Sets the value of [next_page_token][crate::model::ListTargetProjectsResponse::next_page_token].
17366 ///
17367 /// # Example
17368 /// ```ignore,no_run
17369 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsResponse;
17370 /// let x = ListTargetProjectsResponse::new().set_next_page_token("example");
17371 /// ```
17372 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17373 self.next_page_token = v.into();
17374 self
17375 }
17376
17377 /// Sets the value of [unreachable][crate::model::ListTargetProjectsResponse::unreachable].
17378 ///
17379 /// # Example
17380 /// ```ignore,no_run
17381 /// # use google_cloud_vmmigration_v1::model::ListTargetProjectsResponse;
17382 /// let x = ListTargetProjectsResponse::new().set_unreachable(["a", "b", "c"]);
17383 /// ```
17384 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17385 where
17386 T: std::iter::IntoIterator<Item = V>,
17387 V: std::convert::Into<std::string::String>,
17388 {
17389 use std::iter::Iterator;
17390 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17391 self
17392 }
17393}
17394
17395impl wkt::message::Message for ListTargetProjectsResponse {
17396 fn typename() -> &'static str {
17397 "type.googleapis.com/google.cloud.vmmigration.v1.ListTargetProjectsResponse"
17398 }
17399}
17400
17401#[doc(hidden)]
17402impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetProjectsResponse {
17403 type PageItem = crate::model::TargetProject;
17404
17405 fn items(self) -> std::vec::Vec<Self::PageItem> {
17406 self.target_projects
17407 }
17408
17409 fn next_page_token(&self) -> std::string::String {
17410 use std::clone::Clone;
17411 self.next_page_token.clone()
17412 }
17413}
17414
17415/// Request message for 'CreateTargetProject' request.
17416#[derive(Clone, Default, PartialEq)]
17417#[non_exhaustive]
17418pub struct CreateTargetProjectRequest {
17419 /// Required. The TargetProject's parent.
17420 pub parent: std::string::String,
17421
17422 /// Required. The target_project identifier.
17423 pub target_project_id: std::string::String,
17424
17425 /// Required. The create request body.
17426 pub target_project: std::option::Option<crate::model::TargetProject>,
17427
17428 /// A request ID to identify requests. Specify a unique request ID
17429 /// so that if you must retry your request, the server will know to ignore
17430 /// the request if it has already been completed. The server will guarantee
17431 /// that for at least 60 minutes since the first request.
17432 ///
17433 /// For example, consider a situation where you make an initial request and
17434 /// the request times out. If you make the request again with the same request
17435 /// ID, the server can check if original operation with the same request ID
17436 /// was received, and if so, will ignore the second request. This prevents
17437 /// clients from accidentally creating duplicate commitments.
17438 ///
17439 /// The request ID must be a valid UUID with the exception that zero UUID is
17440 /// not supported (00000000-0000-0000-0000-000000000000).
17441 pub request_id: std::string::String,
17442
17443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17444}
17445
17446impl CreateTargetProjectRequest {
17447 /// Creates a new default instance.
17448 pub fn new() -> Self {
17449 std::default::Default::default()
17450 }
17451
17452 /// Sets the value of [parent][crate::model::CreateTargetProjectRequest::parent].
17453 ///
17454 /// # Example
17455 /// ```ignore,no_run
17456 /// # use google_cloud_vmmigration_v1::model::CreateTargetProjectRequest;
17457 /// # let project_id = "project_id";
17458 /// # let location_id = "location_id";
17459 /// let x = CreateTargetProjectRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17460 /// ```
17461 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17462 self.parent = v.into();
17463 self
17464 }
17465
17466 /// Sets the value of [target_project_id][crate::model::CreateTargetProjectRequest::target_project_id].
17467 ///
17468 /// # Example
17469 /// ```ignore,no_run
17470 /// # use google_cloud_vmmigration_v1::model::CreateTargetProjectRequest;
17471 /// let x = CreateTargetProjectRequest::new().set_target_project_id("example");
17472 /// ```
17473 pub fn set_target_project_id<T: std::convert::Into<std::string::String>>(
17474 mut self,
17475 v: T,
17476 ) -> Self {
17477 self.target_project_id = v.into();
17478 self
17479 }
17480
17481 /// Sets the value of [target_project][crate::model::CreateTargetProjectRequest::target_project].
17482 ///
17483 /// # Example
17484 /// ```ignore,no_run
17485 /// # use google_cloud_vmmigration_v1::model::CreateTargetProjectRequest;
17486 /// use google_cloud_vmmigration_v1::model::TargetProject;
17487 /// let x = CreateTargetProjectRequest::new().set_target_project(TargetProject::default()/* use setters */);
17488 /// ```
17489 pub fn set_target_project<T>(mut self, v: T) -> Self
17490 where
17491 T: std::convert::Into<crate::model::TargetProject>,
17492 {
17493 self.target_project = std::option::Option::Some(v.into());
17494 self
17495 }
17496
17497 /// Sets or clears the value of [target_project][crate::model::CreateTargetProjectRequest::target_project].
17498 ///
17499 /// # Example
17500 /// ```ignore,no_run
17501 /// # use google_cloud_vmmigration_v1::model::CreateTargetProjectRequest;
17502 /// use google_cloud_vmmigration_v1::model::TargetProject;
17503 /// let x = CreateTargetProjectRequest::new().set_or_clear_target_project(Some(TargetProject::default()/* use setters */));
17504 /// let x = CreateTargetProjectRequest::new().set_or_clear_target_project(None::<TargetProject>);
17505 /// ```
17506 pub fn set_or_clear_target_project<T>(mut self, v: std::option::Option<T>) -> Self
17507 where
17508 T: std::convert::Into<crate::model::TargetProject>,
17509 {
17510 self.target_project = v.map(|x| x.into());
17511 self
17512 }
17513
17514 /// Sets the value of [request_id][crate::model::CreateTargetProjectRequest::request_id].
17515 ///
17516 /// # Example
17517 /// ```ignore,no_run
17518 /// # use google_cloud_vmmigration_v1::model::CreateTargetProjectRequest;
17519 /// let x = CreateTargetProjectRequest::new().set_request_id("example");
17520 /// ```
17521 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17522 self.request_id = v.into();
17523 self
17524 }
17525}
17526
17527impl wkt::message::Message for CreateTargetProjectRequest {
17528 fn typename() -> &'static str {
17529 "type.googleapis.com/google.cloud.vmmigration.v1.CreateTargetProjectRequest"
17530 }
17531}
17532
17533/// Update message for 'UpdateTargetProject' request.
17534#[derive(Clone, Default, PartialEq)]
17535#[non_exhaustive]
17536pub struct UpdateTargetProjectRequest {
17537 /// Field mask is used to specify the fields to be overwritten in the
17538 /// TargetProject resource by the update.
17539 /// The fields specified in the update_mask are relative to the resource, not
17540 /// the full request. A field will be overwritten if it is in the mask. If the
17541 /// user does not provide a mask then all fields will be overwritten.
17542 pub update_mask: std::option::Option<wkt::FieldMask>,
17543
17544 /// Required. The update request body.
17545 pub target_project: std::option::Option<crate::model::TargetProject>,
17546
17547 /// A request ID to identify requests. Specify a unique request ID
17548 /// so that if you must retry your request, the server will know to ignore
17549 /// the request if it has already been completed. The server will guarantee
17550 /// that for at least 60 minutes since the first request.
17551 ///
17552 /// For example, consider a situation where you make an initial request and
17553 /// the request times out. If you make the request again with the same request
17554 /// ID, the server can check if original operation with the same request ID
17555 /// was received, and if so, will ignore the second request. This prevents
17556 /// clients from accidentally creating duplicate commitments.
17557 ///
17558 /// The request ID must be a valid UUID with the exception that zero UUID is
17559 /// not supported (00000000-0000-0000-0000-000000000000).
17560 pub request_id: std::string::String,
17561
17562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17563}
17564
17565impl UpdateTargetProjectRequest {
17566 /// Creates a new default instance.
17567 pub fn new() -> Self {
17568 std::default::Default::default()
17569 }
17570
17571 /// Sets the value of [update_mask][crate::model::UpdateTargetProjectRequest::update_mask].
17572 ///
17573 /// # Example
17574 /// ```ignore,no_run
17575 /// # use google_cloud_vmmigration_v1::model::UpdateTargetProjectRequest;
17576 /// use wkt::FieldMask;
17577 /// let x = UpdateTargetProjectRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17578 /// ```
17579 pub fn set_update_mask<T>(mut self, v: T) -> Self
17580 where
17581 T: std::convert::Into<wkt::FieldMask>,
17582 {
17583 self.update_mask = std::option::Option::Some(v.into());
17584 self
17585 }
17586
17587 /// Sets or clears the value of [update_mask][crate::model::UpdateTargetProjectRequest::update_mask].
17588 ///
17589 /// # Example
17590 /// ```ignore,no_run
17591 /// # use google_cloud_vmmigration_v1::model::UpdateTargetProjectRequest;
17592 /// use wkt::FieldMask;
17593 /// let x = UpdateTargetProjectRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17594 /// let x = UpdateTargetProjectRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17595 /// ```
17596 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17597 where
17598 T: std::convert::Into<wkt::FieldMask>,
17599 {
17600 self.update_mask = v.map(|x| x.into());
17601 self
17602 }
17603
17604 /// Sets the value of [target_project][crate::model::UpdateTargetProjectRequest::target_project].
17605 ///
17606 /// # Example
17607 /// ```ignore,no_run
17608 /// # use google_cloud_vmmigration_v1::model::UpdateTargetProjectRequest;
17609 /// use google_cloud_vmmigration_v1::model::TargetProject;
17610 /// let x = UpdateTargetProjectRequest::new().set_target_project(TargetProject::default()/* use setters */);
17611 /// ```
17612 pub fn set_target_project<T>(mut self, v: T) -> Self
17613 where
17614 T: std::convert::Into<crate::model::TargetProject>,
17615 {
17616 self.target_project = std::option::Option::Some(v.into());
17617 self
17618 }
17619
17620 /// Sets or clears the value of [target_project][crate::model::UpdateTargetProjectRequest::target_project].
17621 ///
17622 /// # Example
17623 /// ```ignore,no_run
17624 /// # use google_cloud_vmmigration_v1::model::UpdateTargetProjectRequest;
17625 /// use google_cloud_vmmigration_v1::model::TargetProject;
17626 /// let x = UpdateTargetProjectRequest::new().set_or_clear_target_project(Some(TargetProject::default()/* use setters */));
17627 /// let x = UpdateTargetProjectRequest::new().set_or_clear_target_project(None::<TargetProject>);
17628 /// ```
17629 pub fn set_or_clear_target_project<T>(mut self, v: std::option::Option<T>) -> Self
17630 where
17631 T: std::convert::Into<crate::model::TargetProject>,
17632 {
17633 self.target_project = v.map(|x| x.into());
17634 self
17635 }
17636
17637 /// Sets the value of [request_id][crate::model::UpdateTargetProjectRequest::request_id].
17638 ///
17639 /// # Example
17640 /// ```ignore,no_run
17641 /// # use google_cloud_vmmigration_v1::model::UpdateTargetProjectRequest;
17642 /// let x = UpdateTargetProjectRequest::new().set_request_id("example");
17643 /// ```
17644 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17645 self.request_id = v.into();
17646 self
17647 }
17648}
17649
17650impl wkt::message::Message for UpdateTargetProjectRequest {
17651 fn typename() -> &'static str {
17652 "type.googleapis.com/google.cloud.vmmigration.v1.UpdateTargetProjectRequest"
17653 }
17654}
17655
17656/// Request message for 'DeleteTargetProject' request.
17657#[derive(Clone, Default, PartialEq)]
17658#[non_exhaustive]
17659pub struct DeleteTargetProjectRequest {
17660 /// Required. The TargetProject name.
17661 pub name: std::string::String,
17662
17663 /// Optional. A request ID to identify requests. Specify a unique request ID
17664 /// so that if you must retry your request, the server will know to ignore
17665 /// the request if it has already been completed. The server will guarantee
17666 /// that for at least 60 minutes after the first request.
17667 ///
17668 /// For example, consider a situation where you make an initial request and
17669 /// the request times out. If you make the request again with the same request
17670 /// ID, the server can check if original operation with the same request ID
17671 /// was received, and if so, will ignore the second request. This prevents
17672 /// clients from accidentally creating duplicate commitments.
17673 ///
17674 /// The request ID must be a valid UUID with the exception that zero UUID is
17675 /// not supported (00000000-0000-0000-0000-000000000000).
17676 pub request_id: std::string::String,
17677
17678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17679}
17680
17681impl DeleteTargetProjectRequest {
17682 /// Creates a new default instance.
17683 pub fn new() -> Self {
17684 std::default::Default::default()
17685 }
17686
17687 /// Sets the value of [name][crate::model::DeleteTargetProjectRequest::name].
17688 ///
17689 /// # Example
17690 /// ```ignore,no_run
17691 /// # use google_cloud_vmmigration_v1::model::DeleteTargetProjectRequest;
17692 /// # let project_id = "project_id";
17693 /// # let location_id = "location_id";
17694 /// # let target_project_id = "target_project_id";
17695 /// let x = DeleteTargetProjectRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
17696 /// ```
17697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17698 self.name = v.into();
17699 self
17700 }
17701
17702 /// Sets the value of [request_id][crate::model::DeleteTargetProjectRequest::request_id].
17703 ///
17704 /// # Example
17705 /// ```ignore,no_run
17706 /// # use google_cloud_vmmigration_v1::model::DeleteTargetProjectRequest;
17707 /// let x = DeleteTargetProjectRequest::new().set_request_id("example");
17708 /// ```
17709 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17710 self.request_id = v.into();
17711 self
17712 }
17713}
17714
17715impl wkt::message::Message for DeleteTargetProjectRequest {
17716 fn typename() -> &'static str {
17717 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteTargetProjectRequest"
17718 }
17719}
17720
17721/// Describes message for 'Group' resource. The Group is a collections of several
17722/// MigratingVms.
17723#[derive(Clone, Default, PartialEq)]
17724#[non_exhaustive]
17725pub struct Group {
17726 /// Output only. The Group name.
17727 pub name: std::string::String,
17728
17729 /// Output only. The create time timestamp.
17730 pub create_time: std::option::Option<wkt::Timestamp>,
17731
17732 /// Output only. The update time timestamp.
17733 pub update_time: std::option::Option<wkt::Timestamp>,
17734
17735 /// User-provided description of the group.
17736 pub description: std::string::String,
17737
17738 /// Display name is a user defined name for this group which can be updated.
17739 pub display_name: std::string::String,
17740
17741 /// Immutable. The target type of this group.
17742 pub migration_target_type: crate::model::group::MigrationTargetType,
17743
17744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17745}
17746
17747impl Group {
17748 /// Creates a new default instance.
17749 pub fn new() -> Self {
17750 std::default::Default::default()
17751 }
17752
17753 /// Sets the value of [name][crate::model::Group::name].
17754 ///
17755 /// # Example
17756 /// ```ignore,no_run
17757 /// # use google_cloud_vmmigration_v1::model::Group;
17758 /// # let project_id = "project_id";
17759 /// # let location_id = "location_id";
17760 /// # let group_id = "group_id";
17761 /// let x = Group::new().set_name(format!("projects/{project_id}/locations/{location_id}/groups/{group_id}"));
17762 /// ```
17763 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17764 self.name = v.into();
17765 self
17766 }
17767
17768 /// Sets the value of [create_time][crate::model::Group::create_time].
17769 ///
17770 /// # Example
17771 /// ```ignore,no_run
17772 /// # use google_cloud_vmmigration_v1::model::Group;
17773 /// use wkt::Timestamp;
17774 /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
17775 /// ```
17776 pub fn set_create_time<T>(mut self, v: T) -> Self
17777 where
17778 T: std::convert::Into<wkt::Timestamp>,
17779 {
17780 self.create_time = std::option::Option::Some(v.into());
17781 self
17782 }
17783
17784 /// Sets or clears the value of [create_time][crate::model::Group::create_time].
17785 ///
17786 /// # Example
17787 /// ```ignore,no_run
17788 /// # use google_cloud_vmmigration_v1::model::Group;
17789 /// use wkt::Timestamp;
17790 /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17791 /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
17792 /// ```
17793 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17794 where
17795 T: std::convert::Into<wkt::Timestamp>,
17796 {
17797 self.create_time = v.map(|x| x.into());
17798 self
17799 }
17800
17801 /// Sets the value of [update_time][crate::model::Group::update_time].
17802 ///
17803 /// # Example
17804 /// ```ignore,no_run
17805 /// # use google_cloud_vmmigration_v1::model::Group;
17806 /// use wkt::Timestamp;
17807 /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
17808 /// ```
17809 pub fn set_update_time<T>(mut self, v: T) -> Self
17810 where
17811 T: std::convert::Into<wkt::Timestamp>,
17812 {
17813 self.update_time = std::option::Option::Some(v.into());
17814 self
17815 }
17816
17817 /// Sets or clears the value of [update_time][crate::model::Group::update_time].
17818 ///
17819 /// # Example
17820 /// ```ignore,no_run
17821 /// # use google_cloud_vmmigration_v1::model::Group;
17822 /// use wkt::Timestamp;
17823 /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17824 /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
17825 /// ```
17826 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17827 where
17828 T: std::convert::Into<wkt::Timestamp>,
17829 {
17830 self.update_time = v.map(|x| x.into());
17831 self
17832 }
17833
17834 /// Sets the value of [description][crate::model::Group::description].
17835 ///
17836 /// # Example
17837 /// ```ignore,no_run
17838 /// # use google_cloud_vmmigration_v1::model::Group;
17839 /// let x = Group::new().set_description("example");
17840 /// ```
17841 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17842 self.description = v.into();
17843 self
17844 }
17845
17846 /// Sets the value of [display_name][crate::model::Group::display_name].
17847 ///
17848 /// # Example
17849 /// ```ignore,no_run
17850 /// # use google_cloud_vmmigration_v1::model::Group;
17851 /// let x = Group::new().set_display_name("example");
17852 /// ```
17853 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17854 self.display_name = v.into();
17855 self
17856 }
17857
17858 /// Sets the value of [migration_target_type][crate::model::Group::migration_target_type].
17859 ///
17860 /// # Example
17861 /// ```ignore,no_run
17862 /// # use google_cloud_vmmigration_v1::model::Group;
17863 /// use google_cloud_vmmigration_v1::model::group::MigrationTargetType;
17864 /// let x0 = Group::new().set_migration_target_type(MigrationTargetType::Gce);
17865 /// let x1 = Group::new().set_migration_target_type(MigrationTargetType::Disks);
17866 /// ```
17867 pub fn set_migration_target_type<
17868 T: std::convert::Into<crate::model::group::MigrationTargetType>,
17869 >(
17870 mut self,
17871 v: T,
17872 ) -> Self {
17873 self.migration_target_type = v.into();
17874 self
17875 }
17876}
17877
17878impl wkt::message::Message for Group {
17879 fn typename() -> &'static str {
17880 "type.googleapis.com/google.cloud.vmmigration.v1.Group"
17881 }
17882}
17883
17884/// Defines additional types related to [Group].
17885pub mod group {
17886 #[allow(unused_imports)]
17887 use super::*;
17888
17889 /// The possible types of the group.
17890 ///
17891 /// # Working with unknown values
17892 ///
17893 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17894 /// additional enum variants at any time. Adding new variants is not considered
17895 /// a breaking change. Applications should write their code in anticipation of:
17896 ///
17897 /// - New values appearing in future releases of the client library, **and**
17898 /// - New values received dynamically, without application changes.
17899 ///
17900 /// Please consult the [Working with enums] section in the user guide for some
17901 /// guidelines.
17902 ///
17903 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17904 #[derive(Clone, Debug, PartialEq)]
17905 #[non_exhaustive]
17906 pub enum MigrationTargetType {
17907 /// Group type is not specified. This defaults to Compute Engine targets.
17908 Unspecified,
17909 /// All MigratingVMs in the group must have Compute Engine targets.
17910 Gce,
17911 /// All MigratingVMs in the group must have Compute Engine Disks targets.
17912 Disks,
17913 /// If set, the enum was initialized with an unknown value.
17914 ///
17915 /// Applications can examine the value using [MigrationTargetType::value] or
17916 /// [MigrationTargetType::name].
17917 UnknownValue(migration_target_type::UnknownValue),
17918 }
17919
17920 #[doc(hidden)]
17921 pub mod migration_target_type {
17922 #[allow(unused_imports)]
17923 use super::*;
17924 #[derive(Clone, Debug, PartialEq)]
17925 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17926 }
17927
17928 impl MigrationTargetType {
17929 /// Gets the enum value.
17930 ///
17931 /// Returns `None` if the enum contains an unknown value deserialized from
17932 /// the string representation of enums.
17933 pub fn value(&self) -> std::option::Option<i32> {
17934 match self {
17935 Self::Unspecified => std::option::Option::Some(0),
17936 Self::Gce => std::option::Option::Some(1),
17937 Self::Disks => std::option::Option::Some(2),
17938 Self::UnknownValue(u) => u.0.value(),
17939 }
17940 }
17941
17942 /// Gets the enum value as a string.
17943 ///
17944 /// Returns `None` if the enum contains an unknown value deserialized from
17945 /// the integer representation of enums.
17946 pub fn name(&self) -> std::option::Option<&str> {
17947 match self {
17948 Self::Unspecified => std::option::Option::Some("MIGRATION_TARGET_TYPE_UNSPECIFIED"),
17949 Self::Gce => std::option::Option::Some("MIGRATION_TARGET_TYPE_GCE"),
17950 Self::Disks => std::option::Option::Some("MIGRATION_TARGET_TYPE_DISKS"),
17951 Self::UnknownValue(u) => u.0.name(),
17952 }
17953 }
17954 }
17955
17956 impl std::default::Default for MigrationTargetType {
17957 fn default() -> Self {
17958 use std::convert::From;
17959 Self::from(0)
17960 }
17961 }
17962
17963 impl std::fmt::Display for MigrationTargetType {
17964 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17965 wkt::internal::display_enum(f, self.name(), self.value())
17966 }
17967 }
17968
17969 impl std::convert::From<i32> for MigrationTargetType {
17970 fn from(value: i32) -> Self {
17971 match value {
17972 0 => Self::Unspecified,
17973 1 => Self::Gce,
17974 2 => Self::Disks,
17975 _ => Self::UnknownValue(migration_target_type::UnknownValue(
17976 wkt::internal::UnknownEnumValue::Integer(value),
17977 )),
17978 }
17979 }
17980 }
17981
17982 impl std::convert::From<&str> for MigrationTargetType {
17983 fn from(value: &str) -> Self {
17984 use std::string::ToString;
17985 match value {
17986 "MIGRATION_TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
17987 "MIGRATION_TARGET_TYPE_GCE" => Self::Gce,
17988 "MIGRATION_TARGET_TYPE_DISKS" => Self::Disks,
17989 _ => Self::UnknownValue(migration_target_type::UnknownValue(
17990 wkt::internal::UnknownEnumValue::String(value.to_string()),
17991 )),
17992 }
17993 }
17994 }
17995
17996 impl serde::ser::Serialize for MigrationTargetType {
17997 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17998 where
17999 S: serde::Serializer,
18000 {
18001 match self {
18002 Self::Unspecified => serializer.serialize_i32(0),
18003 Self::Gce => serializer.serialize_i32(1),
18004 Self::Disks => serializer.serialize_i32(2),
18005 Self::UnknownValue(u) => u.0.serialize(serializer),
18006 }
18007 }
18008 }
18009
18010 impl<'de> serde::de::Deserialize<'de> for MigrationTargetType {
18011 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18012 where
18013 D: serde::Deserializer<'de>,
18014 {
18015 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationTargetType>::new(
18016 ".google.cloud.vmmigration.v1.Group.MigrationTargetType",
18017 ))
18018 }
18019 }
18020}
18021
18022/// Request message for 'ListGroups' request.
18023#[derive(Clone, Default, PartialEq)]
18024#[non_exhaustive]
18025pub struct ListGroupsRequest {
18026 /// Required. The parent, which owns this collection of groups.
18027 pub parent: std::string::String,
18028
18029 /// Optional. The maximum number of groups to return. The service may return
18030 /// fewer than this value. If unspecified, at most 500 groups will be
18031 /// returned. The maximum value is 1000; values above 1000 will be coerced to
18032 /// 1000.
18033 pub page_size: i32,
18034
18035 /// Required. A page token, received from a previous `ListGroups` call.
18036 /// Provide this to retrieve the subsequent page.
18037 ///
18038 /// When paginating, all other parameters provided to `ListGroups` must
18039 /// match the call that provided the page token.
18040 pub page_token: std::string::String,
18041
18042 /// Optional. The filter request.
18043 pub filter: std::string::String,
18044
18045 /// Optional. the order by fields for the result.
18046 pub order_by: std::string::String,
18047
18048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18049}
18050
18051impl ListGroupsRequest {
18052 /// Creates a new default instance.
18053 pub fn new() -> Self {
18054 std::default::Default::default()
18055 }
18056
18057 /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
18058 ///
18059 /// # Example
18060 /// ```ignore,no_run
18061 /// # use google_cloud_vmmigration_v1::model::ListGroupsRequest;
18062 /// # let project_id = "project_id";
18063 /// # let location_id = "location_id";
18064 /// let x = ListGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
18065 /// ```
18066 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18067 self.parent = v.into();
18068 self
18069 }
18070
18071 /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
18072 ///
18073 /// # Example
18074 /// ```ignore,no_run
18075 /// # use google_cloud_vmmigration_v1::model::ListGroupsRequest;
18076 /// let x = ListGroupsRequest::new().set_page_size(42);
18077 /// ```
18078 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18079 self.page_size = v.into();
18080 self
18081 }
18082
18083 /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
18084 ///
18085 /// # Example
18086 /// ```ignore,no_run
18087 /// # use google_cloud_vmmigration_v1::model::ListGroupsRequest;
18088 /// let x = ListGroupsRequest::new().set_page_token("example");
18089 /// ```
18090 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18091 self.page_token = v.into();
18092 self
18093 }
18094
18095 /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
18096 ///
18097 /// # Example
18098 /// ```ignore,no_run
18099 /// # use google_cloud_vmmigration_v1::model::ListGroupsRequest;
18100 /// let x = ListGroupsRequest::new().set_filter("example");
18101 /// ```
18102 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18103 self.filter = v.into();
18104 self
18105 }
18106
18107 /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
18108 ///
18109 /// # Example
18110 /// ```ignore,no_run
18111 /// # use google_cloud_vmmigration_v1::model::ListGroupsRequest;
18112 /// let x = ListGroupsRequest::new().set_order_by("example");
18113 /// ```
18114 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18115 self.order_by = v.into();
18116 self
18117 }
18118}
18119
18120impl wkt::message::Message for ListGroupsRequest {
18121 fn typename() -> &'static str {
18122 "type.googleapis.com/google.cloud.vmmigration.v1.ListGroupsRequest"
18123 }
18124}
18125
18126/// Response message for 'ListGroups' request.
18127#[derive(Clone, Default, PartialEq)]
18128#[non_exhaustive]
18129pub struct ListGroupsResponse {
18130 /// Output only. The list of groups response.
18131 pub groups: std::vec::Vec<crate::model::Group>,
18132
18133 /// Output only. A token, which can be sent as `page_token` to retrieve the
18134 /// next page. If this field is omitted, there are no subsequent pages.
18135 pub next_page_token: std::string::String,
18136
18137 /// Output only. Locations that could not be reached.
18138 pub unreachable: std::vec::Vec<std::string::String>,
18139
18140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18141}
18142
18143impl ListGroupsResponse {
18144 /// Creates a new default instance.
18145 pub fn new() -> Self {
18146 std::default::Default::default()
18147 }
18148
18149 /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
18150 ///
18151 /// # Example
18152 /// ```ignore,no_run
18153 /// # use google_cloud_vmmigration_v1::model::ListGroupsResponse;
18154 /// use google_cloud_vmmigration_v1::model::Group;
18155 /// let x = ListGroupsResponse::new()
18156 /// .set_groups([
18157 /// Group::default()/* use setters */,
18158 /// Group::default()/* use (different) setters */,
18159 /// ]);
18160 /// ```
18161 pub fn set_groups<T, V>(mut self, v: T) -> Self
18162 where
18163 T: std::iter::IntoIterator<Item = V>,
18164 V: std::convert::Into<crate::model::Group>,
18165 {
18166 use std::iter::Iterator;
18167 self.groups = v.into_iter().map(|i| i.into()).collect();
18168 self
18169 }
18170
18171 /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
18172 ///
18173 /// # Example
18174 /// ```ignore,no_run
18175 /// # use google_cloud_vmmigration_v1::model::ListGroupsResponse;
18176 /// let x = ListGroupsResponse::new().set_next_page_token("example");
18177 /// ```
18178 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18179 self.next_page_token = v.into();
18180 self
18181 }
18182
18183 /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
18184 ///
18185 /// # Example
18186 /// ```ignore,no_run
18187 /// # use google_cloud_vmmigration_v1::model::ListGroupsResponse;
18188 /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
18189 /// ```
18190 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
18191 where
18192 T: std::iter::IntoIterator<Item = V>,
18193 V: std::convert::Into<std::string::String>,
18194 {
18195 use std::iter::Iterator;
18196 self.unreachable = v.into_iter().map(|i| i.into()).collect();
18197 self
18198 }
18199}
18200
18201impl wkt::message::Message for ListGroupsResponse {
18202 fn typename() -> &'static str {
18203 "type.googleapis.com/google.cloud.vmmigration.v1.ListGroupsResponse"
18204 }
18205}
18206
18207#[doc(hidden)]
18208impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
18209 type PageItem = crate::model::Group;
18210
18211 fn items(self) -> std::vec::Vec<Self::PageItem> {
18212 self.groups
18213 }
18214
18215 fn next_page_token(&self) -> std::string::String {
18216 use std::clone::Clone;
18217 self.next_page_token.clone()
18218 }
18219}
18220
18221/// Request message for 'GetGroup' request.
18222#[derive(Clone, Default, PartialEq)]
18223#[non_exhaustive]
18224pub struct GetGroupRequest {
18225 /// Required. The group name.
18226 pub name: std::string::String,
18227
18228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18229}
18230
18231impl GetGroupRequest {
18232 /// Creates a new default instance.
18233 pub fn new() -> Self {
18234 std::default::Default::default()
18235 }
18236
18237 /// Sets the value of [name][crate::model::GetGroupRequest::name].
18238 ///
18239 /// # Example
18240 /// ```ignore,no_run
18241 /// # use google_cloud_vmmigration_v1::model::GetGroupRequest;
18242 /// # let project_id = "project_id";
18243 /// # let location_id = "location_id";
18244 /// # let group_id = "group_id";
18245 /// let x = GetGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/groups/{group_id}"));
18246 /// ```
18247 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18248 self.name = v.into();
18249 self
18250 }
18251}
18252
18253impl wkt::message::Message for GetGroupRequest {
18254 fn typename() -> &'static str {
18255 "type.googleapis.com/google.cloud.vmmigration.v1.GetGroupRequest"
18256 }
18257}
18258
18259/// Request message for 'CreateGroup' request.
18260#[derive(Clone, Default, PartialEq)]
18261#[non_exhaustive]
18262pub struct CreateGroupRequest {
18263 /// Required. The Group's parent.
18264 pub parent: std::string::String,
18265
18266 /// Required. The group identifier.
18267 pub group_id: std::string::String,
18268
18269 /// Required. The create request body.
18270 pub group: std::option::Option<crate::model::Group>,
18271
18272 /// A request ID to identify requests. Specify a unique request ID
18273 /// so that if you must retry your request, the server will know to ignore
18274 /// the request if it has already been completed. The server will guarantee
18275 /// that for at least 60 minutes since the first request.
18276 ///
18277 /// For example, consider a situation where you make an initial request and
18278 /// the request times out. If you make the request again with the same request
18279 /// ID, the server can check if original operation with the same request ID
18280 /// was received, and if so, will ignore the second request. This prevents
18281 /// clients from accidentally creating duplicate commitments.
18282 ///
18283 /// The request ID must be a valid UUID with the exception that zero UUID is
18284 /// not supported (00000000-0000-0000-0000-000000000000).
18285 pub request_id: std::string::String,
18286
18287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18288}
18289
18290impl CreateGroupRequest {
18291 /// Creates a new default instance.
18292 pub fn new() -> Self {
18293 std::default::Default::default()
18294 }
18295
18296 /// Sets the value of [parent][crate::model::CreateGroupRequest::parent].
18297 ///
18298 /// # Example
18299 /// ```ignore,no_run
18300 /// # use google_cloud_vmmigration_v1::model::CreateGroupRequest;
18301 /// # let project_id = "project_id";
18302 /// # let location_id = "location_id";
18303 /// let x = CreateGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
18304 /// ```
18305 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18306 self.parent = v.into();
18307 self
18308 }
18309
18310 /// Sets the value of [group_id][crate::model::CreateGroupRequest::group_id].
18311 ///
18312 /// # Example
18313 /// ```ignore,no_run
18314 /// # use google_cloud_vmmigration_v1::model::CreateGroupRequest;
18315 /// let x = CreateGroupRequest::new().set_group_id("example");
18316 /// ```
18317 pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18318 self.group_id = v.into();
18319 self
18320 }
18321
18322 /// Sets the value of [group][crate::model::CreateGroupRequest::group].
18323 ///
18324 /// # Example
18325 /// ```ignore,no_run
18326 /// # use google_cloud_vmmigration_v1::model::CreateGroupRequest;
18327 /// use google_cloud_vmmigration_v1::model::Group;
18328 /// let x = CreateGroupRequest::new().set_group(Group::default()/* use setters */);
18329 /// ```
18330 pub fn set_group<T>(mut self, v: T) -> Self
18331 where
18332 T: std::convert::Into<crate::model::Group>,
18333 {
18334 self.group = std::option::Option::Some(v.into());
18335 self
18336 }
18337
18338 /// Sets or clears the value of [group][crate::model::CreateGroupRequest::group].
18339 ///
18340 /// # Example
18341 /// ```ignore,no_run
18342 /// # use google_cloud_vmmigration_v1::model::CreateGroupRequest;
18343 /// use google_cloud_vmmigration_v1::model::Group;
18344 /// let x = CreateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
18345 /// let x = CreateGroupRequest::new().set_or_clear_group(None::<Group>);
18346 /// ```
18347 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
18348 where
18349 T: std::convert::Into<crate::model::Group>,
18350 {
18351 self.group = v.map(|x| x.into());
18352 self
18353 }
18354
18355 /// Sets the value of [request_id][crate::model::CreateGroupRequest::request_id].
18356 ///
18357 /// # Example
18358 /// ```ignore,no_run
18359 /// # use google_cloud_vmmigration_v1::model::CreateGroupRequest;
18360 /// let x = CreateGroupRequest::new().set_request_id("example");
18361 /// ```
18362 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18363 self.request_id = v.into();
18364 self
18365 }
18366}
18367
18368impl wkt::message::Message for CreateGroupRequest {
18369 fn typename() -> &'static str {
18370 "type.googleapis.com/google.cloud.vmmigration.v1.CreateGroupRequest"
18371 }
18372}
18373
18374/// Update message for 'UpdateGroups' request.
18375#[derive(Clone, Default, PartialEq)]
18376#[non_exhaustive]
18377pub struct UpdateGroupRequest {
18378 /// Field mask is used to specify the fields to be overwritten in the
18379 /// Group resource by the update.
18380 /// The fields specified in the update_mask are relative to the resource, not
18381 /// the full request. A field will be overwritten if it is in the mask. If the
18382 /// user does not provide a mask then all fields will be overwritten.
18383 pub update_mask: std::option::Option<wkt::FieldMask>,
18384
18385 /// Required. The update request body.
18386 pub group: std::option::Option<crate::model::Group>,
18387
18388 /// A request ID to identify requests. Specify a unique request ID
18389 /// so that if you must retry your request, the server will know to ignore
18390 /// the request if it has already been completed. The server will guarantee
18391 /// that for at least 60 minutes since the first request.
18392 ///
18393 /// For example, consider a situation where you make an initial request and
18394 /// the request times out. If you make the request again with the same request
18395 /// ID, the server can check if original operation with the same request ID
18396 /// was received, and if so, will ignore the second request. This prevents
18397 /// clients from accidentally creating duplicate commitments.
18398 ///
18399 /// The request ID must be a valid UUID with the exception that zero UUID is
18400 /// not supported (00000000-0000-0000-0000-000000000000).
18401 pub request_id: std::string::String,
18402
18403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18404}
18405
18406impl UpdateGroupRequest {
18407 /// Creates a new default instance.
18408 pub fn new() -> Self {
18409 std::default::Default::default()
18410 }
18411
18412 /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
18413 ///
18414 /// # Example
18415 /// ```ignore,no_run
18416 /// # use google_cloud_vmmigration_v1::model::UpdateGroupRequest;
18417 /// use wkt::FieldMask;
18418 /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
18419 /// ```
18420 pub fn set_update_mask<T>(mut self, v: T) -> Self
18421 where
18422 T: std::convert::Into<wkt::FieldMask>,
18423 {
18424 self.update_mask = std::option::Option::Some(v.into());
18425 self
18426 }
18427
18428 /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
18429 ///
18430 /// # Example
18431 /// ```ignore,no_run
18432 /// # use google_cloud_vmmigration_v1::model::UpdateGroupRequest;
18433 /// use wkt::FieldMask;
18434 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
18435 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
18436 /// ```
18437 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18438 where
18439 T: std::convert::Into<wkt::FieldMask>,
18440 {
18441 self.update_mask = v.map(|x| x.into());
18442 self
18443 }
18444
18445 /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
18446 ///
18447 /// # Example
18448 /// ```ignore,no_run
18449 /// # use google_cloud_vmmigration_v1::model::UpdateGroupRequest;
18450 /// use google_cloud_vmmigration_v1::model::Group;
18451 /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
18452 /// ```
18453 pub fn set_group<T>(mut self, v: T) -> Self
18454 where
18455 T: std::convert::Into<crate::model::Group>,
18456 {
18457 self.group = std::option::Option::Some(v.into());
18458 self
18459 }
18460
18461 /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
18462 ///
18463 /// # Example
18464 /// ```ignore,no_run
18465 /// # use google_cloud_vmmigration_v1::model::UpdateGroupRequest;
18466 /// use google_cloud_vmmigration_v1::model::Group;
18467 /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
18468 /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
18469 /// ```
18470 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
18471 where
18472 T: std::convert::Into<crate::model::Group>,
18473 {
18474 self.group = v.map(|x| x.into());
18475 self
18476 }
18477
18478 /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
18479 ///
18480 /// # Example
18481 /// ```ignore,no_run
18482 /// # use google_cloud_vmmigration_v1::model::UpdateGroupRequest;
18483 /// let x = UpdateGroupRequest::new().set_request_id("example");
18484 /// ```
18485 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18486 self.request_id = v.into();
18487 self
18488 }
18489}
18490
18491impl wkt::message::Message for UpdateGroupRequest {
18492 fn typename() -> &'static str {
18493 "type.googleapis.com/google.cloud.vmmigration.v1.UpdateGroupRequest"
18494 }
18495}
18496
18497/// Request message for 'DeleteGroup' request.
18498#[derive(Clone, Default, PartialEq)]
18499#[non_exhaustive]
18500pub struct DeleteGroupRequest {
18501 /// Required. The Group name.
18502 pub name: std::string::String,
18503
18504 /// Optional. A request ID to identify requests. Specify a unique request ID
18505 /// so that if you must retry your request, the server will know to ignore
18506 /// the request if it has already been completed. The server will guarantee
18507 /// that for at least 60 minutes after the first request.
18508 ///
18509 /// For example, consider a situation where you make an initial request and
18510 /// the request times out. If you make the request again with the same request
18511 /// ID, the server can check if original operation with the same request ID
18512 /// was received, and if so, will ignore the second request. This prevents
18513 /// clients from accidentally creating duplicate commitments.
18514 ///
18515 /// The request ID must be a valid UUID with the exception that zero UUID is
18516 /// not supported (00000000-0000-0000-0000-000000000000).
18517 pub request_id: std::string::String,
18518
18519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18520}
18521
18522impl DeleteGroupRequest {
18523 /// Creates a new default instance.
18524 pub fn new() -> Self {
18525 std::default::Default::default()
18526 }
18527
18528 /// Sets the value of [name][crate::model::DeleteGroupRequest::name].
18529 ///
18530 /// # Example
18531 /// ```ignore,no_run
18532 /// # use google_cloud_vmmigration_v1::model::DeleteGroupRequest;
18533 /// # let project_id = "project_id";
18534 /// # let location_id = "location_id";
18535 /// # let group_id = "group_id";
18536 /// let x = DeleteGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/groups/{group_id}"));
18537 /// ```
18538 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18539 self.name = v.into();
18540 self
18541 }
18542
18543 /// Sets the value of [request_id][crate::model::DeleteGroupRequest::request_id].
18544 ///
18545 /// # Example
18546 /// ```ignore,no_run
18547 /// # use google_cloud_vmmigration_v1::model::DeleteGroupRequest;
18548 /// let x = DeleteGroupRequest::new().set_request_id("example");
18549 /// ```
18550 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18551 self.request_id = v.into();
18552 self
18553 }
18554}
18555
18556impl wkt::message::Message for DeleteGroupRequest {
18557 fn typename() -> &'static str {
18558 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteGroupRequest"
18559 }
18560}
18561
18562/// Request message for 'AddGroupMigration' request.
18563#[derive(Clone, Default, PartialEq)]
18564#[non_exhaustive]
18565pub struct AddGroupMigrationRequest {
18566 /// Required. The full path name of the Group to add to.
18567 pub group: std::string::String,
18568
18569 /// The full path name of the MigratingVm to add.
18570 pub migrating_vm: std::string::String,
18571
18572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18573}
18574
18575impl AddGroupMigrationRequest {
18576 /// Creates a new default instance.
18577 pub fn new() -> Self {
18578 std::default::Default::default()
18579 }
18580
18581 /// Sets the value of [group][crate::model::AddGroupMigrationRequest::group].
18582 ///
18583 /// # Example
18584 /// ```ignore,no_run
18585 /// # use google_cloud_vmmigration_v1::model::AddGroupMigrationRequest;
18586 /// # let project_id = "project_id";
18587 /// # let location_id = "location_id";
18588 /// # let group_id = "group_id";
18589 /// let x = AddGroupMigrationRequest::new().set_group(format!("projects/{project_id}/locations/{location_id}/groups/{group_id}"));
18590 /// ```
18591 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18592 self.group = v.into();
18593 self
18594 }
18595
18596 /// Sets the value of [migrating_vm][crate::model::AddGroupMigrationRequest::migrating_vm].
18597 ///
18598 /// # Example
18599 /// ```ignore,no_run
18600 /// # use google_cloud_vmmigration_v1::model::AddGroupMigrationRequest;
18601 /// # let project_id = "project_id";
18602 /// # let location_id = "location_id";
18603 /// # let source_id = "source_id";
18604 /// # let migrating_vm_id = "migrating_vm_id";
18605 /// let x = AddGroupMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
18606 /// ```
18607 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18608 self.migrating_vm = v.into();
18609 self
18610 }
18611}
18612
18613impl wkt::message::Message for AddGroupMigrationRequest {
18614 fn typename() -> &'static str {
18615 "type.googleapis.com/google.cloud.vmmigration.v1.AddGroupMigrationRequest"
18616 }
18617}
18618
18619/// Response message for 'AddGroupMigration' request.
18620#[derive(Clone, Default, PartialEq)]
18621#[non_exhaustive]
18622pub struct AddGroupMigrationResponse {
18623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18624}
18625
18626impl AddGroupMigrationResponse {
18627 /// Creates a new default instance.
18628 pub fn new() -> Self {
18629 std::default::Default::default()
18630 }
18631}
18632
18633impl wkt::message::Message for AddGroupMigrationResponse {
18634 fn typename() -> &'static str {
18635 "type.googleapis.com/google.cloud.vmmigration.v1.AddGroupMigrationResponse"
18636 }
18637}
18638
18639/// Request message for 'RemoveMigration' request.
18640#[derive(Clone, Default, PartialEq)]
18641#[non_exhaustive]
18642pub struct RemoveGroupMigrationRequest {
18643 /// Required. The name of the Group.
18644 pub group: std::string::String,
18645
18646 /// The MigratingVm to remove.
18647 pub migrating_vm: std::string::String,
18648
18649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18650}
18651
18652impl RemoveGroupMigrationRequest {
18653 /// Creates a new default instance.
18654 pub fn new() -> Self {
18655 std::default::Default::default()
18656 }
18657
18658 /// Sets the value of [group][crate::model::RemoveGroupMigrationRequest::group].
18659 ///
18660 /// # Example
18661 /// ```ignore,no_run
18662 /// # use google_cloud_vmmigration_v1::model::RemoveGroupMigrationRequest;
18663 /// # let project_id = "project_id";
18664 /// # let location_id = "location_id";
18665 /// # let group_id = "group_id";
18666 /// let x = RemoveGroupMigrationRequest::new().set_group(format!("projects/{project_id}/locations/{location_id}/groups/{group_id}"));
18667 /// ```
18668 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18669 self.group = v.into();
18670 self
18671 }
18672
18673 /// Sets the value of [migrating_vm][crate::model::RemoveGroupMigrationRequest::migrating_vm].
18674 ///
18675 /// # Example
18676 /// ```ignore,no_run
18677 /// # use google_cloud_vmmigration_v1::model::RemoveGroupMigrationRequest;
18678 /// # let project_id = "project_id";
18679 /// # let location_id = "location_id";
18680 /// # let source_id = "source_id";
18681 /// # let migrating_vm_id = "migrating_vm_id";
18682 /// let x = RemoveGroupMigrationRequest::new().set_migrating_vm(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
18683 /// ```
18684 pub fn set_migrating_vm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18685 self.migrating_vm = v.into();
18686 self
18687 }
18688}
18689
18690impl wkt::message::Message for RemoveGroupMigrationRequest {
18691 fn typename() -> &'static str {
18692 "type.googleapis.com/google.cloud.vmmigration.v1.RemoveGroupMigrationRequest"
18693 }
18694}
18695
18696/// Response message for 'RemoveMigration' request.
18697#[derive(Clone, Default, PartialEq)]
18698#[non_exhaustive]
18699pub struct RemoveGroupMigrationResponse {
18700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18701}
18702
18703impl RemoveGroupMigrationResponse {
18704 /// Creates a new default instance.
18705 pub fn new() -> Self {
18706 std::default::Default::default()
18707 }
18708}
18709
18710impl wkt::message::Message for RemoveGroupMigrationResponse {
18711 fn typename() -> &'static str {
18712 "type.googleapis.com/google.cloud.vmmigration.v1.RemoveGroupMigrationResponse"
18713 }
18714}
18715
18716/// Request message for 'CreateCutoverJob' request.
18717#[derive(Clone, Default, PartialEq)]
18718#[non_exhaustive]
18719pub struct CreateCutoverJobRequest {
18720 /// Required. The Cutover's parent.
18721 pub parent: std::string::String,
18722
18723 /// Required. The cutover job identifier.
18724 pub cutover_job_id: std::string::String,
18725
18726 /// Required. The cutover request body.
18727 pub cutover_job: std::option::Option<crate::model::CutoverJob>,
18728
18729 /// A request ID to identify requests. Specify a unique request ID
18730 /// so that if you must retry your request, the server will know to ignore
18731 /// the request if it has already been completed. The server will guarantee
18732 /// that for at least 60 minutes since the first request.
18733 ///
18734 /// For example, consider a situation where you make an initial request and
18735 /// the request times out. If you make the request again with the same request
18736 /// ID, the server can check if original operation with the same request ID
18737 /// was received, and if so, will ignore the second request. This prevents
18738 /// clients from accidentally creating duplicate commitments.
18739 ///
18740 /// The request ID must be a valid UUID with the exception that zero UUID is
18741 /// not supported (00000000-0000-0000-0000-000000000000).
18742 pub request_id: std::string::String,
18743
18744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18745}
18746
18747impl CreateCutoverJobRequest {
18748 /// Creates a new default instance.
18749 pub fn new() -> Self {
18750 std::default::Default::default()
18751 }
18752
18753 /// Sets the value of [parent][crate::model::CreateCutoverJobRequest::parent].
18754 ///
18755 /// # Example
18756 /// ```ignore,no_run
18757 /// # use google_cloud_vmmigration_v1::model::CreateCutoverJobRequest;
18758 /// # let project_id = "project_id";
18759 /// # let location_id = "location_id";
18760 /// # let source_id = "source_id";
18761 /// # let migrating_vm_id = "migrating_vm_id";
18762 /// let x = CreateCutoverJobRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
18763 /// ```
18764 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18765 self.parent = v.into();
18766 self
18767 }
18768
18769 /// Sets the value of [cutover_job_id][crate::model::CreateCutoverJobRequest::cutover_job_id].
18770 ///
18771 /// # Example
18772 /// ```ignore,no_run
18773 /// # use google_cloud_vmmigration_v1::model::CreateCutoverJobRequest;
18774 /// let x = CreateCutoverJobRequest::new().set_cutover_job_id("example");
18775 /// ```
18776 pub fn set_cutover_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18777 self.cutover_job_id = v.into();
18778 self
18779 }
18780
18781 /// Sets the value of [cutover_job][crate::model::CreateCutoverJobRequest::cutover_job].
18782 ///
18783 /// # Example
18784 /// ```ignore,no_run
18785 /// # use google_cloud_vmmigration_v1::model::CreateCutoverJobRequest;
18786 /// use google_cloud_vmmigration_v1::model::CutoverJob;
18787 /// let x = CreateCutoverJobRequest::new().set_cutover_job(CutoverJob::default()/* use setters */);
18788 /// ```
18789 pub fn set_cutover_job<T>(mut self, v: T) -> Self
18790 where
18791 T: std::convert::Into<crate::model::CutoverJob>,
18792 {
18793 self.cutover_job = std::option::Option::Some(v.into());
18794 self
18795 }
18796
18797 /// Sets or clears the value of [cutover_job][crate::model::CreateCutoverJobRequest::cutover_job].
18798 ///
18799 /// # Example
18800 /// ```ignore,no_run
18801 /// # use google_cloud_vmmigration_v1::model::CreateCutoverJobRequest;
18802 /// use google_cloud_vmmigration_v1::model::CutoverJob;
18803 /// let x = CreateCutoverJobRequest::new().set_or_clear_cutover_job(Some(CutoverJob::default()/* use setters */));
18804 /// let x = CreateCutoverJobRequest::new().set_or_clear_cutover_job(None::<CutoverJob>);
18805 /// ```
18806 pub fn set_or_clear_cutover_job<T>(mut self, v: std::option::Option<T>) -> Self
18807 where
18808 T: std::convert::Into<crate::model::CutoverJob>,
18809 {
18810 self.cutover_job = v.map(|x| x.into());
18811 self
18812 }
18813
18814 /// Sets the value of [request_id][crate::model::CreateCutoverJobRequest::request_id].
18815 ///
18816 /// # Example
18817 /// ```ignore,no_run
18818 /// # use google_cloud_vmmigration_v1::model::CreateCutoverJobRequest;
18819 /// let x = CreateCutoverJobRequest::new().set_request_id("example");
18820 /// ```
18821 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18822 self.request_id = v.into();
18823 self
18824 }
18825}
18826
18827impl wkt::message::Message for CreateCutoverJobRequest {
18828 fn typename() -> &'static str {
18829 "type.googleapis.com/google.cloud.vmmigration.v1.CreateCutoverJobRequest"
18830 }
18831}
18832
18833/// Request message for 'CancelCutoverJob' request.
18834#[derive(Clone, Default, PartialEq)]
18835#[non_exhaustive]
18836pub struct CancelCutoverJobRequest {
18837 /// Required. The cutover job id
18838 pub name: std::string::String,
18839
18840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18841}
18842
18843impl CancelCutoverJobRequest {
18844 /// Creates a new default instance.
18845 pub fn new() -> Self {
18846 std::default::Default::default()
18847 }
18848
18849 /// Sets the value of [name][crate::model::CancelCutoverJobRequest::name].
18850 ///
18851 /// # Example
18852 /// ```ignore,no_run
18853 /// # use google_cloud_vmmigration_v1::model::CancelCutoverJobRequest;
18854 /// # let project_id = "project_id";
18855 /// # let location_id = "location_id";
18856 /// # let source_id = "source_id";
18857 /// # let migrating_vm_id = "migrating_vm_id";
18858 /// # let cutover_job_id = "cutover_job_id";
18859 /// let x = CancelCutoverJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/cutoverJobs/{cutover_job_id}"));
18860 /// ```
18861 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18862 self.name = v.into();
18863 self
18864 }
18865}
18866
18867impl wkt::message::Message for CancelCutoverJobRequest {
18868 fn typename() -> &'static str {
18869 "type.googleapis.com/google.cloud.vmmigration.v1.CancelCutoverJobRequest"
18870 }
18871}
18872
18873/// Response message for 'CancelCutoverJob' request.
18874#[derive(Clone, Default, PartialEq)]
18875#[non_exhaustive]
18876pub struct CancelCutoverJobResponse {
18877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18878}
18879
18880impl CancelCutoverJobResponse {
18881 /// Creates a new default instance.
18882 pub fn new() -> Self {
18883 std::default::Default::default()
18884 }
18885}
18886
18887impl wkt::message::Message for CancelCutoverJobResponse {
18888 fn typename() -> &'static str {
18889 "type.googleapis.com/google.cloud.vmmigration.v1.CancelCutoverJobResponse"
18890 }
18891}
18892
18893/// Request message for 'ListCutoverJobsRequest' request.
18894#[derive(Clone, Default, PartialEq)]
18895#[non_exhaustive]
18896pub struct ListCutoverJobsRequest {
18897 /// Required. The parent, which owns this collection of migrating VMs.
18898 pub parent: std::string::String,
18899
18900 /// Optional. The maximum number of cutover jobs to return. The service may
18901 /// return fewer than this value. If unspecified, at most 500 cutover jobs will
18902 /// be returned. The maximum value is 1000; values above 1000 will be coerced
18903 /// to 1000.
18904 pub page_size: i32,
18905
18906 /// Required. A page token, received from a previous `ListCutoverJobs` call.
18907 /// Provide this to retrieve the subsequent page.
18908 ///
18909 /// When paginating, all other parameters provided to `ListCutoverJobs` must
18910 /// match the call that provided the page token.
18911 pub page_token: std::string::String,
18912
18913 /// Optional. The filter request.
18914 pub filter: std::string::String,
18915
18916 /// Optional. the order by fields for the result.
18917 pub order_by: std::string::String,
18918
18919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18920}
18921
18922impl ListCutoverJobsRequest {
18923 /// Creates a new default instance.
18924 pub fn new() -> Self {
18925 std::default::Default::default()
18926 }
18927
18928 /// Sets the value of [parent][crate::model::ListCutoverJobsRequest::parent].
18929 ///
18930 /// # Example
18931 /// ```ignore,no_run
18932 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsRequest;
18933 /// # let project_id = "project_id";
18934 /// # let location_id = "location_id";
18935 /// # let source_id = "source_id";
18936 /// # let migrating_vm_id = "migrating_vm_id";
18937 /// let x = ListCutoverJobsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
18938 /// ```
18939 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18940 self.parent = v.into();
18941 self
18942 }
18943
18944 /// Sets the value of [page_size][crate::model::ListCutoverJobsRequest::page_size].
18945 ///
18946 /// # Example
18947 /// ```ignore,no_run
18948 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsRequest;
18949 /// let x = ListCutoverJobsRequest::new().set_page_size(42);
18950 /// ```
18951 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18952 self.page_size = v.into();
18953 self
18954 }
18955
18956 /// Sets the value of [page_token][crate::model::ListCutoverJobsRequest::page_token].
18957 ///
18958 /// # Example
18959 /// ```ignore,no_run
18960 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsRequest;
18961 /// let x = ListCutoverJobsRequest::new().set_page_token("example");
18962 /// ```
18963 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18964 self.page_token = v.into();
18965 self
18966 }
18967
18968 /// Sets the value of [filter][crate::model::ListCutoverJobsRequest::filter].
18969 ///
18970 /// # Example
18971 /// ```ignore,no_run
18972 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsRequest;
18973 /// let x = ListCutoverJobsRequest::new().set_filter("example");
18974 /// ```
18975 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18976 self.filter = v.into();
18977 self
18978 }
18979
18980 /// Sets the value of [order_by][crate::model::ListCutoverJobsRequest::order_by].
18981 ///
18982 /// # Example
18983 /// ```ignore,no_run
18984 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsRequest;
18985 /// let x = ListCutoverJobsRequest::new().set_order_by("example");
18986 /// ```
18987 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18988 self.order_by = v.into();
18989 self
18990 }
18991}
18992
18993impl wkt::message::Message for ListCutoverJobsRequest {
18994 fn typename() -> &'static str {
18995 "type.googleapis.com/google.cloud.vmmigration.v1.ListCutoverJobsRequest"
18996 }
18997}
18998
18999/// Response message for 'ListCutoverJobs' request.
19000#[derive(Clone, Default, PartialEq)]
19001#[non_exhaustive]
19002pub struct ListCutoverJobsResponse {
19003 /// Output only. The list of cutover jobs response.
19004 pub cutover_jobs: std::vec::Vec<crate::model::CutoverJob>,
19005
19006 /// Output only. A token, which can be sent as `page_token` to retrieve the
19007 /// next page. If this field is omitted, there are no subsequent pages.
19008 pub next_page_token: std::string::String,
19009
19010 /// Output only. Locations that could not be reached.
19011 pub unreachable: std::vec::Vec<std::string::String>,
19012
19013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19014}
19015
19016impl ListCutoverJobsResponse {
19017 /// Creates a new default instance.
19018 pub fn new() -> Self {
19019 std::default::Default::default()
19020 }
19021
19022 /// Sets the value of [cutover_jobs][crate::model::ListCutoverJobsResponse::cutover_jobs].
19023 ///
19024 /// # Example
19025 /// ```ignore,no_run
19026 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsResponse;
19027 /// use google_cloud_vmmigration_v1::model::CutoverJob;
19028 /// let x = ListCutoverJobsResponse::new()
19029 /// .set_cutover_jobs([
19030 /// CutoverJob::default()/* use setters */,
19031 /// CutoverJob::default()/* use (different) setters */,
19032 /// ]);
19033 /// ```
19034 pub fn set_cutover_jobs<T, V>(mut self, v: T) -> Self
19035 where
19036 T: std::iter::IntoIterator<Item = V>,
19037 V: std::convert::Into<crate::model::CutoverJob>,
19038 {
19039 use std::iter::Iterator;
19040 self.cutover_jobs = v.into_iter().map(|i| i.into()).collect();
19041 self
19042 }
19043
19044 /// Sets the value of [next_page_token][crate::model::ListCutoverJobsResponse::next_page_token].
19045 ///
19046 /// # Example
19047 /// ```ignore,no_run
19048 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsResponse;
19049 /// let x = ListCutoverJobsResponse::new().set_next_page_token("example");
19050 /// ```
19051 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19052 self.next_page_token = v.into();
19053 self
19054 }
19055
19056 /// Sets the value of [unreachable][crate::model::ListCutoverJobsResponse::unreachable].
19057 ///
19058 /// # Example
19059 /// ```ignore,no_run
19060 /// # use google_cloud_vmmigration_v1::model::ListCutoverJobsResponse;
19061 /// let x = ListCutoverJobsResponse::new().set_unreachable(["a", "b", "c"]);
19062 /// ```
19063 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
19064 where
19065 T: std::iter::IntoIterator<Item = V>,
19066 V: std::convert::Into<std::string::String>,
19067 {
19068 use std::iter::Iterator;
19069 self.unreachable = v.into_iter().map(|i| i.into()).collect();
19070 self
19071 }
19072}
19073
19074impl wkt::message::Message for ListCutoverJobsResponse {
19075 fn typename() -> &'static str {
19076 "type.googleapis.com/google.cloud.vmmigration.v1.ListCutoverJobsResponse"
19077 }
19078}
19079
19080#[doc(hidden)]
19081impl google_cloud_gax::paginator::internal::PageableResponse for ListCutoverJobsResponse {
19082 type PageItem = crate::model::CutoverJob;
19083
19084 fn items(self) -> std::vec::Vec<Self::PageItem> {
19085 self.cutover_jobs
19086 }
19087
19088 fn next_page_token(&self) -> std::string::String {
19089 use std::clone::Clone;
19090 self.next_page_token.clone()
19091 }
19092}
19093
19094/// Request message for 'GetCutoverJob' request.
19095#[derive(Clone, Default, PartialEq)]
19096#[non_exhaustive]
19097pub struct GetCutoverJobRequest {
19098 /// Required. The name of the CutoverJob.
19099 pub name: std::string::String,
19100
19101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19102}
19103
19104impl GetCutoverJobRequest {
19105 /// Creates a new default instance.
19106 pub fn new() -> Self {
19107 std::default::Default::default()
19108 }
19109
19110 /// Sets the value of [name][crate::model::GetCutoverJobRequest::name].
19111 ///
19112 /// # Example
19113 /// ```ignore,no_run
19114 /// # use google_cloud_vmmigration_v1::model::GetCutoverJobRequest;
19115 /// # let project_id = "project_id";
19116 /// # let location_id = "location_id";
19117 /// # let source_id = "source_id";
19118 /// # let migrating_vm_id = "migrating_vm_id";
19119 /// # let cutover_job_id = "cutover_job_id";
19120 /// let x = GetCutoverJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/cutoverJobs/{cutover_job_id}"));
19121 /// ```
19122 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19123 self.name = v.into();
19124 self
19125 }
19126}
19127
19128impl wkt::message::Message for GetCutoverJobRequest {
19129 fn typename() -> &'static str {
19130 "type.googleapis.com/google.cloud.vmmigration.v1.GetCutoverJobRequest"
19131 }
19132}
19133
19134/// Represents the metadata of the long-running operation.
19135#[derive(Clone, Default, PartialEq)]
19136#[non_exhaustive]
19137pub struct OperationMetadata {
19138 /// Output only. The time the operation was created.
19139 pub create_time: std::option::Option<wkt::Timestamp>,
19140
19141 /// Output only. The time the operation finished running.
19142 pub end_time: std::option::Option<wkt::Timestamp>,
19143
19144 /// Output only. Server-defined resource path for the target of the operation.
19145 pub target: std::string::String,
19146
19147 /// Output only. Name of the verb executed by the operation.
19148 pub verb: std::string::String,
19149
19150 /// Output only. Human-readable status of the operation, if any.
19151 pub status_message: std::string::String,
19152
19153 /// Output only. Identifies whether the user has requested cancellation
19154 /// of the operation. Operations that have successfully been cancelled
19155 /// have [Operation.error][] value with a
19156 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
19157 /// `Code.CANCELLED`.
19158 pub requested_cancellation: bool,
19159
19160 /// Output only. API version used to start the operation.
19161 pub api_version: std::string::String,
19162
19163 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19164}
19165
19166impl OperationMetadata {
19167 /// Creates a new default instance.
19168 pub fn new() -> Self {
19169 std::default::Default::default()
19170 }
19171
19172 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
19173 ///
19174 /// # Example
19175 /// ```ignore,no_run
19176 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19177 /// use wkt::Timestamp;
19178 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
19179 /// ```
19180 pub fn set_create_time<T>(mut self, v: T) -> Self
19181 where
19182 T: std::convert::Into<wkt::Timestamp>,
19183 {
19184 self.create_time = std::option::Option::Some(v.into());
19185 self
19186 }
19187
19188 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
19189 ///
19190 /// # Example
19191 /// ```ignore,no_run
19192 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19193 /// use wkt::Timestamp;
19194 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
19195 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
19196 /// ```
19197 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
19198 where
19199 T: std::convert::Into<wkt::Timestamp>,
19200 {
19201 self.create_time = v.map(|x| x.into());
19202 self
19203 }
19204
19205 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
19206 ///
19207 /// # Example
19208 /// ```ignore,no_run
19209 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19210 /// use wkt::Timestamp;
19211 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
19212 /// ```
19213 pub fn set_end_time<T>(mut self, v: T) -> Self
19214 where
19215 T: std::convert::Into<wkt::Timestamp>,
19216 {
19217 self.end_time = std::option::Option::Some(v.into());
19218 self
19219 }
19220
19221 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
19222 ///
19223 /// # Example
19224 /// ```ignore,no_run
19225 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19226 /// use wkt::Timestamp;
19227 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
19228 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
19229 /// ```
19230 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
19231 where
19232 T: std::convert::Into<wkt::Timestamp>,
19233 {
19234 self.end_time = v.map(|x| x.into());
19235 self
19236 }
19237
19238 /// Sets the value of [target][crate::model::OperationMetadata::target].
19239 ///
19240 /// # Example
19241 /// ```ignore,no_run
19242 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19243 /// let x = OperationMetadata::new().set_target("example");
19244 /// ```
19245 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19246 self.target = v.into();
19247 self
19248 }
19249
19250 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
19251 ///
19252 /// # Example
19253 /// ```ignore,no_run
19254 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19255 /// let x = OperationMetadata::new().set_verb("example");
19256 /// ```
19257 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19258 self.verb = v.into();
19259 self
19260 }
19261
19262 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
19263 ///
19264 /// # Example
19265 /// ```ignore,no_run
19266 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19267 /// let x = OperationMetadata::new().set_status_message("example");
19268 /// ```
19269 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19270 self.status_message = v.into();
19271 self
19272 }
19273
19274 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
19275 ///
19276 /// # Example
19277 /// ```ignore,no_run
19278 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19279 /// let x = OperationMetadata::new().set_requested_cancellation(true);
19280 /// ```
19281 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19282 self.requested_cancellation = v.into();
19283 self
19284 }
19285
19286 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
19287 ///
19288 /// # Example
19289 /// ```ignore,no_run
19290 /// # use google_cloud_vmmigration_v1::model::OperationMetadata;
19291 /// let x = OperationMetadata::new().set_api_version("example");
19292 /// ```
19293 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19294 self.api_version = v.into();
19295 self
19296 }
19297}
19298
19299impl wkt::message::Message for OperationMetadata {
19300 fn typename() -> &'static str {
19301 "type.googleapis.com/google.cloud.vmmigration.v1.OperationMetadata"
19302 }
19303}
19304
19305/// Represents migration resource error information that can be used with
19306/// google.rpc.Status message. MigrationError is used to present the user with
19307/// error information in migration operations.
19308#[derive(Clone, Default, PartialEq)]
19309#[non_exhaustive]
19310pub struct MigrationError {
19311 /// Output only. The error code.
19312 pub code: crate::model::migration_error::ErrorCode,
19313
19314 /// Output only. The localized error message.
19315 pub error_message: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
19316
19317 /// Output only. Suggested action for solving the error.
19318 pub action_item: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
19319
19320 /// Output only. URL(s) pointing to additional information on handling the
19321 /// current error.
19322 pub help_links: std::vec::Vec<google_cloud_rpc::model::help::Link>,
19323
19324 /// Output only. The time the error occurred.
19325 pub error_time: std::option::Option<wkt::Timestamp>,
19326
19327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19328}
19329
19330impl MigrationError {
19331 /// Creates a new default instance.
19332 pub fn new() -> Self {
19333 std::default::Default::default()
19334 }
19335
19336 /// Sets the value of [code][crate::model::MigrationError::code].
19337 ///
19338 /// # Example
19339 /// ```ignore,no_run
19340 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19341 /// use google_cloud_vmmigration_v1::model::migration_error::ErrorCode;
19342 /// let x0 = MigrationError::new().set_code(ErrorCode::UnknownError);
19343 /// let x1 = MigrationError::new().set_code(ErrorCode::SourceValidationError);
19344 /// let x2 = MigrationError::new().set_code(ErrorCode::SourceReplicationError);
19345 /// ```
19346 pub fn set_code<T: std::convert::Into<crate::model::migration_error::ErrorCode>>(
19347 mut self,
19348 v: T,
19349 ) -> Self {
19350 self.code = v.into();
19351 self
19352 }
19353
19354 /// Sets the value of [error_message][crate::model::MigrationError::error_message].
19355 ///
19356 /// # Example
19357 /// ```ignore,no_run
19358 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19359 /// use google_cloud_rpc::model::LocalizedMessage;
19360 /// let x = MigrationError::new().set_error_message(LocalizedMessage::default()/* use setters */);
19361 /// ```
19362 pub fn set_error_message<T>(mut self, v: T) -> Self
19363 where
19364 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19365 {
19366 self.error_message = std::option::Option::Some(v.into());
19367 self
19368 }
19369
19370 /// Sets or clears the value of [error_message][crate::model::MigrationError::error_message].
19371 ///
19372 /// # Example
19373 /// ```ignore,no_run
19374 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19375 /// use google_cloud_rpc::model::LocalizedMessage;
19376 /// let x = MigrationError::new().set_or_clear_error_message(Some(LocalizedMessage::default()/* use setters */));
19377 /// let x = MigrationError::new().set_or_clear_error_message(None::<LocalizedMessage>);
19378 /// ```
19379 pub fn set_or_clear_error_message<T>(mut self, v: std::option::Option<T>) -> Self
19380 where
19381 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19382 {
19383 self.error_message = v.map(|x| x.into());
19384 self
19385 }
19386
19387 /// Sets the value of [action_item][crate::model::MigrationError::action_item].
19388 ///
19389 /// # Example
19390 /// ```ignore,no_run
19391 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19392 /// use google_cloud_rpc::model::LocalizedMessage;
19393 /// let x = MigrationError::new().set_action_item(LocalizedMessage::default()/* use setters */);
19394 /// ```
19395 pub fn set_action_item<T>(mut self, v: T) -> Self
19396 where
19397 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19398 {
19399 self.action_item = std::option::Option::Some(v.into());
19400 self
19401 }
19402
19403 /// Sets or clears the value of [action_item][crate::model::MigrationError::action_item].
19404 ///
19405 /// # Example
19406 /// ```ignore,no_run
19407 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19408 /// use google_cloud_rpc::model::LocalizedMessage;
19409 /// let x = MigrationError::new().set_or_clear_action_item(Some(LocalizedMessage::default()/* use setters */));
19410 /// let x = MigrationError::new().set_or_clear_action_item(None::<LocalizedMessage>);
19411 /// ```
19412 pub fn set_or_clear_action_item<T>(mut self, v: std::option::Option<T>) -> Self
19413 where
19414 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19415 {
19416 self.action_item = v.map(|x| x.into());
19417 self
19418 }
19419
19420 /// Sets the value of [help_links][crate::model::MigrationError::help_links].
19421 ///
19422 /// # Example
19423 /// ```ignore,no_run
19424 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19425 /// use google_cloud_rpc::model::help::Link;
19426 /// let x = MigrationError::new()
19427 /// .set_help_links([
19428 /// Link::default()/* use setters */,
19429 /// Link::default()/* use (different) setters */,
19430 /// ]);
19431 /// ```
19432 pub fn set_help_links<T, V>(mut self, v: T) -> Self
19433 where
19434 T: std::iter::IntoIterator<Item = V>,
19435 V: std::convert::Into<google_cloud_rpc::model::help::Link>,
19436 {
19437 use std::iter::Iterator;
19438 self.help_links = v.into_iter().map(|i| i.into()).collect();
19439 self
19440 }
19441
19442 /// Sets the value of [error_time][crate::model::MigrationError::error_time].
19443 ///
19444 /// # Example
19445 /// ```ignore,no_run
19446 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19447 /// use wkt::Timestamp;
19448 /// let x = MigrationError::new().set_error_time(Timestamp::default()/* use setters */);
19449 /// ```
19450 pub fn set_error_time<T>(mut self, v: T) -> Self
19451 where
19452 T: std::convert::Into<wkt::Timestamp>,
19453 {
19454 self.error_time = std::option::Option::Some(v.into());
19455 self
19456 }
19457
19458 /// Sets or clears the value of [error_time][crate::model::MigrationError::error_time].
19459 ///
19460 /// # Example
19461 /// ```ignore,no_run
19462 /// # use google_cloud_vmmigration_v1::model::MigrationError;
19463 /// use wkt::Timestamp;
19464 /// let x = MigrationError::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
19465 /// let x = MigrationError::new().set_or_clear_error_time(None::<Timestamp>);
19466 /// ```
19467 pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
19468 where
19469 T: std::convert::Into<wkt::Timestamp>,
19470 {
19471 self.error_time = v.map(|x| x.into());
19472 self
19473 }
19474}
19475
19476impl wkt::message::Message for MigrationError {
19477 fn typename() -> &'static str {
19478 "type.googleapis.com/google.cloud.vmmigration.v1.MigrationError"
19479 }
19480}
19481
19482/// Defines additional types related to [MigrationError].
19483pub mod migration_error {
19484 #[allow(unused_imports)]
19485 use super::*;
19486
19487 /// Represents resource error codes.
19488 ///
19489 /// # Working with unknown values
19490 ///
19491 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19492 /// additional enum variants at any time. Adding new variants is not considered
19493 /// a breaking change. Applications should write their code in anticipation of:
19494 ///
19495 /// - New values appearing in future releases of the client library, **and**
19496 /// - New values received dynamically, without application changes.
19497 ///
19498 /// Please consult the [Working with enums] section in the user guide for some
19499 /// guidelines.
19500 ///
19501 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19502 #[derive(Clone, Debug, PartialEq)]
19503 #[non_exhaustive]
19504 pub enum ErrorCode {
19505 /// Default value. This value is not used.
19506 Unspecified,
19507 /// Migrate to Virtual Machines encountered an unknown error.
19508 UnknownError,
19509 /// Migrate to Virtual Machines encountered an error while validating
19510 /// replication source health.
19511 SourceValidationError,
19512 /// Migrate to Virtual Machines encountered an error during source data
19513 /// operation.
19514 SourceReplicationError,
19515 /// Migrate to Virtual Machines encountered an error during target data
19516 /// operation.
19517 TargetReplicationError,
19518 /// Migrate to Virtual Machines encountered an error during OS adaptation.
19519 OsAdaptationError,
19520 /// Migrate to Virtual Machines encountered an error in clone operation.
19521 CloneError,
19522 /// Migrate to Virtual Machines encountered an error in cutover operation.
19523 CutoverError,
19524 /// Migrate to Virtual Machines encountered an error during utilization
19525 /// report creation.
19526 UtilizationReportError,
19527 /// Migrate to Virtual Machines encountered an error during appliance
19528 /// upgrade.
19529 ApplianceUpgradeError,
19530 /// Migrate to Virtual Machines encountered an error in image import
19531 /// operation.
19532 ImageImportError,
19533 /// Migrate to Virtual Machines encountered an error in disk migration
19534 /// operation.
19535 DiskMigrationError,
19536 /// If set, the enum was initialized with an unknown value.
19537 ///
19538 /// Applications can examine the value using [ErrorCode::value] or
19539 /// [ErrorCode::name].
19540 UnknownValue(error_code::UnknownValue),
19541 }
19542
19543 #[doc(hidden)]
19544 pub mod error_code {
19545 #[allow(unused_imports)]
19546 use super::*;
19547 #[derive(Clone, Debug, PartialEq)]
19548 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19549 }
19550
19551 impl ErrorCode {
19552 /// Gets the enum value.
19553 ///
19554 /// Returns `None` if the enum contains an unknown value deserialized from
19555 /// the string representation of enums.
19556 pub fn value(&self) -> std::option::Option<i32> {
19557 match self {
19558 Self::Unspecified => std::option::Option::Some(0),
19559 Self::UnknownError => std::option::Option::Some(1),
19560 Self::SourceValidationError => std::option::Option::Some(2),
19561 Self::SourceReplicationError => std::option::Option::Some(3),
19562 Self::TargetReplicationError => std::option::Option::Some(4),
19563 Self::OsAdaptationError => std::option::Option::Some(5),
19564 Self::CloneError => std::option::Option::Some(6),
19565 Self::CutoverError => std::option::Option::Some(7),
19566 Self::UtilizationReportError => std::option::Option::Some(8),
19567 Self::ApplianceUpgradeError => std::option::Option::Some(9),
19568 Self::ImageImportError => std::option::Option::Some(10),
19569 Self::DiskMigrationError => std::option::Option::Some(11),
19570 Self::UnknownValue(u) => u.0.value(),
19571 }
19572 }
19573
19574 /// Gets the enum value as a string.
19575 ///
19576 /// Returns `None` if the enum contains an unknown value deserialized from
19577 /// the integer representation of enums.
19578 pub fn name(&self) -> std::option::Option<&str> {
19579 match self {
19580 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
19581 Self::UnknownError => std::option::Option::Some("UNKNOWN_ERROR"),
19582 Self::SourceValidationError => std::option::Option::Some("SOURCE_VALIDATION_ERROR"),
19583 Self::SourceReplicationError => {
19584 std::option::Option::Some("SOURCE_REPLICATION_ERROR")
19585 }
19586 Self::TargetReplicationError => {
19587 std::option::Option::Some("TARGET_REPLICATION_ERROR")
19588 }
19589 Self::OsAdaptationError => std::option::Option::Some("OS_ADAPTATION_ERROR"),
19590 Self::CloneError => std::option::Option::Some("CLONE_ERROR"),
19591 Self::CutoverError => std::option::Option::Some("CUTOVER_ERROR"),
19592 Self::UtilizationReportError => {
19593 std::option::Option::Some("UTILIZATION_REPORT_ERROR")
19594 }
19595 Self::ApplianceUpgradeError => std::option::Option::Some("APPLIANCE_UPGRADE_ERROR"),
19596 Self::ImageImportError => std::option::Option::Some("IMAGE_IMPORT_ERROR"),
19597 Self::DiskMigrationError => std::option::Option::Some("DISK_MIGRATION_ERROR"),
19598 Self::UnknownValue(u) => u.0.name(),
19599 }
19600 }
19601 }
19602
19603 impl std::default::Default for ErrorCode {
19604 fn default() -> Self {
19605 use std::convert::From;
19606 Self::from(0)
19607 }
19608 }
19609
19610 impl std::fmt::Display for ErrorCode {
19611 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19612 wkt::internal::display_enum(f, self.name(), self.value())
19613 }
19614 }
19615
19616 impl std::convert::From<i32> for ErrorCode {
19617 fn from(value: i32) -> Self {
19618 match value {
19619 0 => Self::Unspecified,
19620 1 => Self::UnknownError,
19621 2 => Self::SourceValidationError,
19622 3 => Self::SourceReplicationError,
19623 4 => Self::TargetReplicationError,
19624 5 => Self::OsAdaptationError,
19625 6 => Self::CloneError,
19626 7 => Self::CutoverError,
19627 8 => Self::UtilizationReportError,
19628 9 => Self::ApplianceUpgradeError,
19629 10 => Self::ImageImportError,
19630 11 => Self::DiskMigrationError,
19631 _ => Self::UnknownValue(error_code::UnknownValue(
19632 wkt::internal::UnknownEnumValue::Integer(value),
19633 )),
19634 }
19635 }
19636 }
19637
19638 impl std::convert::From<&str> for ErrorCode {
19639 fn from(value: &str) -> Self {
19640 use std::string::ToString;
19641 match value {
19642 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
19643 "UNKNOWN_ERROR" => Self::UnknownError,
19644 "SOURCE_VALIDATION_ERROR" => Self::SourceValidationError,
19645 "SOURCE_REPLICATION_ERROR" => Self::SourceReplicationError,
19646 "TARGET_REPLICATION_ERROR" => Self::TargetReplicationError,
19647 "OS_ADAPTATION_ERROR" => Self::OsAdaptationError,
19648 "CLONE_ERROR" => Self::CloneError,
19649 "CUTOVER_ERROR" => Self::CutoverError,
19650 "UTILIZATION_REPORT_ERROR" => Self::UtilizationReportError,
19651 "APPLIANCE_UPGRADE_ERROR" => Self::ApplianceUpgradeError,
19652 "IMAGE_IMPORT_ERROR" => Self::ImageImportError,
19653 "DISK_MIGRATION_ERROR" => Self::DiskMigrationError,
19654 _ => Self::UnknownValue(error_code::UnknownValue(
19655 wkt::internal::UnknownEnumValue::String(value.to_string()),
19656 )),
19657 }
19658 }
19659 }
19660
19661 impl serde::ser::Serialize for ErrorCode {
19662 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19663 where
19664 S: serde::Serializer,
19665 {
19666 match self {
19667 Self::Unspecified => serializer.serialize_i32(0),
19668 Self::UnknownError => serializer.serialize_i32(1),
19669 Self::SourceValidationError => serializer.serialize_i32(2),
19670 Self::SourceReplicationError => serializer.serialize_i32(3),
19671 Self::TargetReplicationError => serializer.serialize_i32(4),
19672 Self::OsAdaptationError => serializer.serialize_i32(5),
19673 Self::CloneError => serializer.serialize_i32(6),
19674 Self::CutoverError => serializer.serialize_i32(7),
19675 Self::UtilizationReportError => serializer.serialize_i32(8),
19676 Self::ApplianceUpgradeError => serializer.serialize_i32(9),
19677 Self::ImageImportError => serializer.serialize_i32(10),
19678 Self::DiskMigrationError => serializer.serialize_i32(11),
19679 Self::UnknownValue(u) => u.0.serialize(serializer),
19680 }
19681 }
19682 }
19683
19684 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
19685 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19686 where
19687 D: serde::Deserializer<'de>,
19688 {
19689 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
19690 ".google.cloud.vmmigration.v1.MigrationError.ErrorCode",
19691 ))
19692 }
19693 }
19694}
19695
19696/// Represents migration resource warning information that can be used with
19697/// google.rpc.Status message. MigrationWarning is used to present the user with
19698/// warning information in migration operations.
19699#[derive(Clone, Default, PartialEq)]
19700#[non_exhaustive]
19701pub struct MigrationWarning {
19702 /// The warning code.
19703 pub code: crate::model::migration_warning::WarningCode,
19704
19705 /// Output only. The localized warning message.
19706 pub warning_message: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
19707
19708 /// Output only. Suggested action for solving the warning.
19709 pub action_item: std::option::Option<google_cloud_rpc::model::LocalizedMessage>,
19710
19711 /// Output only. URL(s) pointing to additional information on handling the
19712 /// current warning.
19713 pub help_links: std::vec::Vec<google_cloud_rpc::model::help::Link>,
19714
19715 /// The time the warning occurred.
19716 pub warning_time: std::option::Option<wkt::Timestamp>,
19717
19718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19719}
19720
19721impl MigrationWarning {
19722 /// Creates a new default instance.
19723 pub fn new() -> Self {
19724 std::default::Default::default()
19725 }
19726
19727 /// Sets the value of [code][crate::model::MigrationWarning::code].
19728 ///
19729 /// # Example
19730 /// ```ignore,no_run
19731 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19732 /// use google_cloud_vmmigration_v1::model::migration_warning::WarningCode;
19733 /// let x0 = MigrationWarning::new().set_code(WarningCode::AdaptationWarning);
19734 /// ```
19735 pub fn set_code<T: std::convert::Into<crate::model::migration_warning::WarningCode>>(
19736 mut self,
19737 v: T,
19738 ) -> Self {
19739 self.code = v.into();
19740 self
19741 }
19742
19743 /// Sets the value of [warning_message][crate::model::MigrationWarning::warning_message].
19744 ///
19745 /// # Example
19746 /// ```ignore,no_run
19747 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19748 /// use google_cloud_rpc::model::LocalizedMessage;
19749 /// let x = MigrationWarning::new().set_warning_message(LocalizedMessage::default()/* use setters */);
19750 /// ```
19751 pub fn set_warning_message<T>(mut self, v: T) -> Self
19752 where
19753 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19754 {
19755 self.warning_message = std::option::Option::Some(v.into());
19756 self
19757 }
19758
19759 /// Sets or clears the value of [warning_message][crate::model::MigrationWarning::warning_message].
19760 ///
19761 /// # Example
19762 /// ```ignore,no_run
19763 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19764 /// use google_cloud_rpc::model::LocalizedMessage;
19765 /// let x = MigrationWarning::new().set_or_clear_warning_message(Some(LocalizedMessage::default()/* use setters */));
19766 /// let x = MigrationWarning::new().set_or_clear_warning_message(None::<LocalizedMessage>);
19767 /// ```
19768 pub fn set_or_clear_warning_message<T>(mut self, v: std::option::Option<T>) -> Self
19769 where
19770 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19771 {
19772 self.warning_message = v.map(|x| x.into());
19773 self
19774 }
19775
19776 /// Sets the value of [action_item][crate::model::MigrationWarning::action_item].
19777 ///
19778 /// # Example
19779 /// ```ignore,no_run
19780 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19781 /// use google_cloud_rpc::model::LocalizedMessage;
19782 /// let x = MigrationWarning::new().set_action_item(LocalizedMessage::default()/* use setters */);
19783 /// ```
19784 pub fn set_action_item<T>(mut self, v: T) -> Self
19785 where
19786 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19787 {
19788 self.action_item = std::option::Option::Some(v.into());
19789 self
19790 }
19791
19792 /// Sets or clears the value of [action_item][crate::model::MigrationWarning::action_item].
19793 ///
19794 /// # Example
19795 /// ```ignore,no_run
19796 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19797 /// use google_cloud_rpc::model::LocalizedMessage;
19798 /// let x = MigrationWarning::new().set_or_clear_action_item(Some(LocalizedMessage::default()/* use setters */));
19799 /// let x = MigrationWarning::new().set_or_clear_action_item(None::<LocalizedMessage>);
19800 /// ```
19801 pub fn set_or_clear_action_item<T>(mut self, v: std::option::Option<T>) -> Self
19802 where
19803 T: std::convert::Into<google_cloud_rpc::model::LocalizedMessage>,
19804 {
19805 self.action_item = v.map(|x| x.into());
19806 self
19807 }
19808
19809 /// Sets the value of [help_links][crate::model::MigrationWarning::help_links].
19810 ///
19811 /// # Example
19812 /// ```ignore,no_run
19813 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19814 /// use google_cloud_rpc::model::help::Link;
19815 /// let x = MigrationWarning::new()
19816 /// .set_help_links([
19817 /// Link::default()/* use setters */,
19818 /// Link::default()/* use (different) setters */,
19819 /// ]);
19820 /// ```
19821 pub fn set_help_links<T, V>(mut self, v: T) -> Self
19822 where
19823 T: std::iter::IntoIterator<Item = V>,
19824 V: std::convert::Into<google_cloud_rpc::model::help::Link>,
19825 {
19826 use std::iter::Iterator;
19827 self.help_links = v.into_iter().map(|i| i.into()).collect();
19828 self
19829 }
19830
19831 /// Sets the value of [warning_time][crate::model::MigrationWarning::warning_time].
19832 ///
19833 /// # Example
19834 /// ```ignore,no_run
19835 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19836 /// use wkt::Timestamp;
19837 /// let x = MigrationWarning::new().set_warning_time(Timestamp::default()/* use setters */);
19838 /// ```
19839 pub fn set_warning_time<T>(mut self, v: T) -> Self
19840 where
19841 T: std::convert::Into<wkt::Timestamp>,
19842 {
19843 self.warning_time = std::option::Option::Some(v.into());
19844 self
19845 }
19846
19847 /// Sets or clears the value of [warning_time][crate::model::MigrationWarning::warning_time].
19848 ///
19849 /// # Example
19850 /// ```ignore,no_run
19851 /// # use google_cloud_vmmigration_v1::model::MigrationWarning;
19852 /// use wkt::Timestamp;
19853 /// let x = MigrationWarning::new().set_or_clear_warning_time(Some(Timestamp::default()/* use setters */));
19854 /// let x = MigrationWarning::new().set_or_clear_warning_time(None::<Timestamp>);
19855 /// ```
19856 pub fn set_or_clear_warning_time<T>(mut self, v: std::option::Option<T>) -> Self
19857 where
19858 T: std::convert::Into<wkt::Timestamp>,
19859 {
19860 self.warning_time = v.map(|x| x.into());
19861 self
19862 }
19863}
19864
19865impl wkt::message::Message for MigrationWarning {
19866 fn typename() -> &'static str {
19867 "type.googleapis.com/google.cloud.vmmigration.v1.MigrationWarning"
19868 }
19869}
19870
19871/// Defines additional types related to [MigrationWarning].
19872pub mod migration_warning {
19873 #[allow(unused_imports)]
19874 use super::*;
19875
19876 /// Represents possible warning codes.
19877 ///
19878 /// # Working with unknown values
19879 ///
19880 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19881 /// additional enum variants at any time. Adding new variants is not considered
19882 /// a breaking change. Applications should write their code in anticipation of:
19883 ///
19884 /// - New values appearing in future releases of the client library, **and**
19885 /// - New values received dynamically, without application changes.
19886 ///
19887 /// Please consult the [Working with enums] section in the user guide for some
19888 /// guidelines.
19889 ///
19890 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19891 #[derive(Clone, Debug, PartialEq)]
19892 #[non_exhaustive]
19893 pub enum WarningCode {
19894 /// Default value. This value is not used.
19895 Unspecified,
19896 /// A warning originated from OS Adaptation.
19897 AdaptationWarning,
19898 /// If set, the enum was initialized with an unknown value.
19899 ///
19900 /// Applications can examine the value using [WarningCode::value] or
19901 /// [WarningCode::name].
19902 UnknownValue(warning_code::UnknownValue),
19903 }
19904
19905 #[doc(hidden)]
19906 pub mod warning_code {
19907 #[allow(unused_imports)]
19908 use super::*;
19909 #[derive(Clone, Debug, PartialEq)]
19910 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19911 }
19912
19913 impl WarningCode {
19914 /// Gets the enum value.
19915 ///
19916 /// Returns `None` if the enum contains an unknown value deserialized from
19917 /// the string representation of enums.
19918 pub fn value(&self) -> std::option::Option<i32> {
19919 match self {
19920 Self::Unspecified => std::option::Option::Some(0),
19921 Self::AdaptationWarning => std::option::Option::Some(1),
19922 Self::UnknownValue(u) => u.0.value(),
19923 }
19924 }
19925
19926 /// Gets the enum value as a string.
19927 ///
19928 /// Returns `None` if the enum contains an unknown value deserialized from
19929 /// the integer representation of enums.
19930 pub fn name(&self) -> std::option::Option<&str> {
19931 match self {
19932 Self::Unspecified => std::option::Option::Some("WARNING_CODE_UNSPECIFIED"),
19933 Self::AdaptationWarning => std::option::Option::Some("ADAPTATION_WARNING"),
19934 Self::UnknownValue(u) => u.0.name(),
19935 }
19936 }
19937 }
19938
19939 impl std::default::Default for WarningCode {
19940 fn default() -> Self {
19941 use std::convert::From;
19942 Self::from(0)
19943 }
19944 }
19945
19946 impl std::fmt::Display for WarningCode {
19947 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19948 wkt::internal::display_enum(f, self.name(), self.value())
19949 }
19950 }
19951
19952 impl std::convert::From<i32> for WarningCode {
19953 fn from(value: i32) -> Self {
19954 match value {
19955 0 => Self::Unspecified,
19956 1 => Self::AdaptationWarning,
19957 _ => Self::UnknownValue(warning_code::UnknownValue(
19958 wkt::internal::UnknownEnumValue::Integer(value),
19959 )),
19960 }
19961 }
19962 }
19963
19964 impl std::convert::From<&str> for WarningCode {
19965 fn from(value: &str) -> Self {
19966 use std::string::ToString;
19967 match value {
19968 "WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
19969 "ADAPTATION_WARNING" => Self::AdaptationWarning,
19970 _ => Self::UnknownValue(warning_code::UnknownValue(
19971 wkt::internal::UnknownEnumValue::String(value.to_string()),
19972 )),
19973 }
19974 }
19975 }
19976
19977 impl serde::ser::Serialize for WarningCode {
19978 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19979 where
19980 S: serde::Serializer,
19981 {
19982 match self {
19983 Self::Unspecified => serializer.serialize_i32(0),
19984 Self::AdaptationWarning => serializer.serialize_i32(1),
19985 Self::UnknownValue(u) => u.0.serialize(serializer),
19986 }
19987 }
19988 }
19989
19990 impl<'de> serde::de::Deserialize<'de> for WarningCode {
19991 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19992 where
19993 D: serde::Deserializer<'de>,
19994 {
19995 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WarningCode>::new(
19996 ".google.cloud.vmmigration.v1.MigrationWarning.WarningCode",
19997 ))
19998 }
19999 }
20000}
20001
20002/// Represent the source Vmware VM details.
20003#[derive(Clone, Default, PartialEq)]
20004#[non_exhaustive]
20005pub struct VmwareSourceVmDetails {
20006 /// Output only. The firmware type of the source VM.
20007 pub firmware: crate::model::vmware_source_vm_details::Firmware,
20008
20009 /// Output only. The total size of the disks being migrated in bytes.
20010 pub committed_storage_bytes: i64,
20011
20012 /// Output only. The disks attached to the source VM.
20013 pub disks: std::vec::Vec<crate::model::vmware_source_vm_details::VmwareDiskDetails>,
20014
20015 /// Output only. Information about VM capabilities needed for some Compute
20016 /// Engine features.
20017 pub vm_capabilities_info: std::option::Option<crate::model::VmCapabilities>,
20018
20019 /// Output only. The VM architecture.
20020 pub architecture: crate::model::VmArchitecture,
20021
20022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20023}
20024
20025impl VmwareSourceVmDetails {
20026 /// Creates a new default instance.
20027 pub fn new() -> Self {
20028 std::default::Default::default()
20029 }
20030
20031 /// Sets the value of [firmware][crate::model::VmwareSourceVmDetails::firmware].
20032 ///
20033 /// # Example
20034 /// ```ignore,no_run
20035 /// # use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
20036 /// use google_cloud_vmmigration_v1::model::vmware_source_vm_details::Firmware;
20037 /// let x0 = VmwareSourceVmDetails::new().set_firmware(Firmware::Efi);
20038 /// let x1 = VmwareSourceVmDetails::new().set_firmware(Firmware::Bios);
20039 /// ```
20040 pub fn set_firmware<T: std::convert::Into<crate::model::vmware_source_vm_details::Firmware>>(
20041 mut self,
20042 v: T,
20043 ) -> Self {
20044 self.firmware = v.into();
20045 self
20046 }
20047
20048 /// Sets the value of [committed_storage_bytes][crate::model::VmwareSourceVmDetails::committed_storage_bytes].
20049 ///
20050 /// # Example
20051 /// ```ignore,no_run
20052 /// # use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
20053 /// let x = VmwareSourceVmDetails::new().set_committed_storage_bytes(42);
20054 /// ```
20055 pub fn set_committed_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20056 self.committed_storage_bytes = v.into();
20057 self
20058 }
20059
20060 /// Sets the value of [disks][crate::model::VmwareSourceVmDetails::disks].
20061 ///
20062 /// # Example
20063 /// ```ignore,no_run
20064 /// # use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
20065 /// use google_cloud_vmmigration_v1::model::vmware_source_vm_details::VmwareDiskDetails;
20066 /// let x = VmwareSourceVmDetails::new()
20067 /// .set_disks([
20068 /// VmwareDiskDetails::default()/* use setters */,
20069 /// VmwareDiskDetails::default()/* use (different) setters */,
20070 /// ]);
20071 /// ```
20072 pub fn set_disks<T, V>(mut self, v: T) -> Self
20073 where
20074 T: std::iter::IntoIterator<Item = V>,
20075 V: std::convert::Into<crate::model::vmware_source_vm_details::VmwareDiskDetails>,
20076 {
20077 use std::iter::Iterator;
20078 self.disks = v.into_iter().map(|i| i.into()).collect();
20079 self
20080 }
20081
20082 /// Sets the value of [vm_capabilities_info][crate::model::VmwareSourceVmDetails::vm_capabilities_info].
20083 ///
20084 /// # Example
20085 /// ```ignore,no_run
20086 /// # use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
20087 /// use google_cloud_vmmigration_v1::model::VmCapabilities;
20088 /// let x = VmwareSourceVmDetails::new().set_vm_capabilities_info(VmCapabilities::default()/* use setters */);
20089 /// ```
20090 pub fn set_vm_capabilities_info<T>(mut self, v: T) -> Self
20091 where
20092 T: std::convert::Into<crate::model::VmCapabilities>,
20093 {
20094 self.vm_capabilities_info = std::option::Option::Some(v.into());
20095 self
20096 }
20097
20098 /// Sets or clears the value of [vm_capabilities_info][crate::model::VmwareSourceVmDetails::vm_capabilities_info].
20099 ///
20100 /// # Example
20101 /// ```ignore,no_run
20102 /// # use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
20103 /// use google_cloud_vmmigration_v1::model::VmCapabilities;
20104 /// let x = VmwareSourceVmDetails::new().set_or_clear_vm_capabilities_info(Some(VmCapabilities::default()/* use setters */));
20105 /// let x = VmwareSourceVmDetails::new().set_or_clear_vm_capabilities_info(None::<VmCapabilities>);
20106 /// ```
20107 pub fn set_or_clear_vm_capabilities_info<T>(mut self, v: std::option::Option<T>) -> Self
20108 where
20109 T: std::convert::Into<crate::model::VmCapabilities>,
20110 {
20111 self.vm_capabilities_info = v.map(|x| x.into());
20112 self
20113 }
20114
20115 /// Sets the value of [architecture][crate::model::VmwareSourceVmDetails::architecture].
20116 ///
20117 /// # Example
20118 /// ```ignore,no_run
20119 /// # use google_cloud_vmmigration_v1::model::VmwareSourceVmDetails;
20120 /// use google_cloud_vmmigration_v1::model::VmArchitecture;
20121 /// let x0 = VmwareSourceVmDetails::new().set_architecture(VmArchitecture::X86Family);
20122 /// let x1 = VmwareSourceVmDetails::new().set_architecture(VmArchitecture::Arm64);
20123 /// ```
20124 pub fn set_architecture<T: std::convert::Into<crate::model::VmArchitecture>>(
20125 mut self,
20126 v: T,
20127 ) -> Self {
20128 self.architecture = v.into();
20129 self
20130 }
20131}
20132
20133impl wkt::message::Message for VmwareSourceVmDetails {
20134 fn typename() -> &'static str {
20135 "type.googleapis.com/google.cloud.vmmigration.v1.VmwareSourceVmDetails"
20136 }
20137}
20138
20139/// Defines additional types related to [VmwareSourceVmDetails].
20140pub mod vmware_source_vm_details {
20141 #[allow(unused_imports)]
20142 use super::*;
20143
20144 /// The details of a Vmware VM disk.
20145 #[derive(Clone, Default, PartialEq)]
20146 #[non_exhaustive]
20147 pub struct VmwareDiskDetails {
20148 /// Output only. The ordinal number of the disk.
20149 pub disk_number: i32,
20150
20151 /// Output only. Size in GB.
20152 pub size_gb: i64,
20153
20154 /// Output only. The disk label.
20155 pub label: std::string::String,
20156
20157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20158 }
20159
20160 impl VmwareDiskDetails {
20161 /// Creates a new default instance.
20162 pub fn new() -> Self {
20163 std::default::Default::default()
20164 }
20165
20166 /// Sets the value of [disk_number][crate::model::vmware_source_vm_details::VmwareDiskDetails::disk_number].
20167 ///
20168 /// # Example
20169 /// ```ignore,no_run
20170 /// # use google_cloud_vmmigration_v1::model::vmware_source_vm_details::VmwareDiskDetails;
20171 /// let x = VmwareDiskDetails::new().set_disk_number(42);
20172 /// ```
20173 pub fn set_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20174 self.disk_number = v.into();
20175 self
20176 }
20177
20178 /// Sets the value of [size_gb][crate::model::vmware_source_vm_details::VmwareDiskDetails::size_gb].
20179 ///
20180 /// # Example
20181 /// ```ignore,no_run
20182 /// # use google_cloud_vmmigration_v1::model::vmware_source_vm_details::VmwareDiskDetails;
20183 /// let x = VmwareDiskDetails::new().set_size_gb(42);
20184 /// ```
20185 pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20186 self.size_gb = v.into();
20187 self
20188 }
20189
20190 /// Sets the value of [label][crate::model::vmware_source_vm_details::VmwareDiskDetails::label].
20191 ///
20192 /// # Example
20193 /// ```ignore,no_run
20194 /// # use google_cloud_vmmigration_v1::model::vmware_source_vm_details::VmwareDiskDetails;
20195 /// let x = VmwareDiskDetails::new().set_label("example");
20196 /// ```
20197 pub fn set_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20198 self.label = v.into();
20199 self
20200 }
20201 }
20202
20203 impl wkt::message::Message for VmwareDiskDetails {
20204 fn typename() -> &'static str {
20205 "type.googleapis.com/google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetails"
20206 }
20207 }
20208
20209 /// Possible values for Vmware VM firmware.
20210 ///
20211 /// # Working with unknown values
20212 ///
20213 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20214 /// additional enum variants at any time. Adding new variants is not considered
20215 /// a breaking change. Applications should write their code in anticipation of:
20216 ///
20217 /// - New values appearing in future releases of the client library, **and**
20218 /// - New values received dynamically, without application changes.
20219 ///
20220 /// Please consult the [Working with enums] section in the user guide for some
20221 /// guidelines.
20222 ///
20223 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20224 #[derive(Clone, Debug, PartialEq)]
20225 #[non_exhaustive]
20226 pub enum Firmware {
20227 /// The firmware is unknown.
20228 Unspecified,
20229 /// The firmware is EFI.
20230 Efi,
20231 /// The firmware is BIOS.
20232 Bios,
20233 /// If set, the enum was initialized with an unknown value.
20234 ///
20235 /// Applications can examine the value using [Firmware::value] or
20236 /// [Firmware::name].
20237 UnknownValue(firmware::UnknownValue),
20238 }
20239
20240 #[doc(hidden)]
20241 pub mod firmware {
20242 #[allow(unused_imports)]
20243 use super::*;
20244 #[derive(Clone, Debug, PartialEq)]
20245 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20246 }
20247
20248 impl Firmware {
20249 /// Gets the enum value.
20250 ///
20251 /// Returns `None` if the enum contains an unknown value deserialized from
20252 /// the string representation of enums.
20253 pub fn value(&self) -> std::option::Option<i32> {
20254 match self {
20255 Self::Unspecified => std::option::Option::Some(0),
20256 Self::Efi => std::option::Option::Some(1),
20257 Self::Bios => std::option::Option::Some(2),
20258 Self::UnknownValue(u) => u.0.value(),
20259 }
20260 }
20261
20262 /// Gets the enum value as a string.
20263 ///
20264 /// Returns `None` if the enum contains an unknown value deserialized from
20265 /// the integer representation of enums.
20266 pub fn name(&self) -> std::option::Option<&str> {
20267 match self {
20268 Self::Unspecified => std::option::Option::Some("FIRMWARE_UNSPECIFIED"),
20269 Self::Efi => std::option::Option::Some("EFI"),
20270 Self::Bios => std::option::Option::Some("BIOS"),
20271 Self::UnknownValue(u) => u.0.name(),
20272 }
20273 }
20274 }
20275
20276 impl std::default::Default for Firmware {
20277 fn default() -> Self {
20278 use std::convert::From;
20279 Self::from(0)
20280 }
20281 }
20282
20283 impl std::fmt::Display for Firmware {
20284 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20285 wkt::internal::display_enum(f, self.name(), self.value())
20286 }
20287 }
20288
20289 impl std::convert::From<i32> for Firmware {
20290 fn from(value: i32) -> Self {
20291 match value {
20292 0 => Self::Unspecified,
20293 1 => Self::Efi,
20294 2 => Self::Bios,
20295 _ => Self::UnknownValue(firmware::UnknownValue(
20296 wkt::internal::UnknownEnumValue::Integer(value),
20297 )),
20298 }
20299 }
20300 }
20301
20302 impl std::convert::From<&str> for Firmware {
20303 fn from(value: &str) -> Self {
20304 use std::string::ToString;
20305 match value {
20306 "FIRMWARE_UNSPECIFIED" => Self::Unspecified,
20307 "EFI" => Self::Efi,
20308 "BIOS" => Self::Bios,
20309 _ => Self::UnknownValue(firmware::UnknownValue(
20310 wkt::internal::UnknownEnumValue::String(value.to_string()),
20311 )),
20312 }
20313 }
20314 }
20315
20316 impl serde::ser::Serialize for Firmware {
20317 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20318 where
20319 S: serde::Serializer,
20320 {
20321 match self {
20322 Self::Unspecified => serializer.serialize_i32(0),
20323 Self::Efi => serializer.serialize_i32(1),
20324 Self::Bios => serializer.serialize_i32(2),
20325 Self::UnknownValue(u) => u.0.serialize(serializer),
20326 }
20327 }
20328 }
20329
20330 impl<'de> serde::de::Deserialize<'de> for Firmware {
20331 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20332 where
20333 D: serde::Deserializer<'de>,
20334 {
20335 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Firmware>::new(
20336 ".google.cloud.vmmigration.v1.VmwareSourceVmDetails.Firmware",
20337 ))
20338 }
20339 }
20340}
20341
20342/// Represent the source AWS VM details.
20343#[derive(Clone, Default, PartialEq)]
20344#[non_exhaustive]
20345pub struct AwsSourceVmDetails {
20346 /// Output only. The firmware type of the source VM.
20347 pub firmware: crate::model::aws_source_vm_details::Firmware,
20348
20349 /// Output only. The total size of the disks being migrated in bytes.
20350 pub committed_storage_bytes: i64,
20351
20352 /// Output only. The disks attached to the source VM.
20353 pub disks: std::vec::Vec<crate::model::aws_source_vm_details::AwsDiskDetails>,
20354
20355 /// Output only. Information about VM capabilities needed for some Compute
20356 /// Engine features.
20357 pub vm_capabilities_info: std::option::Option<crate::model::VmCapabilities>,
20358
20359 /// Output only. The VM architecture.
20360 pub architecture: crate::model::VmArchitecture,
20361
20362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20363}
20364
20365impl AwsSourceVmDetails {
20366 /// Creates a new default instance.
20367 pub fn new() -> Self {
20368 std::default::Default::default()
20369 }
20370
20371 /// Sets the value of [firmware][crate::model::AwsSourceVmDetails::firmware].
20372 ///
20373 /// # Example
20374 /// ```ignore,no_run
20375 /// # use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
20376 /// use google_cloud_vmmigration_v1::model::aws_source_vm_details::Firmware;
20377 /// let x0 = AwsSourceVmDetails::new().set_firmware(Firmware::Efi);
20378 /// let x1 = AwsSourceVmDetails::new().set_firmware(Firmware::Bios);
20379 /// ```
20380 pub fn set_firmware<T: std::convert::Into<crate::model::aws_source_vm_details::Firmware>>(
20381 mut self,
20382 v: T,
20383 ) -> Self {
20384 self.firmware = v.into();
20385 self
20386 }
20387
20388 /// Sets the value of [committed_storage_bytes][crate::model::AwsSourceVmDetails::committed_storage_bytes].
20389 ///
20390 /// # Example
20391 /// ```ignore,no_run
20392 /// # use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
20393 /// let x = AwsSourceVmDetails::new().set_committed_storage_bytes(42);
20394 /// ```
20395 pub fn set_committed_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20396 self.committed_storage_bytes = v.into();
20397 self
20398 }
20399
20400 /// Sets the value of [disks][crate::model::AwsSourceVmDetails::disks].
20401 ///
20402 /// # Example
20403 /// ```ignore,no_run
20404 /// # use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
20405 /// use google_cloud_vmmigration_v1::model::aws_source_vm_details::AwsDiskDetails;
20406 /// let x = AwsSourceVmDetails::new()
20407 /// .set_disks([
20408 /// AwsDiskDetails::default()/* use setters */,
20409 /// AwsDiskDetails::default()/* use (different) setters */,
20410 /// ]);
20411 /// ```
20412 pub fn set_disks<T, V>(mut self, v: T) -> Self
20413 where
20414 T: std::iter::IntoIterator<Item = V>,
20415 V: std::convert::Into<crate::model::aws_source_vm_details::AwsDiskDetails>,
20416 {
20417 use std::iter::Iterator;
20418 self.disks = v.into_iter().map(|i| i.into()).collect();
20419 self
20420 }
20421
20422 /// Sets the value of [vm_capabilities_info][crate::model::AwsSourceVmDetails::vm_capabilities_info].
20423 ///
20424 /// # Example
20425 /// ```ignore,no_run
20426 /// # use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
20427 /// use google_cloud_vmmigration_v1::model::VmCapabilities;
20428 /// let x = AwsSourceVmDetails::new().set_vm_capabilities_info(VmCapabilities::default()/* use setters */);
20429 /// ```
20430 pub fn set_vm_capabilities_info<T>(mut self, v: T) -> Self
20431 where
20432 T: std::convert::Into<crate::model::VmCapabilities>,
20433 {
20434 self.vm_capabilities_info = std::option::Option::Some(v.into());
20435 self
20436 }
20437
20438 /// Sets or clears the value of [vm_capabilities_info][crate::model::AwsSourceVmDetails::vm_capabilities_info].
20439 ///
20440 /// # Example
20441 /// ```ignore,no_run
20442 /// # use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
20443 /// use google_cloud_vmmigration_v1::model::VmCapabilities;
20444 /// let x = AwsSourceVmDetails::new().set_or_clear_vm_capabilities_info(Some(VmCapabilities::default()/* use setters */));
20445 /// let x = AwsSourceVmDetails::new().set_or_clear_vm_capabilities_info(None::<VmCapabilities>);
20446 /// ```
20447 pub fn set_or_clear_vm_capabilities_info<T>(mut self, v: std::option::Option<T>) -> Self
20448 where
20449 T: std::convert::Into<crate::model::VmCapabilities>,
20450 {
20451 self.vm_capabilities_info = v.map(|x| x.into());
20452 self
20453 }
20454
20455 /// Sets the value of [architecture][crate::model::AwsSourceVmDetails::architecture].
20456 ///
20457 /// # Example
20458 /// ```ignore,no_run
20459 /// # use google_cloud_vmmigration_v1::model::AwsSourceVmDetails;
20460 /// use google_cloud_vmmigration_v1::model::VmArchitecture;
20461 /// let x0 = AwsSourceVmDetails::new().set_architecture(VmArchitecture::X86Family);
20462 /// let x1 = AwsSourceVmDetails::new().set_architecture(VmArchitecture::Arm64);
20463 /// ```
20464 pub fn set_architecture<T: std::convert::Into<crate::model::VmArchitecture>>(
20465 mut self,
20466 v: T,
20467 ) -> Self {
20468 self.architecture = v.into();
20469 self
20470 }
20471}
20472
20473impl wkt::message::Message for AwsSourceVmDetails {
20474 fn typename() -> &'static str {
20475 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceVmDetails"
20476 }
20477}
20478
20479/// Defines additional types related to [AwsSourceVmDetails].
20480pub mod aws_source_vm_details {
20481 #[allow(unused_imports)]
20482 use super::*;
20483
20484 /// The details of an AWS instance disk.
20485 #[derive(Clone, Default, PartialEq)]
20486 #[non_exhaustive]
20487 pub struct AwsDiskDetails {
20488 /// Output only. The ordinal number of the disk.
20489 pub disk_number: i32,
20490
20491 /// Output only. AWS volume ID.
20492 pub volume_id: std::string::String,
20493
20494 /// Output only. Size in GB.
20495 pub size_gb: i64,
20496
20497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20498 }
20499
20500 impl AwsDiskDetails {
20501 /// Creates a new default instance.
20502 pub fn new() -> Self {
20503 std::default::Default::default()
20504 }
20505
20506 /// Sets the value of [disk_number][crate::model::aws_source_vm_details::AwsDiskDetails::disk_number].
20507 ///
20508 /// # Example
20509 /// ```ignore,no_run
20510 /// # use google_cloud_vmmigration_v1::model::aws_source_vm_details::AwsDiskDetails;
20511 /// let x = AwsDiskDetails::new().set_disk_number(42);
20512 /// ```
20513 pub fn set_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20514 self.disk_number = v.into();
20515 self
20516 }
20517
20518 /// Sets the value of [volume_id][crate::model::aws_source_vm_details::AwsDiskDetails::volume_id].
20519 ///
20520 /// # Example
20521 /// ```ignore,no_run
20522 /// # use google_cloud_vmmigration_v1::model::aws_source_vm_details::AwsDiskDetails;
20523 /// let x = AwsDiskDetails::new().set_volume_id("example");
20524 /// ```
20525 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20526 self.volume_id = v.into();
20527 self
20528 }
20529
20530 /// Sets the value of [size_gb][crate::model::aws_source_vm_details::AwsDiskDetails::size_gb].
20531 ///
20532 /// # Example
20533 /// ```ignore,no_run
20534 /// # use google_cloud_vmmigration_v1::model::aws_source_vm_details::AwsDiskDetails;
20535 /// let x = AwsDiskDetails::new().set_size_gb(42);
20536 /// ```
20537 pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20538 self.size_gb = v.into();
20539 self
20540 }
20541 }
20542
20543 impl wkt::message::Message for AwsDiskDetails {
20544 fn typename() -> &'static str {
20545 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetails"
20546 }
20547 }
20548
20549 /// Possible values for AWS VM firmware.
20550 ///
20551 /// # Working with unknown values
20552 ///
20553 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20554 /// additional enum variants at any time. Adding new variants is not considered
20555 /// a breaking change. Applications should write their code in anticipation of:
20556 ///
20557 /// - New values appearing in future releases of the client library, **and**
20558 /// - New values received dynamically, without application changes.
20559 ///
20560 /// Please consult the [Working with enums] section in the user guide for some
20561 /// guidelines.
20562 ///
20563 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20564 #[derive(Clone, Debug, PartialEq)]
20565 #[non_exhaustive]
20566 pub enum Firmware {
20567 /// The firmware is unknown.
20568 Unspecified,
20569 /// The firmware is EFI.
20570 Efi,
20571 /// The firmware is BIOS.
20572 Bios,
20573 /// If set, the enum was initialized with an unknown value.
20574 ///
20575 /// Applications can examine the value using [Firmware::value] or
20576 /// [Firmware::name].
20577 UnknownValue(firmware::UnknownValue),
20578 }
20579
20580 #[doc(hidden)]
20581 pub mod firmware {
20582 #[allow(unused_imports)]
20583 use super::*;
20584 #[derive(Clone, Debug, PartialEq)]
20585 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20586 }
20587
20588 impl Firmware {
20589 /// Gets the enum value.
20590 ///
20591 /// Returns `None` if the enum contains an unknown value deserialized from
20592 /// the string representation of enums.
20593 pub fn value(&self) -> std::option::Option<i32> {
20594 match self {
20595 Self::Unspecified => std::option::Option::Some(0),
20596 Self::Efi => std::option::Option::Some(1),
20597 Self::Bios => std::option::Option::Some(2),
20598 Self::UnknownValue(u) => u.0.value(),
20599 }
20600 }
20601
20602 /// Gets the enum value as a string.
20603 ///
20604 /// Returns `None` if the enum contains an unknown value deserialized from
20605 /// the integer representation of enums.
20606 pub fn name(&self) -> std::option::Option<&str> {
20607 match self {
20608 Self::Unspecified => std::option::Option::Some("FIRMWARE_UNSPECIFIED"),
20609 Self::Efi => std::option::Option::Some("EFI"),
20610 Self::Bios => std::option::Option::Some("BIOS"),
20611 Self::UnknownValue(u) => u.0.name(),
20612 }
20613 }
20614 }
20615
20616 impl std::default::Default for Firmware {
20617 fn default() -> Self {
20618 use std::convert::From;
20619 Self::from(0)
20620 }
20621 }
20622
20623 impl std::fmt::Display for Firmware {
20624 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20625 wkt::internal::display_enum(f, self.name(), self.value())
20626 }
20627 }
20628
20629 impl std::convert::From<i32> for Firmware {
20630 fn from(value: i32) -> Self {
20631 match value {
20632 0 => Self::Unspecified,
20633 1 => Self::Efi,
20634 2 => Self::Bios,
20635 _ => Self::UnknownValue(firmware::UnknownValue(
20636 wkt::internal::UnknownEnumValue::Integer(value),
20637 )),
20638 }
20639 }
20640 }
20641
20642 impl std::convert::From<&str> for Firmware {
20643 fn from(value: &str) -> Self {
20644 use std::string::ToString;
20645 match value {
20646 "FIRMWARE_UNSPECIFIED" => Self::Unspecified,
20647 "EFI" => Self::Efi,
20648 "BIOS" => Self::Bios,
20649 _ => Self::UnknownValue(firmware::UnknownValue(
20650 wkt::internal::UnknownEnumValue::String(value.to_string()),
20651 )),
20652 }
20653 }
20654 }
20655
20656 impl serde::ser::Serialize for Firmware {
20657 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20658 where
20659 S: serde::Serializer,
20660 {
20661 match self {
20662 Self::Unspecified => serializer.serialize_i32(0),
20663 Self::Efi => serializer.serialize_i32(1),
20664 Self::Bios => serializer.serialize_i32(2),
20665 Self::UnknownValue(u) => u.0.serialize(serializer),
20666 }
20667 }
20668 }
20669
20670 impl<'de> serde::de::Deserialize<'de> for Firmware {
20671 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20672 where
20673 D: serde::Deserializer<'de>,
20674 {
20675 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Firmware>::new(
20676 ".google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware",
20677 ))
20678 }
20679 }
20680}
20681
20682/// Represent the source Azure VM details.
20683#[derive(Clone, Default, PartialEq)]
20684#[non_exhaustive]
20685pub struct AzureSourceVmDetails {
20686 /// Output only. The firmware type of the source VM.
20687 pub firmware: crate::model::azure_source_vm_details::Firmware,
20688
20689 /// Output only. The total size of the disks being migrated in bytes.
20690 pub committed_storage_bytes: i64,
20691
20692 /// Output only. The disks attached to the source VM.
20693 pub disks: std::vec::Vec<crate::model::azure_source_vm_details::AzureDiskDetails>,
20694
20695 /// Output only. Information about VM capabilities needed for some Compute
20696 /// Engine features.
20697 pub vm_capabilities_info: std::option::Option<crate::model::VmCapabilities>,
20698
20699 /// Output only. The VM architecture.
20700 pub architecture: crate::model::VmArchitecture,
20701
20702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20703}
20704
20705impl AzureSourceVmDetails {
20706 /// Creates a new default instance.
20707 pub fn new() -> Self {
20708 std::default::Default::default()
20709 }
20710
20711 /// Sets the value of [firmware][crate::model::AzureSourceVmDetails::firmware].
20712 ///
20713 /// # Example
20714 /// ```ignore,no_run
20715 /// # use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
20716 /// use google_cloud_vmmigration_v1::model::azure_source_vm_details::Firmware;
20717 /// let x0 = AzureSourceVmDetails::new().set_firmware(Firmware::Efi);
20718 /// let x1 = AzureSourceVmDetails::new().set_firmware(Firmware::Bios);
20719 /// ```
20720 pub fn set_firmware<T: std::convert::Into<crate::model::azure_source_vm_details::Firmware>>(
20721 mut self,
20722 v: T,
20723 ) -> Self {
20724 self.firmware = v.into();
20725 self
20726 }
20727
20728 /// Sets the value of [committed_storage_bytes][crate::model::AzureSourceVmDetails::committed_storage_bytes].
20729 ///
20730 /// # Example
20731 /// ```ignore,no_run
20732 /// # use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
20733 /// let x = AzureSourceVmDetails::new().set_committed_storage_bytes(42);
20734 /// ```
20735 pub fn set_committed_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20736 self.committed_storage_bytes = v.into();
20737 self
20738 }
20739
20740 /// Sets the value of [disks][crate::model::AzureSourceVmDetails::disks].
20741 ///
20742 /// # Example
20743 /// ```ignore,no_run
20744 /// # use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
20745 /// use google_cloud_vmmigration_v1::model::azure_source_vm_details::AzureDiskDetails;
20746 /// let x = AzureSourceVmDetails::new()
20747 /// .set_disks([
20748 /// AzureDiskDetails::default()/* use setters */,
20749 /// AzureDiskDetails::default()/* use (different) setters */,
20750 /// ]);
20751 /// ```
20752 pub fn set_disks<T, V>(mut self, v: T) -> Self
20753 where
20754 T: std::iter::IntoIterator<Item = V>,
20755 V: std::convert::Into<crate::model::azure_source_vm_details::AzureDiskDetails>,
20756 {
20757 use std::iter::Iterator;
20758 self.disks = v.into_iter().map(|i| i.into()).collect();
20759 self
20760 }
20761
20762 /// Sets the value of [vm_capabilities_info][crate::model::AzureSourceVmDetails::vm_capabilities_info].
20763 ///
20764 /// # Example
20765 /// ```ignore,no_run
20766 /// # use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
20767 /// use google_cloud_vmmigration_v1::model::VmCapabilities;
20768 /// let x = AzureSourceVmDetails::new().set_vm_capabilities_info(VmCapabilities::default()/* use setters */);
20769 /// ```
20770 pub fn set_vm_capabilities_info<T>(mut self, v: T) -> Self
20771 where
20772 T: std::convert::Into<crate::model::VmCapabilities>,
20773 {
20774 self.vm_capabilities_info = std::option::Option::Some(v.into());
20775 self
20776 }
20777
20778 /// Sets or clears the value of [vm_capabilities_info][crate::model::AzureSourceVmDetails::vm_capabilities_info].
20779 ///
20780 /// # Example
20781 /// ```ignore,no_run
20782 /// # use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
20783 /// use google_cloud_vmmigration_v1::model::VmCapabilities;
20784 /// let x = AzureSourceVmDetails::new().set_or_clear_vm_capabilities_info(Some(VmCapabilities::default()/* use setters */));
20785 /// let x = AzureSourceVmDetails::new().set_or_clear_vm_capabilities_info(None::<VmCapabilities>);
20786 /// ```
20787 pub fn set_or_clear_vm_capabilities_info<T>(mut self, v: std::option::Option<T>) -> Self
20788 where
20789 T: std::convert::Into<crate::model::VmCapabilities>,
20790 {
20791 self.vm_capabilities_info = v.map(|x| x.into());
20792 self
20793 }
20794
20795 /// Sets the value of [architecture][crate::model::AzureSourceVmDetails::architecture].
20796 ///
20797 /// # Example
20798 /// ```ignore,no_run
20799 /// # use google_cloud_vmmigration_v1::model::AzureSourceVmDetails;
20800 /// use google_cloud_vmmigration_v1::model::VmArchitecture;
20801 /// let x0 = AzureSourceVmDetails::new().set_architecture(VmArchitecture::X86Family);
20802 /// let x1 = AzureSourceVmDetails::new().set_architecture(VmArchitecture::Arm64);
20803 /// ```
20804 pub fn set_architecture<T: std::convert::Into<crate::model::VmArchitecture>>(
20805 mut self,
20806 v: T,
20807 ) -> Self {
20808 self.architecture = v.into();
20809 self
20810 }
20811}
20812
20813impl wkt::message::Message for AzureSourceVmDetails {
20814 fn typename() -> &'static str {
20815 "type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceVmDetails"
20816 }
20817}
20818
20819/// Defines additional types related to [AzureSourceVmDetails].
20820pub mod azure_source_vm_details {
20821 #[allow(unused_imports)]
20822 use super::*;
20823
20824 /// The details of an Azure VM disk.
20825 #[derive(Clone, Default, PartialEq)]
20826 #[non_exhaustive]
20827 pub struct AzureDiskDetails {
20828 /// Output only. The ordinal number of the disk.
20829 pub disk_number: i32,
20830
20831 /// Output only. Azure disk ID.
20832 pub disk_id: std::string::String,
20833
20834 /// Output only. Size in GB.
20835 pub size_gb: i64,
20836
20837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20838 }
20839
20840 impl AzureDiskDetails {
20841 /// Creates a new default instance.
20842 pub fn new() -> Self {
20843 std::default::Default::default()
20844 }
20845
20846 /// Sets the value of [disk_number][crate::model::azure_source_vm_details::AzureDiskDetails::disk_number].
20847 ///
20848 /// # Example
20849 /// ```ignore,no_run
20850 /// # use google_cloud_vmmigration_v1::model::azure_source_vm_details::AzureDiskDetails;
20851 /// let x = AzureDiskDetails::new().set_disk_number(42);
20852 /// ```
20853 pub fn set_disk_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20854 self.disk_number = v.into();
20855 self
20856 }
20857
20858 /// Sets the value of [disk_id][crate::model::azure_source_vm_details::AzureDiskDetails::disk_id].
20859 ///
20860 /// # Example
20861 /// ```ignore,no_run
20862 /// # use google_cloud_vmmigration_v1::model::azure_source_vm_details::AzureDiskDetails;
20863 /// let x = AzureDiskDetails::new().set_disk_id("example");
20864 /// ```
20865 pub fn set_disk_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20866 self.disk_id = v.into();
20867 self
20868 }
20869
20870 /// Sets the value of [size_gb][crate::model::azure_source_vm_details::AzureDiskDetails::size_gb].
20871 ///
20872 /// # Example
20873 /// ```ignore,no_run
20874 /// # use google_cloud_vmmigration_v1::model::azure_source_vm_details::AzureDiskDetails;
20875 /// let x = AzureDiskDetails::new().set_size_gb(42);
20876 /// ```
20877 pub fn set_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20878 self.size_gb = v.into();
20879 self
20880 }
20881 }
20882
20883 impl wkt::message::Message for AzureDiskDetails {
20884 fn typename() -> &'static str {
20885 "type.googleapis.com/google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetails"
20886 }
20887 }
20888
20889 /// Possible values for Azure VM firmware.
20890 ///
20891 /// # Working with unknown values
20892 ///
20893 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20894 /// additional enum variants at any time. Adding new variants is not considered
20895 /// a breaking change. Applications should write their code in anticipation of:
20896 ///
20897 /// - New values appearing in future releases of the client library, **and**
20898 /// - New values received dynamically, without application changes.
20899 ///
20900 /// Please consult the [Working with enums] section in the user guide for some
20901 /// guidelines.
20902 ///
20903 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20904 #[derive(Clone, Debug, PartialEq)]
20905 #[non_exhaustive]
20906 pub enum Firmware {
20907 /// The firmware is unknown.
20908 Unspecified,
20909 /// The firmware is EFI.
20910 Efi,
20911 /// The firmware is BIOS.
20912 Bios,
20913 /// If set, the enum was initialized with an unknown value.
20914 ///
20915 /// Applications can examine the value using [Firmware::value] or
20916 /// [Firmware::name].
20917 UnknownValue(firmware::UnknownValue),
20918 }
20919
20920 #[doc(hidden)]
20921 pub mod firmware {
20922 #[allow(unused_imports)]
20923 use super::*;
20924 #[derive(Clone, Debug, PartialEq)]
20925 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20926 }
20927
20928 impl Firmware {
20929 /// Gets the enum value.
20930 ///
20931 /// Returns `None` if the enum contains an unknown value deserialized from
20932 /// the string representation of enums.
20933 pub fn value(&self) -> std::option::Option<i32> {
20934 match self {
20935 Self::Unspecified => std::option::Option::Some(0),
20936 Self::Efi => std::option::Option::Some(1),
20937 Self::Bios => std::option::Option::Some(2),
20938 Self::UnknownValue(u) => u.0.value(),
20939 }
20940 }
20941
20942 /// Gets the enum value as a string.
20943 ///
20944 /// Returns `None` if the enum contains an unknown value deserialized from
20945 /// the integer representation of enums.
20946 pub fn name(&self) -> std::option::Option<&str> {
20947 match self {
20948 Self::Unspecified => std::option::Option::Some("FIRMWARE_UNSPECIFIED"),
20949 Self::Efi => std::option::Option::Some("EFI"),
20950 Self::Bios => std::option::Option::Some("BIOS"),
20951 Self::UnknownValue(u) => u.0.name(),
20952 }
20953 }
20954 }
20955
20956 impl std::default::Default for Firmware {
20957 fn default() -> Self {
20958 use std::convert::From;
20959 Self::from(0)
20960 }
20961 }
20962
20963 impl std::fmt::Display for Firmware {
20964 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20965 wkt::internal::display_enum(f, self.name(), self.value())
20966 }
20967 }
20968
20969 impl std::convert::From<i32> for Firmware {
20970 fn from(value: i32) -> Self {
20971 match value {
20972 0 => Self::Unspecified,
20973 1 => Self::Efi,
20974 2 => Self::Bios,
20975 _ => Self::UnknownValue(firmware::UnknownValue(
20976 wkt::internal::UnknownEnumValue::Integer(value),
20977 )),
20978 }
20979 }
20980 }
20981
20982 impl std::convert::From<&str> for Firmware {
20983 fn from(value: &str) -> Self {
20984 use std::string::ToString;
20985 match value {
20986 "FIRMWARE_UNSPECIFIED" => Self::Unspecified,
20987 "EFI" => Self::Efi,
20988 "BIOS" => Self::Bios,
20989 _ => Self::UnknownValue(firmware::UnknownValue(
20990 wkt::internal::UnknownEnumValue::String(value.to_string()),
20991 )),
20992 }
20993 }
20994 }
20995
20996 impl serde::ser::Serialize for Firmware {
20997 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20998 where
20999 S: serde::Serializer,
21000 {
21001 match self {
21002 Self::Unspecified => serializer.serialize_i32(0),
21003 Self::Efi => serializer.serialize_i32(1),
21004 Self::Bios => serializer.serialize_i32(2),
21005 Self::UnknownValue(u) => u.0.serialize(serializer),
21006 }
21007 }
21008 }
21009
21010 impl<'de> serde::de::Deserialize<'de> for Firmware {
21011 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21012 where
21013 D: serde::Deserializer<'de>,
21014 {
21015 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Firmware>::new(
21016 ".google.cloud.vmmigration.v1.AzureSourceVmDetails.Firmware",
21017 ))
21018 }
21019 }
21020}
21021
21022/// Request message for 'LisReplicationCyclesRequest' request.
21023#[derive(Clone, Default, PartialEq)]
21024#[non_exhaustive]
21025pub struct ListReplicationCyclesRequest {
21026 /// Required. The parent, which owns this collection of ReplicationCycles.
21027 pub parent: std::string::String,
21028
21029 /// Optional. The maximum number of replication cycles to return. The service
21030 /// may return fewer than this value. If unspecified, at most 100 migrating VMs
21031 /// will be returned. The maximum value is 100; values above 100 will be
21032 /// coerced to 100.
21033 pub page_size: i32,
21034
21035 /// Required. A page token, received from a previous `ListReplicationCycles`
21036 /// call. Provide this to retrieve the subsequent page.
21037 ///
21038 /// When paginating, all other parameters provided to `ListReplicationCycles`
21039 /// must match the call that provided the page token.
21040 pub page_token: std::string::String,
21041
21042 /// Optional. The filter request.
21043 pub filter: std::string::String,
21044
21045 /// Optional. the order by fields for the result.
21046 pub order_by: std::string::String,
21047
21048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21049}
21050
21051impl ListReplicationCyclesRequest {
21052 /// Creates a new default instance.
21053 pub fn new() -> Self {
21054 std::default::Default::default()
21055 }
21056
21057 /// Sets the value of [parent][crate::model::ListReplicationCyclesRequest::parent].
21058 ///
21059 /// # Example
21060 /// ```ignore,no_run
21061 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesRequest;
21062 /// # let project_id = "project_id";
21063 /// # let location_id = "location_id";
21064 /// # let source_id = "source_id";
21065 /// # let migrating_vm_id = "migrating_vm_id";
21066 /// let x = ListReplicationCyclesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}"));
21067 /// ```
21068 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21069 self.parent = v.into();
21070 self
21071 }
21072
21073 /// Sets the value of [page_size][crate::model::ListReplicationCyclesRequest::page_size].
21074 ///
21075 /// # Example
21076 /// ```ignore,no_run
21077 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesRequest;
21078 /// let x = ListReplicationCyclesRequest::new().set_page_size(42);
21079 /// ```
21080 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21081 self.page_size = v.into();
21082 self
21083 }
21084
21085 /// Sets the value of [page_token][crate::model::ListReplicationCyclesRequest::page_token].
21086 ///
21087 /// # Example
21088 /// ```ignore,no_run
21089 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesRequest;
21090 /// let x = ListReplicationCyclesRequest::new().set_page_token("example");
21091 /// ```
21092 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21093 self.page_token = v.into();
21094 self
21095 }
21096
21097 /// Sets the value of [filter][crate::model::ListReplicationCyclesRequest::filter].
21098 ///
21099 /// # Example
21100 /// ```ignore,no_run
21101 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesRequest;
21102 /// let x = ListReplicationCyclesRequest::new().set_filter("example");
21103 /// ```
21104 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21105 self.filter = v.into();
21106 self
21107 }
21108
21109 /// Sets the value of [order_by][crate::model::ListReplicationCyclesRequest::order_by].
21110 ///
21111 /// # Example
21112 /// ```ignore,no_run
21113 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesRequest;
21114 /// let x = ListReplicationCyclesRequest::new().set_order_by("example");
21115 /// ```
21116 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21117 self.order_by = v.into();
21118 self
21119 }
21120}
21121
21122impl wkt::message::Message for ListReplicationCyclesRequest {
21123 fn typename() -> &'static str {
21124 "type.googleapis.com/google.cloud.vmmigration.v1.ListReplicationCyclesRequest"
21125 }
21126}
21127
21128/// Response message for 'ListReplicationCycles' request.
21129#[derive(Clone, Default, PartialEq)]
21130#[non_exhaustive]
21131pub struct ListReplicationCyclesResponse {
21132 /// Output only. The list of replication cycles response.
21133 pub replication_cycles: std::vec::Vec<crate::model::ReplicationCycle>,
21134
21135 /// Output only. A token, which can be sent as `page_token` to retrieve the
21136 /// next page. If this field is omitted, there are no subsequent pages.
21137 pub next_page_token: std::string::String,
21138
21139 /// Output only. Locations that could not be reached.
21140 pub unreachable: std::vec::Vec<std::string::String>,
21141
21142 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21143}
21144
21145impl ListReplicationCyclesResponse {
21146 /// Creates a new default instance.
21147 pub fn new() -> Self {
21148 std::default::Default::default()
21149 }
21150
21151 /// Sets the value of [replication_cycles][crate::model::ListReplicationCyclesResponse::replication_cycles].
21152 ///
21153 /// # Example
21154 /// ```ignore,no_run
21155 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesResponse;
21156 /// use google_cloud_vmmigration_v1::model::ReplicationCycle;
21157 /// let x = ListReplicationCyclesResponse::new()
21158 /// .set_replication_cycles([
21159 /// ReplicationCycle::default()/* use setters */,
21160 /// ReplicationCycle::default()/* use (different) setters */,
21161 /// ]);
21162 /// ```
21163 pub fn set_replication_cycles<T, V>(mut self, v: T) -> Self
21164 where
21165 T: std::iter::IntoIterator<Item = V>,
21166 V: std::convert::Into<crate::model::ReplicationCycle>,
21167 {
21168 use std::iter::Iterator;
21169 self.replication_cycles = v.into_iter().map(|i| i.into()).collect();
21170 self
21171 }
21172
21173 /// Sets the value of [next_page_token][crate::model::ListReplicationCyclesResponse::next_page_token].
21174 ///
21175 /// # Example
21176 /// ```ignore,no_run
21177 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesResponse;
21178 /// let x = ListReplicationCyclesResponse::new().set_next_page_token("example");
21179 /// ```
21180 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21181 self.next_page_token = v.into();
21182 self
21183 }
21184
21185 /// Sets the value of [unreachable][crate::model::ListReplicationCyclesResponse::unreachable].
21186 ///
21187 /// # Example
21188 /// ```ignore,no_run
21189 /// # use google_cloud_vmmigration_v1::model::ListReplicationCyclesResponse;
21190 /// let x = ListReplicationCyclesResponse::new().set_unreachable(["a", "b", "c"]);
21191 /// ```
21192 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
21193 where
21194 T: std::iter::IntoIterator<Item = V>,
21195 V: std::convert::Into<std::string::String>,
21196 {
21197 use std::iter::Iterator;
21198 self.unreachable = v.into_iter().map(|i| i.into()).collect();
21199 self
21200 }
21201}
21202
21203impl wkt::message::Message for ListReplicationCyclesResponse {
21204 fn typename() -> &'static str {
21205 "type.googleapis.com/google.cloud.vmmigration.v1.ListReplicationCyclesResponse"
21206 }
21207}
21208
21209#[doc(hidden)]
21210impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationCyclesResponse {
21211 type PageItem = crate::model::ReplicationCycle;
21212
21213 fn items(self) -> std::vec::Vec<Self::PageItem> {
21214 self.replication_cycles
21215 }
21216
21217 fn next_page_token(&self) -> std::string::String {
21218 use std::clone::Clone;
21219 self.next_page_token.clone()
21220 }
21221}
21222
21223/// Request message for 'GetReplicationCycle' request.
21224#[derive(Clone, Default, PartialEq)]
21225#[non_exhaustive]
21226pub struct GetReplicationCycleRequest {
21227 /// Required. The name of the ReplicationCycle.
21228 pub name: std::string::String,
21229
21230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21231}
21232
21233impl GetReplicationCycleRequest {
21234 /// Creates a new default instance.
21235 pub fn new() -> Self {
21236 std::default::Default::default()
21237 }
21238
21239 /// Sets the value of [name][crate::model::GetReplicationCycleRequest::name].
21240 ///
21241 /// # Example
21242 /// ```ignore,no_run
21243 /// # use google_cloud_vmmigration_v1::model::GetReplicationCycleRequest;
21244 /// # let project_id = "project_id";
21245 /// # let location_id = "location_id";
21246 /// # let source_id = "source_id";
21247 /// # let migrating_vm_id = "migrating_vm_id";
21248 /// # let replication_cycle_id = "replication_cycle_id";
21249 /// let x = GetReplicationCycleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/migratingVms/{migrating_vm_id}/replicationCycles/{replication_cycle_id}"));
21250 /// ```
21251 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21252 self.name = v.into();
21253 self
21254 }
21255}
21256
21257impl wkt::message::Message for GetReplicationCycleRequest {
21258 fn typename() -> &'static str {
21259 "type.googleapis.com/google.cloud.vmmigration.v1.GetReplicationCycleRequest"
21260 }
21261}
21262
21263/// Migrating VM source information about the VM capabilities needed for some
21264/// Compute Engine features.
21265#[derive(Clone, Default, PartialEq)]
21266#[non_exhaustive]
21267pub struct VmCapabilities {
21268 /// Output only. Unordered list. List of certain VM OS capabilities needed for
21269 /// some Compute Engine features.
21270 pub os_capabilities: std::vec::Vec<crate::model::OsCapability>,
21271
21272 /// Output only. The last time OS capabilities list was updated.
21273 pub last_os_capabilities_update_time: std::option::Option<wkt::Timestamp>,
21274
21275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21276}
21277
21278impl VmCapabilities {
21279 /// Creates a new default instance.
21280 pub fn new() -> Self {
21281 std::default::Default::default()
21282 }
21283
21284 /// Sets the value of [os_capabilities][crate::model::VmCapabilities::os_capabilities].
21285 ///
21286 /// # Example
21287 /// ```ignore,no_run
21288 /// # use google_cloud_vmmigration_v1::model::VmCapabilities;
21289 /// use google_cloud_vmmigration_v1::model::OsCapability;
21290 /// let x = VmCapabilities::new().set_os_capabilities([
21291 /// OsCapability::NvmeStorageAccess,
21292 /// OsCapability::GvnicNetworkInterface,
21293 /// OsCapability::IdpfNetworkInterface,
21294 /// ]);
21295 /// ```
21296 pub fn set_os_capabilities<T, V>(mut self, v: T) -> Self
21297 where
21298 T: std::iter::IntoIterator<Item = V>,
21299 V: std::convert::Into<crate::model::OsCapability>,
21300 {
21301 use std::iter::Iterator;
21302 self.os_capabilities = v.into_iter().map(|i| i.into()).collect();
21303 self
21304 }
21305
21306 /// Sets the value of [last_os_capabilities_update_time][crate::model::VmCapabilities::last_os_capabilities_update_time].
21307 ///
21308 /// # Example
21309 /// ```ignore,no_run
21310 /// # use google_cloud_vmmigration_v1::model::VmCapabilities;
21311 /// use wkt::Timestamp;
21312 /// let x = VmCapabilities::new().set_last_os_capabilities_update_time(Timestamp::default()/* use setters */);
21313 /// ```
21314 pub fn set_last_os_capabilities_update_time<T>(mut self, v: T) -> Self
21315 where
21316 T: std::convert::Into<wkt::Timestamp>,
21317 {
21318 self.last_os_capabilities_update_time = std::option::Option::Some(v.into());
21319 self
21320 }
21321
21322 /// Sets or clears the value of [last_os_capabilities_update_time][crate::model::VmCapabilities::last_os_capabilities_update_time].
21323 ///
21324 /// # Example
21325 /// ```ignore,no_run
21326 /// # use google_cloud_vmmigration_v1::model::VmCapabilities;
21327 /// use wkt::Timestamp;
21328 /// let x = VmCapabilities::new().set_or_clear_last_os_capabilities_update_time(Some(Timestamp::default()/* use setters */));
21329 /// let x = VmCapabilities::new().set_or_clear_last_os_capabilities_update_time(None::<Timestamp>);
21330 /// ```
21331 pub fn set_or_clear_last_os_capabilities_update_time<T>(
21332 mut self,
21333 v: std::option::Option<T>,
21334 ) -> Self
21335 where
21336 T: std::convert::Into<wkt::Timestamp>,
21337 {
21338 self.last_os_capabilities_update_time = v.map(|x| x.into());
21339 self
21340 }
21341}
21342
21343impl wkt::message::Message for VmCapabilities {
21344 fn typename() -> &'static str {
21345 "type.googleapis.com/google.cloud.vmmigration.v1.VmCapabilities"
21346 }
21347}
21348
21349/// ImageImport describes the configuration of the image import to run.
21350#[derive(Clone, Default, PartialEq)]
21351#[non_exhaustive]
21352pub struct ImageImport {
21353 /// Output only. The resource path of the ImageImport.
21354 pub name: std::string::String,
21355
21356 /// Output only. The time the image import was created.
21357 pub create_time: std::option::Option<wkt::Timestamp>,
21358
21359 /// Output only. The result of the most recent runs for this ImageImport. All
21360 /// jobs for this ImageImport can be listed via ListImageImportJobs.
21361 pub recent_image_import_jobs: std::vec::Vec<crate::model::ImageImportJob>,
21362
21363 /// Immutable. The encryption details used by the image import process during
21364 /// the image adaptation for Compute Engine.
21365 pub encryption: std::option::Option<crate::model::Encryption>,
21366
21367 #[allow(missing_docs)]
21368 pub source: std::option::Option<crate::model::image_import::Source>,
21369
21370 /// The configuration of the resources that will be created in GCP as a result
21371 /// of the ImageImport.
21372 pub target_defaults: std::option::Option<crate::model::image_import::TargetDefaults>,
21373
21374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21375}
21376
21377impl ImageImport {
21378 /// Creates a new default instance.
21379 pub fn new() -> Self {
21380 std::default::Default::default()
21381 }
21382
21383 /// Sets the value of [name][crate::model::ImageImport::name].
21384 ///
21385 /// # Example
21386 /// ```ignore,no_run
21387 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21388 /// # let project_id = "project_id";
21389 /// # let location_id = "location_id";
21390 /// # let job_id = "job_id";
21391 /// let x = ImageImport::new().set_name(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}"));
21392 /// ```
21393 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21394 self.name = v.into();
21395 self
21396 }
21397
21398 /// Sets the value of [create_time][crate::model::ImageImport::create_time].
21399 ///
21400 /// # Example
21401 /// ```ignore,no_run
21402 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21403 /// use wkt::Timestamp;
21404 /// let x = ImageImport::new().set_create_time(Timestamp::default()/* use setters */);
21405 /// ```
21406 pub fn set_create_time<T>(mut self, v: T) -> Self
21407 where
21408 T: std::convert::Into<wkt::Timestamp>,
21409 {
21410 self.create_time = std::option::Option::Some(v.into());
21411 self
21412 }
21413
21414 /// Sets or clears the value of [create_time][crate::model::ImageImport::create_time].
21415 ///
21416 /// # Example
21417 /// ```ignore,no_run
21418 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21419 /// use wkt::Timestamp;
21420 /// let x = ImageImport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21421 /// let x = ImageImport::new().set_or_clear_create_time(None::<Timestamp>);
21422 /// ```
21423 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21424 where
21425 T: std::convert::Into<wkt::Timestamp>,
21426 {
21427 self.create_time = v.map(|x| x.into());
21428 self
21429 }
21430
21431 /// Sets the value of [recent_image_import_jobs][crate::model::ImageImport::recent_image_import_jobs].
21432 ///
21433 /// # Example
21434 /// ```ignore,no_run
21435 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21436 /// use google_cloud_vmmigration_v1::model::ImageImportJob;
21437 /// let x = ImageImport::new()
21438 /// .set_recent_image_import_jobs([
21439 /// ImageImportJob::default()/* use setters */,
21440 /// ImageImportJob::default()/* use (different) setters */,
21441 /// ]);
21442 /// ```
21443 pub fn set_recent_image_import_jobs<T, V>(mut self, v: T) -> Self
21444 where
21445 T: std::iter::IntoIterator<Item = V>,
21446 V: std::convert::Into<crate::model::ImageImportJob>,
21447 {
21448 use std::iter::Iterator;
21449 self.recent_image_import_jobs = v.into_iter().map(|i| i.into()).collect();
21450 self
21451 }
21452
21453 /// Sets the value of [encryption][crate::model::ImageImport::encryption].
21454 ///
21455 /// # Example
21456 /// ```ignore,no_run
21457 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21458 /// use google_cloud_vmmigration_v1::model::Encryption;
21459 /// let x = ImageImport::new().set_encryption(Encryption::default()/* use setters */);
21460 /// ```
21461 pub fn set_encryption<T>(mut self, v: T) -> Self
21462 where
21463 T: std::convert::Into<crate::model::Encryption>,
21464 {
21465 self.encryption = std::option::Option::Some(v.into());
21466 self
21467 }
21468
21469 /// Sets or clears the value of [encryption][crate::model::ImageImport::encryption].
21470 ///
21471 /// # Example
21472 /// ```ignore,no_run
21473 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21474 /// use google_cloud_vmmigration_v1::model::Encryption;
21475 /// let x = ImageImport::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
21476 /// let x = ImageImport::new().set_or_clear_encryption(None::<Encryption>);
21477 /// ```
21478 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
21479 where
21480 T: std::convert::Into<crate::model::Encryption>,
21481 {
21482 self.encryption = v.map(|x| x.into());
21483 self
21484 }
21485
21486 /// Sets the value of [source][crate::model::ImageImport::source].
21487 ///
21488 /// Note that all the setters affecting `source` are mutually
21489 /// exclusive.
21490 ///
21491 /// # Example
21492 /// ```ignore,no_run
21493 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21494 /// use google_cloud_vmmigration_v1::model::image_import::Source;
21495 /// let x = ImageImport::new().set_source(Some(Source::CloudStorageUri("example".to_string())));
21496 /// ```
21497 pub fn set_source<
21498 T: std::convert::Into<std::option::Option<crate::model::image_import::Source>>,
21499 >(
21500 mut self,
21501 v: T,
21502 ) -> Self {
21503 self.source = v.into();
21504 self
21505 }
21506
21507 /// The value of [source][crate::model::ImageImport::source]
21508 /// if it holds a `CloudStorageUri`, `None` if the field is not set or
21509 /// holds a different branch.
21510 pub fn cloud_storage_uri(&self) -> std::option::Option<&std::string::String> {
21511 #[allow(unreachable_patterns)]
21512 self.source.as_ref().and_then(|v| match v {
21513 crate::model::image_import::Source::CloudStorageUri(v) => std::option::Option::Some(v),
21514 _ => std::option::Option::None,
21515 })
21516 }
21517
21518 /// Sets the value of [source][crate::model::ImageImport::source]
21519 /// to hold a `CloudStorageUri`.
21520 ///
21521 /// Note that all the setters affecting `source` are
21522 /// mutually exclusive.
21523 ///
21524 /// # Example
21525 /// ```ignore,no_run
21526 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21527 /// let x = ImageImport::new().set_cloud_storage_uri("example");
21528 /// assert!(x.cloud_storage_uri().is_some());
21529 /// ```
21530 pub fn set_cloud_storage_uri<T: std::convert::Into<std::string::String>>(
21531 mut self,
21532 v: T,
21533 ) -> Self {
21534 self.source = std::option::Option::Some(
21535 crate::model::image_import::Source::CloudStorageUri(v.into()),
21536 );
21537 self
21538 }
21539
21540 /// Sets the value of [target_defaults][crate::model::ImageImport::target_defaults].
21541 ///
21542 /// Note that all the setters affecting `target_defaults` are mutually
21543 /// exclusive.
21544 ///
21545 /// # Example
21546 /// ```ignore,no_run
21547 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21548 /// use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
21549 /// let x = ImageImport::new().set_target_defaults(Some(
21550 /// google_cloud_vmmigration_v1::model::image_import::TargetDefaults::DiskImageTargetDefaults(DiskImageTargetDetails::default().into())));
21551 /// ```
21552 pub fn set_target_defaults<
21553 T: std::convert::Into<std::option::Option<crate::model::image_import::TargetDefaults>>,
21554 >(
21555 mut self,
21556 v: T,
21557 ) -> Self {
21558 self.target_defaults = v.into();
21559 self
21560 }
21561
21562 /// The value of [target_defaults][crate::model::ImageImport::target_defaults]
21563 /// if it holds a `DiskImageTargetDefaults`, `None` if the field is not set or
21564 /// holds a different branch.
21565 pub fn disk_image_target_defaults(
21566 &self,
21567 ) -> std::option::Option<&std::boxed::Box<crate::model::DiskImageTargetDetails>> {
21568 #[allow(unreachable_patterns)]
21569 self.target_defaults.as_ref().and_then(|v| match v {
21570 crate::model::image_import::TargetDefaults::DiskImageTargetDefaults(v) => {
21571 std::option::Option::Some(v)
21572 }
21573 _ => std::option::Option::None,
21574 })
21575 }
21576
21577 /// Sets the value of [target_defaults][crate::model::ImageImport::target_defaults]
21578 /// to hold a `DiskImageTargetDefaults`.
21579 ///
21580 /// Note that all the setters affecting `target_defaults` are
21581 /// mutually exclusive.
21582 ///
21583 /// # Example
21584 /// ```ignore,no_run
21585 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21586 /// use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
21587 /// let x = ImageImport::new().set_disk_image_target_defaults(DiskImageTargetDetails::default()/* use setters */);
21588 /// assert!(x.disk_image_target_defaults().is_some());
21589 /// assert!(x.machine_image_target_defaults().is_none());
21590 /// ```
21591 pub fn set_disk_image_target_defaults<
21592 T: std::convert::Into<std::boxed::Box<crate::model::DiskImageTargetDetails>>,
21593 >(
21594 mut self,
21595 v: T,
21596 ) -> Self {
21597 self.target_defaults = std::option::Option::Some(
21598 crate::model::image_import::TargetDefaults::DiskImageTargetDefaults(v.into()),
21599 );
21600 self
21601 }
21602
21603 /// The value of [target_defaults][crate::model::ImageImport::target_defaults]
21604 /// if it holds a `MachineImageTargetDefaults`, `None` if the field is not set or
21605 /// holds a different branch.
21606 pub fn machine_image_target_defaults(
21607 &self,
21608 ) -> std::option::Option<&std::boxed::Box<crate::model::MachineImageTargetDetails>> {
21609 #[allow(unreachable_patterns)]
21610 self.target_defaults.as_ref().and_then(|v| match v {
21611 crate::model::image_import::TargetDefaults::MachineImageTargetDefaults(v) => {
21612 std::option::Option::Some(v)
21613 }
21614 _ => std::option::Option::None,
21615 })
21616 }
21617
21618 /// Sets the value of [target_defaults][crate::model::ImageImport::target_defaults]
21619 /// to hold a `MachineImageTargetDefaults`.
21620 ///
21621 /// Note that all the setters affecting `target_defaults` are
21622 /// mutually exclusive.
21623 ///
21624 /// # Example
21625 /// ```ignore,no_run
21626 /// # use google_cloud_vmmigration_v1::model::ImageImport;
21627 /// use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
21628 /// let x = ImageImport::new().set_machine_image_target_defaults(MachineImageTargetDetails::default()/* use setters */);
21629 /// assert!(x.machine_image_target_defaults().is_some());
21630 /// assert!(x.disk_image_target_defaults().is_none());
21631 /// ```
21632 pub fn set_machine_image_target_defaults<
21633 T: std::convert::Into<std::boxed::Box<crate::model::MachineImageTargetDetails>>,
21634 >(
21635 mut self,
21636 v: T,
21637 ) -> Self {
21638 self.target_defaults = std::option::Option::Some(
21639 crate::model::image_import::TargetDefaults::MachineImageTargetDefaults(v.into()),
21640 );
21641 self
21642 }
21643}
21644
21645impl wkt::message::Message for ImageImport {
21646 fn typename() -> &'static str {
21647 "type.googleapis.com/google.cloud.vmmigration.v1.ImageImport"
21648 }
21649}
21650
21651/// Defines additional types related to [ImageImport].
21652pub mod image_import {
21653 #[allow(unused_imports)]
21654 use super::*;
21655
21656 #[allow(missing_docs)]
21657 #[derive(Clone, Debug, PartialEq)]
21658 #[non_exhaustive]
21659 pub enum Source {
21660 /// Immutable. The path to the Cloud Storage file from which the image should
21661 /// be imported.
21662 CloudStorageUri(std::string::String),
21663 }
21664
21665 /// The configuration of the resources that will be created in GCP as a result
21666 /// of the ImageImport.
21667 #[derive(Clone, Debug, PartialEq)]
21668 #[non_exhaustive]
21669 pub enum TargetDefaults {
21670 /// Immutable. Target details for importing a disk image, will be used by
21671 /// ImageImportJob.
21672 DiskImageTargetDefaults(std::boxed::Box<crate::model::DiskImageTargetDetails>),
21673 /// Immutable. Target details for importing a machine image, will be used by
21674 /// ImageImportJob.
21675 MachineImageTargetDefaults(std::boxed::Box<crate::model::MachineImageTargetDetails>),
21676 }
21677}
21678
21679/// ImageImportJob describes the progress and result of an image import.
21680#[derive(Clone, Default, PartialEq)]
21681#[non_exhaustive]
21682pub struct ImageImportJob {
21683 /// Output only. The resource path of the ImageImportJob.
21684 pub name: std::string::String,
21685
21686 /// Output only. The resource paths of the resources created by the image
21687 /// import job.
21688 pub created_resources: std::vec::Vec<std::string::String>,
21689
21690 /// Output only. The state of the image import.
21691 pub state: crate::model::image_import_job::State,
21692
21693 /// Output only. The time the image import was created (as an API call, not
21694 /// when it was actually created in the target).
21695 pub create_time: std::option::Option<wkt::Timestamp>,
21696
21697 /// Output only. The time the image import was ended.
21698 pub end_time: std::option::Option<wkt::Timestamp>,
21699
21700 /// Output only. Provides details on the error that led to the image import
21701 /// state in case of an error.
21702 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
21703
21704 /// Output only. Warnings that occurred during the image import.
21705 pub warnings: std::vec::Vec<crate::model::MigrationWarning>,
21706
21707 /// Output only. The image import steps list representing its progress.
21708 pub steps: std::vec::Vec<crate::model::ImageImportStep>,
21709
21710 #[allow(missing_docs)]
21711 pub source: std::option::Option<crate::model::image_import_job::Source>,
21712
21713 /// The configuration of the resources that were created in GCP as a result of
21714 /// the image import.
21715 pub target_details: std::option::Option<crate::model::image_import_job::TargetDetails>,
21716
21717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21718}
21719
21720impl ImageImportJob {
21721 /// Creates a new default instance.
21722 pub fn new() -> Self {
21723 std::default::Default::default()
21724 }
21725
21726 /// Sets the value of [name][crate::model::ImageImportJob::name].
21727 ///
21728 /// # Example
21729 /// ```ignore,no_run
21730 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21731 /// # let project_id = "project_id";
21732 /// # let location_id = "location_id";
21733 /// # let job_id = "job_id";
21734 /// # let result_id = "result_id";
21735 /// let x = ImageImportJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}/imageImportJobs/{result_id}"));
21736 /// ```
21737 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21738 self.name = v.into();
21739 self
21740 }
21741
21742 /// Sets the value of [created_resources][crate::model::ImageImportJob::created_resources].
21743 ///
21744 /// # Example
21745 /// ```ignore,no_run
21746 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21747 /// let x = ImageImportJob::new().set_created_resources(["a", "b", "c"]);
21748 /// ```
21749 pub fn set_created_resources<T, V>(mut self, v: T) -> Self
21750 where
21751 T: std::iter::IntoIterator<Item = V>,
21752 V: std::convert::Into<std::string::String>,
21753 {
21754 use std::iter::Iterator;
21755 self.created_resources = v.into_iter().map(|i| i.into()).collect();
21756 self
21757 }
21758
21759 /// Sets the value of [state][crate::model::ImageImportJob::state].
21760 ///
21761 /// # Example
21762 /// ```ignore,no_run
21763 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21764 /// use google_cloud_vmmigration_v1::model::image_import_job::State;
21765 /// let x0 = ImageImportJob::new().set_state(State::Pending);
21766 /// let x1 = ImageImportJob::new().set_state(State::Running);
21767 /// let x2 = ImageImportJob::new().set_state(State::Succeeded);
21768 /// ```
21769 pub fn set_state<T: std::convert::Into<crate::model::image_import_job::State>>(
21770 mut self,
21771 v: T,
21772 ) -> Self {
21773 self.state = v.into();
21774 self
21775 }
21776
21777 /// Sets the value of [create_time][crate::model::ImageImportJob::create_time].
21778 ///
21779 /// # Example
21780 /// ```ignore,no_run
21781 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21782 /// use wkt::Timestamp;
21783 /// let x = ImageImportJob::new().set_create_time(Timestamp::default()/* use setters */);
21784 /// ```
21785 pub fn set_create_time<T>(mut self, v: T) -> Self
21786 where
21787 T: std::convert::Into<wkt::Timestamp>,
21788 {
21789 self.create_time = std::option::Option::Some(v.into());
21790 self
21791 }
21792
21793 /// Sets or clears the value of [create_time][crate::model::ImageImportJob::create_time].
21794 ///
21795 /// # Example
21796 /// ```ignore,no_run
21797 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21798 /// use wkt::Timestamp;
21799 /// let x = ImageImportJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21800 /// let x = ImageImportJob::new().set_or_clear_create_time(None::<Timestamp>);
21801 /// ```
21802 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21803 where
21804 T: std::convert::Into<wkt::Timestamp>,
21805 {
21806 self.create_time = v.map(|x| x.into());
21807 self
21808 }
21809
21810 /// Sets the value of [end_time][crate::model::ImageImportJob::end_time].
21811 ///
21812 /// # Example
21813 /// ```ignore,no_run
21814 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21815 /// use wkt::Timestamp;
21816 /// let x = ImageImportJob::new().set_end_time(Timestamp::default()/* use setters */);
21817 /// ```
21818 pub fn set_end_time<T>(mut self, v: T) -> Self
21819 where
21820 T: std::convert::Into<wkt::Timestamp>,
21821 {
21822 self.end_time = std::option::Option::Some(v.into());
21823 self
21824 }
21825
21826 /// Sets or clears the value of [end_time][crate::model::ImageImportJob::end_time].
21827 ///
21828 /// # Example
21829 /// ```ignore,no_run
21830 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21831 /// use wkt::Timestamp;
21832 /// let x = ImageImportJob::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
21833 /// let x = ImageImportJob::new().set_or_clear_end_time(None::<Timestamp>);
21834 /// ```
21835 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
21836 where
21837 T: std::convert::Into<wkt::Timestamp>,
21838 {
21839 self.end_time = v.map(|x| x.into());
21840 self
21841 }
21842
21843 /// Sets the value of [errors][crate::model::ImageImportJob::errors].
21844 ///
21845 /// # Example
21846 /// ```ignore,no_run
21847 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21848 /// use google_cloud_rpc::model::Status;
21849 /// let x = ImageImportJob::new()
21850 /// .set_errors([
21851 /// Status::default()/* use setters */,
21852 /// Status::default()/* use (different) setters */,
21853 /// ]);
21854 /// ```
21855 pub fn set_errors<T, V>(mut self, v: T) -> Self
21856 where
21857 T: std::iter::IntoIterator<Item = V>,
21858 V: std::convert::Into<google_cloud_rpc::model::Status>,
21859 {
21860 use std::iter::Iterator;
21861 self.errors = v.into_iter().map(|i| i.into()).collect();
21862 self
21863 }
21864
21865 /// Sets the value of [warnings][crate::model::ImageImportJob::warnings].
21866 ///
21867 /// # Example
21868 /// ```ignore,no_run
21869 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21870 /// use google_cloud_vmmigration_v1::model::MigrationWarning;
21871 /// let x = ImageImportJob::new()
21872 /// .set_warnings([
21873 /// MigrationWarning::default()/* use setters */,
21874 /// MigrationWarning::default()/* use (different) setters */,
21875 /// ]);
21876 /// ```
21877 pub fn set_warnings<T, V>(mut self, v: T) -> Self
21878 where
21879 T: std::iter::IntoIterator<Item = V>,
21880 V: std::convert::Into<crate::model::MigrationWarning>,
21881 {
21882 use std::iter::Iterator;
21883 self.warnings = v.into_iter().map(|i| i.into()).collect();
21884 self
21885 }
21886
21887 /// Sets the value of [steps][crate::model::ImageImportJob::steps].
21888 ///
21889 /// # Example
21890 /// ```ignore,no_run
21891 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21892 /// use google_cloud_vmmigration_v1::model::ImageImportStep;
21893 /// let x = ImageImportJob::new()
21894 /// .set_steps([
21895 /// ImageImportStep::default()/* use setters */,
21896 /// ImageImportStep::default()/* use (different) setters */,
21897 /// ]);
21898 /// ```
21899 pub fn set_steps<T, V>(mut self, v: T) -> Self
21900 where
21901 T: std::iter::IntoIterator<Item = V>,
21902 V: std::convert::Into<crate::model::ImageImportStep>,
21903 {
21904 use std::iter::Iterator;
21905 self.steps = v.into_iter().map(|i| i.into()).collect();
21906 self
21907 }
21908
21909 /// Sets the value of [source][crate::model::ImageImportJob::source].
21910 ///
21911 /// Note that all the setters affecting `source` are mutually
21912 /// exclusive.
21913 ///
21914 /// # Example
21915 /// ```ignore,no_run
21916 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21917 /// use google_cloud_vmmigration_v1::model::image_import_job::Source;
21918 /// let x = ImageImportJob::new().set_source(Some(Source::CloudStorageUri("example".to_string())));
21919 /// ```
21920 pub fn set_source<
21921 T: std::convert::Into<std::option::Option<crate::model::image_import_job::Source>>,
21922 >(
21923 mut self,
21924 v: T,
21925 ) -> Self {
21926 self.source = v.into();
21927 self
21928 }
21929
21930 /// The value of [source][crate::model::ImageImportJob::source]
21931 /// if it holds a `CloudStorageUri`, `None` if the field is not set or
21932 /// holds a different branch.
21933 pub fn cloud_storage_uri(&self) -> std::option::Option<&std::string::String> {
21934 #[allow(unreachable_patterns)]
21935 self.source.as_ref().and_then(|v| match v {
21936 crate::model::image_import_job::Source::CloudStorageUri(v) => {
21937 std::option::Option::Some(v)
21938 }
21939 _ => std::option::Option::None,
21940 })
21941 }
21942
21943 /// Sets the value of [source][crate::model::ImageImportJob::source]
21944 /// to hold a `CloudStorageUri`.
21945 ///
21946 /// Note that all the setters affecting `source` are
21947 /// mutually exclusive.
21948 ///
21949 /// # Example
21950 /// ```ignore,no_run
21951 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21952 /// let x = ImageImportJob::new().set_cloud_storage_uri("example");
21953 /// assert!(x.cloud_storage_uri().is_some());
21954 /// ```
21955 pub fn set_cloud_storage_uri<T: std::convert::Into<std::string::String>>(
21956 mut self,
21957 v: T,
21958 ) -> Self {
21959 self.source = std::option::Option::Some(
21960 crate::model::image_import_job::Source::CloudStorageUri(v.into()),
21961 );
21962 self
21963 }
21964
21965 /// Sets the value of [target_details][crate::model::ImageImportJob::target_details].
21966 ///
21967 /// Note that all the setters affecting `target_details` are mutually
21968 /// exclusive.
21969 ///
21970 /// # Example
21971 /// ```ignore,no_run
21972 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
21973 /// use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
21974 /// let x = ImageImportJob::new().set_target_details(Some(
21975 /// google_cloud_vmmigration_v1::model::image_import_job::TargetDetails::DiskImageTargetDetails(DiskImageTargetDetails::default().into())));
21976 /// ```
21977 pub fn set_target_details<
21978 T: std::convert::Into<std::option::Option<crate::model::image_import_job::TargetDetails>>,
21979 >(
21980 mut self,
21981 v: T,
21982 ) -> Self {
21983 self.target_details = v.into();
21984 self
21985 }
21986
21987 /// The value of [target_details][crate::model::ImageImportJob::target_details]
21988 /// if it holds a `DiskImageTargetDetails`, `None` if the field is not set or
21989 /// holds a different branch.
21990 pub fn disk_image_target_details(
21991 &self,
21992 ) -> std::option::Option<&std::boxed::Box<crate::model::DiskImageTargetDetails>> {
21993 #[allow(unreachable_patterns)]
21994 self.target_details.as_ref().and_then(|v| match v {
21995 crate::model::image_import_job::TargetDetails::DiskImageTargetDetails(v) => {
21996 std::option::Option::Some(v)
21997 }
21998 _ => std::option::Option::None,
21999 })
22000 }
22001
22002 /// Sets the value of [target_details][crate::model::ImageImportJob::target_details]
22003 /// to hold a `DiskImageTargetDetails`.
22004 ///
22005 /// Note that all the setters affecting `target_details` are
22006 /// mutually exclusive.
22007 ///
22008 /// # Example
22009 /// ```ignore,no_run
22010 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
22011 /// use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22012 /// let x = ImageImportJob::new().set_disk_image_target_details(DiskImageTargetDetails::default()/* use setters */);
22013 /// assert!(x.disk_image_target_details().is_some());
22014 /// assert!(x.machine_image_target_details().is_none());
22015 /// ```
22016 pub fn set_disk_image_target_details<
22017 T: std::convert::Into<std::boxed::Box<crate::model::DiskImageTargetDetails>>,
22018 >(
22019 mut self,
22020 v: T,
22021 ) -> Self {
22022 self.target_details = std::option::Option::Some(
22023 crate::model::image_import_job::TargetDetails::DiskImageTargetDetails(v.into()),
22024 );
22025 self
22026 }
22027
22028 /// The value of [target_details][crate::model::ImageImportJob::target_details]
22029 /// if it holds a `MachineImageTargetDetails`, `None` if the field is not set or
22030 /// holds a different branch.
22031 pub fn machine_image_target_details(
22032 &self,
22033 ) -> std::option::Option<&std::boxed::Box<crate::model::MachineImageTargetDetails>> {
22034 #[allow(unreachable_patterns)]
22035 self.target_details.as_ref().and_then(|v| match v {
22036 crate::model::image_import_job::TargetDetails::MachineImageTargetDetails(v) => {
22037 std::option::Option::Some(v)
22038 }
22039 _ => std::option::Option::None,
22040 })
22041 }
22042
22043 /// Sets the value of [target_details][crate::model::ImageImportJob::target_details]
22044 /// to hold a `MachineImageTargetDetails`.
22045 ///
22046 /// Note that all the setters affecting `target_details` are
22047 /// mutually exclusive.
22048 ///
22049 /// # Example
22050 /// ```ignore,no_run
22051 /// # use google_cloud_vmmigration_v1::model::ImageImportJob;
22052 /// use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
22053 /// let x = ImageImportJob::new().set_machine_image_target_details(MachineImageTargetDetails::default()/* use setters */);
22054 /// assert!(x.machine_image_target_details().is_some());
22055 /// assert!(x.disk_image_target_details().is_none());
22056 /// ```
22057 pub fn set_machine_image_target_details<
22058 T: std::convert::Into<std::boxed::Box<crate::model::MachineImageTargetDetails>>,
22059 >(
22060 mut self,
22061 v: T,
22062 ) -> Self {
22063 self.target_details = std::option::Option::Some(
22064 crate::model::image_import_job::TargetDetails::MachineImageTargetDetails(v.into()),
22065 );
22066 self
22067 }
22068}
22069
22070impl wkt::message::Message for ImageImportJob {
22071 fn typename() -> &'static str {
22072 "type.googleapis.com/google.cloud.vmmigration.v1.ImageImportJob"
22073 }
22074}
22075
22076/// Defines additional types related to [ImageImportJob].
22077pub mod image_import_job {
22078 #[allow(unused_imports)]
22079 use super::*;
22080
22081 /// Possible states of the image import.
22082 ///
22083 /// # Working with unknown values
22084 ///
22085 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22086 /// additional enum variants at any time. Adding new variants is not considered
22087 /// a breaking change. Applications should write their code in anticipation of:
22088 ///
22089 /// - New values appearing in future releases of the client library, **and**
22090 /// - New values received dynamically, without application changes.
22091 ///
22092 /// Please consult the [Working with enums] section in the user guide for some
22093 /// guidelines.
22094 ///
22095 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22096 #[derive(Clone, Debug, PartialEq)]
22097 #[non_exhaustive]
22098 pub enum State {
22099 /// The state is unknown.
22100 Unspecified,
22101 /// The image import has not yet started.
22102 Pending,
22103 /// The image import is active and running.
22104 Running,
22105 /// The image import has finished successfully.
22106 Succeeded,
22107 /// The image import has finished with errors.
22108 Failed,
22109 /// The image import is being cancelled.
22110 Cancelling,
22111 /// The image import was cancelled.
22112 Cancelled,
22113 /// If set, the enum was initialized with an unknown value.
22114 ///
22115 /// Applications can examine the value using [State::value] or
22116 /// [State::name].
22117 UnknownValue(state::UnknownValue),
22118 }
22119
22120 #[doc(hidden)]
22121 pub mod state {
22122 #[allow(unused_imports)]
22123 use super::*;
22124 #[derive(Clone, Debug, PartialEq)]
22125 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22126 }
22127
22128 impl State {
22129 /// Gets the enum value.
22130 ///
22131 /// Returns `None` if the enum contains an unknown value deserialized from
22132 /// the string representation of enums.
22133 pub fn value(&self) -> std::option::Option<i32> {
22134 match self {
22135 Self::Unspecified => std::option::Option::Some(0),
22136 Self::Pending => std::option::Option::Some(1),
22137 Self::Running => std::option::Option::Some(2),
22138 Self::Succeeded => std::option::Option::Some(3),
22139 Self::Failed => std::option::Option::Some(4),
22140 Self::Cancelling => std::option::Option::Some(5),
22141 Self::Cancelled => std::option::Option::Some(6),
22142 Self::UnknownValue(u) => u.0.value(),
22143 }
22144 }
22145
22146 /// Gets the enum value as a string.
22147 ///
22148 /// Returns `None` if the enum contains an unknown value deserialized from
22149 /// the integer representation of enums.
22150 pub fn name(&self) -> std::option::Option<&str> {
22151 match self {
22152 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
22153 Self::Pending => std::option::Option::Some("PENDING"),
22154 Self::Running => std::option::Option::Some("RUNNING"),
22155 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
22156 Self::Failed => std::option::Option::Some("FAILED"),
22157 Self::Cancelling => std::option::Option::Some("CANCELLING"),
22158 Self::Cancelled => std::option::Option::Some("CANCELLED"),
22159 Self::UnknownValue(u) => u.0.name(),
22160 }
22161 }
22162 }
22163
22164 impl std::default::Default for State {
22165 fn default() -> Self {
22166 use std::convert::From;
22167 Self::from(0)
22168 }
22169 }
22170
22171 impl std::fmt::Display for State {
22172 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22173 wkt::internal::display_enum(f, self.name(), self.value())
22174 }
22175 }
22176
22177 impl std::convert::From<i32> for State {
22178 fn from(value: i32) -> Self {
22179 match value {
22180 0 => Self::Unspecified,
22181 1 => Self::Pending,
22182 2 => Self::Running,
22183 3 => Self::Succeeded,
22184 4 => Self::Failed,
22185 5 => Self::Cancelling,
22186 6 => Self::Cancelled,
22187 _ => Self::UnknownValue(state::UnknownValue(
22188 wkt::internal::UnknownEnumValue::Integer(value),
22189 )),
22190 }
22191 }
22192 }
22193
22194 impl std::convert::From<&str> for State {
22195 fn from(value: &str) -> Self {
22196 use std::string::ToString;
22197 match value {
22198 "STATE_UNSPECIFIED" => Self::Unspecified,
22199 "PENDING" => Self::Pending,
22200 "RUNNING" => Self::Running,
22201 "SUCCEEDED" => Self::Succeeded,
22202 "FAILED" => Self::Failed,
22203 "CANCELLING" => Self::Cancelling,
22204 "CANCELLED" => Self::Cancelled,
22205 _ => Self::UnknownValue(state::UnknownValue(
22206 wkt::internal::UnknownEnumValue::String(value.to_string()),
22207 )),
22208 }
22209 }
22210 }
22211
22212 impl serde::ser::Serialize for State {
22213 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22214 where
22215 S: serde::Serializer,
22216 {
22217 match self {
22218 Self::Unspecified => serializer.serialize_i32(0),
22219 Self::Pending => serializer.serialize_i32(1),
22220 Self::Running => serializer.serialize_i32(2),
22221 Self::Succeeded => serializer.serialize_i32(3),
22222 Self::Failed => serializer.serialize_i32(4),
22223 Self::Cancelling => serializer.serialize_i32(5),
22224 Self::Cancelled => serializer.serialize_i32(6),
22225 Self::UnknownValue(u) => u.0.serialize(serializer),
22226 }
22227 }
22228 }
22229
22230 impl<'de> serde::de::Deserialize<'de> for State {
22231 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22232 where
22233 D: serde::Deserializer<'de>,
22234 {
22235 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
22236 ".google.cloud.vmmigration.v1.ImageImportJob.State",
22237 ))
22238 }
22239 }
22240
22241 #[allow(missing_docs)]
22242 #[derive(Clone, Debug, PartialEq)]
22243 #[non_exhaustive]
22244 pub enum Source {
22245 /// Output only. The path to the Cloud Storage file from which the image
22246 /// should be imported.
22247 CloudStorageUri(std::string::String),
22248 }
22249
22250 /// The configuration of the resources that were created in GCP as a result of
22251 /// the image import.
22252 #[derive(Clone, Debug, PartialEq)]
22253 #[non_exhaustive]
22254 pub enum TargetDetails {
22255 /// Output only. Target details used to import a disk image.
22256 DiskImageTargetDetails(std::boxed::Box<crate::model::DiskImageTargetDetails>),
22257 /// Output only. Target details used to import a machine image.
22258 MachineImageTargetDetails(std::boxed::Box<crate::model::MachineImageTargetDetails>),
22259 }
22260}
22261
22262/// ImageImportStep holds information about the image import step progress.
22263#[derive(Clone, Default, PartialEq)]
22264#[non_exhaustive]
22265pub struct ImageImportStep {
22266 /// Output only. The time the step has started.
22267 pub start_time: std::option::Option<wkt::Timestamp>,
22268
22269 /// Output only. The time the step has ended.
22270 pub end_time: std::option::Option<wkt::Timestamp>,
22271
22272 #[allow(missing_docs)]
22273 pub step: std::option::Option<crate::model::image_import_step::Step>,
22274
22275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22276}
22277
22278impl ImageImportStep {
22279 /// Creates a new default instance.
22280 pub fn new() -> Self {
22281 std::default::Default::default()
22282 }
22283
22284 /// Sets the value of [start_time][crate::model::ImageImportStep::start_time].
22285 ///
22286 /// # Example
22287 /// ```ignore,no_run
22288 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22289 /// use wkt::Timestamp;
22290 /// let x = ImageImportStep::new().set_start_time(Timestamp::default()/* use setters */);
22291 /// ```
22292 pub fn set_start_time<T>(mut self, v: T) -> Self
22293 where
22294 T: std::convert::Into<wkt::Timestamp>,
22295 {
22296 self.start_time = std::option::Option::Some(v.into());
22297 self
22298 }
22299
22300 /// Sets or clears the value of [start_time][crate::model::ImageImportStep::start_time].
22301 ///
22302 /// # Example
22303 /// ```ignore,no_run
22304 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22305 /// use wkt::Timestamp;
22306 /// let x = ImageImportStep::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
22307 /// let x = ImageImportStep::new().set_or_clear_start_time(None::<Timestamp>);
22308 /// ```
22309 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
22310 where
22311 T: std::convert::Into<wkt::Timestamp>,
22312 {
22313 self.start_time = v.map(|x| x.into());
22314 self
22315 }
22316
22317 /// Sets the value of [end_time][crate::model::ImageImportStep::end_time].
22318 ///
22319 /// # Example
22320 /// ```ignore,no_run
22321 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22322 /// use wkt::Timestamp;
22323 /// let x = ImageImportStep::new().set_end_time(Timestamp::default()/* use setters */);
22324 /// ```
22325 pub fn set_end_time<T>(mut self, v: T) -> Self
22326 where
22327 T: std::convert::Into<wkt::Timestamp>,
22328 {
22329 self.end_time = std::option::Option::Some(v.into());
22330 self
22331 }
22332
22333 /// Sets or clears the value of [end_time][crate::model::ImageImportStep::end_time].
22334 ///
22335 /// # Example
22336 /// ```ignore,no_run
22337 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22338 /// use wkt::Timestamp;
22339 /// let x = ImageImportStep::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
22340 /// let x = ImageImportStep::new().set_or_clear_end_time(None::<Timestamp>);
22341 /// ```
22342 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
22343 where
22344 T: std::convert::Into<wkt::Timestamp>,
22345 {
22346 self.end_time = v.map(|x| x.into());
22347 self
22348 }
22349
22350 /// Sets the value of [step][crate::model::ImageImportStep::step].
22351 ///
22352 /// Note that all the setters affecting `step` are mutually
22353 /// exclusive.
22354 ///
22355 /// # Example
22356 /// ```ignore,no_run
22357 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22358 /// use google_cloud_vmmigration_v1::model::InitializingImageImportStep;
22359 /// let x = ImageImportStep::new().set_step(Some(
22360 /// google_cloud_vmmigration_v1::model::image_import_step::Step::Initializing(InitializingImageImportStep::default().into())));
22361 /// ```
22362 pub fn set_step<
22363 T: std::convert::Into<std::option::Option<crate::model::image_import_step::Step>>,
22364 >(
22365 mut self,
22366 v: T,
22367 ) -> Self {
22368 self.step = v.into();
22369 self
22370 }
22371
22372 /// The value of [step][crate::model::ImageImportStep::step]
22373 /// if it holds a `Initializing`, `None` if the field is not set or
22374 /// holds a different branch.
22375 pub fn initializing(
22376 &self,
22377 ) -> std::option::Option<&std::boxed::Box<crate::model::InitializingImageImportStep>> {
22378 #[allow(unreachable_patterns)]
22379 self.step.as_ref().and_then(|v| match v {
22380 crate::model::image_import_step::Step::Initializing(v) => std::option::Option::Some(v),
22381 _ => std::option::Option::None,
22382 })
22383 }
22384
22385 /// Sets the value of [step][crate::model::ImageImportStep::step]
22386 /// to hold a `Initializing`.
22387 ///
22388 /// Note that all the setters affecting `step` are
22389 /// mutually exclusive.
22390 ///
22391 /// # Example
22392 /// ```ignore,no_run
22393 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22394 /// use google_cloud_vmmigration_v1::model::InitializingImageImportStep;
22395 /// let x = ImageImportStep::new().set_initializing(InitializingImageImportStep::default()/* use setters */);
22396 /// assert!(x.initializing().is_some());
22397 /// assert!(x.loading_source_files().is_none());
22398 /// assert!(x.adapting_os().is_none());
22399 /// assert!(x.creating_image().is_none());
22400 /// ```
22401 pub fn set_initializing<
22402 T: std::convert::Into<std::boxed::Box<crate::model::InitializingImageImportStep>>,
22403 >(
22404 mut self,
22405 v: T,
22406 ) -> Self {
22407 self.step = std::option::Option::Some(crate::model::image_import_step::Step::Initializing(
22408 v.into(),
22409 ));
22410 self
22411 }
22412
22413 /// The value of [step][crate::model::ImageImportStep::step]
22414 /// if it holds a `LoadingSourceFiles`, `None` if the field is not set or
22415 /// holds a different branch.
22416 pub fn loading_source_files(
22417 &self,
22418 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadingImageSourceFilesStep>> {
22419 #[allow(unreachable_patterns)]
22420 self.step.as_ref().and_then(|v| match v {
22421 crate::model::image_import_step::Step::LoadingSourceFiles(v) => {
22422 std::option::Option::Some(v)
22423 }
22424 _ => std::option::Option::None,
22425 })
22426 }
22427
22428 /// Sets the value of [step][crate::model::ImageImportStep::step]
22429 /// to hold a `LoadingSourceFiles`.
22430 ///
22431 /// Note that all the setters affecting `step` are
22432 /// mutually exclusive.
22433 ///
22434 /// # Example
22435 /// ```ignore,no_run
22436 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22437 /// use google_cloud_vmmigration_v1::model::LoadingImageSourceFilesStep;
22438 /// let x = ImageImportStep::new().set_loading_source_files(LoadingImageSourceFilesStep::default()/* use setters */);
22439 /// assert!(x.loading_source_files().is_some());
22440 /// assert!(x.initializing().is_none());
22441 /// assert!(x.adapting_os().is_none());
22442 /// assert!(x.creating_image().is_none());
22443 /// ```
22444 pub fn set_loading_source_files<
22445 T: std::convert::Into<std::boxed::Box<crate::model::LoadingImageSourceFilesStep>>,
22446 >(
22447 mut self,
22448 v: T,
22449 ) -> Self {
22450 self.step = std::option::Option::Some(
22451 crate::model::image_import_step::Step::LoadingSourceFiles(v.into()),
22452 );
22453 self
22454 }
22455
22456 /// The value of [step][crate::model::ImageImportStep::step]
22457 /// if it holds a `AdaptingOs`, `None` if the field is not set or
22458 /// holds a different branch.
22459 pub fn adapting_os(
22460 &self,
22461 ) -> std::option::Option<&std::boxed::Box<crate::model::AdaptingOSStep>> {
22462 #[allow(unreachable_patterns)]
22463 self.step.as_ref().and_then(|v| match v {
22464 crate::model::image_import_step::Step::AdaptingOs(v) => std::option::Option::Some(v),
22465 _ => std::option::Option::None,
22466 })
22467 }
22468
22469 /// Sets the value of [step][crate::model::ImageImportStep::step]
22470 /// to hold a `AdaptingOs`.
22471 ///
22472 /// Note that all the setters affecting `step` are
22473 /// mutually exclusive.
22474 ///
22475 /// # Example
22476 /// ```ignore,no_run
22477 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22478 /// use google_cloud_vmmigration_v1::model::AdaptingOSStep;
22479 /// let x = ImageImportStep::new().set_adapting_os(AdaptingOSStep::default()/* use setters */);
22480 /// assert!(x.adapting_os().is_some());
22481 /// assert!(x.initializing().is_none());
22482 /// assert!(x.loading_source_files().is_none());
22483 /// assert!(x.creating_image().is_none());
22484 /// ```
22485 pub fn set_adapting_os<T: std::convert::Into<std::boxed::Box<crate::model::AdaptingOSStep>>>(
22486 mut self,
22487 v: T,
22488 ) -> Self {
22489 self.step =
22490 std::option::Option::Some(crate::model::image_import_step::Step::AdaptingOs(v.into()));
22491 self
22492 }
22493
22494 /// The value of [step][crate::model::ImageImportStep::step]
22495 /// if it holds a `CreatingImage`, `None` if the field is not set or
22496 /// holds a different branch.
22497 pub fn creating_image(
22498 &self,
22499 ) -> std::option::Option<&std::boxed::Box<crate::model::CreatingImageStep>> {
22500 #[allow(unreachable_patterns)]
22501 self.step.as_ref().and_then(|v| match v {
22502 crate::model::image_import_step::Step::CreatingImage(v) => std::option::Option::Some(v),
22503 _ => std::option::Option::None,
22504 })
22505 }
22506
22507 /// Sets the value of [step][crate::model::ImageImportStep::step]
22508 /// to hold a `CreatingImage`.
22509 ///
22510 /// Note that all the setters affecting `step` are
22511 /// mutually exclusive.
22512 ///
22513 /// # Example
22514 /// ```ignore,no_run
22515 /// # use google_cloud_vmmigration_v1::model::ImageImportStep;
22516 /// use google_cloud_vmmigration_v1::model::CreatingImageStep;
22517 /// let x = ImageImportStep::new().set_creating_image(CreatingImageStep::default()/* use setters */);
22518 /// assert!(x.creating_image().is_some());
22519 /// assert!(x.initializing().is_none());
22520 /// assert!(x.loading_source_files().is_none());
22521 /// assert!(x.adapting_os().is_none());
22522 /// ```
22523 pub fn set_creating_image<
22524 T: std::convert::Into<std::boxed::Box<crate::model::CreatingImageStep>>,
22525 >(
22526 mut self,
22527 v: T,
22528 ) -> Self {
22529 self.step = std::option::Option::Some(
22530 crate::model::image_import_step::Step::CreatingImage(v.into()),
22531 );
22532 self
22533 }
22534}
22535
22536impl wkt::message::Message for ImageImportStep {
22537 fn typename() -> &'static str {
22538 "type.googleapis.com/google.cloud.vmmigration.v1.ImageImportStep"
22539 }
22540}
22541
22542/// Defines additional types related to [ImageImportStep].
22543pub mod image_import_step {
22544 #[allow(unused_imports)]
22545 use super::*;
22546
22547 #[allow(missing_docs)]
22548 #[derive(Clone, Debug, PartialEq)]
22549 #[non_exhaustive]
22550 pub enum Step {
22551 /// Initializing step.
22552 Initializing(std::boxed::Box<crate::model::InitializingImageImportStep>),
22553 /// Loading source files step.
22554 LoadingSourceFiles(std::boxed::Box<crate::model::LoadingImageSourceFilesStep>),
22555 /// Adapting OS step.
22556 AdaptingOs(std::boxed::Box<crate::model::AdaptingOSStep>),
22557 /// Creating image step.
22558 CreatingImage(std::boxed::Box<crate::model::CreatingImageStep>),
22559 }
22560}
22561
22562/// InitializingImageImportStep contains specific step details.
22563#[derive(Clone, Default, PartialEq)]
22564#[non_exhaustive]
22565pub struct InitializingImageImportStep {
22566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22567}
22568
22569impl InitializingImageImportStep {
22570 /// Creates a new default instance.
22571 pub fn new() -> Self {
22572 std::default::Default::default()
22573 }
22574}
22575
22576impl wkt::message::Message for InitializingImageImportStep {
22577 fn typename() -> &'static str {
22578 "type.googleapis.com/google.cloud.vmmigration.v1.InitializingImageImportStep"
22579 }
22580}
22581
22582/// LoadingImageSourceFilesStep contains specific step details.
22583#[derive(Clone, Default, PartialEq)]
22584#[non_exhaustive]
22585pub struct LoadingImageSourceFilesStep {
22586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22587}
22588
22589impl LoadingImageSourceFilesStep {
22590 /// Creates a new default instance.
22591 pub fn new() -> Self {
22592 std::default::Default::default()
22593 }
22594}
22595
22596impl wkt::message::Message for LoadingImageSourceFilesStep {
22597 fn typename() -> &'static str {
22598 "type.googleapis.com/google.cloud.vmmigration.v1.LoadingImageSourceFilesStep"
22599 }
22600}
22601
22602/// CreatingImageStep contains specific step details.
22603#[derive(Clone, Default, PartialEq)]
22604#[non_exhaustive]
22605pub struct CreatingImageStep {
22606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22607}
22608
22609impl CreatingImageStep {
22610 /// Creates a new default instance.
22611 pub fn new() -> Self {
22612 std::default::Default::default()
22613 }
22614}
22615
22616impl wkt::message::Message for CreatingImageStep {
22617 fn typename() -> &'static str {
22618 "type.googleapis.com/google.cloud.vmmigration.v1.CreatingImageStep"
22619 }
22620}
22621
22622/// The target details of the image resource that will be created by the import
22623/// job.
22624#[derive(Clone, Default, PartialEq)]
22625#[non_exhaustive]
22626pub struct DiskImageTargetDetails {
22627 /// Required. The name of the image to be created.
22628 pub image_name: std::string::String,
22629
22630 /// Required. Reference to the TargetProject resource that represents the
22631 /// target project in which the imported image will be created.
22632 pub target_project: std::string::String,
22633
22634 /// Optional. An optional description of the image.
22635 pub description: std::string::String,
22636
22637 /// Optional. The name of the image family to which the new image belongs.
22638 pub family_name: std::string::String,
22639
22640 /// Optional. A map of labels to associate with the image.
22641 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
22642
22643 /// Optional. Additional licenses to assign to the image.
22644 /// Format:
22645 /// <https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME>
22646 /// Or
22647 /// <https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME>
22648 pub additional_licenses: std::vec::Vec<std::string::String>,
22649
22650 /// Optional. Set to true to set the image storageLocations to the single
22651 /// region of the import job. When false, the closest multi-region is selected.
22652 pub single_region_storage: bool,
22653
22654 /// Immutable. The encryption to apply to the image.
22655 pub encryption: std::option::Option<crate::model::Encryption>,
22656
22657 #[allow(missing_docs)]
22658 pub os_adaptation_config:
22659 std::option::Option<crate::model::disk_image_target_details::OsAdaptationConfig>,
22660
22661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22662}
22663
22664impl DiskImageTargetDetails {
22665 /// Creates a new default instance.
22666 pub fn new() -> Self {
22667 std::default::Default::default()
22668 }
22669
22670 /// Sets the value of [image_name][crate::model::DiskImageTargetDetails::image_name].
22671 ///
22672 /// # Example
22673 /// ```ignore,no_run
22674 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22675 /// let x = DiskImageTargetDetails::new().set_image_name("example");
22676 /// ```
22677 pub fn set_image_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22678 self.image_name = v.into();
22679 self
22680 }
22681
22682 /// Sets the value of [target_project][crate::model::DiskImageTargetDetails::target_project].
22683 ///
22684 /// # Example
22685 /// ```ignore,no_run
22686 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22687 /// # let project_id = "project_id";
22688 /// # let location_id = "location_id";
22689 /// # let target_project_id = "target_project_id";
22690 /// let x = DiskImageTargetDetails::new().set_target_project(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
22691 /// ```
22692 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22693 self.target_project = v.into();
22694 self
22695 }
22696
22697 /// Sets the value of [description][crate::model::DiskImageTargetDetails::description].
22698 ///
22699 /// # Example
22700 /// ```ignore,no_run
22701 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22702 /// let x = DiskImageTargetDetails::new().set_description("example");
22703 /// ```
22704 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22705 self.description = v.into();
22706 self
22707 }
22708
22709 /// Sets the value of [family_name][crate::model::DiskImageTargetDetails::family_name].
22710 ///
22711 /// # Example
22712 /// ```ignore,no_run
22713 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22714 /// let x = DiskImageTargetDetails::new().set_family_name("example");
22715 /// ```
22716 pub fn set_family_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22717 self.family_name = v.into();
22718 self
22719 }
22720
22721 /// Sets the value of [labels][crate::model::DiskImageTargetDetails::labels].
22722 ///
22723 /// # Example
22724 /// ```ignore,no_run
22725 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22726 /// let x = DiskImageTargetDetails::new().set_labels([
22727 /// ("key0", "abc"),
22728 /// ("key1", "xyz"),
22729 /// ]);
22730 /// ```
22731 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
22732 where
22733 T: std::iter::IntoIterator<Item = (K, V)>,
22734 K: std::convert::Into<std::string::String>,
22735 V: std::convert::Into<std::string::String>,
22736 {
22737 use std::iter::Iterator;
22738 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
22739 self
22740 }
22741
22742 /// Sets the value of [additional_licenses][crate::model::DiskImageTargetDetails::additional_licenses].
22743 ///
22744 /// # Example
22745 /// ```ignore,no_run
22746 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22747 /// let x = DiskImageTargetDetails::new().set_additional_licenses(["a", "b", "c"]);
22748 /// ```
22749 pub fn set_additional_licenses<T, V>(mut self, v: T) -> Self
22750 where
22751 T: std::iter::IntoIterator<Item = V>,
22752 V: std::convert::Into<std::string::String>,
22753 {
22754 use std::iter::Iterator;
22755 self.additional_licenses = v.into_iter().map(|i| i.into()).collect();
22756 self
22757 }
22758
22759 /// Sets the value of [single_region_storage][crate::model::DiskImageTargetDetails::single_region_storage].
22760 ///
22761 /// # Example
22762 /// ```ignore,no_run
22763 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22764 /// let x = DiskImageTargetDetails::new().set_single_region_storage(true);
22765 /// ```
22766 pub fn set_single_region_storage<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22767 self.single_region_storage = v.into();
22768 self
22769 }
22770
22771 /// Sets the value of [encryption][crate::model::DiskImageTargetDetails::encryption].
22772 ///
22773 /// # Example
22774 /// ```ignore,no_run
22775 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22776 /// use google_cloud_vmmigration_v1::model::Encryption;
22777 /// let x = DiskImageTargetDetails::new().set_encryption(Encryption::default()/* use setters */);
22778 /// ```
22779 pub fn set_encryption<T>(mut self, v: T) -> Self
22780 where
22781 T: std::convert::Into<crate::model::Encryption>,
22782 {
22783 self.encryption = std::option::Option::Some(v.into());
22784 self
22785 }
22786
22787 /// Sets or clears the value of [encryption][crate::model::DiskImageTargetDetails::encryption].
22788 ///
22789 /// # Example
22790 /// ```ignore,no_run
22791 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22792 /// use google_cloud_vmmigration_v1::model::Encryption;
22793 /// let x = DiskImageTargetDetails::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
22794 /// let x = DiskImageTargetDetails::new().set_or_clear_encryption(None::<Encryption>);
22795 /// ```
22796 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
22797 where
22798 T: std::convert::Into<crate::model::Encryption>,
22799 {
22800 self.encryption = v.map(|x| x.into());
22801 self
22802 }
22803
22804 /// Sets the value of [os_adaptation_config][crate::model::DiskImageTargetDetails::os_adaptation_config].
22805 ///
22806 /// Note that all the setters affecting `os_adaptation_config` are mutually
22807 /// exclusive.
22808 ///
22809 /// # Example
22810 /// ```ignore,no_run
22811 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22812 /// use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
22813 /// let x = DiskImageTargetDetails::new().set_os_adaptation_config(Some(
22814 /// google_cloud_vmmigration_v1::model::disk_image_target_details::OsAdaptationConfig::OsAdaptationParameters(ImageImportOsAdaptationParameters::default().into())));
22815 /// ```
22816 pub fn set_os_adaptation_config<
22817 T: std::convert::Into<
22818 std::option::Option<crate::model::disk_image_target_details::OsAdaptationConfig>,
22819 >,
22820 >(
22821 mut self,
22822 v: T,
22823 ) -> Self {
22824 self.os_adaptation_config = v.into();
22825 self
22826 }
22827
22828 /// The value of [os_adaptation_config][crate::model::DiskImageTargetDetails::os_adaptation_config]
22829 /// if it holds a `OsAdaptationParameters`, `None` if the field is not set or
22830 /// holds a different branch.
22831 pub fn os_adaptation_parameters(
22832 &self,
22833 ) -> std::option::Option<&std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>
22834 {
22835 #[allow(unreachable_patterns)]
22836 self.os_adaptation_config.as_ref().and_then(|v| match v {
22837 crate::model::disk_image_target_details::OsAdaptationConfig::OsAdaptationParameters(
22838 v,
22839 ) => std::option::Option::Some(v),
22840 _ => std::option::Option::None,
22841 })
22842 }
22843
22844 /// Sets the value of [os_adaptation_config][crate::model::DiskImageTargetDetails::os_adaptation_config]
22845 /// to hold a `OsAdaptationParameters`.
22846 ///
22847 /// Note that all the setters affecting `os_adaptation_config` are
22848 /// mutually exclusive.
22849 ///
22850 /// # Example
22851 /// ```ignore,no_run
22852 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22853 /// use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
22854 /// let x = DiskImageTargetDetails::new().set_os_adaptation_parameters(ImageImportOsAdaptationParameters::default()/* use setters */);
22855 /// assert!(x.os_adaptation_parameters().is_some());
22856 /// assert!(x.data_disk_image_import().is_none());
22857 /// ```
22858 pub fn set_os_adaptation_parameters<
22859 T: std::convert::Into<std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>,
22860 >(
22861 mut self,
22862 v: T,
22863 ) -> Self {
22864 self.os_adaptation_config = std::option::Option::Some(
22865 crate::model::disk_image_target_details::OsAdaptationConfig::OsAdaptationParameters(
22866 v.into(),
22867 ),
22868 );
22869 self
22870 }
22871
22872 /// The value of [os_adaptation_config][crate::model::DiskImageTargetDetails::os_adaptation_config]
22873 /// if it holds a `DataDiskImageImport`, `None` if the field is not set or
22874 /// holds a different branch.
22875 pub fn data_disk_image_import(
22876 &self,
22877 ) -> std::option::Option<&std::boxed::Box<crate::model::DataDiskImageImport>> {
22878 #[allow(unreachable_patterns)]
22879 self.os_adaptation_config.as_ref().and_then(|v| match v {
22880 crate::model::disk_image_target_details::OsAdaptationConfig::DataDiskImageImport(v) => {
22881 std::option::Option::Some(v)
22882 }
22883 _ => std::option::Option::None,
22884 })
22885 }
22886
22887 /// Sets the value of [os_adaptation_config][crate::model::DiskImageTargetDetails::os_adaptation_config]
22888 /// to hold a `DataDiskImageImport`.
22889 ///
22890 /// Note that all the setters affecting `os_adaptation_config` are
22891 /// mutually exclusive.
22892 ///
22893 /// # Example
22894 /// ```ignore,no_run
22895 /// # use google_cloud_vmmigration_v1::model::DiskImageTargetDetails;
22896 /// use google_cloud_vmmigration_v1::model::DataDiskImageImport;
22897 /// let x = DiskImageTargetDetails::new().set_data_disk_image_import(DataDiskImageImport::default()/* use setters */);
22898 /// assert!(x.data_disk_image_import().is_some());
22899 /// assert!(x.os_adaptation_parameters().is_none());
22900 /// ```
22901 pub fn set_data_disk_image_import<
22902 T: std::convert::Into<std::boxed::Box<crate::model::DataDiskImageImport>>,
22903 >(
22904 mut self,
22905 v: T,
22906 ) -> Self {
22907 self.os_adaptation_config = std::option::Option::Some(
22908 crate::model::disk_image_target_details::OsAdaptationConfig::DataDiskImageImport(
22909 v.into(),
22910 ),
22911 );
22912 self
22913 }
22914}
22915
22916impl wkt::message::Message for DiskImageTargetDetails {
22917 fn typename() -> &'static str {
22918 "type.googleapis.com/google.cloud.vmmigration.v1.DiskImageTargetDetails"
22919 }
22920}
22921
22922/// Defines additional types related to [DiskImageTargetDetails].
22923pub mod disk_image_target_details {
22924 #[allow(unused_imports)]
22925 use super::*;
22926
22927 #[allow(missing_docs)]
22928 #[derive(Clone, Debug, PartialEq)]
22929 #[non_exhaustive]
22930 pub enum OsAdaptationConfig {
22931 /// Optional. Use to set the parameters relevant for the OS adaptation
22932 /// process.
22933 OsAdaptationParameters(std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>),
22934 /// Optional. Use to skip OS adaptation process.
22935 DataDiskImageImport(std::boxed::Box<crate::model::DataDiskImageImport>),
22936 }
22937}
22938
22939/// The target details of the machine image resource that will be created by the
22940/// image import job.
22941#[derive(Clone, Default, PartialEq)]
22942#[non_exhaustive]
22943pub struct MachineImageTargetDetails {
22944 /// Required. The name of the machine image to be created.
22945 pub machine_image_name: std::string::String,
22946
22947 /// Required. Reference to the TargetProject resource that represents the
22948 /// target project in which the imported machine image will be created.
22949 pub target_project: std::string::String,
22950
22951 /// Optional. An optional description of the machine image.
22952 pub description: std::string::String,
22953
22954 /// Optional. Set to true to set the machine image storageLocations to the
22955 /// single region of the import job. When false, the closest multi-region is
22956 /// selected.
22957 pub single_region_storage: bool,
22958
22959 /// Immutable. The encryption to apply to the machine image.
22960 /// If the Image Import resource has an encryption, this field must be set to
22961 /// the same encryption key.
22962 pub encryption: std::option::Option<crate::model::Encryption>,
22963
22964 /// Optional. Parameters overriding decisions based on the source machine image
22965 /// configurations.
22966 pub machine_image_parameters_overrides:
22967 std::option::Option<crate::model::MachineImageParametersOverrides>,
22968
22969 /// Optional. The service account to assign to the instance created by the
22970 /// machine image.
22971 pub service_account: std::option::Option<crate::model::ServiceAccount>,
22972
22973 /// Optional. Additional licenses to assign to the instance created by the
22974 /// machine image. Format:
22975 /// <https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME>
22976 /// Or
22977 /// <https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME>
22978 pub additional_licenses: std::vec::Vec<std::string::String>,
22979
22980 /// Optional. The labels to apply to the instance created by the machine image.
22981 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
22982
22983 /// Optional. The tags to apply to the instance created by the machine image.
22984 pub tags: std::vec::Vec<std::string::String>,
22985
22986 /// Optional. Shielded instance configuration.
22987 pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
22988
22989 /// Optional. The network interfaces to create with the instance created by the
22990 /// machine image. Internal and external IP addresses, and network tiers are
22991 /// ignored for machine image import.
22992 pub network_interfaces: std::vec::Vec<crate::model::NetworkInterface>,
22993
22994 #[allow(missing_docs)]
22995 pub os_adaptation_config:
22996 std::option::Option<crate::model::machine_image_target_details::OsAdaptationConfig>,
22997
22998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22999}
23000
23001impl MachineImageTargetDetails {
23002 /// Creates a new default instance.
23003 pub fn new() -> Self {
23004 std::default::Default::default()
23005 }
23006
23007 /// Sets the value of [machine_image_name][crate::model::MachineImageTargetDetails::machine_image_name].
23008 ///
23009 /// # Example
23010 /// ```ignore,no_run
23011 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23012 /// let x = MachineImageTargetDetails::new().set_machine_image_name("example");
23013 /// ```
23014 pub fn set_machine_image_name<T: std::convert::Into<std::string::String>>(
23015 mut self,
23016 v: T,
23017 ) -> Self {
23018 self.machine_image_name = v.into();
23019 self
23020 }
23021
23022 /// Sets the value of [target_project][crate::model::MachineImageTargetDetails::target_project].
23023 ///
23024 /// # Example
23025 /// ```ignore,no_run
23026 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23027 /// # let project_id = "project_id";
23028 /// # let location_id = "location_id";
23029 /// # let target_project_id = "target_project_id";
23030 /// let x = MachineImageTargetDetails::new().set_target_project(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
23031 /// ```
23032 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23033 self.target_project = v.into();
23034 self
23035 }
23036
23037 /// Sets the value of [description][crate::model::MachineImageTargetDetails::description].
23038 ///
23039 /// # Example
23040 /// ```ignore,no_run
23041 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23042 /// let x = MachineImageTargetDetails::new().set_description("example");
23043 /// ```
23044 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23045 self.description = v.into();
23046 self
23047 }
23048
23049 /// Sets the value of [single_region_storage][crate::model::MachineImageTargetDetails::single_region_storage].
23050 ///
23051 /// # Example
23052 /// ```ignore,no_run
23053 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23054 /// let x = MachineImageTargetDetails::new().set_single_region_storage(true);
23055 /// ```
23056 pub fn set_single_region_storage<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23057 self.single_region_storage = v.into();
23058 self
23059 }
23060
23061 /// Sets the value of [encryption][crate::model::MachineImageTargetDetails::encryption].
23062 ///
23063 /// # Example
23064 /// ```ignore,no_run
23065 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23066 /// use google_cloud_vmmigration_v1::model::Encryption;
23067 /// let x = MachineImageTargetDetails::new().set_encryption(Encryption::default()/* use setters */);
23068 /// ```
23069 pub fn set_encryption<T>(mut self, v: T) -> Self
23070 where
23071 T: std::convert::Into<crate::model::Encryption>,
23072 {
23073 self.encryption = std::option::Option::Some(v.into());
23074 self
23075 }
23076
23077 /// Sets or clears the value of [encryption][crate::model::MachineImageTargetDetails::encryption].
23078 ///
23079 /// # Example
23080 /// ```ignore,no_run
23081 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23082 /// use google_cloud_vmmigration_v1::model::Encryption;
23083 /// let x = MachineImageTargetDetails::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
23084 /// let x = MachineImageTargetDetails::new().set_or_clear_encryption(None::<Encryption>);
23085 /// ```
23086 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
23087 where
23088 T: std::convert::Into<crate::model::Encryption>,
23089 {
23090 self.encryption = v.map(|x| x.into());
23091 self
23092 }
23093
23094 /// Sets the value of [machine_image_parameters_overrides][crate::model::MachineImageTargetDetails::machine_image_parameters_overrides].
23095 ///
23096 /// # Example
23097 /// ```ignore,no_run
23098 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23099 /// use google_cloud_vmmigration_v1::model::MachineImageParametersOverrides;
23100 /// let x = MachineImageTargetDetails::new().set_machine_image_parameters_overrides(MachineImageParametersOverrides::default()/* use setters */);
23101 /// ```
23102 pub fn set_machine_image_parameters_overrides<T>(mut self, v: T) -> Self
23103 where
23104 T: std::convert::Into<crate::model::MachineImageParametersOverrides>,
23105 {
23106 self.machine_image_parameters_overrides = std::option::Option::Some(v.into());
23107 self
23108 }
23109
23110 /// Sets or clears the value of [machine_image_parameters_overrides][crate::model::MachineImageTargetDetails::machine_image_parameters_overrides].
23111 ///
23112 /// # Example
23113 /// ```ignore,no_run
23114 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23115 /// use google_cloud_vmmigration_v1::model::MachineImageParametersOverrides;
23116 /// let x = MachineImageTargetDetails::new().set_or_clear_machine_image_parameters_overrides(Some(MachineImageParametersOverrides::default()/* use setters */));
23117 /// let x = MachineImageTargetDetails::new().set_or_clear_machine_image_parameters_overrides(None::<MachineImageParametersOverrides>);
23118 /// ```
23119 pub fn set_or_clear_machine_image_parameters_overrides<T>(
23120 mut self,
23121 v: std::option::Option<T>,
23122 ) -> Self
23123 where
23124 T: std::convert::Into<crate::model::MachineImageParametersOverrides>,
23125 {
23126 self.machine_image_parameters_overrides = v.map(|x| x.into());
23127 self
23128 }
23129
23130 /// Sets the value of [service_account][crate::model::MachineImageTargetDetails::service_account].
23131 ///
23132 /// # Example
23133 /// ```ignore,no_run
23134 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23135 /// use google_cloud_vmmigration_v1::model::ServiceAccount;
23136 /// let x = MachineImageTargetDetails::new().set_service_account(ServiceAccount::default()/* use setters */);
23137 /// ```
23138 pub fn set_service_account<T>(mut self, v: T) -> Self
23139 where
23140 T: std::convert::Into<crate::model::ServiceAccount>,
23141 {
23142 self.service_account = std::option::Option::Some(v.into());
23143 self
23144 }
23145
23146 /// Sets or clears the value of [service_account][crate::model::MachineImageTargetDetails::service_account].
23147 ///
23148 /// # Example
23149 /// ```ignore,no_run
23150 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23151 /// use google_cloud_vmmigration_v1::model::ServiceAccount;
23152 /// let x = MachineImageTargetDetails::new().set_or_clear_service_account(Some(ServiceAccount::default()/* use setters */));
23153 /// let x = MachineImageTargetDetails::new().set_or_clear_service_account(None::<ServiceAccount>);
23154 /// ```
23155 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
23156 where
23157 T: std::convert::Into<crate::model::ServiceAccount>,
23158 {
23159 self.service_account = v.map(|x| x.into());
23160 self
23161 }
23162
23163 /// Sets the value of [additional_licenses][crate::model::MachineImageTargetDetails::additional_licenses].
23164 ///
23165 /// # Example
23166 /// ```ignore,no_run
23167 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23168 /// let x = MachineImageTargetDetails::new().set_additional_licenses(["a", "b", "c"]);
23169 /// ```
23170 pub fn set_additional_licenses<T, V>(mut self, v: T) -> Self
23171 where
23172 T: std::iter::IntoIterator<Item = V>,
23173 V: std::convert::Into<std::string::String>,
23174 {
23175 use std::iter::Iterator;
23176 self.additional_licenses = v.into_iter().map(|i| i.into()).collect();
23177 self
23178 }
23179
23180 /// Sets the value of [labels][crate::model::MachineImageTargetDetails::labels].
23181 ///
23182 /// # Example
23183 /// ```ignore,no_run
23184 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23185 /// let x = MachineImageTargetDetails::new().set_labels([
23186 /// ("key0", "abc"),
23187 /// ("key1", "xyz"),
23188 /// ]);
23189 /// ```
23190 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
23191 where
23192 T: std::iter::IntoIterator<Item = (K, V)>,
23193 K: std::convert::Into<std::string::String>,
23194 V: std::convert::Into<std::string::String>,
23195 {
23196 use std::iter::Iterator;
23197 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
23198 self
23199 }
23200
23201 /// Sets the value of [tags][crate::model::MachineImageTargetDetails::tags].
23202 ///
23203 /// # Example
23204 /// ```ignore,no_run
23205 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23206 /// let x = MachineImageTargetDetails::new().set_tags(["a", "b", "c"]);
23207 /// ```
23208 pub fn set_tags<T, V>(mut self, v: T) -> Self
23209 where
23210 T: std::iter::IntoIterator<Item = V>,
23211 V: std::convert::Into<std::string::String>,
23212 {
23213 use std::iter::Iterator;
23214 self.tags = v.into_iter().map(|i| i.into()).collect();
23215 self
23216 }
23217
23218 /// Sets the value of [shielded_instance_config][crate::model::MachineImageTargetDetails::shielded_instance_config].
23219 ///
23220 /// # Example
23221 /// ```ignore,no_run
23222 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23223 /// use google_cloud_vmmigration_v1::model::ShieldedInstanceConfig;
23224 /// let x = MachineImageTargetDetails::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
23225 /// ```
23226 pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
23227 where
23228 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
23229 {
23230 self.shielded_instance_config = std::option::Option::Some(v.into());
23231 self
23232 }
23233
23234 /// Sets or clears the value of [shielded_instance_config][crate::model::MachineImageTargetDetails::shielded_instance_config].
23235 ///
23236 /// # Example
23237 /// ```ignore,no_run
23238 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23239 /// use google_cloud_vmmigration_v1::model::ShieldedInstanceConfig;
23240 /// let x = MachineImageTargetDetails::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
23241 /// let x = MachineImageTargetDetails::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
23242 /// ```
23243 pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
23244 where
23245 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
23246 {
23247 self.shielded_instance_config = v.map(|x| x.into());
23248 self
23249 }
23250
23251 /// Sets the value of [network_interfaces][crate::model::MachineImageTargetDetails::network_interfaces].
23252 ///
23253 /// # Example
23254 /// ```ignore,no_run
23255 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23256 /// use google_cloud_vmmigration_v1::model::NetworkInterface;
23257 /// let x = MachineImageTargetDetails::new()
23258 /// .set_network_interfaces([
23259 /// NetworkInterface::default()/* use setters */,
23260 /// NetworkInterface::default()/* use (different) setters */,
23261 /// ]);
23262 /// ```
23263 pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
23264 where
23265 T: std::iter::IntoIterator<Item = V>,
23266 V: std::convert::Into<crate::model::NetworkInterface>,
23267 {
23268 use std::iter::Iterator;
23269 self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
23270 self
23271 }
23272
23273 /// Sets the value of [os_adaptation_config][crate::model::MachineImageTargetDetails::os_adaptation_config].
23274 ///
23275 /// Note that all the setters affecting `os_adaptation_config` are mutually
23276 /// exclusive.
23277 ///
23278 /// # Example
23279 /// ```ignore,no_run
23280 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23281 /// use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
23282 /// let x = MachineImageTargetDetails::new().set_os_adaptation_config(Some(
23283 /// google_cloud_vmmigration_v1::model::machine_image_target_details::OsAdaptationConfig::OsAdaptationParameters(ImageImportOsAdaptationParameters::default().into())));
23284 /// ```
23285 pub fn set_os_adaptation_config<
23286 T: std::convert::Into<
23287 std::option::Option<crate::model::machine_image_target_details::OsAdaptationConfig>,
23288 >,
23289 >(
23290 mut self,
23291 v: T,
23292 ) -> Self {
23293 self.os_adaptation_config = v.into();
23294 self
23295 }
23296
23297 /// The value of [os_adaptation_config][crate::model::MachineImageTargetDetails::os_adaptation_config]
23298 /// if it holds a `OsAdaptationParameters`, `None` if the field is not set or
23299 /// holds a different branch.
23300 pub fn os_adaptation_parameters(
23301 &self,
23302 ) -> std::option::Option<&std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>
23303 {
23304 #[allow(unreachable_patterns)]
23305 self.os_adaptation_config.as_ref().and_then(|v| match v {
23306 crate::model::machine_image_target_details::OsAdaptationConfig::OsAdaptationParameters(v) => std::option::Option::Some(v),
23307 _ => std::option::Option::None,
23308 })
23309 }
23310
23311 /// Sets the value of [os_adaptation_config][crate::model::MachineImageTargetDetails::os_adaptation_config]
23312 /// to hold a `OsAdaptationParameters`.
23313 ///
23314 /// Note that all the setters affecting `os_adaptation_config` are
23315 /// mutually exclusive.
23316 ///
23317 /// # Example
23318 /// ```ignore,no_run
23319 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23320 /// use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
23321 /// let x = MachineImageTargetDetails::new().set_os_adaptation_parameters(ImageImportOsAdaptationParameters::default()/* use setters */);
23322 /// assert!(x.os_adaptation_parameters().is_some());
23323 /// assert!(x.skip_os_adaptation().is_none());
23324 /// ```
23325 pub fn set_os_adaptation_parameters<
23326 T: std::convert::Into<std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>>,
23327 >(
23328 mut self,
23329 v: T,
23330 ) -> Self {
23331 self.os_adaptation_config = std::option::Option::Some(
23332 crate::model::machine_image_target_details::OsAdaptationConfig::OsAdaptationParameters(
23333 v.into(),
23334 ),
23335 );
23336 self
23337 }
23338
23339 /// The value of [os_adaptation_config][crate::model::MachineImageTargetDetails::os_adaptation_config]
23340 /// if it holds a `SkipOsAdaptation`, `None` if the field is not set or
23341 /// holds a different branch.
23342 pub fn skip_os_adaptation(
23343 &self,
23344 ) -> std::option::Option<&std::boxed::Box<crate::model::SkipOsAdaptation>> {
23345 #[allow(unreachable_patterns)]
23346 self.os_adaptation_config.as_ref().and_then(|v| match v {
23347 crate::model::machine_image_target_details::OsAdaptationConfig::SkipOsAdaptation(v) => {
23348 std::option::Option::Some(v)
23349 }
23350 _ => std::option::Option::None,
23351 })
23352 }
23353
23354 /// Sets the value of [os_adaptation_config][crate::model::MachineImageTargetDetails::os_adaptation_config]
23355 /// to hold a `SkipOsAdaptation`.
23356 ///
23357 /// Note that all the setters affecting `os_adaptation_config` are
23358 /// mutually exclusive.
23359 ///
23360 /// # Example
23361 /// ```ignore,no_run
23362 /// # use google_cloud_vmmigration_v1::model::MachineImageTargetDetails;
23363 /// use google_cloud_vmmigration_v1::model::SkipOsAdaptation;
23364 /// let x = MachineImageTargetDetails::new().set_skip_os_adaptation(SkipOsAdaptation::default()/* use setters */);
23365 /// assert!(x.skip_os_adaptation().is_some());
23366 /// assert!(x.os_adaptation_parameters().is_none());
23367 /// ```
23368 pub fn set_skip_os_adaptation<
23369 T: std::convert::Into<std::boxed::Box<crate::model::SkipOsAdaptation>>,
23370 >(
23371 mut self,
23372 v: T,
23373 ) -> Self {
23374 self.os_adaptation_config = std::option::Option::Some(
23375 crate::model::machine_image_target_details::OsAdaptationConfig::SkipOsAdaptation(
23376 v.into(),
23377 ),
23378 );
23379 self
23380 }
23381}
23382
23383impl wkt::message::Message for MachineImageTargetDetails {
23384 fn typename() -> &'static str {
23385 "type.googleapis.com/google.cloud.vmmigration.v1.MachineImageTargetDetails"
23386 }
23387}
23388
23389/// Defines additional types related to [MachineImageTargetDetails].
23390pub mod machine_image_target_details {
23391 #[allow(unused_imports)]
23392 use super::*;
23393
23394 #[allow(missing_docs)]
23395 #[derive(Clone, Debug, PartialEq)]
23396 #[non_exhaustive]
23397 pub enum OsAdaptationConfig {
23398 /// Optional. Use to set the parameters relevant for the OS adaptation
23399 /// process.
23400 OsAdaptationParameters(std::boxed::Box<crate::model::ImageImportOsAdaptationParameters>),
23401 /// Optional. Use to skip OS adaptation process.
23402 SkipOsAdaptation(std::boxed::Box<crate::model::SkipOsAdaptation>),
23403 }
23404}
23405
23406/// Service account to assign to the instance created by the machine image.
23407#[derive(Clone, Default, PartialEq)]
23408#[non_exhaustive]
23409pub struct ServiceAccount {
23410 /// Required. The email address of the service account.
23411 pub email: std::string::String,
23412
23413 /// Optional. The list of scopes to be made available for this service account.
23414 pub scopes: std::vec::Vec<std::string::String>,
23415
23416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23417}
23418
23419impl ServiceAccount {
23420 /// Creates a new default instance.
23421 pub fn new() -> Self {
23422 std::default::Default::default()
23423 }
23424
23425 /// Sets the value of [email][crate::model::ServiceAccount::email].
23426 ///
23427 /// # Example
23428 /// ```ignore,no_run
23429 /// # use google_cloud_vmmigration_v1::model::ServiceAccount;
23430 /// let x = ServiceAccount::new().set_email("example");
23431 /// ```
23432 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23433 self.email = v.into();
23434 self
23435 }
23436
23437 /// Sets the value of [scopes][crate::model::ServiceAccount::scopes].
23438 ///
23439 /// # Example
23440 /// ```ignore,no_run
23441 /// # use google_cloud_vmmigration_v1::model::ServiceAccount;
23442 /// let x = ServiceAccount::new().set_scopes(["a", "b", "c"]);
23443 /// ```
23444 pub fn set_scopes<T, V>(mut self, v: T) -> Self
23445 where
23446 T: std::iter::IntoIterator<Item = V>,
23447 V: std::convert::Into<std::string::String>,
23448 {
23449 use std::iter::Iterator;
23450 self.scopes = v.into_iter().map(|i| i.into()).collect();
23451 self
23452 }
23453}
23454
23455impl wkt::message::Message for ServiceAccount {
23456 fn typename() -> &'static str {
23457 "type.googleapis.com/google.cloud.vmmigration.v1.ServiceAccount"
23458 }
23459}
23460
23461/// Shielded instance configuration.
23462#[derive(Clone, Default, PartialEq)]
23463#[non_exhaustive]
23464pub struct ShieldedInstanceConfig {
23465 /// Optional. Defines whether the instance created by the machine image has
23466 /// Secure Boot enabled. This can be set to true only if the image boot option
23467 /// is EFI.
23468 pub secure_boot: crate::model::shielded_instance_config::SecureBoot,
23469
23470 /// Optional. Defines whether the instance created by the machine image has
23471 /// vTPM enabled. This can be set to true only if the image boot option is EFI.
23472 pub enable_vtpm: bool,
23473
23474 /// Optional. Defines whether the instance created by the machine image has
23475 /// integrity monitoring enabled. This can be set to true only if the image
23476 /// boot option is EFI, and vTPM is enabled.
23477 pub enable_integrity_monitoring: bool,
23478
23479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23480}
23481
23482impl ShieldedInstanceConfig {
23483 /// Creates a new default instance.
23484 pub fn new() -> Self {
23485 std::default::Default::default()
23486 }
23487
23488 /// Sets the value of [secure_boot][crate::model::ShieldedInstanceConfig::secure_boot].
23489 ///
23490 /// # Example
23491 /// ```ignore,no_run
23492 /// # use google_cloud_vmmigration_v1::model::ShieldedInstanceConfig;
23493 /// use google_cloud_vmmigration_v1::model::shielded_instance_config::SecureBoot;
23494 /// let x0 = ShieldedInstanceConfig::new().set_secure_boot(SecureBoot::True);
23495 /// let x1 = ShieldedInstanceConfig::new().set_secure_boot(SecureBoot::False);
23496 /// ```
23497 pub fn set_secure_boot<
23498 T: std::convert::Into<crate::model::shielded_instance_config::SecureBoot>,
23499 >(
23500 mut self,
23501 v: T,
23502 ) -> Self {
23503 self.secure_boot = v.into();
23504 self
23505 }
23506
23507 /// Sets the value of [enable_vtpm][crate::model::ShieldedInstanceConfig::enable_vtpm].
23508 ///
23509 /// # Example
23510 /// ```ignore,no_run
23511 /// # use google_cloud_vmmigration_v1::model::ShieldedInstanceConfig;
23512 /// let x = ShieldedInstanceConfig::new().set_enable_vtpm(true);
23513 /// ```
23514 pub fn set_enable_vtpm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23515 self.enable_vtpm = v.into();
23516 self
23517 }
23518
23519 /// Sets the value of [enable_integrity_monitoring][crate::model::ShieldedInstanceConfig::enable_integrity_monitoring].
23520 ///
23521 /// # Example
23522 /// ```ignore,no_run
23523 /// # use google_cloud_vmmigration_v1::model::ShieldedInstanceConfig;
23524 /// let x = ShieldedInstanceConfig::new().set_enable_integrity_monitoring(true);
23525 /// ```
23526 pub fn set_enable_integrity_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23527 self.enable_integrity_monitoring = v.into();
23528 self
23529 }
23530}
23531
23532impl wkt::message::Message for ShieldedInstanceConfig {
23533 fn typename() -> &'static str {
23534 "type.googleapis.com/google.cloud.vmmigration.v1.ShieldedInstanceConfig"
23535 }
23536}
23537
23538/// Defines additional types related to [ShieldedInstanceConfig].
23539pub mod shielded_instance_config {
23540 #[allow(unused_imports)]
23541 use super::*;
23542
23543 /// Possible values for secure boot.
23544 ///
23545 /// # Working with unknown values
23546 ///
23547 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23548 /// additional enum variants at any time. Adding new variants is not considered
23549 /// a breaking change. Applications should write their code in anticipation of:
23550 ///
23551 /// - New values appearing in future releases of the client library, **and**
23552 /// - New values received dynamically, without application changes.
23553 ///
23554 /// Please consult the [Working with enums] section in the user guide for some
23555 /// guidelines.
23556 ///
23557 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23558 #[derive(Clone, Debug, PartialEq)]
23559 #[non_exhaustive]
23560 pub enum SecureBoot {
23561 /// No explicit value is selected. Will use the configuration of the source
23562 /// (if exists, otherwise the default will be false).
23563 Unspecified,
23564 /// Use secure boot. This can be set to true only if the image boot option is
23565 /// EFI.
23566 True,
23567 /// Do not use secure boot.
23568 False,
23569 /// If set, the enum was initialized with an unknown value.
23570 ///
23571 /// Applications can examine the value using [SecureBoot::value] or
23572 /// [SecureBoot::name].
23573 UnknownValue(secure_boot::UnknownValue),
23574 }
23575
23576 #[doc(hidden)]
23577 pub mod secure_boot {
23578 #[allow(unused_imports)]
23579 use super::*;
23580 #[derive(Clone, Debug, PartialEq)]
23581 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23582 }
23583
23584 impl SecureBoot {
23585 /// Gets the enum value.
23586 ///
23587 /// Returns `None` if the enum contains an unknown value deserialized from
23588 /// the string representation of enums.
23589 pub fn value(&self) -> std::option::Option<i32> {
23590 match self {
23591 Self::Unspecified => std::option::Option::Some(0),
23592 Self::True => std::option::Option::Some(1),
23593 Self::False => std::option::Option::Some(2),
23594 Self::UnknownValue(u) => u.0.value(),
23595 }
23596 }
23597
23598 /// Gets the enum value as a string.
23599 ///
23600 /// Returns `None` if the enum contains an unknown value deserialized from
23601 /// the integer representation of enums.
23602 pub fn name(&self) -> std::option::Option<&str> {
23603 match self {
23604 Self::Unspecified => std::option::Option::Some("SECURE_BOOT_UNSPECIFIED"),
23605 Self::True => std::option::Option::Some("TRUE"),
23606 Self::False => std::option::Option::Some("FALSE"),
23607 Self::UnknownValue(u) => u.0.name(),
23608 }
23609 }
23610 }
23611
23612 impl std::default::Default for SecureBoot {
23613 fn default() -> Self {
23614 use std::convert::From;
23615 Self::from(0)
23616 }
23617 }
23618
23619 impl std::fmt::Display for SecureBoot {
23620 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23621 wkt::internal::display_enum(f, self.name(), self.value())
23622 }
23623 }
23624
23625 impl std::convert::From<i32> for SecureBoot {
23626 fn from(value: i32) -> Self {
23627 match value {
23628 0 => Self::Unspecified,
23629 1 => Self::True,
23630 2 => Self::False,
23631 _ => Self::UnknownValue(secure_boot::UnknownValue(
23632 wkt::internal::UnknownEnumValue::Integer(value),
23633 )),
23634 }
23635 }
23636 }
23637
23638 impl std::convert::From<&str> for SecureBoot {
23639 fn from(value: &str) -> Self {
23640 use std::string::ToString;
23641 match value {
23642 "SECURE_BOOT_UNSPECIFIED" => Self::Unspecified,
23643 "TRUE" => Self::True,
23644 "FALSE" => Self::False,
23645 _ => Self::UnknownValue(secure_boot::UnknownValue(
23646 wkt::internal::UnknownEnumValue::String(value.to_string()),
23647 )),
23648 }
23649 }
23650 }
23651
23652 impl serde::ser::Serialize for SecureBoot {
23653 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23654 where
23655 S: serde::Serializer,
23656 {
23657 match self {
23658 Self::Unspecified => serializer.serialize_i32(0),
23659 Self::True => serializer.serialize_i32(1),
23660 Self::False => serializer.serialize_i32(2),
23661 Self::UnknownValue(u) => u.0.serialize(serializer),
23662 }
23663 }
23664 }
23665
23666 impl<'de> serde::de::Deserialize<'de> for SecureBoot {
23667 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23668 where
23669 D: serde::Deserializer<'de>,
23670 {
23671 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecureBoot>::new(
23672 ".google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBoot",
23673 ))
23674 }
23675 }
23676}
23677
23678/// Parameters overriding decisions based on the source machine image
23679/// configurations.
23680#[derive(Clone, Default, PartialEq)]
23681#[non_exhaustive]
23682pub struct MachineImageParametersOverrides {
23683 /// Optional. The machine type to create the MachineImage with.
23684 /// If empty, the service will choose a relevant machine type based on the
23685 /// information from the source image.
23686 /// For more information about machine types, please refer to
23687 /// <https://cloud.google.com/compute/docs/machine-resource>.
23688 pub machine_type: std::string::String,
23689
23690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23691}
23692
23693impl MachineImageParametersOverrides {
23694 /// Creates a new default instance.
23695 pub fn new() -> Self {
23696 std::default::Default::default()
23697 }
23698
23699 /// Sets the value of [machine_type][crate::model::MachineImageParametersOverrides::machine_type].
23700 ///
23701 /// # Example
23702 /// ```ignore,no_run
23703 /// # use google_cloud_vmmigration_v1::model::MachineImageParametersOverrides;
23704 /// let x = MachineImageParametersOverrides::new().set_machine_type("example");
23705 /// ```
23706 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23707 self.machine_type = v.into();
23708 self
23709 }
23710}
23711
23712impl wkt::message::Message for MachineImageParametersOverrides {
23713 fn typename() -> &'static str {
23714 "type.googleapis.com/google.cloud.vmmigration.v1.MachineImageParametersOverrides"
23715 }
23716}
23717
23718/// Parameters affecting the OS adaptation process.
23719#[derive(Clone, Default, PartialEq)]
23720#[non_exhaustive]
23721pub struct ImageImportOsAdaptationParameters {
23722 /// Optional. Set to true in order to generalize the imported image.
23723 /// The generalization process enables co-existence of multiple VMs created
23724 /// from the same image.
23725 /// For Windows, generalizing the image removes computer-specific information
23726 /// such as installed drivers and the computer security identifier (SID).
23727 pub generalize: bool,
23728
23729 /// Optional. Choose which type of license to apply to the imported image.
23730 pub license_type: crate::model::ComputeEngineLicenseType,
23731
23732 /// Optional. By default the image will keep its existing boot option. Setting
23733 /// this property will trigger an internal process which will convert the
23734 /// image from using the existing boot option to another.
23735 /// The size of the boot disk might be increased to allow the conversion
23736 pub boot_conversion: crate::model::BootConversion,
23737
23738 /// Optional. Modifiers to be used as configuration of the OS adaptation
23739 /// process.
23740 pub adaptation_modifiers: std::vec::Vec<crate::model::AdaptationModifier>,
23741
23742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23743}
23744
23745impl ImageImportOsAdaptationParameters {
23746 /// Creates a new default instance.
23747 pub fn new() -> Self {
23748 std::default::Default::default()
23749 }
23750
23751 /// Sets the value of [generalize][crate::model::ImageImportOsAdaptationParameters::generalize].
23752 ///
23753 /// # Example
23754 /// ```ignore,no_run
23755 /// # use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
23756 /// let x = ImageImportOsAdaptationParameters::new().set_generalize(true);
23757 /// ```
23758 pub fn set_generalize<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23759 self.generalize = v.into();
23760 self
23761 }
23762
23763 /// Sets the value of [license_type][crate::model::ImageImportOsAdaptationParameters::license_type].
23764 ///
23765 /// # Example
23766 /// ```ignore,no_run
23767 /// # use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
23768 /// use google_cloud_vmmigration_v1::model::ComputeEngineLicenseType;
23769 /// let x0 = ImageImportOsAdaptationParameters::new().set_license_type(ComputeEngineLicenseType::Payg);
23770 /// let x1 = ImageImportOsAdaptationParameters::new().set_license_type(ComputeEngineLicenseType::Byol);
23771 /// ```
23772 pub fn set_license_type<T: std::convert::Into<crate::model::ComputeEngineLicenseType>>(
23773 mut self,
23774 v: T,
23775 ) -> Self {
23776 self.license_type = v.into();
23777 self
23778 }
23779
23780 /// Sets the value of [boot_conversion][crate::model::ImageImportOsAdaptationParameters::boot_conversion].
23781 ///
23782 /// # Example
23783 /// ```ignore,no_run
23784 /// # use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
23785 /// use google_cloud_vmmigration_v1::model::BootConversion;
23786 /// let x0 = ImageImportOsAdaptationParameters::new().set_boot_conversion(BootConversion::None);
23787 /// let x1 = ImageImportOsAdaptationParameters::new().set_boot_conversion(BootConversion::BiosToEfi);
23788 /// ```
23789 pub fn set_boot_conversion<T: std::convert::Into<crate::model::BootConversion>>(
23790 mut self,
23791 v: T,
23792 ) -> Self {
23793 self.boot_conversion = v.into();
23794 self
23795 }
23796
23797 /// Sets the value of [adaptation_modifiers][crate::model::ImageImportOsAdaptationParameters::adaptation_modifiers].
23798 ///
23799 /// # Example
23800 /// ```ignore,no_run
23801 /// # use google_cloud_vmmigration_v1::model::ImageImportOsAdaptationParameters;
23802 /// use google_cloud_vmmigration_v1::model::AdaptationModifier;
23803 /// let x = ImageImportOsAdaptationParameters::new()
23804 /// .set_adaptation_modifiers([
23805 /// AdaptationModifier::default()/* use setters */,
23806 /// AdaptationModifier::default()/* use (different) setters */,
23807 /// ]);
23808 /// ```
23809 pub fn set_adaptation_modifiers<T, V>(mut self, v: T) -> Self
23810 where
23811 T: std::iter::IntoIterator<Item = V>,
23812 V: std::convert::Into<crate::model::AdaptationModifier>,
23813 {
23814 use std::iter::Iterator;
23815 self.adaptation_modifiers = v.into_iter().map(|i| i.into()).collect();
23816 self
23817 }
23818}
23819
23820impl wkt::message::Message for ImageImportOsAdaptationParameters {
23821 fn typename() -> &'static str {
23822 "type.googleapis.com/google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters"
23823 }
23824}
23825
23826/// Used when the image import is not using OS adaptation process.
23827#[derive(Clone, Default, PartialEq)]
23828#[non_exhaustive]
23829pub struct DataDiskImageImport {
23830 /// Optional. A list of guest OS features to apply to the imported image. These
23831 /// features are flags that are used by Compute Engine to enable certain
23832 /// capabilities for virtual machine instances that are created from the image.
23833 ///
23834 /// This field does not change the OS of the image; it only marks the image
23835 /// with the specified features. The user must ensure that the OS is
23836 /// compatible with the features.
23837 ///
23838 /// For a list of available features, see
23839 /// <https://cloud.google.com/compute/docs/images/create-custom#guest-os-features>.
23840 pub guest_os_features: std::vec::Vec<std::string::String>,
23841
23842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23843}
23844
23845impl DataDiskImageImport {
23846 /// Creates a new default instance.
23847 pub fn new() -> Self {
23848 std::default::Default::default()
23849 }
23850
23851 /// Sets the value of [guest_os_features][crate::model::DataDiskImageImport::guest_os_features].
23852 ///
23853 /// # Example
23854 /// ```ignore,no_run
23855 /// # use google_cloud_vmmigration_v1::model::DataDiskImageImport;
23856 /// let x = DataDiskImageImport::new().set_guest_os_features(["a", "b", "c"]);
23857 /// ```
23858 pub fn set_guest_os_features<T, V>(mut self, v: T) -> Self
23859 where
23860 T: std::iter::IntoIterator<Item = V>,
23861 V: std::convert::Into<std::string::String>,
23862 {
23863 use std::iter::Iterator;
23864 self.guest_os_features = v.into_iter().map(|i| i.into()).collect();
23865 self
23866 }
23867}
23868
23869impl wkt::message::Message for DataDiskImageImport {
23870 fn typename() -> &'static str {
23871 "type.googleapis.com/google.cloud.vmmigration.v1.DataDiskImageImport"
23872 }
23873}
23874
23875/// Mentions that the machine image import is not using OS adaptation process.
23876#[derive(Clone, Default, PartialEq)]
23877#[non_exhaustive]
23878pub struct SkipOsAdaptation {
23879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23880}
23881
23882impl SkipOsAdaptation {
23883 /// Creates a new default instance.
23884 pub fn new() -> Self {
23885 std::default::Default::default()
23886 }
23887}
23888
23889impl wkt::message::Message for SkipOsAdaptation {
23890 fn typename() -> &'static str {
23891 "type.googleapis.com/google.cloud.vmmigration.v1.SkipOsAdaptation"
23892 }
23893}
23894
23895/// Request message for 'GetImageImport' call.
23896#[derive(Clone, Default, PartialEq)]
23897#[non_exhaustive]
23898pub struct GetImageImportRequest {
23899 /// Required. The ImageImport name.
23900 pub name: std::string::String,
23901
23902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23903}
23904
23905impl GetImageImportRequest {
23906 /// Creates a new default instance.
23907 pub fn new() -> Self {
23908 std::default::Default::default()
23909 }
23910
23911 /// Sets the value of [name][crate::model::GetImageImportRequest::name].
23912 ///
23913 /// # Example
23914 /// ```ignore,no_run
23915 /// # use google_cloud_vmmigration_v1::model::GetImageImportRequest;
23916 /// # let project_id = "project_id";
23917 /// # let location_id = "location_id";
23918 /// # let job_id = "job_id";
23919 /// let x = GetImageImportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}"));
23920 /// ```
23921 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23922 self.name = v.into();
23923 self
23924 }
23925}
23926
23927impl wkt::message::Message for GetImageImportRequest {
23928 fn typename() -> &'static str {
23929 "type.googleapis.com/google.cloud.vmmigration.v1.GetImageImportRequest"
23930 }
23931}
23932
23933/// Request message for 'ListImageImports' call.
23934#[derive(Clone, Default, PartialEq)]
23935#[non_exhaustive]
23936pub struct ListImageImportsRequest {
23937 /// Required. The parent, which owns this collection of targets.
23938 pub parent: std::string::String,
23939
23940 /// Optional. The maximum number of targets to return. The service may return
23941 /// fewer than this value. If unspecified, at most 500 targets will be
23942 /// returned. The maximum value is 1000; values above 1000 will be coerced to
23943 /// 1000.
23944 pub page_size: i32,
23945
23946 /// Optional. A page token, received from a previous `ListImageImports` call.
23947 /// Provide this to retrieve the subsequent page.
23948 ///
23949 /// When paginating, all other parameters provided to `ListImageImports` must
23950 /// match the call that provided the page token.
23951 pub page_token: std::string::String,
23952
23953 /// Optional. The filter request (according to <a
23954 /// href="https://google.aip.dev/160" target="_blank">AIP-160</a>).
23955 pub filter: std::string::String,
23956
23957 /// Optional. The order by fields for the result (according to <a
23958 /// href="https://google.aip.dev/132#ordering" target="_blank">AIP-132</a>).
23959 /// Currently ordering is only possible by "name" field.
23960 pub order_by: std::string::String,
23961
23962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23963}
23964
23965impl ListImageImportsRequest {
23966 /// Creates a new default instance.
23967 pub fn new() -> Self {
23968 std::default::Default::default()
23969 }
23970
23971 /// Sets the value of [parent][crate::model::ListImageImportsRequest::parent].
23972 ///
23973 /// # Example
23974 /// ```ignore,no_run
23975 /// # use google_cloud_vmmigration_v1::model::ListImageImportsRequest;
23976 /// # let project_id = "project_id";
23977 /// # let location_id = "location_id";
23978 /// let x = ListImageImportsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
23979 /// ```
23980 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23981 self.parent = v.into();
23982 self
23983 }
23984
23985 /// Sets the value of [page_size][crate::model::ListImageImportsRequest::page_size].
23986 ///
23987 /// # Example
23988 /// ```ignore,no_run
23989 /// # use google_cloud_vmmigration_v1::model::ListImageImportsRequest;
23990 /// let x = ListImageImportsRequest::new().set_page_size(42);
23991 /// ```
23992 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23993 self.page_size = v.into();
23994 self
23995 }
23996
23997 /// Sets the value of [page_token][crate::model::ListImageImportsRequest::page_token].
23998 ///
23999 /// # Example
24000 /// ```ignore,no_run
24001 /// # use google_cloud_vmmigration_v1::model::ListImageImportsRequest;
24002 /// let x = ListImageImportsRequest::new().set_page_token("example");
24003 /// ```
24004 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24005 self.page_token = v.into();
24006 self
24007 }
24008
24009 /// Sets the value of [filter][crate::model::ListImageImportsRequest::filter].
24010 ///
24011 /// # Example
24012 /// ```ignore,no_run
24013 /// # use google_cloud_vmmigration_v1::model::ListImageImportsRequest;
24014 /// let x = ListImageImportsRequest::new().set_filter("example");
24015 /// ```
24016 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24017 self.filter = v.into();
24018 self
24019 }
24020
24021 /// Sets the value of [order_by][crate::model::ListImageImportsRequest::order_by].
24022 ///
24023 /// # Example
24024 /// ```ignore,no_run
24025 /// # use google_cloud_vmmigration_v1::model::ListImageImportsRequest;
24026 /// let x = ListImageImportsRequest::new().set_order_by("example");
24027 /// ```
24028 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24029 self.order_by = v.into();
24030 self
24031 }
24032}
24033
24034impl wkt::message::Message for ListImageImportsRequest {
24035 fn typename() -> &'static str {
24036 "type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportsRequest"
24037 }
24038}
24039
24040/// Response message for 'ListImageImports' call.
24041#[derive(Clone, Default, PartialEq)]
24042#[non_exhaustive]
24043pub struct ListImageImportsResponse {
24044 /// Output only. The list of target response.
24045 pub image_imports: std::vec::Vec<crate::model::ImageImport>,
24046
24047 /// Output only. A token, which can be sent as `page_token` to retrieve the
24048 /// next page. If this field is omitted, there are no subsequent pages.
24049 pub next_page_token: std::string::String,
24050
24051 /// Output only. Locations that could not be reached.
24052 pub unreachable: std::vec::Vec<std::string::String>,
24053
24054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24055}
24056
24057impl ListImageImportsResponse {
24058 /// Creates a new default instance.
24059 pub fn new() -> Self {
24060 std::default::Default::default()
24061 }
24062
24063 /// Sets the value of [image_imports][crate::model::ListImageImportsResponse::image_imports].
24064 ///
24065 /// # Example
24066 /// ```ignore,no_run
24067 /// # use google_cloud_vmmigration_v1::model::ListImageImportsResponse;
24068 /// use google_cloud_vmmigration_v1::model::ImageImport;
24069 /// let x = ListImageImportsResponse::new()
24070 /// .set_image_imports([
24071 /// ImageImport::default()/* use setters */,
24072 /// ImageImport::default()/* use (different) setters */,
24073 /// ]);
24074 /// ```
24075 pub fn set_image_imports<T, V>(mut self, v: T) -> Self
24076 where
24077 T: std::iter::IntoIterator<Item = V>,
24078 V: std::convert::Into<crate::model::ImageImport>,
24079 {
24080 use std::iter::Iterator;
24081 self.image_imports = v.into_iter().map(|i| i.into()).collect();
24082 self
24083 }
24084
24085 /// Sets the value of [next_page_token][crate::model::ListImageImportsResponse::next_page_token].
24086 ///
24087 /// # Example
24088 /// ```ignore,no_run
24089 /// # use google_cloud_vmmigration_v1::model::ListImageImportsResponse;
24090 /// let x = ListImageImportsResponse::new().set_next_page_token("example");
24091 /// ```
24092 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24093 self.next_page_token = v.into();
24094 self
24095 }
24096
24097 /// Sets the value of [unreachable][crate::model::ListImageImportsResponse::unreachable].
24098 ///
24099 /// # Example
24100 /// ```ignore,no_run
24101 /// # use google_cloud_vmmigration_v1::model::ListImageImportsResponse;
24102 /// let x = ListImageImportsResponse::new().set_unreachable(["a", "b", "c"]);
24103 /// ```
24104 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
24105 where
24106 T: std::iter::IntoIterator<Item = V>,
24107 V: std::convert::Into<std::string::String>,
24108 {
24109 use std::iter::Iterator;
24110 self.unreachable = v.into_iter().map(|i| i.into()).collect();
24111 self
24112 }
24113}
24114
24115impl wkt::message::Message for ListImageImportsResponse {
24116 fn typename() -> &'static str {
24117 "type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportsResponse"
24118 }
24119}
24120
24121#[doc(hidden)]
24122impl google_cloud_gax::paginator::internal::PageableResponse for ListImageImportsResponse {
24123 type PageItem = crate::model::ImageImport;
24124
24125 fn items(self) -> std::vec::Vec<Self::PageItem> {
24126 self.image_imports
24127 }
24128
24129 fn next_page_token(&self) -> std::string::String {
24130 use std::clone::Clone;
24131 self.next_page_token.clone()
24132 }
24133}
24134
24135/// Request message for 'CreateImageImport' request.
24136#[derive(Clone, Default, PartialEq)]
24137#[non_exhaustive]
24138pub struct CreateImageImportRequest {
24139 /// Required. The ImageImport's parent.
24140 pub parent: std::string::String,
24141
24142 /// Required. The image import identifier.
24143 /// This value maximum length is 63 characters, and valid characters are
24144 /// /[a-z][0-9]-/. It must start with an english letter and must not end with a
24145 /// hyphen.
24146 pub image_import_id: std::string::String,
24147
24148 /// Required. The create request body.
24149 pub image_import: std::option::Option<crate::model::ImageImport>,
24150
24151 /// Optional. A request ID to identify requests. Specify a unique request ID
24152 /// so that if you must retry your request, the server will know to ignore
24153 /// the request if it has already been completed. The server will guarantee
24154 /// that for at least 60 minutes since the first request.
24155 ///
24156 /// For example, consider a situation where you make an initial request and
24157 /// the request times out. If you make the request again with the same request
24158 /// ID, the server can check if original operation with the same request ID
24159 /// was received, and if so, will ignore the second request. This prevents
24160 /// clients from accidentally creating duplicate commitments.
24161 ///
24162 /// The request ID must be a valid UUID with the exception that zero UUID is
24163 /// not supported (00000000-0000-0000-0000-000000000000).
24164 pub request_id: std::string::String,
24165
24166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24167}
24168
24169impl CreateImageImportRequest {
24170 /// Creates a new default instance.
24171 pub fn new() -> Self {
24172 std::default::Default::default()
24173 }
24174
24175 /// Sets the value of [parent][crate::model::CreateImageImportRequest::parent].
24176 ///
24177 /// # Example
24178 /// ```ignore,no_run
24179 /// # use google_cloud_vmmigration_v1::model::CreateImageImportRequest;
24180 /// # let project_id = "project_id";
24181 /// # let location_id = "location_id";
24182 /// let x = CreateImageImportRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
24183 /// ```
24184 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24185 self.parent = v.into();
24186 self
24187 }
24188
24189 /// Sets the value of [image_import_id][crate::model::CreateImageImportRequest::image_import_id].
24190 ///
24191 /// # Example
24192 /// ```ignore,no_run
24193 /// # use google_cloud_vmmigration_v1::model::CreateImageImportRequest;
24194 /// let x = CreateImageImportRequest::new().set_image_import_id("example");
24195 /// ```
24196 pub fn set_image_import_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24197 self.image_import_id = v.into();
24198 self
24199 }
24200
24201 /// Sets the value of [image_import][crate::model::CreateImageImportRequest::image_import].
24202 ///
24203 /// # Example
24204 /// ```ignore,no_run
24205 /// # use google_cloud_vmmigration_v1::model::CreateImageImportRequest;
24206 /// use google_cloud_vmmigration_v1::model::ImageImport;
24207 /// let x = CreateImageImportRequest::new().set_image_import(ImageImport::default()/* use setters */);
24208 /// ```
24209 pub fn set_image_import<T>(mut self, v: T) -> Self
24210 where
24211 T: std::convert::Into<crate::model::ImageImport>,
24212 {
24213 self.image_import = std::option::Option::Some(v.into());
24214 self
24215 }
24216
24217 /// Sets or clears the value of [image_import][crate::model::CreateImageImportRequest::image_import].
24218 ///
24219 /// # Example
24220 /// ```ignore,no_run
24221 /// # use google_cloud_vmmigration_v1::model::CreateImageImportRequest;
24222 /// use google_cloud_vmmigration_v1::model::ImageImport;
24223 /// let x = CreateImageImportRequest::new().set_or_clear_image_import(Some(ImageImport::default()/* use setters */));
24224 /// let x = CreateImageImportRequest::new().set_or_clear_image_import(None::<ImageImport>);
24225 /// ```
24226 pub fn set_or_clear_image_import<T>(mut self, v: std::option::Option<T>) -> Self
24227 where
24228 T: std::convert::Into<crate::model::ImageImport>,
24229 {
24230 self.image_import = v.map(|x| x.into());
24231 self
24232 }
24233
24234 /// Sets the value of [request_id][crate::model::CreateImageImportRequest::request_id].
24235 ///
24236 /// # Example
24237 /// ```ignore,no_run
24238 /// # use google_cloud_vmmigration_v1::model::CreateImageImportRequest;
24239 /// let x = CreateImageImportRequest::new().set_request_id("example");
24240 /// ```
24241 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24242 self.request_id = v.into();
24243 self
24244 }
24245}
24246
24247impl wkt::message::Message for CreateImageImportRequest {
24248 fn typename() -> &'static str {
24249 "type.googleapis.com/google.cloud.vmmigration.v1.CreateImageImportRequest"
24250 }
24251}
24252
24253/// Request message for 'DeleteImageImport' request.
24254#[derive(Clone, Default, PartialEq)]
24255#[non_exhaustive]
24256pub struct DeleteImageImportRequest {
24257 /// Required. The ImageImport name.
24258 pub name: std::string::String,
24259
24260 /// Optional. A request ID to identify requests. Specify a unique request ID
24261 /// so that if you must retry your request, the server will know to ignore
24262 /// the request if it has already been completed. The server will guarantee
24263 /// that for at least 60 minutes after the first request.
24264 ///
24265 /// For example, consider a situation where you make an initial request and t
24266 /// he request times out. If you make the request again with the same request
24267 /// ID, the server can check if original operation with the same request ID
24268 /// was received, and if so, will ignore the second request. This prevents
24269 /// clients from accidentally creating duplicate commitments.
24270 ///
24271 /// The request ID must be a valid UUID with the exception that zero UUID is
24272 /// not supported (00000000-0000-0000-0000-000000000000).
24273 pub request_id: std::string::String,
24274
24275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24276}
24277
24278impl DeleteImageImportRequest {
24279 /// Creates a new default instance.
24280 pub fn new() -> Self {
24281 std::default::Default::default()
24282 }
24283
24284 /// Sets the value of [name][crate::model::DeleteImageImportRequest::name].
24285 ///
24286 /// # Example
24287 /// ```ignore,no_run
24288 /// # use google_cloud_vmmigration_v1::model::DeleteImageImportRequest;
24289 /// # let project_id = "project_id";
24290 /// # let location_id = "location_id";
24291 /// # let job_id = "job_id";
24292 /// let x = DeleteImageImportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}"));
24293 /// ```
24294 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24295 self.name = v.into();
24296 self
24297 }
24298
24299 /// Sets the value of [request_id][crate::model::DeleteImageImportRequest::request_id].
24300 ///
24301 /// # Example
24302 /// ```ignore,no_run
24303 /// # use google_cloud_vmmigration_v1::model::DeleteImageImportRequest;
24304 /// let x = DeleteImageImportRequest::new().set_request_id("example");
24305 /// ```
24306 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24307 self.request_id = v.into();
24308 self
24309 }
24310}
24311
24312impl wkt::message::Message for DeleteImageImportRequest {
24313 fn typename() -> &'static str {
24314 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteImageImportRequest"
24315 }
24316}
24317
24318/// Request message for 'GetImageImportJob' call.
24319#[derive(Clone, Default, PartialEq)]
24320#[non_exhaustive]
24321pub struct GetImageImportJobRequest {
24322 /// Required. The ImageImportJob name.
24323 pub name: std::string::String,
24324
24325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24326}
24327
24328impl GetImageImportJobRequest {
24329 /// Creates a new default instance.
24330 pub fn new() -> Self {
24331 std::default::Default::default()
24332 }
24333
24334 /// Sets the value of [name][crate::model::GetImageImportJobRequest::name].
24335 ///
24336 /// # Example
24337 /// ```ignore,no_run
24338 /// # use google_cloud_vmmigration_v1::model::GetImageImportJobRequest;
24339 /// # let project_id = "project_id";
24340 /// # let location_id = "location_id";
24341 /// # let job_id = "job_id";
24342 /// # let result_id = "result_id";
24343 /// let x = GetImageImportJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}/imageImportJobs/{result_id}"));
24344 /// ```
24345 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24346 self.name = v.into();
24347 self
24348 }
24349}
24350
24351impl wkt::message::Message for GetImageImportJobRequest {
24352 fn typename() -> &'static str {
24353 "type.googleapis.com/google.cloud.vmmigration.v1.GetImageImportJobRequest"
24354 }
24355}
24356
24357/// Request message for 'ListImageImportJobs' call.
24358#[derive(Clone, Default, PartialEq)]
24359#[non_exhaustive]
24360pub struct ListImageImportJobsRequest {
24361 /// Required. The parent, which owns this collection of targets.
24362 pub parent: std::string::String,
24363
24364 /// Optional. The maximum number of targets to return. The service may return
24365 /// fewer than this value. If unspecified, at most 500 targets will be
24366 /// returned. The maximum value is 1000; values above 1000 will be coerced to
24367 /// 1000.
24368 pub page_size: i32,
24369
24370 /// Optional. A page token, received from a previous `ListImageImportJobs`
24371 /// call. Provide this to retrieve the subsequent page.
24372 ///
24373 /// When paginating, all other parameters provided to `ListImageImportJobs`
24374 /// must match the call that provided the page token.
24375 pub page_token: std::string::String,
24376
24377 /// Optional. The filter request (according to <a
24378 /// href="https://google.aip.dev/160" target="_blank">AIP-160</a>).
24379 pub filter: std::string::String,
24380
24381 /// Optional. The order by fields for the result (according to <a
24382 /// href="https://google.aip.dev/132#ordering" target="_blank">AIP-132</a>).
24383 /// Currently ordering is only possible by "name" field.
24384 pub order_by: std::string::String,
24385
24386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24387}
24388
24389impl ListImageImportJobsRequest {
24390 /// Creates a new default instance.
24391 pub fn new() -> Self {
24392 std::default::Default::default()
24393 }
24394
24395 /// Sets the value of [parent][crate::model::ListImageImportJobsRequest::parent].
24396 ///
24397 /// # Example
24398 /// ```ignore,no_run
24399 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsRequest;
24400 /// # let project_id = "project_id";
24401 /// # let location_id = "location_id";
24402 /// # let job_id = "job_id";
24403 /// let x = ListImageImportJobsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}"));
24404 /// ```
24405 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24406 self.parent = v.into();
24407 self
24408 }
24409
24410 /// Sets the value of [page_size][crate::model::ListImageImportJobsRequest::page_size].
24411 ///
24412 /// # Example
24413 /// ```ignore,no_run
24414 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsRequest;
24415 /// let x = ListImageImportJobsRequest::new().set_page_size(42);
24416 /// ```
24417 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
24418 self.page_size = v.into();
24419 self
24420 }
24421
24422 /// Sets the value of [page_token][crate::model::ListImageImportJobsRequest::page_token].
24423 ///
24424 /// # Example
24425 /// ```ignore,no_run
24426 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsRequest;
24427 /// let x = ListImageImportJobsRequest::new().set_page_token("example");
24428 /// ```
24429 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24430 self.page_token = v.into();
24431 self
24432 }
24433
24434 /// Sets the value of [filter][crate::model::ListImageImportJobsRequest::filter].
24435 ///
24436 /// # Example
24437 /// ```ignore,no_run
24438 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsRequest;
24439 /// let x = ListImageImportJobsRequest::new().set_filter("example");
24440 /// ```
24441 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24442 self.filter = v.into();
24443 self
24444 }
24445
24446 /// Sets the value of [order_by][crate::model::ListImageImportJobsRequest::order_by].
24447 ///
24448 /// # Example
24449 /// ```ignore,no_run
24450 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsRequest;
24451 /// let x = ListImageImportJobsRequest::new().set_order_by("example");
24452 /// ```
24453 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24454 self.order_by = v.into();
24455 self
24456 }
24457}
24458
24459impl wkt::message::Message for ListImageImportJobsRequest {
24460 fn typename() -> &'static str {
24461 "type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportJobsRequest"
24462 }
24463}
24464
24465/// Response message for 'ListImageImportJobs' call.
24466#[derive(Clone, Default, PartialEq)]
24467#[non_exhaustive]
24468pub struct ListImageImportJobsResponse {
24469 /// Output only. The list of target response.
24470 pub image_import_jobs: std::vec::Vec<crate::model::ImageImportJob>,
24471
24472 /// Output only. A token, which can be sent as `page_token` to retrieve the
24473 /// next page. If this field is omitted, there are no subsequent pages.
24474 pub next_page_token: std::string::String,
24475
24476 /// Output only. Locations that could not be reached.
24477 pub unreachable: std::vec::Vec<std::string::String>,
24478
24479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24480}
24481
24482impl ListImageImportJobsResponse {
24483 /// Creates a new default instance.
24484 pub fn new() -> Self {
24485 std::default::Default::default()
24486 }
24487
24488 /// Sets the value of [image_import_jobs][crate::model::ListImageImportJobsResponse::image_import_jobs].
24489 ///
24490 /// # Example
24491 /// ```ignore,no_run
24492 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsResponse;
24493 /// use google_cloud_vmmigration_v1::model::ImageImportJob;
24494 /// let x = ListImageImportJobsResponse::new()
24495 /// .set_image_import_jobs([
24496 /// ImageImportJob::default()/* use setters */,
24497 /// ImageImportJob::default()/* use (different) setters */,
24498 /// ]);
24499 /// ```
24500 pub fn set_image_import_jobs<T, V>(mut self, v: T) -> Self
24501 where
24502 T: std::iter::IntoIterator<Item = V>,
24503 V: std::convert::Into<crate::model::ImageImportJob>,
24504 {
24505 use std::iter::Iterator;
24506 self.image_import_jobs = v.into_iter().map(|i| i.into()).collect();
24507 self
24508 }
24509
24510 /// Sets the value of [next_page_token][crate::model::ListImageImportJobsResponse::next_page_token].
24511 ///
24512 /// # Example
24513 /// ```ignore,no_run
24514 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsResponse;
24515 /// let x = ListImageImportJobsResponse::new().set_next_page_token("example");
24516 /// ```
24517 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24518 self.next_page_token = v.into();
24519 self
24520 }
24521
24522 /// Sets the value of [unreachable][crate::model::ListImageImportJobsResponse::unreachable].
24523 ///
24524 /// # Example
24525 /// ```ignore,no_run
24526 /// # use google_cloud_vmmigration_v1::model::ListImageImportJobsResponse;
24527 /// let x = ListImageImportJobsResponse::new().set_unreachable(["a", "b", "c"]);
24528 /// ```
24529 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
24530 where
24531 T: std::iter::IntoIterator<Item = V>,
24532 V: std::convert::Into<std::string::String>,
24533 {
24534 use std::iter::Iterator;
24535 self.unreachable = v.into_iter().map(|i| i.into()).collect();
24536 self
24537 }
24538}
24539
24540impl wkt::message::Message for ListImageImportJobsResponse {
24541 fn typename() -> &'static str {
24542 "type.googleapis.com/google.cloud.vmmigration.v1.ListImageImportJobsResponse"
24543 }
24544}
24545
24546#[doc(hidden)]
24547impl google_cloud_gax::paginator::internal::PageableResponse for ListImageImportJobsResponse {
24548 type PageItem = crate::model::ImageImportJob;
24549
24550 fn items(self) -> std::vec::Vec<Self::PageItem> {
24551 self.image_import_jobs
24552 }
24553
24554 fn next_page_token(&self) -> std::string::String {
24555 use std::clone::Clone;
24556 self.next_page_token.clone()
24557 }
24558}
24559
24560/// Request message for 'CancelImageImportJob' request.
24561#[derive(Clone, Default, PartialEq)]
24562#[non_exhaustive]
24563pub struct CancelImageImportJobRequest {
24564 /// Required. The image import job id.
24565 pub name: std::string::String,
24566
24567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24568}
24569
24570impl CancelImageImportJobRequest {
24571 /// Creates a new default instance.
24572 pub fn new() -> Self {
24573 std::default::Default::default()
24574 }
24575
24576 /// Sets the value of [name][crate::model::CancelImageImportJobRequest::name].
24577 ///
24578 /// # Example
24579 /// ```ignore,no_run
24580 /// # use google_cloud_vmmigration_v1::model::CancelImageImportJobRequest;
24581 /// # let project_id = "project_id";
24582 /// # let location_id = "location_id";
24583 /// # let job_id = "job_id";
24584 /// # let result_id = "result_id";
24585 /// let x = CancelImageImportJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/imageImports/{job_id}/imageImportJobs/{result_id}"));
24586 /// ```
24587 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24588 self.name = v.into();
24589 self
24590 }
24591}
24592
24593impl wkt::message::Message for CancelImageImportJobRequest {
24594 fn typename() -> &'static str {
24595 "type.googleapis.com/google.cloud.vmmigration.v1.CancelImageImportJobRequest"
24596 }
24597}
24598
24599/// Response message for 'CancelImageImportJob' request.
24600#[derive(Clone, Default, PartialEq)]
24601#[non_exhaustive]
24602pub struct CancelImageImportJobResponse {
24603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24604}
24605
24606impl CancelImageImportJobResponse {
24607 /// Creates a new default instance.
24608 pub fn new() -> Self {
24609 std::default::Default::default()
24610 }
24611}
24612
24613impl wkt::message::Message for CancelImageImportJobResponse {
24614 fn typename() -> &'static str {
24615 "type.googleapis.com/google.cloud.vmmigration.v1.CancelImageImportJobResponse"
24616 }
24617}
24618
24619/// Describes the disk which will be migrated from the source environment.
24620/// The source disk has to be unattached.
24621#[derive(Clone, Default, PartialEq)]
24622#[non_exhaustive]
24623pub struct DiskMigrationJob {
24624 /// Output only. Identifier. The identifier of the DiskMigrationJob.
24625 pub name: std::string::String,
24626
24627 /// Required. Details of the target Disk in Compute Engine.
24628 pub target_details: std::option::Option<crate::model::DiskMigrationJobTargetDetails>,
24629
24630 /// Output only. The time the DiskMigrationJob resource was created.
24631 pub create_time: std::option::Option<wkt::Timestamp>,
24632
24633 /// Output only. The last time the DiskMigrationJob resource was updated.
24634 pub update_time: std::option::Option<wkt::Timestamp>,
24635
24636 /// Output only. State of the DiskMigrationJob.
24637 pub state: crate::model::disk_migration_job::State,
24638
24639 /// Output only. Provides details on the errors that led to the disk migration
24640 /// job's state in case of an error.
24641 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
24642
24643 /// Output only. The disk migration steps list representing its progress.
24644 pub steps: std::vec::Vec<crate::model::DiskMigrationStep>,
24645
24646 /// Unattached source disk details.
24647 pub source_disk_details:
24648 std::option::Option<crate::model::disk_migration_job::SourceDiskDetails>,
24649
24650 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24651}
24652
24653impl DiskMigrationJob {
24654 /// Creates a new default instance.
24655 pub fn new() -> Self {
24656 std::default::Default::default()
24657 }
24658
24659 /// Sets the value of [name][crate::model::DiskMigrationJob::name].
24660 ///
24661 /// # Example
24662 /// ```ignore,no_run
24663 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24664 /// # let project_id = "project_id";
24665 /// # let location_id = "location_id";
24666 /// # let source_id = "source_id";
24667 /// # let disk_migration_job_id = "disk_migration_job_id";
24668 /// let x = DiskMigrationJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/diskMigrationJobs/{disk_migration_job_id}"));
24669 /// ```
24670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24671 self.name = v.into();
24672 self
24673 }
24674
24675 /// Sets the value of [target_details][crate::model::DiskMigrationJob::target_details].
24676 ///
24677 /// # Example
24678 /// ```ignore,no_run
24679 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24680 /// use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
24681 /// let x = DiskMigrationJob::new().set_target_details(DiskMigrationJobTargetDetails::default()/* use setters */);
24682 /// ```
24683 pub fn set_target_details<T>(mut self, v: T) -> Self
24684 where
24685 T: std::convert::Into<crate::model::DiskMigrationJobTargetDetails>,
24686 {
24687 self.target_details = std::option::Option::Some(v.into());
24688 self
24689 }
24690
24691 /// Sets or clears the value of [target_details][crate::model::DiskMigrationJob::target_details].
24692 ///
24693 /// # Example
24694 /// ```ignore,no_run
24695 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24696 /// use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
24697 /// let x = DiskMigrationJob::new().set_or_clear_target_details(Some(DiskMigrationJobTargetDetails::default()/* use setters */));
24698 /// let x = DiskMigrationJob::new().set_or_clear_target_details(None::<DiskMigrationJobTargetDetails>);
24699 /// ```
24700 pub fn set_or_clear_target_details<T>(mut self, v: std::option::Option<T>) -> Self
24701 where
24702 T: std::convert::Into<crate::model::DiskMigrationJobTargetDetails>,
24703 {
24704 self.target_details = v.map(|x| x.into());
24705 self
24706 }
24707
24708 /// Sets the value of [create_time][crate::model::DiskMigrationJob::create_time].
24709 ///
24710 /// # Example
24711 /// ```ignore,no_run
24712 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24713 /// use wkt::Timestamp;
24714 /// let x = DiskMigrationJob::new().set_create_time(Timestamp::default()/* use setters */);
24715 /// ```
24716 pub fn set_create_time<T>(mut self, v: T) -> Self
24717 where
24718 T: std::convert::Into<wkt::Timestamp>,
24719 {
24720 self.create_time = std::option::Option::Some(v.into());
24721 self
24722 }
24723
24724 /// Sets or clears the value of [create_time][crate::model::DiskMigrationJob::create_time].
24725 ///
24726 /// # Example
24727 /// ```ignore,no_run
24728 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24729 /// use wkt::Timestamp;
24730 /// let x = DiskMigrationJob::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
24731 /// let x = DiskMigrationJob::new().set_or_clear_create_time(None::<Timestamp>);
24732 /// ```
24733 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
24734 where
24735 T: std::convert::Into<wkt::Timestamp>,
24736 {
24737 self.create_time = v.map(|x| x.into());
24738 self
24739 }
24740
24741 /// Sets the value of [update_time][crate::model::DiskMigrationJob::update_time].
24742 ///
24743 /// # Example
24744 /// ```ignore,no_run
24745 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24746 /// use wkt::Timestamp;
24747 /// let x = DiskMigrationJob::new().set_update_time(Timestamp::default()/* use setters */);
24748 /// ```
24749 pub fn set_update_time<T>(mut self, v: T) -> Self
24750 where
24751 T: std::convert::Into<wkt::Timestamp>,
24752 {
24753 self.update_time = std::option::Option::Some(v.into());
24754 self
24755 }
24756
24757 /// Sets or clears the value of [update_time][crate::model::DiskMigrationJob::update_time].
24758 ///
24759 /// # Example
24760 /// ```ignore,no_run
24761 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24762 /// use wkt::Timestamp;
24763 /// let x = DiskMigrationJob::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
24764 /// let x = DiskMigrationJob::new().set_or_clear_update_time(None::<Timestamp>);
24765 /// ```
24766 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
24767 where
24768 T: std::convert::Into<wkt::Timestamp>,
24769 {
24770 self.update_time = v.map(|x| x.into());
24771 self
24772 }
24773
24774 /// Sets the value of [state][crate::model::DiskMigrationJob::state].
24775 ///
24776 /// # Example
24777 /// ```ignore,no_run
24778 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24779 /// use google_cloud_vmmigration_v1::model::disk_migration_job::State;
24780 /// let x0 = DiskMigrationJob::new().set_state(State::Ready);
24781 /// let x1 = DiskMigrationJob::new().set_state(State::Running);
24782 /// let x2 = DiskMigrationJob::new().set_state(State::Succeeded);
24783 /// ```
24784 pub fn set_state<T: std::convert::Into<crate::model::disk_migration_job::State>>(
24785 mut self,
24786 v: T,
24787 ) -> Self {
24788 self.state = v.into();
24789 self
24790 }
24791
24792 /// Sets the value of [errors][crate::model::DiskMigrationJob::errors].
24793 ///
24794 /// # Example
24795 /// ```ignore,no_run
24796 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24797 /// use google_cloud_rpc::model::Status;
24798 /// let x = DiskMigrationJob::new()
24799 /// .set_errors([
24800 /// Status::default()/* use setters */,
24801 /// Status::default()/* use (different) setters */,
24802 /// ]);
24803 /// ```
24804 pub fn set_errors<T, V>(mut self, v: T) -> Self
24805 where
24806 T: std::iter::IntoIterator<Item = V>,
24807 V: std::convert::Into<google_cloud_rpc::model::Status>,
24808 {
24809 use std::iter::Iterator;
24810 self.errors = v.into_iter().map(|i| i.into()).collect();
24811 self
24812 }
24813
24814 /// Sets the value of [steps][crate::model::DiskMigrationJob::steps].
24815 ///
24816 /// # Example
24817 /// ```ignore,no_run
24818 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24819 /// use google_cloud_vmmigration_v1::model::DiskMigrationStep;
24820 /// let x = DiskMigrationJob::new()
24821 /// .set_steps([
24822 /// DiskMigrationStep::default()/* use setters */,
24823 /// DiskMigrationStep::default()/* use (different) setters */,
24824 /// ]);
24825 /// ```
24826 pub fn set_steps<T, V>(mut self, v: T) -> Self
24827 where
24828 T: std::iter::IntoIterator<Item = V>,
24829 V: std::convert::Into<crate::model::DiskMigrationStep>,
24830 {
24831 use std::iter::Iterator;
24832 self.steps = v.into_iter().map(|i| i.into()).collect();
24833 self
24834 }
24835
24836 /// Sets the value of [source_disk_details][crate::model::DiskMigrationJob::source_disk_details].
24837 ///
24838 /// Note that all the setters affecting `source_disk_details` are mutually
24839 /// exclusive.
24840 ///
24841 /// # Example
24842 /// ```ignore,no_run
24843 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24844 /// use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
24845 /// let x = DiskMigrationJob::new().set_source_disk_details(Some(
24846 /// google_cloud_vmmigration_v1::model::disk_migration_job::SourceDiskDetails::AwsSourceDiskDetails(AwsSourceDiskDetails::default().into())));
24847 /// ```
24848 pub fn set_source_disk_details<
24849 T: std::convert::Into<
24850 std::option::Option<crate::model::disk_migration_job::SourceDiskDetails>,
24851 >,
24852 >(
24853 mut self,
24854 v: T,
24855 ) -> Self {
24856 self.source_disk_details = v.into();
24857 self
24858 }
24859
24860 /// The value of [source_disk_details][crate::model::DiskMigrationJob::source_disk_details]
24861 /// if it holds a `AwsSourceDiskDetails`, `None` if the field is not set or
24862 /// holds a different branch.
24863 pub fn aws_source_disk_details(
24864 &self,
24865 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsSourceDiskDetails>> {
24866 #[allow(unreachable_patterns)]
24867 self.source_disk_details.as_ref().and_then(|v| match v {
24868 crate::model::disk_migration_job::SourceDiskDetails::AwsSourceDiskDetails(v) => {
24869 std::option::Option::Some(v)
24870 }
24871 _ => std::option::Option::None,
24872 })
24873 }
24874
24875 /// Sets the value of [source_disk_details][crate::model::DiskMigrationJob::source_disk_details]
24876 /// to hold a `AwsSourceDiskDetails`.
24877 ///
24878 /// Note that all the setters affecting `source_disk_details` are
24879 /// mutually exclusive.
24880 ///
24881 /// # Example
24882 /// ```ignore,no_run
24883 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJob;
24884 /// use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
24885 /// let x = DiskMigrationJob::new().set_aws_source_disk_details(AwsSourceDiskDetails::default()/* use setters */);
24886 /// assert!(x.aws_source_disk_details().is_some());
24887 /// ```
24888 pub fn set_aws_source_disk_details<
24889 T: std::convert::Into<std::boxed::Box<crate::model::AwsSourceDiskDetails>>,
24890 >(
24891 mut self,
24892 v: T,
24893 ) -> Self {
24894 self.source_disk_details = std::option::Option::Some(
24895 crate::model::disk_migration_job::SourceDiskDetails::AwsSourceDiskDetails(v.into()),
24896 );
24897 self
24898 }
24899}
24900
24901impl wkt::message::Message for DiskMigrationJob {
24902 fn typename() -> &'static str {
24903 "type.googleapis.com/google.cloud.vmmigration.v1.DiskMigrationJob"
24904 }
24905}
24906
24907/// Defines additional types related to [DiskMigrationJob].
24908pub mod disk_migration_job {
24909 #[allow(unused_imports)]
24910 use super::*;
24911
24912 /// The possible values of the state/health of DiskMigrationJob.
24913 ///
24914 /// # Working with unknown values
24915 ///
24916 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24917 /// additional enum variants at any time. Adding new variants is not considered
24918 /// a breaking change. Applications should write their code in anticipation of:
24919 ///
24920 /// - New values appearing in future releases of the client library, **and**
24921 /// - New values received dynamically, without application changes.
24922 ///
24923 /// Please consult the [Working with enums] section in the user guide for some
24924 /// guidelines.
24925 ///
24926 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24927 #[derive(Clone, Debug, PartialEq)]
24928 #[non_exhaustive]
24929 pub enum State {
24930 /// The state is unspecified. This is not in use.
24931 Unspecified,
24932 /// The initial state of the disk migration.
24933 /// In this state the customers can update the target details.
24934 Ready,
24935 /// The migration is active, and it's running or scheduled to run.
24936 Running,
24937 /// The migration completed successfully.
24938 Succeeded,
24939 /// Migration cancellation was initiated.
24940 Cancelling,
24941 /// The migration was cancelled.
24942 Cancelled,
24943 /// The migration process encountered an unrecoverable error and was aborted.
24944 Failed,
24945 /// If set, the enum was initialized with an unknown value.
24946 ///
24947 /// Applications can examine the value using [State::value] or
24948 /// [State::name].
24949 UnknownValue(state::UnknownValue),
24950 }
24951
24952 #[doc(hidden)]
24953 pub mod state {
24954 #[allow(unused_imports)]
24955 use super::*;
24956 #[derive(Clone, Debug, PartialEq)]
24957 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24958 }
24959
24960 impl State {
24961 /// Gets the enum value.
24962 ///
24963 /// Returns `None` if the enum contains an unknown value deserialized from
24964 /// the string representation of enums.
24965 pub fn value(&self) -> std::option::Option<i32> {
24966 match self {
24967 Self::Unspecified => std::option::Option::Some(0),
24968 Self::Ready => std::option::Option::Some(1),
24969 Self::Running => std::option::Option::Some(3),
24970 Self::Succeeded => std::option::Option::Some(4),
24971 Self::Cancelling => std::option::Option::Some(5),
24972 Self::Cancelled => std::option::Option::Some(6),
24973 Self::Failed => std::option::Option::Some(7),
24974 Self::UnknownValue(u) => u.0.value(),
24975 }
24976 }
24977
24978 /// Gets the enum value as a string.
24979 ///
24980 /// Returns `None` if the enum contains an unknown value deserialized from
24981 /// the integer representation of enums.
24982 pub fn name(&self) -> std::option::Option<&str> {
24983 match self {
24984 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
24985 Self::Ready => std::option::Option::Some("READY"),
24986 Self::Running => std::option::Option::Some("RUNNING"),
24987 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24988 Self::Cancelling => std::option::Option::Some("CANCELLING"),
24989 Self::Cancelled => std::option::Option::Some("CANCELLED"),
24990 Self::Failed => std::option::Option::Some("FAILED"),
24991 Self::UnknownValue(u) => u.0.name(),
24992 }
24993 }
24994 }
24995
24996 impl std::default::Default for State {
24997 fn default() -> Self {
24998 use std::convert::From;
24999 Self::from(0)
25000 }
25001 }
25002
25003 impl std::fmt::Display for State {
25004 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25005 wkt::internal::display_enum(f, self.name(), self.value())
25006 }
25007 }
25008
25009 impl std::convert::From<i32> for State {
25010 fn from(value: i32) -> Self {
25011 match value {
25012 0 => Self::Unspecified,
25013 1 => Self::Ready,
25014 3 => Self::Running,
25015 4 => Self::Succeeded,
25016 5 => Self::Cancelling,
25017 6 => Self::Cancelled,
25018 7 => Self::Failed,
25019 _ => Self::UnknownValue(state::UnknownValue(
25020 wkt::internal::UnknownEnumValue::Integer(value),
25021 )),
25022 }
25023 }
25024 }
25025
25026 impl std::convert::From<&str> for State {
25027 fn from(value: &str) -> Self {
25028 use std::string::ToString;
25029 match value {
25030 "STATE_UNSPECIFIED" => Self::Unspecified,
25031 "READY" => Self::Ready,
25032 "RUNNING" => Self::Running,
25033 "SUCCEEDED" => Self::Succeeded,
25034 "CANCELLING" => Self::Cancelling,
25035 "CANCELLED" => Self::Cancelled,
25036 "FAILED" => Self::Failed,
25037 _ => Self::UnknownValue(state::UnknownValue(
25038 wkt::internal::UnknownEnumValue::String(value.to_string()),
25039 )),
25040 }
25041 }
25042 }
25043
25044 impl serde::ser::Serialize for State {
25045 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25046 where
25047 S: serde::Serializer,
25048 {
25049 match self {
25050 Self::Unspecified => serializer.serialize_i32(0),
25051 Self::Ready => serializer.serialize_i32(1),
25052 Self::Running => serializer.serialize_i32(3),
25053 Self::Succeeded => serializer.serialize_i32(4),
25054 Self::Cancelling => serializer.serialize_i32(5),
25055 Self::Cancelled => serializer.serialize_i32(6),
25056 Self::Failed => serializer.serialize_i32(7),
25057 Self::UnknownValue(u) => u.0.serialize(serializer),
25058 }
25059 }
25060 }
25061
25062 impl<'de> serde::de::Deserialize<'de> for State {
25063 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25064 where
25065 D: serde::Deserializer<'de>,
25066 {
25067 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
25068 ".google.cloud.vmmigration.v1.DiskMigrationJob.State",
25069 ))
25070 }
25071 }
25072
25073 /// Unattached source disk details.
25074 #[derive(Clone, Debug, PartialEq)]
25075 #[non_exhaustive]
25076 pub enum SourceDiskDetails {
25077 /// Details of the unattached AWS source disk.
25078 AwsSourceDiskDetails(std::boxed::Box<crate::model::AwsSourceDiskDetails>),
25079 }
25080}
25081
25082/// Details of the target disk in Compute Engine.
25083#[derive(Clone, Default, PartialEq)]
25084#[non_exhaustive]
25085pub struct DiskMigrationJobTargetDetails {
25086 /// Required. The name of the resource of type TargetProject which represents
25087 /// the Compute Engine project in which to create the disk. Should be of the
25088 /// form: projects/{project}/locations/global/targetProjects/{target-project}
25089 pub target_project: std::string::String,
25090
25091 /// Optional. A map of labels to associate with the disk.
25092 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
25093
25094 /// Optional. The encryption to apply to the disk.
25095 /// If the DiskMigrationJob parent Source resource has an encryption, this
25096 /// field must be set to the same encryption key.
25097 pub encryption: std::option::Option<crate::model::Encryption>,
25098
25099 /// The target storage.
25100 pub target_storage:
25101 std::option::Option<crate::model::disk_migration_job_target_details::TargetStorage>,
25102
25103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25104}
25105
25106impl DiskMigrationJobTargetDetails {
25107 /// Creates a new default instance.
25108 pub fn new() -> Self {
25109 std::default::Default::default()
25110 }
25111
25112 /// Sets the value of [target_project][crate::model::DiskMigrationJobTargetDetails::target_project].
25113 ///
25114 /// # Example
25115 /// ```ignore,no_run
25116 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
25117 /// # let project_id = "project_id";
25118 /// # let location_id = "location_id";
25119 /// # let target_project_id = "target_project_id";
25120 /// let x = DiskMigrationJobTargetDetails::new().set_target_project(format!("projects/{project_id}/locations/{location_id}/targetProjects/{target_project_id}"));
25121 /// ```
25122 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25123 self.target_project = v.into();
25124 self
25125 }
25126
25127 /// Sets the value of [labels][crate::model::DiskMigrationJobTargetDetails::labels].
25128 ///
25129 /// # Example
25130 /// ```ignore,no_run
25131 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
25132 /// let x = DiskMigrationJobTargetDetails::new().set_labels([
25133 /// ("key0", "abc"),
25134 /// ("key1", "xyz"),
25135 /// ]);
25136 /// ```
25137 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
25138 where
25139 T: std::iter::IntoIterator<Item = (K, V)>,
25140 K: std::convert::Into<std::string::String>,
25141 V: std::convert::Into<std::string::String>,
25142 {
25143 use std::iter::Iterator;
25144 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
25145 self
25146 }
25147
25148 /// Sets the value of [encryption][crate::model::DiskMigrationJobTargetDetails::encryption].
25149 ///
25150 /// # Example
25151 /// ```ignore,no_run
25152 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
25153 /// use google_cloud_vmmigration_v1::model::Encryption;
25154 /// let x = DiskMigrationJobTargetDetails::new().set_encryption(Encryption::default()/* use setters */);
25155 /// ```
25156 pub fn set_encryption<T>(mut self, v: T) -> Self
25157 where
25158 T: std::convert::Into<crate::model::Encryption>,
25159 {
25160 self.encryption = std::option::Option::Some(v.into());
25161 self
25162 }
25163
25164 /// Sets or clears the value of [encryption][crate::model::DiskMigrationJobTargetDetails::encryption].
25165 ///
25166 /// # Example
25167 /// ```ignore,no_run
25168 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
25169 /// use google_cloud_vmmigration_v1::model::Encryption;
25170 /// let x = DiskMigrationJobTargetDetails::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
25171 /// let x = DiskMigrationJobTargetDetails::new().set_or_clear_encryption(None::<Encryption>);
25172 /// ```
25173 pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
25174 where
25175 T: std::convert::Into<crate::model::Encryption>,
25176 {
25177 self.encryption = v.map(|x| x.into());
25178 self
25179 }
25180
25181 /// Sets the value of [target_storage][crate::model::DiskMigrationJobTargetDetails::target_storage].
25182 ///
25183 /// Note that all the setters affecting `target_storage` are mutually
25184 /// exclusive.
25185 ///
25186 /// # Example
25187 /// ```ignore,no_run
25188 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
25189 /// use google_cloud_vmmigration_v1::model::ComputeEngineDisk;
25190 /// let x = DiskMigrationJobTargetDetails::new().set_target_storage(Some(
25191 /// google_cloud_vmmigration_v1::model::disk_migration_job_target_details::TargetStorage::TargetDisk(ComputeEngineDisk::default().into())));
25192 /// ```
25193 pub fn set_target_storage<
25194 T: std::convert::Into<
25195 std::option::Option<crate::model::disk_migration_job_target_details::TargetStorage>,
25196 >,
25197 >(
25198 mut self,
25199 v: T,
25200 ) -> Self {
25201 self.target_storage = v.into();
25202 self
25203 }
25204
25205 /// The value of [target_storage][crate::model::DiskMigrationJobTargetDetails::target_storage]
25206 /// if it holds a `TargetDisk`, `None` if the field is not set or
25207 /// holds a different branch.
25208 pub fn target_disk(
25209 &self,
25210 ) -> std::option::Option<&std::boxed::Box<crate::model::ComputeEngineDisk>> {
25211 #[allow(unreachable_patterns)]
25212 self.target_storage.as_ref().and_then(|v| match v {
25213 crate::model::disk_migration_job_target_details::TargetStorage::TargetDisk(v) => {
25214 std::option::Option::Some(v)
25215 }
25216 _ => std::option::Option::None,
25217 })
25218 }
25219
25220 /// Sets the value of [target_storage][crate::model::DiskMigrationJobTargetDetails::target_storage]
25221 /// to hold a `TargetDisk`.
25222 ///
25223 /// Note that all the setters affecting `target_storage` are
25224 /// mutually exclusive.
25225 ///
25226 /// # Example
25227 /// ```ignore,no_run
25228 /// # use google_cloud_vmmigration_v1::model::DiskMigrationJobTargetDetails;
25229 /// use google_cloud_vmmigration_v1::model::ComputeEngineDisk;
25230 /// let x = DiskMigrationJobTargetDetails::new().set_target_disk(ComputeEngineDisk::default()/* use setters */);
25231 /// assert!(x.target_disk().is_some());
25232 /// ```
25233 pub fn set_target_disk<
25234 T: std::convert::Into<std::boxed::Box<crate::model::ComputeEngineDisk>>,
25235 >(
25236 mut self,
25237 v: T,
25238 ) -> Self {
25239 self.target_storage = std::option::Option::Some(
25240 crate::model::disk_migration_job_target_details::TargetStorage::TargetDisk(v.into()),
25241 );
25242 self
25243 }
25244}
25245
25246impl wkt::message::Message for DiskMigrationJobTargetDetails {
25247 fn typename() -> &'static str {
25248 "type.googleapis.com/google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails"
25249 }
25250}
25251
25252/// Defines additional types related to [DiskMigrationJobTargetDetails].
25253pub mod disk_migration_job_target_details {
25254 #[allow(unused_imports)]
25255 use super::*;
25256
25257 /// The target storage.
25258 #[derive(Clone, Debug, PartialEq)]
25259 #[non_exhaustive]
25260 pub enum TargetStorage {
25261 /// Required. The target disk.
25262 TargetDisk(std::boxed::Box<crate::model::ComputeEngineDisk>),
25263 }
25264}
25265
25266/// DiskMigrationStep holds information about the disk migration step progress.
25267#[derive(Clone, Default, PartialEq)]
25268#[non_exhaustive]
25269pub struct DiskMigrationStep {
25270 /// Output only. The time the step has started.
25271 pub start_time: std::option::Option<wkt::Timestamp>,
25272
25273 /// Output only. The time the step has ended.
25274 pub end_time: std::option::Option<wkt::Timestamp>,
25275
25276 /// The step details.
25277 pub step: std::option::Option<crate::model::disk_migration_step::Step>,
25278
25279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25280}
25281
25282impl DiskMigrationStep {
25283 /// Creates a new default instance.
25284 pub fn new() -> Self {
25285 std::default::Default::default()
25286 }
25287
25288 /// Sets the value of [start_time][crate::model::DiskMigrationStep::start_time].
25289 ///
25290 /// # Example
25291 /// ```ignore,no_run
25292 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25293 /// use wkt::Timestamp;
25294 /// let x = DiskMigrationStep::new().set_start_time(Timestamp::default()/* use setters */);
25295 /// ```
25296 pub fn set_start_time<T>(mut self, v: T) -> Self
25297 where
25298 T: std::convert::Into<wkt::Timestamp>,
25299 {
25300 self.start_time = std::option::Option::Some(v.into());
25301 self
25302 }
25303
25304 /// Sets or clears the value of [start_time][crate::model::DiskMigrationStep::start_time].
25305 ///
25306 /// # Example
25307 /// ```ignore,no_run
25308 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25309 /// use wkt::Timestamp;
25310 /// let x = DiskMigrationStep::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
25311 /// let x = DiskMigrationStep::new().set_or_clear_start_time(None::<Timestamp>);
25312 /// ```
25313 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
25314 where
25315 T: std::convert::Into<wkt::Timestamp>,
25316 {
25317 self.start_time = v.map(|x| x.into());
25318 self
25319 }
25320
25321 /// Sets the value of [end_time][crate::model::DiskMigrationStep::end_time].
25322 ///
25323 /// # Example
25324 /// ```ignore,no_run
25325 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25326 /// use wkt::Timestamp;
25327 /// let x = DiskMigrationStep::new().set_end_time(Timestamp::default()/* use setters */);
25328 /// ```
25329 pub fn set_end_time<T>(mut self, v: T) -> Self
25330 where
25331 T: std::convert::Into<wkt::Timestamp>,
25332 {
25333 self.end_time = std::option::Option::Some(v.into());
25334 self
25335 }
25336
25337 /// Sets or clears the value of [end_time][crate::model::DiskMigrationStep::end_time].
25338 ///
25339 /// # Example
25340 /// ```ignore,no_run
25341 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25342 /// use wkt::Timestamp;
25343 /// let x = DiskMigrationStep::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
25344 /// let x = DiskMigrationStep::new().set_or_clear_end_time(None::<Timestamp>);
25345 /// ```
25346 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
25347 where
25348 T: std::convert::Into<wkt::Timestamp>,
25349 {
25350 self.end_time = v.map(|x| x.into());
25351 self
25352 }
25353
25354 /// Sets the value of [step][crate::model::DiskMigrationStep::step].
25355 ///
25356 /// Note that all the setters affecting `step` are mutually
25357 /// exclusive.
25358 ///
25359 /// # Example
25360 /// ```ignore,no_run
25361 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25362 /// use google_cloud_vmmigration_v1::model::CreatingSourceDiskSnapshotStep;
25363 /// let x = DiskMigrationStep::new().set_step(Some(
25364 /// google_cloud_vmmigration_v1::model::disk_migration_step::Step::CreatingSourceDiskSnapshot(CreatingSourceDiskSnapshotStep::default().into())));
25365 /// ```
25366 pub fn set_step<
25367 T: std::convert::Into<std::option::Option<crate::model::disk_migration_step::Step>>,
25368 >(
25369 mut self,
25370 v: T,
25371 ) -> Self {
25372 self.step = v.into();
25373 self
25374 }
25375
25376 /// The value of [step][crate::model::DiskMigrationStep::step]
25377 /// if it holds a `CreatingSourceDiskSnapshot`, `None` if the field is not set or
25378 /// holds a different branch.
25379 pub fn creating_source_disk_snapshot(
25380 &self,
25381 ) -> std::option::Option<&std::boxed::Box<crate::model::CreatingSourceDiskSnapshotStep>> {
25382 #[allow(unreachable_patterns)]
25383 self.step.as_ref().and_then(|v| match v {
25384 crate::model::disk_migration_step::Step::CreatingSourceDiskSnapshot(v) => {
25385 std::option::Option::Some(v)
25386 }
25387 _ => std::option::Option::None,
25388 })
25389 }
25390
25391 /// Sets the value of [step][crate::model::DiskMigrationStep::step]
25392 /// to hold a `CreatingSourceDiskSnapshot`.
25393 ///
25394 /// Note that all the setters affecting `step` are
25395 /// mutually exclusive.
25396 ///
25397 /// # Example
25398 /// ```ignore,no_run
25399 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25400 /// use google_cloud_vmmigration_v1::model::CreatingSourceDiskSnapshotStep;
25401 /// let x = DiskMigrationStep::new().set_creating_source_disk_snapshot(CreatingSourceDiskSnapshotStep::default()/* use setters */);
25402 /// assert!(x.creating_source_disk_snapshot().is_some());
25403 /// assert!(x.copying_source_disk_snapshot().is_none());
25404 /// assert!(x.provisioning_target_disk().is_none());
25405 /// ```
25406 pub fn set_creating_source_disk_snapshot<
25407 T: std::convert::Into<std::boxed::Box<crate::model::CreatingSourceDiskSnapshotStep>>,
25408 >(
25409 mut self,
25410 v: T,
25411 ) -> Self {
25412 self.step = std::option::Option::Some(
25413 crate::model::disk_migration_step::Step::CreatingSourceDiskSnapshot(v.into()),
25414 );
25415 self
25416 }
25417
25418 /// The value of [step][crate::model::DiskMigrationStep::step]
25419 /// if it holds a `CopyingSourceDiskSnapshot`, `None` if the field is not set or
25420 /// holds a different branch.
25421 pub fn copying_source_disk_snapshot(
25422 &self,
25423 ) -> std::option::Option<&std::boxed::Box<crate::model::CopyingSourceDiskSnapshotStep>> {
25424 #[allow(unreachable_patterns)]
25425 self.step.as_ref().and_then(|v| match v {
25426 crate::model::disk_migration_step::Step::CopyingSourceDiskSnapshot(v) => {
25427 std::option::Option::Some(v)
25428 }
25429 _ => std::option::Option::None,
25430 })
25431 }
25432
25433 /// Sets the value of [step][crate::model::DiskMigrationStep::step]
25434 /// to hold a `CopyingSourceDiskSnapshot`.
25435 ///
25436 /// Note that all the setters affecting `step` are
25437 /// mutually exclusive.
25438 ///
25439 /// # Example
25440 /// ```ignore,no_run
25441 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25442 /// use google_cloud_vmmigration_v1::model::CopyingSourceDiskSnapshotStep;
25443 /// let x = DiskMigrationStep::new().set_copying_source_disk_snapshot(CopyingSourceDiskSnapshotStep::default()/* use setters */);
25444 /// assert!(x.copying_source_disk_snapshot().is_some());
25445 /// assert!(x.creating_source_disk_snapshot().is_none());
25446 /// assert!(x.provisioning_target_disk().is_none());
25447 /// ```
25448 pub fn set_copying_source_disk_snapshot<
25449 T: std::convert::Into<std::boxed::Box<crate::model::CopyingSourceDiskSnapshotStep>>,
25450 >(
25451 mut self,
25452 v: T,
25453 ) -> Self {
25454 self.step = std::option::Option::Some(
25455 crate::model::disk_migration_step::Step::CopyingSourceDiskSnapshot(v.into()),
25456 );
25457 self
25458 }
25459
25460 /// The value of [step][crate::model::DiskMigrationStep::step]
25461 /// if it holds a `ProvisioningTargetDisk`, `None` if the field is not set or
25462 /// holds a different branch.
25463 pub fn provisioning_target_disk(
25464 &self,
25465 ) -> std::option::Option<&std::boxed::Box<crate::model::ProvisioningTargetDiskStep>> {
25466 #[allow(unreachable_patterns)]
25467 self.step.as_ref().and_then(|v| match v {
25468 crate::model::disk_migration_step::Step::ProvisioningTargetDisk(v) => {
25469 std::option::Option::Some(v)
25470 }
25471 _ => std::option::Option::None,
25472 })
25473 }
25474
25475 /// Sets the value of [step][crate::model::DiskMigrationStep::step]
25476 /// to hold a `ProvisioningTargetDisk`.
25477 ///
25478 /// Note that all the setters affecting `step` are
25479 /// mutually exclusive.
25480 ///
25481 /// # Example
25482 /// ```ignore,no_run
25483 /// # use google_cloud_vmmigration_v1::model::DiskMigrationStep;
25484 /// use google_cloud_vmmigration_v1::model::ProvisioningTargetDiskStep;
25485 /// let x = DiskMigrationStep::new().set_provisioning_target_disk(ProvisioningTargetDiskStep::default()/* use setters */);
25486 /// assert!(x.provisioning_target_disk().is_some());
25487 /// assert!(x.creating_source_disk_snapshot().is_none());
25488 /// assert!(x.copying_source_disk_snapshot().is_none());
25489 /// ```
25490 pub fn set_provisioning_target_disk<
25491 T: std::convert::Into<std::boxed::Box<crate::model::ProvisioningTargetDiskStep>>,
25492 >(
25493 mut self,
25494 v: T,
25495 ) -> Self {
25496 self.step = std::option::Option::Some(
25497 crate::model::disk_migration_step::Step::ProvisioningTargetDisk(v.into()),
25498 );
25499 self
25500 }
25501}
25502
25503impl wkt::message::Message for DiskMigrationStep {
25504 fn typename() -> &'static str {
25505 "type.googleapis.com/google.cloud.vmmigration.v1.DiskMigrationStep"
25506 }
25507}
25508
25509/// Defines additional types related to [DiskMigrationStep].
25510pub mod disk_migration_step {
25511 #[allow(unused_imports)]
25512 use super::*;
25513
25514 /// The step details.
25515 #[derive(Clone, Debug, PartialEq)]
25516 #[non_exhaustive]
25517 pub enum Step {
25518 /// Creating source disk snapshot step.
25519 CreatingSourceDiskSnapshot(std::boxed::Box<crate::model::CreatingSourceDiskSnapshotStep>),
25520 /// Copying source disk snapshot step.
25521 CopyingSourceDiskSnapshot(std::boxed::Box<crate::model::CopyingSourceDiskSnapshotStep>),
25522 /// Creating target disk step.
25523 ProvisioningTargetDisk(std::boxed::Box<crate::model::ProvisioningTargetDiskStep>),
25524 }
25525}
25526
25527/// CreatingSourceDiskSnapshotStep contains specific step details.
25528#[derive(Clone, Default, PartialEq)]
25529#[non_exhaustive]
25530pub struct CreatingSourceDiskSnapshotStep {
25531 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25532}
25533
25534impl CreatingSourceDiskSnapshotStep {
25535 /// Creates a new default instance.
25536 pub fn new() -> Self {
25537 std::default::Default::default()
25538 }
25539}
25540
25541impl wkt::message::Message for CreatingSourceDiskSnapshotStep {
25542 fn typename() -> &'static str {
25543 "type.googleapis.com/google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStep"
25544 }
25545}
25546
25547/// CopyingSourceDiskSnapshotStep contains specific step details.
25548#[derive(Clone, Default, PartialEq)]
25549#[non_exhaustive]
25550pub struct CopyingSourceDiskSnapshotStep {
25551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25552}
25553
25554impl CopyingSourceDiskSnapshotStep {
25555 /// Creates a new default instance.
25556 pub fn new() -> Self {
25557 std::default::Default::default()
25558 }
25559}
25560
25561impl wkt::message::Message for CopyingSourceDiskSnapshotStep {
25562 fn typename() -> &'static str {
25563 "type.googleapis.com/google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStep"
25564 }
25565}
25566
25567/// ProvisioningTargetDiskStep contains specific step details.
25568#[derive(Clone, Default, PartialEq)]
25569#[non_exhaustive]
25570pub struct ProvisioningTargetDiskStep {
25571 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25572}
25573
25574impl ProvisioningTargetDiskStep {
25575 /// Creates a new default instance.
25576 pub fn new() -> Self {
25577 std::default::Default::default()
25578 }
25579}
25580
25581impl wkt::message::Message for ProvisioningTargetDiskStep {
25582 fn typename() -> &'static str {
25583 "type.googleapis.com/google.cloud.vmmigration.v1.ProvisioningTargetDiskStep"
25584 }
25585}
25586
25587/// Compute Engine disk target details.
25588#[derive(Clone, Default, PartialEq)]
25589#[non_exhaustive]
25590pub struct ComputeEngineDisk {
25591 /// Optional. Target Compute Engine Disk ID.
25592 /// This is the resource ID segment of the Compute Engine Disk to create.
25593 /// In the resource name compute/v1/projects/{project}/zones/{zone}/disks/disk1
25594 /// "disk1" is the resource ID for the disk.
25595 pub disk_id: std::string::String,
25596
25597 /// Required. The Compute Engine zone in which to create the disk. Should be of
25598 /// the form: projects/{target-project}/locations/{zone}
25599 pub zone: std::string::String,
25600
25601 /// Optional. Replication zones of the regional disk. Should be of the form:
25602 /// projects/{target-project}/locations/{replica-zone}
25603 /// Currently only one replica zone is supported.
25604 pub replica_zones: std::vec::Vec<std::string::String>,
25605
25606 /// Required. The disk type to use.
25607 pub disk_type: crate::model::ComputeEngineDiskType,
25608
25609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25610}
25611
25612impl ComputeEngineDisk {
25613 /// Creates a new default instance.
25614 pub fn new() -> Self {
25615 std::default::Default::default()
25616 }
25617
25618 /// Sets the value of [disk_id][crate::model::ComputeEngineDisk::disk_id].
25619 ///
25620 /// # Example
25621 /// ```ignore,no_run
25622 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisk;
25623 /// let x = ComputeEngineDisk::new().set_disk_id("example");
25624 /// ```
25625 pub fn set_disk_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25626 self.disk_id = v.into();
25627 self
25628 }
25629
25630 /// Sets the value of [zone][crate::model::ComputeEngineDisk::zone].
25631 ///
25632 /// # Example
25633 /// ```ignore,no_run
25634 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisk;
25635 /// let x = ComputeEngineDisk::new().set_zone("example");
25636 /// ```
25637 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25638 self.zone = v.into();
25639 self
25640 }
25641
25642 /// Sets the value of [replica_zones][crate::model::ComputeEngineDisk::replica_zones].
25643 ///
25644 /// # Example
25645 /// ```ignore,no_run
25646 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisk;
25647 /// let x = ComputeEngineDisk::new().set_replica_zones(["a", "b", "c"]);
25648 /// ```
25649 pub fn set_replica_zones<T, V>(mut self, v: T) -> Self
25650 where
25651 T: std::iter::IntoIterator<Item = V>,
25652 V: std::convert::Into<std::string::String>,
25653 {
25654 use std::iter::Iterator;
25655 self.replica_zones = v.into_iter().map(|i| i.into()).collect();
25656 self
25657 }
25658
25659 /// Sets the value of [disk_type][crate::model::ComputeEngineDisk::disk_type].
25660 ///
25661 /// # Example
25662 /// ```ignore,no_run
25663 /// # use google_cloud_vmmigration_v1::model::ComputeEngineDisk;
25664 /// use google_cloud_vmmigration_v1::model::ComputeEngineDiskType;
25665 /// let x0 = ComputeEngineDisk::new().set_disk_type(ComputeEngineDiskType::Standard);
25666 /// let x1 = ComputeEngineDisk::new().set_disk_type(ComputeEngineDiskType::Ssd);
25667 /// let x2 = ComputeEngineDisk::new().set_disk_type(ComputeEngineDiskType::Balanced);
25668 /// ```
25669 pub fn set_disk_type<T: std::convert::Into<crate::model::ComputeEngineDiskType>>(
25670 mut self,
25671 v: T,
25672 ) -> Self {
25673 self.disk_type = v.into();
25674 self
25675 }
25676}
25677
25678impl wkt::message::Message for ComputeEngineDisk {
25679 fn typename() -> &'static str {
25680 "type.googleapis.com/google.cloud.vmmigration.v1.ComputeEngineDisk"
25681 }
25682}
25683
25684/// Represents the source AWS Disk details.
25685#[derive(Clone, Default, PartialEq)]
25686#[non_exhaustive]
25687pub struct AwsSourceDiskDetails {
25688 /// Required. AWS volume ID.
25689 pub volume_id: std::string::String,
25690
25691 /// Output only. Size in GiB.
25692 pub size_gib: i64,
25693
25694 /// Optional. Output only. Disk type.
25695 pub disk_type: crate::model::aws_source_disk_details::Type,
25696
25697 /// Optional. Output only. A map of AWS volume tags.
25698 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
25699
25700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25701}
25702
25703impl AwsSourceDiskDetails {
25704 /// Creates a new default instance.
25705 pub fn new() -> Self {
25706 std::default::Default::default()
25707 }
25708
25709 /// Sets the value of [volume_id][crate::model::AwsSourceDiskDetails::volume_id].
25710 ///
25711 /// # Example
25712 /// ```ignore,no_run
25713 /// # use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
25714 /// let x = AwsSourceDiskDetails::new().set_volume_id("example");
25715 /// ```
25716 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25717 self.volume_id = v.into();
25718 self
25719 }
25720
25721 /// Sets the value of [size_gib][crate::model::AwsSourceDiskDetails::size_gib].
25722 ///
25723 /// # Example
25724 /// ```ignore,no_run
25725 /// # use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
25726 /// let x = AwsSourceDiskDetails::new().set_size_gib(42);
25727 /// ```
25728 pub fn set_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
25729 self.size_gib = v.into();
25730 self
25731 }
25732
25733 /// Sets the value of [disk_type][crate::model::AwsSourceDiskDetails::disk_type].
25734 ///
25735 /// # Example
25736 /// ```ignore,no_run
25737 /// # use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
25738 /// use google_cloud_vmmigration_v1::model::aws_source_disk_details::Type;
25739 /// let x0 = AwsSourceDiskDetails::new().set_disk_type(Type::Gp2);
25740 /// let x1 = AwsSourceDiskDetails::new().set_disk_type(Type::Gp3);
25741 /// let x2 = AwsSourceDiskDetails::new().set_disk_type(Type::Io1);
25742 /// ```
25743 pub fn set_disk_type<T: std::convert::Into<crate::model::aws_source_disk_details::Type>>(
25744 mut self,
25745 v: T,
25746 ) -> Self {
25747 self.disk_type = v.into();
25748 self
25749 }
25750
25751 /// Sets the value of [tags][crate::model::AwsSourceDiskDetails::tags].
25752 ///
25753 /// # Example
25754 /// ```ignore,no_run
25755 /// # use google_cloud_vmmigration_v1::model::AwsSourceDiskDetails;
25756 /// let x = AwsSourceDiskDetails::new().set_tags([
25757 /// ("key0", "abc"),
25758 /// ("key1", "xyz"),
25759 /// ]);
25760 /// ```
25761 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
25762 where
25763 T: std::iter::IntoIterator<Item = (K, V)>,
25764 K: std::convert::Into<std::string::String>,
25765 V: std::convert::Into<std::string::String>,
25766 {
25767 use std::iter::Iterator;
25768 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
25769 self
25770 }
25771}
25772
25773impl wkt::message::Message for AwsSourceDiskDetails {
25774 fn typename() -> &'static str {
25775 "type.googleapis.com/google.cloud.vmmigration.v1.AwsSourceDiskDetails"
25776 }
25777}
25778
25779/// Defines additional types related to [AwsSourceDiskDetails].
25780pub mod aws_source_disk_details {
25781 #[allow(unused_imports)]
25782 use super::*;
25783
25784 /// Possible values for disk types.
25785 ///
25786 /// # Working with unknown values
25787 ///
25788 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25789 /// additional enum variants at any time. Adding new variants is not considered
25790 /// a breaking change. Applications should write their code in anticipation of:
25791 ///
25792 /// - New values appearing in future releases of the client library, **and**
25793 /// - New values received dynamically, without application changes.
25794 ///
25795 /// Please consult the [Working with enums] section in the user guide for some
25796 /// guidelines.
25797 ///
25798 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25799 #[derive(Clone, Debug, PartialEq)]
25800 #[non_exhaustive]
25801 pub enum Type {
25802 /// Unspecified AWS disk type. Should not be used.
25803 Unspecified,
25804 /// GP2 disk type.
25805 Gp2,
25806 /// GP3 disk type.
25807 Gp3,
25808 /// IO1 disk type.
25809 Io1,
25810 /// IO2 disk type.
25811 Io2,
25812 /// ST1 disk type.
25813 St1,
25814 /// SC1 disk type.
25815 Sc1,
25816 /// Standard disk type.
25817 Standard,
25818 /// If set, the enum was initialized with an unknown value.
25819 ///
25820 /// Applications can examine the value using [Type::value] or
25821 /// [Type::name].
25822 UnknownValue(r#type::UnknownValue),
25823 }
25824
25825 #[doc(hidden)]
25826 pub mod r#type {
25827 #[allow(unused_imports)]
25828 use super::*;
25829 #[derive(Clone, Debug, PartialEq)]
25830 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25831 }
25832
25833 impl Type {
25834 /// Gets the enum value.
25835 ///
25836 /// Returns `None` if the enum contains an unknown value deserialized from
25837 /// the string representation of enums.
25838 pub fn value(&self) -> std::option::Option<i32> {
25839 match self {
25840 Self::Unspecified => std::option::Option::Some(0),
25841 Self::Gp2 => std::option::Option::Some(1),
25842 Self::Gp3 => std::option::Option::Some(2),
25843 Self::Io1 => std::option::Option::Some(3),
25844 Self::Io2 => std::option::Option::Some(4),
25845 Self::St1 => std::option::Option::Some(5),
25846 Self::Sc1 => std::option::Option::Some(6),
25847 Self::Standard => std::option::Option::Some(7),
25848 Self::UnknownValue(u) => u.0.value(),
25849 }
25850 }
25851
25852 /// Gets the enum value as a string.
25853 ///
25854 /// Returns `None` if the enum contains an unknown value deserialized from
25855 /// the integer representation of enums.
25856 pub fn name(&self) -> std::option::Option<&str> {
25857 match self {
25858 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
25859 Self::Gp2 => std::option::Option::Some("GP2"),
25860 Self::Gp3 => std::option::Option::Some("GP3"),
25861 Self::Io1 => std::option::Option::Some("IO1"),
25862 Self::Io2 => std::option::Option::Some("IO2"),
25863 Self::St1 => std::option::Option::Some("ST1"),
25864 Self::Sc1 => std::option::Option::Some("SC1"),
25865 Self::Standard => std::option::Option::Some("STANDARD"),
25866 Self::UnknownValue(u) => u.0.name(),
25867 }
25868 }
25869 }
25870
25871 impl std::default::Default for Type {
25872 fn default() -> Self {
25873 use std::convert::From;
25874 Self::from(0)
25875 }
25876 }
25877
25878 impl std::fmt::Display for Type {
25879 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25880 wkt::internal::display_enum(f, self.name(), self.value())
25881 }
25882 }
25883
25884 impl std::convert::From<i32> for Type {
25885 fn from(value: i32) -> Self {
25886 match value {
25887 0 => Self::Unspecified,
25888 1 => Self::Gp2,
25889 2 => Self::Gp3,
25890 3 => Self::Io1,
25891 4 => Self::Io2,
25892 5 => Self::St1,
25893 6 => Self::Sc1,
25894 7 => Self::Standard,
25895 _ => Self::UnknownValue(r#type::UnknownValue(
25896 wkt::internal::UnknownEnumValue::Integer(value),
25897 )),
25898 }
25899 }
25900 }
25901
25902 impl std::convert::From<&str> for Type {
25903 fn from(value: &str) -> Self {
25904 use std::string::ToString;
25905 match value {
25906 "TYPE_UNSPECIFIED" => Self::Unspecified,
25907 "GP2" => Self::Gp2,
25908 "GP3" => Self::Gp3,
25909 "IO1" => Self::Io1,
25910 "IO2" => Self::Io2,
25911 "ST1" => Self::St1,
25912 "SC1" => Self::Sc1,
25913 "STANDARD" => Self::Standard,
25914 _ => Self::UnknownValue(r#type::UnknownValue(
25915 wkt::internal::UnknownEnumValue::String(value.to_string()),
25916 )),
25917 }
25918 }
25919 }
25920
25921 impl serde::ser::Serialize for Type {
25922 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25923 where
25924 S: serde::Serializer,
25925 {
25926 match self {
25927 Self::Unspecified => serializer.serialize_i32(0),
25928 Self::Gp2 => serializer.serialize_i32(1),
25929 Self::Gp3 => serializer.serialize_i32(2),
25930 Self::Io1 => serializer.serialize_i32(3),
25931 Self::Io2 => serializer.serialize_i32(4),
25932 Self::St1 => serializer.serialize_i32(5),
25933 Self::Sc1 => serializer.serialize_i32(6),
25934 Self::Standard => serializer.serialize_i32(7),
25935 Self::UnknownValue(u) => u.0.serialize(serializer),
25936 }
25937 }
25938 }
25939
25940 impl<'de> serde::de::Deserialize<'de> for Type {
25941 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25942 where
25943 D: serde::Deserializer<'de>,
25944 {
25945 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
25946 ".google.cloud.vmmigration.v1.AwsSourceDiskDetails.Type",
25947 ))
25948 }
25949 }
25950}
25951
25952/// Request message for 'CreateDiskMigrationJob' request.
25953#[derive(Clone, Default, PartialEq)]
25954#[non_exhaustive]
25955pub struct CreateDiskMigrationJobRequest {
25956 /// Required. The DiskMigrationJob's parent.
25957 pub parent: std::string::String,
25958
25959 /// Required. The DiskMigrationJob identifier.
25960 /// The maximum length of this value is 63 characters.
25961 /// Valid characters are lower case Latin letters, digits and hyphen.
25962 /// It must start with a Latin letter and must not end with a hyphen.
25963 pub disk_migration_job_id: std::string::String,
25964
25965 /// Required. The create request body.
25966 pub disk_migration_job: std::option::Option<crate::model::DiskMigrationJob>,
25967
25968 /// Optional. A request ID to identify requests. Specify a unique request ID
25969 /// so that if you must retry your request, the server will know to ignore
25970 /// the request if it has already been completed. The server will guarantee
25971 /// that for at least 60 minutes since the first request.
25972 ///
25973 /// For example, consider a situation where you make an initial request and
25974 /// the request timed out. If you make the request again with the same request
25975 /// ID, the server can check if original operation with the same request ID
25976 /// was received, and if so, will ignore the second request. This prevents
25977 /// clients from accidentally creating duplicate commitments.
25978 ///
25979 /// The request ID must be a valid UUID with the exception that zero UUID is
25980 /// not supported (00000000-0000-0000-0000-000000000000).
25981 pub request_id: std::string::String,
25982
25983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25984}
25985
25986impl CreateDiskMigrationJobRequest {
25987 /// Creates a new default instance.
25988 pub fn new() -> Self {
25989 std::default::Default::default()
25990 }
25991
25992 /// Sets the value of [parent][crate::model::CreateDiskMigrationJobRequest::parent].
25993 ///
25994 /// # Example
25995 /// ```ignore,no_run
25996 /// # use google_cloud_vmmigration_v1::model::CreateDiskMigrationJobRequest;
25997 /// # let project_id = "project_id";
25998 /// # let location_id = "location_id";
25999 /// # let source_id = "source_id";
26000 /// let x = CreateDiskMigrationJobRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
26001 /// ```
26002 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26003 self.parent = v.into();
26004 self
26005 }
26006
26007 /// Sets the value of [disk_migration_job_id][crate::model::CreateDiskMigrationJobRequest::disk_migration_job_id].
26008 ///
26009 /// # Example
26010 /// ```ignore,no_run
26011 /// # use google_cloud_vmmigration_v1::model::CreateDiskMigrationJobRequest;
26012 /// let x = CreateDiskMigrationJobRequest::new().set_disk_migration_job_id("example");
26013 /// ```
26014 pub fn set_disk_migration_job_id<T: std::convert::Into<std::string::String>>(
26015 mut self,
26016 v: T,
26017 ) -> Self {
26018 self.disk_migration_job_id = v.into();
26019 self
26020 }
26021
26022 /// Sets the value of [disk_migration_job][crate::model::CreateDiskMigrationJobRequest::disk_migration_job].
26023 ///
26024 /// # Example
26025 /// ```ignore,no_run
26026 /// # use google_cloud_vmmigration_v1::model::CreateDiskMigrationJobRequest;
26027 /// use google_cloud_vmmigration_v1::model::DiskMigrationJob;
26028 /// let x = CreateDiskMigrationJobRequest::new().set_disk_migration_job(DiskMigrationJob::default()/* use setters */);
26029 /// ```
26030 pub fn set_disk_migration_job<T>(mut self, v: T) -> Self
26031 where
26032 T: std::convert::Into<crate::model::DiskMigrationJob>,
26033 {
26034 self.disk_migration_job = std::option::Option::Some(v.into());
26035 self
26036 }
26037
26038 /// Sets or clears the value of [disk_migration_job][crate::model::CreateDiskMigrationJobRequest::disk_migration_job].
26039 ///
26040 /// # Example
26041 /// ```ignore,no_run
26042 /// # use google_cloud_vmmigration_v1::model::CreateDiskMigrationJobRequest;
26043 /// use google_cloud_vmmigration_v1::model::DiskMigrationJob;
26044 /// let x = CreateDiskMigrationJobRequest::new().set_or_clear_disk_migration_job(Some(DiskMigrationJob::default()/* use setters */));
26045 /// let x = CreateDiskMigrationJobRequest::new().set_or_clear_disk_migration_job(None::<DiskMigrationJob>);
26046 /// ```
26047 pub fn set_or_clear_disk_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
26048 where
26049 T: std::convert::Into<crate::model::DiskMigrationJob>,
26050 {
26051 self.disk_migration_job = v.map(|x| x.into());
26052 self
26053 }
26054
26055 /// Sets the value of [request_id][crate::model::CreateDiskMigrationJobRequest::request_id].
26056 ///
26057 /// # Example
26058 /// ```ignore,no_run
26059 /// # use google_cloud_vmmigration_v1::model::CreateDiskMigrationJobRequest;
26060 /// let x = CreateDiskMigrationJobRequest::new().set_request_id("example");
26061 /// ```
26062 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26063 self.request_id = v.into();
26064 self
26065 }
26066}
26067
26068impl wkt::message::Message for CreateDiskMigrationJobRequest {
26069 fn typename() -> &'static str {
26070 "type.googleapis.com/google.cloud.vmmigration.v1.CreateDiskMigrationJobRequest"
26071 }
26072}
26073
26074/// Request message for 'ListDiskMigrationJobsRequest' request.
26075#[derive(Clone, Default, PartialEq)]
26076#[non_exhaustive]
26077pub struct ListDiskMigrationJobsRequest {
26078 /// Required. The parent, which owns this collection of DiskMigrationJobs.
26079 pub parent: std::string::String,
26080
26081 /// Optional. The maximum number of disk migration jobs to return. The service
26082 /// may return fewer than this value. If unspecified, at most 500
26083 /// disk migration jobs will be returned.
26084 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
26085 pub page_size: i32,
26086
26087 /// Optional. A page token, received from a previous `ListDiskMigrationJobs`
26088 /// call. Provide this to retrieve the subsequent page.
26089 ///
26090 /// When paginating, all parameters provided to `ListDiskMigrationJobs`
26091 /// except `page_size` must match the call that provided the page token.
26092 pub page_token: std::string::String,
26093
26094 /// Optional. The filter request (according to <a
26095 /// href="https://google.aip.dev/160" target="_blank">AIP-160</a>).
26096 pub filter: std::string::String,
26097
26098 /// Optional. Ordering of the result list.
26099 pub order_by: std::string::String,
26100
26101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26102}
26103
26104impl ListDiskMigrationJobsRequest {
26105 /// Creates a new default instance.
26106 pub fn new() -> Self {
26107 std::default::Default::default()
26108 }
26109
26110 /// Sets the value of [parent][crate::model::ListDiskMigrationJobsRequest::parent].
26111 ///
26112 /// # Example
26113 /// ```ignore,no_run
26114 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsRequest;
26115 /// # let project_id = "project_id";
26116 /// # let location_id = "location_id";
26117 /// # let source_id = "source_id";
26118 /// let x = ListDiskMigrationJobsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}"));
26119 /// ```
26120 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26121 self.parent = v.into();
26122 self
26123 }
26124
26125 /// Sets the value of [page_size][crate::model::ListDiskMigrationJobsRequest::page_size].
26126 ///
26127 /// # Example
26128 /// ```ignore,no_run
26129 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsRequest;
26130 /// let x = ListDiskMigrationJobsRequest::new().set_page_size(42);
26131 /// ```
26132 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26133 self.page_size = v.into();
26134 self
26135 }
26136
26137 /// Sets the value of [page_token][crate::model::ListDiskMigrationJobsRequest::page_token].
26138 ///
26139 /// # Example
26140 /// ```ignore,no_run
26141 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsRequest;
26142 /// let x = ListDiskMigrationJobsRequest::new().set_page_token("example");
26143 /// ```
26144 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26145 self.page_token = v.into();
26146 self
26147 }
26148
26149 /// Sets the value of [filter][crate::model::ListDiskMigrationJobsRequest::filter].
26150 ///
26151 /// # Example
26152 /// ```ignore,no_run
26153 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsRequest;
26154 /// let x = ListDiskMigrationJobsRequest::new().set_filter("example");
26155 /// ```
26156 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26157 self.filter = v.into();
26158 self
26159 }
26160
26161 /// Sets the value of [order_by][crate::model::ListDiskMigrationJobsRequest::order_by].
26162 ///
26163 /// # Example
26164 /// ```ignore,no_run
26165 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsRequest;
26166 /// let x = ListDiskMigrationJobsRequest::new().set_order_by("example");
26167 /// ```
26168 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26169 self.order_by = v.into();
26170 self
26171 }
26172}
26173
26174impl wkt::message::Message for ListDiskMigrationJobsRequest {
26175 fn typename() -> &'static str {
26176 "type.googleapis.com/google.cloud.vmmigration.v1.ListDiskMigrationJobsRequest"
26177 }
26178}
26179
26180/// Response message for 'ListDiskMigrationJobs' request.
26181#[derive(Clone, Default, PartialEq)]
26182#[non_exhaustive]
26183pub struct ListDiskMigrationJobsResponse {
26184 /// Output only. The list of the disk migration jobs.
26185 pub disk_migration_jobs: std::vec::Vec<crate::model::DiskMigrationJob>,
26186
26187 /// Optional. Output only. A token, which can be sent as `page_token` to
26188 /// retrieve the next page. If this field is omitted, there are no subsequent
26189 /// pages.
26190 pub next_page_token: std::string::String,
26191
26192 /// Output only. Locations that could not be reached.
26193 pub unreachable: std::vec::Vec<std::string::String>,
26194
26195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26196}
26197
26198impl ListDiskMigrationJobsResponse {
26199 /// Creates a new default instance.
26200 pub fn new() -> Self {
26201 std::default::Default::default()
26202 }
26203
26204 /// Sets the value of [disk_migration_jobs][crate::model::ListDiskMigrationJobsResponse::disk_migration_jobs].
26205 ///
26206 /// # Example
26207 /// ```ignore,no_run
26208 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsResponse;
26209 /// use google_cloud_vmmigration_v1::model::DiskMigrationJob;
26210 /// let x = ListDiskMigrationJobsResponse::new()
26211 /// .set_disk_migration_jobs([
26212 /// DiskMigrationJob::default()/* use setters */,
26213 /// DiskMigrationJob::default()/* use (different) setters */,
26214 /// ]);
26215 /// ```
26216 pub fn set_disk_migration_jobs<T, V>(mut self, v: T) -> Self
26217 where
26218 T: std::iter::IntoIterator<Item = V>,
26219 V: std::convert::Into<crate::model::DiskMigrationJob>,
26220 {
26221 use std::iter::Iterator;
26222 self.disk_migration_jobs = v.into_iter().map(|i| i.into()).collect();
26223 self
26224 }
26225
26226 /// Sets the value of [next_page_token][crate::model::ListDiskMigrationJobsResponse::next_page_token].
26227 ///
26228 /// # Example
26229 /// ```ignore,no_run
26230 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsResponse;
26231 /// let x = ListDiskMigrationJobsResponse::new().set_next_page_token("example");
26232 /// ```
26233 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26234 self.next_page_token = v.into();
26235 self
26236 }
26237
26238 /// Sets the value of [unreachable][crate::model::ListDiskMigrationJobsResponse::unreachable].
26239 ///
26240 /// # Example
26241 /// ```ignore,no_run
26242 /// # use google_cloud_vmmigration_v1::model::ListDiskMigrationJobsResponse;
26243 /// let x = ListDiskMigrationJobsResponse::new().set_unreachable(["a", "b", "c"]);
26244 /// ```
26245 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
26246 where
26247 T: std::iter::IntoIterator<Item = V>,
26248 V: std::convert::Into<std::string::String>,
26249 {
26250 use std::iter::Iterator;
26251 self.unreachable = v.into_iter().map(|i| i.into()).collect();
26252 self
26253 }
26254}
26255
26256impl wkt::message::Message for ListDiskMigrationJobsResponse {
26257 fn typename() -> &'static str {
26258 "type.googleapis.com/google.cloud.vmmigration.v1.ListDiskMigrationJobsResponse"
26259 }
26260}
26261
26262#[doc(hidden)]
26263impl google_cloud_gax::paginator::internal::PageableResponse for ListDiskMigrationJobsResponse {
26264 type PageItem = crate::model::DiskMigrationJob;
26265
26266 fn items(self) -> std::vec::Vec<Self::PageItem> {
26267 self.disk_migration_jobs
26268 }
26269
26270 fn next_page_token(&self) -> std::string::String {
26271 use std::clone::Clone;
26272 self.next_page_token.clone()
26273 }
26274}
26275
26276/// Request message for 'GetDiskMigrationJob' request.
26277#[derive(Clone, Default, PartialEq)]
26278#[non_exhaustive]
26279pub struct GetDiskMigrationJobRequest {
26280 /// Required. The name of the DiskMigrationJob.
26281 pub name: std::string::String,
26282
26283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26284}
26285
26286impl GetDiskMigrationJobRequest {
26287 /// Creates a new default instance.
26288 pub fn new() -> Self {
26289 std::default::Default::default()
26290 }
26291
26292 /// Sets the value of [name][crate::model::GetDiskMigrationJobRequest::name].
26293 ///
26294 /// # Example
26295 /// ```ignore,no_run
26296 /// # use google_cloud_vmmigration_v1::model::GetDiskMigrationJobRequest;
26297 /// # let project_id = "project_id";
26298 /// # let location_id = "location_id";
26299 /// # let source_id = "source_id";
26300 /// # let disk_migration_job_id = "disk_migration_job_id";
26301 /// let x = GetDiskMigrationJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/diskMigrationJobs/{disk_migration_job_id}"));
26302 /// ```
26303 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26304 self.name = v.into();
26305 self
26306 }
26307}
26308
26309impl wkt::message::Message for GetDiskMigrationJobRequest {
26310 fn typename() -> &'static str {
26311 "type.googleapis.com/google.cloud.vmmigration.v1.GetDiskMigrationJobRequest"
26312 }
26313}
26314
26315/// Request message for 'UpdateDiskMigrationJob' request.
26316#[derive(Clone, Default, PartialEq)]
26317#[non_exhaustive]
26318pub struct UpdateDiskMigrationJobRequest {
26319 /// Optional. Field mask is used to specify the fields to be overwritten in the
26320 /// DiskMigrationJob resource by the update.
26321 /// The fields specified in the update_mask are relative to the resource, not
26322 /// the full request. A field will be overwritten if it is in the mask. If the
26323 /// user does not provide a mask, then a mask equivalent to all fields that are
26324 /// populated (have a non-empty value), will be implied.
26325 pub update_mask: std::option::Option<wkt::FieldMask>,
26326
26327 /// Required. The update request body.
26328 pub disk_migration_job: std::option::Option<crate::model::DiskMigrationJob>,
26329
26330 /// Optional. A request ID to identify requests. Specify a unique request ID
26331 /// so that if you must retry your request, the server will know to ignore
26332 /// the request if it has already been completed. The server will guarantee
26333 /// that for at least 60 minutes since the first request.
26334 ///
26335 /// For example, consider a situation where you make an initial request and
26336 /// the request timed out. If you make the request again with the same request
26337 /// ID, the server can check if original operation with the same request ID
26338 /// was received, and if so, will ignore the second request. This prevents
26339 /// clients from accidentally creating duplicate commitments.
26340 ///
26341 /// The request ID must be a valid UUID with the exception that zero UUID is
26342 /// not supported (00000000-0000-0000-0000-000000000000).
26343 pub request_id: std::string::String,
26344
26345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26346}
26347
26348impl UpdateDiskMigrationJobRequest {
26349 /// Creates a new default instance.
26350 pub fn new() -> Self {
26351 std::default::Default::default()
26352 }
26353
26354 /// Sets the value of [update_mask][crate::model::UpdateDiskMigrationJobRequest::update_mask].
26355 ///
26356 /// # Example
26357 /// ```ignore,no_run
26358 /// # use google_cloud_vmmigration_v1::model::UpdateDiskMigrationJobRequest;
26359 /// use wkt::FieldMask;
26360 /// let x = UpdateDiskMigrationJobRequest::new().set_update_mask(FieldMask::default()/* use setters */);
26361 /// ```
26362 pub fn set_update_mask<T>(mut self, v: T) -> Self
26363 where
26364 T: std::convert::Into<wkt::FieldMask>,
26365 {
26366 self.update_mask = std::option::Option::Some(v.into());
26367 self
26368 }
26369
26370 /// Sets or clears the value of [update_mask][crate::model::UpdateDiskMigrationJobRequest::update_mask].
26371 ///
26372 /// # Example
26373 /// ```ignore,no_run
26374 /// # use google_cloud_vmmigration_v1::model::UpdateDiskMigrationJobRequest;
26375 /// use wkt::FieldMask;
26376 /// let x = UpdateDiskMigrationJobRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
26377 /// let x = UpdateDiskMigrationJobRequest::new().set_or_clear_update_mask(None::<FieldMask>);
26378 /// ```
26379 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
26380 where
26381 T: std::convert::Into<wkt::FieldMask>,
26382 {
26383 self.update_mask = v.map(|x| x.into());
26384 self
26385 }
26386
26387 /// Sets the value of [disk_migration_job][crate::model::UpdateDiskMigrationJobRequest::disk_migration_job].
26388 ///
26389 /// # Example
26390 /// ```ignore,no_run
26391 /// # use google_cloud_vmmigration_v1::model::UpdateDiskMigrationJobRequest;
26392 /// use google_cloud_vmmigration_v1::model::DiskMigrationJob;
26393 /// let x = UpdateDiskMigrationJobRequest::new().set_disk_migration_job(DiskMigrationJob::default()/* use setters */);
26394 /// ```
26395 pub fn set_disk_migration_job<T>(mut self, v: T) -> Self
26396 where
26397 T: std::convert::Into<crate::model::DiskMigrationJob>,
26398 {
26399 self.disk_migration_job = std::option::Option::Some(v.into());
26400 self
26401 }
26402
26403 /// Sets or clears the value of [disk_migration_job][crate::model::UpdateDiskMigrationJobRequest::disk_migration_job].
26404 ///
26405 /// # Example
26406 /// ```ignore,no_run
26407 /// # use google_cloud_vmmigration_v1::model::UpdateDiskMigrationJobRequest;
26408 /// use google_cloud_vmmigration_v1::model::DiskMigrationJob;
26409 /// let x = UpdateDiskMigrationJobRequest::new().set_or_clear_disk_migration_job(Some(DiskMigrationJob::default()/* use setters */));
26410 /// let x = UpdateDiskMigrationJobRequest::new().set_or_clear_disk_migration_job(None::<DiskMigrationJob>);
26411 /// ```
26412 pub fn set_or_clear_disk_migration_job<T>(mut self, v: std::option::Option<T>) -> Self
26413 where
26414 T: std::convert::Into<crate::model::DiskMigrationJob>,
26415 {
26416 self.disk_migration_job = v.map(|x| x.into());
26417 self
26418 }
26419
26420 /// Sets the value of [request_id][crate::model::UpdateDiskMigrationJobRequest::request_id].
26421 ///
26422 /// # Example
26423 /// ```ignore,no_run
26424 /// # use google_cloud_vmmigration_v1::model::UpdateDiskMigrationJobRequest;
26425 /// let x = UpdateDiskMigrationJobRequest::new().set_request_id("example");
26426 /// ```
26427 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26428 self.request_id = v.into();
26429 self
26430 }
26431}
26432
26433impl wkt::message::Message for UpdateDiskMigrationJobRequest {
26434 fn typename() -> &'static str {
26435 "type.googleapis.com/google.cloud.vmmigration.v1.UpdateDiskMigrationJobRequest"
26436 }
26437}
26438
26439/// Request message for 'DeleteDiskMigrationJob' request.
26440#[derive(Clone, Default, PartialEq)]
26441#[non_exhaustive]
26442pub struct DeleteDiskMigrationJobRequest {
26443 /// Required. The name of the DiskMigrationJob.
26444 pub name: std::string::String,
26445
26446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26447}
26448
26449impl DeleteDiskMigrationJobRequest {
26450 /// Creates a new default instance.
26451 pub fn new() -> Self {
26452 std::default::Default::default()
26453 }
26454
26455 /// Sets the value of [name][crate::model::DeleteDiskMigrationJobRequest::name].
26456 ///
26457 /// # Example
26458 /// ```ignore,no_run
26459 /// # use google_cloud_vmmigration_v1::model::DeleteDiskMigrationJobRequest;
26460 /// # let project_id = "project_id";
26461 /// # let location_id = "location_id";
26462 /// # let source_id = "source_id";
26463 /// # let disk_migration_job_id = "disk_migration_job_id";
26464 /// let x = DeleteDiskMigrationJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/diskMigrationJobs/{disk_migration_job_id}"));
26465 /// ```
26466 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26467 self.name = v.into();
26468 self
26469 }
26470}
26471
26472impl wkt::message::Message for DeleteDiskMigrationJobRequest {
26473 fn typename() -> &'static str {
26474 "type.googleapis.com/google.cloud.vmmigration.v1.DeleteDiskMigrationJobRequest"
26475 }
26476}
26477
26478/// Request message for 'RunDiskMigrationJobRequest' request.
26479#[derive(Clone, Default, PartialEq)]
26480#[non_exhaustive]
26481pub struct RunDiskMigrationJobRequest {
26482 /// Required. The name of the DiskMigrationJob.
26483 pub name: std::string::String,
26484
26485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26486}
26487
26488impl RunDiskMigrationJobRequest {
26489 /// Creates a new default instance.
26490 pub fn new() -> Self {
26491 std::default::Default::default()
26492 }
26493
26494 /// Sets the value of [name][crate::model::RunDiskMigrationJobRequest::name].
26495 ///
26496 /// # Example
26497 /// ```ignore,no_run
26498 /// # use google_cloud_vmmigration_v1::model::RunDiskMigrationJobRequest;
26499 /// # let project_id = "project_id";
26500 /// # let location_id = "location_id";
26501 /// # let source_id = "source_id";
26502 /// # let disk_migration_job_id = "disk_migration_job_id";
26503 /// let x = RunDiskMigrationJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/diskMigrationJobs/{disk_migration_job_id}"));
26504 /// ```
26505 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26506 self.name = v.into();
26507 self
26508 }
26509}
26510
26511impl wkt::message::Message for RunDiskMigrationJobRequest {
26512 fn typename() -> &'static str {
26513 "type.googleapis.com/google.cloud.vmmigration.v1.RunDiskMigrationJobRequest"
26514 }
26515}
26516
26517/// Response message for 'RunDiskMigrationJob' request.
26518#[derive(Clone, Default, PartialEq)]
26519#[non_exhaustive]
26520pub struct RunDiskMigrationJobResponse {
26521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26522}
26523
26524impl RunDiskMigrationJobResponse {
26525 /// Creates a new default instance.
26526 pub fn new() -> Self {
26527 std::default::Default::default()
26528 }
26529}
26530
26531impl wkt::message::Message for RunDiskMigrationJobResponse {
26532 fn typename() -> &'static str {
26533 "type.googleapis.com/google.cloud.vmmigration.v1.RunDiskMigrationJobResponse"
26534 }
26535}
26536
26537/// Request message for 'CancelDiskMigrationJob' request.
26538#[derive(Clone, Default, PartialEq)]
26539#[non_exhaustive]
26540pub struct CancelDiskMigrationJobRequest {
26541 /// Required. The name of the DiskMigrationJob.
26542 pub name: std::string::String,
26543
26544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26545}
26546
26547impl CancelDiskMigrationJobRequest {
26548 /// Creates a new default instance.
26549 pub fn new() -> Self {
26550 std::default::Default::default()
26551 }
26552
26553 /// Sets the value of [name][crate::model::CancelDiskMigrationJobRequest::name].
26554 ///
26555 /// # Example
26556 /// ```ignore,no_run
26557 /// # use google_cloud_vmmigration_v1::model::CancelDiskMigrationJobRequest;
26558 /// # let project_id = "project_id";
26559 /// # let location_id = "location_id";
26560 /// # let source_id = "source_id";
26561 /// # let disk_migration_job_id = "disk_migration_job_id";
26562 /// let x = CancelDiskMigrationJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sources/{source_id}/diskMigrationJobs/{disk_migration_job_id}"));
26563 /// ```
26564 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26565 self.name = v.into();
26566 self
26567 }
26568}
26569
26570impl wkt::message::Message for CancelDiskMigrationJobRequest {
26571 fn typename() -> &'static str {
26572 "type.googleapis.com/google.cloud.vmmigration.v1.CancelDiskMigrationJobRequest"
26573 }
26574}
26575
26576/// Response message for 'CancelDiskMigrationJob' request.
26577#[derive(Clone, Default, PartialEq)]
26578#[non_exhaustive]
26579pub struct CancelDiskMigrationJobResponse {
26580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26581}
26582
26583impl CancelDiskMigrationJobResponse {
26584 /// Creates a new default instance.
26585 pub fn new() -> Self {
26586 std::default::Default::default()
26587 }
26588}
26589
26590impl wkt::message::Message for CancelDiskMigrationJobResponse {
26591 fn typename() -> &'static str {
26592 "type.googleapis.com/google.cloud.vmmigration.v1.CancelDiskMigrationJobResponse"
26593 }
26594}
26595
26596/// Types of disks supported for Compute Engine VM.
26597///
26598/// # Working with unknown values
26599///
26600/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26601/// additional enum variants at any time. Adding new variants is not considered
26602/// a breaking change. Applications should write their code in anticipation of:
26603///
26604/// - New values appearing in future releases of the client library, **and**
26605/// - New values received dynamically, without application changes.
26606///
26607/// Please consult the [Working with enums] section in the user guide for some
26608/// guidelines.
26609///
26610/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26611#[derive(Clone, Debug, PartialEq)]
26612#[non_exhaustive]
26613pub enum ComputeEngineDiskType {
26614 /// An unspecified disk type. Will be used as STANDARD.
26615 Unspecified,
26616 /// A Standard disk type.
26617 Standard,
26618 /// SSD hard disk type.
26619 Ssd,
26620 /// An alternative to SSD persistent disks that balance performance and
26621 /// cost.
26622 Balanced,
26623 /// Hyperdisk balanced disk type.
26624 HyperdiskBalanced,
26625 /// If set, the enum was initialized with an unknown value.
26626 ///
26627 /// Applications can examine the value using [ComputeEngineDiskType::value] or
26628 /// [ComputeEngineDiskType::name].
26629 UnknownValue(compute_engine_disk_type::UnknownValue),
26630}
26631
26632#[doc(hidden)]
26633pub mod compute_engine_disk_type {
26634 #[allow(unused_imports)]
26635 use super::*;
26636 #[derive(Clone, Debug, PartialEq)]
26637 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26638}
26639
26640impl ComputeEngineDiskType {
26641 /// Gets the enum value.
26642 ///
26643 /// Returns `None` if the enum contains an unknown value deserialized from
26644 /// the string representation of enums.
26645 pub fn value(&self) -> std::option::Option<i32> {
26646 match self {
26647 Self::Unspecified => std::option::Option::Some(0),
26648 Self::Standard => std::option::Option::Some(1),
26649 Self::Ssd => std::option::Option::Some(2),
26650 Self::Balanced => std::option::Option::Some(3),
26651 Self::HyperdiskBalanced => std::option::Option::Some(4),
26652 Self::UnknownValue(u) => u.0.value(),
26653 }
26654 }
26655
26656 /// Gets the enum value as a string.
26657 ///
26658 /// Returns `None` if the enum contains an unknown value deserialized from
26659 /// the integer representation of enums.
26660 pub fn name(&self) -> std::option::Option<&str> {
26661 match self {
26662 Self::Unspecified => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED"),
26663 Self::Standard => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_STANDARD"),
26664 Self::Ssd => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_SSD"),
26665 Self::Balanced => std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_BALANCED"),
26666 Self::HyperdiskBalanced => {
26667 std::option::Option::Some("COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED")
26668 }
26669 Self::UnknownValue(u) => u.0.name(),
26670 }
26671 }
26672}
26673
26674impl std::default::Default for ComputeEngineDiskType {
26675 fn default() -> Self {
26676 use std::convert::From;
26677 Self::from(0)
26678 }
26679}
26680
26681impl std::fmt::Display for ComputeEngineDiskType {
26682 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26683 wkt::internal::display_enum(f, self.name(), self.value())
26684 }
26685}
26686
26687impl std::convert::From<i32> for ComputeEngineDiskType {
26688 fn from(value: i32) -> Self {
26689 match value {
26690 0 => Self::Unspecified,
26691 1 => Self::Standard,
26692 2 => Self::Ssd,
26693 3 => Self::Balanced,
26694 4 => Self::HyperdiskBalanced,
26695 _ => Self::UnknownValue(compute_engine_disk_type::UnknownValue(
26696 wkt::internal::UnknownEnumValue::Integer(value),
26697 )),
26698 }
26699 }
26700}
26701
26702impl std::convert::From<&str> for ComputeEngineDiskType {
26703 fn from(value: &str) -> Self {
26704 use std::string::ToString;
26705 match value {
26706 "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
26707 "COMPUTE_ENGINE_DISK_TYPE_STANDARD" => Self::Standard,
26708 "COMPUTE_ENGINE_DISK_TYPE_SSD" => Self::Ssd,
26709 "COMPUTE_ENGINE_DISK_TYPE_BALANCED" => Self::Balanced,
26710 "COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
26711 _ => Self::UnknownValue(compute_engine_disk_type::UnknownValue(
26712 wkt::internal::UnknownEnumValue::String(value.to_string()),
26713 )),
26714 }
26715 }
26716}
26717
26718impl serde::ser::Serialize for ComputeEngineDiskType {
26719 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26720 where
26721 S: serde::Serializer,
26722 {
26723 match self {
26724 Self::Unspecified => serializer.serialize_i32(0),
26725 Self::Standard => serializer.serialize_i32(1),
26726 Self::Ssd => serializer.serialize_i32(2),
26727 Self::Balanced => serializer.serialize_i32(3),
26728 Self::HyperdiskBalanced => serializer.serialize_i32(4),
26729 Self::UnknownValue(u) => u.0.serialize(serializer),
26730 }
26731 }
26732}
26733
26734impl<'de> serde::de::Deserialize<'de> for ComputeEngineDiskType {
26735 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26736 where
26737 D: serde::Deserializer<'de>,
26738 {
26739 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineDiskType>::new(
26740 ".google.cloud.vmmigration.v1.ComputeEngineDiskType",
26741 ))
26742 }
26743}
26744
26745/// Types of licenses used in OS adaptation.
26746///
26747/// # Working with unknown values
26748///
26749/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26750/// additional enum variants at any time. Adding new variants is not considered
26751/// a breaking change. Applications should write their code in anticipation of:
26752///
26753/// - New values appearing in future releases of the client library, **and**
26754/// - New values received dynamically, without application changes.
26755///
26756/// Please consult the [Working with enums] section in the user guide for some
26757/// guidelines.
26758///
26759/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26760#[derive(Clone, Debug, PartialEq)]
26761#[non_exhaustive]
26762pub enum ComputeEngineLicenseType {
26763 /// The license type is the default for the OS.
26764 Default,
26765 /// The license type is Pay As You Go license type.
26766 Payg,
26767 /// The license type is Bring Your Own License type.
26768 Byol,
26769 /// If set, the enum was initialized with an unknown value.
26770 ///
26771 /// Applications can examine the value using [ComputeEngineLicenseType::value] or
26772 /// [ComputeEngineLicenseType::name].
26773 UnknownValue(compute_engine_license_type::UnknownValue),
26774}
26775
26776#[doc(hidden)]
26777pub mod compute_engine_license_type {
26778 #[allow(unused_imports)]
26779 use super::*;
26780 #[derive(Clone, Debug, PartialEq)]
26781 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26782}
26783
26784impl ComputeEngineLicenseType {
26785 /// Gets the enum value.
26786 ///
26787 /// Returns `None` if the enum contains an unknown value deserialized from
26788 /// the string representation of enums.
26789 pub fn value(&self) -> std::option::Option<i32> {
26790 match self {
26791 Self::Default => std::option::Option::Some(0),
26792 Self::Payg => std::option::Option::Some(1),
26793 Self::Byol => std::option::Option::Some(2),
26794 Self::UnknownValue(u) => u.0.value(),
26795 }
26796 }
26797
26798 /// Gets the enum value as a string.
26799 ///
26800 /// Returns `None` if the enum contains an unknown value deserialized from
26801 /// the integer representation of enums.
26802 pub fn name(&self) -> std::option::Option<&str> {
26803 match self {
26804 Self::Default => std::option::Option::Some("COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT"),
26805 Self::Payg => std::option::Option::Some("COMPUTE_ENGINE_LICENSE_TYPE_PAYG"),
26806 Self::Byol => std::option::Option::Some("COMPUTE_ENGINE_LICENSE_TYPE_BYOL"),
26807 Self::UnknownValue(u) => u.0.name(),
26808 }
26809 }
26810}
26811
26812impl std::default::Default for ComputeEngineLicenseType {
26813 fn default() -> Self {
26814 use std::convert::From;
26815 Self::from(0)
26816 }
26817}
26818
26819impl std::fmt::Display for ComputeEngineLicenseType {
26820 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26821 wkt::internal::display_enum(f, self.name(), self.value())
26822 }
26823}
26824
26825impl std::convert::From<i32> for ComputeEngineLicenseType {
26826 fn from(value: i32) -> Self {
26827 match value {
26828 0 => Self::Default,
26829 1 => Self::Payg,
26830 2 => Self::Byol,
26831 _ => Self::UnknownValue(compute_engine_license_type::UnknownValue(
26832 wkt::internal::UnknownEnumValue::Integer(value),
26833 )),
26834 }
26835 }
26836}
26837
26838impl std::convert::From<&str> for ComputeEngineLicenseType {
26839 fn from(value: &str) -> Self {
26840 use std::string::ToString;
26841 match value {
26842 "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT" => Self::Default,
26843 "COMPUTE_ENGINE_LICENSE_TYPE_PAYG" => Self::Payg,
26844 "COMPUTE_ENGINE_LICENSE_TYPE_BYOL" => Self::Byol,
26845 _ => Self::UnknownValue(compute_engine_license_type::UnknownValue(
26846 wkt::internal::UnknownEnumValue::String(value.to_string()),
26847 )),
26848 }
26849 }
26850}
26851
26852impl serde::ser::Serialize for ComputeEngineLicenseType {
26853 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26854 where
26855 S: serde::Serializer,
26856 {
26857 match self {
26858 Self::Default => serializer.serialize_i32(0),
26859 Self::Payg => serializer.serialize_i32(1),
26860 Self::Byol => serializer.serialize_i32(2),
26861 Self::UnknownValue(u) => u.0.serialize(serializer),
26862 }
26863 }
26864}
26865
26866impl<'de> serde::de::Deserialize<'de> for ComputeEngineLicenseType {
26867 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26868 where
26869 D: serde::Deserializer<'de>,
26870 {
26871 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineLicenseType>::new(
26872 ".google.cloud.vmmigration.v1.ComputeEngineLicenseType",
26873 ))
26874 }
26875}
26876
26877/// Possible values for vm boot option.
26878///
26879/// # Working with unknown values
26880///
26881/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26882/// additional enum variants at any time. Adding new variants is not considered
26883/// a breaking change. Applications should write their code in anticipation of:
26884///
26885/// - New values appearing in future releases of the client library, **and**
26886/// - New values received dynamically, without application changes.
26887///
26888/// Please consult the [Working with enums] section in the user guide for some
26889/// guidelines.
26890///
26891/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26892#[derive(Clone, Debug, PartialEq)]
26893#[non_exhaustive]
26894pub enum ComputeEngineBootOption {
26895 /// The boot option is unknown.
26896 Unspecified,
26897 /// The boot option is EFI.
26898 Efi,
26899 /// The boot option is BIOS.
26900 Bios,
26901 /// If set, the enum was initialized with an unknown value.
26902 ///
26903 /// Applications can examine the value using [ComputeEngineBootOption::value] or
26904 /// [ComputeEngineBootOption::name].
26905 UnknownValue(compute_engine_boot_option::UnknownValue),
26906}
26907
26908#[doc(hidden)]
26909pub mod compute_engine_boot_option {
26910 #[allow(unused_imports)]
26911 use super::*;
26912 #[derive(Clone, Debug, PartialEq)]
26913 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26914}
26915
26916impl ComputeEngineBootOption {
26917 /// Gets the enum value.
26918 ///
26919 /// Returns `None` if the enum contains an unknown value deserialized from
26920 /// the string representation of enums.
26921 pub fn value(&self) -> std::option::Option<i32> {
26922 match self {
26923 Self::Unspecified => std::option::Option::Some(0),
26924 Self::Efi => std::option::Option::Some(1),
26925 Self::Bios => std::option::Option::Some(2),
26926 Self::UnknownValue(u) => u.0.value(),
26927 }
26928 }
26929
26930 /// Gets the enum value as a string.
26931 ///
26932 /// Returns `None` if the enum contains an unknown value deserialized from
26933 /// the integer representation of enums.
26934 pub fn name(&self) -> std::option::Option<&str> {
26935 match self {
26936 Self::Unspecified => {
26937 std::option::Option::Some("COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED")
26938 }
26939 Self::Efi => std::option::Option::Some("COMPUTE_ENGINE_BOOT_OPTION_EFI"),
26940 Self::Bios => std::option::Option::Some("COMPUTE_ENGINE_BOOT_OPTION_BIOS"),
26941 Self::UnknownValue(u) => u.0.name(),
26942 }
26943 }
26944}
26945
26946impl std::default::Default for ComputeEngineBootOption {
26947 fn default() -> Self {
26948 use std::convert::From;
26949 Self::from(0)
26950 }
26951}
26952
26953impl std::fmt::Display for ComputeEngineBootOption {
26954 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26955 wkt::internal::display_enum(f, self.name(), self.value())
26956 }
26957}
26958
26959impl std::convert::From<i32> for ComputeEngineBootOption {
26960 fn from(value: i32) -> Self {
26961 match value {
26962 0 => Self::Unspecified,
26963 1 => Self::Efi,
26964 2 => Self::Bios,
26965 _ => Self::UnknownValue(compute_engine_boot_option::UnknownValue(
26966 wkt::internal::UnknownEnumValue::Integer(value),
26967 )),
26968 }
26969 }
26970}
26971
26972impl std::convert::From<&str> for ComputeEngineBootOption {
26973 fn from(value: &str) -> Self {
26974 use std::string::ToString;
26975 match value {
26976 "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED" => Self::Unspecified,
26977 "COMPUTE_ENGINE_BOOT_OPTION_EFI" => Self::Efi,
26978 "COMPUTE_ENGINE_BOOT_OPTION_BIOS" => Self::Bios,
26979 _ => Self::UnknownValue(compute_engine_boot_option::UnknownValue(
26980 wkt::internal::UnknownEnumValue::String(value.to_string()),
26981 )),
26982 }
26983 }
26984}
26985
26986impl serde::ser::Serialize for ComputeEngineBootOption {
26987 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26988 where
26989 S: serde::Serializer,
26990 {
26991 match self {
26992 Self::Unspecified => serializer.serialize_i32(0),
26993 Self::Efi => serializer.serialize_i32(1),
26994 Self::Bios => serializer.serialize_i32(2),
26995 Self::UnknownValue(u) => u.0.serialize(serializer),
26996 }
26997 }
26998}
26999
27000impl<'de> serde::de::Deserialize<'de> for ComputeEngineBootOption {
27001 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27002 where
27003 D: serde::Deserializer<'de>,
27004 {
27005 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineBootOption>::new(
27006 ".google.cloud.vmmigration.v1.ComputeEngineBootOption",
27007 ))
27008 }
27009}
27010
27011/// VM operating system (OS) capabilities needed for determining compatibility
27012/// with Compute Engine features supported by the migration.
27013///
27014/// # Working with unknown values
27015///
27016/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27017/// additional enum variants at any time. Adding new variants is not considered
27018/// a breaking change. Applications should write their code in anticipation of:
27019///
27020/// - New values appearing in future releases of the client library, **and**
27021/// - New values received dynamically, without application changes.
27022///
27023/// Please consult the [Working with enums] section in the user guide for some
27024/// guidelines.
27025///
27026/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27027#[derive(Clone, Debug, PartialEq)]
27028#[non_exhaustive]
27029pub enum OsCapability {
27030 /// This is for API compatibility only and is not in use.
27031 Unspecified,
27032 /// NVMe driver installed and the VM can use NVMe PD or local SSD.
27033 NvmeStorageAccess,
27034 /// gVNIC virtual NIC driver supported.
27035 GvnicNetworkInterface,
27036 /// IDPF virtual NIC driver supported.
27037 IdpfNetworkInterface,
27038 /// If set, the enum was initialized with an unknown value.
27039 ///
27040 /// Applications can examine the value using [OsCapability::value] or
27041 /// [OsCapability::name].
27042 UnknownValue(os_capability::UnknownValue),
27043}
27044
27045#[doc(hidden)]
27046pub mod os_capability {
27047 #[allow(unused_imports)]
27048 use super::*;
27049 #[derive(Clone, Debug, PartialEq)]
27050 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27051}
27052
27053impl OsCapability {
27054 /// Gets the enum value.
27055 ///
27056 /// Returns `None` if the enum contains an unknown value deserialized from
27057 /// the string representation of enums.
27058 pub fn value(&self) -> std::option::Option<i32> {
27059 match self {
27060 Self::Unspecified => std::option::Option::Some(0),
27061 Self::NvmeStorageAccess => std::option::Option::Some(1),
27062 Self::GvnicNetworkInterface => std::option::Option::Some(2),
27063 Self::IdpfNetworkInterface => std::option::Option::Some(3),
27064 Self::UnknownValue(u) => u.0.value(),
27065 }
27066 }
27067
27068 /// Gets the enum value as a string.
27069 ///
27070 /// Returns `None` if the enum contains an unknown value deserialized from
27071 /// the integer representation of enums.
27072 pub fn name(&self) -> std::option::Option<&str> {
27073 match self {
27074 Self::Unspecified => std::option::Option::Some("OS_CAPABILITY_UNSPECIFIED"),
27075 Self::NvmeStorageAccess => {
27076 std::option::Option::Some("OS_CAPABILITY_NVME_STORAGE_ACCESS")
27077 }
27078 Self::GvnicNetworkInterface => {
27079 std::option::Option::Some("OS_CAPABILITY_GVNIC_NETWORK_INTERFACE")
27080 }
27081 Self::IdpfNetworkInterface => {
27082 std::option::Option::Some("OS_CAPABILITY_IDPF_NETWORK_INTERFACE")
27083 }
27084 Self::UnknownValue(u) => u.0.name(),
27085 }
27086 }
27087}
27088
27089impl std::default::Default for OsCapability {
27090 fn default() -> Self {
27091 use std::convert::From;
27092 Self::from(0)
27093 }
27094}
27095
27096impl std::fmt::Display for OsCapability {
27097 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27098 wkt::internal::display_enum(f, self.name(), self.value())
27099 }
27100}
27101
27102impl std::convert::From<i32> for OsCapability {
27103 fn from(value: i32) -> Self {
27104 match value {
27105 0 => Self::Unspecified,
27106 1 => Self::NvmeStorageAccess,
27107 2 => Self::GvnicNetworkInterface,
27108 3 => Self::IdpfNetworkInterface,
27109 _ => Self::UnknownValue(os_capability::UnknownValue(
27110 wkt::internal::UnknownEnumValue::Integer(value),
27111 )),
27112 }
27113 }
27114}
27115
27116impl std::convert::From<&str> for OsCapability {
27117 fn from(value: &str) -> Self {
27118 use std::string::ToString;
27119 match value {
27120 "OS_CAPABILITY_UNSPECIFIED" => Self::Unspecified,
27121 "OS_CAPABILITY_NVME_STORAGE_ACCESS" => Self::NvmeStorageAccess,
27122 "OS_CAPABILITY_GVNIC_NETWORK_INTERFACE" => Self::GvnicNetworkInterface,
27123 "OS_CAPABILITY_IDPF_NETWORK_INTERFACE" => Self::IdpfNetworkInterface,
27124 _ => Self::UnknownValue(os_capability::UnknownValue(
27125 wkt::internal::UnknownEnumValue::String(value.to_string()),
27126 )),
27127 }
27128 }
27129}
27130
27131impl serde::ser::Serialize for OsCapability {
27132 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27133 where
27134 S: serde::Serializer,
27135 {
27136 match self {
27137 Self::Unspecified => serializer.serialize_i32(0),
27138 Self::NvmeStorageAccess => serializer.serialize_i32(1),
27139 Self::GvnicNetworkInterface => serializer.serialize_i32(2),
27140 Self::IdpfNetworkInterface => serializer.serialize_i32(3),
27141 Self::UnknownValue(u) => u.0.serialize(serializer),
27142 }
27143 }
27144}
27145
27146impl<'de> serde::de::Deserialize<'de> for OsCapability {
27147 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27148 where
27149 D: serde::Deserializer<'de>,
27150 {
27151 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsCapability>::new(
27152 ".google.cloud.vmmigration.v1.OsCapability",
27153 ))
27154 }
27155}
27156
27157/// Possible boot options conversions.
27158///
27159/// # Working with unknown values
27160///
27161/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27162/// additional enum variants at any time. Adding new variants is not considered
27163/// a breaking change. Applications should write their code in anticipation of:
27164///
27165/// - New values appearing in future releases of the client library, **and**
27166/// - New values received dynamically, without application changes.
27167///
27168/// Please consult the [Working with enums] section in the user guide for some
27169/// guidelines.
27170///
27171/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27172#[derive(Clone, Debug, PartialEq)]
27173#[non_exhaustive]
27174pub enum BootConversion {
27175 /// Unspecified conversion type.
27176 Unspecified,
27177 /// No conversion.
27178 None,
27179 /// Convert from BIOS to EFI.
27180 BiosToEfi,
27181 /// If set, the enum was initialized with an unknown value.
27182 ///
27183 /// Applications can examine the value using [BootConversion::value] or
27184 /// [BootConversion::name].
27185 UnknownValue(boot_conversion::UnknownValue),
27186}
27187
27188#[doc(hidden)]
27189pub mod boot_conversion {
27190 #[allow(unused_imports)]
27191 use super::*;
27192 #[derive(Clone, Debug, PartialEq)]
27193 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27194}
27195
27196impl BootConversion {
27197 /// Gets the enum value.
27198 ///
27199 /// Returns `None` if the enum contains an unknown value deserialized from
27200 /// the string representation of enums.
27201 pub fn value(&self) -> std::option::Option<i32> {
27202 match self {
27203 Self::Unspecified => std::option::Option::Some(0),
27204 Self::None => std::option::Option::Some(1),
27205 Self::BiosToEfi => std::option::Option::Some(2),
27206 Self::UnknownValue(u) => u.0.value(),
27207 }
27208 }
27209
27210 /// Gets the enum value as a string.
27211 ///
27212 /// Returns `None` if the enum contains an unknown value deserialized from
27213 /// the integer representation of enums.
27214 pub fn name(&self) -> std::option::Option<&str> {
27215 match self {
27216 Self::Unspecified => std::option::Option::Some("BOOT_CONVERSION_UNSPECIFIED"),
27217 Self::None => std::option::Option::Some("NONE"),
27218 Self::BiosToEfi => std::option::Option::Some("BIOS_TO_EFI"),
27219 Self::UnknownValue(u) => u.0.name(),
27220 }
27221 }
27222}
27223
27224impl std::default::Default for BootConversion {
27225 fn default() -> Self {
27226 use std::convert::From;
27227 Self::from(0)
27228 }
27229}
27230
27231impl std::fmt::Display for BootConversion {
27232 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27233 wkt::internal::display_enum(f, self.name(), self.value())
27234 }
27235}
27236
27237impl std::convert::From<i32> for BootConversion {
27238 fn from(value: i32) -> Self {
27239 match value {
27240 0 => Self::Unspecified,
27241 1 => Self::None,
27242 2 => Self::BiosToEfi,
27243 _ => Self::UnknownValue(boot_conversion::UnknownValue(
27244 wkt::internal::UnknownEnumValue::Integer(value),
27245 )),
27246 }
27247 }
27248}
27249
27250impl std::convert::From<&str> for BootConversion {
27251 fn from(value: &str) -> Self {
27252 use std::string::ToString;
27253 match value {
27254 "BOOT_CONVERSION_UNSPECIFIED" => Self::Unspecified,
27255 "NONE" => Self::None,
27256 "BIOS_TO_EFI" => Self::BiosToEfi,
27257 _ => Self::UnknownValue(boot_conversion::UnknownValue(
27258 wkt::internal::UnknownEnumValue::String(value.to_string()),
27259 )),
27260 }
27261 }
27262}
27263
27264impl serde::ser::Serialize for BootConversion {
27265 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27266 where
27267 S: serde::Serializer,
27268 {
27269 match self {
27270 Self::Unspecified => serializer.serialize_i32(0),
27271 Self::None => serializer.serialize_i32(1),
27272 Self::BiosToEfi => serializer.serialize_i32(2),
27273 Self::UnknownValue(u) => u.0.serialize(serializer),
27274 }
27275 }
27276}
27277
27278impl<'de> serde::de::Deserialize<'de> for BootConversion {
27279 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27280 where
27281 D: serde::Deserializer<'de>,
27282 {
27283 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BootConversion>::new(
27284 ".google.cloud.vmmigration.v1.BootConversion",
27285 ))
27286 }
27287}
27288
27289/// Controls the level of details of a Utilization Report.
27290///
27291/// # Working with unknown values
27292///
27293/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27294/// additional enum variants at any time. Adding new variants is not considered
27295/// a breaking change. Applications should write their code in anticipation of:
27296///
27297/// - New values appearing in future releases of the client library, **and**
27298/// - New values received dynamically, without application changes.
27299///
27300/// Please consult the [Working with enums] section in the user guide for some
27301/// guidelines.
27302///
27303/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27304#[derive(Clone, Debug, PartialEq)]
27305#[non_exhaustive]
27306pub enum UtilizationReportView {
27307 /// The default / unset value.
27308 /// The API will default to FULL on single report request and BASIC for
27309 /// multiple reports request.
27310 Unspecified,
27311 /// Get the report metadata, without the list of VMs and their utilization
27312 /// info.
27313 Basic,
27314 /// Include everything.
27315 Full,
27316 /// If set, the enum was initialized with an unknown value.
27317 ///
27318 /// Applications can examine the value using [UtilizationReportView::value] or
27319 /// [UtilizationReportView::name].
27320 UnknownValue(utilization_report_view::UnknownValue),
27321}
27322
27323#[doc(hidden)]
27324pub mod utilization_report_view {
27325 #[allow(unused_imports)]
27326 use super::*;
27327 #[derive(Clone, Debug, PartialEq)]
27328 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27329}
27330
27331impl UtilizationReportView {
27332 /// Gets the enum value.
27333 ///
27334 /// Returns `None` if the enum contains an unknown value deserialized from
27335 /// the string representation of enums.
27336 pub fn value(&self) -> std::option::Option<i32> {
27337 match self {
27338 Self::Unspecified => std::option::Option::Some(0),
27339 Self::Basic => std::option::Option::Some(1),
27340 Self::Full => std::option::Option::Some(2),
27341 Self::UnknownValue(u) => u.0.value(),
27342 }
27343 }
27344
27345 /// Gets the enum value as a string.
27346 ///
27347 /// Returns `None` if the enum contains an unknown value deserialized from
27348 /// the integer representation of enums.
27349 pub fn name(&self) -> std::option::Option<&str> {
27350 match self {
27351 Self::Unspecified => std::option::Option::Some("UTILIZATION_REPORT_VIEW_UNSPECIFIED"),
27352 Self::Basic => std::option::Option::Some("BASIC"),
27353 Self::Full => std::option::Option::Some("FULL"),
27354 Self::UnknownValue(u) => u.0.name(),
27355 }
27356 }
27357}
27358
27359impl std::default::Default for UtilizationReportView {
27360 fn default() -> Self {
27361 use std::convert::From;
27362 Self::from(0)
27363 }
27364}
27365
27366impl std::fmt::Display for UtilizationReportView {
27367 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27368 wkt::internal::display_enum(f, self.name(), self.value())
27369 }
27370}
27371
27372impl std::convert::From<i32> for UtilizationReportView {
27373 fn from(value: i32) -> Self {
27374 match value {
27375 0 => Self::Unspecified,
27376 1 => Self::Basic,
27377 2 => Self::Full,
27378 _ => Self::UnknownValue(utilization_report_view::UnknownValue(
27379 wkt::internal::UnknownEnumValue::Integer(value),
27380 )),
27381 }
27382 }
27383}
27384
27385impl std::convert::From<&str> for UtilizationReportView {
27386 fn from(value: &str) -> Self {
27387 use std::string::ToString;
27388 match value {
27389 "UTILIZATION_REPORT_VIEW_UNSPECIFIED" => Self::Unspecified,
27390 "BASIC" => Self::Basic,
27391 "FULL" => Self::Full,
27392 _ => Self::UnknownValue(utilization_report_view::UnknownValue(
27393 wkt::internal::UnknownEnumValue::String(value.to_string()),
27394 )),
27395 }
27396 }
27397}
27398
27399impl serde::ser::Serialize for UtilizationReportView {
27400 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27401 where
27402 S: serde::Serializer,
27403 {
27404 match self {
27405 Self::Unspecified => serializer.serialize_i32(0),
27406 Self::Basic => serializer.serialize_i32(1),
27407 Self::Full => serializer.serialize_i32(2),
27408 Self::UnknownValue(u) => u.0.serialize(serializer),
27409 }
27410 }
27411}
27412
27413impl<'de> serde::de::Deserialize<'de> for UtilizationReportView {
27414 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27415 where
27416 D: serde::Deserializer<'de>,
27417 {
27418 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UtilizationReportView>::new(
27419 ".google.cloud.vmmigration.v1.UtilizationReportView",
27420 ))
27421 }
27422}
27423
27424/// Controls the level of details of a Migrating VM.
27425///
27426/// # Working with unknown values
27427///
27428/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27429/// additional enum variants at any time. Adding new variants is not considered
27430/// a breaking change. Applications should write their code in anticipation of:
27431///
27432/// - New values appearing in future releases of the client library, **and**
27433/// - New values received dynamically, without application changes.
27434///
27435/// Please consult the [Working with enums] section in the user guide for some
27436/// guidelines.
27437///
27438/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27439#[derive(Clone, Debug, PartialEq)]
27440#[non_exhaustive]
27441pub enum MigratingVmView {
27442 /// View is unspecified. The API will fallback to the default value.
27443 Unspecified,
27444 /// Get the migrating VM basic details.
27445 /// The basic details do not include the recent clone jobs and recent cutover
27446 /// jobs lists.
27447 Basic,
27448 /// Include everything.
27449 Full,
27450 /// If set, the enum was initialized with an unknown value.
27451 ///
27452 /// Applications can examine the value using [MigratingVmView::value] or
27453 /// [MigratingVmView::name].
27454 UnknownValue(migrating_vm_view::UnknownValue),
27455}
27456
27457#[doc(hidden)]
27458pub mod migrating_vm_view {
27459 #[allow(unused_imports)]
27460 use super::*;
27461 #[derive(Clone, Debug, PartialEq)]
27462 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27463}
27464
27465impl MigratingVmView {
27466 /// Gets the enum value.
27467 ///
27468 /// Returns `None` if the enum contains an unknown value deserialized from
27469 /// the string representation of enums.
27470 pub fn value(&self) -> std::option::Option<i32> {
27471 match self {
27472 Self::Unspecified => std::option::Option::Some(0),
27473 Self::Basic => std::option::Option::Some(1),
27474 Self::Full => std::option::Option::Some(2),
27475 Self::UnknownValue(u) => u.0.value(),
27476 }
27477 }
27478
27479 /// Gets the enum value as a string.
27480 ///
27481 /// Returns `None` if the enum contains an unknown value deserialized from
27482 /// the integer representation of enums.
27483 pub fn name(&self) -> std::option::Option<&str> {
27484 match self {
27485 Self::Unspecified => std::option::Option::Some("MIGRATING_VM_VIEW_UNSPECIFIED"),
27486 Self::Basic => std::option::Option::Some("MIGRATING_VM_VIEW_BASIC"),
27487 Self::Full => std::option::Option::Some("MIGRATING_VM_VIEW_FULL"),
27488 Self::UnknownValue(u) => u.0.name(),
27489 }
27490 }
27491}
27492
27493impl std::default::Default for MigratingVmView {
27494 fn default() -> Self {
27495 use std::convert::From;
27496 Self::from(0)
27497 }
27498}
27499
27500impl std::fmt::Display for MigratingVmView {
27501 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27502 wkt::internal::display_enum(f, self.name(), self.value())
27503 }
27504}
27505
27506impl std::convert::From<i32> for MigratingVmView {
27507 fn from(value: i32) -> Self {
27508 match value {
27509 0 => Self::Unspecified,
27510 1 => Self::Basic,
27511 2 => Self::Full,
27512 _ => Self::UnknownValue(migrating_vm_view::UnknownValue(
27513 wkt::internal::UnknownEnumValue::Integer(value),
27514 )),
27515 }
27516 }
27517}
27518
27519impl std::convert::From<&str> for MigratingVmView {
27520 fn from(value: &str) -> Self {
27521 use std::string::ToString;
27522 match value {
27523 "MIGRATING_VM_VIEW_UNSPECIFIED" => Self::Unspecified,
27524 "MIGRATING_VM_VIEW_BASIC" => Self::Basic,
27525 "MIGRATING_VM_VIEW_FULL" => Self::Full,
27526 _ => Self::UnknownValue(migrating_vm_view::UnknownValue(
27527 wkt::internal::UnknownEnumValue::String(value.to_string()),
27528 )),
27529 }
27530 }
27531}
27532
27533impl serde::ser::Serialize for MigratingVmView {
27534 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27535 where
27536 S: serde::Serializer,
27537 {
27538 match self {
27539 Self::Unspecified => serializer.serialize_i32(0),
27540 Self::Basic => serializer.serialize_i32(1),
27541 Self::Full => serializer.serialize_i32(2),
27542 Self::UnknownValue(u) => u.0.serialize(serializer),
27543 }
27544 }
27545}
27546
27547impl<'de> serde::de::Deserialize<'de> for MigratingVmView {
27548 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27549 where
27550 D: serde::Deserializer<'de>,
27551 {
27552 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigratingVmView>::new(
27553 ".google.cloud.vmmigration.v1.MigratingVmView",
27554 ))
27555 }
27556}
27557
27558/// Possible values for the VM architecture.
27559///
27560/// # Working with unknown values
27561///
27562/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27563/// additional enum variants at any time. Adding new variants is not considered
27564/// a breaking change. Applications should write their code in anticipation of:
27565///
27566/// - New values appearing in future releases of the client library, **and**
27567/// - New values received dynamically, without application changes.
27568///
27569/// Please consult the [Working with enums] section in the user guide for some
27570/// guidelines.
27571///
27572/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27573#[derive(Clone, Debug, PartialEq)]
27574#[non_exhaustive]
27575pub enum VmArchitecture {
27576 /// The architecture is unknown.
27577 Unspecified,
27578 /// The architecture is one of the x86 architectures.
27579 X86Family,
27580 /// The architecture is ARM64.
27581 Arm64,
27582 /// If set, the enum was initialized with an unknown value.
27583 ///
27584 /// Applications can examine the value using [VmArchitecture::value] or
27585 /// [VmArchitecture::name].
27586 UnknownValue(vm_architecture::UnknownValue),
27587}
27588
27589#[doc(hidden)]
27590pub mod vm_architecture {
27591 #[allow(unused_imports)]
27592 use super::*;
27593 #[derive(Clone, Debug, PartialEq)]
27594 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27595}
27596
27597impl VmArchitecture {
27598 /// Gets the enum value.
27599 ///
27600 /// Returns `None` if the enum contains an unknown value deserialized from
27601 /// the string representation of enums.
27602 pub fn value(&self) -> std::option::Option<i32> {
27603 match self {
27604 Self::Unspecified => std::option::Option::Some(0),
27605 Self::X86Family => std::option::Option::Some(1),
27606 Self::Arm64 => std::option::Option::Some(2),
27607 Self::UnknownValue(u) => u.0.value(),
27608 }
27609 }
27610
27611 /// Gets the enum value as a string.
27612 ///
27613 /// Returns `None` if the enum contains an unknown value deserialized from
27614 /// the integer representation of enums.
27615 pub fn name(&self) -> std::option::Option<&str> {
27616 match self {
27617 Self::Unspecified => std::option::Option::Some("VM_ARCHITECTURE_UNSPECIFIED"),
27618 Self::X86Family => std::option::Option::Some("VM_ARCHITECTURE_X86_FAMILY"),
27619 Self::Arm64 => std::option::Option::Some("VM_ARCHITECTURE_ARM64"),
27620 Self::UnknownValue(u) => u.0.name(),
27621 }
27622 }
27623}
27624
27625impl std::default::Default for VmArchitecture {
27626 fn default() -> Self {
27627 use std::convert::From;
27628 Self::from(0)
27629 }
27630}
27631
27632impl std::fmt::Display for VmArchitecture {
27633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27634 wkt::internal::display_enum(f, self.name(), self.value())
27635 }
27636}
27637
27638impl std::convert::From<i32> for VmArchitecture {
27639 fn from(value: i32) -> Self {
27640 match value {
27641 0 => Self::Unspecified,
27642 1 => Self::X86Family,
27643 2 => Self::Arm64,
27644 _ => Self::UnknownValue(vm_architecture::UnknownValue(
27645 wkt::internal::UnknownEnumValue::Integer(value),
27646 )),
27647 }
27648 }
27649}
27650
27651impl std::convert::From<&str> for VmArchitecture {
27652 fn from(value: &str) -> Self {
27653 use std::string::ToString;
27654 match value {
27655 "VM_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
27656 "VM_ARCHITECTURE_X86_FAMILY" => Self::X86Family,
27657 "VM_ARCHITECTURE_ARM64" => Self::Arm64,
27658 _ => Self::UnknownValue(vm_architecture::UnknownValue(
27659 wkt::internal::UnknownEnumValue::String(value.to_string()),
27660 )),
27661 }
27662 }
27663}
27664
27665impl serde::ser::Serialize for VmArchitecture {
27666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27667 where
27668 S: serde::Serializer,
27669 {
27670 match self {
27671 Self::Unspecified => serializer.serialize_i32(0),
27672 Self::X86Family => serializer.serialize_i32(1),
27673 Self::Arm64 => serializer.serialize_i32(2),
27674 Self::UnknownValue(u) => u.0.serialize(serializer),
27675 }
27676 }
27677}
27678
27679impl<'de> serde::de::Deserialize<'de> for VmArchitecture {
27680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27681 where
27682 D: serde::Deserializer<'de>,
27683 {
27684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VmArchitecture>::new(
27685 ".google.cloud.vmmigration.v1.VmArchitecture",
27686 ))
27687 }
27688}
27689
27690/// Describes the networking tier used for configuring network access
27691/// configuration.
27692///
27693/// # Working with unknown values
27694///
27695/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27696/// additional enum variants at any time. Adding new variants is not considered
27697/// a breaking change. Applications should write their code in anticipation of:
27698///
27699/// - New values appearing in future releases of the client library, **and**
27700/// - New values received dynamically, without application changes.
27701///
27702/// Please consult the [Working with enums] section in the user guide for some
27703/// guidelines.
27704///
27705/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27706#[derive(Clone, Debug, PartialEq)]
27707#[non_exhaustive]
27708pub enum ComputeEngineNetworkTier {
27709 /// An unspecified network tier. Will be used as PREMIUM.
27710 Unspecified,
27711 /// A standard network tier.
27712 NetworkTierStandard,
27713 /// A premium network tier.
27714 NetworkTierPremium,
27715 /// If set, the enum was initialized with an unknown value.
27716 ///
27717 /// Applications can examine the value using [ComputeEngineNetworkTier::value] or
27718 /// [ComputeEngineNetworkTier::name].
27719 UnknownValue(compute_engine_network_tier::UnknownValue),
27720}
27721
27722#[doc(hidden)]
27723pub mod compute_engine_network_tier {
27724 #[allow(unused_imports)]
27725 use super::*;
27726 #[derive(Clone, Debug, PartialEq)]
27727 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27728}
27729
27730impl ComputeEngineNetworkTier {
27731 /// Gets the enum value.
27732 ///
27733 /// Returns `None` if the enum contains an unknown value deserialized from
27734 /// the string representation of enums.
27735 pub fn value(&self) -> std::option::Option<i32> {
27736 match self {
27737 Self::Unspecified => std::option::Option::Some(0),
27738 Self::NetworkTierStandard => std::option::Option::Some(1),
27739 Self::NetworkTierPremium => std::option::Option::Some(2),
27740 Self::UnknownValue(u) => u.0.value(),
27741 }
27742 }
27743
27744 /// Gets the enum value as a string.
27745 ///
27746 /// Returns `None` if the enum contains an unknown value deserialized from
27747 /// the integer representation of enums.
27748 pub fn name(&self) -> std::option::Option<&str> {
27749 match self {
27750 Self::Unspecified => {
27751 std::option::Option::Some("COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED")
27752 }
27753 Self::NetworkTierStandard => std::option::Option::Some("NETWORK_TIER_STANDARD"),
27754 Self::NetworkTierPremium => std::option::Option::Some("NETWORK_TIER_PREMIUM"),
27755 Self::UnknownValue(u) => u.0.name(),
27756 }
27757 }
27758}
27759
27760impl std::default::Default for ComputeEngineNetworkTier {
27761 fn default() -> Self {
27762 use std::convert::From;
27763 Self::from(0)
27764 }
27765}
27766
27767impl std::fmt::Display for ComputeEngineNetworkTier {
27768 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27769 wkt::internal::display_enum(f, self.name(), self.value())
27770 }
27771}
27772
27773impl std::convert::From<i32> for ComputeEngineNetworkTier {
27774 fn from(value: i32) -> Self {
27775 match value {
27776 0 => Self::Unspecified,
27777 1 => Self::NetworkTierStandard,
27778 2 => Self::NetworkTierPremium,
27779 _ => Self::UnknownValue(compute_engine_network_tier::UnknownValue(
27780 wkt::internal::UnknownEnumValue::Integer(value),
27781 )),
27782 }
27783 }
27784}
27785
27786impl std::convert::From<&str> for ComputeEngineNetworkTier {
27787 fn from(value: &str) -> Self {
27788 use std::string::ToString;
27789 match value {
27790 "COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED" => Self::Unspecified,
27791 "NETWORK_TIER_STANDARD" => Self::NetworkTierStandard,
27792 "NETWORK_TIER_PREMIUM" => Self::NetworkTierPremium,
27793 _ => Self::UnknownValue(compute_engine_network_tier::UnknownValue(
27794 wkt::internal::UnknownEnumValue::String(value.to_string()),
27795 )),
27796 }
27797 }
27798}
27799
27800impl serde::ser::Serialize for ComputeEngineNetworkTier {
27801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27802 where
27803 S: serde::Serializer,
27804 {
27805 match self {
27806 Self::Unspecified => serializer.serialize_i32(0),
27807 Self::NetworkTierStandard => serializer.serialize_i32(1),
27808 Self::NetworkTierPremium => serializer.serialize_i32(2),
27809 Self::UnknownValue(u) => u.0.serialize(serializer),
27810 }
27811 }
27812}
27813
27814impl<'de> serde::de::Deserialize<'de> for ComputeEngineNetworkTier {
27815 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27816 where
27817 D: serde::Deserializer<'de>,
27818 {
27819 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComputeEngineNetworkTier>::new(
27820 ".google.cloud.vmmigration.v1.ComputeEngineNetworkTier",
27821 ))
27822 }
27823}