Chilkat Online Tools

StartBuildBatch delphiAx Example

AWS CodeBuild

var
rest: TChilkatRest;
success: Integer;
authAws: TChilkatAuthAws;
json: TChilkatJsonObject;
sbRequestBody: TChilkatStringBuilder;
sbResponseBody: TChilkatStringBuilder;
respStatusCode: Integer;
jResp: TChilkatJsonObject;
strVal: WideString;
currentBuildSummaryArn: WideString;
BuildStatus: WideString;
Identifier: WideString;
PrimaryArtifactLocation: WideString;
PrimaryArtifactType: WideString;
RequestedOn: Integer;
identifier: WideString;
ignoreFailure: Integer;
j: Integer;
count_j: Integer;
location: WideString;
v_type: WideString;
arn: WideString;
buildStatus: WideString;
primaryArtifactIdentifier: WideString;
primaryArtifactLocation: WideString;
primaryArtifactType: WideString;
requestedOn: Integer;
k: Integer;
count_k: Integer;
name: WideString;
value: WideString;
mountOptions: WideString;
mountPoint: WideString;
durationInSeconds: Integer;
endTime: Integer;
phaseStatus: WideString;
phaseType: WideString;
startTime: Integer;
message: WideString;
statusCode: WideString;
artifactIdentifier: WideString;
bucketOwnerAccess: WideString;
encryptionDisabled: Integer;
md5sum: WideString;
overrideArtifactName: Integer;
sha256sum: WideString;
authResource: WideString;
authType: WideString;
buildspec: WideString;
buildStatusConfigContext: WideString;
buildStatusConfigTargetUrl: WideString;
gitCloneDepth: Integer;
gitSubmodulesConfigFetchSubmodules: Integer;
insecureSsl: Integer;
reportBuildStatus: Integer;
sourceIdentifier: WideString;
sourceVersion: WideString;
Arn: WideString;
ArtifactIdentifier: WideString;
BucketOwnerAccess: WideString;
EncryptionDisabled: Integer;
Location: WideString;
Md5sum: WideString;
OverrideArtifactName: Integer;
Sha256sum: WideString;
BatchReportMode: WideString;
CombineArtifacts: Integer;
MaximumBuildsAllowed: Integer;
ServiceRole: WideString;
TimeoutInMins: Integer;
BuildBatchNumber: Integer;
BuildBatchStatus: WideString;
BuildTimeoutInMinutes: Integer;
CacheLocation: WideString;
v_Type: WideString;
Complete: Integer;
CurrentPhase: WideString;
DebugSessionEnabled: Integer;
EncryptionKey: WideString;
EndTime: Integer;
Certificate: WideString;
ComputeType: WideString;
Image: WideString;
ImagePullCredentialsType: WideString;
PrivilegedMode: Integer;
Credential: WideString;
CredentialProvider: WideString;
EnvironmentType: WideString;
Id: WideString;
Initiator: WideString;
GroupName: WideString;
Status: WideString;
StreamName: WideString;
S3LogsBucketOwnerAccess: WideString;
S3LogsEncryptionDisabled: Integer;
S3LogsLocation: WideString;
S3LogsStatus: WideString;
ProjectName: WideString;
QueuedTimeoutInMinutes: Integer;
ResolvedSourceVersion: WideString;
buildBatchServiceRole: WideString;
Resource: WideString;
AuthType: WideString;
Buildspec: WideString;
Context: WideString;
TargetUrl: WideString;
GitCloneDepth: Integer;
FetchSubmodules: Integer;
InsecureSsl: Integer;
SourceLocation: WideString;
ReportBuildStatus: Integer;
SourceIdentifier: WideString;
SourceType: WideString;
SourceVersion: WideString;
StartTime: Integer;
VpcId: WideString;
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 := TChilkatRest.Create(Self);

authAws := TChilkatAuthAws.Create(Self);
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 := 'codebuild';
// SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
rest.SetAuthAws(authAws.ControlInterface);

