File Coverage

blib/lib/Paws/DynamoDB/Condition.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


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