| 1 | # Generated by default/object.tt | ||
| 2 | package Paws::DynamoDB::Condition; | ||
| 3 | use Moose; | ||
| 4 | has AttributeValueList => (is => 'ro', isa => 'ArrayRef[Paws::DynamoDB::AttributeValue]'); | ||
| 5 | has ComparisonOperator => (is => 'ro', isa => 'Str', required => 1); | ||
| 6 | |||
| 7 | 1; | ||
| 8 | |||
| 9 | ### main pod documentation begin ### | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Paws::DynamoDB::Condition | ||
| 14 | |||
| 15 | =head1 USAGE | ||
| 16 | |||
| 17 | This class represents one of two things: | ||
| 18 | |||
| 19 | =head3 Arguments in a call to a service | ||
| 20 | |||
| 21 | Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. | ||
| 22 | Each attribute should be used as a named argument in the calls that expect this type of object. | ||
| 23 | |||
| 24 | As an example, if Att1 is expected to be a Paws::DynamoDB::Condition object: | ||
| 25 | |||
| 26 | $service_obj->Method(Att1 => { AttributeValueList => $value, ..., ComparisonOperator => $value }); | ||
| 27 | |||
| 28 | =head3 Results returned from an API call | ||
| 29 | |||
| 30 | Use accessors for each attribute. If Att1 is expected to be an Paws::DynamoDB::Condition object: | ||
| 31 | |||
| 32 | $result = $service_obj->Method(...); | ||
| 33 | $result->Att1->AttributeValueList | ||
| 34 | |||
| 35 | =head1 DESCRIPTION | ||
| 36 | |||
| 37 | Represents the selection criteria for a C<Query> or C<Scan> operation: | ||
| 38 | |||
| 39 | =over | ||
| 40 | |||
| 41 | =item * | ||
| 42 | |||
| 43 | For a C<Query> operation, C<Condition> is used for specifying the | ||
| 44 | C<KeyConditions> to use when querying a table or an index. For | ||
| 45 | C<KeyConditions>, only the following comparison operators are | ||
| 46 | supported: | ||
| 47 | |||
| 48 | C<EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN> | ||
| 49 | |||
| 50 | C<Condition> is also used in a C<QueryFilter>, which evaluates the | ||
| 51 | query results and returns only the desired values. | ||
| 52 | |||
| 53 | =item * | ||
| 54 | |||
| 55 | For a C<Scan> operation, C<Condition> is used in a C<ScanFilter>, which | ||
| 56 | evaluates the scan results and returns only the desired values. | ||
| 57 | |||
| 58 | =back | ||
| 59 | |||
| 60 | |||
| 61 | =head1 ATTRIBUTES | ||
| 62 | |||
| 63 | |||
| 64 | =head2 AttributeValueList => ArrayRef[L<Paws::DynamoDB::AttributeValue>] | ||
| 65 | |||
| 66 | One or more values to evaluate against the supplied attribute. The | ||
| 67 | number of values in the list depends on the C<ComparisonOperator> being | ||
| 68 | used. | ||
| 69 | |||
| 70 | For type Number, value comparisons are numeric. | ||
| 71 | |||
| 72 | String value comparisons for greater than, equals, or less than are | ||
| 73 | based on ASCII character code values. For example, C<a> is greater than | ||
| 74 | C<A>, and C<a> is greater than C<B>. For a list of code values, see | ||
| 75 | http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters | ||
| 76 | (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). | ||
| 77 | |||
| 78 | For Binary, DynamoDB treats each byte of the binary data as unsigned | ||
| 79 | when it compares binary values. | ||
| 80 | |||
| 81 | |||
| 82 | =head2 B<REQUIRED> ComparisonOperator => Str | ||
| 83 | |||
| 84 | A comparator for evaluating attributes. For example, equals, greater | ||
| 85 | than, less than, etc. | ||
| 86 | |||
| 87 | The following comparison operators are available: | ||
| 88 | |||
| 89 | C<EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | | ||
| 90 | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN> | ||
| 91 | |||
| 92 | The following are descriptions of each comparison operator. | ||
| 93 | |||
| 94 | =over | ||
| 95 | |||
| 96 | =item * | ||
| 97 | |||
| 98 | C<EQ> : Equal. C<EQ> is supported for all data types, including lists | ||
| 99 | and maps. | ||
| 100 | |||
| 101 | C<AttributeValueList> can contain only one C<AttributeValue> element of | ||
| 102 | type String, Number, Binary, String Set, Number Set, or Binary Set. If | ||
| 103 | an item contains an C<AttributeValue> element of a different type than | ||
| 104 | the one provided in the request, the value does not match. For example, | ||
| 105 | C<{"S":"6"}> does not equal C<{"N":"6"}>. Also, C<{"N":"6"}> does not | ||
| 106 | equal C<{"NS":["6", "2", "1"]}>. | ||
| 107 | |||
| 108 | =item * | ||
| 109 | |||
| 110 | C<NE> : Not equal. C<NE> is supported for all data types, including | ||
| 111 | lists and maps. | ||
| 112 | |||
| 113 | C<AttributeValueList> can contain only one C<AttributeValue> of type | ||
| 114 | String, Number, Binary, String Set, Number Set, or Binary Set. If an | ||
| 115 | item contains an C<AttributeValue> of a different type than the one | ||
| 116 | provided in the request, the value does not match. For example, | ||
| 117 | C<{"S":"6"}> does not equal C<{"N":"6"}>. Also, C<{"N":"6"}> does not | ||
| 118 | equal C<{"NS":["6", "2", "1"]}>. | ||
| 119 | |||
| 120 | =item * | ||
| 121 | |||
| 122 | C<LE> : Less than or equal. | ||
| 123 | |||
| 124 | C<AttributeValueList> can contain only one C<AttributeValue> element of | ||
| 125 | type String, Number, or Binary (not a set type). If an item contains an | ||
| 126 | C<AttributeValue> element of a different type than the one provided in | ||
| 127 | the request, the value does not match. For example, C<{"S":"6"}> does | ||
| 128 | not equal C<{"N":"6"}>. Also, C<{"N":"6"}> does not compare to | ||
| 129 | C<{"NS":["6", "2", "1"]}>. | ||
| 130 | |||
| 131 | =item * | ||
| 132 | |||
| 133 | C<LT> : Less than. | ||
| 134 | |||
| 135 | C<AttributeValueList> can contain only one C<AttributeValue> of type | ||
| 136 | String, Number, or Binary (not a set type). If an item contains an | ||
| 137 | C<AttributeValue> element of a different type than the one provided in | ||
| 138 | the request, the value does not match. For example, C<{"S":"6"}> does | ||
| 139 | not equal C<{"N":"6"}>. Also, C<{"N":"6"}> does not compare to | ||
| 140 | C<{"NS":["6", "2", "1"]}>. | ||
| 141 | |||
| 142 | =item * | ||
| 143 | |||
| 144 | C<GE> : Greater than or equal. | ||
| 145 | |||
| 146 | C<AttributeValueList> can contain only one C<AttributeValue> element of | ||
| 147 | type String, Number, or Binary (not a set type). If an item contains an | ||
| 148 | C<AttributeValue> element of a different type than the one provided in | ||
| 149 | the request, the value does not match. For example, C<{"S":"6"}> does | ||
| 150 | not equal C<{"N":"6"}>. Also, C<{"N":"6"}> does not compare to | ||
| 151 | C<{"NS":["6", "2", "1"]}>. | ||
| 152 | |||
| 153 | =item * | ||
| 154 | |||
| 155 | C<GT> : Greater than. | ||
| 156 | |||
| 157 | C<AttributeValueList> can contain only one C<AttributeValue> element of | ||
| 158 | type String, Number, or Binary (not a set type). If an item contains an | ||
| 159 | C<AttributeValue> element of a different type than the one provided in | ||
| 160 | the request, the value does not match. For example, C<{"S":"6"}> does | ||
| 161 | not equal C<{"N":"6"}>. Also, C<{"N":"6"}> does not compare to | ||
| 162 | C<{"NS":["6", "2", "1"]}>. | ||
| 163 | |||
| 164 | =item * | ||
| 165 | |||
| 166 | C<NOT_NULL> : The attribute exists. C<NOT_NULL> is supported for all | ||
| 167 | data types, including lists and maps. | ||
| 168 | |||
| 169 | This operator tests for the existence of an attribute, not its data | ||
| 170 | type. If the data type of attribute "C<a>" is null, and you evaluate it | ||
| 171 | using C<NOT_NULL>, the result is a Boolean C<true>. This result is | ||
| 172 | because the attribute "C<a>" exists; its data type is not relevant to | ||
| 173 | the C<NOT_NULL> comparison operator. | ||
| 174 | |||
| 175 | =item * | ||
| 176 | |||
| 177 | C<NULL> : The attribute does not exist. C<NULL> is supported for all | ||
| 178 | data types, including lists and maps. | ||
| 179 | |||
| 180 | This operator tests for the nonexistence of an attribute, not its data | ||
| 181 | type. If the data type of attribute "C<a>" is null, and you evaluate it | ||
| 182 | using C<NULL>, the result is a Boolean C<false>. This is because the | ||
| 183 | attribute "C<a>" exists; its data type is not relevant to the C<NULL> | ||
| 184 | comparison operator. | ||
| 185 | |||
| 186 | =item * | ||
| 187 | |||
| 188 | C<CONTAINS> : Checks for a subsequence, or value in a set. | ||
| 189 | |||
| 190 | C<AttributeValueList> can contain only one C<AttributeValue> element of | ||
| 191 | type String, Number, or Binary (not a set type). If the target | ||
| 192 | attribute of the comparison is of type String, then the operator checks | ||
| 193 | for a substring match. If the target attribute of the comparison is of | ||
| 194 | type Binary, then the operator looks for a subsequence of the target | ||
| 195 | that matches the input. If the target attribute of the comparison is a | ||
| 196 | set ("C<SS>", "C<NS>", or "C<BS>"), then the operator evaluates to true | ||
| 197 | if it finds an exact match with any member of the set. | ||
| 198 | |||
| 199 | CONTAINS is supported for lists: When evaluating "C<a CONTAINS b>", | ||
| 200 | "C<a>" can be a list; however, "C<b>" cannot be a set, a map, or a | ||
| 201 | list. | ||
| 202 | |||
| 203 | =item * | ||
| 204 | |||
| 205 | C<NOT_CONTAINS> : Checks for absence of a subsequence, or absence of a | ||
| 206 | value in a set. | ||
| 207 | |||
| 208 | C<AttributeValueList> can contain only one C<AttributeValue> element of | ||
| 209 | type String, Number, or Binary (not a set type). If the target | ||
| 210 | attribute of the comparison is a String, then the operator checks for | ||
| 211 | the absence of a substring match. If the target attribute of the | ||
| 212 | comparison is Binary, then the operator checks for the absence of a | ||
| 213 | subsequence of the target that matches the input. If the target | ||
| 214 | attribute of the comparison is a set ("C<SS>", "C<NS>", or "C<BS>"), | ||
| 215 | then the operator evaluates to true if it I<does not> find an exact | ||
| 216 | match with any member of the set. | ||
| 217 | |||
| 218 | NOT_CONTAINS is supported for lists: When evaluating "C<a NOT CONTAINS | ||
| 219 | b>", "C<a>" can be a list; however, "C<b>" cannot be a set, a map, or a | ||
| 220 | list. | ||
| 221 | |||
| 222 | =item * | ||
| 223 | |||
| 224 | C<BEGINS_WITH> : Checks for a prefix. | ||
| 225 | |||
| 226 | C<AttributeValueList> can contain only one C<AttributeValue> of type | ||
| 227 | String or Binary (not a Number or a set type). The target attribute of | ||
| 228 | the comparison must be of type String or Binary (not a Number or a set | ||
| 229 | type). | ||
| 230 | |||
| 231 | =item * | ||
| 232 | |||
| 233 | C<IN> : Checks for matching elements in a list. | ||
| 234 | |||
| 235 | C<AttributeValueList> can contain one or more C<AttributeValue> | ||
| 236 | elements of type String, Number, or Binary. These attributes are | ||
| 237 | compared against an existing attribute of an item. If any elements of | ||
| 238 | the input are equal to the item attribute, the expression evaluates to | ||
| 239 | true. | ||
| 240 | |||
| 241 | =item * | ||
| 242 | |||
| 243 | C<BETWEEN> : Greater than or equal to the first value, and less than or | ||
| 244 | equal to the second value. | ||
| 245 | |||
| 246 | C<AttributeValueList> must contain two C<AttributeValue> elements of | ||
| 247 | the same type, either String, Number, or Binary (not a set type). A | ||
| 248 | target attribute matches if the target value is greater than, or equal | ||
| 249 | to, the first element and less than, or equal to, the second element. | ||
| 250 | If an item contains an C<AttributeValue> element of a different type | ||
| 251 | than the one provided in the request, the value does not match. For | ||
| 252 | example, C<{"S":"6"}> does not compare to C<{"N":"6"}>. Also, | ||
| 253 | C<{"N":"6"}> does not compare to C<{"NS":["6", "2", "1"]}> | ||
| 254 | |||
| 255 | =back | ||
| 256 | |||
| 257 | For usage examples of C<AttributeValueList> and C<ComparisonOperator>, | ||
| 258 | see Legacy Conditional Parameters | ||
| 259 | (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) | ||
| 260 | in the I<Amazon DynamoDB Developer Guide>. | ||
| 261 | |||
| 262 | |||
| 263 | |||
| 264 | =head1 SEE ALSO | ||
| 265 | |||
| 266 | This class forms part of L<Paws>, describing an object used in L<Paws::DynamoDB> | ||
| 267 | |||
| 268 | =head1 BUGS and CONTRIBUTIONS | ||
| 269 | |||
| 270 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 271 | |||
| 272 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 273 | |||
| 274 | =cut | ||
| 275 |