// URL: https://codebuild.us-west-2.amazonaws.com/
// Use the same region as specified above.
success := rest.Connect('codebuild.us-west-2.amazonaws.com',443,1,1);
if (success <> 1) then
  begin
    Memo1.Lines.Add('ConnectFailReason: ' + IntToStr(rest.ConnectFailReason));
    Memo1.Lines.Add(rest.LastErrorText);
    Exit;
  end;

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

json := TChilkatJsonObject.Create(Self);
json.UpdateString('artifactsOverride.artifactIdentifier','string');
json.UpdateString('artifactsOverride.bucketOwnerAccess','string');
json.UpdateInt('artifactsOverride.encryptionDisabled',123);
json.UpdateString('artifactsOverride.location','string');
json.UpdateString('artifactsOverride.name','string');
json.UpdateString('artifactsOverride.namespaceType','string');
json.UpdateInt('artifactsOverride.overrideArtifactName',123);
json.UpdateString('artifactsOverride.packaging','string');
json.UpdateString('artifactsOverride.path','string');
json.UpdateString('artifactsOverride.type','string');
json.UpdateString('buildBatchConfigOverride.batchReportMode','string');
json.UpdateInt('buildBatchConfigOverride.combineArtifacts',123);
json.UpdateString('buildBatchConfigOverride.restrictions.computeTypesAllowed[0]','string');
json.UpdateInt('buildBatchConfigOverride.restrictions.maximumBuildsAllowed',123);
json.UpdateString('buildBatchConfigOverride.serviceRole','string');
json.UpdateInt('buildBatchConfigOverride.timeoutInMins',123);
json.UpdateString('buildspecOverride','string');
json.UpdateInt('buildTimeoutInMinutesOverride',123);
json.UpdateString('cacheOverride.location','string');
json.UpdateString('cacheOverride.modes[0]','string');
json.UpdateString('cacheOverride.type','string');
json.UpdateString('certificateOverride','string');
json.UpdateString('computeTypeOverride','string');
json.UpdateInt('debugSessionEnabled',123);
json.UpdateString('encryptionKeyOverride','string');
json.UpdateString('environmentTypeOverride','string');
json.UpdateString('environmentVariablesOverride[0].name','string');
json.UpdateString('environmentVariablesOverride[0].type','string');
json.UpdateString('environmentVariablesOverride[0].value','string');
json.UpdateInt('gitCloneDepthOverride',123);
json.UpdateInt('gitSubmodulesConfigOverride.fetchSubmodules',123);
json.UpdateString('idempotencyToken','string');
json.UpdateString('imageOverride','string');
json.UpdateString('imagePullCredentialsTypeOverride','string');
json.UpdateInt('insecureSslOverride',123);
json.UpdateString('logsConfigOverride.cloudWatchLogs.groupName','string');
json.UpdateString('logsConfigOverride.cloudWatchLogs.status','string');
json.UpdateString('logsConfigOverride.cloudWatchLogs.streamName','string');
json.UpdateString('logsConfigOverride.s3Logs.bucketOwnerAccess','string');
json.UpdateInt('logsConfigOverride.s3Logs.encryptionDisabled',123);
json.UpdateString('logsConfigOverride.s3Logs.location','string');
json.UpdateString('logsConfigOverride.s3Logs.status','string');
json.UpdateInt('privilegedModeOverride',123);
json.UpdateString('projectName','string');
json.UpdateInt('queuedTimeoutInMinutesOverride',123);
json.UpdateString('registryCredentialOverride.credential','string');
json.UpdateString('registryCredentialOverride.credentialProvider','string');
json.UpdateInt('reportBuildBatchStatusOverride',123);
json.UpdateString('secondaryArtifactsOverride[0].artifactIdentifier','string');
json.UpdateString('secondaryArtifactsOverride[0].bucketOwnerAccess','string');
json.UpdateInt('secondaryArtifactsOverride[0].encryptionDisabled',123);
json.UpdateString('secondaryArtifactsOverride[0].location','string');
json.UpdateString('secondaryArtifactsOverride[0].name','string');
json.UpdateString('secondaryArtifactsOverride[0].namespaceType','string');
json.UpdateInt('secondaryArtifactsOverride[0].overrideArtifactName',123);
json.UpdateString('secondaryArtifactsOverride[0].packaging','string');
json.UpdateString('secondaryArtifactsOverride[0].path','string');
json.UpdateString('secondaryArtifactsOverride[0].type','string');
json.UpdateString('secondarySourcesOverride[0].auth.resource','string');
json.UpdateString('secondarySourcesOverride[0].auth.type','string');
json.UpdateString('secondarySourcesOverride[0].buildspec','string');
json.UpdateString('secondarySourcesOverride[0].buildStatusConfig.context','string');
json.UpdateString('secondarySourcesOverride[0].buildStatusConfig.targetUrl','string');
json.UpdateInt('secondarySourcesOverride[0].gitCloneDepth',123);
json.UpdateInt('secondarySourcesOverride[0].gitSubmodulesConfig.fetchSubmodules',123);
json.UpdateInt('secondarySourcesOverride[0].insecureSsl',123);
json.UpdateString('secondarySourcesOverride[0].location','string');
json.UpdateInt('secondarySourcesOverride[0].reportBuildStatus',123);
json.UpdateString('secondarySourcesOverride[0].sourceIdentifier','string');
json.UpdateString('secondarySourcesOverride[0].type','string');
json.UpdateString('secondarySourcesVersionOverride[0].sourceIdentifier','string');
json.UpdateString('secondarySourcesVersionOverride[0].sourceVersion','string');
json.UpdateString('serviceRoleOverride','string');
json.UpdateString('sourceAuthOverride.resource','string');
json.UpdateString('sourceAuthOverride.type','string');
json.UpdateString('sourceLocationOverride','string');
json.UpdateString('sourceTypeOverride','string');
json.UpdateString('sourceVersion','string');

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

// {
//   "artifactsOverride": {
//     "artifactIdentifier": "string",
//     "bucketOwnerAccess": "string",
//     "encryptionDisabled": boolean,
//     "location": "string",
//     "name": "string",
//     "namespaceType": "string",
//     "overrideArtifactName": boolean,
//     "packaging": "string",
//     "path": "string",
//     "type": "string"
//   },
//   "buildBatchConfigOverride": {
//     "batchReportMode": "string",
//     "combineArtifacts": boolean,
//     "restrictions": {
//       "computeTypesAllowed": [
//         "string"
//       ],
//       "maximumBuildsAllowed": number
//     },
//     "serviceRole": "string",
//     "timeoutInMins": number
//   },
//   "buildspecOverride": "string",
//   "buildTimeoutInMinutesOverride": number,
//   "cacheOverride": {
//     "location": "string",
//     "modes": [
//       "string"
//     ],
//     "type": "string"
//   },
//   "certificateOverride": "string",
//   "computeTypeOverride": "string",
//   "debugSessionEnabled": boolean,
//   "encryptionKeyOverride": "string",
//   "environmentTypeOverride": "string",
//   "environmentVariablesOverride": [
//     {
//       "name": "string",
//       "type": "string",
//       "value": "string"
//     }
//   ],
//   "gitCloneDepthOverride": number,
//   "gitSubmodulesConfigOverride": {
//     "fetchSubmodules": boolean
//   },
//   "idempotencyToken": "string",
//   "imageOverride": "string",
//   "imagePullCredentialsTypeOverride": "string",
//   "insecureSslOverride": boolean,
//   "logsConfigOverride": {
//     "cloudWatchLogs": {
//       "groupName": "string",
//       "status": "string",
//       "streamName": "string"
//     },
//     "s3Logs": {
//       "bucketOwnerAccess": "string",
//       "encryptionDisabled": boolean,
//       "location": "string",
//       "status": "string"
//     }
//   },
//   "privilegedModeOverride": boolean,
//   "projectName": "string",
//   "queuedTimeoutInMinutesOverride": number,
//   "registryCredentialOverride": {
//     "credential": "string",
//     "credentialProvider": "string"
//   },
//   "reportBuildBatchStatusOverride": boolean,
//   "secondaryArtifactsOverride": [
//     {
//       "artifactIdentifier": "string",
//       "bucketOwnerAccess": "string",
//       "encryptionDisabled": boolean,
//       "location": "string",
//       "name": "string",
//       "namespaceType": "string",
//       "overrideArtifactName": boolean,
//       "packaging": "string",
//       "path": "string",
//       "type": "string"
//     }
//   ],
//   "secondarySourcesOverride": [
//     {
//       "auth": {
//         "resource": "string",
//         "type": "string"
//       },
//       "buildspec": "string",
//       "buildStatusConfig": {
//         "context": "string",
//         "targetUrl": "string"
//       },
//       "gitCloneDepth": number,
//       "gitSubmodulesConfig": {
//         "fetchSubmodules": boolean
//       },
//       "insecureSsl": boolean,
//       "location": "string",
//       "reportBuildStatus": boolean,
//       "sourceIdentifier": "string",
//       "type": "string"
//     }
//   ],
//   "secondarySourcesVersionOverride": [
//     {
//       "sourceIdentifier": "string",
//       "sourceVersion": "string"
//     }
//   ],
//   "serviceRoleOverride": "string",
//   "sourceAuthOverride": {
//     "resource": "string",
//     "type": "string"
//   },
//   "sourceLocationOverride": "string",
//   "sourceTypeOverride": "string",
//   "sourceVersion": "string"
// }

