Chilkat Online Tools

DescribeAnomaly C++ Example

Amazon DevOps Guru

#include <CkRest.h>
#include <CkAuthAws.h>
#include <CkStringBuilder.h>
#include <CkJsonObject.h>

void ChilkatSample(void)
    {
    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkRest rest;
    bool success;

    CkAuthAws authAws;
    authAws.put_AccessKey("AWS_ACCESS_KEY");
    authAws.put_SecretKey("AWS_SECRET_KEY");

    // Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.)
    authAws.put_Region("us-west-2");
    authAws.put_ServiceName("devops-guru");
    // SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    rest.SetAuthAws(authAws);

    // URL: https://devops-guru.us-west-2.amazonaws.com/
    // Use the same region as specified above.
    success = rest.Connect("devops-guru.us-west-2.amazonaws.com",443,true,true);
    if (success != true) {
        std::cout << "ConnectFailReason: " << rest.get_ConnectFailReason() << "\r\n";
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    rest.AddHeader("Content-Type","application/x-amz-json-1.1");
    rest.AddHeader("X-Amz-Target","DescribeAnomaly");

    CkStringBuilder sbResponseBody;
    success = rest.FullRequestNoBodySb("GET","/anomalies/{Id}",sbResponseBody);
    if (success != true) {
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    int respStatusCode = rest.get_ResponseStatusCode();
    std::cout << "response status code = " << respStatusCode << "\r\n";
    if (respStatusCode != 200) {
        std::cout << "Response Header:" << "\r\n";
        std::cout << rest.responseHeader() << "\r\n";
        std::cout << "Response Body:" << "\r\n";
        std::cout << sbResponseBody.getAsString() << "\r\n";
        return;
    }

    CkJsonObject jResp;
    jResp.LoadSb(sbResponseBody);

    // The following code parses the JSON response.
    // A sample JSON response is shown below the sample code.

    // Use this online tool to generate parsing code from sample JSON:
    // Generate Parsing Code from JSON

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

    const char *strVal = 0;
    const char *AppBoundaryKey = 0;
    int j;
    int count_j;
    const char *StatusCode = 0;
    const char *MetricName = 0;
    const char *Namespace = 0;
    int Period;
    const char *Stat = 0;
    const char *Unit = 0;
    const char *Value = 0;
    int MetricValue;
    int Timestamp;
    const char *MetricDisplayName = 0;
    const char *v_String = 0;
    const char *Group = 0;
    int GroupByLimit;
    const char *Metric = 0;
    const char *FilterString = 0;
    const char *GroupByGroup = 0;
    const char *MetricQueryMetric = 0;
    int ReferenceScalarValue;
    int k;
    int count_k;
    int Value_int;
    const char *MetricDataSummaryStatusCode = 0;

    int CloseTime = jResp.IntOf("ProactiveAnomaly.AnomalyReportedTimeRange.CloseTime");
    int OpenTime = jResp.IntOf("ProactiveAnomaly.AnomalyReportedTimeRange.OpenTime");
    int EndTime = jResp.IntOf("ProactiveAnomaly.AnomalyTimeRange.EndTime");
    int StartTime = jResp.IntOf("ProactiveAnomaly.AnomalyTimeRange.StartTime");
    const char *AssociatedInsightId = jResp.stringOf("ProactiveAnomaly.AssociatedInsightId");
    const char *Id = jResp.stringOf("ProactiveAnomaly.Id");
    int Limit = jResp.IntOf("ProactiveAnomaly.Limit");
    int PredictionTimeRangeEndTime = jResp.IntOf("ProactiveAnomaly.PredictionTimeRange.EndTime");
    int PredictionTimeRangeStartTime = jResp.IntOf("ProactiveAnomaly.PredictionTimeRange.StartTime");
    const char *Severity = jResp.stringOf("ProactiveAnomaly.Severity");
    const char *Source = jResp.stringOf("ProactiveAnomaly.SourceMetadata.Source");
    const char *SourceResourceName = jResp.stringOf("ProactiveAnomaly.SourceMetadata.SourceResourceName");
    const char *SourceResourceType = jResp.stringOf("ProactiveAnomaly.SourceMetadata.SourceResourceType");
    const char *Status = jResp.stringOf("ProactiveAnomaly.Status");
    int UpdateTime = jResp.IntOf("ProactiveAnomaly.UpdateTime");
    int AnomalyReportedTimeRangeCloseTime = jResp.IntOf("ReactiveAnomaly.AnomalyReportedTimeRange.CloseTime");
    int AnomalyReportedTimeRangeOpenTime = jResp.IntOf("ReactiveAnomaly.AnomalyReportedTimeRange.OpenTime");
    int AnomalyTimeRangeEndTime = jResp.IntOf("ReactiveAnomaly.AnomalyTimeRange.EndTime");
    int AnomalyTimeRangeStartTime = jResp.IntOf("ReactiveAnomaly.AnomalyTimeRange.StartTime");
    const char *ReactiveAnomalyAssociatedInsightId = jResp.stringOf("ReactiveAnomaly.AssociatedInsightId");
    const char *CausalAnomalyId = jResp.stringOf("ReactiveAnomaly.CausalAnomalyId");
    const char *Description = jResp.stringOf("ReactiveAnomaly.Description");
    const char *ReactiveAnomalyId = jResp.stringOf("ReactiveAnomaly.Id");
    const char *Name = jResp.stringOf("ReactiveAnomaly.Name");
    const char *ReactiveAnomalySeverity = jResp.stringOf("ReactiveAnomaly.Severity");
    const char *ReactiveAnomalyStatus = jResp.stringOf("ReactiveAnomaly.Status");
    const char *v_Type = jResp.stringOf("ReactiveAnomaly.Type");
    int i = 0;
    int count_i = jResp.SizeOfArray("ProactiveAnomaly.AnomalyResources");
    while (i < count_i) {
        jResp.put_I(i);
        Name = jResp.stringOf("ProactiveAnomaly.AnomalyResources[i].Name");
        v_Type = jResp.stringOf("ProactiveAnomaly.AnomalyResources[i].Type");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ProactiveAnomaly.ResourceCollection.Tags");
    while (i < count_i) {
        jResp.put_I(i);
        AppBoundaryKey = jResp.stringOf("ProactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey");
        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.ResourceCollection.Tags[i].TagValues");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("ProactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.CloudWatchMetrics");
    while (i < count_i) {
        jResp.put_I(i);
        StatusCode = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.StatusCode");
        MetricName = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricName");
        Namespace = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Namespace");
        Period = jResp.IntOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Period");
        Stat = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Stat");
        Unit = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Unit");
        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions");
        while (j < count_j) {
            jResp.put_J(j);
            Name = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Name");
            Value = jResp.stringOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList");
        while (j < count_j) {
            jResp.put_J(j);
            MetricValue = jResp.IntOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue");
            Timestamp = jResp.IntOf("ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics");
    while (i < count_i) {
        jResp.put_I(i);
        MetricDisplayName = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricDisplayName");
        v_String = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Filter.string");
        Group = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Group");
        GroupByLimit = jResp.IntOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Limit");
        Metric = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Metric");
        Unit = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].Unit");
        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData");
        while (j < count_j) {
            jResp.put_J(j);
            FilterString = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string");
            GroupByGroup = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group");
            GroupByLimit = jResp.IntOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit");
            MetricQueryMetric = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Metric");
            ReferenceScalarValue = jResp.IntOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceScalar.Value");
            Name = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].Name");
            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[k]");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly");
        while (j < count_j) {
            jResp.put_J(j);
            v_Type = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type");
            Value_int = jResp.IntOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline");
        while (j < count_j) {
            jResp.put_J(j);
            v_Type = jResp.stringOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type");
            Value_int = jResp.IntOf("ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ReactiveAnomaly.AnomalyResources");
    while (i < count_i) {
        jResp.put_I(i);
        Name = jResp.stringOf("ReactiveAnomaly.AnomalyResources[i].Name");
        v_Type = jResp.stringOf("ReactiveAnomaly.AnomalyResources[i].Type");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ReactiveAnomaly.ResourceCollection.Tags");
    while (i < count_i) {
        jResp.put_I(i);
        AppBoundaryKey = jResp.stringOf("ReactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey");
        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.ResourceCollection.Tags[i].TagValues");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("ReactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.CloudWatchMetrics");
    while (i < count_i) {
        jResp.put_I(i);
        MetricDataSummaryStatusCode = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.StatusCode");
        MetricName = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricName");
        Namespace = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Namespace");
        Period = jResp.IntOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Period");
        Stat = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Stat");
        Unit = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Unit");
        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions");
        while (j < count_j) {
            jResp.put_J(j);
            Name = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Name");
            Value = jResp.stringOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList");
        while (j < count_j) {
            jResp.put_J(j);
            MetricValue = jResp.IntOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue");
            Timestamp = jResp.IntOf("ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics");
    while (i < count_i) {
        jResp.put_I(i);
        MetricDisplayName = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricDisplayName");
        FilterString = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Filter.string");
        GroupByGroup = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Group");
        GroupByLimit = jResp.IntOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Limit");
        MetricQueryMetric = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Metric");
        Unit = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].Unit");
        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData");
        while (j < count_j) {
            jResp.put_J(j);
            FilterString = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string");
            GroupByGroup = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group");
            GroupByLimit = jResp.IntOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit");
            MetricQueryMetric = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Metric");
            ReferenceScalarValue = jResp.IntOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceScalar.Value");
            Name = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].Name");
            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[k]");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly");
        while (j < count_j) {
            jResp.put_J(j);
            v_Type = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type");
            Value_int = jResp.IntOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline");
        while (j < count_j) {
            jResp.put_J(j);
            v_Type = jResp.stringOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type");
            Value_int = jResp.IntOf("ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value");
            j = j + 1;
        }

        i = i + 1;
    }

    // A sample JSON response body parsed by the above code:

    // {
    //   "ProactiveAnomaly": {
    //     "AnomalyReportedTimeRange": {
    //       "CloseTime": number,
    //       "OpenTime": number
    //     },
    //     "AnomalyResources": [
    //       {
    //         "Name": "string",
    //         "Type": "string"
    //       }
    //     ],
    //     "AnomalyTimeRange": {
    //       "EndTime": number,
    //       "StartTime": number
    //     },
    //     "AssociatedInsightId": "string",
    //     "Id": "string",
    //     "Limit": number,
    //     "PredictionTimeRange": {
    //       "EndTime": number,
    //       "StartTime": number
    //     },
    //     "ResourceCollection": {
    //       "CloudFormation": {
    //         "StackNames": [
    //           "string"
    //         ]
    //       },
    //       "Tags": [
    //         {
    //           "AppBoundaryKey": "string",
    //           "TagValues": [
    //             "string"
    //           ]
    //         }
    //       ]
    //     },
    //     "Severity": "string",
    //     "SourceDetails": {
    //       "CloudWatchMetrics": [
    //         {
    //           "Dimensions": [
    //             {
    //               "Name": "string",
    //               "Value": "string"
    //             }
    //           ],
    //           "MetricDataSummary": {
    //             "StatusCode": "string",
    //             "TimestampMetricValuePairList": [
    //               {
    //                 "MetricValue": number,
    //                 "Timestamp": number
    //               }
    //             ]
    //           },
    //           "MetricName": "string",
    //           "Namespace": "string",
    //           "Period": number,
    //           "Stat": "string",
    //           "Unit": "string"
    //         }
    //       ],
    //       "PerformanceInsightsMetrics": [
    //         {
    //           "MetricDisplayName": "string",
    //           "MetricQuery": {
    //             "Filter": {
    //               "string": "string"
    //             },
    //             "GroupBy": {
    //               "Dimensions": [
    //                 "string"
    //               ],
    //               "Group": "string",
    //               "Limit": number
    //             },
    //             "Metric": "string"
    //           },
    //           "ReferenceData": [
    //             {
    //               "ComparisonValues": {
    //                 "ReferenceMetric": {
    //                   "MetricQuery": {
    //                     "Filter": {
    //                       "string": "string"
    //                     },
    //                     "GroupBy": {
    //                       "Dimensions": [
    //                         "string"
    //                       ],
    //                       "Group": "string",
    //                       "Limit": number
    //                     },
    //                     "Metric": "string"
    //                   }
    //                 },
    //                 "ReferenceScalar": {
    //                   "Value": number
    //                 }
    //               },
    //               "Name": "string"
    //             }
    //           ],
    //           "StatsAtAnomaly": [
    //             {
    //               "Type": "string",
    //               "Value": number
    //             }
    //           ],
    //           "StatsAtBaseline": [
    //             {
    //               "Type": "string",
    //               "Value": number
    //             }
    //           ],
    //           "Unit": "string"
    //         }
    //       ]
    //     },
    //     "SourceMetadata": {
    //       "Source": "string",
    //       "SourceResourceName": "string",
    //       "SourceResourceType": "string"
    //     },
    //     "Status": "string",
    //     "UpdateTime": number
    //   },
    //   "ReactiveAnomaly": {
    //     "AnomalyReportedTimeRange": {
    //       "CloseTime": number,
    //       "OpenTime": number
    //     },
    //     "AnomalyResources": [
    //       {
    //         "Name": "string",
    //         "Type": "string"
    //       }
    //     ],
    //     "AnomalyTimeRange": {
    //       "EndTime": number,
    //       "StartTime": number
    //     },
    //     "AssociatedInsightId": "string",
    //     "CausalAnomalyId": "string",
    //     "Description": "string",
    //     "Id": "string",
    //     "Name": "string",
    //     "ResourceCollection": {
    //       "CloudFormation": {
    //         "StackNames": [
    //           "string"
    //         ]
    //       },
    //       "Tags": [
    //         {
    //           "AppBoundaryKey": "string",
    //           "TagValues": [
    //             "string"
    //           ]
    //         }
    //       ]
    //     },
    //     "Severity": "string",
    //     "SourceDetails": {
    //       "CloudWatchMetrics": [
    //         {
    //           "Dimensions": [
    //             {
    //               "Name": "string",
    //               "Value": "string"
    //             }
    //           ],
    //           "MetricDataSummary": {
    //             "StatusCode": "string",
    //             "TimestampMetricValuePairList": [
    //               {
    //                 "MetricValue": number,
    //                 "Timestamp": number
    //               }
    //             ]
    //           },
    //           "MetricName": "string",
    //           "Namespace": "string",
    //           "Period": number,
    //           "Stat": "string",
    //           "Unit": "string"
    //         }
    //       ],
    //       "PerformanceInsightsMetrics": [
    //         {
    //           "MetricDisplayName": "string",
    //           "MetricQuery": {
    //             "Filter": {
    //               "string": "string"
    //             },
    //             "GroupBy": {
    //               "Dimensions": [
    //                 "string"
    //               ],
    //               "Group": "string",
    //               "Limit": number
    //             },
    //             "Metric": "string"
    //           },
    //           "ReferenceData": [
    //             {
    //               "ComparisonValues": {
    //                 "ReferenceMetric": {
    //                   "MetricQuery": {
    //                     "Filter": {
    //                       "string": "string"
    //                     },
    //                     "GroupBy": {
    //                       "Dimensions": [
    //                         "string"
    //                       ],
    //                       "Group": "string",
    //                       "Limit": number
    //                     },
    //                     "Metric": "string"
    //                   }
    //                 },
    //                 "ReferenceScalar": {
    //                   "Value": number
    //                 }
    //               },
    //               "Name": "string"
    //             }
    //           ],
    //           "StatsAtAnomaly": [
    //             {
    //               "Type": "string",
    //               "Value": number
    //             }
    //           ],
    //           "StatsAtBaseline": [
    //             {
    //               "Type": "string",
    //               "Value": number
    //             }
    //           ],
    //           "Unit": "string"
    //         }
    //       ]
    //     },
    //     "Status": "string",
    //     "Type": "string"
    //   }
    // }
    }