BatchGetBuildBatches SQL Server Example
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
DECLARE @sTmp0 nvarchar(max)
-- This example requires the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @rest int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Rest', @rest OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
DECLARE @authAws int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.AuthAws', @authAws OUT
EXEC sp_OASetProperty @authAws, 'AccessKey', 'AWS_ACCESS_KEY'
EXEC sp_OASetProperty @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.)
EXEC sp_OASetProperty @authAws, 'Region', 'us-west-2'
EXEC sp_OASetProperty @authAws, 'ServiceName', 'codebuild'
-- SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
EXEC sp_OAMethod @rest, 'SetAuthAws', @success OUT, @authAws
-- URL: https://codebuild.us-west-2.amazonaws.com/
-- Use the same region as specified above.
EXEC sp_OAMethod @rest, 'Connect', @success OUT, 'codebuild.us-west-2.amazonaws.com', 443, 1, 1
IF @success <> 1
BEGIN
EXEC sp_OAGetProperty @rest, 'ConnectFailReason', @iTmp0 OUT
PRINT 'ConnectFailReason: ' + @iTmp0
EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @rest
EXEC @hr = sp_OADestroy @authAws
RETURN
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
DECLARE @json int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @json OUT
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'ids[0]', 'string'
-- The JSON request body created by the above code:
-- {
-- "ids": [
-- "string"
-- ]
-- }
EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'Content-Type', 'application/x-amz-json-1.1'
EXEC sp_OAMethod @rest, 'AddHeader', @success OUT, 'X-Amz-Target', 'CodeBuild_20161006.BatchGetBuildBatches'
DECLARE @sbRequestBody int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbRequestBody OUT
EXEC sp_OAMethod @json, 'EmitSb', @success OUT, @sbRequestBody
DECLARE @sbResponseBody int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @rest, 'FullRequestSb', @success OUT, 'POST', '/', @sbRequestBody, @sbResponseBody
IF @success <> 1
BEGIN
EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @rest
EXEC @hr = sp_OADestroy @authAws
EXEC @hr = sp_OADestroy @json
EXEC @hr = sp_OADestroy @sbRequestBody
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @rest, 'ResponseStatusCode', @respStatusCode OUT
PRINT 'response status code = ' + @respStatusCode
IF @respStatusCode <> 200
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @rest, 'ResponseHeader', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Response Body:'
EXEC sp_OAMethod @sbResponseBody, 'GetAsString', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @rest
EXEC @hr = sp_OADestroy @authAws
EXEC @hr = sp_OADestroy @json
EXEC @hr = sp_OADestroy @sbRequestBody
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
DECLARE @jResp int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @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
DECLARE @arn nvarchar(max)
DECLARE @ArtifactIdentifier nvarchar(max)
DECLARE @BucketOwnerAccess nvarchar(max)
DECLARE @EncryptionDisabled int
DECLARE @Location nvarchar(max)
DECLARE @Md5sum nvarchar(max)
DECLARE @OverrideArtifactName int
DECLARE @Sha256sum nvarchar(max)
DECLARE @BatchReportMode nvarchar(max)
DECLARE @CombineArtifacts int
DECLARE @MaximumBuildsAllowed int
DECLARE @ServiceRole nvarchar(max)
DECLARE @TimeoutInMins int
DECLARE @buildBatchNumber int
DECLARE @buildBatchStatus nvarchar(max)
DECLARE @buildTimeoutInMinutes int
DECLARE @cacheLocation nvarchar(max)
DECLARE @v_Type nvarchar(max)
DECLARE @complete int
DECLARE @currentPhase nvarchar(max)
DECLARE @debugSessionEnabled int
DECLARE @encryptionKey nvarchar(max)
DECLARE @endTime int
DECLARE @Certificate nvarchar(max)
DECLARE @ComputeType nvarchar(max)
DECLARE @Image nvarchar(max)
DECLARE @ImagePullCredentialsType nvarchar(max)
DECLARE @PrivilegedMode int
DECLARE @Credential nvarchar(max)
DECLARE @CredentialProvider nvarchar(max)
DECLARE @environmentType nvarchar(max)
DECLARE @id nvarchar(max)
DECLARE @initiator nvarchar(max)
DECLARE @GroupName nvarchar(max)
DECLARE @Status nvarchar(max)
DECLARE @StreamName nvarchar(max)
DECLARE @S3LogsBucketOwnerAccess nvarchar(max)
DECLARE @S3LogsEncryptionDisabled int
DECLARE @S3LogsLocation nvarchar(max)
DECLARE @S3LogsStatus nvarchar(max)
DECLARE @projectName nvarchar(max)
DECLARE @queuedTimeoutInMinutes int
DECLARE @resolvedSourceVersion nvarchar(max)
DECLARE @serviceRole nvarchar(max)
DECLARE @Resource nvarchar(max)
DECLARE @AuthType nvarchar(max)
DECLARE @Buildspec nvarchar(max)
DECLARE @Context nvarchar(max)
DECLARE @TargetUrl nvarchar(max)
DECLARE @GitCloneDepth int
DECLARE @FetchSubmodules int
DECLARE @InsecureSsl int
DECLARE @sourceLocation nvarchar(max)
DECLARE @ReportBuildStatus int
DECLARE @SourceIdentifier nvarchar(max)
DECLARE @sourceType nvarchar(max)
DECLARE @sourceVersion nvarchar(max)
DECLARE @startTime int
DECLARE @VpcId nvarchar(max)
DECLARE @j int
DECLARE @count_j int
DECLARE @strVal nvarchar(max)
DECLARE @Arn nvarchar(max)
DECLARE @BuildStatus nvarchar(max)
DECLARE @Identifier nvarchar(max)
DECLARE @PrimaryArtifactLocation nvarchar(max)
DECLARE @PrimaryArtifactType nvarchar(max)
DECLARE @RequestedOn int
DECLARE @identifier nvarchar(max)
DECLARE @ignoreFailure int
DECLARE @k int
DECLARE @count_k int
DECLARE @location nvarchar(max)
DECLARE @v_type nvarchar(max)
DECLARE @buildStatus nvarchar(max)
DECLARE @primaryArtifactIdentifier nvarchar(max)
DECLARE @primaryArtifactLocation nvarchar(max)
DECLARE @primaryArtifactType nvarchar(max)
DECLARE @requestedOn int
DECLARE @json1 int
DECLARE @i1 int
DECLARE @count_i1 int
DECLARE @name nvarchar(max)
DECLARE @value nvarchar(max)
DECLARE @mountOptions nvarchar(max)
DECLARE @mountPoint nvarchar(max)
DECLARE @durationInSeconds int
DECLARE @phaseStatus nvarchar(max)
DECLARE @phaseType nvarchar(max)
DECLARE @message nvarchar(max)
DECLARE @statusCode nvarchar(max)
DECLARE @artifactIdentifier nvarchar(max)
DECLARE @bucketOwnerAccess nvarchar(max)
DECLARE @encryptionDisabled int
DECLARE @md5sum nvarchar(max)
DECLARE @overrideArtifactName int
DECLARE @sha256sum nvarchar(max)
DECLARE @authResource nvarchar(max)
DECLARE @authType nvarchar(max)
DECLARE @buildspec nvarchar(max)
DECLARE @buildStatusConfigContext nvarchar(max)
DECLARE @buildStatusConfigTargetUrl nvarchar(max)
DECLARE @gitCloneDepth int
DECLARE @gitSubmodulesConfigFetchSubmodules int
DECLARE @insecureSsl int
DECLARE @reportBuildStatus int
DECLARE @sourceIdentifier nvarchar(max)
DECLARE @i int
SELECT @i = 0
DECLARE @count_i int
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'buildBatches'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @arn OUT, 'buildBatches[i].arn'
EXEC sp_OAMethod @jResp, 'StringOf', @ArtifactIdentifier OUT, 'buildBatches[i].artifacts.artifactIdentifier'
EXEC sp_OAMethod @jResp, 'StringOf', @BucketOwnerAccess OUT, 'buildBatches[i].artifacts.bucketOwnerAccess'
EXEC sp_OAMethod @jResp, 'IntOf', @EncryptionDisabled OUT, 'buildBatches[i].artifacts.encryptionDisabled'
EXEC sp_OAMethod @jResp, 'StringOf', @Location OUT, 'buildBatches[i].artifacts.location'
EXEC sp_OAMethod @jResp, 'StringOf', @Md5sum OUT, 'buildBatches[i].artifacts.md5sum'
EXEC sp_OAMethod @jResp, 'IntOf', @OverrideArtifactName OUT, 'buildBatches[i].artifacts.overrideArtifactName'
EXEC sp_OAMethod @jResp, 'StringOf', @Sha256sum OUT, 'buildBatches[i].artifacts.sha256sum'
EXEC sp_OAMethod @jResp, 'StringOf', @BatchReportMode OUT, 'buildBatches[i].buildBatchConfig.batchReportMode'
EXEC sp_OAMethod @jResp, 'IntOf', @CombineArtifacts OUT, 'buildBatches[i].buildBatchConfig.combineArtifacts'
EXEC sp_OAMethod @jResp, 'IntOf', @MaximumBuildsAllowed OUT, 'buildBatches[i].buildBatchConfig.restrictions.maximumBuildsAllowed'
EXEC sp_OAMethod @jResp, 'StringOf', @ServiceRole OUT, 'buildBatches[i].buildBatchConfig.serviceRole'
EXEC sp_OAMethod @jResp, 'IntOf', @TimeoutInMins OUT, 'buildBatches[i].buildBatchConfig.timeoutInMins'
EXEC sp_OAMethod @jResp, 'IntOf', @buildBatchNumber OUT, 'buildBatches[i].buildBatchNumber'
EXEC sp_OAMethod @jResp, 'StringOf', @buildBatchStatus OUT, 'buildBatches[i].buildBatchStatus'
EXEC sp_OAMethod @jResp, 'IntOf', @buildTimeoutInMinutes OUT, 'buildBatches[i].buildTimeoutInMinutes'
EXEC sp_OAMethod @jResp, 'StringOf', @cacheLocation OUT, 'buildBatches[i].cache.location'
EXEC sp_OAMethod @jResp, 'StringOf', @v_Type OUT, 'buildBatches[i].cache.type'
EXEC sp_OAMethod @jResp, 'IntOf', @complete OUT, 'buildBatches[i].complete'
EXEC sp_OAMethod @jResp, 'StringOf', @currentPhase OUT, 'buildBatches[i].currentPhase'
EXEC sp_OAMethod @jResp, 'IntOf', @debugSessionEnabled OUT, 'buildBatches[i].debugSessionEnabled'
EXEC sp_OAMethod @jResp, 'StringOf', @encryptionKey OUT, 'buildBatches[i].encryptionKey'
EXEC sp_OAMethod @jResp, 'IntOf', @endTime OUT, 'buildBatches[i].endTime'
EXEC sp_OAMethod @jResp, 'StringOf', @Certificate OUT, 'buildBatches[i].environment.certificate'
EXEC sp_OAMethod @jResp, 'StringOf', @ComputeType OUT, 'buildBatches[i].environment.computeType'
EXEC sp_OAMethod @jResp, 'StringOf', @Image OUT, 'buildBatches[i].environment.image'
EXEC sp_OAMethod @jResp, 'StringOf', @ImagePullCredentialsType OUT, 'buildBatches[i].environment.imagePullCredentialsType'
EXEC sp_OAMethod @jResp, 'IntOf', @PrivilegedMode OUT, 'buildBatches[i].environment.privilegedMode'
EXEC sp_OAMethod @jResp, 'StringOf', @Credential OUT, 'buildBatches[i].environment.registryCredential.credential'
EXEC sp_OAMethod @jResp, 'StringOf', @CredentialProvider OUT, 'buildBatches[i].environment.registryCredential.credentialProvider'
EXEC sp_OAMethod @jResp, 'StringOf', @environmentType OUT, 'buildBatches[i].environment.type'
EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'buildBatches[i].id'
EXEC sp_OAMethod @jResp, 'StringOf', @initiator OUT, 'buildBatches[i].initiator'
EXEC sp_OAMethod @jResp, 'StringOf', @GroupName OUT, 'buildBatches[i].logConfig.cloudWatchLogs.groupName'
EXEC sp_OAMethod @jResp, 'StringOf', @Status OUT, 'buildBatches[i].logConfig.cloudWatchLogs.status'
EXEC sp_OAMethod @jResp, 'StringOf', @StreamName OUT, 'buildBatches[i].logConfig.cloudWatchLogs.streamName'
EXEC sp_OAMethod @jResp, 'StringOf', @S3LogsBucketOwnerAccess OUT, 'buildBatches[i].logConfig.s3Logs.bucketOwnerAccess'
EXEC sp_OAMethod @jResp, 'IntOf', @S3LogsEncryptionDisabled OUT, 'buildBatches[i].logConfig.s3Logs.encryptionDisabled'
EXEC sp_OAMethod @jResp, 'StringOf', @S3LogsLocation OUT, 'buildBatches[i].logConfig.s3Logs.location'
EXEC sp_OAMethod @jResp, 'StringOf', @S3LogsStatus OUT, 'buildBatches[i].logConfig.s3Logs.status'
EXEC sp_OAMethod @jResp, 'StringOf', @projectName OUT, 'buildBatches[i].projectName'
EXEC sp_OAMethod @jResp, 'IntOf', @queuedTimeoutInMinutes OUT, 'buildBatches[i].queuedTimeoutInMinutes'
EXEC sp_OAMethod @jResp, 'StringOf', @resolvedSourceVersion OUT, 'buildBatches[i].resolvedSourceVersion'
EXEC sp_OAMethod @jResp, 'StringOf', @serviceRole OUT, 'buildBatches[i].serviceRole'
EXEC sp_OAMethod @jResp, 'StringOf', @Resource OUT, 'buildBatches[i].source.auth.resource'
EXEC sp_OAMethod @jResp, 'StringOf', @AuthType OUT, 'buildBatches[i].source.auth.type'
EXEC sp_OAMethod @jResp, 'StringOf', @Buildspec OUT, 'buildBatches[i].source.buildspec'
EXEC sp_OAMethod @jResp, 'StringOf', @Context OUT, 'buildBatches[i].source.buildStatusConfig.context'
EXEC sp_OAMethod @jResp, 'StringOf', @TargetUrl OUT, 'buildBatches[i].source.buildStatusConfig.targetUrl'
EXEC sp_OAMethod @jResp, 'IntOf', @GitCloneDepth OUT, 'buildBatches[i].source.gitCloneDepth'
EXEC sp_OAMethod @jResp, 'IntOf', @FetchSubmodules OUT, 'buildBatches[i].source.gitSubmodulesConfig.fetchSubmodules'
EXEC sp_OAMethod @jResp, 'IntOf', @InsecureSsl OUT, 'buildBatches[i].source.insecureSsl'
EXEC sp_OAMethod @jResp, 'StringOf', @sourceLocation OUT, 'buildBatches[i].source.location'
EXEC sp_OAMethod @jResp, 'IntOf', @ReportBuildStatus OUT, 'buildBatches[i].source.reportBuildStatus'
EXEC sp_OAMethod @jResp, 'StringOf', @SourceIdentifier OUT, 'buildBatches[i].source.sourceIdentifier'
EXEC sp_OAMethod @jResp, 'StringOf', @sourceType OUT, 'buildBatches[i].source.type'
EXEC sp_OAMethod @jResp, 'StringOf', @sourceVersion OUT, 'buildBatches[i].sourceVersion'
EXEC sp_OAMethod @jResp, 'IntOf', @startTime OUT, 'buildBatches[i].startTime'
EXEC sp_OAMethod @jResp, 'StringOf', @VpcId OUT, 'buildBatches[i].vpcConfig.vpcId'
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].buildBatchConfig.restrictions.computeTypesAllowed'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'buildBatches[i].buildBatchConfig.restrictions.computeTypesAllowed[j]'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].buildGroups'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @Arn OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.arn'
EXEC sp_OAMethod @jResp, 'StringOf', @BuildStatus OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.buildStatus'
EXEC sp_OAMethod @jResp, 'StringOf', @Identifier OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.primaryArtifact.identifier'
EXEC sp_OAMethod @jResp, 'StringOf', @PrimaryArtifactLocation OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.primaryArtifact.location'
EXEC sp_OAMethod @jResp, 'StringOf', @PrimaryArtifactType OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.primaryArtifact.type'
EXEC sp_OAMethod @jResp, 'IntOf', @RequestedOn OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.requestedOn'
EXEC sp_OAMethod @jResp, 'StringOf', @identifier OUT, 'buildBatches[i].buildGroups[j].identifier'
EXEC sp_OAMethod @jResp, 'IntOf', @ignoreFailure OUT, 'buildBatches[i].buildGroups[j].ignoreFailure'
SELECT @k = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts'
WHILE @k < @count_k
BEGIN
EXEC sp_OASetProperty @jResp, 'K', @k
EXEC sp_OAMethod @jResp, 'StringOf', @identifier OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts[k].identifier'
EXEC sp_OAMethod @jResp, 'StringOf', @location OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts[k].location'
EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'buildBatches[i].buildGroups[j].currentBuildSummary.secondaryArtifacts[k].type'
SELECT @k = @k + 1
END
SELECT @k = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'buildBatches[i].buildGroups[j].dependsOn'
WHILE @k < @count_k
BEGIN
EXEC sp_OASetProperty @jResp, 'K', @k
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'buildBatches[i].buildGroups[j].dependsOn[k]'
SELECT @k = @k + 1
END
SELECT @k = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList'
WHILE @k < @count_k
BEGIN
EXEC sp_OASetProperty @jResp, 'K', @k
EXEC sp_OAMethod @jResp, 'StringOf', @arn OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k].arn'
EXEC sp_OAMethod @jResp, 'StringOf', @buildStatus OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k].buildStatus'
EXEC sp_OAMethod @jResp, 'StringOf', @primaryArtifactIdentifier OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k].primaryArtifact.identifier'
EXEC sp_OAMethod @jResp, 'StringOf', @primaryArtifactLocation OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k].primaryArtifact.location'
EXEC sp_OAMethod @jResp, 'StringOf', @primaryArtifactType OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k].primaryArtifact.type'
EXEC sp_OAMethod @jResp, 'IntOf', @requestedOn OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k].requestedOn'
EXEC sp_OAMethod @jResp, 'ObjectOf', @json1 OUT, 'buildBatches[i].buildGroups[j].priorBuildSummaryList[k]'
SELECT @i1 = 0
EXEC sp_OAMethod @json1, 'SizeOfArray', @count_i1 OUT, 'secondaryArtifacts'
WHILE @i1 < @count_i1
BEGIN
EXEC sp_OASetProperty @json1, 'I', @i1
EXEC sp_OAMethod @json1, 'StringOf', @identifier OUT, 'secondaryArtifacts[i].identifier'
EXEC sp_OAMethod @json1, 'StringOf', @location OUT, 'secondaryArtifacts[i].location'
EXEC sp_OAMethod @json1, 'StringOf', @v_type OUT, 'secondaryArtifacts[i].type'
SELECT @i1 = @i1 + 1
END
EXEC @hr = sp_OADestroy @json1
SELECT @k = @k + 1
END
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].cache.modes'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'buildBatches[i].cache.modes[j]'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].environment.environmentVariables'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'buildBatches[i].environment.environmentVariables[j].name'
EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'buildBatches[i].environment.environmentVariables[j].type'
EXEC sp_OAMethod @jResp, 'StringOf', @value OUT, 'buildBatches[i].environment.environmentVariables[j].value'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].fileSystemLocations'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @identifier OUT, 'buildBatches[i].fileSystemLocations[j].identifier'
EXEC sp_OAMethod @jResp, 'StringOf', @location OUT, 'buildBatches[i].fileSystemLocations[j].location'
EXEC sp_OAMethod @jResp, 'StringOf', @mountOptions OUT, 'buildBatches[i].fileSystemLocations[j].mountOptions'
EXEC sp_OAMethod @jResp, 'StringOf', @mountPoint OUT, 'buildBatches[i].fileSystemLocations[j].mountPoint'
EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'buildBatches[i].fileSystemLocations[j].type'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].phases'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'IntOf', @durationInSeconds OUT, 'buildBatches[i].phases[j].durationInSeconds'
EXEC sp_OAMethod @jResp, 'IntOf', @endTime OUT, 'buildBatches[i].phases[j].endTime'
EXEC sp_OAMethod @jResp, 'StringOf', @phaseStatus OUT, 'buildBatches[i].phases[j].phaseStatus'
EXEC sp_OAMethod @jResp, 'StringOf', @phaseType OUT, 'buildBatches[i].phases[j].phaseType'
EXEC sp_OAMethod @jResp, 'IntOf', @startTime OUT, 'buildBatches[i].phases[j].startTime'
SELECT @k = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'buildBatches[i].phases[j].contexts'
WHILE @k < @count_k
BEGIN
EXEC sp_OASetProperty @jResp, 'K', @k
EXEC sp_OAMethod @jResp, 'StringOf', @message OUT, 'buildBatches[i].phases[j].contexts[k].message'
EXEC sp_OAMethod @jResp, 'StringOf', @statusCode OUT, 'buildBatches[i].phases[j].contexts[k].statusCode'
SELECT @k = @k + 1
END
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].secondaryArtifacts'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @artifactIdentifier OUT, 'buildBatches[i].secondaryArtifacts[j].artifactIdentifier'
EXEC sp_OAMethod @jResp, 'StringOf', @bucketOwnerAccess OUT, 'buildBatches[i].secondaryArtifacts[j].bucketOwnerAccess'
EXEC sp_OAMethod @jResp, 'IntOf', @encryptionDisabled OUT, 'buildBatches[i].secondaryArtifacts[j].encryptionDisabled'
EXEC sp_OAMethod @jResp, 'StringOf', @location OUT, 'buildBatches[i].secondaryArtifacts[j].location'
EXEC sp_OAMethod @jResp, 'StringOf', @md5sum OUT, 'buildBatches[i].secondaryArtifacts[j].md5sum'
EXEC sp_OAMethod @jResp, 'IntOf', @overrideArtifactName OUT, 'buildBatches[i].secondaryArtifacts[j].overrideArtifactName'
EXEC sp_OAMethod @jResp, 'StringOf', @sha256sum OUT, 'buildBatches[i].secondaryArtifacts[j].sha256sum'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].secondarySources'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @authResource OUT, 'buildBatches[i].secondarySources[j].auth.resource'
EXEC sp_OAMethod @jResp, 'StringOf', @authType OUT, 'buildBatches[i].secondarySources[j].auth.type'
EXEC sp_OAMethod @jResp, 'StringOf', @buildspec OUT, 'buildBatches[i].secondarySources[j].buildspec'
EXEC sp_OAMethod @jResp, 'StringOf', @buildStatusConfigContext OUT, 'buildBatches[i].secondarySources[j].buildStatusConfig.context'
EXEC sp_OAMethod @jResp, 'StringOf', @buildStatusConfigTargetUrl OUT, 'buildBatches[i].secondarySources[j].buildStatusConfig.targetUrl'
EXEC sp_OAMethod @jResp, 'IntOf', @gitCloneDepth OUT, 'buildBatches[i].secondarySources[j].gitCloneDepth'
EXEC sp_OAMethod @jResp, 'IntOf', @gitSubmodulesConfigFetchSubmodules OUT, 'buildBatches[i].secondarySources[j].gitSubmodulesConfig.fetchSubmodules'
EXEC sp_OAMethod @jResp, 'IntOf', @insecureSsl OUT, 'buildBatches[i].secondarySources[j].insecureSsl'
EXEC sp_OAMethod @jResp, 'StringOf', @location OUT, 'buildBatches[i].secondarySources[j].location'
EXEC sp_OAMethod @jResp, 'IntOf', @reportBuildStatus OUT, 'buildBatches[i].secondarySources[j].reportBuildStatus'
EXEC sp_OAMethod @jResp, 'StringOf', @sourceIdentifier OUT, 'buildBatches[i].secondarySources[j].sourceIdentifier'
EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'buildBatches[i].secondarySources[j].type'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].secondarySourceVersions'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @sourceIdentifier OUT, 'buildBatches[i].secondarySourceVersions[j].sourceIdentifier'
EXEC sp_OAMethod @jResp, 'StringOf', @sourceVersion OUT, 'buildBatches[i].secondarySourceVersions[j].sourceVersion'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].vpcConfig.securityGroupIds'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'buildBatches[i].vpcConfig.securityGroupIds[j]'
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'buildBatches[i].vpcConfig.subnets'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'buildBatches[i].vpcConfig.subnets[j]'
SELECT @j = @j + 1
END
SELECT @i = @i + 1
END
SELECT @i = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'buildBatchesNotFound'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'buildBatchesNotFound[i]'
SELECT @i = @i + 1
END
-- 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"
-- ]
-- }
EXEC @hr = sp_OADestroy @rest
EXEC @hr = sp_OADestroy @authAws
EXEC @hr = sp_OADestroy @json
EXEC @hr = sp_OADestroy @sbRequestBody
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO