internal UpdateItemResponse UpdateItem(UpdateItemRequest request) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; return(Invoke <UpdateItemRequest, UpdateItemResponse>(request, marshaller, unmarshaller)); }
public void UpdateItemMarshallTest() { var request = InstantiateClassGenerator.Execute <UpdateItemRequest>(); var marshaller = new UpdateItemRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <UpdateItemRequest>(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("UpdateItem").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = UpdateItemResponseUnmarshaller.Instance.Unmarshall(context) as UpdateItemResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// <para> Edits an existing item's attributes, or inserts a new item if it does not already exist. You can put, delete, or add attribute /// values. You can also perform a conditional update (insert a new attribute name-value pair if it doesn't exist, or replace an existing /// name-value pair if it has certain expected attribute values).</para> <para>In addition to updating an item, you can also return the item's /// attribute values in the same operation, using the <i>ReturnValues</i> parameter.</para> /// </summary> /// /// <param name="updateItemRequest">Container for the necessary parameters to execute the UpdateItem service method on AmazonDynamoDBv2.</param> /// /// <returns>The response from the UpdateItem service method, as returned by AmazonDynamoDBv2.</returns> /// /// <exception cref="T:Amazon.DynamoDBv2.Model.ItemCollectionSizeLimitExceededException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.ConditionalCheckFailedException" /> /// <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 <UpdateItemResponse> UpdateItemAsync(UpdateItemRequest updateItemRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, UpdateItemRequest, UpdateItemResponse>(updateItemRequest, marshaller, unmarshaller, signer, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateItem 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 <UpdateItemResponse> UpdateItemAsync(UpdateItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; return(InvokeAsync <UpdateItemRequest, UpdateItemResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateItem 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 UpdateItemAsync(UpdateItemRequest 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 UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; Invoke(request, callback, state, marshaller, unmarshaller, signer); })); return; }
/// <summary> /// Initiates the asynchronous execution of the UpdateItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateItem 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<UpdateItemResponse> UpdateItemAsync(UpdateItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; return InvokeAsync<UpdateItemRequest,UpdateItemResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal UpdateItemResponse UpdateItem(UpdateItemRequest request) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; return Invoke<UpdateItemRequest,UpdateItemResponse>(request, marshaller, unmarshaller); }
public void UpdateItemMarshallTest() { var request = InstantiateClassGenerator.Execute<UpdateItemRequest>(); var marshaller = new UpdateItemRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<UpdateItemRequest>(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("UpdateItem").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = UpdateItemResponseUnmarshaller.Instance.Unmarshall(context) as UpdateItemResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
IAsyncResult invokeUpdateItem(UpdateItemRequest updateItemRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new UpdateItemRequestMarshaller().Marshall(updateItemRequest); var unmarshaller = UpdateItemResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Edits an existing item's attributes, or inserts a new item if it does not already exist. You can put, delete, or add attribute /// values. You can also perform a conditional update (insert a new attribute name-value pair if it doesn't exist, or replace an existing /// name-value pair if it has certain expected attribute values).</para> <para>In addition to updating an item, you can also return the item's /// attribute values in the same operation, using the <i>ReturnValues</i> parameter.</para> /// </summary> /// /// <param name="updateItemRequest">Container for the necessary parameters to execute the UpdateItem service method on AmazonDynamoDBv2.</param> /// /// <returns>The response from the UpdateItem service method, as returned by AmazonDynamoDBv2.</returns> /// /// <exception cref="T:Amazon.DynamoDBv2.Model.ItemCollectionSizeLimitExceededException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.DynamoDBv2.Model.ConditionalCheckFailedException" /> /// <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<UpdateItemResponse> UpdateItemAsync(UpdateItemRequest updateItemRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.GetInstance(); return Invoke<IRequest, UpdateItemRequest, UpdateItemResponse>(updateItemRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the UpdateItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateItem 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 EndUpdateItem /// operation.</returns> public IAsyncResult BeginUpdateItem(UpdateItemRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; return BeginInvoke<UpdateItemRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Edits an existing item's attributes. You can perform a conditional update (insert a new attribute name-value pair if it doesn't /// exist, or replace an existing name-value pair if it has certain expected attribute values). </para> /// </summary> /// /// <param name="updateItemRequest">Container for the necessary parameters to execute the UpdateItem service method on AmazonDynamoDB.</param> /// /// <returns>The response from the UpdateItem service method, as returned by AmazonDynamoDB.</returns> /// /// <exception cref="ProvisionedThroughputExceededException"/> /// <exception cref="ConditionalCheckFailedException"/> /// <exception cref="InternalServerErrorException"/> /// <exception cref="ResourceNotFoundException"/> public UpdateItemResponse UpdateItem(UpdateItemRequest updateItemRequest) { IRequest<UpdateItemRequest> request = new UpdateItemRequestMarshaller().Marshall(updateItemRequest); UpdateItemResponse response = Invoke<UpdateItemRequest, UpdateItemResponse> (request, this.signer, UpdateItemResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the UpdateItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.UpdateItem"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateItem 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<UpdateItemResponse> UpdateItemAsync(UpdateItemRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, UpdateItemRequest, UpdateItemResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the UpdateItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateItem 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 UpdateItemAsync(UpdateItemRequest request, AmazonServiceCallback<UpdateItemRequest, UpdateItemResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new UpdateItemRequestMarshaller(); var unmarshaller = UpdateItemResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<UpdateItemRequest,UpdateItemResponse> responseObject = new AmazonServiceResult<UpdateItemRequest,UpdateItemResponse>((UpdateItemRequest)req, (UpdateItemResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<UpdateItemRequest>(request, marshaller, unmarshaller, options, callbackHelper); }