public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticLoadBalancingV2.Model.ModifyListenerRequest(); if (cmdletContext.AlpnPolicy != null) { request.AlpnPolicy = cmdletContext.AlpnPolicy; } if (cmdletContext.Certificate != null) { request.Certificates = cmdletContext.Certificate; } if (cmdletContext.DefaultAction != null) { request.DefaultActions = cmdletContext.DefaultAction; } if (cmdletContext.ListenerArn != null) { request.ListenerArn = cmdletContext.ListenerArn; } if (cmdletContext.Port != null) { request.Port = cmdletContext.Port.Value; } if (cmdletContext.Protocol != null) { request.Protocol = cmdletContext.Protocol; } if (cmdletContext.SslPolicy != null) { request.SslPolicy = cmdletContext.SslPolicy; } 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); }
private Amazon.ElasticLoadBalancingV2.Model.ModifyListenerResponse CallAWSServiceOperation(IAmazonElasticLoadBalancingV2 client, Amazon.ElasticLoadBalancingV2.Model.ModifyListenerRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Load Balancing V2", "ModifyListener"); try { #if DESKTOP return(client.ModifyListener(request)); #elif CORECLR return(client.ModifyListenerAsync(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> /// Initiates the asynchronous execution of the ModifyListener operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyListener 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<ModifyListenerResponse> ModifyListenerAsync(ModifyListenerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyListenerRequestMarshaller(); var unmarshaller = ModifyListenerResponseUnmarshaller.Instance; return InvokeAsync<ModifyListenerRequest,ModifyListenerResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Modifies the specified properties of the specified listener. /// /// /// <para> /// Any properties that you do not specify retain their current values. However, changing /// the protocol from HTTPS to HTTP removes the security policy and SSL certificate properties. /// If you change the protocol from HTTP to HTTPS, you must add the security policy. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyListener service method.</param> /// /// <returns>The response from the ModifyListener service method, as returned by ElasticLoadBalancingV2.</returns> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.CertificateNotFoundException"> /// The specified certificate does not exist. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.DuplicateListenerException"> /// A listener with the specified port already exists. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.IncompatibleProtocolsException"> /// The specified configuration is not valid with this protocol. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.InvalidConfigurationRequestException"> /// The requested configuration is not valid. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.ListenerNotFoundException"> /// The specified listener does not exist. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.SSLPolicyNotFoundException"> /// The specified SSL policy does not exist. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TargetGroupAssociationLimitException"> /// You've reached the limit on the number of load balancers per target group. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TargetGroupNotFoundException"> /// The specified target group does not exist. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TooManyCertificatesException"> /// You've reached the limit on the number of certificates per listener. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TooManyListenersException"> /// You've reached the limit on the number of listeners per load balancer. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.TooManyRegistrationsForTargetIdException"> /// You've reached the limit on the number of times a target can be registered with a /// load balancer. /// </exception> /// <exception cref="Amazon.ElasticLoadBalancingV2.Model.UnsupportedProtocolException"> /// The specified protocol is not supported. /// </exception> public ModifyListenerResponse ModifyListener(ModifyListenerRequest request) { var marshaller = new ModifyListenerRequestMarshaller(); var unmarshaller = ModifyListenerResponseUnmarshaller.Instance; return Invoke<ModifyListenerRequest,ModifyListenerResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ModifyListener operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyListener operation on AmazonElasticLoadBalancingV2Client.</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 EndModifyListener /// operation.</returns> public IAsyncResult BeginModifyListener(ModifyListenerRequest request, AsyncCallback callback, object state) { var marshaller = new ModifyListenerRequestMarshaller(); var unmarshaller = ModifyListenerResponseUnmarshaller.Instance; return BeginInvoke<ModifyListenerRequest>(request, marshaller, unmarshaller, callback, state); }