/// <summary> /// Initiates the asynchronous execution of the UpdateNotification operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateNotification operation on AmazonBudgetsClient.</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 EndUpdateNotification /// operation.</returns> public IAsyncResult BeginUpdateNotification(UpdateNotificationRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateNotificationRequestMarshaller(); var unmarshaller = UpdateNotificationResponseUnmarshaller.Instance; return BeginInvoke<UpdateNotificationRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Update the information about a notification already created /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateNotification service method.</param> /// /// <returns>The response from the UpdateNotification service method, as returned by Budgets.</returns> /// <exception cref="Amazon.Budgets.Model.InternalErrorException"> /// This exception is thrown on an unknown internal failure. /// </exception> /// <exception cref="Amazon.Budgets.Model.InvalidParameterException"> /// This exception is thrown if any request is given an invalid parameter. E.g., if a /// required Date field is null. /// </exception> /// <exception cref="Amazon.Budgets.Model.NotFoundException"> /// This exception is thrown if a requested entity is not found. E.g., if a budget id /// doesn't exist for an account ID. /// </exception> public UpdateNotificationResponse UpdateNotification(UpdateNotificationRequest request) { var marshaller = new UpdateNotificationRequestMarshaller(); var unmarshaller = UpdateNotificationResponseUnmarshaller.Instance; return Invoke<UpdateNotificationRequest,UpdateNotificationResponse>(request, marshaller, unmarshaller); }
private Amazon.Budgets.Model.UpdateNotificationResponse CallAWSServiceOperation(IAmazonBudgets client, Amazon.Budgets.Model.UpdateNotificationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Budgets", "UpdateNotification"); try { #if DESKTOP return(client.UpdateNotification(request)); #elif CORECLR return(client.UpdateNotificationAsync(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 UpdateNotification operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateNotification 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<UpdateNotificationResponse> UpdateNotificationAsync(UpdateNotificationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateNotificationRequestMarshaller(); var unmarshaller = UpdateNotificationResponseUnmarshaller.Instance; return InvokeAsync<UpdateNotificationRequest,UpdateNotificationResponse>(request, marshaller, unmarshaller, cancellationToken); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Budgets.Model.UpdateNotificationRequest(); if (cmdletContext.AccountId != null) { request.AccountId = cmdletContext.AccountId; } if (cmdletContext.BudgetName != null) { request.BudgetName = cmdletContext.BudgetName; } // populate NewNotification var requestNewNotificationIsNull = true; request.NewNotification = new Amazon.Budgets.Model.Notification(); Amazon.Budgets.ComparisonOperator requestNewNotification_newNotification_ComparisonOperator = null; if (cmdletContext.NewNotification_ComparisonOperator != null) { requestNewNotification_newNotification_ComparisonOperator = cmdletContext.NewNotification_ComparisonOperator; } if (requestNewNotification_newNotification_ComparisonOperator != null) { request.NewNotification.ComparisonOperator = requestNewNotification_newNotification_ComparisonOperator; requestNewNotificationIsNull = false; } Amazon.Budgets.NotificationState requestNewNotification_newNotification_NotificationState = null; if (cmdletContext.NewNotification_NotificationState != null) { requestNewNotification_newNotification_NotificationState = cmdletContext.NewNotification_NotificationState; } if (requestNewNotification_newNotification_NotificationState != null) { request.NewNotification.NotificationState = requestNewNotification_newNotification_NotificationState; requestNewNotificationIsNull = false; } Amazon.Budgets.NotificationType requestNewNotification_newNotification_NotificationType = null; if (cmdletContext.NewNotification_NotificationType != null) { requestNewNotification_newNotification_NotificationType = cmdletContext.NewNotification_NotificationType; } if (requestNewNotification_newNotification_NotificationType != null) { request.NewNotification.NotificationType = requestNewNotification_newNotification_NotificationType; requestNewNotificationIsNull = false; } System.Double?requestNewNotification_newNotification_Threshold = null; if (cmdletContext.NewNotification_Threshold != null) { requestNewNotification_newNotification_Threshold = cmdletContext.NewNotification_Threshold.Value; } if (requestNewNotification_newNotification_Threshold != null) { request.NewNotification.Threshold = requestNewNotification_newNotification_Threshold.Value; requestNewNotificationIsNull = false; } Amazon.Budgets.ThresholdType requestNewNotification_newNotification_ThresholdType = null; if (cmdletContext.NewNotification_ThresholdType != null) { requestNewNotification_newNotification_ThresholdType = cmdletContext.NewNotification_ThresholdType; } if (requestNewNotification_newNotification_ThresholdType != null) { request.NewNotification.ThresholdType = requestNewNotification_newNotification_ThresholdType; requestNewNotificationIsNull = false; } // determine if request.NewNotification should be set to null if (requestNewNotificationIsNull) { request.NewNotification = null; } // populate OldNotification var requestOldNotificationIsNull = true; request.OldNotification = new Amazon.Budgets.Model.Notification(); Amazon.Budgets.ComparisonOperator requestOldNotification_oldNotification_ComparisonOperator = null; if (cmdletContext.OldNotification_ComparisonOperator != null) { requestOldNotification_oldNotification_ComparisonOperator = cmdletContext.OldNotification_ComparisonOperator; } if (requestOldNotification_oldNotification_ComparisonOperator != null) { request.OldNotification.ComparisonOperator = requestOldNotification_oldNotification_ComparisonOperator; requestOldNotificationIsNull = false; } Amazon.Budgets.NotificationState requestOldNotification_oldNotification_NotificationState = null; if (cmdletContext.OldNotification_NotificationState != null) { requestOldNotification_oldNotification_NotificationState = cmdletContext.OldNotification_NotificationState; } if (requestOldNotification_oldNotification_NotificationState != null) { request.OldNotification.NotificationState = requestOldNotification_oldNotification_NotificationState; requestOldNotificationIsNull = false; } Amazon.Budgets.NotificationType requestOldNotification_oldNotification_NotificationType = null; if (cmdletContext.OldNotification_NotificationType != null) { requestOldNotification_oldNotification_NotificationType = cmdletContext.OldNotification_NotificationType; } if (requestOldNotification_oldNotification_NotificationType != null) { request.OldNotification.NotificationType = requestOldNotification_oldNotification_NotificationType; requestOldNotificationIsNull = false; } System.Double?requestOldNotification_oldNotification_Threshold = null; if (cmdletContext.OldNotification_Threshold != null) { requestOldNotification_oldNotification_Threshold = cmdletContext.OldNotification_Threshold.Value; } if (requestOldNotification_oldNotification_Threshold != null) { request.OldNotification.Threshold = requestOldNotification_oldNotification_Threshold.Value; requestOldNotificationIsNull = false; } Amazon.Budgets.ThresholdType requestOldNotification_oldNotification_ThresholdType = null; if (cmdletContext.OldNotification_ThresholdType != null) { requestOldNotification_oldNotification_ThresholdType = cmdletContext.OldNotification_ThresholdType; } if (requestOldNotification_oldNotification_ThresholdType != null) { request.OldNotification.ThresholdType = requestOldNotification_oldNotification_ThresholdType; requestOldNotificationIsNull = false; } // determine if request.OldNotification should be set to null if (requestOldNotificationIsNull) { request.OldNotification = null; } 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); }