Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/*
3
 * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License").
6
 * You may not use this file except in compliance with the License.
7
 * A copy of the License is located at
8
 *
9
 *  http://aws.amazon.com/apache2.0
10
 *
11
 * or in the "license" file accompanying this file. This file is distributed
12
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
 * express or implied. See the License for the specific language governing
14
 * permissions and limitations under the License.
15
 */
16
 
17
/**
18
 * Amazon DynamoDB is a fast, highly scalable, highly available, cost-effective non-relational
19
 * database service.
20
 *
21
 * Amazon DynamoDB removes traditional scalability limitations on data storage while maintaining
22
 * low latency and predictable performance.
23
 *
24
 * @version 2012.01.16
25
 * @license See the included NOTICE.md file for complete information.
26
 * @copyright See the included NOTICE.md file for complete information.
27
 * @link http://aws.amazon.com/dynamodb/ Amazon DynamoDB
28
 * @link http://aws.amazon.com/dynamodb/documentation/ Amazon DynamoDB documentation
29
 */
30
class AmazonDynamoDB extends CFRuntime
31
{
32
	/*%******************************************************************************************%*/
33
	// CLASS CONSTANTS
34
 
35
	/**
36
	 * Specify the queue URL for the United States East (Northern Virginia) Region.
37
	 */
38
	const REGION_US_E1 = 'dynamodb.us-east-1.amazonaws.com';
39
 
40
	/**
41
	 * Specify the queue URL for the United States East (Northern Virginia) Region.
42
	 */
43
	const REGION_VIRGINIA = self::REGION_US_E1;
44
 
45
	/**
46
	 * Default service endpoint.
47
	 */
48
	const DEFAULT_URL = self::REGION_US_E1;
49
 
50
 
51
	/*%******************************************************************************************%*/
52
	// ACTION CONSTANTS
53
 
54
	/**
55
	 * Action: Add
56
	 */
57
	const ACTION_ADD = 'ADD';
58
 
59
	/**
60
	 * Action: Delete
61
	 */
62
	const ACTION_DELETE = 'DELETE';
63
 
64
	/**
65
	 * Action: Put
66
	 */
67
	const ACTION_PUT = 'PUT';
68
 
69
 
70
	/*%******************************************************************************************%*/
71
	// CONDITION CONSTANTS
72
 
73
	/**
74
	 * Condition operator: Equal To
75
	 */
76
	const CONDITION_EQUAL = 'EQ';
77
 
78
	/**
79
	 * Condition operator: Not Equal To
80
	 */
81
	const CONDITION_NOT_EQUAL = 'NE';
82
 
83
	/**
84
	 * Condition operator: Less Than
85
	 */
86
	const CONDITION_LESS_THAN = 'LT';
87
 
88
	/**
89
	 * Condition operator: Less Than or Equal To
90
	 */
91
	const CONDITION_LESS_THAN_OR_EQUAL = 'LE';
92
 
93
	/**
94
	 * Condition operator: Greater Than or Equal To
95
	 */
96
	const CONDITION_GREATER_THAN = 'GT';
97
 
98
	/**
99
	 * Condition operator: Greater Than or Equal To
100
	 */
101
	const CONDITION_GREATER_THAN_OR_EQUAL = 'GE';
102
 
103
	/**
104
	 * Condition operator: Null
105
	 */
106
	const CONDITION_NULL = 'NULL';
107
 
108
	/**
109
	 * Condition operator: Not Null
110
	 */
111
	const CONDITION_NOT_NULL = 'NOT_NULL';
112
 
113
	/**
114
	 * Condition operator: Contains
115
	 */
116
	const CONDITION_CONTAINS = 'CONTAINS';
117
 
118
	/**
119
	 * Condition operator: Doesn't Contain
120
	 */
121
	const CONDITION_DOESNT_CONTAIN = 'NOT_CONTAINS';
122
 
123
	/**
124
	 * Condition operator: In
125
	 */
126
	const CONDITION_IN = 'IN';
127
 
128
	/**
129
	 * Condition operator: Between
130
	 */
131
	const CONDITION_BETWEEN = 'BETWEEN';
132
 
133
	/**
134
	 * Condition operator: Begins With
135
	 */
136
	const CONDITION_BEGINS_WITH = 'BEGINS_WITH';
137
 
138
 
139
	/*%******************************************************************************************%*/
140
	// RETURN CONSTANTS
141
 
142
	/**
143
	 * Return value type: NONE
144
	 */
145
	const RETURN_NONE = 'NONE';
146
 
147
	/**
148
	 * Return value type: ALL_OLD
149
	 */
150
	const RETURN_ALL_OLD = 'ALL_OLD';
151
 
152
	/**
153
	 * Return value type: ALL_NEW
154
	 */
155
	const RETURN_ALL_NEW = 'ALL_NEW';
156
 
157
	/**
158
	 * Return value type: UPDATED_OLD
159
	 */
160
	const RETURN_UPDATED_OLD = 'UPDATED_OLD';
161
 
162
	/**
163
	 * Return value type: UPDATED_NEW
164
	 */
165
	const RETURN_UPDATED_NEW = 'UPDATED_NEW';
166
 
167
 
168
	/*%******************************************************************************************%*/
169
	// TYPE CONSTANTS
170
 
171
	/**
172
	 * Content type: string
173
	 */
174
	const TYPE_STRING = 'S';
175
 
176
	/**
177
	 * Content type: number
178
	 */
179
	const TYPE_NUMBER = 'N';
180
 
181
	/**
182
	 * Content type: array of strings
183
	 */
184
	const TYPE_ARRAY_OF_STRINGS = 'SS';
185
 
186
	/**
187
	 * Content type: array of strings
188
	 */
189
	const TYPE_ARRAY_OF_NUMBERS = 'NS';
190
 
191
 
192
	/*%******************************************************************************************%*/
193
	// CONSTRUCTOR
194
 
195
	/**
196
	 * Constructs a new instance of <AmazonDynamoDB>.
197
	 *
198
	 * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
199
	 * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
200
	 * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
201
	 * 	<li><code>default_cache_config</code> - <code>string</code> - Optional - This option allows a preferred storage type to be configured for long-term caching. This can be changed later using the <set_cache_config()> method. Valid values are: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
202
	 * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
203
	 * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
204
	 * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
205
	 * @return void
206
	 */
207
	public function __construct(array $options = array())
208
	{
209
		$this->api_version = '2011-12-05';
210
		$this->hostname = self::DEFAULT_URL;
211
		$this->auth_class = 'AuthV3JSON';
212
		$this->operation_prefix = 'x-amz-target:DynamoDB_20111205.';
213
 
214
		parent::__construct($options);
215
 
216
		// Default caching mechanism is required
217
		if (!$this->credentials->default_cache_config)
218
		{
219
			// @codeCoverageIgnoreStart
220
			throw new DynamoDB_Exception('The DynamoDB class requires the "default_cache_config" configuration to be set in the config.inc.php file.');
221
			// @codeCoverageIgnoreEnd
222
		}
223
 
224
		$token = new AmazonSTS($options);
225
		$token->set_cache_config($this->credentials->default_cache_config);
226
		$response = $token->cache(3600)->get_session_token();
227
 
228
		$this->key = (string) $response->body->GetSessionTokenResult->Credentials->AccessKeyId;
229
		$this->secret_key = (string) $response->body->GetSessionTokenResult->Credentials->SecretAccessKey;
230
		$this->auth_token = (string) $response->body->GetSessionTokenResult->Credentials->SessionToken;
231
	}
232
 
233
 
234
	/*%******************************************************************************************%*/
235
	// SETTERS
236
 
237
	/**
238
	 * This allows you to explicitly sets the region for the service to use.
239
	 *
240
	 * @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>.
241
	 * @return $this A reference to the current instance.
242
	 */
243
	public function set_region($region)
244
	{
245
		// @codeCoverageIgnoreStart
246
		$this->set_hostname($region);
247
		return $this;
248
		// @codeCoverageIgnoreEnd
249
	}
250
 
251
 
252
	/*%******************************************************************************************%*/
253
	// SERVICE METHODS
254
 
255
	/**
256
	 * Retrieves the attributes for multiple items from multiple tables using their primary keys.
257
	 *
258
	 * The maximum number of item attributes that can be retrieved for a single operation is 100.
259
	 * Also, the number of items retrieved is constrained by a 1 MB the size limit. If the response
260
	 * size limit is exceeded or a partial result is returned due to an internal processing failure,
261
	 * Amazon DynamoDB returns an <code>UnprocessedKeys</code> value so you can retry the operation
262
	 * starting with the next item to get.
263
	 *
264
	 * Amazon DynamoDB automatically adjusts the number of items returned per page to enforce this
265
	 * limit. For example, even if you ask to retrieve 100 items, but each individual item is 50k in
266
	 * size, the system returns 20 items and an appropriate <code>UnprocessedKeys</code> value so you
267
	 * can get the next page of results. If necessary, your application needs its own logic to
268
	 * assemble the pages of results into one set.
269
	 *
270
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
271
	 * 	<li><code>RequestItems</code> - <code>array</code> - Required - A map of the table name and corresponding items to get by primary key. While requesting items, each table name can be invoked only once per operation. <ul>
272
	 * 		<li><code>[table_name]</code> - <code>array</code> - Optional - The name of the table to use for the lookup. <ul>
273
	 * 			<li><code>Keys</code> - <code>array</code> - Required - <p>The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.</p> <ul>
274
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
275
	 * 					<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
276
	 * 						<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
277
	 * 							<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
278
	 * 							<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
279
	 * 							<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
280
	 * 							<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
281
	 * 						</ul></li>
282
	 * 					</ul></li>
283
	 * 					<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
284
	 * 						<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
285
	 * 							<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
286
	 * 							<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
287
	 * 							<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
288
	 * 							<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
289
	 * 						</ul></li>
290
	 * 					</ul></li>
291
	 * 				</ul></li>
292
	 * 			</ul></li>
293
	 * 			<li><code>AttributesToGet</code> - <code>string|array</code> - Optional - List of <code>Attribute</code> names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.</li>
294
	 * 		</ul></li>
295
	 * 	</ul></li>
296
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
297
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
298
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
299
	 */
300
	public function batch_get_item($opt = null)
301
	{
302
		if (!$opt) $opt = array();
303
 
304
		$opt = json_encode($opt);
305
		return $this->authenticate('BatchGetItem', $opt);
306
	}
307
 
308
	/**
309
	 * Adds a new table to your account.
310
	 *
311
	 * The table name must be unique among those associated with the AWS Account issuing the request,
312
	 * and the AWS Region that receives the request (e.g. <code>us-east-1</code>).
313
	 *
314
	 * The <code>CreateTable</code> operation triggers an asynchronous workflow to begin creating the
315
	 * table. Amazon DynamoDB immediately returns the state of the table (<code>CREATING</code>) until
316
	 * the table is in the <code>ACTIVE</code> state. Once the table is in the <code>ACTIVE</code>
317
	 * state, you can perform data plane operations.
318
	 *
319
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
320
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table you want to create. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
321
	 * 	<li><code>KeySchema</code> - <code>array</code> - Required - The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a <code>HashKeyElement</code>. A composite hash-and-range primary key contains two attribute values: a <code>HashKeyElement</code> and a <code>RangeKeyElement</code>. <ul>
322
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
323
	 * 			<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
324
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
325
	 * 					<li><code>AttributeName</code> - <code>string</code> - Required - The <code>AttributeName</code> of the <code>KeySchemaElement</code>.</li>
326
	 * 					<li><code>AttributeType</code> - <code>string</code> - Required - The <code>AttributeType</code> of the <code>KeySchemaElement</code> which can be a <code>String</code> or a <code>Number</code>. [Allowed values: <code>S</code>, <code>N</code>]</li>
327
	 * 				</ul></li>
328
	 * 			</ul></li>
329
	 * 			<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
330
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
331
	 * 					<li><code>AttributeName</code> - <code>string</code> - Required - The <code>AttributeName</code> of the <code>KeySchemaElement</code>.</li>
332
	 * 					<li><code>AttributeType</code> - <code>string</code> - Required - The <code>AttributeType</code> of the <code>KeySchemaElement</code> which can be a <code>String</code> or a <code>Number</code>. [Allowed values: <code>S</code>, <code>N</code>]</li>
333
	 * 				</ul></li>
334
	 * 			</ul></li>
335
	 * 		</ul></li>
336
	 * 	</ul></li>
337
	 * 	<li><code>ProvisionedThroughput</code> - <code>array</code> - Required - Provisioned throughput reserves the required read and write resources for your table in terms of <code>ReadCapacityUnits</code> and <code>WriteCapacityUnits</code>. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads. <ul>
338
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
339
	 * 			<li><code>ReadCapacityUnits</code> - <code>long</code> - Required - <code>ReadCapacityUnits</code> are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the <code>ReadCapacityUnits</code>. Eventually-consistent reads only require half the <code>ReadCapacityUnits</code> of stirctly consistent reads.</li>
340
	 * 			<li><code>WriteCapacityUnits</code> - <code>long</code> - Required - <code>WriteCapacityUnits</code> are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the <code>WriteCapacityUnits</code>.</li>
341
	 * 		</ul></li>
342
	 * 	</ul></li>
343
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
344
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
345
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
346
	 */
347
	public function create_table($opt = null)
348
	{
349
		if (!$opt) $opt = array();
350
 
351
		$opt = json_encode($opt);
352
		return $this->authenticate('CreateTable', $opt);
353
	}
354
 
355
	/**
356
	 * Deletes a single item in a table by primary key.
357
	 *
358
	 * You can perform a conditional delete operation that deletes the item if it exists, or if it has
359
	 * an expected attribute value.
360
	 *
361
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
362
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table in which you want to delete an item. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
363
	 * 	<li><code>Key</code> - <code>array</code> - Required - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key. <ul>
364
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
365
	 * 			<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
366
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
367
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
368
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
369
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
370
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
371
	 * 				</ul></li>
372
	 * 			</ul></li>
373
	 * 			<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
374
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
375
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
376
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
377
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
378
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
379
	 * 				</ul></li>
380
	 * 			</ul></li>
381
	 * 		</ul></li>
382
	 * 	</ul></li>
383
	 * 	<li><code>Expected</code> - <code>array</code> - Optional - Designates an attribute for a conditional modification. The <code>Expected</code> parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it. <ul>
384
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
385
	 * 			<li><code>key</code> - <code>string</code> - Optional - </li>
386
	 * 			<li><code>value</code> - <code>array</code> - Optional - Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it. <ul>
387
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
388
	 * 					<li><code>Value</code> - <code>array</code> - Optional - Specify whether or not a value already exists and has a specific content for the attribute name-value pair. <ul>
389
	 * 						<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
390
	 * 							<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
391
	 * 							<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
392
	 * 							<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
393
	 * 							<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
394
	 * 						</ul></li>
395
	 * 					</ul></li>
396
	 * 					<li><code>Exists</code> - <code>boolean</code> - Optional - Specify whether or not a value already exists for the attribute name-value pair.</li>
397
	 * 				</ul></li>
398
	 * 			</ul></li>
399
	 * 		</ul></li>
400
	 * 	</ul></li>
401
	 * 	<li><code>ReturnValues</code> - <code>string</code> - Optional - Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For <code>PUT</code> operations, the possible parameter values are <code>NONE</code> (default) or <code>ALL_OLD</code>. For update operations, the possible parameter values are <code>NONE</code> (default) or <code>ALL_OLD</code>, <code>UPDATED_OLD</code>, <code>ALL_NEW</code> or <code>UPDATED_NEW</code>.<ul><li> <code>NONE</code>: Nothing is returned.</li><li> <code>ALL_OLD</code>: Returns the attributes of the item as they were before the operation.</li><li> <code>UPDATED_OLD</code>: Returns the values of the updated attributes, only, as they were before the operation.</li><li> <code>ALL_NEW</code>: Returns all the attributes and their new values after the operation.</li><li> <code>UPDATED_NEW</code>: Returns the values of the updated attributes, only, as they are after the operation.</li></ul> [Allowed values: <code>NONE</code>, <code>ALL_OLD</code>, <code>UPDATED_OLD</code>, <code>ALL_NEW</code>, <code>UPDATED_NEW</code>]</li>
402
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
403
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
404
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
405
	 */
406
	public function delete_item($opt = null)
407
	{
408
		if (!$opt) $opt = array();
409
 
410
		$opt = json_encode($opt);
411
		return $this->authenticate('DeleteItem', $opt);
412
	}
413
 
414
	/**
415
	 * Deletes a table and all of its items.
416
	 *
417
	 * If the table is in the <code>ACTIVE</code> state, you can delete it. If a table is in
418
	 * <code>CREATING</code> or <code>UPDATING</code> states then <code>DeleteTable</code> returns a
419
	 * <code>ResourceInUseException</code>. If the specified table does not exist, Amazon DynamoDB
420
	 * returns a <code>ResourceNotFoundException</code>.
421
	 *
422
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
423
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table you want to delete. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
424
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
425
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
426
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
427
	 */
428
	public function delete_table($opt = null)
429
	{
430
		if (!$opt) $opt = array();
431
 
432
		$opt = json_encode($opt);
433
		return $this->authenticate('DeleteTable', $opt);
434
	}
435
 
436
	/**
437
	 * Retrieves information about the table, including the current status of the table, the primary
438
	 * key schema and when the table was created.
439
	 *
440
	 * If the table does not exist, the server returns a <code>ResourceNotFoundException</code>.
441
	 *
442
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
443
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table you want to describe. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
444
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
445
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
446
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
447
	 */
448
	public function describe_table($opt = null)
449
	{
450
		if (!$opt) $opt = array();
451
 
452
		$opt = json_encode($opt);
453
		return $this->authenticate('DescribeTable', $opt);
454
	}
455
 
456
	/**
457
	 * Retrieves a set of Attributes for an item that matches the primary key.
458
	 *
459
	 * The <code>GetItem</code> operation provides an eventually-consistent read by default. If
460
	 * eventually-consistent reads are not acceptable for your application, use
461
	 * <code>ConsistentRead</code>. Although this operation might take longer than a standard read, it
462
	 * always returns the last updated value.
463
	 *
464
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
465
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table in which you want to get an item. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
466
	 * 	<li><code>Key</code> - <code>array</code> - Required - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key. <ul>
467
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
468
	 * 			<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
469
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
470
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
471
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
472
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
473
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
474
	 * 				</ul></li>
475
	 * 			</ul></li>
476
	 * 			<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
477
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
478
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
479
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
480
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
481
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
482
	 * 				</ul></li>
483
	 * 			</ul></li>
484
	 * 		</ul></li>
485
	 * 	</ul></li>
486
	 * 	<li><code>AttributesToGet</code> - <code>string|array</code> - Optional - List of <code>Attribute</code> names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.</li>
487
	 * 	<li><code>ConsistentRead</code> - <code>boolean</code> - Optional - If set to <code>true</code>, then a consistent read is issued. Otherwise eventually-consistent is used.</li>
488
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
489
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
490
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
491
	 */
492
	public function get_item($opt = null)
493
	{
494
		if (!$opt) $opt = array();
495
 
496
		// List (non-map)
497
		if (isset($opt['AttributesToGet']))
498
		{
499
			$opt['AttributesToGet'] = (is_array($opt['AttributesToGet']) ? $opt['AttributesToGet'] : array($opt['AttributesToGet']));
500
		}
501
 
502
		$opt = json_encode($opt);
503
		return $this->authenticate('GetItem', $opt);
504
	}
505
 
506
	/**
507
	 * Retrieves a paginated list of table names created by the AWS Account of the caller in the AWS
508
	 * Region (e.g. <code>us-east-1</code>).
509
	 *
510
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
511
	 * 	<li><code>ExclusiveStartTableName</code> - <code>string</code> - Optional - The name of the table that starts the list. If you already ran a <code>ListTables</code> operation and received a <code>LastEvaluatedTableName</code> value in the response, use that value here to continue the list. [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
512
	 * 	<li><code>Limit</code> - <code>integer</code> - Optional - A number of maximum table names to return.</li>
513
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
514
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
515
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
516
	 */
517
	public function list_tables($opt = null)
518
	{
519
		if (!$opt) $opt = array();
520
 
521
		$opt = json_encode($opt);
522
		return $this->authenticate('ListTables', $opt);
523
	}
524
 
525
	/**
526
	 * Creates a new item, or replaces an old item with a new item (including all the attributes).
527
	 *
528
	 * If an item already exists in the specified table with the same primary key, the new item
529
	 * completely replaces the existing item. You can perform a conditional put (insert a new item if
530
	 * one with the specified primary key doesn't exist), or replace an existing item if it has
531
	 * certain attribute values.
532
	 *
533
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
534
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table in which you want to put an item. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
535
	 * 	<li><code>Item</code> - <code>array</code> - Required - A map of the attributes for the item, and must include the primary key values that define the item. Other attribute name-value pairs can be provided for the item. <ul>
536
	 * 		<li><code>[attribute_name]</code> - <code>array</code> - Optional - The name of the attribute to use for the lookup. <ul>
537
	 * 			<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
538
	 * 				<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
539
	 * 				<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
540
	 * 				<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
541
	 * 				<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
542
	 * 			</ul></li>
543
	 * 		</ul></li>
544
	 * 	</ul></li>
545
	 * 	<li><code>Expected</code> - <code>array</code> - Optional - Designates an attribute for a conditional modification. The <code>Expected</code> parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it. <ul>
546
	 * 		<li><code>[attribute_name]</code> - <code>array</code> - Optional - Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it. <ul>
547
	 * 			<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
548
	 * 				<li><code>Value</code> - <code>array</code> - Optional - Specify whether or not a value already exists and has a specific content for the attribute name-value pair. <ul>
549
	 * 					<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
550
	 * 						<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
551
	 * 						<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
552
	 * 						<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
553
	 * 						<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
554
	 * 					</ul></li>
555
	 * 				</ul></li>
556
	 * 				<li><code>Exists</code> - <code>boolean</code> - Optional - Specify whether or not a value already exists for the attribute name-value pair.</li>
557
	 * 			</ul></li>
558
	 * 		</ul></li>
559
	 * 	</ul></li>
560
	 * 	<li><code>ReturnValues</code> - <code>string</code> - Optional - Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For <code>PUT</code> operations, the possible parameter values are <code>NONE</code> (default) or <code>ALL_OLD</code>. For update operations, the possible parameter values are <code>NONE</code> (default) or <code>ALL_OLD</code>, <code>UPDATED_OLD</code>, <code>ALL_NEW</code> or <code>UPDATED_NEW</code>.<ul><li> <code>NONE</code>: Nothing is returned.</li><li> <code>ALL_OLD</code>: Returns the attributes of the item as they were before the operation.</li><li> <code>UPDATED_OLD</code>: Returns the values of the updated attributes, only, as they were before the operation.</li><li> <code>ALL_NEW</code>: Returns all the attributes and their new values after the operation.</li><li> <code>UPDATED_NEW</code>: Returns the values of the updated attributes, only, as they are after the operation.</li></ul> [Allowed values: <code>NONE</code>, <code>ALL_OLD</code>, <code>UPDATED_OLD</code>, <code>ALL_NEW</code>, <code>UPDATED_NEW</code>]</li>
561
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
562
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
563
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
564
	 */
565
	public function put_item($opt = null)
566
	{
567
		if (!$opt) $opt = array();
568
 
569
		$opt = json_encode($opt);
570
		return $this->authenticate('PutItem', $opt);
571
	}
572
 
573
	/**
574
	 * Gets the values of one or more items and its attributes by primary key (composite primary key,
575
	 * only).
576
	 *
577
	 * Narrow the scope of the query using comparison operators on the <code>RangeKeyValue</code> of
578
	 * the composite key. Use the <code>ScanIndexForward</code> parameter to get results in forward or
579
	 * reverse order by range key.
580
	 *
581
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
582
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table in which you want to query. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
583
	 * 	<li><code>AttributesToGet</code> - <code>string|array</code> - Optional - List of <code>Attribute</code> names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.</li>
584
	 * 	<li><code>Limit</code> - <code>integer</code> - Optional - The maximum number of items to return. If Amazon DynamoDB hits this limit while querying the table, it stops the query and returns the matching values up to the limit, and a <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the query. Also, if the result set size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the query and returns the matching values, and a <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the query.</li>
585
	 * 	<li><code>ConsistentRead</code> - <code>boolean</code> - Optional - If set to <code>true</code>, then a consistent read is issued. Otherwise eventually-consistent is used.</li>
586
	 * 	<li><code>Count</code> - <code>boolean</code> - Optional - If set to <code>true</code>, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. Do not set <code>Count</code> to true while providing a list of <code>AttributesToGet</code>, otherwise Amazon DynamoDB returns a validation error.</li>
587
	 * 	<li><code>HashKeyValue</code> - <code>array</code> - Required - Attribute value of the hash component of the composite primary key. <ul>
588
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
589
	 * 			<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
590
	 * 			<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
591
	 * 			<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
592
	 * 			<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
593
	 * 		</ul></li>
594
	 * 	</ul></li>
595
	 * 	<li><code>RangeKeyCondition</code> - <code>array</code> - Optional - A container for the attribute values and comparison operators to use for the query. <ul>
596
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
597
	 * 			<li><code>AttributeValueList</code> - <code>array</code> - Optional - A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a <code>BETWEEN</code> comparison, the AttributeValueList contains two attribute values and the comparison operator. <ul>
598
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
599
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
600
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
601
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
602
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
603
	 * 				</ul></li>
604
	 * 			</ul></li>
605
	 * 			<li><code>ComparisonOperator</code> - <code>string</code> - Required - A comparison operator is an enumeration of several operations:<ul><li> <code>EQ</code> for <em>equal</em> </li><li> <code>NE</code> for <em>not equal</em> </li><li> <code>IN</code> checks for exact matches</li><li> <code>LE</code> for <em>less than or equal to</em> </li><li> <code>LT</code> for <em>less than</em> </li><li> <code>GE</code> for <em>greater than or equal to</em> </li><li> <code>GT</code> for <em>greater than</em> </li><li> <code>BETWEEN</code> for <em>between</em> </li><li> <code>NOT_NULL</code> for <em>exists</em> </li><li> <code>NULL</code> for <em>not exists</em> </li><li> <code>CONTAINS</code> for substring or value in a set</li><li> <code>NOT_CONTAINS</code> for absence of a substring or absence of a value in a set</li><li> <code>BEGINS_WITH</code> for a substring prefix.</li></ul> [Allowed values: <code>EQ</code>, <code>NE</code>, <code>IN</code>, <code>LE</code>, <code>LT</code>, <code>GE</code>, <code>GT</code>, <code>BETWEEN</code>, <code>NOT_NULL</code>, <code>NULL</code>, <code>CONTAINS</code>, <code>NOT_CONTAINS</code>, <code>BEGINS_WITH</code>]</li>
606
	 * 		</ul></li>
607
	 * 	</ul></li>
608
	 * 	<li><code>ScanIndexForward</code> - <code>boolean</code> - Optional - Specifies forward or backward traversal of the index. Amazon DynamoDB returns results reflecting the requested order, determined by the range key. The default value is <code>true</code> (forward).</li>
609
	 * 	<li><code>ExclusiveStartKey</code> - <code>array</code> - Optional - Primary key of the item from which to continue an earlier query. An earlier query might provide this value as the <code>LastEvaluatedKey</code> if that query operation was interrupted before completing the query; either because of the result set size or the <code>Limit</code> parameter. The <code>LastEvaluatedKey</code> can be passed back in a new query request to continue the operation from that point. <ul>
610
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
611
	 * 			<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
612
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
613
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
614
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
615
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
616
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
617
	 * 				</ul></li>
618
	 * 			</ul></li>
619
	 * 			<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
620
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
621
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
622
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
623
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
624
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
625
	 * 				</ul></li>
626
	 * 			</ul></li>
627
	 * 		</ul></li>
628
	 * 	</ul></li>
629
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
630
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
631
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
632
	 */
633
	public function query($opt = null)
634
	{
635
		if (!$opt) $opt = array();
636
 
637
		// List (non-map)
638
		if (isset($opt['AttributesToGet']))
639
		{
640
			$opt['AttributesToGet'] = (is_array($opt['AttributesToGet']) ? $opt['AttributesToGet'] : array($opt['AttributesToGet']));
641
		}
642
 
643
		$opt = json_encode($opt);
644
		return $this->authenticate('Query', $opt);
645
	}
646
 
647
	/**
648
	 * Retrieves one or more items and its attributes by performing a full scan of a table.
649
	 *
650
	 * Limit the returned results by specifying a filter.
651
	 *
652
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
653
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table in which you want to scan. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
654
	 * 	<li><code>AttributesToGet</code> - <code>string|array</code> - Optional - List of <code>Attribute</code> names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.</li>
655
	 * 	<li><code>Limit</code> - <code>integer</code> - Optional - The maximum number of items to return. If Amazon DynamoDB hits this limit while scanning the table, it stops the scan and returns the matching values up to the limit, and a <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the scan. Also, if the scanned data set size exceeds 1 MB before Amazon DynamoDB hits this limit, it stops the scan and returns the matching values up to the limit, and a <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the scan.</li>
656
	 * 	<li><code>Count</code> - <code>boolean</code> - Optional - If set to true, Amazon DynamoDB returns a total number of items for the <code>Scan</code> operation, even if the operation has no matching items for the assigned filter. Do not set <code>Count</code> to true while providing a list of <code>AttributesToGet</code>, otherwise Amazon DynamoDB returns a validation error.</li>
657
	 * 	<li><code>ScanFilter</code> - <code>array</code> - Optional - Evaluates the scan results and returns only the desired values. <ul>
658
	 * 		<li><code>[attribute_name]</code> - <code>array</code> - Optional - The name of the attribute to use for the lookup. <ul>
659
	 * 			<li><code>AttributeValueList</code> - <code>array</code> - Optional - A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a <code>BETWEEN</code> comparison, the AttributeValueList contains two attribute values and the comparison operator. <ul>
660
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
661
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
662
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
663
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
664
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
665
	 * 				</ul></li>
666
	 * 			</ul></li>
667
	 * 			<li><code>ComparisonOperator</code> - <code>string</code> - Required - A comparison operator is an enumeration of several operations:<ul><li> <code>EQ</code> for <em>equal</em> </li><li> <code>NE</code> for <em>not equal</em> </li><li> <code>IN</code> checks for exact matches</li><li> <code>LE</code> for <em>less than or equal to</em> </li><li> <code>LT</code> for <em>less than</em> </li><li> <code>GE</code> for <em>greater than or equal to</em> </li><li> <code>GT</code> for <em>greater than</em> </li><li> <code>BETWEEN</code> for <em>between</em> </li><li> <code>NOT_NULL</code> for <em>exists</em> </li><li> <code>NULL</code> for <em>not exists</em> </li><li> <code>CONTAINS</code> for substring or value in a set</li><li> <code>NOT_CONTAINS</code> for absence of a substring or absence of a value in a set</li><li> <code>BEGINS_WITH</code> for a substring prefix.</li></ul> [Allowed values: <code>EQ</code>, <code>NE</code>, <code>IN</code>, <code>LE</code>, <code>LT</code>, <code>GE</code>, <code>GT</code>, <code>BETWEEN</code>, <code>NOT_NULL</code>, <code>NULL</code>, <code>CONTAINS</code>, <code>NOT_CONTAINS</code>, <code>BEGINS_WITH</code>]</li>
668
	 * 		</ul></li>
669
	 * 	</ul></li>
670
	 * 	<li><code>ExclusiveStartKey</code> - <code>array</code> - Optional - Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the <code>Limit</code> parameter. The <code>LastEvaluatedKey</code> can be passed back in a new scan request to continue the operation from that point. <ul>
671
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
672
	 * 			<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
673
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
674
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
675
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
676
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
677
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
678
	 * 				</ul></li>
679
	 * 			</ul></li>
680
	 * 			<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
681
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
682
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
683
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
684
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
685
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
686
	 * 				</ul></li>
687
	 * 			</ul></li>
688
	 * 		</ul></li>
689
	 * 	</ul></li>
690
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
691
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
692
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
693
	 */
694
	public function scan($opt = null)
695
	{
696
		if (!$opt) $opt = array();
697
 
698
		// List (non-map)
699
		if (isset($opt['AttributesToGet']))
700
		{
701
			$opt['AttributesToGet'] = (is_array($opt['AttributesToGet']) ? $opt['AttributesToGet'] : array($opt['AttributesToGet']));
702
		}
703
 
704
		$opt = json_encode($opt);
705
		return $this->authenticate('Scan', $opt);
706
	}
707
 
708
	/**
709
	 * Edits an existing item's attributes.
710
	 *
711
	 * You can perform a conditional update (insert a new attribute name-value pair if it doesn't
712
	 * exist, or replace an existing name-value pair if it has certain expected attribute values).
713
	 *
714
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
715
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table in which you want to update an item. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
716
	 * 	<li><code>Key</code> - <code>array</code> - Required - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key. <ul>
717
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
718
	 * 			<li><code>HashKeyElement</code> - <code>array</code> - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
719
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
720
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
721
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
722
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
723
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
724
	 * 				</ul></li>
725
	 * 			</ul></li>
726
	 * 			<li><code>RangeKeyElement</code> - <code>array</code> - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
727
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
728
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
729
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
730
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
731
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
732
	 * 				</ul></li>
733
	 * 			</ul></li>
734
	 * 		</ul></li>
735
	 * 	</ul></li>
736
	 * 	<li><code>AttributeUpdates</code> - <code>array</code> - Required - Map of attribute name to the new value and action for the update. The attribute names specify the attributes to modify, and cannot contain any primary key attributes. <ul>
737
	 * 		<li><code>[attribute_name]</code> - <code>array</code> - Optional - The name of the attribute to use for the lookup. <ul>
738
	 * 			<li><code>Action</code> - <code>string</code> - Optional - The type of action for an item update operation. Only use the add action for numbers or sets; the specified value is added to the existing value. If a set of values is specified, the values are added to the existing set. Adds the specified attribute. If the attribute exists, it is replaced by the new value. If no value is specified, this removes the attribute and its value. If a set of values is specified, then the values in the specified set are removed from the old set. [Allowed values: <code>ADD</code>, <code>PUT</code>, <code>DELETE</code>]</li>
739
	 * 			<li><code>Value</code> - <code>array</code> - Optional - AttributeValue can be <code>String</code>, <code>Number</code>, <code>StringSet</code>, <code>NumberSet</code>. <ul>
740
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
741
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
742
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
743
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
744
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
745
	 * 				</ul></li>
746
	 * 			</ul></li>
747
	 * 		</ul></li>
748
	 * 	</ul></li>
749
	 * 	<li><code>Expected</code> - <code>array</code> - Optional - Designates an attribute for a conditional modification. The <code>Expected</code> parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it. <ul>
750
	 * 		<li><code>[attribute_name]</code> - <code>array</code> - Optional - The name of the attribute to use for the lookup. <ul>
751
	 * 			<li><code>Value</code> - <code>array</code> - Optional - Specify whether or not a value already exists and has a specific content for the attribute name-value pair. <ul>
752
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
753
	 * 					<li><code>S</code> - <code>string</code> - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).</li>
754
	 * 					<li><code>N</code> - <code>string</code> - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.</li>
755
	 * 					<li><code>SS</code> - <code>string|array</code> - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.</li>
756
	 * 					<li><code>NS</code> - <code>string|array</code> - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.</li>
757
	 * 				</ul></li>
758
	 * 			</ul></li>
759
	 * 			<li><code>Exists</code> - <code>boolean</code> - Optional - Specify whether or not a value already exists for the attribute name-value pair.</li>
760
	 * 		</ul></li>
761
	 * 	</ul></li>
762
	 * 	<li><code>ReturnValues</code> - <code>string</code> - Optional - Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For <code>PUT</code> operations, the possible parameter values are <code>NONE</code> (default) or <code>ALL_OLD</code>. For update operations, the possible parameter values are <code>NONE</code> (default) or <code>ALL_OLD</code>, <code>UPDATED_OLD</code>, <code>ALL_NEW</code> or <code>UPDATED_NEW</code>.<ul><li> <code>NONE</code>: Nothing is returned.</li><li> <code>ALL_OLD</code>: Returns the attributes of the item as they were before the operation.</li><li> <code>UPDATED_OLD</code>: Returns the values of the updated attributes, only, as they were before the operation.</li><li> <code>ALL_NEW</code>: Returns all the attributes and their new values after the operation.</li><li> <code>UPDATED_NEW</code>: Returns the values of the updated attributes, only, as they are after the operation.</li></ul> [Allowed values: <code>NONE</code>, <code>ALL_OLD</code>, <code>UPDATED_OLD</code>, <code>ALL_NEW</code>, <code>UPDATED_NEW</code>]</li>
763
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
764
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
765
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
766
	 */
767
	public function update_item($opt = null)
768
	{
769
		if (!$opt) $opt = array();
770
 
771
		$opt = json_encode($opt);
772
		return $this->authenticate('UpdateItem', $opt);
773
	}
774
 
775
	/**
776
	 * Updates the provisioned throughput for the given table.
777
	 *
778
	 * Setting the throughput for a table helps you manage performance and is part of the Provisioned
779
	 * Capacity feature of Amazon DynamoDB.
780
	 *
781
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
782
	 * 	<li><code>TableName</code> - <code>string</code> - Required - The name of the table you want to update. Allowed characters are <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>_</code> (underscore), <code>-</code> (hyphen) and <code>.</code> (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: <code>[a-zA-Z0-9_.-]+</code>]</li>
783
	 * 	<li><code>ProvisionedThroughput</code> - <code>array</code> - Required - Provisioned throughput reserves the required read and write resources for your table in terms of <code>ReadCapacityUnits</code> and <code>WriteCapacityUnits</code>. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads. <ul>
784
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
785
	 * 			<li><code>ReadCapacityUnits</code> - <code>long</code> - Required - <code>ReadCapacityUnits</code> are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the <code>ReadCapacityUnits</code>. Eventually-consistent reads only require half the <code>ReadCapacityUnits</code> of stirctly consistent reads.</li>
786
	 * 			<li><code>WriteCapacityUnits</code> - <code>long</code> - Required - <code>WriteCapacityUnits</code> are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the <code>WriteCapacityUnits</code>.</li>
787
	 * 		</ul></li>
788
	 * 	</ul></li>
789
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
790
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
791
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
792
	 */
793
	public function update_table($opt = null)
794
	{
795
		if (!$opt) $opt = array();
796
 
797
		$opt = json_encode($opt);
798
		return $this->authenticate('UpdateTable', $opt);
799
	}
800
}
801
 
802
 
803
/*%******************************************************************************************%*/
804
// EXCEPTIONS
805
 
806
class DynamoDB_Exception extends Exception {}