aws_sdk_elasticache/operation/start_migration/
_start_migration_input.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartMigrationInput {
    /// <p>The ID of the replication group to which data should be migrated.</p>
    pub replication_group_id: ::std::option::Option<::std::string::String>,
    /// <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>
    pub customer_node_endpoint_list: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>,
}
impl StartMigrationInput {
    /// <p>The ID of the replication group to which data should be migrated.</p>
    pub fn replication_group_id(&self) -> ::std::option::Option<&str> {
        self.replication_group_id.as_deref()
    }
    /// <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>
    ///
    /// 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()`.
    pub fn customer_node_endpoint_list(&self) -> &[crate::types::CustomerNodeEndpoint] {
        self.customer_node_endpoint_list.as_deref().unwrap_or_default()
    }
}
impl StartMigrationInput {
    /// Creates a new builder-style object to manufacture [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
    pub fn builder() -> crate::operation::start_migration::builders::StartMigrationInputBuilder {
        crate::operation::start_migration::builders::StartMigrationInputBuilder::default()
    }
}

/// A builder for [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartMigrationInputBuilder {
    pub(crate) replication_group_id: ::std::option::Option<::std::string::String>,
    pub(crate) customer_node_endpoint_list: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>,
}
impl StartMigrationInputBuilder {
    /// <p>The ID of the replication group to which data should be migrated.</p>
    /// This field is required.
    pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.replication_group_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the replication group to which data should be migrated.</p>
    pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.replication_group_id = input;
        self
    }
    /// <p>The ID of the replication group to which data should be migrated.</p>
    pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.replication_group_id
    }
    /// Appends an item to `customer_node_endpoint_list`.
    ///
    /// To override the contents of this collection use [`set_customer_node_endpoint_list`](Self::set_customer_node_endpoint_list).
    ///
    /// <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>
    pub fn customer_node_endpoint_list(mut self, input: crate::types::CustomerNodeEndpoint) -> Self {
        let mut v = self.customer_node_endpoint_list.unwrap_or_default();
        v.push(input);
        self.customer_node_endpoint_list = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_customer_node_endpoint_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>>) -> Self {
        self.customer_node_endpoint_list = input;
        self
    }
    /// <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>
    pub fn get_customer_node_endpoint_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CustomerNodeEndpoint>> {
        &self.customer_node_endpoint_list
    }
    /// Consumes the builder and constructs a [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_migration::StartMigrationInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_migration::StartMigrationInput {
            replication_group_id: self.replication_group_id,
            customer_node_endpoint_list: self.customer_node_endpoint_list,
        })
    }
}