rest.AddHeader('Content-Type','application/x-amz-json-1.1');
rest.AddHeader('X-Amz-Target','CodeBuild_20161006.StartBuildBatch');

sbRequestBody := TChilkatStringBuilder.Create(Self);
json.EmitSb(sbRequestBody.ControlInterface);
sbResponseBody := TChilkatStringBuilder.Create(Self);
success := rest.FullRequestSb('POST','/',sbRequestBody.ControlInterface,sbResponseBody.ControlInterface);
if (success <> 1) then
  begin
    Memo1.Lines.Add(rest.LastErrorText);
    Exit;
  end;
respStatusCode := rest.ResponseStatusCode;
Memo1.Lines.Add('response status code = ' + IntToStr(respStatusCode));
if (respStatusCode <> 200) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(rest.ResponseHeader);
    Memo1.Lines.Add('Response Body:');
    Memo1.Lines.Add(sbResponseBody.GetAsString());
    Exit;
  end;

jResp := TChilkatJsonObject.Create(Self);
jResp.LoadSb(sbResponseBody.ControlInterface);

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

Arn := jResp.StringOf('buildBatch.arn');
ArtifactIdentifier := jResp.StringOf('buildBatch.artifacts.artifactIdentifier');
BucketOwnerAccess := jResp.StringOf('buildBatch.artifacts.bucketOwnerAccess');
EncryptionDisabled := jResp.IntOf('buildBatch.artifacts.encryptionDisabled');
Location := jResp.StringOf('buildBatch.artifacts.location');
Md5sum := jResp.StringOf('buildBatch.artifacts.md5sum');
OverrideArtifactName := jResp.IntOf('buildBatch.artifacts.overrideArtifactName');
Sha256sum := jResp.StringOf('buildBatch.artifacts.sha256sum');
BatchReportMode := jResp.StringOf('buildBatch.buildBatchConfig.batchReportMode');
CombineArtifacts := jResp.IntOf('buildBatch.buildBatchConfig.combineArtifacts');
MaximumBuildsAllowed := jResp.IntOf('buildBatch.buildBatchConfig.restrictions.maximumBuildsAllowed');
ServiceRole := jResp.StringOf('buildBatch.buildBatchConfig.serviceRole');
TimeoutInMins := jResp.IntOf('buildBatch.buildBatchConfig.timeoutInMins');
BuildBatchNumber := jResp.IntOf('buildBatch.buildBatchNumber');
BuildBatchStatus := jResp.StringOf('buildBatch.buildBatchStatus');
BuildTimeoutInMinutes := jResp.IntOf('buildBatch.buildTimeoutInMinutes');
CacheLocation := jResp.StringOf('buildBatch.cache.location');
v_Type := jResp.StringOf('buildBatch.cache.type');
Complete := jResp.IntOf('buildBatch.complete');
CurrentPhase := jResp.StringOf('buildBatch.currentPhase');
DebugSessionEnabled := jResp.IntOf('buildBatch.debugSessionEnabled');
EncryptionKey := jResp.StringOf('buildBatch.encryptionKey');
EndTime := jResp.IntOf('buildBatch.endTime');
Certificate := jResp.StringOf('buildBatch.environment.certificate');
ComputeType := jResp.StringOf('buildBatch.environment.computeType');
Image := jResp.StringOf('buildBatch.environment.image');
ImagePullCredentialsType := jResp.StringOf('buildBatch.environment.imagePullCredentialsType');
PrivilegedMode := jResp.IntOf('buildBatch.environment.privilegedMode');
Credential := jResp.StringOf('buildBatch.environment.registryCredential.credential');
CredentialProvider := jResp.StringOf('buildBatch.environment.registryCredential.credentialProvider');
EnvironmentType := jResp.StringOf('buildBatch.environment.type');
Id := jResp.StringOf('buildBatch.id');
Initiator := jResp.StringOf('buildBatch.initiator');
GroupName := jResp.StringOf('buildBatch.logConfig.cloudWatchLogs.groupName');
Status := jResp.StringOf('buildBatch.logConfig.cloudWatchLogs.status');
StreamName := jResp.StringOf('buildBatch.logConfig.cloudWatchLogs.streamName');
S3LogsBucketOwnerAccess := jResp.StringOf('buildBatch.logConfig.s3Logs.bucketOwnerAccess');
S3LogsEncryptionDisabled := jResp.IntOf('buildBatch.logConfig.s3Logs.encryptionDisabled');
S3LogsLocation := jResp.StringOf('buildBatch.logConfig.s3Logs.location');
S3LogsStatus := jResp.StringOf('buildBatch.logConfig.s3Logs.status');
ProjectName := jResp.StringOf('buildBatch.projectName');
QueuedTimeoutInMinutes := jResp.IntOf('buildBatch.queuedTimeoutInMinutes');
ResolvedSourceVersion := jResp.StringOf('buildBatch.resolvedSourceVersion');
buildBatchServiceRole := jResp.StringOf('buildBatch.serviceRole');
Resource := jResp.StringOf('buildBatch.source.auth.resource');
AuthType := jResp.StringOf('buildBatch.source.auth.type');
Buildspec := jResp.StringOf('buildBatch.source.buildspec');
Context := jResp.StringOf('buildBatch.source.buildStatusConfig.context');
TargetUrl := jResp.StringOf('buildBatch.source.buildStatusConfig.targetUrl');
GitCloneDepth := jResp.IntOf('buildBatch.source.gitCloneDepth');
FetchSubmodules := jResp.IntOf('buildBatch.source.gitSubmodulesConfig.fetchSubmodules');
InsecureSsl := jResp.IntOf('buildBatch.source.insecureSsl');
SourceLocation := jResp.StringOf('buildBatch.source.location');
ReportBuildStatus := jResp.IntOf('buildBatch.source.reportBuildStatus');
SourceIdentifier := jResp.StringOf('buildBatch.source.sourceIdentifier');
SourceType := jResp.StringOf('buildBatch.source.type');
SourceVersion := jResp.StringOf('buildBatch.sourceVersion');
StartTime := jResp.IntOf('buildBatch.startTime');
VpcId := jResp.StringOf('buildBatch.vpcConfig.vpcId');
i := 0;
count_i := jResp.SizeOfArray('buildBatch.buildBatchConfig.restrictions.computeTypesAllowed');
while i < count_i do
  begin
    jResp.I := i;
    strVal := jResp.StringOf('buildBatch.buildBatchConfig.restrictions.computeTypesAllowed[i]');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.buildGroups');
