File Coverage

blib/lib/Paws/DynamoDB/PutItem.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1              
2             package Paws::DynamoDB::PutItem;
3 1     1   332 use Moose;
  1     2   2  
  1         6  
  2         1127  
  2         6  
  2         18  
4             has ConditionalOperator => (is => 'ro', isa => 'Str');
5             has ConditionExpression => (is => 'ro', isa => 'Str');
6             has Expected => (is => 'ro', isa => 'Paws::DynamoDB::ExpectedAttributeMap');
7             has ExpressionAttributeNames => (is => 'ro', isa => 'Paws::DynamoDB::ExpressionAttributeNameMap');
8             has ExpressionAttributeValues => (is => 'ro', isa => 'Paws::DynamoDB::ExpressionAttributeValueMap');
9             has Item => (is => 'ro', isa => 'Paws::DynamoDB::PutItemInputAttributeMap', required => 1);
10             has ReturnConsumedCapacity => (is => 'ro', isa => 'Str');
11             has ReturnItemCollectionMetrics => (is => 'ro', isa => 'Str');
12             has ReturnValues => (is => 'ro', isa => 'Str');
13             has TableName => (is => 'ro', isa => 'Str', required => 1);
14              
15 1     1   5624 use MooseX::ClassAttribute;
  1     2   2  
  1         9  
  2         13213  
  2         5  
  2         23  
