public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticBeanstalk.Model.TerminateEnvironmentRequest(); if (cmdletContext.EnvironmentId != null) { request.EnvironmentId = cmdletContext.EnvironmentId; } if (cmdletContext.EnvironmentName != null) { request.EnvironmentName = cmdletContext.EnvironmentName; } if (cmdletContext.ForceTerminate != null) { request.ForceTerminate = cmdletContext.ForceTerminate.Value; } if (cmdletContext.TerminateResource != null) { request.TerminateResources = cmdletContext.TerminateResource.Value; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the TerminateEnvironment operation. /// <seealso cref="Amazon.ElasticBeanstalk.AmazonElasticBeanstalk.TerminateEnvironment"/> /// </summary> /// /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment operation on /// AmazonElasticBeanstalk.</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 /// EndTerminateEnvironment operation.</returns> public IAsyncResult BeginTerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest, AsyncCallback callback, object state) { return invokeTerminateEnvironment(terminateEnvironmentRequest, callback, state, false); }
IAsyncResult invokeTerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new TerminateEnvironmentRequestMarshaller().Marshall(terminateEnvironmentRequest); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Terminates the specified environment. </para> /// </summary> /// /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns> /// public TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest) { IAsyncResult asyncResult = invokeTerminateEnvironment(terminateEnvironmentRequest, null, null, true); return EndTerminateEnvironment(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the TerminateEnvironment operation. /// <seealso cref="Amazon.ElasticBeanstalk.IAmazonElasticBeanstalk"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateEnvironment 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<TerminateEnvironmentResponse> TerminateEnvironmentAsync(TerminateEnvironmentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateEnvironmentRequestMarshaller(); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance; return InvokeAsync<TerminateEnvironmentRequest,TerminateEnvironmentResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest request) { var marshaller = new TerminateEnvironmentRequestMarshaller(); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance; return Invoke<TerminateEnvironmentRequest,TerminateEnvironmentResponse>(request, marshaller, unmarshaller); }
private Amazon.ElasticBeanstalk.Model.TerminateEnvironmentResponse CallAWSServiceOperation(IAmazonElasticBeanstalk client, Amazon.ElasticBeanstalk.Model.TerminateEnvironmentRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elastic Beanstalk", "TerminateEnvironment"); try { #if DESKTOP return(client.TerminateEnvironment(request)); #elif CORECLR return(client.TerminateEnvironmentAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// <para> Terminates the specified environment. </para> /// </summary> /// /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns> /// /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<TerminateEnvironmentResponse> TerminateEnvironmentAsync(TerminateEnvironmentRequest terminateEnvironmentRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateEnvironmentRequestMarshaller(); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.GetInstance(); return Invoke<IRequest, TerminateEnvironmentRequest, TerminateEnvironmentResponse>(terminateEnvironmentRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Terminates the specified environment. </para> /// </summary> /// /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns> /// public TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest terminateEnvironmentRequest) { IRequest<TerminateEnvironmentRequest> request = new TerminateEnvironmentRequestMarshaller().Marshall(terminateEnvironmentRequest); TerminateEnvironmentResponse response = Invoke<TerminateEnvironmentRequest, TerminateEnvironmentResponse> (request, this.signer, TerminateEnvironmentResponseUnmarshaller.GetInstance()); return response; }
internal TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest request) { var task = TerminateEnvironmentAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the TerminateEnvironment operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateEnvironment operation on AmazonElasticBeanstalkClient.</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 EndTerminateEnvironment /// operation.</returns> public IAsyncResult BeginTerminateEnvironment(TerminateEnvironmentRequest request, AsyncCallback callback, object state) { var marshaller = new TerminateEnvironmentRequestMarshaller(); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance; return BeginInvoke<TerminateEnvironmentRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeTerminateEnvironment(TerminateEnvironmentRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new TerminateEnvironmentRequestMarshaller(); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// <para> Terminates the specified environment. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TerminateEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns> /// /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" /> public TerminateEnvironmentResponse TerminateEnvironment(TerminateEnvironmentRequest request) { var task = TerminateEnvironmentAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> Terminates the specified environment. </para> /// </summary> /// /// <param name="terminateEnvironmentRequest">Container for the necessary parameters to execute the TerminateEnvironment service method on /// AmazonElasticBeanstalk.</param> /// /// <returns>The response from the TerminateEnvironment service method, as returned by AmazonElasticBeanstalk.</returns> /// /// <exception cref="T:Amazon.ElasticBeanstalk.Model.InsufficientPrivilegesException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<TerminateEnvironmentResponse> TerminateEnvironmentAsync(TerminateEnvironmentRequest terminateEnvironmentRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TerminateEnvironmentRequestMarshaller(); var unmarshaller = TerminateEnvironmentResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, TerminateEnvironmentRequest, TerminateEnvironmentResponse>(terminateEnvironmentRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }