/// <summary>Snippet for DeleteEnvironmentAsync</summary> public async Task DeleteEnvironmentRequestObjectAsync() { // Snippet: DeleteEnvironmentAsync(DeleteEnvironmentRequest, CallSettings) // Additional: DeleteEnvironmentAsync(DeleteEnvironmentRequest, CancellationToken) // Create client EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync(); // Initialize request argument(s) DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { Name = "", }; // Make the request Operation <Empty, OperationMetadata> response = await environmentsClient.DeleteEnvironmentAsync(request); // Poll until the returned long-running operation is complete Operation <Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Empty result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Empty, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceDeleteEnvironmentAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Empty retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary> /// Deletes an AWS Cloud9 development environment. If an Amazon EC2 instance is connected /// to the environment, also terminates the instance. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteEnvironment service method.</param> /// /// <returns>The response from the DeleteEnvironment service method, as returned by Cloud9.</returns> /// <exception cref="Amazon.Cloud9.Model.BadRequestException"> /// The target request is invalid. /// </exception> /// <exception cref="Amazon.Cloud9.Model.ConflictException"> /// A conflict occurred. /// </exception> /// <exception cref="Amazon.Cloud9.Model.ForbiddenException"> /// An access permissions issue occurred. /// </exception> /// <exception cref="Amazon.Cloud9.Model.InternalServerErrorException"> /// An internal server error occurred. /// </exception> /// <exception cref="Amazon.Cloud9.Model.LimitExceededException"> /// A service limit was exceeded. /// </exception> /// <exception cref="Amazon.Cloud9.Model.NotFoundException"> /// The target resource cannot be found. /// </exception> /// <exception cref="Amazon.Cloud9.Model.TooManyRequestsException"> /// Too many service requests were made over the given time period. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/DeleteEnvironment">REST API Reference for DeleteEnvironment Operation</seealso> public virtual DeleteEnvironmentResponse DeleteEnvironment(DeleteEnvironmentRequest request) { var marshaller = DeleteEnvironmentRequestMarshaller.Instance; var unmarshaller = DeleteEnvironmentResponseUnmarshaller.Instance; return(Invoke <DeleteEnvironmentRequest, DeleteEnvironmentResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the DeleteEnvironment operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteEnvironment 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/cloud9-2017-09-23/DeleteEnvironment">REST API Reference for DeleteEnvironment Operation</seealso> public virtual Task <DeleteEnvironmentResponse> DeleteEnvironmentAsync(DeleteEnvironmentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = DeleteEnvironmentRequestMarshaller.Instance; var unmarshaller = DeleteEnvironmentResponseUnmarshaller.Instance; return(InvokeAsync <DeleteEnvironmentRequest, DeleteEnvironmentResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Deletes an Amazon Managed Workflows for Apache Airflow (MWAA) environment. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteEnvironment service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteEnvironment service method, as returned by MWAA.</returns> /// <exception cref="Amazon.MWAA.Model.InternalServerException"> /// InternalServerException: An internal error has occurred. /// </exception> /// <exception cref="Amazon.MWAA.Model.ResourceNotFoundException"> /// ResourceNotFoundException: The resource is not available. /// </exception> /// <exception cref="Amazon.MWAA.Model.ValidationException"> /// ValidationException: The provided input is not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mwaa-2020-07-01/DeleteEnvironment">REST API Reference for DeleteEnvironment Operation</seealso> public virtual Task <DeleteEnvironmentResponse> DeleteEnvironmentAsync(DeleteEnvironmentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteEnvironmentRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteEnvironmentResponseUnmarshaller.Instance; return(InvokeAsync <DeleteEnvironmentResponse>(request, options, cancellationToken)); }
internal virtual DeleteEnvironmentResponse DeleteEnvironment(DeleteEnvironmentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteEnvironmentRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteEnvironmentResponseUnmarshaller.Instance; return(Invoke <DeleteEnvironmentResponse>(request, options)); }
/// <summary> /// Initiates the asynchronous execution of the DeleteEnvironment operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteEnvironment operation on AmazonFinspaceClient.</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 EndDeleteEnvironment /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/DeleteEnvironment">REST API Reference for DeleteEnvironment Operation</seealso> public virtual IAsyncResult BeginDeleteEnvironment(DeleteEnvironmentRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteEnvironmentRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteEnvironmentResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }
/// <summary>Snippet for DeleteEnvironment</summary> public void DeleteEnvironmentRequestObject() { // Snippet: DeleteEnvironment(DeleteEnvironmentRequest, CallSettings) // Create client EnvironmentsClient environmentsClient = EnvironmentsClient.Create(); // Initialize request argument(s) DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { EnvironmentName = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"), }; // Make the request environmentsClient.DeleteEnvironment(request); // End snippet }
public void DeleteEnvironmentRequestObject() { moq::Mock <Environments.EnvironmentsClient> mockGrpcClient = new moq::Mock <Environments.EnvironmentsClient>(moq::MockBehavior.Strict); DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { EnvironmentName = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteEnvironment(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); EnvironmentsClient client = new EnvironmentsClientImpl(mockGrpcClient.Object, null); client.DeleteEnvironment(request); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteEnvironmentAsync</summary> public async Task DeleteEnvironmentRequestObjectAsync() { // Snippet: DeleteEnvironmentAsync(DeleteEnvironmentRequest, CallSettings) // Additional: DeleteEnvironmentAsync(DeleteEnvironmentRequest, CancellationToken) // Create client EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync(); // Initialize request argument(s) DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { EnvironmentName = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"), }; // Make the request await environmentsClient.DeleteEnvironmentAsync(request); // End snippet }
public async stt::Task DeleteEnvironmentRequestObjectAsync() { moq::Mock <Environments.EnvironmentsClient> mockGrpcClient = new moq::Mock <Environments.EnvironmentsClient>(moq::MockBehavior.Strict); DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { EnvironmentName = EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteEnvironmentAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); EnvironmentsClient client = new EnvironmentsClientImpl(mockGrpcClient.Object, null); await client.DeleteEnvironmentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteEnvironmentAsync(request, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }