CreateProject delphiDll Example
var
rest: HCkRest;
success: Boolean;
authAws: HCkAuthAws;
json: HCkJsonObject;
sbRequestBody: HCkStringBuilder;
sbResponseBody: HCkStringBuilder;
respStatusCode: Integer;
jResp: HCkJsonObject;
strVal: PWideChar;
name: PWideChar;
v_type: PWideChar;
value: PWideChar;
identifier: PWideChar;
location: PWideChar;
mountOptions: PWideChar;
mountPoint: PWideChar;
artifactIdentifier: PWideChar;
bucketOwnerAccess: PWideChar;
encryptionDisabled: Integer;
namespaceType: PWideChar;
overrideArtifactName: Integer;
packaging: PWideChar;
path: PWideChar;
authResource: PWideChar;
authType: PWideChar;
buildspec: PWideChar;
buildStatusConfigContext: PWideChar;
buildStatusConfigTargetUrl: PWideChar;
gitCloneDepth: Integer;
gitSubmodulesConfigFetchSubmodules: Integer;
insecureSsl: Integer;
reportBuildStatus: Integer;
sourceIdentifier: PWideChar;
sourceVersion: PWideChar;
key: PWideChar;
j: Integer;
count_j: Integer;
excludeMatchedPattern: Integer;
pattern: PWideChar;
Arn: PWideChar;
ArtifactIdentifier: PWideChar;
BucketOwnerAccess: PWideChar;
EncryptionDisabled: Integer;
Location: PWideChar;
Name: PWideChar;
NamespaceType: PWideChar;
OverrideArtifactName: Integer;
Packaging: PWideChar;
Path: PWideChar;
v_Type: PWideChar;
BadgeEnabled: Integer;
BadgeRequestUrl: PWideChar;
BatchReportMode: PWideChar;
CombineArtifacts: Integer;
MaximumBuildsAllowed: Integer;
ServiceRole: PWideChar;
TimeoutInMins: Integer;
CacheLocation: PWideChar;
CacheType: PWideChar;
ConcurrentBuildLimit: Integer;
Created: Integer;
Description: PWideChar;
EncryptionKey: PWideChar;
Certificate: PWideChar;
ComputeType: PWideChar;
Image: PWideChar;
ImagePullCredentialsType: PWideChar;
PrivilegedMode: Integer;
Credential: PWideChar;
CredentialProvider: PWideChar;
EnvironmentType: PWideChar;
LastModified: Integer;
GroupName: PWideChar;
Status: PWideChar;
StreamName: PWideChar;
S3LogsBucketOwnerAccess: PWideChar;
S3LogsEncryptionDisabled: Integer;
S3LogsLocation: PWideChar;
S3LogsStatus: PWideChar;
projectName: PWideChar;
ProjectVisibility: PWideChar;
PublicProjectAlias: PWideChar;
QueuedTimeoutInMinutes: Integer;
ResourceAccessRole: PWideChar;
projectServiceRole: PWideChar;
Resource: PWideChar;
AuthType: PWideChar;
Buildspec: PWideChar;
Context: PWideChar;
TargetUrl: PWideChar;
GitCloneDepth: Integer;
FetchSubmodules: Integer;
InsecureSsl: Integer;
SourceLocation: PWideChar;
ReportBuildStatus: Integer;
SourceIdentifier: PWideChar;
SourceType: PWideChar;
SourceVersion: PWideChar;
TimeoutInMinutes: Integer;
VpcId: PWideChar;
BranchFilter: PWideChar;
BuildType: PWideChar;
LastModifiedSecret: Integer;
PayloadUrl: PWideChar;
Secret: PWideChar;
v_Url: 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,'codebuild');
// SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
CkRest_SetAuthAws(rest,authAws);
// URL: https://codebuild.us-west-2.amazonaws.com/
// Use the same region as specified above.
success := CkRest_Connect(rest,'codebuild.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;
// 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 := CkJsonObject_Create();
CkJsonObject_UpdateString(json,'artifacts.artifactIdentifier','string');
CkJsonObject_UpdateString(json,'artifacts.bucketOwnerAccess','string');
CkJsonObject_UpdateInt(json,'artifacts.encryptionDisabled',123);
CkJsonObject_UpdateString(json,'artifacts.location','string');
CkJsonObject_UpdateString(json,'artifacts.name','string');
CkJsonObject_UpdateString(json,'artifacts.namespaceType','string');
CkJsonObject_UpdateInt(json,'artifacts.overrideArtifactName',123);
CkJsonObject_UpdateString(json,'artifacts.packaging','string');
CkJsonObject_UpdateString(json,'artifacts.path','string');
CkJsonObject_UpdateString(json,'artifacts.type','string');
CkJsonObject_UpdateInt(json,'badgeEnabled',123);
CkJsonObject_UpdateString(json,'buildBatchConfig.batchReportMode','string');
CkJsonObject_UpdateInt(json,'buildBatchConfig.combineArtifacts',123);
CkJsonObject_UpdateString(json,'buildBatchConfig.restrictions.computeTypesAllowed[0]','string');
CkJsonObject_UpdateInt(json,'buildBatchConfig.restrictions.maximumBuildsAllowed',123);
CkJsonObject_UpdateString(json,'buildBatchConfig.serviceRole','string');
CkJsonObject_UpdateInt(json,'buildBatchConfig.timeoutInMins',123);
CkJsonObject_UpdateString(json,'cache.location','string');
CkJsonObject_UpdateString(json,'cache.modes[0]','string');
CkJsonObject_UpdateString(json,'cache.type','string');
CkJsonObject_UpdateInt(json,'concurrentBuildLimit',123);
CkJsonObject_UpdateString(json,'description','string');
CkJsonObject_UpdateString(json,'encryptionKey','string');
CkJsonObject_UpdateString(json,'environment.certificate','string');
CkJsonObject_UpdateString(json,'environment.computeType','string');
CkJsonObject_UpdateString(json,'environment.environmentVariables[0].name','string');
CkJsonObject_UpdateString(json,'environment.environmentVariables[0].type','string');
CkJsonObject_UpdateString(json,'environment.environmentVariables[0].value','string');
CkJsonObject_UpdateString(json,'environment.image','string');
CkJsonObject_UpdateString(json,'environment.imagePullCredentialsType','string');
CkJsonObject_UpdateInt(json,'environment.privilegedMode',123);
CkJsonObject_UpdateString(json,'environment.registryCredential.credential','string');
CkJsonObject_UpdateString(json,'environment.registryCredential.credentialProvider','string');
CkJsonObject_UpdateString(json,'environment.type','string');
CkJsonObject_UpdateString(json,'fileSystemLocations[0].identifier','string');
CkJsonObject_UpdateString(json,'fileSystemLocations[0].location','string');
CkJsonObject_UpdateString(json,'fileSystemLocations[0].mountOptions','string');
CkJsonObject_UpdateString(json,'fileSystemLocations[0].mountPoint','string');
CkJsonObject_UpdateString(json,'fileSystemLocations[0].type','string');
CkJsonObject_UpdateString(json,'logsConfig.cloudWatchLogs.groupName','string');
CkJsonObject_UpdateString(json,'logsConfig.cloudWatchLogs.status','string');
CkJsonObject_UpdateString(json,'logsConfig.cloudWatchLogs.streamName','string');
CkJsonObject_UpdateString(json,'logsConfig.s3Logs.bucketOwnerAccess','string');
CkJsonObject_UpdateInt(json,'logsConfig.s3Logs.encryptionDisabled',123);
CkJsonObject_UpdateString(json,'logsConfig.s3Logs.location','string');
CkJsonObject_UpdateString(json,'logsConfig.s3Logs.status','string');
CkJsonObject_UpdateString(json,'name','string');
CkJsonObject_UpdateInt(json,'queuedTimeoutInMinutes',123);
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].artifactIdentifier','string');
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].bucketOwnerAccess','string');
CkJsonObject_UpdateInt(json,'secondaryArtifacts[0].encryptionDisabled',123);
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].location','string');
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].name','string');
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].namespaceType','string');
CkJsonObject_UpdateInt(json,'secondaryArtifacts[0].overrideArtifactName',123);
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].packaging','string');
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].path','string');
CkJsonObject_UpdateString(json,'secondaryArtifacts[0].type','string');
CkJsonObject_UpdateString(json,'secondarySources[0].auth.resource','string');
CkJsonObject_UpdateString(json,'secondarySources[0].auth.type','string');
CkJsonObject_UpdateString(json,'secondarySources[0].buildspec','string');
CkJsonObject_UpdateString(json,'secondarySources[0].buildStatusConfig.context','string');
CkJsonObject_UpdateString(json,'secondarySources[0].buildStatusConfig.targetUrl','string');
CkJsonObject_UpdateInt(json,'secondarySources[0].gitCloneDepth',123);
CkJsonObject_UpdateInt(json,'secondarySources[0].gitSubmodulesConfig.fetchSubmodules',123);
CkJsonObject_UpdateInt(json,'secondarySources[0].insecureSsl',123);
CkJsonObject_UpdateString(json,'secondarySources[0].location','string');
CkJsonObject_UpdateInt(json,'secondarySources[0].reportBuildStatus',123);
CkJsonObject_UpdateString(json,'secondarySources[0].sourceIdentifier','string');
CkJsonObject_UpdateString(json,'secondarySources[0].type','string');
CkJsonObject_UpdateString(json,'secondarySourceVersions[0].sourceIdentifier','string');
CkJsonObject_UpdateString(json,'secondarySourceVersions[0].sourceVersion','string');
CkJsonObject_UpdateString(json,'serviceRole','string');
CkJsonObject_UpdateString(json,'source.auth.resource','string');
CkJsonObject_UpdateString(json,'source.auth.type','string');
CkJsonObject_UpdateString(json,'source.buildspec','string');
CkJsonObject_UpdateString(json,'source.buildStatusConfig.context','string');
CkJsonObject_UpdateString(json,'source.buildStatusConfig.targetUrl','string');
CkJsonObject_UpdateInt(json,'source.gitCloneDepth',123);
CkJsonObject_UpdateInt(json,'source.gitSubmodulesConfig.fetchSubmodules',123);
CkJsonObject_UpdateInt(json,'source.insecureSsl',123);
CkJsonObject_UpdateString(json,'source.location','string');
CkJsonObject_UpdateInt(json,'source.reportBuildStatus',123);
CkJsonObject_UpdateString(json,'source.sourceIdentifier','string');
CkJsonObject_UpdateString(json,'source.type','string');
CkJsonObject_UpdateString(json,'sourceVersion','string');
CkJsonObject_UpdateString(json,'tags[0].key','string');
CkJsonObject_UpdateString(json,'tags[0].value','string');
CkJsonObject_UpdateInt(json,'timeoutInMinutes',123);
CkJsonObject_UpdateString(json,'vpcConfig.securityGroupIds[0]','string');
CkJsonObject_UpdateString(json,'vpcConfig.subnets[0]','string');
CkJsonObject_UpdateString(json,'vpcConfig.vpcId','string');
// The JSON request body created by the above code:
// {
// "artifacts": {
// "artifactIdentifier": "string",
// "bucketOwnerAccess": "string",
// "encryptionDisabled": boolean,
// "location": "string",
// "name": "string",
// "namespaceType": "string",
// "overrideArtifactName": boolean,
// "packaging": "string",
// "path": "string",
// "type": "string"
// },
// "badgeEnabled": boolean,
// "buildBatchConfig": {
// "batchReportMode": "string",
// "combineArtifacts": boolean,
// "restrictions": {
// "computeTypesAllowed": [
// "string"
// ],
// "maximumBuildsAllowed": number
// },
// "serviceRole": "string",
// "timeoutInMins": number
// },
// "cache": {
// "location": "string",
// "modes": [
// "string"
// ],
// "type": "string"
// },
// "concurrentBuildLimit": number,
// "description": "string",
// "encryptionKey": "string",
// "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"
// }
// ],
// "logsConfig": {
// "cloudWatchLogs": {
// "groupName": "string",
// "status": "string",
// "streamName": "string"
// },
// "s3Logs": {
// "bucketOwnerAccess": "string",
// "encryptionDisabled": boolean,
// "location": "string",
// "status": "string"
// }
// },
// "name": "string",
// "queuedTimeoutInMinutes": number,
// "secondaryArtifacts": [
// {
// "artifactIdentifier": "string",
// "bucketOwnerAccess": "string",
// "encryptionDisabled": boolean,
// "location": "string",
// "name": "string",
// "namespaceType": "string",
// "overrideArtifactName": boolean,
// "packaging": "string",
// "path": "string",
// "type": "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",
// "tags": [
// {
// "key": "string",
// "value": "string"
// }
// ],
// "timeoutInMinutes": number,
// "vpcConfig": {
// "securityGroupIds": [
// "string"
// ],
// "subnets": [
// "string"
// ],
// "vpcId": "string"
// }
// }
CkRest_AddHeader(rest,'Content-Type','application/x-amz-json-1.1');
CkRest_AddHeader(rest,'X-Amz-Target','CodeBuild_20161006.CreateProject');
sbRequestBody := CkStringBuilder_Create();
CkJsonObject_EmitSb(json,sbRequestBody);
sbResponseBody := CkStringBuilder_Create();
success := CkRest_FullRequestSb(rest,'POST','/',sbRequestBody,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
Arn := CkJsonObject__stringOf(jResp,'project.arn');
ArtifactIdentifier := CkJsonObject__stringOf(jResp,'project.artifacts.artifactIdentifier');
BucketOwnerAccess := CkJsonObject__stringOf(jResp,'project.artifacts.bucketOwnerAccess');
EncryptionDisabled := CkJsonObject_IntOf(jResp,'project.artifacts.encryptionDisabled');
Location := CkJsonObject__stringOf(jResp,'project.artifacts.location');
Name := CkJsonObject__stringOf(jResp,'project.artifacts.name');
NamespaceType := CkJsonObject__stringOf(jResp,'project.artifacts.namespaceType');
OverrideArtifactName := CkJsonObject_IntOf(jResp,'project.artifacts.overrideArtifactName');
Packaging := CkJsonObject__stringOf(jResp,'project.artifacts.packaging');
Path := CkJsonObject__stringOf(jResp,'project.artifacts.path');
v_Type := CkJsonObject__stringOf(jResp,'project.artifacts.type');
BadgeEnabled := CkJsonObject_IntOf(jResp,'project.badge.badgeEnabled');
BadgeRequestUrl := CkJsonObject__stringOf(jResp,'project.badge.badgeRequestUrl');
BatchReportMode := CkJsonObject__stringOf(jResp,'project.buildBatchConfig.batchReportMode');
CombineArtifacts := CkJsonObject_IntOf(jResp,'project.buildBatchConfig.combineArtifacts');
MaximumBuildsAllowed := CkJsonObject_IntOf(jResp,'project.buildBatchConfig.restrictions.maximumBuildsAllowed');
ServiceRole := CkJsonObject__stringOf(jResp,'project.buildBatchConfig.serviceRole');
TimeoutInMins := CkJsonObject_IntOf(jResp,'project.buildBatchConfig.timeoutInMins');
CacheLocation := CkJsonObject__stringOf(jResp,'project.cache.location');
CacheType := CkJsonObject__stringOf(jResp,'project.cache.type');
ConcurrentBuildLimit := CkJsonObject_IntOf(jResp,'project.concurrentBuildLimit');
Created := CkJsonObject_IntOf(jResp,'project.created');
Description := CkJsonObject__stringOf(jResp,'project.description');
EncryptionKey := CkJsonObject__stringOf(jResp,'project.encryptionKey');
Certificate := CkJsonObject__stringOf(jResp,'project.environment.certificate');
ComputeType := CkJsonObject__stringOf(jResp,'project.environment.computeType');
Image := CkJsonObject__stringOf(jResp,'project.environment.image');
ImagePullCredentialsType := CkJsonObject__stringOf(jResp,'project.environment.imagePullCredentialsType');
PrivilegedMode := CkJsonObject_IntOf(jResp,'project.environment.privilegedMode');
Credential := CkJsonObject__stringOf(jResp,'project.environment.registryCredential.credential');
CredentialProvider := CkJsonObject__stringOf(jResp,'project.environment.registryCredential.credentialProvider');
EnvironmentType := CkJsonObject__stringOf(jResp,'project.environment.type');
LastModified := CkJsonObject_IntOf(jResp,'project.lastModified');
GroupName := CkJsonObject__stringOf(jResp,'project.logsConfig.cloudWatchLogs.groupName');
Status := CkJsonObject__stringOf(jResp,'project.logsConfig.cloudWatchLogs.status');
StreamName := CkJsonObject__stringOf(jResp,'project.logsConfig.cloudWatchLogs.streamName');
S3LogsBucketOwnerAccess := CkJsonObject__stringOf(jResp,'project.logsConfig.s3Logs.bucketOwnerAccess');
S3LogsEncryptionDisabled := CkJsonObject_IntOf(jResp,'project.logsConfig.s3Logs.encryptionDisabled');
S3LogsLocation := CkJsonObject__stringOf(jResp,'project.logsConfig.s3Logs.location');
S3LogsStatus := CkJsonObject__stringOf(jResp,'project.logsConfig.s3Logs.status');
projectName := CkJsonObject__stringOf(jResp,'project.name');
ProjectVisibility := CkJsonObject__stringOf(jResp,'project.projectVisibility');
PublicProjectAlias := CkJsonObject__stringOf(jResp,'project.publicProjectAlias');
QueuedTimeoutInMinutes := CkJsonObject_IntOf(jResp,'project.queuedTimeoutInMinutes');
ResourceAccessRole := CkJsonObject__stringOf(jResp,'project.resourceAccessRole');
projectServiceRole := CkJsonObject__stringOf(jResp,'project.serviceRole');
Resource := CkJsonObject__stringOf(jResp,'project.source.auth.resource');
AuthType := CkJsonObject__stringOf(jResp,'project.source.auth.type');
Buildspec := CkJsonObject__stringOf(jResp,'project.source.buildspec');
Context := CkJsonObject__stringOf(jResp,'project.source.buildStatusConfig.context');
TargetUrl := CkJsonObject__stringOf(jResp,'project.source.buildStatusConfig.targetUrl');
GitCloneDepth := CkJsonObject_IntOf(jResp,'project.source.gitCloneDepth');
FetchSubmodules := CkJsonObject_IntOf(jResp,'project.source.gitSubmodulesConfig.fetchSubmodules');
InsecureSsl := CkJsonObject_IntOf(jResp,'project.source.insecureSsl');
SourceLocation := CkJsonObject__stringOf(jResp,'project.source.location');
ReportBuildStatus := CkJsonObject_IntOf(jResp,'project.source.reportBuildStatus');
SourceIdentifier := CkJsonObject__stringOf(jResp,'project.source.sourceIdentifier');
SourceType := CkJsonObject__stringOf(jResp,'project.source.type');
SourceVersion := CkJsonObject__stringOf(jResp,'project.sourceVersion');
TimeoutInMinutes := CkJsonObject_IntOf(jResp,'project.timeoutInMinutes');
VpcId := CkJsonObject__stringOf(jResp,'project.vpcConfig.vpcId');
BranchFilter := CkJsonObject__stringOf(jResp,'project.webhook.branchFilter');
BuildType := CkJsonObject__stringOf(jResp,'project.webhook.buildType');
LastModifiedSecret := CkJsonObject_IntOf(jResp,'project.webhook.lastModifiedSecret');
PayloadUrl := CkJsonObject__stringOf(jResp,'project.webhook.payloadUrl');
Secret := CkJsonObject__stringOf(jResp,'project.webhook.secret');
v_Url := CkJsonObject__stringOf(jResp,'project.webhook.url');
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.buildBatchConfig.restrictions.computeTypesAllowed');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
strVal := CkJsonObject__stringOf(jResp,'project.buildBatchConfig.restrictions.computeTypesAllowed[i]');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.cache.modes');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
strVal := CkJsonObject__stringOf(jResp,'project.cache.modes[i]');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.environment.environmentVariables');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
name := CkJsonObject__stringOf(jResp,'project.environment.environmentVariables[i].name');
v_type := CkJsonObject__stringOf(jResp,'project.environment.environmentVariables[i].type');
value := CkJsonObject__stringOf(jResp,'project.environment.environmentVariables[i].value');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.fileSystemLocations');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
identifier := CkJsonObject__stringOf(jResp,'project.fileSystemLocations[i].identifier');
location := CkJsonObject__stringOf(jResp,'project.fileSystemLocations[i].location');
mountOptions := CkJsonObject__stringOf(jResp,'project.fileSystemLocations[i].mountOptions');
mountPoint := CkJsonObject__stringOf(jResp,'project.fileSystemLocations[i].mountPoint');
v_type := CkJsonObject__stringOf(jResp,'project.fileSystemLocations[i].type');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.secondaryArtifacts');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
artifactIdentifier := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].artifactIdentifier');
bucketOwnerAccess := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].bucketOwnerAccess');
encryptionDisabled := CkJsonObject_IntOf(jResp,'project.secondaryArtifacts[i].encryptionDisabled');
location := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].location');
name := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].name');
namespaceType := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].namespaceType');
overrideArtifactName := CkJsonObject_IntOf(jResp,'project.secondaryArtifacts[i].overrideArtifactName');
packaging := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].packaging');
path := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].path');
v_type := CkJsonObject__stringOf(jResp,'project.secondaryArtifacts[i].type');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.secondarySources');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
authResource := CkJsonObject__stringOf(jResp,'project.secondarySources[i].auth.resource');
authType := CkJsonObject__stringOf(jResp,'project.secondarySources[i].auth.type');
buildspec := CkJsonObject__stringOf(jResp,'project.secondarySources[i].buildspec');
buildStatusConfigContext := CkJsonObject__stringOf(jResp,'project.secondarySources[i].buildStatusConfig.context');
buildStatusConfigTargetUrl := CkJsonObject__stringOf(jResp,'project.secondarySources[i].buildStatusConfig.targetUrl');
gitCloneDepth := CkJsonObject_IntOf(jResp,'project.secondarySources[i].gitCloneDepth');
gitSubmodulesConfigFetchSubmodules := CkJsonObject_IntOf(jResp,'project.secondarySources[i].gitSubmodulesConfig.fetchSubmodules');
insecureSsl := CkJsonObject_IntOf(jResp,'project.secondarySources[i].insecureSsl');
location := CkJsonObject__stringOf(jResp,'project.secondarySources[i].location');
reportBuildStatus := CkJsonObject_IntOf(jResp,'project.secondarySources[i].reportBuildStatus');
sourceIdentifier := CkJsonObject__stringOf(jResp,'project.secondarySources[i].sourceIdentifier');
v_type := CkJsonObject__stringOf(jResp,'project.secondarySources[i].type');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.secondarySourceVersions');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
sourceIdentifier := CkJsonObject__stringOf(jResp,'project.secondarySourceVersions[i].sourceIdentifier');
sourceVersion := CkJsonObject__stringOf(jResp,'project.secondarySourceVersions[i].sourceVersion');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.tags');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
key := CkJsonObject__stringOf(jResp,'project.tags[i].key');
value := CkJsonObject__stringOf(jResp,'project.tags[i].value');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.vpcConfig.securityGroupIds');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
strVal := CkJsonObject__stringOf(jResp,'project.vpcConfig.securityGroupIds[i]');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.vpcConfig.subnets');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
strVal := CkJsonObject__stringOf(jResp,'project.vpcConfig.subnets[i]');
i := i + 1;
end;
i := 0;
count_i := CkJsonObject_SizeOfArray(jResp,'project.webhook.filterGroups');
while i < count_i do
begin
CkJsonObject_putI(jResp,i);
j := 0;
count_j := CkJsonObject_SizeOfArray(jResp,'project.webhook.filterGroups[i]');
while j < count_j do
begin
CkJsonObject_putJ(jResp,j);
excludeMatchedPattern := CkJsonObject_IntOf(jResp,'project.webhook.filterGroups[i][j].excludeMatchedPattern');
pattern := CkJsonObject__stringOf(jResp,'project.webhook.filterGroups[i][j].pattern');
v_type := CkJsonObject__stringOf(jResp,'project.webhook.filterGroups[i][j].type');
j := j + 1;
end;
i := i + 1;
end;
// A sample JSON response body parsed by the above code:
// {
// "project": {
// "arn": "string",
// "artifacts": {
// "artifactIdentifier": "string",
// "bucketOwnerAccess": "string",
// "encryptionDisabled": boolean,
// "location": "string",
// "name": "string",
// "namespaceType": "string",
// "overrideArtifactName": boolean,
// "packaging": "string",
// "path": "string",
// "type": "string"
// },
// "badge": {
// "badgeEnabled": boolean,
// "badgeRequestUrl": "string"
// },
// "buildBatchConfig": {
// "batchReportMode": "string",
// "combineArtifacts": boolean,
// "restrictions": {
// "computeTypesAllowed": [
// "string"
// ],
// "maximumBuildsAllowed": number
// },
// "serviceRole": "string",
// "timeoutInMins": number
// },
// "cache": {
// "location": "string",
// "modes": [
// "string"
// ],
// "type": "string"
// },
// "concurrentBuildLimit": number,
// "created": number,
// "description": "string",
// "encryptionKey": "string",
// "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"
// }
// ],
// "lastModified": number,
// "logsConfig": {
// "cloudWatchLogs": {
// "groupName": "string",
// "status": "string",
// "streamName": "string"
// },
// "s3Logs": {
// "bucketOwnerAccess": "string",
// "encryptionDisabled": boolean,
// "location": "string",
// "status": "string"
// }
// },
// "name": "string",
// "projectVisibility": "string",
// "publicProjectAlias": "string",
// "queuedTimeoutInMinutes": number,
// "resourceAccessRole": "string",
// "secondaryArtifacts": [
// {
// "artifactIdentifier": "string",
// "bucketOwnerAccess": "string",
// "encryptionDisabled": boolean,
// "location": "string",
// "name": "string",
// "namespaceType": "string",
// "overrideArtifactName": boolean,
// "packaging": "string",
// "path": "string",
// "type": "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",
// "tags": [
// {
// "key": "string",
// "value": "string"
// }
// ],
// "timeoutInMinutes": number,
// "vpcConfig": {
// "securityGroupIds": [
// "string"
// ],
// "subnets": [
// "string"
// ],
// "vpcId": "string"
// },
// "webhook": {
// "branchFilter": "string",
// "buildType": "string",
// "filterGroups": [
// [
// {
// "excludeMatchedPattern": boolean,
// "pattern": "string",
// "type": "string"
// }
// ]
// ],
// "lastModifiedSecret": number,
// "payloadUrl": "string",
// "secret": "string",
// "url": "string"
// }
// }
// }
CkRest_Dispose(rest);
CkAuthAws_Dispose(authAws);
CkJsonObject_Dispose(json);
CkStringBuilder_Dispose(sbRequestBody);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);