while i < count_i do
  begin
    jResp.I := i;
    currentBuildSummaryArn := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.arn');
    BuildStatus := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.buildStatus');
    Identifier := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.primaryArtifact.identifier');
    PrimaryArtifactLocation := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.primaryArtifact.location');
    PrimaryArtifactType := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.primaryArtifact.type');
    RequestedOn := jResp.IntOf('buildBatch.buildGroups[i].currentBuildSummary.requestedOn');
    identifier := jResp.StringOf('buildBatch.buildGroups[i].identifier');
    ignoreFailure := jResp.IntOf('buildBatch.buildGroups[i].ignoreFailure');
    j := 0;
    count_j := jResp.SizeOfArray('buildBatch.buildGroups[i].currentBuildSummary.secondaryArtifacts');
    while j < count_j do
      begin
        jResp.J := j;
        identifier := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.secondaryArtifacts[j].identifier');
        location := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.secondaryArtifacts[j].location');
        v_type := jResp.StringOf('buildBatch.buildGroups[i].currentBuildSummary.secondaryArtifacts[j].type');
        j := j + 1;
      end;

    j := 0;
    count_j := jResp.SizeOfArray('buildBatch.buildGroups[i].dependsOn');
    while j < count_j do
      begin
        jResp.J := j;
        strVal := jResp.StringOf('buildBatch.buildGroups[i].dependsOn[j]');
        j := j + 1;
      end;

    j := 0;
    count_j := jResp.SizeOfArray('buildBatch.buildGroups[i].priorBuildSummaryList');
    while j < count_j do
      begin
        jResp.J := j;
        arn := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].arn');
        buildStatus := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].buildStatus');
        primaryArtifactIdentifier := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].primaryArtifact.identifier');
        primaryArtifactLocation := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].primaryArtifact.location');
        primaryArtifactType := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].primaryArtifact.type');
        requestedOn := jResp.IntOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].requestedOn');
        k := 0;
        count_k := jResp.SizeOfArray('buildBatch.buildGroups[i].priorBuildSummaryList[j].secondaryArtifacts');
        while k < count_k do
          begin
            jResp.K := k;
            identifier := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].secondaryArtifacts[k].identifier');
            location := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].secondaryArtifacts[k].location');
            v_type := jResp.StringOf('buildBatch.buildGroups[i].priorBuildSummaryList[j].secondaryArtifacts[k].type');
            k := k + 1;
          end;

        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.cache.modes');
