Chilkat Online Tools

DescribeAnomaly Objective-C Example

Amazon DevOps Guru

#import <CkoRest.h>
#import <CkoAuthAws.h>
#import <CkoStringBuilder.h>
#import <CkoJsonObject.h>
#import <NSString.h>

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

CkoRest *rest = [[CkoRest alloc] init];
BOOL success;

CkoAuthAws *authAws = [[CkoAuthAws alloc] init];
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: [NSNumber numberWithInt: 443] tls: YES autoReconnect: YES];
if (success != YES) {
    NSLog(@"%@%d",@"ConnectFailReason: ",[rest.ConnectFailReason intValue]);
    NSLog(@"%@",rest.LastErrorText);
    return;
}

[rest AddHeader: @"Content-Type" value: @"application/x-amz-json-1.1"];
[rest AddHeader: @"X-Amz-Target" value: @"DescribeAnomaly"];

CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"GET" uriPath: @"/anomalies/{Id}" sb: sbResponseBody];
if (success != YES) {
    NSLog(@"%@",rest.LastErrorText);
    return;
}

int respStatusCode = [rest.ResponseStatusCode intValue];
NSLog(@"%@%d",@"response status code = ",respStatusCode);
if (respStatusCode != 200) {
    NSLog(@"%@",@"Response Header:");
    NSLog(@"%@",rest.ResponseHeader);
    NSLog(@"%@",@"Response Body:");
    NSLog(@"%@",[sbResponseBody GetAsString]);
    return;
}

CkoJsonObject *jResp = [[CkoJsonObject alloc] init];
[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

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

int CloseTime = [[jResp IntOf: @"ProactiveAnomaly.AnomalyReportedTimeRange.CloseTime"] intValue];
int OpenTime = [[jResp IntOf: @"ProactiveAnomaly.AnomalyReportedTimeRange.OpenTime"] intValue];
int EndTime = [[jResp IntOf: @"ProactiveAnomaly.AnomalyTimeRange.EndTime"] intValue];
int StartTime = [[jResp IntOf: @"ProactiveAnomaly.AnomalyTimeRange.StartTime"] intValue];
NSString *AssociatedInsightId = [jResp StringOf: @"ProactiveAnomaly.AssociatedInsightId"];
NSString *Id = [jResp StringOf: @"ProactiveAnomaly.Id"];
int Limit = [[jResp IntOf: @"ProactiveAnomaly.Limit"] intValue];
int PredictionTimeRangeEndTime = [[jResp IntOf: @"ProactiveAnomaly.PredictionTimeRange.EndTime"] intValue];
int PredictionTimeRangeStartTime = [[jResp IntOf: @"ProactiveAnomaly.PredictionTimeRange.StartTime"] intValue];
NSString *Severity = [jResp StringOf: @"ProactiveAnomaly.Severity"];
NSString *Source = [jResp StringOf: @"ProactiveAnomaly.SourceMetadata.Source"];
NSString *SourceResourceName = [jResp StringOf: @"ProactiveAnomaly.SourceMetadata.SourceResourceName"];
NSString *SourceResourceType = [jResp StringOf: @"ProactiveAnomaly.SourceMetadata.SourceResourceType"];
NSString *Status = [jResp StringOf: @"ProactiveAnomaly.Status"];
int UpdateTime = [[jResp IntOf: @"ProactiveAnomaly.UpdateTime"] intValue];
int AnomalyReportedTimeRangeCloseTime = [[jResp IntOf: @"ReactiveAnomaly.AnomalyReportedTimeRange.CloseTime"] intValue];
int AnomalyReportedTimeRangeOpenTime = [[jResp IntOf: @"ReactiveAnomaly.AnomalyReportedTimeRange.OpenTime"] intValue];
int AnomalyTimeRangeEndTime = [[jResp IntOf: @"ReactiveAnomaly.AnomalyTimeRange.EndTime"] intValue];
int AnomalyTimeRangeStartTime = [[jResp IntOf: @"ReactiveAnomaly.AnomalyTimeRange.StartTime"] intValue];
NSString *ReactiveAnomalyAssociatedInsightId = [jResp StringOf: @"ReactiveAnomaly.AssociatedInsightId"];
NSString *CausalAnomalyId = [jResp StringOf: @"ReactiveAnomaly.CausalAnomalyId"];
NSString *Description = [jResp StringOf: @"ReactiveAnomaly.Description"];
NSString *ReactiveAnomalyId = [jResp StringOf: @"ReactiveAnomaly.Id"];
NSString *Name = [jResp StringOf: @"ReactiveAnomaly.Name"];
NSString *ReactiveAnomalySeverity = [jResp StringOf: @"ReactiveAnomaly.Severity"];
NSString *ReactiveAnomalyStatus = [jResp StringOf: @"ReactiveAnomaly.Status"];
NSString *v_Type = [jResp StringOf: @"ReactiveAnomaly.Type"];
int i = 0;
int count_i = [[jResp SizeOfArray: @"ProactiveAnomaly.AnomalyResources"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: 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"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    strVal = [jResp StringOf: @"ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]"];
    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"ProactiveAnomaly.ResourceCollection.Tags"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    AppBoundaryKey = [jResp StringOf: @"ProactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey"];
    j = 0;
    count_j = [[jResp SizeOfArray: @"ProactiveAnomaly.ResourceCollection.Tags[i].TagValues"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: 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"] intValue];
    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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        MetricValue = [[jResp IntOf: @"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue"] intValue];
        Timestamp = [[jResp IntOf: @"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp"] intValue];
        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: 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"] intValue];
    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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
        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"] intValue];
        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"] intValue];
        while (k < count_k) {
            jResp.K = [NSNumber numberWithInt: 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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        v_Type = [jResp StringOf: @"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type"];
        Value_int = [[jResp IntOf: @"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value"] intValue];
        j = j + 1;
    }

    j = 0;
    count_j = [[jResp SizeOfArray: @"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        v_Type = [jResp StringOf: @"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type"];
        Value_int = [[jResp IntOf: @"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value"] intValue];
        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"ReactiveAnomaly.AnomalyResources"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: 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"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    strVal = [jResp StringOf: @"ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]"];
    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"ReactiveAnomaly.ResourceCollection.Tags"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    AppBoundaryKey = [jResp StringOf: @"ReactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey"];
    j = 0;
    count_j = [[jResp SizeOfArray: @"ReactiveAnomaly.ResourceCollection.Tags[i].TagValues"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: 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"] intValue];
    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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        MetricValue = [[jResp IntOf: @"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue"] intValue];
        Timestamp = [[jResp IntOf: @"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp"] intValue];
        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: 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"] intValue];
    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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: 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"] intValue];
        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"] intValue];
        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"] intValue];
        while (k < count_k) {
            jResp.K = [NSNumber numberWithInt: 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"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        v_Type = [jResp StringOf: @"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type"];
        Value_int = [[jResp IntOf: @"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value"] intValue];
        j = j + 1;
    }

    j = 0;
    count_j = [[jResp SizeOfArray: @"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        v_Type = [jResp StringOf: @"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type"];
        Value_int = [[jResp IntOf: @"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value"] intValue];
        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"
//   }
// }