Chilkat Online Tools

CreateProject C++ Example

AWS CodeBuild

#include <CkRest.h>
#include <CkAuthAws.h>
#include <CkJsonObject.h>
#include <CkStringBuilder.h>

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

    CkRest rest;
    bool success;

    CkAuthAws authAws;
    authAws.put_AccessKey("AWS_ACCESS_KEY");
    authAws.put_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.put_Region("us-west-2");
    authAws.put_ServiceName("codebuild");
    // SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    rest.SetAuthAws(authAws);

    // 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,true,true);
    if (success != true) {
        std::cout << "ConnectFailReason: " << rest.get_ConnectFailReason() << "\r\n";
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

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

    CkJsonObject json;
    json.UpdateString("artifacts.artifactIdentifier","string");
    json.UpdateString("artifacts.bucketOwnerAccess","string");
    json.UpdateInt("artifacts.encryptionDisabled",123);
    json.UpdateString("artifacts.location","string");
    json.UpdateString("artifacts.name","string");
    json.UpdateString("artifacts.namespaceType","string");
    json.UpdateInt("artifacts.overrideArtifactName",123);
    json.UpdateString("artifacts.packaging","string");
    json.UpdateString("artifacts.path","string");
    json.UpdateString("artifacts.type","string");
    json.UpdateInt("badgeEnabled",123);
    json.UpdateString("buildBatchConfig.batchReportMode","string");
    json.UpdateInt("buildBatchConfig.combineArtifacts",123);
    json.UpdateString("buildBatchConfig.restrictions.computeTypesAllowed[0]","string");
    json.UpdateInt("buildBatchConfig.restrictions.maximumBuildsAllowed",123);
    json.UpdateString("buildBatchConfig.serviceRole","string");
    json.UpdateInt("buildBatchConfig.timeoutInMins",123);
    json.UpdateString("cache.location","string");
    json.UpdateString("cache.modes[0]","string");
    json.UpdateString("cache.type","string");
    json.UpdateInt("concurrentBuildLimit",123);
    json.UpdateString("description","string");
    json.UpdateString("encryptionKey","string");
    json.UpdateString("environment.certificate","string");
    json.UpdateString("environment.computeType","string");
    json.UpdateString("environment.environmentVariables[0].name","string");
    json.UpdateString("environment.environmentVariables[0].type","string");
    json.UpdateString("environment.environmentVariables[0].value","string");
    json.UpdateString("environment.image","string");
    json.UpdateString("environment.imagePullCredentialsType","string");
    json.UpdateInt("environment.privilegedMode",123);
    json.UpdateString("environment.registryCredential.credential","string");
    json.UpdateString("environment.registryCredential.credentialProvider","string");
    json.UpdateString("environment.type","string");
    json.UpdateString("fileSystemLocations[0].identifier","string");
    json.UpdateString("fileSystemLocations[0].location","string");
    json.UpdateString("fileSystemLocations[0].mountOptions","string");
    json.UpdateString("fileSystemLocations[0].mountPoint","string");
    json.UpdateString("fileSystemLocations[0].type","string");
    json.UpdateString("logsConfig.cloudWatchLogs.groupName","string");
    json.UpdateString("logsConfig.cloudWatchLogs.status","string");
    json.UpdateString("logsConfig.cloudWatchLogs.streamName","string");
    json.UpdateString("logsConfig.s3Logs.bucketOwnerAccess","string");
    json.UpdateInt("logsConfig.s3Logs.encryptionDisabled",123);
    json.UpdateString("logsConfig.s3Logs.location","string");
    json.UpdateString("logsConfig.s3Logs.status","string");
    json.UpdateString("name","string");
    json.UpdateInt("queuedTimeoutInMinutes",123);
    json.UpdateString("secondaryArtifacts[0].artifactIdentifier","string");
    json.UpdateString("secondaryArtifacts[0].bucketOwnerAccess","string");
    json.UpdateInt("secondaryArtifacts[0].encryptionDisabled",123);
    json.UpdateString("secondaryArtifacts[0].location","string");
    json.UpdateString("secondaryArtifacts[0].name","string");
    json.UpdateString("secondaryArtifacts[0].namespaceType","string");
    json.UpdateInt("secondaryArtifacts[0].overrideArtifactName",123);
    json.UpdateString("secondaryArtifacts[0].packaging","string");
    json.UpdateString("secondaryArtifacts[0].path","string");
    json.UpdateString("secondaryArtifacts[0].type","string");
    json.UpdateString("secondarySources[0].auth.resource","string");
    json.UpdateString("secondarySources[0].auth.type","string");
    json.UpdateString("secondarySources[0].buildspec","string");
    json.UpdateString("secondarySources[0].buildStatusConfig.context","string");
    json.UpdateString("secondarySources[0].buildStatusConfig.targetUrl","string");
    json.UpdateInt("secondarySources[0].gitCloneDepth",123);
    json.UpdateInt("secondarySources[0].gitSubmodulesConfig.fetchSubmodules",123);
    json.UpdateInt("secondarySources[0].insecureSsl",123);
    json.UpdateString("secondarySources[0].location","string");
    json.UpdateInt("secondarySources[0].reportBuildStatus",123);
    json.UpdateString("secondarySources[0].sourceIdentifier","string");
    json.UpdateString("secondarySources[0].type","string");
    json.UpdateString("secondarySourceVersions[0].sourceIdentifier","string");
    json.UpdateString("secondarySourceVersions[0].sourceVersion","string");
    json.UpdateString("serviceRole","string");
    json.UpdateString("source.auth.resource","string");
    json.UpdateString("source.auth.type","string");
    json.UpdateString("source.buildspec","string");
    json.UpdateString("source.buildStatusConfig.context","string");
    json.UpdateString("source.buildStatusConfig.targetUrl","string");
    json.UpdateInt("source.gitCloneDepth",123);
    json.UpdateInt("source.gitSubmodulesConfig.fetchSubmodules",123);
    json.UpdateInt("source.insecureSsl",123);
    json.UpdateString("source.location","string");
    json.UpdateInt("source.reportBuildStatus",123);
    json.UpdateString("source.sourceIdentifier","string");
    json.UpdateString("source.type","string");
    json.UpdateString("sourceVersion","string");
    json.UpdateString("tags[0].key","string");
    json.UpdateString("tags[0].value","string");
    json.UpdateInt("timeoutInMinutes",123);
    json.UpdateString("vpcConfig.securityGroupIds[0]","string");
    json.UpdateString("vpcConfig.subnets[0]","string");
    json.UpdateString("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"
    //   }
    // }

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

    CkStringBuilder sbRequestBody;
    json.EmitSb(sbRequestBody);
    CkStringBuilder sbResponseBody;
    success = rest.FullRequestSb("POST","/",sbRequestBody,sbResponseBody);
    if (success != true) {
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    int respStatusCode = rest.get_ResponseStatusCode();
    std::cout << "response status code = " << respStatusCode << "\r\n";
    if (respStatusCode != 200) {
        std::cout << "Response Header:" << "\r\n";
        std::cout << rest.responseHeader() << "\r\n";
        std::cout << "Response Body:" << "\r\n";
        std::cout << sbResponseBody.getAsString() << "\r\n";
        return;
    }

    CkJsonObject jResp;
    jResp.LoadSb(sbResponseBody);

    // The following code parses the JSON response.
    // A sample JSON response is shown below the sample code.

    // Use this online tool to generate parsing code from sample JSON:
    // Generate Parsing Code from JSON

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

    const char *strVal = 0;
    const char *name = 0;
    const char *v_type = 0;
    const char *value = 0;
    const char *identifier = 0;
    const char *location = 0;
    const char *mountOptions = 0;
    const char *mountPoint = 0;
    const char *artifactIdentifier = 0;
    const char *bucketOwnerAccess = 0;
    int encryptionDisabled;
    const char *namespaceType = 0;
    int overrideArtifactName;
    const char *packaging = 0;
    const char *path = 0;
    const char *authResource = 0;
    const char *authType = 0;
    const char *buildspec = 0;
    const char *buildStatusConfigContext = 0;
    const char *buildStatusConfigTargetUrl = 0;
    int gitCloneDepth;
    int gitSubmodulesConfigFetchSubmodules;
    int insecureSsl;
    int reportBuildStatus;
    const char *sourceIdentifier = 0;
    const char *sourceVersion = 0;
    const char *key = 0;
    int j;
    int count_j;
    int excludeMatchedPattern;
    const char *pattern = 0;

    const char *Arn = jResp.stringOf("project.arn");
    const char *ArtifactIdentifier = jResp.stringOf("project.artifacts.artifactIdentifier");
    const char *BucketOwnerAccess = jResp.stringOf("project.artifacts.bucketOwnerAccess");
    int EncryptionDisabled = jResp.IntOf("project.artifacts.encryptionDisabled");
    const char *Location = jResp.stringOf("project.artifacts.location");
    const char *Name = jResp.stringOf("project.artifacts.name");
    const char *NamespaceType = jResp.stringOf("project.artifacts.namespaceType");
    int OverrideArtifactName = jResp.IntOf("project.artifacts.overrideArtifactName");
    const char *Packaging = jResp.stringOf("project.artifacts.packaging");
    const char *Path = jResp.stringOf("project.artifacts.path");
    const char *v_Type = jResp.stringOf("project.artifacts.type");
    int BadgeEnabled = jResp.IntOf("project.badge.badgeEnabled");
    const char *BadgeRequestUrl = jResp.stringOf("project.badge.badgeRequestUrl");
    const char *BatchReportMode = jResp.stringOf("project.buildBatchConfig.batchReportMode");
    int CombineArtifacts = jResp.IntOf("project.buildBatchConfig.combineArtifacts");
    int MaximumBuildsAllowed = jResp.IntOf("project.buildBatchConfig.restrictions.maximumBuildsAllowed");
    const char *ServiceRole = jResp.stringOf("project.buildBatchConfig.serviceRole");
    int TimeoutInMins = jResp.IntOf("project.buildBatchConfig.timeoutInMins");
    const char *CacheLocation = jResp.stringOf("project.cache.location");
    const char *CacheType = jResp.stringOf("project.cache.type");
    int ConcurrentBuildLimit = jResp.IntOf("project.concurrentBuildLimit");
    int Created = jResp.IntOf("project.created");
    const char *Description = jResp.stringOf("project.description");
    const char *EncryptionKey = jResp.stringOf("project.encryptionKey");
    const char *Certificate = jResp.stringOf("project.environment.certificate");
    const char *ComputeType = jResp.stringOf("project.environment.computeType");
    const char *Image = jResp.stringOf("project.environment.image");
    const char *ImagePullCredentialsType = jResp.stringOf("project.environment.imagePullCredentialsType");
    int PrivilegedMode = jResp.IntOf("project.environment.privilegedMode");
    const char *Credential = jResp.stringOf("project.environment.registryCredential.credential");
    const char *CredentialProvider = jResp.stringOf("project.environment.registryCredential.credentialProvider");
    const char *EnvironmentType = jResp.stringOf("project.environment.type");
    int LastModified = jResp.IntOf("project.lastModified");
    const char *GroupName = jResp.stringOf("project.logsConfig.cloudWatchLogs.groupName");
    const char *Status = jResp.stringOf("project.logsConfig.cloudWatchLogs.status");
    const char *StreamName = jResp.stringOf("project.logsConfig.cloudWatchLogs.streamName");
    const char *S3LogsBucketOwnerAccess = jResp.stringOf("project.logsConfig.s3Logs.bucketOwnerAccess");
    int S3LogsEncryptionDisabled = jResp.IntOf("project.logsConfig.s3Logs.encryptionDisabled");
    const char *S3LogsLocation = jResp.stringOf("project.logsConfig.s3Logs.location");
    const char *S3LogsStatus = jResp.stringOf("project.logsConfig.s3Logs.status");
    const char *projectName = jResp.stringOf("project.name");
    const char *ProjectVisibility = jResp.stringOf("project.projectVisibility");
    const char *PublicProjectAlias = jResp.stringOf("project.publicProjectAlias");
    int QueuedTimeoutInMinutes = jResp.IntOf("project.queuedTimeoutInMinutes");
    const char *ResourceAccessRole = jResp.stringOf("project.resourceAccessRole");
    const char *projectServiceRole = jResp.stringOf("project.serviceRole");
    const char *Resource = jResp.stringOf("project.source.auth.resource");
    const char *AuthType = jResp.stringOf("project.source.auth.type");
    const char *Buildspec = jResp.stringOf("project.source.buildspec");
    const char *Context = jResp.stringOf("project.source.buildStatusConfig.context");
    const char *TargetUrl = jResp.stringOf("project.source.buildStatusConfig.targetUrl");
    int GitCloneDepth = jResp.IntOf("project.source.gitCloneDepth");
    int FetchSubmodules = jResp.IntOf("project.source.gitSubmodulesConfig.fetchSubmodules");
    int InsecureSsl = jResp.IntOf("project.source.insecureSsl");
    const char *SourceLocation = jResp.stringOf("project.source.location");
    int ReportBuildStatus = jResp.IntOf("project.source.reportBuildStatus");
    const char *SourceIdentifier = jResp.stringOf("project.source.sourceIdentifier");
    const char *SourceType = jResp.stringOf("project.source.type");
    const char *SourceVersion = jResp.stringOf("project.sourceVersion");
    int TimeoutInMinutes = jResp.IntOf("project.timeoutInMinutes");
    const char *VpcId = jResp.stringOf("project.vpcConfig.vpcId");
    const char *BranchFilter = jResp.stringOf("project.webhook.branchFilter");
    const char *BuildType = jResp.stringOf("project.webhook.buildType");
    int LastModifiedSecret = jResp.IntOf("project.webhook.lastModifiedSecret");
    const char *PayloadUrl = jResp.stringOf("project.webhook.payloadUrl");
    const char *Secret = jResp.stringOf("project.webhook.secret");
    const char *v_Url = jResp.stringOf("project.webhook.url");
    int i = 0;
    int count_i = jResp.SizeOfArray("project.buildBatchConfig.restrictions.computeTypesAllowed");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("project.buildBatchConfig.restrictions.computeTypesAllowed[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.cache.modes");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("project.cache.modes[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.environment.environmentVariables");
    while (i < count_i) {
        jResp.put_I(i);
        name = jResp.stringOf("project.environment.environmentVariables[i].name");
        v_type = jResp.stringOf("project.environment.environmentVariables[i].type");
        value = jResp.stringOf("project.environment.environmentVariables[i].value");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.fileSystemLocations");
    while (i < count_i) {
        jResp.put_I(i);
        identifier = jResp.stringOf("project.fileSystemLocations[i].identifier");
        location = jResp.stringOf("project.fileSystemLocations[i].location");
        mountOptions = jResp.stringOf("project.fileSystemLocations[i].mountOptions");
        mountPoint = jResp.stringOf("project.fileSystemLocations[i].mountPoint");
        v_type = jResp.stringOf("project.fileSystemLocations[i].type");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.secondaryArtifacts");
    while (i < count_i) {
        jResp.put_I(i);
        artifactIdentifier = jResp.stringOf("project.secondaryArtifacts[i].artifactIdentifier");
        bucketOwnerAccess = jResp.stringOf("project.secondaryArtifacts[i].bucketOwnerAccess");
        encryptionDisabled = jResp.IntOf("project.secondaryArtifacts[i].encryptionDisabled");
        location = jResp.stringOf("project.secondaryArtifacts[i].location");
        name = jResp.stringOf("project.secondaryArtifacts[i].name");
        namespaceType = jResp.stringOf("project.secondaryArtifacts[i].namespaceType");
        overrideArtifactName = jResp.IntOf("project.secondaryArtifacts[i].overrideArtifactName");
        packaging = jResp.stringOf("project.secondaryArtifacts[i].packaging");
        path = jResp.stringOf("project.secondaryArtifacts[i].path");
        v_type = jResp.stringOf("project.secondaryArtifacts[i].type");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.secondarySources");
    while (i < count_i) {
        jResp.put_I(i);
        authResource = jResp.stringOf("project.secondarySources[i].auth.resource");
        authType = jResp.stringOf("project.secondarySources[i].auth.type");
        buildspec = jResp.stringOf("project.secondarySources[i].buildspec");
        buildStatusConfigContext = jResp.stringOf("project.secondarySources[i].buildStatusConfig.context");
        buildStatusConfigTargetUrl = jResp.stringOf("project.secondarySources[i].buildStatusConfig.targetUrl");
        gitCloneDepth = jResp.IntOf("project.secondarySources[i].gitCloneDepth");
        gitSubmodulesConfigFetchSubmodules = jResp.IntOf("project.secondarySources[i].gitSubmodulesConfig.fetchSubmodules");
        insecureSsl = jResp.IntOf("project.secondarySources[i].insecureSsl");
        location = jResp.stringOf("project.secondarySources[i].location");
        reportBuildStatus = jResp.IntOf("project.secondarySources[i].reportBuildStatus");
        sourceIdentifier = jResp.stringOf("project.secondarySources[i].sourceIdentifier");
        v_type = jResp.stringOf("project.secondarySources[i].type");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.secondarySourceVersions");
    while (i < count_i) {
        jResp.put_I(i);
        sourceIdentifier = jResp.stringOf("project.secondarySourceVersions[i].sourceIdentifier");
        sourceVersion = jResp.stringOf("project.secondarySourceVersions[i].sourceVersion");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.tags");
    while (i < count_i) {
        jResp.put_I(i);
        key = jResp.stringOf("project.tags[i].key");
        value = jResp.stringOf("project.tags[i].value");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.vpcConfig.securityGroupIds");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("project.vpcConfig.securityGroupIds[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.vpcConfig.subnets");
    while (i < count_i) {
        jResp.put_I(i);
        strVal = jResp.stringOf("project.vpcConfig.subnets[i]");
        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("project.webhook.filterGroups");
    while (i < count_i) {
        jResp.put_I(i);
        j = 0;
        count_j = jResp.SizeOfArray("project.webhook.filterGroups[i]");
        while (j < count_j) {
            jResp.put_J(j);
            excludeMatchedPattern = jResp.IntOf("project.webhook.filterGroups[i][j].excludeMatchedPattern");
            pattern = jResp.stringOf("project.webhook.filterGroups[i][j].pattern");
            v_type = jResp.stringOf("project.webhook.filterGroups[i][j].type");
            j = j + 1;
        }

        i = i + 1;
    }

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