while i < count_i do
  begin
    jResp.I := i;
    strVal := jResp.StringOf('buildBatch.cache.modes[i]');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.environment.environmentVariables');
while i < count_i do
  begin
    jResp.I := i;
    name := jResp.StringOf('buildBatch.environment.environmentVariables[i].name');
    v_type := jResp.StringOf('buildBatch.environment.environmentVariables[i].type');
    value := jResp.StringOf('buildBatch.environment.environmentVariables[i].value');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.fileSystemLocations');
while i < count_i do
  begin
    jResp.I := i;
    identifier := jResp.StringOf('buildBatch.fileSystemLocations[i].identifier');
    location := jResp.StringOf('buildBatch.fileSystemLocations[i].location');
    mountOptions := jResp.StringOf('buildBatch.fileSystemLocations[i].mountOptions');
    mountPoint := jResp.StringOf('buildBatch.fileSystemLocations[i].mountPoint');
    v_type := jResp.StringOf('buildBatch.fileSystemLocations[i].type');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.phases');
while i < count_i do
  begin
    jResp.I := i;
    durationInSeconds := jResp.IntOf('buildBatch.phases[i].durationInSeconds');
    endTime := jResp.IntOf('buildBatch.phases[i].endTime');
    phaseStatus := jResp.StringOf('buildBatch.phases[i].phaseStatus');
    phaseType := jResp.StringOf('buildBatch.phases[i].phaseType');
    startTime := jResp.IntOf('buildBatch.phases[i].startTime');
    j := 0;
    count_j := jResp.SizeOfArray('buildBatch.phases[i].contexts');
    while j < count_j do
      begin
        jResp.J := j;
        message := jResp.StringOf('buildBatch.phases[i].contexts[j].message');
        statusCode := jResp.StringOf('buildBatch.phases[i].contexts[j].statusCode');
        j := j + 1;
      end;

    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.secondaryArtifacts');
