1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct StartMigrationInput {
6/// <p>The ID of the replication group to which data should be migrated.</p>
7pub replication_group_id: ::std::option::Option<::std::string::String>,
8/// <p>List of endpoints from which data should be migrated. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element.</p>
9pub customer_node_endpoint_list: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>,
10}
11impl StartMigrationInput {
12/// <p>The ID of the replication group to which data should be migrated.</p>
13pub fn replication_group_id(&self) -> ::std::option::Option<&str> {
14self.replication_group_id.as_deref()
15 }
16/// <p>List of endpoints from which data should be migrated. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element.</p>
17 ///
18 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.customer_node_endpoint_list.is_none()`.
19pub fn customer_node_endpoint_list(&self) -> &[crate::types::CustomerNodeEndpoint] {
20self.customer_node_endpoint_list.as_deref().unwrap_or_default()
21 }
22}
23impl StartMigrationInput {
24/// Creates a new builder-style object to manufacture [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
25pub fn builder() -> crate::operation::start_migration::builders::StartMigrationInputBuilder {
26crate::operation::start_migration::builders::StartMigrationInputBuilder::default()
27 }
28}
2930/// A builder for [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct StartMigrationInputBuilder {
34pub(crate) replication_group_id: ::std::option::Option<::std::string::String>,
35pub(crate) customer_node_endpoint_list: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>,
36}
37impl StartMigrationInputBuilder {
38/// <p>The ID of the replication group to which data should be migrated.</p>
39 /// This field is required.
40pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41self.replication_group_id = ::std::option::Option::Some(input.into());
42self
43}
44/// <p>The ID of the replication group to which data should be migrated.</p>
45pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46self.replication_group_id = input;
47self
48}
49/// <p>The ID of the replication group to which data should be migrated.</p>
50pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
51&self.replication_group_id
52 }
53/// Appends an item to `customer_node_endpoint_list`.
54 ///
55 /// To override the contents of this collection use [`set_customer_node_endpoint_list`](Self::set_customer_node_endpoint_list).
56 ///
57 /// <p>List of endpoints from which data should be migrated. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element.</p>
58pub fn customer_node_endpoint_list(mut self, input: crate::types::CustomerNodeEndpoint) -> Self {
59let mut v = self.customer_node_endpoint_list.unwrap_or_default();
60 v.push(input);
61self.customer_node_endpoint_list = ::std::option::Option::Some(v);
62self
63}
64/// <p>List of endpoints from which data should be migrated. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element.</p>
65pub fn set_customer_node_endpoint_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>) -> Self {
66self.customer_node_endpoint_list = input;
67self
68}
69/// <p>List of endpoints from which data should be migrated. For Valkey or Redis OSS (cluster mode disabled), the list should have only one element.</p>
70pub fn get_customer_node_endpoint_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>> {
71&self.customer_node_endpoint_list
72 }
73/// Consumes the builder and constructs a [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
74pub fn build(
75self,
76 ) -> ::std::result::Result<crate::operation::start_migration::StartMigrationInput, ::aws_smithy_types::error::operation::BuildError> {
77 ::std::result::Result::Ok(crate::operation::start_migration::StartMigrationInput {
78 replication_group_id: self.replication_group_id,
79 customer_node_endpoint_list: self.customer_node_endpoint_list,
80 })
81 }
82}