Chilkat Online Tools

ListAnomaliesForInsight Swift3 Example

Amazon DevOps Guru

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

    let rest = CkoRest()!
    var success: Bool

    let authAws = CkoAuthAws()!
    authAws.accessKey = "AWS_ACCESS_KEY"
    authAws.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.region = "us-west-2"
    authAws.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", port: 443, tls: true, autoReconnect: true)
    if success != true {
        print("ConnectFailReason: \(rest.connectFailReason.intValue)")
        print("\(rest.lastErrorText!)")
        return
    }

    // The following code creates the JSON request body.
    // The JSON created by this code is shown below.

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

    let json = CkoJsonObject()!
    json.update("AccountId", value: "string")
    json.updateInt("MaxResults", value: 123)
    json.update("NextToken", value: "string")
    json.updateInt("StartTimeRange.FromTime", value: 123)
    json.updateInt("StartTimeRange.ToTime", value: 123)

    // The JSON request body created by the above code:

    // {
    //   "AccountId": "string",
    //   "MaxResults": number,
    //   "NextToken": "string",
    //   "StartTimeRange": {
    //     "FromTime": number,
    //     "ToTime": number
    //   }
    // }

    rest.addHeader("Content-Type", value: "application/x-amz-json-1.1")
    rest.addHeader("X-Amz-Target", value: "ListAnomaliesForInsight")

    let sbRequestBody = CkoStringBuilder()!
    json.emitSb(sbRequestBody)
    let sbResponseBody = CkoStringBuilder()!
    success = rest.fullRequestSb("POST", uriPath: "/anomalies/insight/{InsightId}", requestBody: sbRequestBody, responseBody: sbResponseBody)
    if success != true {
        print("\(rest.lastErrorText!)")
        return
    }

    var respStatusCode: Int = rest.responseStatusCode.intValue
    print("response status code = \(respStatusCode)")
    if respStatusCode != 200 {
        print("Response Header:")
        print("\(rest.responseHeader!)")
        print("Response Body:")
        print("\(sbResponseBody.getAsString()!)")
        return
    }

    let jResp = CkoJsonObject()!
    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

    var CloseTime: Int
    var OpenTime: Int
    var EndTime: Int
    var StartTime: Int
    var AssociatedInsightId: String?
    var Id: String?
    var Limit: Int
    var PredictionTimeRangeEndTime: Int
    var PredictionTimeRangeStartTime: Int
    var Severity: String?
    var Source: String?
    var SourceResourceName: String?
    var SourceResourceType: String?
    var Status: String?
    var UpdateTime: Int
    var j: Int
    var count_j: Int
    var Name: String?
    var v_Type: String?
    var strVal: String?
    var AppBoundaryKey: String?
    var k: Int
    var count_k: Int
    var StatusCode: String?
    var MetricName: String?
    var Namespace: String?
    var Period: Int
    var Stat: String?
    var Unit: String?
    var Value: String?
    var MetricValue: Int
    var Timestamp: Int
    var MetricDisplayName: String?
    var v_String: String?
    var Group: String?
    var GroupByLimit: Int
    var Metric: String?
    var FilterString: String?
    var GroupByGroup: String?
    var MetricQueryMetric: String?
    var ReferenceScalarValue: Int
    var json1: CkoJsonObject?
    var i1: Int
    var count_i1: Int
    var Value_int: Int
    var AnomalyReportedTimeRangeCloseTime: Int
    var AnomalyReportedTimeRangeOpenTime: Int
    var AnomalyTimeRangeEndTime: Int
    var AnomalyTimeRangeStartTime: Int
    var CausalAnomalyId: String?
    var Description: String?
    var MetricDataSummaryStatusCode: String?

    var NextToken: String? = jResp.string(of: "NextToken")
    var i: Int = 0
    var count_i: Int = jResp.size(ofArray: "ProactiveAnomalies").intValue
    while i < count_i {
        jResp.i = i
        CloseTime = jResp.int(of: "ProactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime").intValue
        OpenTime = jResp.int(of: "ProactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime").intValue
        EndTime = jResp.int(of: "ProactiveAnomalies[i].AnomalyTimeRange.EndTime").intValue
        StartTime = jResp.int(of: "ProactiveAnomalies[i].AnomalyTimeRange.StartTime").intValue
        AssociatedInsightId = jResp.string(of: "ProactiveAnomalies[i].AssociatedInsightId")
        Id = jResp.string(of: "ProactiveAnomalies[i].Id")
        Limit = jResp.int(of: "ProactiveAnomalies[i].Limit").intValue
        PredictionTimeRangeEndTime = jResp.int(of: "ProactiveAnomalies[i].PredictionTimeRange.EndTime").intValue
        PredictionTimeRangeStartTime = jResp.int(of: "ProactiveAnomalies[i].PredictionTimeRange.StartTime").intValue
        Severity = jResp.string(of: "ProactiveAnomalies[i].Severity")
        Source = jResp.string(of: "ProactiveAnomalies[i].SourceMetadata.Source")
        SourceResourceName = jResp.string(of: "ProactiveAnomalies[i].SourceMetadata.SourceResourceName")
        SourceResourceType = jResp.string(of: "ProactiveAnomalies[i].SourceMetadata.SourceResourceType")
        Status = jResp.string(of: "ProactiveAnomalies[i].Status")
        UpdateTime = jResp.int(of: "ProactiveAnomalies[i].UpdateTime").intValue
        j = 0
        count_j = jResp.size(ofArray: "ProactiveAnomalies[i].AnomalyResources").intValue
        while j < count_j {
            jResp.j = j
            Name = jResp.string(of: "ProactiveAnomalies[i].AnomalyResources[j].Name")
            v_Type = jResp.string(of: "ProactiveAnomalies[i].AnomalyResources[j].Type")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ProactiveAnomalies[i].ResourceCollection.Tags").intValue
        while j < count_j {
            jResp.j = j
            AppBoundaryKey = jResp.string(of: "ProactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey")
            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues").intValue
            while k < count_k {
                jResp.k = k
                strVal = jResp.string(of: "ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues[k]")
                k = k + 1
            }

            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics").intValue
        while j < count_j {
            jResp.j = j
            StatusCode = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.StatusCode")
            MetricName = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricName")
            Namespace = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Namespace")
            Period = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Period").intValue
            Stat = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Stat")
            Unit = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Unit")
            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions").intValue
            while k < count_k {
                jResp.k = k
                Name = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Name")
                Value = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Value")
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList").intValue
            while k < count_k {
                jResp.k = k
                MetricValue = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue").intValue
                Timestamp = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp").intValue
                k = k + 1
            }

            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics").intValue
        while j < count_j {
            jResp.j = j
            MetricDisplayName = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricDisplayName")
            v_String = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Filter.string")
            Group = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Group")
            GroupByLimit = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Limit").intValue
            Metric = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Metric")
            Unit = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].Unit")
            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions").intValue
            while k < count_k {
                jResp.k = k
                strVal = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions[k]")
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData").intValue
            while k < count_k {
                jResp.k = k
                FilterString = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string")
                GroupByGroup = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group")
                GroupByLimit = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit").intValue
                MetricQueryMetric = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Metric")
                ReferenceScalarValue = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceScalar.Value").intValue
                Name = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].Name")

                json1 = jResp.object(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k]")
                i1 = 0
                count_i1 = json1!.size(ofArray: "ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions").intValue
                while i1 < count_i1 {
                    json1.i = i1
                    strVal = json1!.string(of: "ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]")
                    i1 = i1 + 1
                }

                json1 = nil
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly").intValue
            while k < count_k {
                jResp.k = k
                v_Type = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Type")
                Value_int = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Value").intValue
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline").intValue
            while k < count_k {
                jResp.k = k
                v_Type = jResp.string(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Type")
                Value_int = jResp.int(of: "ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Value").intValue
                k = k + 1
            }

            j = j + 1
        }

        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "ReactiveAnomalies").intValue
    while i < count_i {
        jResp.i = i
        AnomalyReportedTimeRangeCloseTime = jResp.int(of: "ReactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime").intValue
        AnomalyReportedTimeRangeOpenTime = jResp.int(of: "ReactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime").intValue
        AnomalyTimeRangeEndTime = jResp.int(of: "ReactiveAnomalies[i].AnomalyTimeRange.EndTime").intValue
        AnomalyTimeRangeStartTime = jResp.int(of: "ReactiveAnomalies[i].AnomalyTimeRange.StartTime").intValue
        AssociatedInsightId = jResp.string(of: "ReactiveAnomalies[i].AssociatedInsightId")
        CausalAnomalyId = jResp.string(of: "ReactiveAnomalies[i].CausalAnomalyId")
        Description = jResp.string(of: "ReactiveAnomalies[i].Description")
        Id = jResp.string(of: "ReactiveAnomalies[i].Id")
        Name = jResp.string(of: "ReactiveAnomalies[i].Name")
        Severity = jResp.string(of: "ReactiveAnomalies[i].Severity")
        Status = jResp.string(of: "ReactiveAnomalies[i].Status")
        v_Type = jResp.string(of: "ReactiveAnomalies[i].Type")
        j = 0
        count_j = jResp.size(ofArray: "ReactiveAnomalies[i].AnomalyResources").intValue
        while j < count_j {
            jResp.j = j
            Name = jResp.string(of: "ReactiveAnomalies[i].AnomalyResources[j].Name")
            v_Type = jResp.string(of: "ReactiveAnomalies[i].AnomalyResources[j].Type")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ReactiveAnomalies[i].ResourceCollection.Tags").intValue
        while j < count_j {
            jResp.j = j
            AppBoundaryKey = jResp.string(of: "ReactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey")
            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues").intValue
            while k < count_k {
                jResp.k = k
                strVal = jResp.string(of: "ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues[k]")
                k = k + 1
            }

            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics").intValue
        while j < count_j {
            jResp.j = j
            MetricDataSummaryStatusCode = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.StatusCode")
            MetricName = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricName")
            Namespace = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Namespace")
            Period = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Period").intValue
            Stat = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Stat")
            Unit = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Unit")
            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions").intValue
            while k < count_k {
                jResp.k = k
                Name = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Name")
                Value = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Value")
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList").intValue
            while k < count_k {
                jResp.k = k
                MetricValue = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue").intValue
                Timestamp = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp").intValue
                k = k + 1
            }

            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics").intValue
        while j < count_j {
            jResp.j = j
            MetricDisplayName = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricDisplayName")
            FilterString = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Filter.string")
            GroupByGroup = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Group")
            GroupByLimit = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Limit").intValue
            MetricQueryMetric = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Metric")
            Unit = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].Unit")
            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions").intValue
            while k < count_k {
                jResp.k = k
                strVal = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions[k]")
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData").intValue
            while k < count_k {
                jResp.k = k
                FilterString = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string")
                GroupByGroup = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group")
                GroupByLimit = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit").intValue
                MetricQueryMetric = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Metric")
                ReferenceScalarValue = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceScalar.Value").intValue
                Name = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].Name")

                json1 = jResp.object(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k]")
                i1 = 0
                count_i1 = json1!.size(ofArray: "ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions").intValue
                while i1 < count_i1 {
                    json1.i = i1
                    strVal = json1!.string(of: "ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]")
                    i1 = i1 + 1
                }

                json1 = nil
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly").intValue
            while k < count_k {
                jResp.k = k
                v_Type = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Type")
                Value_int = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Value").intValue
                k = k + 1
            }

            k = 0
            count_k = jResp.size(ofArray: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline").intValue
            while k < count_k {
                jResp.k = k
                v_Type = jResp.string(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Type")
                Value_int = jResp.int(of: "ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Value").intValue
                k = k + 1
            }

            j = j + 1
        }

        i = i + 1
    }

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

    // {
    //   "NextToken": "string",
    //   "ProactiveAnomalies": [
    //     {
    //       "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
    //     }
    //   ],
    //   "ReactiveAnomalies": [
    //     {
    //       "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"
    //     }
    //   ]
    // }

}