Skip to main content

aws_sdk_dynamodb/types/
_replica_update.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents one of the following:</p>
4/// <ul>
5/// <li>
6/// <p>A new replica to be added to an existing global table.</p></li>
7/// <li>
8/// <p>New parameters for an existing replica.</p></li>
9/// <li>
10/// <p>An existing replica to be removed from an existing global table.</p></li>
11/// </ul>
12#[non_exhaustive]
13#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
14pub struct ReplicaUpdate {
15    /// <p>The parameters required for creating a replica on an existing global table.</p>
16    pub create: ::std::option::Option<crate::types::CreateReplicaAction>,
17    /// <p>The name of the existing replica to be removed.</p>
18    pub delete: ::std::option::Option<crate::types::DeleteReplicaAction>,
19}
20impl ReplicaUpdate {
21    /// <p>The parameters required for creating a replica on an existing global table.</p>
22    pub fn create(&self) -> ::std::option::Option<&crate::types::CreateReplicaAction> {
23        self.create.as_ref()
24    }
25    /// <p>The name of the existing replica to be removed.</p>
26    pub fn delete(&self) -> ::std::option::Option<&crate::types::DeleteReplicaAction> {
27        self.delete.as_ref()
28    }
29}
30impl ReplicaUpdate {
31    /// Creates a new builder-style object to manufacture [`ReplicaUpdate`](crate::types::ReplicaUpdate).
32    pub fn builder() -> crate::types::builders::ReplicaUpdateBuilder {
33        crate::types::builders::ReplicaUpdateBuilder::default()
34    }
35}
36
37/// A builder for [`ReplicaUpdate`](crate::types::ReplicaUpdate).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct ReplicaUpdateBuilder {
41    pub(crate) create: ::std::option::Option<crate::types::CreateReplicaAction>,
42    pub(crate) delete: ::std::option::Option<crate::types::DeleteReplicaAction>,
43}
44impl ReplicaUpdateBuilder {
45    /// <p>The parameters required for creating a replica on an existing global table.</p>
46    pub fn create(mut self, input: crate::types::CreateReplicaAction) -> Self {
47        self.create = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>The parameters required for creating a replica on an existing global table.</p>
51    pub fn set_create(mut self, input: ::std::option::Option<crate::types::CreateReplicaAction>) -> Self {
52        self.create = input;
53        self
54    }
55    /// <p>The parameters required for creating a replica on an existing global table.</p>
56    pub fn get_create(&self) -> &::std::option::Option<crate::types::CreateReplicaAction> {
57        &self.create
58    }
59    /// <p>The name of the existing replica to be removed.</p>
60    pub fn delete(mut self, input: crate::types::DeleteReplicaAction) -> Self {
61        self.delete = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>The name of the existing replica to be removed.</p>
65    pub fn set_delete(mut self, input: ::std::option::Option<crate::types::DeleteReplicaAction>) -> Self {
66        self.delete = input;
67        self
68    }
69    /// <p>The name of the existing replica to be removed.</p>
70    pub fn get_delete(&self) -> &::std::option::Option<crate::types::DeleteReplicaAction> {
71        &self.delete
72    }
73    /// Consumes the builder and constructs a [`ReplicaUpdate`](crate::types::ReplicaUpdate).
74    pub fn build(self) -> crate::types::ReplicaUpdate {
75        crate::types::ReplicaUpdate {
76            create: self.create,
77            delete: self.delete,
78        }
79    }
80}