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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// 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 GetSynchronizationConfigurationOutput {
/// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
pub latest_version_number: ::std::option::Option<i32>,
/// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
pub import_data_rules: ::std::vec::Vec<crate::types::ImportDataRule>,
/// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
pub expiration_data_rules: ::std::vec::Vec<crate::types::ExpirationDataRule>,
_request_id: Option<String>,
}
impl GetSynchronizationConfigurationOutput {
/// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
pub fn latest_version_number(&self) -> ::std::option::Option<i32> {
self.latest_version_number
}
/// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
pub fn import_data_rules(&self) -> &[crate::types::ImportDataRule] {
use std::ops::Deref;
self.import_data_rules.deref()
}
/// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
pub fn expiration_data_rules(&self) -> &[crate::types::ExpirationDataRule] {
use std::ops::Deref;
self.expiration_data_rules.deref()
}
}
impl ::aws_types::request_id::RequestId for GetSynchronizationConfigurationOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetSynchronizationConfigurationOutput {
/// Creates a new builder-style object to manufacture [`GetSynchronizationConfigurationOutput`](crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput).
pub fn builder() -> crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder {
crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder::default()
}
}
/// A builder for [`GetSynchronizationConfigurationOutput`](crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSynchronizationConfigurationOutputBuilder {
pub(crate) latest_version_number: ::std::option::Option<i32>,
pub(crate) import_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::ImportDataRule>>,
pub(crate) expiration_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>>,
_request_id: Option<String>,
}
impl GetSynchronizationConfigurationOutputBuilder {
/// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
pub fn latest_version_number(mut self, input: i32) -> Self {
self.latest_version_number = ::std::option::Option::Some(input);
self
}
/// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
pub fn set_latest_version_number(mut self, input: ::std::option::Option<i32>) -> Self {
self.latest_version_number = input;
self
}
/// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
pub fn get_latest_version_number(&self) -> &::std::option::Option<i32> {
&self.latest_version_number
}
/// Appends an item to `import_data_rules`.
///
/// To override the contents of this collection use [`set_import_data_rules`](Self::set_import_data_rules).
///
/// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
pub fn import_data_rules(mut self, input: crate::types::ImportDataRule) -> Self {
let mut v = self.import_data_rules.unwrap_or_default();
v.push(input);
self.import_data_rules = ::std::option::Option::Some(v);
self
}
/// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
pub fn set_import_data_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImportDataRule>>) -> Self {
self.import_data_rules = input;
self
}
/// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
pub fn get_import_data_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImportDataRule>> {
&self.import_data_rules
}
/// Appends an item to `expiration_data_rules`.
///
/// To override the contents of this collection use [`set_expiration_data_rules`](Self::set_expiration_data_rules).
///
/// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
pub fn expiration_data_rules(mut self, input: crate::types::ExpirationDataRule) -> Self {
let mut v = self.expiration_data_rules.unwrap_or_default();
v.push(input);
self.expiration_data_rules = ::std::option::Option::Some(v);
self
}
/// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
pub fn set_expiration_data_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>>) -> Self {
self.expiration_data_rules = input;
self
}
/// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
pub fn get_expiration_data_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>> {
&self.expiration_data_rules
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetSynchronizationConfigurationOutput`](crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput).
/// This method will fail if any of the following fields are not set:
/// - [`import_data_rules`](crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder::import_data_rules)
/// - [`expiration_data_rules`](crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder::expiration_data_rules)
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(
crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput {
latest_version_number: self.latest_version_number,
import_data_rules: self.import_data_rules.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"import_data_rules",
"import_data_rules was not specified but it is required when building GetSynchronizationConfigurationOutput",
)
})?,
expiration_data_rules: self.expiration_data_rules.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"expiration_data_rules",
"expiration_data_rules was not specified but it is required when building GetSynchronizationConfigurationOutput",
)
})?,
_request_id: self._request_id,
},
)
}
}