16              
17             class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutItem');
18             class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::DynamoDB::PutItemOutput');
19             class_has _result_key => (isa => 'Str', is => 'ro');
20             1;
21              
22             ### main pod documentation begin ###
23              
24             =head1 NAME
25              
26             Paws::DynamoDB::PutItem - Arguments for method PutItem on Paws::DynamoDB
27              
28             =head1 DESCRIPTION
29              
30             This class represents the parameters used for calling the method PutItem on the
31             Amazon DynamoDB service. Use the attributes of this class
32             as arguments to method PutItem.
33              
34             You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutItem.
35              
36             As an example:
37              
38             $service_obj->PutItem(Att1 => $value1, Att2 => $value2, ...);
39              
40             Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
41              
42             =head1 ATTRIBUTES
43              
44              
45             =head2 ConditionalOperator => Str
46              
47             This is a legacy parameter. Use C<ConditionExpression> instead. For
48             more information, see ConditionalOperator in the I<Amazon DynamoDB
49             Developer Guide>.
50              
51             Valid values are: C<"AND">, C<"OR">
52              
53             =head2 ConditionExpression => Str
54              
55             A condition that must be satisfied in order for a conditional
56             C<PutItem> operation to succeed.
57              
58             An expression can contain any of the following:
59              
60             =over
61              
62             =item *
63              
64             Functions: C<attribute_exists | attribute_not_exists | attribute_type |
65             contains | begins_with | size>
66              
67             These function names are case-sensitive.
68              
69             =item *
70              
71             Comparison operators: C<= | E<lt>E<gt> | E<lt> | E<gt> | E<lt>= |
72             E<gt>= | BETWEEN | IN>
73              
74             =item *
75              
76             Logical operators: C<AND | OR | NOT>
77              
78             =back
79              
80             For more information on condition expressions, see Specifying
81             Conditions in the I<Amazon DynamoDB Developer Guide>.
82              
83              
84              
85             =head2 Expected => L<Paws::DynamoDB::ExpectedAttributeMap>
86              
87             This is a legacy parameter. Use C<ConditionExpression> instead. For
88             more information, see Expected in the I<Amazon DynamoDB Developer
89             Guide>.
90              
91              
92              
93             =head2 ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>
94              
95             One or more substitution tokens for attribute names in an expression.
96             The following are some use cases for using C<ExpressionAttributeNames>:
97              
98             =over
99              
100             =item *
101              
102             To access an attribute whose name conflicts with a DynamoDB reserved
103             word.
104              
105             =item *
106              
107             To create a placeholder for repeating occurrences of an attribute name
108             in an expression.
109              
110             =item *
111              
112             To prevent special characters in an attribute name from being
113             misinterpreted in an expression.
114              
115             =back
116              
117             Use the B<#> character in an expression to dereference an attribute
118             name. For example, consider the following attribute name:
119              
120             =over
121              
122             =item *
123              
124             C<Percentile>
125              
126             =back
127              
128             The name of this attribute conflicts with a reserved word, so it cannot
129             be used directly in an expression. (For the complete list of reserved
130             words, see Reserved Words in the I<Amazon DynamoDB Developer Guide>).
131             To work around this, you could specify the following for
132             C<ExpressionAttributeNames>:
133              
134             =over
135              
136             =item *
137              
138             C<{"#P":"Percentile"}>
139              
140             =back
141              
142             You could then use this substitution in an expression, as in this
143             example:
144              
145             =over
146              
147             =item *
148              
149             C<#P = :val>
150              
151             =back
152              
153             Tokens that begin with the B<:> character are I<expression attribute
154             values>, which are placeholders for the actual value at runtime.
155              
156             For more information on expression attribute names, see Accessing Item
157             Attributes in the I<Amazon DynamoDB Developer Guide>.
158              
159              
160              
161             =head2 ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>
162              
163             One or more values that can be substituted in an expression.
164              
165             Use the B<:> (colon) character in an expression to dereference an
166             attribute value. For example, suppose that you wanted to check whether
167             the value of the I<ProductStatus> attribute was one of the following:
168              
169             C<Available | Backordered | Discontinued>
170              
171             You would first need to specify C<ExpressionAttributeValues> as
172             follows:
173              
174             C<{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"},
175             ":disc":{"S":"Discontinued"} }>
176              
177             You could then use these values in an expression, such as this:
178              
179             C<ProductStatus IN (:avail, :back, :disc)>
180              
181             For more information on expression attribute values, see Specifying
182             Conditions in the I<Amazon DynamoDB Developer Guide>.
183              
184              
185              
186             =head2 B<REQUIRED> Item => L<Paws::DynamoDB::PutItemInputAttributeMap>
187              
188             A map of attribute name/value pairs, one for each attribute. Only the
189             primary key attributes are required; you can optionally provide other
190             attribute name-value pairs for the item.
191              
192             You must provide all of the attributes for the primary key. For
193             example, with a simple primary key, you only need to provide a value
194             for the partition key. For a composite primary key, you must provide
195             both values for both the partition key and the sort key.
196              
197             If you specify any attributes that are part of an index key, then the
198             data types for those attributes must match those of the schema in the
199             table's attribute definition.
200              
201             For more information about primary keys, see Primary Key in the
202             I<Amazon DynamoDB Developer Guide>.
203              
204             Each element in the C<Item> map is an C<AttributeValue> object.
205              
206              
207              
208             =head2 ReturnConsumedCapacity => Str
209              
210              
211              
212             Valid values are: C<"INDEXES">, C<"TOTAL">, C<"NONE">
213              
214             =head2 ReturnItemCollectionMetrics => Str
215              
216             Determines whether item collection metrics are returned. If set to
217             C<SIZE>, the response includes statistics about item collections, if
218             any, that were modified during the operation are returned in the
219             response. If set to C<NONE> (the default), no statistics are returned.
220              
221             Valid values are: C<"SIZE">, C<"NONE">
222              
223             =head2 ReturnValues => Str
224              
225             Use C<ReturnValues> if you want to get the item attributes as they
226             appeared before they were updated with the C<PutItem> request. For
227             C<PutItem>, the valid values are:
228              
229             =over
230              
231             =item *
232              
233             C<NONE> - If C<ReturnValues> is not specified, or if its value is
234             C<NONE>, then nothing is returned. (This setting is the default for
235             C<ReturnValues>.)
236              
237             =item *
238              
239             C<ALL_OLD> - If C<PutItem> overwrote an attribute name-value pair, then
240             the content of the old item is returned.
241              
242             =back
243              
244             The C<ReturnValues> parameter is used by several DynamoDB operations;
245             however, C<PutItem> does not recognize any values other than C<NONE> or
246             C<ALL_OLD>.
247              
248             Valid values are: C<"NONE">, C<"ALL_OLD">, C<"UPDATED_OLD">, C<"ALL_NEW">, C<"UPDATED_NEW">
249              
250             =head2 B<REQUIRED> TableName => Str
251              
252             The name of the table to contain the item.
253              
254              
255              
256              
257             =head1 SEE ALSO
258              
259             This class forms part of L<Paws>, documenting arguments for method PutItem in L<Paws::DynamoDB>
260              
261             =head1 BUGS and CONTRIBUTIONS
262              
263             The source code is located here: https://github.com/pplu/aws-sdk-perl
264              
265             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
266              
267             =cut
268