internal BatchGetItemResponse BatchGetItem(BatchGetItemRequest request) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; return(Invoke <BatchGetItemRequest, BatchGetItemResponse>(request, marshaller, unmarshaller)); }
public void BatchGetItemMarshallTest() { var request = InstantiateClassGenerator.Execute <BatchGetItemRequest>(); var marshaller = new BatchGetItemRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <BatchGetItemRequest>(request, jsonRequest); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("BatchGetItem").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetItemResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetItemResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// <para>The <i>BatchGetItem</i> operation returns the attributes of one or more items from one or more tables. You identify requested items by /// primary key.</para> <para>A single operation can retrieve up to 1 MB of data, which can contain as many as 100 items. <i>BatchGetItem</i> /// will return a partial result if the response size limit is exceeded, the table's provisioned throughput is exceeded, or an internal /// processing failure occurs. If a partial result is returned, the operation returns a value for <i>UnprocessedKeys</i> . You can use this /// value to retry the operation starting with the next item to get.</para> <para>For example, if you ask to retrieve 100 items, but each /// individual item is 50 KB in size, the system returns 20 items (1 MB) and an appropriate <i>UnprocessedKeys</i> value so you can get the next /// page of results. If desired, your application can include its own logic to assemble the pages of results into one dataset.</para> <para>If /// no items can be processed because of insufficient provisioned throughput on each of the tables involved in the request, <i>BatchGetItem</i> /// throws <i>ProvisionedThroughputExceededException</i> . </para> <para>By default, <i>BatchGetItem</i> performs eventually consistent reads on /// every table in the request. If you want strongly consistent reads instead, you can set <i>ConsistentRead</i> to <c>true</c> for any or all /// tables.</para> <para>In order to minimize response latency, <i>BatchGetItem</i> retrieves items in parallel.</para> <para>When designing /// your application, keep in mind that DynamoDB does not return attributes in any particular order. To help parse the response by item, include /// the primary key values for the items in your request in the <i>AttributesToGet</i> parameter.</para> <para>If a requested item does not /// exist, it is not returned in the result. Requests for nonexistent items consume the minimum read capacity units according to the type of /// read. For more information, see <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithDDTables.html#CapacityUnitCalculations">Capacity Units /// Calculations</a> in the Amazon DynamoDB Developer Guide.</para> /// </summary> /// /// <param name="batchGetItemRequest">Container for the necessary parameters to execute the BatchGetItem service method on /// AmazonDynamoDBv2.</param> /// /// <returns>The response from the BatchGetItem service method, as returned by AmazonDynamoDBv2.</returns> /// /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.ProvisionedThroughputExceededException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.InternalServerErrorException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task <BatchGetItemResponse> BatchGetItemAsync(BatchGetItemRequest batchGetItemRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, BatchGetItemRequest, BatchGetItemResponse>(batchGetItemRequest, marshaller, unmarshaller, signer, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the BatchGetItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the BatchGetItem operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <BatchGetItemResponse> BatchGetItemAsync(BatchGetItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; return(InvokeAsync <BatchGetItemRequest, BatchGetItemResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the BatchGetItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// <param name="request">Container for the necessary parameters to execute the BatchGetItem operation.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// <returns>void</returns> public void BatchGetItemAsync(BatchGetItemRequest request, AmazonServiceCallback callback, object state) { if (!AmazonInitializer.IsInitialized) { throw new Exception("AWSPrefab is not added to the scene"); } ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; Invoke(request, callback, state, marshaller, unmarshaller, signer); })); return; }
public void BatchGetItemMarshallTest() { var request = InstantiateClassGenerator.Execute<BatchGetItemRequest>(); var marshaller = new BatchGetItemRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<BatchGetItemRequest>(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("BatchGetItem").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetItemResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetItemResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the BatchGetItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the BatchGetItem operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<BatchGetItemResponse> BatchGetItemAsync(BatchGetItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; return InvokeAsync<BatchGetItemRequest,BatchGetItemResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal BatchGetItemResponse BatchGetItem(BatchGetItemRequest request) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; return Invoke<BatchGetItemRequest,BatchGetItemResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeBatchGetItem(BatchGetItemRequest batchGetItemRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new BatchGetItemRequestMarshaller().Marshall(batchGetItemRequest); var unmarshaller = BatchGetItemResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>The <i>BatchGetItem</i> operation returns the attributes of one or more items from one or more tables. You identify requested items by /// primary key.</para> <para>A single operation can retrieve up to 1 MB of data, which can contain as many as 100 items. <i>BatchGetItem</i> /// will return a partial result if the response size limit is exceeded, the table's provisioned throughput is exceeded, or an internal /// processing failure occurs. If a partial result is returned, the operation returns a value for <i>UnprocessedKeys</i> . You can use this /// value to retry the operation starting with the next item to get.</para> <para>For example, if you ask to retrieve 100 items, but each /// individual item is 50 KB in size, the system returns 20 items (1 MB) and an appropriate <i>UnprocessedKeys</i> value so you can get the next /// page of results. If desired, your application can include its own logic to assemble the pages of results into one dataset.</para> <para>If /// <i>none</i> of the items can be processed due to insufficient provisioned throughput on all of the tables in the request, then /// <i>BatchGetItem</i> will throw a <i>ProvisionedThroughputExceededException</i> . If <i>at least one</i> of the items is successfully /// processed, then <i>BatchGetItem</i> completes successfully, while returning the keys of the unread items in <i>UnprocessedKeys</i> .</para> /// <para>By default, <i>BatchGetItem</i> performs eventually consistent reads on every table in the request. If you want strongly consistent /// reads instead, you can set <i>ConsistentRead</i> to <c>true</c> for any or all tables.</para> <para>In order to minimize response latency, /// <i>BatchGetItem</i> retrieves items in parallel.</para> <para>When designing your application, keep in mind that DynamoDB does not return /// attributes in any particular order. To help parse the response by item, include the primary key values for the items in your request in the /// <i>AttributesToGet</i> parameter.</para> <para>If a requested item does not exist, it is not returned in the result. Requests for /// nonexistent items consume the minimum read capacity units according to the type of read. For more information, see <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations">Capacity Units /// Calculations</a> in the Amazon DynamoDB Developer Guide.</para> /// </summary> /// /// <param name="batchGetItemRequest">Container for the necessary parameters to execute the BatchGetItem service method on /// AmazonDynamoDBv2.</param> /// /// <returns>The response from the BatchGetItem service method, as returned by AmazonDynamoDBv2.</returns> /// /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.ProvisionedThroughputExceededException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.InternalServerErrorException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<BatchGetItemResponse> BatchGetItemAsync(BatchGetItemRequest batchGetItemRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.GetInstance(); return Invoke<IRequest, BatchGetItemRequest, BatchGetItemResponse>(batchGetItemRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the BatchGetItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the BatchGetItem operation on AmazonDynamoDBClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndBatchGetItem /// operation.</returns> public IAsyncResult BeginBatchGetItem(BatchGetItemRequest request, AsyncCallback callback, object state) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; return BeginInvoke<BatchGetItemRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> The BatchGetItem operation returns the attributes for multiple items from multiple tables using their primary keys. The maximum /// number of item attributes that can be retrieved for a single operation is 100. Also, the number of items retrieved is constrained by a 1 MB /// the size limit. If the response size limit is exceeded or a partial result is returned due to an internal processing failure, Amazon /// DynamoDB returns an UnprocessedKeys value so you can retry the operation starting with the next item to get. Amazon DynamoDB automatically /// adjusts the number of items returned per page to enforce this limit. For example, even if you ask to retrieve 100 items, but each individual /// item is 50 KB in size, the system returns 20 items and an appropriate UnprocessedKeys value so you can get the next page of results. If /// necessary, your application needs its own logic to assemble the pages of results into one set. </para> /// </summary> /// /// <param name="batchGetItemRequest">Container for the necessary parameters to execute the BatchGetItem service method on /// AmazonDynamoDB.</param> /// /// <returns>The response from the BatchGetItem service method, as returned by AmazonDynamoDB.</returns> /// /// <exception cref="ProvisionedThroughputExceededException"/> /// <exception cref="InternalServerErrorException"/> /// <exception cref="ResourceNotFoundException"/> public BatchGetItemResponse BatchGetItem(BatchGetItemRequest batchGetItemRequest) { IRequest<BatchGetItemRequest> request = new BatchGetItemRequestMarshaller().Marshall(batchGetItemRequest); BatchGetItemResponse response = Invoke<BatchGetItemRequest, BatchGetItemResponse> (request, this.signer, BatchGetItemResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the BatchGetItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.BatchGetItem"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the BatchGetItem operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<BatchGetItemResponse> BatchGetItemAsync(BatchGetItemRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, BatchGetItemRequest, BatchGetItemResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the BatchGetItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the BatchGetItem operation on AmazonDynamoDBClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void BatchGetItemAsync(BatchGetItemRequest request, AmazonServiceCallback<BatchGetItemRequest, BatchGetItemResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new BatchGetItemRequestMarshaller(); var unmarshaller = BatchGetItemResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<BatchGetItemRequest,BatchGetItemResponse> responseObject = new AmazonServiceResult<BatchGetItemRequest,BatchGetItemResponse>((BatchGetItemRequest)req, (BatchGetItemResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<BatchGetItemRequest>(request, marshaller, unmarshaller, options, callbackHelper); }