public async Task <GetMetricStatisticsResponse> Execute(AwsMetricRequest request) { if (!request.IsValid()) { throw new ArgumentException(nameof(request)); } using var awsClient = Key == null ? new AmazonCloudWatchClient() : new AmazonCloudWatchClient(Key, Secret, Endpoint); return(await awsClient.GetMetricStatisticsAsync(request.ToGetMetricStatisticsRequest())); }
public AwsMetricRequest(string name, AwsMetricRequest other, StandardUnit u = null, Statistic?stat = null) { ns = other.ns; metricName = name; unit = u == null ? other.unit : u; utcFrom = other.utcFrom; utcTo = other.utcTo; stats = new HashSet <Statistic>(other.stats); dimensions = new Dictionary <string, string>(other.dimensions); if (stat.HasValue) { SetStatistics(stat.Value); } }