« blib/lib/Paws/DynamoDB/BatchGetResponseMap.pm
↑ Summary
blib/lib/Paws/DynamoDB/BatchWriteItemRequestMap.pm »
| 1 | |||
| 2 | package Paws::DynamoDB::BatchWriteItem; | ||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | has RequestItems => (is => 'ro', isa => 'Paws::DynamoDB::BatchWriteItemRequestMap', required => 1); | |
| 5 | 1 | has ReturnConsumedCapacity => (is => 'ro', isa => 'Str'); | |
| 6 | 1 | has ReturnItemCollectionMetrics => (is => 'ro', isa => 'Str'); | |
| 7 | |||
| 8 | 1 | ▶ | use MooseX::ClassAttribute; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'BatchWriteItem'); | |
| 11 | 1 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::DynamoDB::BatchWriteItemOutput'); | |
| 12 | 1 | class_has _result_key => (isa => 'Str', is => 'ro'); | |
| 13 | 1 | 1; | |
| 14 | |||
| 15 | ### main pod documentation begin ### | ||
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | Paws::DynamoDB::BatchWriteItem - Arguments for method BatchWriteItem on L<Paws::DynamoDB> | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | This class represents the parameters used for calling the method BatchWriteItem on the | ||
| 24 | L<Amazon DynamoDB|Paws::DynamoDB> service. Use the attributes of this class | ||
| 25 | as arguments to method BatchWriteItem. | ||
| 26 | |||
| 27 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to BatchWriteItem. | ||
| 28 | |||
| 29 | =head1 SYNOPSIS | ||
| 30 | |||
| 31 | my $dynamodb = Paws->service('DynamoDB'); | ||
| 32 | # To add multiple items to a table | ||
| 33 | # This example adds three new items to the Music table using a batch of three | ||
| 34 | # PutItem requests. | ||
| 35 | my $BatchWriteItemOutput = $dynamodb->BatchWriteItem( | ||
| 36 | 'RequestItems' => { | ||
| 37 | 'Music' => [ | ||
| 38 | |||
| 39 | { | ||
| 40 | 'PutRequest' => { | ||
| 41 | 'Item' => { | ||
| 42 | 'AlbumTitle' => { | ||
| 43 | 'S' => 'Somewhat Famous' | ||
| 44 | }, | ||
| 45 | 'Artist' => { | ||
| 46 | 'S' => 'No One You Know' | ||
| 47 | }, | ||
| 48 | 'SongTitle' => { | ||
| 49 | 'S' => 'Call Me Today' | ||
| 50 | } | ||
| 51 | } | ||
| 52 | } | ||
| 53 | }, | ||
| 54 | |||
| 55 | { | ||
| 56 | 'PutRequest' => { | ||
| 57 | 'Item' => { | ||
| 58 | 'AlbumTitle' => { | ||
| 59 | 'S' => 'Songs About Life' | ||
| 60 | }, | ||
| 61 | 'Artist' => { | ||
| 62 | 'S' => 'Acme Band' | ||
| 63 | }, | ||
| 64 | 'SongTitle' => { | ||
| 65 | 'S' => 'Happy Day' | ||
| 66 | } | ||
| 67 | } | ||
| 68 | } | ||
| 69 | }, | ||
| 70 | |||
| 71 | { | ||
| 72 | 'PutRequest' => { | ||
| 73 | 'Item' => { | ||
| 74 | 'AlbumTitle' => { | ||
| 75 | 'S' => 'Blue Sky Blues' | ||
| 76 | }, | ||
| 77 | 'Artist' => { | ||
| 78 | 'S' => 'No One You Know' | ||
| 79 | }, | ||
| 80 | 'SongTitle' => { | ||
| 81 | 'S' => 'Scared of My Shadow' | ||
| 82 | } | ||
| 83 | } | ||
| 84 | } | ||
| 85 | } | ||
| 86 | ] | ||
| 87 | } | ||
| 88 | ); | ||
| 89 | |||
| 90 | |||
| 91 | 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. | ||
| 92 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/dynamodb/BatchWriteItem> | ||
| 93 | |||
| 94 | =head1 ATTRIBUTES | ||
| 95 | |||
| 96 | |||
| 97 | =head2 B<REQUIRED> RequestItems => L<Paws::DynamoDB::BatchWriteItemRequestMap> | ||
| 98 | |||
| 99 | A map of one or more table names and, for each table, a list of | ||
| 100 | operations to be performed (C<DeleteRequest> or C<PutRequest>). Each | ||
| 101 | element in the map consists of the following: | ||
| 102 | |||
| 103 | =over | ||
| 104 | |||
| 105 | =item * | ||
| 106 | |||
| 107 | C<DeleteRequest> - Perform a C<DeleteItem> operation on the specified | ||
| 108 | item. The item to be deleted is identified by a C<Key> subelement: | ||
| 109 | |||
| 110 | =over | ||
| 111 | |||
| 112 | =item * | ||
| 113 | |||
| 114 | C<Key> - A map of primary key attribute values that uniquely identify | ||
| 115 | the item. Each entry in this map consists of an attribute name and an | ||
| 116 | attribute value. For each primary key, you must provide I<all> of the | ||
| 117 | key attributes. For example, with a simple primary key, you only need | ||
| 118 | to provide a value for the partition key. For a composite primary key, | ||
| 119 | you must provide values for I<both> the partition key and the sort key. | ||
| 120 | |||
| 121 | =back | ||
| 122 | |||
| 123 | =item * | ||
| 124 | |||
| 125 | C<PutRequest> - Perform a C<PutItem> operation on the specified item. | ||
| 126 | The item to be put is identified by an C<Item> subelement: | ||
| 127 | |||
| 128 | =over | ||
| 129 | |||
| 130 | =item * | ||
| 131 | |||
| 132 | C<Item> - A map of attributes and their values. Each entry in this map | ||
| 133 | consists of an attribute name and an attribute value. Attribute values | ||
| 134 | must not be null; string and binary type attributes must have lengths | ||
| 135 | greater than zero; and set type attributes must not be empty. Requests | ||
| 136 | that contain empty values are rejected with a C<ValidationException> | ||
| 137 | exception. | ||
| 138 | |||
| 139 | If you specify any attributes that are part of an index key, then the | ||
| 140 | data types for those attributes must match those of the schema in the | ||
| 141 | table's attribute definition. | ||
| 142 | |||
| 143 | =back | ||
| 144 | |||
| 145 | =back | ||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 | |||
| 150 | =head2 ReturnConsumedCapacity => Str | ||
| 151 | |||
| 152 | |||
| 153 | |||
| 154 | Valid values are: C<"INDEXES">, C<"TOTAL">, C<"NONE"> | ||
| 155 | |||
| 156 | =head2 ReturnItemCollectionMetrics => Str | ||
| 157 | |||
| 158 | Determines whether item collection metrics are returned. If set to | ||
| 159 | C<SIZE>, the response includes statistics about item collections, if | ||
| 160 | any, that were modified during the operation are returned in the | ||
| 161 | response. If set to C<NONE> (the default), no statistics are returned. | ||
| 162 | |||
| 163 | Valid values are: C<"SIZE">, C<"NONE"> | ||
| 164 | |||
| 165 | |||
| 166 | =head1 SEE ALSO | ||
| 167 | |||
| 168 | This class forms part of L<Paws>, documenting arguments for method BatchWriteItem in L<Paws::DynamoDB> | ||
| 169 | |||
| 170 | =head1 BUGS and CONTRIBUTIONS | ||
| 171 | |||
| 172 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 173 | |||
| 174 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 175 | |||
| 176 | =cut | ||
| 177 | |||