| 1 | |||
| 2 | package Paws::DynamoDB::GetItem; | ||
| 3 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | has AttributesToGet => (is => 'ro', isa => 'ArrayRef[Str|Undef]'); | |
| 5 | 2 | has ConsistentRead => (is => 'ro', isa => 'Bool'); | |
| 6 | 2 | has ExpressionAttributeNames => (is => 'ro', isa => 'Paws::DynamoDB::ExpressionAttributeNameMap'); | |
| 7 | 2 | has Key => (is => 'ro', isa => 'Paws::DynamoDB::Key', required => 1); | |
| 8 | 2 | has ProjectionExpression => (is => 'ro', isa => 'Str'); | |
| 9 | 2 | has ReturnConsumedCapacity => (is => 'ro', isa => 'Str'); | |
| 10 | 2 | has TableName => (is => 'ro', isa => 'Str', required => 1); | |
| 11 | |||
| 12 | 2 | ▶ | use MooseX::ClassAttribute; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 2 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetItem'); | |
| 15 | 2 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::DynamoDB::GetItemOutput'); | |
| 16 | 2 | class_has _result_key => (isa => 'Str', is => 'ro'); | |
| 17 | 2 | 1; | |
| 18 | |||
| 19 | ### main pod documentation begin ### | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Paws::DynamoDB::GetItem - Arguments for method GetItem on L<Paws::DynamoDB> | ||
| 24 | |||
| 25 | =head1 DESCRIPTION | ||
| 26 | |||
| 27 | This class represents the parameters used for calling the method GetItem on the | ||
| 28 | L<Amazon DynamoDB|Paws::DynamoDB> service. Use the attributes of this class | ||
| 29 | as arguments to method GetItem. | ||
| 30 | |||
| 31 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetItem. | ||
| 32 | |||
| 33 | =head1 SYNOPSIS | ||
| 34 | |||
| 35 | my $dynamodb = Paws->service('DynamoDB'); | ||
| 36 | # To read an item from a table | ||
| 37 | # This example retrieves an item from the Music table. The table has a partition | ||
| 38 | # key and a sort key (Artist and SongTitle), so you must specify both of these | ||
| 39 | # attributes. | ||
| 40 | my $GetItemOutput = $dynamodb->GetItem( | ||
| 41 | 'Key' => { | ||
| 42 | 'Artist' => { | ||
| 43 | 'S' => 'Acme Band' | ||
| 44 | }, | ||
| 45 | 'SongTitle' => { | ||
| 46 | 'S' => 'Happy Day' | ||
| 47 | } | ||
| 48 | }, | ||
| 49 | 'TableName' => 'Music' | ||
| 50 | ); | ||
| 51 | |||
| 52 | # Results: | ||
| 53 | my $Item = $GetItemOutput->Item; | ||
| 54 | |||
| 55 | # Returns a L<Paws::DynamoDB::GetItemOutput> object. | ||
| 56 | |||
| 57 | 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. | ||
| 58 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/dynamodb/GetItem> | ||
| 59 | |||
| 60 | =head1 ATTRIBUTES | ||
| 61 | |||
| 62 | |||
| 63 | =head2 AttributesToGet => ArrayRef[Str|Undef] | ||
| 64 | |||
| 65 | This is a legacy parameter. Use C<ProjectionExpression> instead. For | ||
| 66 | more information, see AttributesToGet | ||
| 67 | (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) | ||
| 68 | in the I<Amazon DynamoDB Developer Guide>. | ||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | =head2 ConsistentRead => Bool | ||
| 73 | |||
| 74 | Determines the read consistency model: If set to C<true>, then the | ||
| 75 | operation uses strongly consistent reads; otherwise, the operation uses | ||
| 76 | eventually consistent reads. | ||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | =head2 ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap> | ||
| 81 | |||
| 82 | One or more substitution tokens for attribute names in an expression. | ||
| 83 | The following are some use cases for using C<ExpressionAttributeNames>: | ||
| 84 | |||
| 85 | =over | ||
| 86 | |||
| 87 | =item * | ||
| 88 | |||
| 89 | To access an attribute whose name conflicts with a DynamoDB reserved | ||
| 90 | word. | ||
| 91 | |||
| 92 | =item * | ||
| 93 | |||
| 94 | To create a placeholder for repeating occurrences of an attribute name | ||
| 95 | in an expression. | ||
| 96 | |||
| 97 | =item * | ||
| 98 | |||
| 99 | To prevent special characters in an attribute name from being | ||
| 100 | misinterpreted in an expression. | ||
| 101 | |||
| 102 | =back | ||
| 103 | |||
| 104 | Use the B<#> character in an expression to dereference an attribute | ||
| 105 | name. For example, consider the following attribute name: | ||
| 106 | |||
| 107 | =over | ||
| 108 | |||
| 109 | =item * | ||
| 110 | |||
| 111 | C<Percentile> | ||
| 112 | |||
| 113 | =back | ||
| 114 | |||
| 115 | The name of this attribute conflicts with a reserved word, so it cannot | ||
| 116 | be used directly in an expression. (For the complete list of reserved | ||
| 117 | words, see Reserved Words | ||
| 118 | (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) | ||
| 119 | in the I<Amazon DynamoDB Developer Guide>). To work around this, you | ||
| 120 | could specify the following for C<ExpressionAttributeNames>: | ||
| 121 | |||
| 122 | =over | ||
| 123 | |||
| 124 | =item * | ||
| 125 | |||
| 126 | C<{"#P":"Percentile"}> | ||
| 127 | |||
| 128 | =back | ||
| 129 | |||
| 130 | You could then use this substitution in an expression, as in this | ||
| 131 | example: | ||
| 132 | |||
| 133 | =over | ||
| 134 | |||
| 135 | =item * | ||
| 136 | |||
| 137 | C<#P = :val> | ||
| 138 | |||
| 139 | =back | ||
| 140 | |||
| 141 | Tokens that begin with the B<:> character are I<expression attribute | ||
| 142 | values>, which are placeholders for the actual value at runtime. | ||
| 143 | |||
| 144 | For more information on expression attribute names, see Specifying Item | ||
| 145 | Attributes | ||
| 146 | (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) | ||
| 147 | in the I<Amazon DynamoDB Developer Guide>. | ||
| 148 | |||
| 149 | |||
| 150 | |||
| 151 | =head2 B<REQUIRED> Key => L<Paws::DynamoDB::Key> | ||
| 152 | |||
| 153 | A map of attribute names to C<AttributeValue> objects, representing the | ||
| 154 | primary key of the item to retrieve. | ||
| 155 | |||
| 156 | For the primary key, you must provide all of the attributes. For | ||
| 157 | example, with a simple primary key, you only need to provide a value | ||
| 158 | for the partition key. For a composite primary key, you must provide | ||
| 159 | values for both the partition key and the sort key. | ||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | =head2 ProjectionExpression => Str | ||
| 164 | |||
| 165 | A string that identifies one or more attributes to retrieve from the | ||
| 166 | table. These attributes can include scalars, sets, or elements of a | ||
| 167 | JSON document. The attributes in the expression must be separated by | ||
| 168 | commas. | ||
| 169 | |||
| 170 | If no attribute names are specified, then all attributes are returned. | ||
| 171 | If any of the requested attributes are not found, they do not appear in | ||
| 172 | the result. | ||
| 173 | |||
| 174 | For more information, see Specifying Item Attributes | ||
| 175 | (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) | ||
| 176 | in the I<Amazon DynamoDB Developer Guide>. | ||
| 177 | |||
| 178 | |||
| 179 | |||
| 180 | =head2 ReturnConsumedCapacity => Str | ||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | Valid values are: C<"INDEXES">, C<"TOTAL">, C<"NONE"> | ||
| 185 | |||
| 186 | =head2 B<REQUIRED> TableName => Str | ||
| 187 | |||
| 188 | The name of the table containing the requested item. | ||
| 189 | |||
| 190 | |||
| 191 | |||
| 192 | |||
| 193 | =head1 SEE ALSO | ||
| 194 | |||
| 195 | This class forms part of L<Paws>, documenting arguments for method GetItem in L<Paws::DynamoDB> | ||
| 196 | |||
| 197 | =head1 BUGS and CONTRIBUTIONS | ||
| 198 | |||
| 199 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 200 | |||
| 201 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 202 | |||
| 203 | =cut | ||
| 204 | |||