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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An adapter selected for use when analyzing documents. Contains an adapter ID and a version number. Contains information on pages selected for analysis when analyzing documents asychronously.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Adapter {
/// <p>A unique identifier for the adapter resource.</p>
pub adapter_id: ::std::string::String,
/// <p>Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter.</p>
/// <ul>
/// <li>
/// <p>If a page is not specified, it is set to <code>\["1"\]</code> by default.</p></li>
/// <li>
/// <p>The following characters are allowed in the parameter's string: <code>0 1 2 3 4 5 6 7 8 9 - *</code>. No whitespace is allowed.</p></li>
/// <li>
/// <p>When using * to indicate all pages, it must be the only element in the list.</p></li>
/// <li>
/// <p>You can use page intervals, such as <code>\["1-3", "1-1", "4-*"\]</code>. Where <code>*</code> indicates last page of document.</p></li>
/// <li>
/// <p>Specified pages must be greater than 0 and less than or equal to the number of pages in the document.</p></li>
/// </ul>
pub pages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>A string that identifies the version of the adapter.</p>
pub version: ::std::string::String,
}
impl Adapter {
/// <p>A unique identifier for the adapter resource.</p>
pub fn adapter_id(&self) -> &str {
use std::ops::Deref;
self.adapter_id.deref()
}
/// <p>Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter.</p>
/// <ul>
/// <li>
/// <p>If a page is not specified, it is set to <code>\["1"\]</code> by default.</p></li>
/// <li>
/// <p>The following characters are allowed in the parameter's string: <code>0 1 2 3 4 5 6 7 8 9 - *</code>. No whitespace is allowed.</p></li>
/// <li>
/// <p>When using * to indicate all pages, it must be the only element in the list.</p></li>
/// <li>
/// <p>You can use page intervals, such as <code>\["1-3", "1-1", "4-*"\]</code>. Where <code>*</code> indicates last page of document.</p></li>
/// <li>
/// <p>Specified pages must be greater than 0 and less than or equal to the number of pages in the document.</p></li>
/// </ul>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.pages.is_none()`.
pub fn pages(&self) -> &[::std::string::String] {
self.pages.as_deref().unwrap_or_default()
}
/// <p>A string that identifies the version of the adapter.</p>
pub fn version(&self) -> &str {
use std::ops::Deref;
self.version.deref()
}
}
impl Adapter {
/// Creates a new builder-style object to manufacture [`Adapter`](crate::types::Adapter).
pub fn builder() -> crate::types::builders::AdapterBuilder {
crate::types::builders::AdapterBuilder::default()
}
}
/// A builder for [`Adapter`](crate::types::Adapter).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AdapterBuilder {
pub(crate) adapter_id: ::std::option::Option<::std::string::String>,
pub(crate) pages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) version: ::std::option::Option<::std::string::String>,
}
impl AdapterBuilder {
/// <p>A unique identifier for the adapter resource.</p>
/// This field is required.
pub fn adapter_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.adapter_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for the adapter resource.</p>
pub fn set_adapter_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.adapter_id = input;
self
}
/// <p>A unique identifier for the adapter resource.</p>
pub fn get_adapter_id(&self) -> &::std::option::Option<::std::string::String> {
&self.adapter_id
}
/// Appends an item to `pages`.
///
/// To override the contents of this collection use [`set_pages`](Self::set_pages).
///
/// <p>Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter.</p>
/// <ul>
/// <li>
/// <p>If a page is not specified, it is set to <code>\["1"\]</code> by default.</p></li>
/// <li>
/// <p>The following characters are allowed in the parameter's string: <code>0 1 2 3 4 5 6 7 8 9 - *</code>. No whitespace is allowed.</p></li>
/// <li>
/// <p>When using * to indicate all pages, it must be the only element in the list.</p></li>
/// <li>
/// <p>You can use page intervals, such as <code>\["1-3", "1-1", "4-*"\]</code>. Where <code>*</code> indicates last page of document.</p></li>
/// <li>
/// <p>Specified pages must be greater than 0 and less than or equal to the number of pages in the document.</p></li>
/// </ul>
pub fn pages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.pages.unwrap_or_default();
v.push(input.into());
self.pages = ::std::option::Option::Some(v);
self
}
/// <p>Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter.</p>
/// <ul>
/// <li>
/// <p>If a page is not specified, it is set to <code>\["1"\]</code> by default.</p></li>
/// <li>
/// <p>The following characters are allowed in the parameter's string: <code>0 1 2 3 4 5 6 7 8 9 - *</code>. No whitespace is allowed.</p></li>
/// <li>
/// <p>When using * to indicate all pages, it must be the only element in the list.</p></li>
/// <li>
/// <p>You can use page intervals, such as <code>\["1-3", "1-1", "4-*"\]</code>. Where <code>*</code> indicates last page of document.</p></li>
/// <li>
/// <p>Specified pages must be greater than 0 and less than or equal to the number of pages in the document.</p></li>
/// </ul>
pub fn set_pages(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.pages = input;
self
}
/// <p>Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter.</p>
/// <ul>
/// <li>
/// <p>If a page is not specified, it is set to <code>\["1"\]</code> by default.</p></li>
/// <li>
/// <p>The following characters are allowed in the parameter's string: <code>0 1 2 3 4 5 6 7 8 9 - *</code>. No whitespace is allowed.</p></li>
/// <li>
/// <p>When using * to indicate all pages, it must be the only element in the list.</p></li>
/// <li>
/// <p>You can use page intervals, such as <code>\["1-3", "1-1", "4-*"\]</code>. Where <code>*</code> indicates last page of document.</p></li>
/// <li>
/// <p>Specified pages must be greater than 0 and less than or equal to the number of pages in the document.</p></li>
/// </ul>
pub fn get_pages(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.pages
}
/// <p>A string that identifies the version of the adapter.</p>
/// This field is required.
pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version = ::std::option::Option::Some(input.into());
self
}
/// <p>A string that identifies the version of the adapter.</p>
pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version = input;
self
}
/// <p>A string that identifies the version of the adapter.</p>
pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
&self.version
}
/// Consumes the builder and constructs a [`Adapter`](crate::types::Adapter).
/// This method will fail if any of the following fields are not set:
/// - [`adapter_id`](crate::types::builders::AdapterBuilder::adapter_id)
/// - [`version`](crate::types::builders::AdapterBuilder::version)
pub fn build(self) -> ::std::result::Result<crate::types::Adapter, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Adapter {
adapter_id: self.adapter_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"adapter_id",
"adapter_id was not specified but it is required when building Adapter",
)
})?,
pages: self.pages,
version: self.version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"version",
"version was not specified but it is required when building Adapter",
)
})?,
})
}
}