/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
using System;
using System.Collections.Generic;
using Amazon.DynamoDBv2.DocumentModel;
using Amazon.DynamoDBv2.Model;
namespace Amazon.DynamoDBv2.DataModel
{
///
/// Context interface for using the DataModel mode of DynamoDB.
/// Used to interact with the service, save/load objects, etc.
///
public partial interface IDynamoDBContext
{
#region Save async
///
/// Initiates the asynchronous execution of the Save operation.
///
///
/// Type to save as.
/// Object to save.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSave
/// operation.
IAsyncResult BeginSave(T value, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Save operation.
///
///
/// Type to save as.
/// Object to save.
/// Overriding configuration.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSave
/// operation.
IAsyncResult BeginSave(T value, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the Save operation.
///
///
/// The IAsyncResult returned by the call to BeginSave.
void EndSave(IAsyncResult asyncResult);
#endregion
#region Load async
///
/// Initiates the asynchronous execution of the Load operation.
///
///
/// Type to populate.
/// Hash key element of the target item.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndLoad
/// operation.
IAsyncResult BeginLoad(object hashKey, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Load operation.
///
///
/// Type to populate.
/// Hash key element of the target item.
/// Range key element of the target item.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndLoad
/// operation.
IAsyncResult BeginLoad(object hashKey, object rangeKey, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Load operation.
///
///
/// Type to populate.
/// Hash key element of the target item.
/// Overriding configuration.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndLoad
/// operation.
IAsyncResult BeginLoad(object hashKey, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Load operation.
///
///
/// Type to populate.
/// Hash key element of the target item.
/// Range key element of the target item.
/// Overriding configuration.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndLoad
/// operation.
IAsyncResult BeginLoad(object hashKey, object rangeKey, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Load operation.
///
///
/// Type to populate.
/// Key of the target item.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndLoad
/// operation.
IAsyncResult BeginLoad(T keyObject, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Load operation.
///
///
/// Type to populate.
/// Key of the target item.
/// Overriding configuration.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndLoad
/// operation.
IAsyncResult BeginLoad(T keyObject, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the Load operation.
///
///
/// The IAsyncResult returned by the call to BeginLoad.
///
/// Object of type T, populated with properties of item loaded from DynamoDB.
///
T EndLoad(IAsyncResult asyncResult);
#endregion
#region Delete async
///
/// Initiates the asynchronous execution of the Delete operation.
///
///
/// Type of object.
/// Object to delete.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginDelete(T value, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Delete operation.
///
///
/// Type of object.
/// Object to delete.
/// Overriding configuration.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginDelete(T value, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Delete operation.
///
///
/// Type of object.
/// Hash key element of the object to delete.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginDelete(object hashKey, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Delete operation.
///
///
/// Type of object.
/// Hash key element of the object to delete.
/// Config object which can be used to override that table used.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginDelete(object hashKey, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Delete operation.
///
///
/// Type of object.
/// Hash key element of the object to delete.
/// Range key element of the object to delete.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginDelete(object hashKey, object rangeKey, AsyncCallback callback, object state);
///
/// Initiates the asynchronous execution of the Delete operation.
///
///
/// Type of object.
/// Hash key element of the object to delete.
/// Range key element of the object to delete.
/// Config object which can be used to override that table used.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginDelete(object hashKey, object rangeKey, DynamoDBOperationConfig operationConfig, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the Delete operation.
///
///
/// The IAsyncResult returned by the call to BeginDelete.
void EndDelete(IAsyncResult asyncResult);
#endregion
#region BatchGet async
///
/// Issues a batch-get request with multiple batches.
///
/// Results are stored in the individual batches.
///
/// Configured BatchGet objects
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteBatchGet
/// operation.
IAsyncResult BeginExecuteBatchGet(BatchGet[] batches, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the ExecuteBatchGet operation.
///
///
/// The IAsyncResult returned by the call to BeginExecuteBatchGet.
void EndExecuteBatchGet(IAsyncResult asyncResult);
#endregion
#region BatchWrite async
///
/// Issues a batch-write request with multiple batches.
///
/// Configured BatchWrite objects
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
IAsyncResult BeginExecuteBatchWrite(BatchWrite[] batches, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the ExecuteBatchWrite operation.
///
///
/// The IAsyncResult returned by the call to BeginExecuteBatchWrite.
void EndExecuteBatchWrite(IAsyncResult asyncResult);
#endregion
#region TransactGet async
///
/// Issues a transactional get request with multiple TransactGet objects.
/// Results are stored in the individual TransactGet objects.
///
/// Configured TransactGet objects.
/// An AsyncCallback delegate that is invoked when the operation completes.
///
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteBatchGet
/// operation.
///
IAsyncResult BeginExecuteTransactGet(TransactGet[] transactionParts, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the ExecuteTransactGet operation.
///
///
/// The IAsyncResult returned by the call to BeginExecuteTransactGet.
void EndExecuteTransactGet(IAsyncResult asyncResult);
#endregion
#region TransactWrite async
///
/// Issues a transactional write request with multiple TransactWrite objects.
///
/// Configured TransactWrite objects.
/// An AsyncCallback delegate that is invoked when the operation completes.
///
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDelete
/// operation.
///
IAsyncResult BeginExecuteTransactWrite(TransactWrite[] transactionParts, AsyncCallback callback, object state);
///
/// Finishes the asynchronous execution of the ExecuteTransactWrite operation.
///
///
/// The IAsyncResult returned by the call to BeginExecuteTransactWrite.
void EndExecuteTransactWrite(IAsyncResult asyncResult);
#endregion
#region Scan async
///
/// Configures an async Scan operation against DynamoDB, finding items
/// that match the specified conditions.
///
/// Type of object.
///
/// Conditions that the results should meet.
///
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch ScanAsync(params ScanCondition[] conditions);
///
/// Configures an async Scan operation against DynamoDB, finding items
/// that match the specified conditions.
///
/// Type of object.
///
/// Conditions that the results should meet.
///
/// Config object which can be used to override that table used.
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch ScanAsync(IEnumerable conditions, DynamoDBOperationConfig operationConfig);
///
/// Configures an async Scan operation against DynamoDB, finding items
/// that match the specified conditions.
///
/// Type of object.
/// Scan request object.
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch FromScanAsync(ScanOperationConfig scanConfig);
///
/// Configures an async Scan operation against DynamoDB, finding items
/// that match the specified conditions.
///
/// Type of object.
/// Scan request object.
/// Config object which can be used to override the table used.
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch FromScanAsync(ScanOperationConfig scanConfig, DynamoDBOperationConfig operationConfig);
#endregion
#region Query async
///
/// Configures an async Query operation against DynamoDB, finding items
/// that match the specified hash primary key.
///
/// Type of object.
/// Hash key of the items to query.
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch QueryAsync(object hashKeyValue);
///
/// Configures an async Query operation against DynamoDB, finding items
/// that match the specified hash primary key.
///
/// Type of object.
/// Hash key of the items to query.
/// Config object which can be used to override the table used.
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch QueryAsync(object hashKeyValue, DynamoDBOperationConfig operationConfig);
///
/// Configures an async Query operation against DynamoDB, finding items
/// that match the specified range element condition for a hash-and-range primary key.
///
/// Type of object.
/// Hash key of the items to query.
/// Operation of the condition.
///
/// Value(s) of the condition.
/// For all operations except QueryOperator.Between, values should be one value.
/// For QueryOperator.Between, values should be two values.
///
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch QueryAsync(object hashKeyValue, QueryOperator op, params object[] values);
///
/// Configures an async Query operation against DynamoDB, finding items
/// that match the specified range element condition for a hash-and-range primary key.
///
/// Type of object.
/// Hash key of the items to query.
/// Operation of the condition.
///
/// Value(s) of the condition.
/// For all operations except QueryOperator.Between, values should be one value.
/// For QueryOperator.Between, values should be two values.
///
/// Config object which can be used to override the table used.
/// AsyncSearch which can be used to retrieve DynamoDB data.
AsyncSearch QueryAsync(object hashKeyValue, QueryOperator op, IEnumerable