public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AutoScaling.Model.PutNotificationConfigurationRequest(); if (cmdletContext.AutoScalingGroupName != null) { request.AutoScalingGroupName = cmdletContext.AutoScalingGroupName; } if (cmdletContext.NotificationType != null) { request.NotificationTypes = cmdletContext.NotificationType; } if (cmdletContext.TopicARN != null) { request.TopicARN = cmdletContext.TopicARN; } 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 PutNotificationConfiguration operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutNotificationConfiguration 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<PutNotificationConfigurationResponse> PutNotificationConfigurationAsync(PutNotificationConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutNotificationConfigurationRequestMarshaller(); var unmarshaller = PutNotificationConfigurationResponseUnmarshaller.Instance; return InvokeAsync<PutNotificationConfigurationRequest,PutNotificationConfigurationResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal PutNotificationConfigurationResponse PutNotificationConfiguration(PutNotificationConfigurationRequest request) { var marshaller = new PutNotificationConfigurationRequestMarshaller(); var unmarshaller = PutNotificationConfigurationResponseUnmarshaller.Instance; return Invoke<PutNotificationConfigurationRequest,PutNotificationConfigurationResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokePutNotificationConfiguration(PutNotificationConfigurationRequest putNotificationConfigurationRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new PutNotificationConfigurationRequestMarshaller().Marshall(putNotificationConfigurationRequest); var unmarshaller = PutNotificationConfigurationResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the PutNotificationConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.PutNotificationConfiguration"/> /// </summary> /// /// <param name="putNotificationConfigurationRequest">Container for the necessary parameters to execute the PutNotificationConfiguration /// operation on AmazonAutoScaling.</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> public IAsyncResult BeginPutNotificationConfiguration(PutNotificationConfigurationRequest putNotificationConfigurationRequest, AsyncCallback callback, object state) { return invokePutNotificationConfiguration(putNotificationConfigurationRequest, callback, state, false); }
/// <summary> /// <para> Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to this topic can have messages /// for events delivered to an endpoint such as a web server or email address. </para> <para>For more information see <a /// href="http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html" >Get Email Notifications When Your Auto /// Scaling Group Changes</a> </para> <para>A new <c>PutNotificationConfiguration</c> overwrites an existing configuration. </para> /// </summary> /// /// <param name="putNotificationConfigurationRequest">Container for the necessary parameters to execute the PutNotificationConfiguration service /// method on AmazonAutoScaling.</param> /// /// <exception cref="LimitExceededException"/> public PutNotificationConfigurationResponse PutNotificationConfiguration(PutNotificationConfigurationRequest putNotificationConfigurationRequest) { IAsyncResult asyncResult = invokePutNotificationConfiguration(putNotificationConfigurationRequest, null, null, true); return EndPutNotificationConfiguration(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the PutNotificationConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.PutNotificationConfiguration"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutNotificationConfiguration 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<PutNotificationConfigurationResponse> PutNotificationConfigurationAsync(PutNotificationConfigurationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutNotificationConfigurationRequestMarshaller(); var unmarshaller = PutNotificationConfigurationResponseUnmarshaller.GetInstance(); return Invoke<IRequest, PutNotificationConfigurationRequest, PutNotificationConfigurationResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to this topic can have messages /// for events delivered to an endpoint such as a web server or email address. </para> <para>For more information see <a href="http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html">Get Email Notifications When Your Auto /// Scaling Group Changes</a> </para> <para>A new <c>PutNotificationConfiguration</c> overwrites an existing configuration. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutNotificationConfiguration service /// method on AmazonAutoScaling.</param> /// /// <exception cref="T:Amazon.AutoScaling.Model.LimitExceededException" /> public PutNotificationConfigurationResponse PutNotificationConfiguration(PutNotificationConfigurationRequest request) { var task = PutNotificationConfigurationAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the PutNotificationConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutNotificationConfiguration operation on AmazonAutoScalingClient.</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 EndPutNotificationConfiguration /// operation.</returns> public IAsyncResult BeginPutNotificationConfiguration(PutNotificationConfigurationRequest request, AsyncCallback callback, object state) { var marshaller = new PutNotificationConfigurationRequestMarshaller(); var unmarshaller = PutNotificationConfigurationResponseUnmarshaller.Instance; return BeginInvoke<PutNotificationConfigurationRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.AutoScaling.Model.PutNotificationConfigurationResponse CallAWSServiceOperation(IAmazonAutoScaling client, Amazon.AutoScaling.Model.PutNotificationConfigurationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Auto Scaling", "PutNotificationConfiguration"); try { #if DESKTOP return(client.PutNotificationConfiguration(request)); #elif CORECLR return(client.PutNotificationConfigurationAsync(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> Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to this topic can have messages /// for events delivered to an endpoint such as a web server or email address. </para> <para> A new <c>PutNotificationConfiguration</c> /// overwrites an existing configuration.</para> /// </summary> /// /// <param name="putNotificationConfigurationRequest">Container for the necessary parameters to execute the PutNotificationConfiguration service /// method on AmazonAutoScaling.</param> /// /// <exception cref="LimitExceededException"/> public PutNotificationConfigurationResponse PutNotificationConfiguration(PutNotificationConfigurationRequest putNotificationConfigurationRequest) { IRequest<PutNotificationConfigurationRequest> request = new PutNotificationConfigurationRequestMarshaller().Marshall(putNotificationConfigurationRequest); PutNotificationConfigurationResponse response = Invoke<PutNotificationConfigurationRequest, PutNotificationConfigurationResponse> (request, this.signer, PutNotificationConfigurationResponseUnmarshaller.GetInstance()); return response; }
internal PutNotificationConfigurationResponse PutNotificationConfiguration(PutNotificationConfigurationRequest request) { var task = PutNotificationConfigurationAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the PutNotificationConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.PutNotificationConfiguration"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutNotificationConfiguration 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<PutNotificationConfigurationResponse> PutNotificationConfigurationAsync(PutNotificationConfigurationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutNotificationConfigurationRequestMarshaller(); var unmarshaller = PutNotificationConfigurationResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, PutNotificationConfigurationRequest, PutNotificationConfigurationResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }