1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// <p>For the <code>UpdateItem</code> operation, represents the attributes to be modified, the action to perform on each, and the new value for each.</p><note>
|
2 + | /* StructureGenerator.kt:197 */
|
3 + | /// /* StructureGenerator.kt:197 */<p>For the <code>UpdateItem</code> operation, represents the attributes to be modified, the action to perform on each, and the new value for each.</p><note>
|
4 4 | /// <p>You cannot use <code>UpdateItem</code> to update any primary key attributes. Instead, you will need to delete the item, and then use <code>PutItem</code> to create a new item with new attributes.</p>
|
5 5 | /// </note>
|
6 6 | /// <p>Attribute values cannot be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests with empty values will be rejected with a <code>ValidationException</code> exception.</p>
|
7 + | /* RustType.kt:516 */
|
7 8 | #[non_exhaustive]
|
9 + | /* RustType.kt:516 */
|
8 10 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9 - | pub struct AttributeValueUpdate {
|
10 - | /// <p>Represents the data for an attribute.</p>
|
11 + | pub /* StructureGenerator.kt:201 */ struct AttributeValueUpdate {
|
12 + | /// /* StructureGenerator.kt:231 */<p>Represents the data for an attribute.</p>
|
11 13 | /// <p>Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.</p>
|
12 14 | /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes">Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
|
13 15 | pub value: ::std::option::Option<crate::types::AttributeValue>,
|
14 - | /// <p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
16 + | /// /* StructureGenerator.kt:231 */<p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
15 17 | /// <p><b>If an item with the specified <i>Key</i> is found in the table:</b></p>
|
16 18 | /// <ul>
|
17 19 | /// <li>
|
18 20 | /// <p><code>PUT</code> - Adds the specified attribute to the item. If the attribute already exists, it is replaced by the new value.</p></li>
|
19 21 | /// <li>
|
20 22 | /// <p><code>DELETE</code> - If no value is specified, the attribute and its value are removed from the item. The data type of the specified value must match the existing value's data type.</p>
|
21 23 | /// <p>If a <i>set</i> of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specified <code>\[a,c\]</code>, then the final attribute value would be <code>\[b\]</code>. Specifying an empty set is an error.</p></li>
|
22 24 | /// <li>
|
23 25 | /// <p><code>ADD</code> - If the attribute does not already exist, then the attribute and its values are added to the item. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
|
24 26 | /// <ul>
|
25 27 | /// <li>
|
26 28 | /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then the <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
|
27 29 | /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value.</p>
|
28 30 | /// <p>In addition, if you use <code>ADD</code> to update an existing item, and intend to increment or decrement an attribute value which does not yet exist, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update does not yet have an attribute named <i>itemcount</i>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway, even though it currently does not exist. DynamoDB will create the <i>itemcount</i> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <i>itemcount</i> attribute in the item, with a value of <code>3</code>.</p>
|
29 31 | /// </note></li>
|
30 32 | /// <li>
|
31 33 | /// <p>If the existing data type is a set, and if the <code>Value</code> is also a set, then the <code>Value</code> is added to the existing set. (This is a <i>set</i> operation, not mathematical addition.) For example, if the attribute value was the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value would be <code>\[1,2,3\]</code>. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
|
32 34 | /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings. The same holds true for number sets and binary sets.</p></li>
|
33 35 | /// </ul>
|
34 36 | /// <p>This action is only valid for an existing attribute whose data type is number or is a set. Do not use <code>ADD</code> for any other data types.</p></li>
|
35 37 | /// </ul>
|
36 38 | /// <p><b>If no item with the specified <i>Key</i> is found:</b></p>
|
37 39 | /// <ul>
|
38 40 | /// <li>
|
39 41 | /// <p><code>PUT</code> - DynamoDB creates a new item with the specified primary key, and then adds the attribute.</p></li>
|
40 42 | /// <li>
|
41 43 | /// <p><code>DELETE</code> - Nothing happens; there is no attribute to delete.</p></li>
|
42 44 | /// <li>
|
43 45 | /// <p><code>ADD</code> - DynamoDB creates an item with the supplied primary key and number (or set of numbers) for the attribute value. The only data types allowed are number and number set; no other data types can be specified.</p></li>
|
44 46 | /// </ul>
|
45 47 | pub action: ::std::option::Option<crate::types::AttributeAction>,
|
48 + | /* StructureGenerator.kt:201 */
|
46 49 | }
|
50 + | /* StructureGenerator.kt:135 */
|
47 51 | impl AttributeValueUpdate {
|
48 - | /// <p>Represents the data for an attribute.</p>
|
52 + | /// /* StructureGenerator.kt:231 */<p>Represents the data for an attribute.</p>
|
49 53 | /// <p>Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.</p>
|
50 54 | /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes">Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
|
55 + | /* StructureGenerator.kt:166 */
|
51 56 | pub fn value(&self) -> ::std::option::Option<&crate::types::AttributeValue> {
|
57 + | /* StructureGenerator.kt:170 */
|
52 58 | self.value.as_ref()
|
59 + | /* StructureGenerator.kt:166 */
|
53 60 | }
|
54 - | /// <p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
61 + | /// /* StructureGenerator.kt:231 */<p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
55 62 | /// <p><b>If an item with the specified <i>Key</i> is found in the table:</b></p>
|
56 63 | /// <ul>
|
57 64 | /// <li>
|
58 65 | /// <p><code>PUT</code> - Adds the specified attribute to the item. If the attribute already exists, it is replaced by the new value.</p></li>
|
59 66 | /// <li>
|
60 67 | /// <p><code>DELETE</code> - If no value is specified, the attribute and its value are removed from the item. The data type of the specified value must match the existing value's data type.</p>
|
61 68 | /// <p>If a <i>set</i> of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specified <code>\[a,c\]</code>, then the final attribute value would be <code>\[b\]</code>. Specifying an empty set is an error.</p></li>
|
62 69 | /// <li>
|
63 70 | /// <p><code>ADD</code> - If the attribute does not already exist, then the attribute and its values are added to the item. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
|
64 71 | /// <ul>
|
65 72 | /// <li>
|
66 73 | /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then the <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
|
67 74 | /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value.</p>
|
68 75 | /// <p>In addition, if you use <code>ADD</code> to update an existing item, and intend to increment or decrement an attribute value which does not yet exist, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update does not yet have an attribute named <i>itemcount</i>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway, even though it currently does not exist. DynamoDB will create the <i>itemcount</i> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <i>itemcount</i> attribute in the item, with a value of <code>3</code>.</p>
|
69 76 | /// </note></li>
|
70 77 | /// <li>
|
71 78 | /// <p>If the existing data type is a set, and if the <code>Value</code> is also a set, then the <code>Value</code> is added to the existing set. (This is a <i>set</i> operation, not mathematical addition.) For example, if the attribute value was the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value would be <code>\[1,2,3\]</code>. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
|
72 79 | /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings. The same holds true for number sets and binary sets.</p></li>
|
73 80 | /// </ul>
|
74 81 | /// <p>This action is only valid for an existing attribute whose data type is number or is a set. Do not use <code>ADD</code> for any other data types.</p></li>
|
75 82 | /// </ul>
|
76 83 | /// <p><b>If no item with the specified <i>Key</i> is found:</b></p>
|
77 84 | /// <ul>
|
78 85 | /// <li>
|
79 86 | /// <p><code>PUT</code> - DynamoDB creates a new item with the specified primary key, and then adds the attribute.</p></li>
|
80 87 | /// <li>
|
81 88 | /// <p><code>DELETE</code> - Nothing happens; there is no attribute to delete.</p></li>
|
82 89 | /// <li>
|
83 90 | /// <p><code>ADD</code> - DynamoDB creates an item with the supplied primary key and number (or set of numbers) for the attribute value. The only data types allowed are number and number set; no other data types can be specified.</p></li>
|
84 91 | /// </ul>
|
92 + | /* StructureGenerator.kt:166 */
|
85 93 | pub fn action(&self) -> ::std::option::Option<&crate::types::AttributeAction> {
|
94 + | /* StructureGenerator.kt:170 */
|
86 95 | self.action.as_ref()
|
96 + | /* StructureGenerator.kt:166 */
|
87 97 | }
|
98 + | /* StructureGenerator.kt:135 */
|
88 99 | }
|
100 + | /* ClientCodegenVisitor.kt:237 */
|
89 101 | impl AttributeValueUpdate {
|
90 - | /// Creates a new builder-style object to manufacture [`AttributeValueUpdate`](crate::types::AttributeValueUpdate).
|
102 + | /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`AttributeValueUpdate`](crate::types::AttributeValueUpdate).
|
103 + | /* BuilderGenerator.kt:175 */
|
91 104 | pub fn builder() -> crate::types::builders::AttributeValueUpdateBuilder {
|
105 + | /* BuilderGenerator.kt:176 */
|
92 106 | crate::types::builders::AttributeValueUpdateBuilder::default()
|
107 + | /* BuilderGenerator.kt:175 */
|
93 108 | }
|
109 + | /* ClientCodegenVisitor.kt:237 */
|
94 110 | }
|
95 111 |
|
96 - | /// A builder for [`AttributeValueUpdate`](crate::types::AttributeValueUpdate).
|
112 + | /// /* BuilderGenerator.kt:342 */A builder for [`AttributeValueUpdate`](crate::types::AttributeValueUpdate).
|
113 + | /* RustType.kt:516 */
|
97 114 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
115 + | /* RustType.kt:516 */
|
98 116 | #[non_exhaustive]
|
117 + | /* BuilderGenerator.kt:345 */
|
99 118 | pub struct AttributeValueUpdateBuilder {
|
100 - | pub(crate) value: ::std::option::Option<crate::types::AttributeValue>,
|
101 - | pub(crate) action: ::std::option::Option<crate::types::AttributeAction>,
|
119 + | /* BuilderGenerator.kt:275 */ pub(crate) value: ::std::option::Option<crate::types::AttributeValue>,
|
120 + | /* BuilderGenerator.kt:275 */ pub(crate) action: ::std::option::Option<crate::types::AttributeAction>,
|
121 + | /* BuilderGenerator.kt:345 */
|
102 122 | }
|
123 + | /* BuilderGenerator.kt:355 */
|
103 124 | impl AttributeValueUpdateBuilder {
|
104 - | /// <p>Represents the data for an attribute.</p>
|
125 + | /// /* BuilderGenerator.kt:286 */<p>Represents the data for an attribute.</p>
|
105 126 | /// <p>Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.</p>
|
106 127 | /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes">Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
|
128 + | /* BuilderGenerator.kt:291 */
|
107 129 | pub fn value(mut self, input: crate::types::AttributeValue) -> Self {
|
130 + | /* BuilderGenerator.kt:292 */
|
108 131 | self.value = ::std::option::Option::Some(input);
|
132 + | /* BuilderGenerator.kt:293 */
|
109 133 | self
|
134 + | /* BuilderGenerator.kt:291 */
|
110 135 | }
|
111 - | /// <p>Represents the data for an attribute.</p>
|
136 + | /// /* BuilderGenerator.kt:312 */<p>Represents the data for an attribute.</p>
|
112 137 | /// <p>Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.</p>
|
113 138 | /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes">Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
|
139 + | /* BuilderGenerator.kt:314 */
|
114 140 | pub fn set_value(mut self, input: ::std::option::Option<crate::types::AttributeValue>) -> Self {
|
141 + | /* BuilderGenerator.kt:315 */
|
115 142 | self.value = input;
|
116 143 | self
|
144 + | /* BuilderGenerator.kt:314 */
|
117 145 | }
|
118 - | /// <p>Represents the data for an attribute.</p>
|
146 + | /// /* BuilderGenerator.kt:334 */<p>Represents the data for an attribute.</p>
|
119 147 | /// <p>Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.</p>
|
120 148 | /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes">Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
|
149 + | /* BuilderGenerator.kt:336 */
|
121 150 | pub fn get_value(&self) -> &::std::option::Option<crate::types::AttributeValue> {
|
151 + | /* BuilderGenerator.kt:337 */
|
122 152 | &self.value
|
153 + | /* BuilderGenerator.kt:336 */
|
123 154 | }
|
124 - | /// <p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
155 + | /// /* BuilderGenerator.kt:286 */<p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
125 156 | /// <p><b>If an item with the specified <i>Key</i> is found in the table:</b></p>
|
126 157 | /// <ul>
|
127 158 | /// <li>
|
128 159 | /// <p><code>PUT</code> - Adds the specified attribute to the item. If the attribute already exists, it is replaced by the new value.</p></li>
|
129 160 | /// <li>
|
130 161 | /// <p><code>DELETE</code> - If no value is specified, the attribute and its value are removed from the item. The data type of the specified value must match the existing value's data type.</p>
|
131 162 | /// <p>If a <i>set</i> of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specified <code>\[a,c\]</code>, then the final attribute value would be <code>\[b\]</code>. Specifying an empty set is an error.</p></li>
|
132 163 | /// <li>
|
133 164 | /// <p><code>ADD</code> - If the attribute does not already exist, then the attribute and its values are added to the item. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
|
134 165 | /// <ul>
|
135 166 | /// <li>
|
136 167 | /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then the <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
|
137 168 | /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value.</p>
|
138 169 | /// <p>In addition, if you use <code>ADD</code> to update an existing item, and intend to increment or decrement an attribute value which does not yet exist, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update does not yet have an attribute named <i>itemcount</i>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway, even though it currently does not exist. DynamoDB will create the <i>itemcount</i> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <i>itemcount</i> attribute in the item, with a value of <code>3</code>.</p>
|
139 170 | /// </note></li>
|
140 171 | /// <li>
|
141 172 | /// <p>If the existing data type is a set, and if the <code>Value</code> is also a set, then the <code>Value</code> is added to the existing set. (This is a <i>set</i> operation, not mathematical addition.) For example, if the attribute value was the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value would be <code>\[1,2,3\]</code>. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
|
142 173 | /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings. The same holds true for number sets and binary sets.</p></li>
|
143 174 | /// </ul>
|
144 175 | /// <p>This action is only valid for an existing attribute whose data type is number or is a set. Do not use <code>ADD</code> for any other data types.</p></li>
|
145 176 | /// </ul>
|
146 177 | /// <p><b>If no item with the specified <i>Key</i> is found:</b></p>
|
147 178 | /// <ul>
|
148 179 | /// <li>
|
149 180 | /// <p><code>PUT</code> - DynamoDB creates a new item with the specified primary key, and then adds the attribute.</p></li>
|
150 181 | /// <li>
|
151 182 | /// <p><code>DELETE</code> - Nothing happens; there is no attribute to delete.</p></li>
|
152 183 | /// <li>
|
153 184 | /// <p><code>ADD</code> - DynamoDB creates an item with the supplied primary key and number (or set of numbers) for the attribute value. The only data types allowed are number and number set; no other data types can be specified.</p></li>
|
154 185 | /// </ul>
|
186 + | /* BuilderGenerator.kt:291 */
|
155 187 | pub fn action(mut self, input: crate::types::AttributeAction) -> Self {
|
188 + | /* BuilderGenerator.kt:292 */
|
156 189 | self.action = ::std::option::Option::Some(input);
|
190 + | /* BuilderGenerator.kt:293 */
|
157 191 | self
|
192 + | /* BuilderGenerator.kt:291 */
|
158 193 | }
|
159 - | /// <p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
194 + | /// /* BuilderGenerator.kt:312 */<p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
160 195 | /// <p><b>If an item with the specified <i>Key</i> is found in the table:</b></p>
|
161 196 | /// <ul>
|
162 197 | /// <li>
|
163 198 | /// <p><code>PUT</code> - Adds the specified attribute to the item. If the attribute already exists, it is replaced by the new value.</p></li>
|
164 199 | /// <li>
|
165 200 | /// <p><code>DELETE</code> - If no value is specified, the attribute and its value are removed from the item. The data type of the specified value must match the existing value's data type.</p>
|
166 201 | /// <p>If a <i>set</i> of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specified <code>\[a,c\]</code>, then the final attribute value would be <code>\[b\]</code>. Specifying an empty set is an error.</p></li>
|
167 202 | /// <li>
|
168 203 | /// <p><code>ADD</code> - If the attribute does not already exist, then the attribute and its values are added to the item. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
|
169 204 | /// <ul>
|
170 205 | /// <li>
|
171 206 | /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then the <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
|
172 207 | /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value.</p>
|
173 208 | /// <p>In addition, if you use <code>ADD</code> to update an existing item, and intend to increment or decrement an attribute value which does not yet exist, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update does not yet have an attribute named <i>itemcount</i>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway, even though it currently does not exist. DynamoDB will create the <i>itemcount</i> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <i>itemcount</i> attribute in the item, with a value of <code>3</code>.</p>
|
174 209 | /// </note></li>
|
175 210 | /// <li>
|
176 211 | /// <p>If the existing data type is a set, and if the <code>Value</code> is also a set, then the <code>Value</code> is added to the existing set. (This is a <i>set</i> operation, not mathematical addition.) For example, if the attribute value was the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value would be <code>\[1,2,3\]</code>. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
|
177 212 | /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings. The same holds true for number sets and binary sets.</p></li>
|
178 213 | /// </ul>
|
179 214 | /// <p>This action is only valid for an existing attribute whose data type is number or is a set. Do not use <code>ADD</code> for any other data types.</p></li>
|
180 215 | /// </ul>
|
181 216 | /// <p><b>If no item with the specified <i>Key</i> is found:</b></p>
|
182 217 | /// <ul>
|
183 218 | /// <li>
|
184 219 | /// <p><code>PUT</code> - DynamoDB creates a new item with the specified primary key, and then adds the attribute.</p></li>
|
185 220 | /// <li>
|
186 221 | /// <p><code>DELETE</code> - Nothing happens; there is no attribute to delete.</p></li>
|
187 222 | /// <li>
|
188 223 | /// <p><code>ADD</code> - DynamoDB creates an item with the supplied primary key and number (or set of numbers) for the attribute value. The only data types allowed are number and number set; no other data types can be specified.</p></li>
|
189 224 | /// </ul>
|
225 + | /* BuilderGenerator.kt:314 */
|
190 226 | pub fn set_action(mut self, input: ::std::option::Option<crate::types::AttributeAction>) -> Self {
|
227 + | /* BuilderGenerator.kt:315 */
|
191 228 | self.action = input;
|
192 229 | self
|
230 + | /* BuilderGenerator.kt:314 */
|
193 231 | }
|
194 - | /// <p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
232 + | /// /* BuilderGenerator.kt:334 */<p>Specifies how to perform the update. Valid values are <code>PUT</code> (default), <code>DELETE</code>, and <code>ADD</code>. The behavior depends on whether the specified primary key already exists in the table.</p>
|
195 233 | /// <p><b>If an item with the specified <i>Key</i> is found in the table:</b></p>
|
196 234 | /// <ul>
|
197 235 | /// <li>
|
198 236 | /// <p><code>PUT</code> - Adds the specified attribute to the item. If the attribute already exists, it is replaced by the new value.</p></li>
|
199 237 | /// <li>
|
200 238 | /// <p><code>DELETE</code> - If no value is specified, the attribute and its value are removed from the item. The data type of the specified value must match the existing value's data type.</p>
|
201 239 | /// <p>If a <i>set</i> of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specified <code>\[a,c\]</code>, then the final attribute value would be <code>\[b\]</code>. Specifying an empty set is an error.</p></li>
|
202 240 | /// <li>
|
203 241 | /// <p><code>ADD</code> - If the attribute does not already exist, then the attribute and its values are added to the item. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
|
204 242 | /// <ul>
|
205 243 | /// <li>
|
206 244 | /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then the <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
|
207 245 | /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value.</p>
|
208 246 | /// <p>In addition, if you use <code>ADD</code> to update an existing item, and intend to increment or decrement an attribute value which does not yet exist, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update does not yet have an attribute named <i>itemcount</i>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway, even though it currently does not exist. DynamoDB will create the <i>itemcount</i> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <i>itemcount</i> attribute in the item, with a value of <code>3</code>.</p>
|
209 247 | /// </note></li>
|
210 248 | /// <li>
|
211 249 | /// <p>If the existing data type is a set, and if the <code>Value</code> is also a set, then the <code>Value</code> is added to the existing set. (This is a <i>set</i> operation, not mathematical addition.) For example, if the attribute value was the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value would be <code>\[1,2,3\]</code>. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
|
212 250 | /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings. The same holds true for number sets and binary sets.</p></li>
|
213 251 | /// </ul>
|
214 252 | /// <p>This action is only valid for an existing attribute whose data type is number or is a set. Do not use <code>ADD</code> for any other data types.</p></li>
|
215 253 | /// </ul>
|
216 254 | /// <p><b>If no item with the specified <i>Key</i> is found:</b></p>
|
217 255 | /// <ul>
|
218 256 | /// <li>
|
219 257 | /// <p><code>PUT</code> - DynamoDB creates a new item with the specified primary key, and then adds the attribute.</p></li>
|
220 258 | /// <li>
|
221 259 | /// <p><code>DELETE</code> - Nothing happens; there is no attribute to delete.</p></li>
|
222 260 | /// <li>
|
223 261 | /// <p><code>ADD</code> - DynamoDB creates an item with the supplied primary key and number (or set of numbers) for the attribute value. The only data types allowed are number and number set; no other data types can be specified.</p></li>
|
224 262 | /// </ul>
|
263 + | /* BuilderGenerator.kt:336 */
|
225 264 | pub fn get_action(&self) -> &::std::option::Option<crate::types::AttributeAction> {
|
265 + | /* BuilderGenerator.kt:337 */
|
226 266 | &self.action
|
267 + | /* BuilderGenerator.kt:336 */
|
227 268 | }
|
228 - | /// Consumes the builder and constructs a [`AttributeValueUpdate`](crate::types::AttributeValueUpdate).
|
269 + | /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`AttributeValueUpdate`](crate::types::AttributeValueUpdate).
|
270 + | /* BuilderGenerator.kt:253 */
|
229 271 | pub fn build(self) -> crate::types::AttributeValueUpdate {
|
272 + | /* BuilderGenerator.kt:477 */
|
230 273 | crate::types::AttributeValueUpdate {
|
231 - | value: self.value,
|
274 + | /* BuilderGenerator.kt:481 */ value: self.value,
|
275 + | /* BuilderGenerator.kt:481 */
|
232 276 | action: self.action,
|
277 + | /* BuilderGenerator.kt:477 */
|
233 278 | }
|
279 + | /* BuilderGenerator.kt:253 */
|
234 280 | }
|
281 + | /* BuilderGenerator.kt:355 */
|
235 282 | }
|