internal GetItemResponse GetItem(GetItemRequest request)
        {
            var marshaller   = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return(Invoke <GetItemRequest, GetItemResponse>(request, marshaller, unmarshaller));
        }
Ejemplo n.º 2
0
        public void GetItemMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <GetItemRequest>();
            var marshaller = new GetItemRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <GetItemRequest>(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("GetItem").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = GetItemResponseUnmarshaller.Instance.Unmarshall(context)
                           as GetItemResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <para>The <i>GetItem</i> operation returns a set of attributes for the item with the given primary key. If there is no matching item,
        /// <i>GetItem</i> does not return any data.</para> <para> <i>GetItem</i> provides an eventually consistent read by default. If your application
        /// requires a strongly consistent read, set <i>ConsistentRead</i> to <c>true</c> . Although a strongly consistent read might take more time
        /// than an eventually consistent read, it always returns the last updated value.</para>
        /// </summary>
        ///
        /// <param name="getItemRequest">Container for the necessary parameters to execute the GetItem service method on AmazonDynamoDBv2.</param>
        ///
        /// <returns>The response from the GetItem 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 <GetItemResponse> GetItemAsync(GetItemRequest getItemRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, GetItemRequest, GetItemResponse>(getItemRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetItem 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 <GetItemResponse> GetItemAsync(GetItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return(InvokeAsync <GetItemRequest, GetItemResponse>(request, marshaller,
                                                                 unmarshaller, cancellationToken));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetItem 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 GetItemAsync(GetItemRequest 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 GetItemRequestMarshaller();
                var unmarshaller = GetItemResponseUnmarshaller.Instance;
                Invoke(request, callback, state, marshaller, unmarshaller, signer);
            }));
            return;
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetItem 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<GetItemResponse> GetItemAsync(GetItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return InvokeAsync<GetItemRequest,GetItemResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal GetItemResponse GetItem(GetItemRequest request)
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return Invoke<GetItemRequest,GetItemResponse>(request, marshaller, unmarshaller);
        }
Ejemplo n.º 8
0
        public void GetItemMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<GetItemRequest>();
            var marshaller = new GetItemRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<GetItemRequest>(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("GetItem").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = GetItemResponseUnmarshaller.Instance.Unmarshall(context)
                as GetItemResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
 IAsyncResult invokeGetItem(GetItemRequest getItemRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetItemRequestMarshaller().Marshall(getItemRequest);
     var unmarshaller = GetItemResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        /// <summary>
        /// <para>The <i>GetItem</i> operation returns a set of attributes for the item with the given primary key. If there is no matching item,
        /// <i>GetItem</i> does not return any data.</para> <para> <i>GetItem</i> provides an eventually consistent read by default. If your application
        /// requires a strongly consistent read, set <i>ConsistentRead</i> to <c>true</c> . Although a strongly consistent read might take more time
        /// than an eventually consistent read, it always returns the last updated value.</para>
        /// </summary>
        /// 
        /// <param name="getItemRequest">Container for the necessary parameters to execute the GetItem service method on AmazonDynamoDBv2.</param>
        /// 
        /// <returns>The response from the GetItem 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<GetItemResponse> GetItemAsync(GetItemRequest getItemRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetItemRequest, GetItemResponse>(getItemRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetItem 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 EndGetItem
        ///         operation.</returns>
        public IAsyncResult BeginGetItem(GetItemRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return BeginInvoke<GetItemRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// <para> The GetItem operation returns a set of Attributes for an item that matches the primary key. The GetItem operation provides an
 /// eventually consistent read by default. If eventually consistent reads are not acceptable for your application, use ConsistentRead. Although
 /// this operation might take longer than a standard read, it always returns the last updated value. </para>
 /// </summary>
 /// 
 /// <param name="getItemRequest">Container for the necessary parameters to execute the GetItem service method on AmazonDynamoDB.</param>
 /// 
 /// <returns>The response from the GetItem service method, as returned by AmazonDynamoDB.</returns>
 /// 
 /// <exception cref="ProvisionedThroughputExceededException"/>
 /// <exception cref="InternalServerErrorException"/>
 /// <exception cref="ResourceNotFoundException"/>
 public GetItemResponse GetItem(GetItemRequest getItemRequest)
 {
     IRequest<GetItemRequest> request = new GetItemRequestMarshaller().Marshall(getItemRequest);
     GetItemResponse response = Invoke<GetItemRequest, GetItemResponse> (request, this.signer, GetItemResponseUnmarshaller.GetInstance());
     return response;
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.GetItem"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetItem 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<GetItemResponse> GetItemAsync(GetItemRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetItemRequest, GetItemResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Initiates the asynchronous execution of the GetItem operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the GetItem 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 GetItemAsync(GetItemRequest request, AmazonServiceCallback<GetItemRequest, GetItemResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new GetItemRequestMarshaller();
     var unmarshaller = GetItemResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<GetItemRequest,GetItemResponse> responseObject 
                     = new AmazonServiceResult<GetItemRequest,GetItemResponse>((GetItemRequest)req, (GetItemResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<GetItemRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }