Chilkat Online Tools

DescribeAnomaly C Example

Amazon DevOps Guru

#include <C_CkRest.h>
#include <C_CkAuthAws.h>
#include <C_CkStringBuilder.h>
#include <C_CkJsonObject.h>

void ChilkatSample(void)
    {
    HCkRest rest;
    BOOL success;
    HCkAuthAws authAws;
    HCkStringBuilder sbResponseBody;
    int respStatusCode;
    HCkJsonObject jResp;
    const char *strVal;
    const char *AppBoundaryKey;
    int j;
    int count_j;
    const char *StatusCode;
    const char *MetricName;
    const char *Namespace;
    int Period;
    const char *Stat;
    const char *Unit;
    const char *Value;
    int MetricValue;
    int Timestamp;
    const char *MetricDisplayName;
    const char *v_String;
    const char *Group;
    int GroupByLimit;
    const char *Metric;
    const char *FilterString;
    const char *GroupByGroup;
    const char *MetricQueryMetric;
    int ReferenceScalarValue;
    int k;
    int count_k;
    int Value_int;
    const char *MetricDataSummaryStatusCode;
    int CloseTime;
    int OpenTime;
    int EndTime;
    int StartTime;
    const char *AssociatedInsightId;
    const char *Id;
    int Limit;
    int PredictionTimeRangeEndTime;
    int PredictionTimeRangeStartTime;
    const char *Severity;
    const char *Source;
    const char *SourceResourceName;
    const char *SourceResourceType;
    const char *Status;
    int UpdateTime;
    int AnomalyReportedTimeRangeCloseTime;
    int AnomalyReportedTimeRangeOpenTime;
    int AnomalyTimeRangeEndTime;
    int AnomalyTimeRangeStartTime;
    const char *ReactiveAnomalyAssociatedInsightId;
    const char *CausalAnomalyId;
    const char *Description;
    const char *ReactiveAnomalyId;
    const char *Name;
    const char *ReactiveAnomalySeverity;
    const char *ReactiveAnomalyStatus;
    const char *v_Type;
    int i;
    int count_i;

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

    rest = CkRest_Create();

    authAws = CkAuthAws_Create();
    CkAuthAws_putAccessKey(authAws,"AWS_ACCESS_KEY");
    CkAuthAws_putSecretKey(authAws,"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.)
    CkAuthAws_putRegion(authAws,"us-west-2");
    CkAuthAws_putServiceName(authAws,"devops-guru");
    // SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    CkRest_SetAuthAws(rest,authAws);

    // URL: https://devops-guru.us-west-2.amazonaws.com/
    // Use the same region as specified above.
    success = CkRest_Connect(rest,"devops-guru.us-west-2.amazonaws.com",443,TRUE,TRUE);
    if (success != TRUE) {
        printf("ConnectFailReason: %d\n",CkRest_getConnectFailReason(rest));
        printf("%s\n",CkRest_lastErrorText(rest));
        CkRest_Dispose(rest);
        CkAuthAws_Dispose(authAws);
        return;
    }

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

    sbResponseBody = CkStringBuilder_Create();
    success = CkRest_FullRequestNoBodySb(rest,"GET","/anomalies/{Id}",sbResponseBody);
    if (success != TRUE) {
        printf("%s\n",CkRest_lastErrorText(rest));
        CkRest_Dispose(rest);
        CkAuthAws_Dispose(authAws);
        CkStringBuilder_Dispose(sbResponseBody);
        return;
    }

    respStatusCode = CkRest_getResponseStatusCode(rest);
    printf("response status code = %d\n",respStatusCode);
    if (respStatusCode != 200) {
        printf("Response Header:\n");
        printf("%s\n",CkRest_responseHeader(rest));
        printf("Response Body:\n");
        printf("%s\n",CkStringBuilder_getAsString(sbResponseBody));
        CkRest_Dispose(rest);
        CkAuthAws_Dispose(authAws);
        CkStringBuilder_Dispose(sbResponseBody);
        return;
    }

    jResp = CkJsonObject_Create();
    CkJsonObject_LoadSb(jResp,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.

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

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        strVal = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.ResourceCollection.Tags");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        AppBoundaryKey = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.ResourceCollection.Tags[i].TagValues");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            strVal = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        StatusCode = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.StatusCode");
        MetricName = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricName");
        Namespace = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Namespace");
        Period = CkJsonObject_IntOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Period");
        Stat = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Stat");
        Unit = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Unit");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            Name = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Name");
            Value = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            MetricValue = CkJsonObject_IntOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue");
            Timestamp = CkJsonObject_IntOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        MetricDisplayName = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricDisplayName");
        v_String = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Filter.string");
        Group = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Group");
        GroupByLimit = CkJsonObject_IntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Limit");
        Metric = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Metric");
        Unit = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].Unit");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            strVal = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]");
            j = j + 1;
        }

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

            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            v_Type = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type");
            Value_int = CkJsonObject_IntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            v_Type = CkJsonObject_stringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type");
            Value_int = CkJsonObject_IntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.AnomalyResources");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        Name = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.AnomalyResources[i].Name");
        v_Type = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.AnomalyResources[i].Type");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        strVal = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.ResourceCollection.Tags");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        AppBoundaryKey = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.ResourceCollection.Tags[i].TagValues");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            strVal = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        MetricDataSummaryStatusCode = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.StatusCode");
        MetricName = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricName");
        Namespace = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Namespace");
        Period = CkJsonObject_IntOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Period");
        Stat = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Stat");
        Unit = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Unit");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            Name = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Name");
            Value = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            MetricValue = CkJsonObject_IntOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue");
            Timestamp = CkJsonObject_IntOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        MetricDisplayName = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricDisplayName");
        FilterString = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Filter.string");
        GroupByGroup = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Group");
        GroupByLimit = CkJsonObject_IntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Limit");
        MetricQueryMetric = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Metric");
        Unit = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].Unit");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            strVal = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]");
            j = j + 1;
        }

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

            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            v_Type = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type");
            Value_int = CkJsonObject_IntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            v_Type = CkJsonObject_stringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type");
            Value_int = CkJsonObject_IntOf(jResp,"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"
    //   }
    // }


    CkRest_Dispose(rest);
    CkAuthAws_Dispose(authAws);
    CkStringBuilder_Dispose(sbResponseBody);
    CkJsonObject_Dispose(jResp);

    }