while i < count_i do
  begin
    jResp.I := i;
    artifactIdentifier := jResp.StringOf('buildBatch.secondaryArtifacts[i].artifactIdentifier');
    bucketOwnerAccess := jResp.StringOf('buildBatch.secondaryArtifacts[i].bucketOwnerAccess');
    encryptionDisabled := jResp.IntOf('buildBatch.secondaryArtifacts[i].encryptionDisabled');
    location := jResp.StringOf('buildBatch.secondaryArtifacts[i].location');
    md5sum := jResp.StringOf('buildBatch.secondaryArtifacts[i].md5sum');
    overrideArtifactName := jResp.IntOf('buildBatch.secondaryArtifacts[i].overrideArtifactName');
    sha256sum := jResp.StringOf('buildBatch.secondaryArtifacts[i].sha256sum');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.secondarySources');
while i < count_i do
  begin
    jResp.I := i;
    authResource := jResp.StringOf('buildBatch.secondarySources[i].auth.resource');
    authType := jResp.StringOf('buildBatch.secondarySources[i].auth.type');
    buildspec := jResp.StringOf('buildBatch.secondarySources[i].buildspec');
    buildStatusConfigContext := jResp.StringOf('buildBatch.secondarySources[i].buildStatusConfig.context');
    buildStatusConfigTargetUrl := jResp.StringOf('buildBatch.secondarySources[i].buildStatusConfig.targetUrl');
    gitCloneDepth := jResp.IntOf('buildBatch.secondarySources[i].gitCloneDepth');
    gitSubmodulesConfigFetchSubmodules := jResp.IntOf('buildBatch.secondarySources[i].gitSubmodulesConfig.fetchSubmodules');
    insecureSsl := jResp.IntOf('buildBatch.secondarySources[i].insecureSsl');
    location := jResp.StringOf('buildBatch.secondarySources[i].location');
    reportBuildStatus := jResp.IntOf('buildBatch.secondarySources[i].reportBuildStatus');
    sourceIdentifier := jResp.StringOf('buildBatch.secondarySources[i].sourceIdentifier');
    v_type := jResp.StringOf('buildBatch.secondarySources[i].type');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.secondarySourceVersions');
while i < count_i do
  begin
    jResp.I := i;
    sourceIdentifier := jResp.StringOf('buildBatch.secondarySourceVersions[i].sourceIdentifier');
    sourceVersion := jResp.StringOf('buildBatch.secondarySourceVersions[i].sourceVersion');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.vpcConfig.securityGroupIds');
while i < count_i do
  begin
    jResp.I := i;
    strVal := jResp.StringOf('buildBatch.vpcConfig.securityGroupIds[i]');
    i := i + 1;
  end;

i := 0;
count_i := jResp.SizeOfArray('buildBatch.vpcConfig.subnets');
while i < count_i do
  begin
    jResp.I := i;
    strVal := jResp.StringOf('buildBatch.vpcConfig.subnets[i]');
    i := i + 1;
  end;

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

