Chilkat Online Tools

DescribeAnomaly delphiDll Example

Amazon DevOps Guru

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

begin
// 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) then
  begin
    Memo1.Lines.Add('ConnectFailReason: ' + IntToStr(CkRest_getConnectFailReason(rest)));
    Memo1.Lines.Add(CkRest__lastErrorText(rest));
    Exit;
  end;

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) then
  begin
    Memo1.Lines.Add(CkRest__lastErrorText(rest));
    Exit;
  end;
respStatusCode := CkRest_getResponseStatusCode(rest);
Memo1.Lines.Add('response status code = ' + IntToStr(respStatusCode));
if (respStatusCode <> 200) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(CkRest__responseHeader(rest));
    Memo1.Lines.Add('Response Body:');
    Memo1.Lines.Add(CkStringBuilder__getAsString(sbResponseBody));
    Exit;
  end;

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

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 do
  begin
    CkJsonObject_putI(jResp,i);
    Name := CkJsonObject__stringOf(jResp,'ProactiveAnomaly.AnomalyResources[i].Name');
    v_Type := CkJsonObject__stringOf(jResp,'ProactiveAnomaly.AnomalyResources[i].Type');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    strVal := CkJsonObject__stringOf(jResp,'ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.ResourceCollection.Tags');
while i < count_i do
  begin
    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 do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'ProactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]');
        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.SourceDetails.CloudWatchMetrics');
while i < count_i do
  begin
    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 do
      begin
        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;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList');
    while j < count_j do
      begin
        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;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics');
while i < count_i do
  begin
    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 do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData');
    while j < count_j do
      begin
        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 do
          begin
            CkJsonObject_putK(jResp,k);
            strVal := CkJsonObject__stringOf(jResp,'ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[k]');
            k := k + 1;
          end;

        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly');
    while j < count_j do
      begin
        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;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline');
    while j < count_j do
      begin
        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;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.AnomalyResources');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    Name := CkJsonObject__stringOf(jResp,'ReactiveAnomaly.AnomalyResources[i].Name');
    v_Type := CkJsonObject__stringOf(jResp,'ReactiveAnomaly.AnomalyResources[i].Type');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames');
while i < count_i do
  begin
    CkJsonObject_putI(jResp,i);
    strVal := CkJsonObject__stringOf(jResp,'ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]');
    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.ResourceCollection.Tags');
while i < count_i do
  begin
    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 do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'ReactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]');
        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.SourceDetails.CloudWatchMetrics');
while i < count_i do
  begin
    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 do
      begin
        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;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList');
    while j < count_j do
      begin
        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;
      end;

    i := i + 1;
  end;

i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics');
while i < count_i do
  begin
    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 do
      begin
        CkJsonObject_putJ(jResp,j);
        strVal := CkJsonObject__stringOf(jResp,'ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData');
    while j < count_j do
      begin
        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 do
          begin
            CkJsonObject_putK(jResp,k);
            strVal := CkJsonObject__stringOf(jResp,'ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[k]');
            k := k + 1;
          end;

        j := j + 1;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly');
    while j < count_j do
      begin
        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;
      end;

    j := 0;
    count_j := CkJsonObject_SizeOfArray(jResp,'ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline');
    while j < count_j do
      begin
        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;
      end;

    i := i + 1;
  end;

// 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);