internal ScanResponse Scan(ScanRequest request) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; return(Invoke <ScanRequest, ScanResponse>(request, marshaller, unmarshaller)); }
public void ScanMarshallTest() { var request = InstantiateClassGenerator.Execute <ScanRequest>(); var marshaller = new ScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <ScanRequest>(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("Scan").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ScanResponseUnmarshaller.Instance.Unmarshall(context) as ScanResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// <para>The <i>Scan</i> operation returns one or more items and item attributes by accessing every item in the table. To have DynamoDB return /// fewer items, you can provide a <i>ScanFilter</i> .</para> <para>If the total number of scanned items exceeds the maximum data set size limit /// of 1 MB, the scan stops and results are returned to the user with a <i>LastEvaluatedKey</i> to continue the scan in a subsequent operation. /// The results also include the number of items exceeding the limit. A scan can result in no table data meeting the filter criteria. </para> /// <para>The result set is eventually consistent. </para> <para>By default, <i>Scan</i> operations proceed sequentially; however, for faster /// performance on large tables, applications can request a parallel <i>Scan</i> by specifying the <i>Segment</i> and <i>TotalSegments</i> /// parameters. For more information, see <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#QueryAndScanParallelScan">Parallel Scan</a> in the /// Amazon DynamoDB Developer Guide.</para> /// </summary> /// /// <param name="scanRequest">Container for the necessary parameters to execute the Scan service method on AmazonDynamoDBv2.</param> /// /// <returns>The response from the Scan 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 <ScanResponse> ScanAsync(ScanRequest scanRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, ScanRequest, ScanResponse>(scanRequest, marshaller, unmarshaller, signer, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the Scan operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Scan 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 <ScanResponse> ScanAsync(ScanRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; return(InvokeAsync <ScanRequest, ScanResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the Scan operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// <param name="request">Container for the necessary parameters to execute the Scan 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 ScanAsync(ScanRequest 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 ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; Invoke(request, callback, state, marshaller, unmarshaller, signer); })); return; }
/// <summary> /// Initiates the asynchronous execution of the Scan operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Scan 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<ScanResponse> ScanAsync(ScanRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; return InvokeAsync<ScanRequest,ScanResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal ScanResponse Scan(ScanRequest request) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; return Invoke<ScanRequest,ScanResponse>(request, marshaller, unmarshaller); }
public void ScanMarshallTest() { var request = InstantiateClassGenerator.Execute<ScanRequest>(); var marshaller = new ScanRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<ScanRequest>(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("Scan").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ScanResponseUnmarshaller.Instance.Unmarshall(context) as ScanResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
IAsyncResult invokeScan(ScanRequest scanRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ScanRequestMarshaller().Marshall(scanRequest); var unmarshaller = ScanResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>The <i>Scan</i> operation returns one or more items and item attributes by accessing every item in the table. To have DynamoDB return /// fewer items, you can provide a <i>ScanFilter</i> .</para> <para>If the total number of scanned items exceeds the maximum data set size limit /// of 1 MB, the scan stops and results are returned to the user with a <i>LastEvaluatedKey</i> to continue the scan in a subsequent operation. /// The results also include the number of items exceeding the limit. A scan can result in no table data meeting the filter criteria. </para> /// <para>The result set is eventually consistent. </para> <para>By default, <i>Scan</i> operations proceed sequentially; however, for faster /// performance on large tables, applications can request a parallel <i>Scan</i> by specifying the <i>Segment</i> and <i>TotalSegments</i> /// parameters. For more information, see <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#QueryAndScanParallelScan">Parallel Scan</a> in the /// Amazon DynamoDB Developer Guide.</para> /// </summary> /// /// <param name="scanRequest">Container for the necessary parameters to execute the Scan service method on AmazonDynamoDBv2.</param> /// /// <returns>The response from the Scan 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<ScanResponse> ScanAsync(ScanRequest scanRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ScanRequest, ScanResponse>(scanRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the Scan operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Scan 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 EndScan /// operation.</returns> public IAsyncResult BeginScan(ScanRequest request, AsyncCallback callback, object state) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; return BeginInvoke<ScanRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> The Scan operation returns one or more items and its attributes by performing a full scan of a table. Limit the returned results by /// specifying a filter. </para> /// </summary> /// /// <param name="scanRequest">Container for the necessary parameters to execute the Scan service method on AmazonDynamoDB.</param> /// /// <returns>The response from the Scan service method, as returned by AmazonDynamoDB.</returns> /// /// <exception cref="ProvisionedThroughputExceededException"/> /// <exception cref="InternalServerErrorException"/> /// <exception cref="ResourceNotFoundException"/> public ScanResponse Scan(ScanRequest scanRequest) { IRequest<ScanRequest> request = new ScanRequestMarshaller().Marshall(scanRequest); ScanResponse response = Invoke<ScanRequest, ScanResponse> (request, this.signer, ScanResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the Scan operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.Scan"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Scan 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<ScanResponse> ScanAsync(ScanRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ScanRequest, ScanResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the Scan operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the Scan 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 ScanAsync(ScanRequest request, AmazonServiceCallback<ScanRequest, ScanResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new ScanRequestMarshaller(); var unmarshaller = ScanResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<ScanRequest,ScanResponse> responseObject = new AmazonServiceResult<ScanRequest,ScanResponse>((ScanRequest)req, (ScanResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<ScanRequest>(request, marshaller, unmarshaller, options, callbackHelper); }