internal DeleteItemResponse DeleteItem(DeleteItemRequest request) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; return(Invoke <DeleteItemRequest, DeleteItemResponse>(request, marshaller, unmarshaller)); }
public void DeleteItemMarshallTest() { var request = InstantiateClassGenerator.Execute <DeleteItemRequest>(); var marshaller = new DeleteItemRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <DeleteItemRequest>(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("DeleteItem").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DeleteItemResponseUnmarshaller.Instance.Unmarshall(context) as DeleteItemResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// <para>Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, or /// if it has an expected attribute value.</para> <para>In addition to deleting an item, you can also return the item's attribute values in the /// same operation, using the <i>ReturnValues</i> parameter.</para> <para>Unless you specify conditions, the <i>DeleteItem</i> is an idempotent /// operation; running it multiple times on the same item or attribute does <i>not</i> result in an error response.</para> <para>Conditional /// deletes are useful for only deleting items if specific conditions are met. If those conditions are met, DynamoDB performs the delete. /// Otherwise, the item is not deleted. </para> /// </summary> /// /// <param name="deleteItemRequest">Container for the necessary parameters to execute the DeleteItem service method on AmazonDynamoDBv2.</param> /// /// <returns>The response from the DeleteItem 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 <DeleteItemResponse> DeleteItemAsync(DeleteItemRequest deleteItemRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, DeleteItemRequest, DeleteItemResponse>(deleteItemRequest, marshaller, unmarshaller, signer, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the DeleteItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteItem 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 <DeleteItemResponse> DeleteItemAsync(DeleteItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; return(InvokeAsync <DeleteItemRequest, DeleteItemResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the DeleteItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteItem 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 DeleteItemAsync(DeleteItemRequest 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 DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; Invoke(request, callback, state, marshaller, unmarshaller, signer); })); return; }
/// <summary> /// Initiates the asynchronous execution of the DeleteItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteItem 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<DeleteItemResponse> DeleteItemAsync(DeleteItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; return InvokeAsync<DeleteItemRequest,DeleteItemResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DeleteItemResponse DeleteItem(DeleteItemRequest request) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; return Invoke<DeleteItemRequest,DeleteItemResponse>(request, marshaller, unmarshaller); }
public void DeleteItemMarshallTest() { var request = InstantiateClassGenerator.Execute<DeleteItemRequest>(); var marshaller = new DeleteItemRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<DeleteItemRequest>(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("DeleteItem").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DeleteItemResponseUnmarshaller.Instance.Unmarshall(context) as DeleteItemResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
IAsyncResult invokeDeleteItem(DeleteItemRequest deleteItemRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteItemRequestMarshaller().Marshall(deleteItemRequest); var unmarshaller = DeleteItemResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, or /// if it has an expected attribute value.</para> <para>In addition to deleting an item, you can also return the item's attribute values in the /// same operation, using the <i>ReturnValues</i> parameter.</para> <para>Unless you specify conditions, the <i>DeleteItem</i> is an idempotent /// operation; running it multiple times on the same item or attribute does <i>not</i> result in an error response.</para> <para>Conditional /// deletes are useful for only deleting items if specific conditions are met. If those conditions are met, DynamoDB performs the delete. /// Otherwise, the item is not deleted. </para> /// </summary> /// /// <param name="deleteItemRequest">Container for the necessary parameters to execute the DeleteItem service method on AmazonDynamoDBv2.</param> /// /// <returns>The response from the DeleteItem 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<DeleteItemResponse> DeleteItemAsync(DeleteItemRequest deleteItemRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteItemRequest, DeleteItemResponse>(deleteItemRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DeleteItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteItem 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 EndDeleteItem /// operation.</returns> public IAsyncResult BeginDeleteItem(DeleteItemRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; return BeginInvoke<DeleteItemRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, /// or if it has an expected attribute value. </para> /// </summary> /// /// <param name="deleteItemRequest">Container for the necessary parameters to execute the DeleteItem service method on AmazonDynamoDB.</param> /// /// <returns>The response from the DeleteItem service method, as returned by AmazonDynamoDB.</returns> /// /// <exception cref="ProvisionedThroughputExceededException"/> /// <exception cref="ConditionalCheckFailedException"/> /// <exception cref="InternalServerErrorException"/> /// <exception cref="ResourceNotFoundException"/> public DeleteItemResponse DeleteItem(DeleteItemRequest deleteItemRequest) { IRequest<DeleteItemRequest> request = new DeleteItemRequestMarshaller().Marshall(deleteItemRequest); DeleteItemResponse response = Invoke<DeleteItemRequest, DeleteItemResponse> (request, this.signer, DeleteItemResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the DeleteItem operation. /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.DeleteItem"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteItem 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<DeleteItemResponse> DeleteItemAsync(DeleteItemRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteItemRequest, DeleteItemResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the DeleteItem operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteItem 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 DeleteItemAsync(DeleteItemRequest request, AmazonServiceCallback<DeleteItemRequest, DeleteItemResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new DeleteItemRequestMarshaller(); var unmarshaller = DeleteItemResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<DeleteItemRequest,DeleteItemResponse> responseObject = new AmazonServiceResult<DeleteItemRequest,DeleteItemResponse>((DeleteItemRequest)req, (DeleteItemResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<DeleteItemRequest>(request, marshaller, unmarshaller, options, callbackHelper); }