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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about how blocks are related to each other. A <code>Block</code> object contains 0 or more <code>Relation</code> objects in a list, <code>Relationships</code>. For more information, see <code>Block</code>.</p>
/// <p>The <code>Type</code> element provides the type of the relationship for all blocks in the <code>IDs</code> array.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Relationship {
/// <p>The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.</p>
/// <ul>
/// <li>
/// <p><i>VALUE</i> - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.</p></li>
/// <li>
/// <p><i>CHILD</i> - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.</p></li>
/// <li>
/// <p><i>MERGED_CELL</i> - A list of IDs that identify each of the MERGED_CELL block types in a table.</p></li>
/// <li>
/// <p><i>ANSWER</i> - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.</p></li>
/// <li>
/// <p><i>TABLE</i> - A list of IDs that identify associated TABLE block types.</p></li>
/// <li>
/// <p><i>TABLE_TITLE</i> - A list that contains the ID for the TABLE_TITLE block type in a table.</p></li>
/// <li>
/// <p><i>TABLE_FOOTER</i> - A list of IDs that identify the TABLE_FOOTER block types in a table.</p></li>
/// </ul>
pub r#type: ::std::option::Option<crate::types::RelationshipType>,
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Relationship {
/// <p>The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.</p>
/// <ul>
/// <li>
/// <p><i>VALUE</i> - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.</p></li>
/// <li>
/// <p><i>CHILD</i> - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.</p></li>
/// <li>
/// <p><i>MERGED_CELL</i> - A list of IDs that identify each of the MERGED_CELL block types in a table.</p></li>
/// <li>
/// <p><i>ANSWER</i> - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.</p></li>
/// <li>
/// <p><i>TABLE</i> - A list of IDs that identify associated TABLE block types.</p></li>
/// <li>
/// <p><i>TABLE_TITLE</i> - A list that contains the ID for the TABLE_TITLE block type in a table.</p></li>
/// <li>
/// <p><i>TABLE_FOOTER</i> - A list of IDs that identify the TABLE_FOOTER block types in a table.</p></li>
/// </ul>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::RelationshipType> {
self.r#type.as_ref()
}
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> 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 `.ids.is_none()`.
pub fn ids(&self) -> &[::std::string::String] {
self.ids.as_deref().unwrap_or_default()
}
}
impl Relationship {
/// Creates a new builder-style object to manufacture [`Relationship`](crate::types::Relationship).
pub fn builder() -> crate::types::builders::RelationshipBuilder {
crate::types::builders::RelationshipBuilder::default()
}
}
/// A builder for [`Relationship`](crate::types::Relationship).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RelationshipBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::RelationshipType>,
pub(crate) ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl RelationshipBuilder {
/// <p>The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.</p>
/// <ul>
/// <li>
/// <p><i>VALUE</i> - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.</p></li>
/// <li>
/// <p><i>CHILD</i> - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.</p></li>
/// <li>
/// <p><i>MERGED_CELL</i> - A list of IDs that identify each of the MERGED_CELL block types in a table.</p></li>
/// <li>
/// <p><i>ANSWER</i> - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.</p></li>
/// <li>
/// <p><i>TABLE</i> - A list of IDs that identify associated TABLE block types.</p></li>
/// <li>
/// <p><i>TABLE_TITLE</i> - A list that contains the ID for the TABLE_TITLE block type in a table.</p></li>
/// <li>
/// <p><i>TABLE_FOOTER</i> - A list of IDs that identify the TABLE_FOOTER block types in a table.</p></li>
/// </ul>
pub fn r#type(mut self, input: crate::types::RelationshipType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.</p>
/// <ul>
/// <li>
/// <p><i>VALUE</i> - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.</p></li>
/// <li>
/// <p><i>CHILD</i> - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.</p></li>
/// <li>
/// <p><i>MERGED_CELL</i> - A list of IDs that identify each of the MERGED_CELL block types in a table.</p></li>
/// <li>
/// <p><i>ANSWER</i> - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.</p></li>
/// <li>
/// <p><i>TABLE</i> - A list of IDs that identify associated TABLE block types.</p></li>
/// <li>
/// <p><i>TABLE_TITLE</i> - A list that contains the ID for the TABLE_TITLE block type in a table.</p></li>
/// <li>
/// <p><i>TABLE_FOOTER</i> - A list of IDs that identify the TABLE_FOOTER block types in a table.</p></li>
/// </ul>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::RelationshipType>) -> Self {
self.r#type = input;
self
}
/// <p>The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.</p>
/// <ul>
/// <li>
/// <p><i>VALUE</i> - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.</p></li>
/// <li>
/// <p><i>CHILD</i> - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.</p></li>
/// <li>
/// <p><i>MERGED_CELL</i> - A list of IDs that identify each of the MERGED_CELL block types in a table.</p></li>
/// <li>
/// <p><i>ANSWER</i> - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.</p></li>
/// <li>
/// <p><i>TABLE</i> - A list of IDs that identify associated TABLE block types.</p></li>
/// <li>
/// <p><i>TABLE_TITLE</i> - A list that contains the ID for the TABLE_TITLE block type in a table.</p></li>
/// <li>
/// <p><i>TABLE_FOOTER</i> - A list of IDs that identify the TABLE_FOOTER block types in a table.</p></li>
/// </ul>
pub fn get_type(&self) -> &::std::option::Option<crate::types::RelationshipType> {
&self.r#type
}
/// Appends an item to `ids`.
///
/// To override the contents of this collection use [`set_ids`](Self::set_ids).
///
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub fn ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.ids.unwrap_or_default();
v.push(input.into());
self.ids = ::std::option::Option::Some(v);
self
}
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub fn set_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.ids = input;
self
}
/// <p>An array of IDs for related blocks. You can get the type of the relationship from the <code>Type</code> element.</p>
pub fn get_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.ids
}
/// Consumes the builder and constructs a [`Relationship`](crate::types::Relationship).
pub fn build(self) -> crate::types::Relationship {
crate::types::Relationship {
r#type: self.r#type,
ids: self.ids,
}
}
}