/// <summary> /// Deletes the specified container. Before you make a <code>DeleteContainer</code> request, /// delete any objects in the container or in any folders in the container. You can delete /// only empty containers. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteContainer service method.</param> /// /// <returns>The response from the DeleteContainer service method, as returned by MediaStore.</returns> /// <exception cref="Amazon.MediaStore.Model.ContainerInUseException"> /// Resource already exists or is being updated. /// </exception> /// <exception cref="Amazon.MediaStore.Model.ContainerNotFoundException"> /// Could not perform an operation on a container that does not exist. /// </exception> /// <exception cref="Amazon.MediaStore.Model.InternalServerErrorException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainer">REST API Reference for DeleteContainer Operation</seealso> public virtual DeleteContainerResponse DeleteContainer(DeleteContainerRequest request) { var marshaller = new DeleteContainerRequestMarshaller(); var unmarshaller = DeleteContainerResponseUnmarshaller.Instance; return(Invoke <DeleteContainerRequest, DeleteContainerResponse>(request, marshaller, unmarshaller)); }
public void DeleteContainerMarshallTest() { var request = InstantiateClassGenerator.Execute <DeleteContainerRequest>(); var marshaller = new DeleteContainerRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <DeleteContainerRequest>(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("DeleteContainer").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DeleteContainerResponseUnmarshaller.Instance.Unmarshall(context) as DeleteContainerResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the DeleteContainer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteContainer operation on AmazonMediaStoreClient.</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 EndDeleteContainer /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainer">REST API Reference for DeleteContainer Operation</seealso> public virtual IAsyncResult BeginDeleteContainer(DeleteContainerRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteContainerRequestMarshaller(); var unmarshaller = DeleteContainerResponseUnmarshaller.Instance; return(BeginInvoke <DeleteContainerRequest>(request, marshaller, unmarshaller, callback, state)); }
/// <summary> /// Initiates the asynchronous execution of the DeleteContainer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteContainer 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainer">REST API Reference for DeleteContainer Operation</seealso> public virtual Task <DeleteContainerResponse> DeleteContainerAsync(DeleteContainerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteContainerRequestMarshaller(); var unmarshaller = DeleteContainerResponseUnmarshaller.Instance; return(InvokeAsync <DeleteContainerRequest, DeleteContainerResponse>(request, marshaller, unmarshaller, cancellationToken)); }