BatchGetBuildBatches PureBasic Example
IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkRest.pb"
IncludeFile "CkAuthAws.pb"
Procedure ChilkatExample()
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
rest.i = CkRest::ckCreate()
If rest.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i
authAws.i = CkAuthAws::ckCreate()
If authAws.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkAuthAws::setCkAccessKey(authAws, "AWS_ACCESS_KEY")
CkAuthAws::setCkSecretKey(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::setCkRegion(authAws, "us-west-2")
CkAuthAws::setCkServiceName(authAws, "codebuild")
; SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
CkRest::ckSetAuthAws(rest,authAws)
; URL: https://codebuild.us-west-2.amazonaws.com/
; Use the same region as specified above.
success = CkRest::ckConnect(rest,"codebuild.us-west-2.amazonaws.com",443,1,1)
If success <> 1
Debug "ConnectFailReason: " + Str(CkRest::ckConnectFailReason(rest))
Debug CkRest::ckLastErrorText(rest)
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
ProcedureReturn
EndIf
; 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.i = CkJsonObject::ckCreate()
If json.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckUpdateString(json,"ids[0]","string")
; The JSON request body created by the above code:
; {
; "ids": [
; "string"
; ]
; }
CkRest::ckAddHeader(rest,"Content-Type","application/x-amz-json-1.1")
CkRest::ckAddHeader(rest,"X-Amz-Target","CodeBuild_20161006.BatchGetBuildBatches")
sbRequestBody.i = CkStringBuilder::ckCreate()
If sbRequestBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckEmitSb(json,sbRequestBody)
sbResponseBody.i = CkStringBuilder::ckCreate()
If sbResponseBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkRest::ckFullRequestSb(rest,"POST","/",sbRequestBody,sbResponseBody)
If success <> 1
Debug CkRest::ckLastErrorText(rest)
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbRequestBody)
CkStringBuilder::ckDispose(sbResponseBody)
ProcedureReturn
EndIf
respStatusCode.i = CkRest::ckResponseStatusCode(rest)
Debug "response status code = " + Str(respStatusCode)
If respStatusCode <> 200
Debug "Response Header:"
Debug CkRest::ckResponseHeader(rest)
Debug "Response Body:"
Debug CkStringBuilder::ckGetAsString(sbResponseBody)
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbRequestBody)
CkStringBuilder::ckDispose(sbResponseBody)
ProcedureReturn
EndIf
jResp.i = CkJsonObject::ckCreate()
If jResp.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckLoadSb(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
arn.s
ArtifactIdentifier.s
BucketOwnerAccess.s
EncryptionDisabled.i
Location.s
Md5sum.s
OverrideArtifactName.i
Sha256sum.s
BatchReportMode.s
CombineArtifacts.i
MaximumBuildsAllowed.i
ServiceRole.s
TimeoutInMins.i
buildBatchNumber.i
buildBatchStatus.s
buildTimeoutInMinutes.i
cacheLocation.s
v_Type.s
complete.i
currentPhase.s
debugSessionEnabled.i
encryptionKey.s
endTime.i
Certificate.s
ComputeType.s
Image.s
ImagePullCredentialsType.s
PrivilegedMode.i
Credential.s
CredentialProvider.s
environmentType.s
id.s
initiator.s
GroupName.s
Status.s
StreamName.s
S3LogsBucketOwnerAccess.s
S3LogsEncryptionDisabled.i
S3LogsLocation.s
S3LogsStatus.s
projectName.s
queuedTimeoutInMinutes.i
resolvedSourceVersion.s
serviceRole.s
Resource.s
AuthType.s
Buildspec.s
Context.s
TargetUrl.s
GitCloneDepth.i
FetchSubmodules.i
InsecureSsl.i
sourceLocation.s
ReportBuildStatus.i
SourceIdentifier.s
sourceType.s
sourceVersion.s
startTime.i
VpcId.s
j.i
count_j.i
strVal.s
Arn.s
BuildStatus.s
Identifier.s
PrimaryArtifactLocation.s
PrimaryArtifactType.s
RequestedOn.i
identifier.s
ignoreFailure.i
k.i
count_k.i
location.s
v_type.s
buildStatus.s
primaryArtifactIdentifier.s
primaryArtifactLocation.s
primaryArtifactType.s
requestedOn.i
json1.i
i1.i
count_i1.i
name.s
value.s
mountOptions.s
mountPoint.s
durationInSeconds.i
phaseStatus.s
phaseType.s
message.s
statusCode.s
artifactIdentifier.s
bucketOwnerAccess.s
encryptionDisabled.i
md5sum.s
overrideArtifactName.i
sha256sum.s
authResource.s
authType.s
buildspec.s
buildStatusConfigContext.s
buildStatusConfigTargetUrl.s
gitCloneDepth.i
gitSubmodulesConfigFetchSubmodules.i
insecureSsl.i
reportBuildStatus.i
sourceIdentifier.s
i.i = 0
count_i.i = CkJsonObject::ckSizeOfArray(jResp,"buildBatches")
While i < count_i
CkJsonObject::setCkI(jResp, i)
arn = CkJsonObject::ckStringOf(jResp,"buildBatches[i].arn")
ArtifactIdentifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].artifacts.artifactIdentifier")
BucketOwnerAccess = CkJsonObject::ckStringOf(jResp,"buildBatches[i].artifacts.bucketOwnerAccess")
EncryptionDisabled = CkJsonObject::ckIntOf(jResp,"buildBatches[i].artifacts.encryptionDisabled")
Location = CkJsonObject::ckStringOf(jResp,"buildBatches[i].artifacts.location")
Md5sum = CkJsonObject::ckStringOf(jResp,"buildBatches[i].artifacts.md5sum")
OverrideArtifactName = CkJsonObject::ckIntOf(jResp,"buildBatches[i].artifacts.overrideArtifactName")
Sha256sum = CkJsonObject::ckStringOf(jResp,"buildBatches[i].artifacts.sha256sum")
BatchReportMode = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildBatchConfig.batchReportMode")
CombineArtifacts = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildBatchConfig.combineArtifacts")
MaximumBuildsAllowed = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildBatchConfig.restrictions.maximumBuildsAllowed")
ServiceRole = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildBatchConfig.serviceRole")
TimeoutInMins = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildBatchConfig.timeoutInMins")
buildBatchNumber = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildBatchNumber")
buildBatchStatus = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildBatchStatus")
buildTimeoutInMinutes = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildTimeoutInMinutes")
cacheLocation = CkJsonObject::ckStringOf(jResp,"buildBatches[i].cache.location")
v_Type = CkJsonObject::ckStringOf(jResp,"buildBatches[i].cache.type")
complete = CkJsonObject::ckIntOf(jResp,"buildBatches[i].complete")
currentPhase = CkJsonObject::ckStringOf(jResp,"buildBatches[i].currentPhase")
debugSessionEnabled = CkJsonObject::ckIntOf(jResp,"buildBatches[i].debugSessionEnabled")
encryptionKey = CkJsonObject::ckStringOf(jResp,"buildBatches[i].encryptionKey")
endTime = CkJsonObject::ckIntOf(jResp,"buildBatches[i].endTime")
Certificate = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.certificate")
ComputeType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.computeType")
Image = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.image")
ImagePullCredentialsType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.imagePullCredentialsType")
PrivilegedMode = CkJsonObject::ckIntOf(jResp,"buildBatches[i].environment.privilegedMode")
Credential = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.registryCredential.credential")
CredentialProvider = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.registryCredential.credentialProvider")
environmentType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.type")
id = CkJsonObject::ckStringOf(jResp,"buildBatches[i].id")
initiator = CkJsonObject::ckStringOf(jResp,"buildBatches[i].initiator")
GroupName = CkJsonObject::ckStringOf(jResp,"buildBatches[i].logConfig.cloudWatchLogs.groupName")
Status = CkJsonObject::ckStringOf(jResp,"buildBatches[i].logConfig.cloudWatchLogs.status")
StreamName = CkJsonObject::ckStringOf(jResp,"buildBatches[i].logConfig.cloudWatchLogs.streamName")
S3LogsBucketOwnerAccess = CkJsonObject::ckStringOf(jResp,"buildBatches[i].logConfig.s3Logs.bucketOwnerAccess")
S3LogsEncryptionDisabled = CkJsonObject::ckIntOf(jResp,"buildBatches[i].logConfig.s3Logs.encryptionDisabled")
S3LogsLocation = CkJsonObject::ckStringOf(jResp,"buildBatches[i].logConfig.s3Logs.location")
S3LogsStatus = CkJsonObject::ckStringOf(jResp,"buildBatches[i].logConfig.s3Logs.status")
projectName = CkJsonObject::ckStringOf(jResp,"buildBatches[i].projectName")
queuedTimeoutInMinutes = CkJsonObject::ckIntOf(jResp,"buildBatches[i].queuedTimeoutInMinutes")
resolvedSourceVersion = CkJsonObject::ckStringOf(jResp,"buildBatches[i].resolvedSourceVersion")
serviceRole = CkJsonObject::ckStringOf(jResp,"buildBatches[i].serviceRole")
Resource = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.auth.resource")
AuthType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.auth.type")
Buildspec = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.buildspec")
Context = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.buildStatusConfig.context")
TargetUrl = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.buildStatusConfig.targetUrl")
GitCloneDepth = CkJsonObject::ckIntOf(jResp,"buildBatches[i].source.gitCloneDepth")
FetchSubmodules = CkJsonObject::ckIntOf(jResp,"buildBatches[i].source.gitSubmodulesConfig.fetchSubmodules")
InsecureSsl = CkJsonObject::ckIntOf(jResp,"buildBatches[i].source.insecureSsl")
sourceLocation = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.location")
ReportBuildStatus = CkJsonObject::ckIntOf(jResp,"buildBatches[i].source.reportBuildStatus")
SourceIdentifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.sourceIdentifier")
sourceType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].source.type")
sourceVersion = CkJsonObject::ckStringOf(jResp,"buildBatches[i].sourceVersion")
startTime = CkJsonObject::ckIntOf(jResp,"buildBatches[i].startTime")
VpcId = CkJsonObject::ckStringOf(jResp,"buildBatches[i].vpcConfig.vpcId")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].buildBatchConfig.restrictions.computeTypesAllowed")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildBatchConfig.restrictions.computeTypesAllowed[j]")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].buildGroups")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
Arn = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.arn")
BuildStatus = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.buildStatus")
Identifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.primaryArtifact.identifier")
PrimaryArtifactLocation = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.primaryArtifact.location")
PrimaryArtifactType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.primaryArtifact.type")
RequestedOn = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.requestedOn")
identifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].identifier")
ignoreFailure = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildGroups[j].ignoreFailure")
k = 0
count_k = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts")
While k < count_k
CkJsonObject::setCkK(jResp, k)
identifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts[k].identifier")
location = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts[k].location")
v_type = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts[k].type")
k = k + 1
Wend
k = 0
count_k = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].buildGroups[j].dependsOn")
While k < count_k
CkJsonObject::setCkK(jResp, k)
strVal = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].dependsOn[k]")
k = k + 1
Wend
k = 0
count_k = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList")
While k < count_k
CkJsonObject::setCkK(jResp, k)
arn = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k].arn")
buildStatus = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k].buildStatus")
primaryArtifactIdentifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k].primaryArtifact.identifier")
primaryArtifactLocation = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k].primaryArtifact.location")
primaryArtifactType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k].primaryArtifact.type")
requestedOn = CkJsonObject::ckIntOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k].requestedOn")
json1 = CkJsonObject::ckObjectOf(jResp,"buildBatches[i].buildGroups[j].priorBuildSummaryList[k]")
i1 = 0
count_i1 = CkJsonObject::ckSizeOfArray(json1,"secondaryArtifacts")
While i1 < count_i1
CkJsonObject::setCkI(json1, i1)
identifier = CkJsonObject::ckStringOf(json1,"secondaryArtifacts[i].identifier")
location = CkJsonObject::ckStringOf(json1,"secondaryArtifacts[i].location")
v_type = CkJsonObject::ckStringOf(json1,"secondaryArtifacts[i].type")
i1 = i1 + 1
Wend
CkJsonObject::ckDispose(json1)
k = k + 1
Wend
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].cache.modes")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"buildBatches[i].cache.modes[j]")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].environment.environmentVariables")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
name = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.environmentVariables[j].name")
v_type = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.environmentVariables[j].type")
value = CkJsonObject::ckStringOf(jResp,"buildBatches[i].environment.environmentVariables[j].value")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].fileSystemLocations")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
identifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].fileSystemLocations[j].identifier")
location = CkJsonObject::ckStringOf(jResp,"buildBatches[i].fileSystemLocations[j].location")
mountOptions = CkJsonObject::ckStringOf(jResp,"buildBatches[i].fileSystemLocations[j].mountOptions")
mountPoint = CkJsonObject::ckStringOf(jResp,"buildBatches[i].fileSystemLocations[j].mountPoint")
v_type = CkJsonObject::ckStringOf(jResp,"buildBatches[i].fileSystemLocations[j].type")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].phases")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
durationInSeconds = CkJsonObject::ckIntOf(jResp,"buildBatches[i].phases[j].durationInSeconds")
endTime = CkJsonObject::ckIntOf(jResp,"buildBatches[i].phases[j].endTime")
phaseStatus = CkJsonObject::ckStringOf(jResp,"buildBatches[i].phases[j].phaseStatus")
phaseType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].phases[j].phaseType")
startTime = CkJsonObject::ckIntOf(jResp,"buildBatches[i].phases[j].startTime")
k = 0
count_k = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].phases[j].contexts")
While k < count_k
CkJsonObject::setCkK(jResp, k)
message = CkJsonObject::ckStringOf(jResp,"buildBatches[i].phases[j].contexts[k].message")
statusCode = CkJsonObject::ckStringOf(jResp,"buildBatches[i].phases[j].contexts[k].statusCode")
k = k + 1
Wend
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].secondaryArtifacts")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
artifactIdentifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondaryArtifacts[j].artifactIdentifier")
bucketOwnerAccess = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondaryArtifacts[j].bucketOwnerAccess")
encryptionDisabled = CkJsonObject::ckIntOf(jResp,"buildBatches[i].secondaryArtifacts[j].encryptionDisabled")
location = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondaryArtifacts[j].location")
md5sum = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondaryArtifacts[j].md5sum")
overrideArtifactName = CkJsonObject::ckIntOf(jResp,"buildBatches[i].secondaryArtifacts[j].overrideArtifactName")
sha256sum = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondaryArtifacts[j].sha256sum")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].secondarySources")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
authResource = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].auth.resource")
authType = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].auth.type")
buildspec = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].buildspec")
buildStatusConfigContext = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].buildStatusConfig.context")
buildStatusConfigTargetUrl = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].buildStatusConfig.targetUrl")
gitCloneDepth = CkJsonObject::ckIntOf(jResp,"buildBatches[i].secondarySources[j].gitCloneDepth")
gitSubmodulesConfigFetchSubmodules = CkJsonObject::ckIntOf(jResp,"buildBatches[i].secondarySources[j].gitSubmodulesConfig.fetchSubmodules")
insecureSsl = CkJsonObject::ckIntOf(jResp,"buildBatches[i].secondarySources[j].insecureSsl")
location = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].location")
reportBuildStatus = CkJsonObject::ckIntOf(jResp,"buildBatches[i].secondarySources[j].reportBuildStatus")
sourceIdentifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].sourceIdentifier")
v_type = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySources[j].type")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].secondarySourceVersions")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
sourceIdentifier = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySourceVersions[j].sourceIdentifier")
sourceVersion = CkJsonObject::ckStringOf(jResp,"buildBatches[i].secondarySourceVersions[j].sourceVersion")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].vpcConfig.securityGroupIds")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"buildBatches[i].vpcConfig.securityGroupIds[j]")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"buildBatches[i].vpcConfig.subnets")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"buildBatches[i].vpcConfig.subnets[j]")
j = j + 1
Wend
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"buildBatchesNotFound")
While i < count_i
CkJsonObject::setCkI(jResp, i)
strVal = CkJsonObject::ckStringOf(jResp,"buildBatchesNotFound[i]")
i = i + 1
Wend
; A sample JSON response body parsed by the above code:
; {
; "buildBatches": [
; {
; "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"
; }
; }
; ],
; "buildBatchesNotFound": [
; "string"
; ]
; }
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbRequestBody)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jResp)
ProcedureReturn
EndProcedure