aws_sdk_elasticache/operation/start_migration/
_start_migration_input.rs

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>
7    pub 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>
9    pub 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>
13    pub fn replication_group_id(&self) -> ::std::option::Option<&str> {
14        self.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()`.
19    pub fn customer_node_endpoint_list(&self) -> &[crate::types::CustomerNodeEndpoint] {
20        self.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).
25    pub fn builder() -> crate::operation::start_migration::builders::StartMigrationInputBuilder {
26        crate::operation::start_migration::builders::StartMigrationInputBuilder::default()
27    }
28}
29
30/// 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 {
34    pub(crate) replication_group_id: ::std::option::Option<::std::string::String>,
35    pub(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.
40    pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.replication_group_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The ID of the replication group to which data should be migrated.</p>
45    pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.replication_group_id = input;
47        self
48    }
49    /// <p>The ID of the replication group to which data should be migrated.</p>
50    pub 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>
58    pub fn customer_node_endpoint_list(mut self, input: crate::types::CustomerNodeEndpoint) -> Self {
59        let mut v = self.customer_node_endpoint_list.unwrap_or_default();
60        v.push(input);
61        self.customer_node_endpoint_list = ::std::option::Option::Some(v);
62        self
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>
65    pub fn set_customer_node_endpoint_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>) -> Self {
66        self.customer_node_endpoint_list = input;
67        self
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>
70    pub 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).
74    pub fn build(
75        self,
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}