/// <summary> /// Enable the actions for the list of CloudWatch alarm names passed /// in the alarmNames parameter. /// </summary> /// <param name="client">An initialized CloudWatch client object.</param> /// <param name="alarmNames">The list of CloudWatch alarms to enable.</param> /// <returns>A Boolean value indicating the success of the call.</returns> public static async Task <bool> EnableAlarmActionsAsync(IAmazonCloudWatch client, List <string> alarmNames) { var request = new EnableAlarmActionsRequest { AlarmNames = alarmNames, }; var response = await client.EnableAlarmActionsAsync(request); return(response.HttpStatusCode == System.Net.HttpStatusCode.OK); }
private Amazon.CloudWatch.Model.EnableAlarmActionsResponse CallAWSServiceOperation(IAmazonCloudWatch client, Amazon.CloudWatch.Model.EnableAlarmActionsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch", "EnableAlarmActions"); try { #if DESKTOP return(client.EnableAlarmActions(request)); #elif CORECLR return(client.EnableAlarmActionsAsync(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; } }