// {
//   "buildBatch": {
//     "arn": "string",
//     "artifacts": {
//       "artifactIdentifier": "string",
//       "bucketOwnerAccess": "string",
//       "encryptionDisabled": boolean,
//       "location": "string",
//       "md5sum": "string",
//       "overrideArtifactName": boolean,
//       "sha256sum": "string"
//     },
//     "buildBatchConfig": {
//       "batchReportMode": "string",
//       "combineArtifacts": boolean,
//       "restrictions": {
//         "computeTypesAllowed": [
//           "string"
//         ],
//         "maximumBuildsAllowed": number
//       },
//       "serviceRole": "string",
//       "timeoutInMins": number
//     },
//     "buildBatchNumber": number,
//     "buildBatchStatus": "string",
//     "buildGroups": [
//       {
//         "currentBuildSummary": {
//           "arn": "string",
//           "buildStatus": "string",
//           "primaryArtifact": {
//             "identifier": "string",
//             "location": "string",
//             "type": "string"
//           },
//           "requestedOn": number,
//           "secondaryArtifacts": [
//             {
//               "identifier": "string",
//               "location": "string",
//               "type": "string"
//             }
//           ]
//         },
//         "dependsOn": [
//           "string"
//         ],
//         "identifier": "string",
//         "ignoreFailure": boolean,
//         "priorBuildSummaryList": [
//           {
//             "arn": "string",
//             "buildStatus": "string",
//             "primaryArtifact": {
//               "identifier": "string",
//               "location": "string",
//               "type": "string"
//             },
//             "requestedOn": number,
//             "secondaryArtifacts": [
//               {
//                 "identifier": "string",
//                 "location": "string",
//                 "type": "string"
//               }
//             ]
//           }
//         ]
//       }
//     ],
//     "buildTimeoutInMinutes": number,
//     "cache": {
//       "location": "string",
//       "modes": [
//         "string"
//       ],
//       "type": "string"
//     },
//     "complete": boolean,
//     "currentPhase": "string",
//     "debugSessionEnabled": boolean,
//     "encryptionKey": "string",
//     "endTime": number,
//     "environment": {
//       "certificate": "string",
//       "computeType": "string",
//       "environmentVariables": [
//         {
//           "name": "string",
//           "type": "string",
//           "value": "string"
//         }
//       ],
//       "image": "string",
//       "imagePullCredentialsType": "string",
//       "privilegedMode": boolean,
//       "registryCredential": {
//         "credential": "string",
//         "credentialProvider": "string"
//       },
//       "type": "string"
//     },
//     "fileSystemLocations": [
//       {
//         "identifier": "string",
//         "location": "string",
//         "mountOptions": "string",
//         "mountPoint": "string",
//         "type": "string"
//       }
//     ],
//     "id": "string",
//     "initiator": "string",
//     "logConfig": {
//       "cloudWatchLogs": {
//         "groupName": "string",
//         "status": "string",
//         "streamName": "string"
//       },
//       "s3Logs": {
//         "bucketOwnerAccess": "string",
//         "encryptionDisabled": boolean,
//         "location": "string",
//         "status": "string"
//       }
//     },
//     "phases": [
//       {
//         "contexts": [
//           {
//             "message": "string",
//             "statusCode": "string"
//           }
//         ],
//         "durationInSeconds": number,
//         "endTime": number,
//         "phaseStatus": "string",
//         "phaseType": "string",
//         "startTime": number
//       }
//     ],
//     "projectName": "string",
//     "queuedTimeoutInMinutes": number,
//     "resolvedSourceVersion": "string",
//     "secondaryArtifacts": [
//       {
//         "artifactIdentifier": "string",
//         "bucketOwnerAccess": "string",
//         "encryptionDisabled": boolean,
//         "location": "string",
//         "md5sum": "string",
//         "overrideArtifactName": boolean,
//         "sha256sum": "string"
//       }
//     ],
//     "secondarySources": [
//       {
//         "auth": {
//           "resource": "string",
//           "type": "string"
//         },
//         "buildspec": "string",
//         "buildStatusConfig": {
//           "context": "string",
//           "targetUrl": "string"
//         },
//         "gitCloneDepth": number,
//         "gitSubmodulesConfig": {
//           "fetchSubmodules": boolean
//         },
//         "insecureSsl": boolean,
//         "location": "string",
//         "reportBuildStatus": boolean,
//         "sourceIdentifier": "string",
//         "type": "string"
//       }
//     ],
//     "secondarySourceVersions": [
//       {
//         "sourceIdentifier": "string",
//         "sourceVersion": "string"
//       }
//     ],
//     "serviceRole": "string",
//     "source": {
//       "auth": {
//         "resource": "string",
//         "type": "string"
//       },
//       "buildspec": "string",
//       "buildStatusConfig": {
//         "context": "string",
//         "targetUrl": "string"
//       },
//       "gitCloneDepth": number,
//       "gitSubmodulesConfig": {
//         "fetchSubmodules": boolean
//       },
//       "insecureSsl": boolean,
//       "location": "string",
//       "reportBuildStatus": boolean,
//       "sourceIdentifier": "string",
//       "type": "string"
//     },
//     "sourceVersion": "string",
//     "startTime": number,
//     "vpcConfig": {
//       "securityGroupIds": [
//         "string"
//       ],
//       "subnets": [
//         "string"
//       ],
//       "vpcId": "string"
//     }
//   }
// }