Skip to content
FeedbackDashboard

Download build target output

builds().targetOutputs().retrieve(TargetOutputRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : TargetOutputRetrieveResponse
GET/v0/build_target_outputs

Retrieve a method to download an output for a given build target.

If the requested type of output is source, and the requested output method is url, a download link to a tarball of the source files is returned. If the requested output method is git, a Git remote, ref, and access token (if necessary) is returned.

Otherwise, the possible types of outputs are specific to the requested target, and the output method must be url. See the documentation for type for more information.

ParametersExpand Collapse
params: TargetOutputRetrieveParams
buildId: String

Build ID

target: Target

SDK language target name

NODE("node")
TYPESCRIPT("typescript")
PYTHON("python")
GO("go")
JAVA("java")
KOTLIN("kotlin")
RUBY("ruby")
TERRAFORM("terraform")
CLI("cli")
PHP("php")
CSHARP("csharp")
SQL("sql")
OPENAPI("openapi")
type: Type
SOURCE("source")
DIST("dist")
WHEEL("wheel")
OPENAPI_WITH_TRANSFORMS("openapi-with-transforms")
OPENAPI_WITH_CODE_SAMPLES("openapi-with-code-samples")
OPENAPI_SDK_SPEC("openapi-sdk-spec")
FILE("file")
output: Optional<Output>

Output format: url (download URL) or git (temporary access token).

URL("url")
GIT("git")
path: Optional<String>

The path of the file to get when used with "type": "file".

ReturnsExpand Collapse
class TargetOutputRetrieveResponse: A class that can be one of several variants.union
Url
output: JsonValue; "url"constant"url"constant
target: Target
One of the following:
NODE("node")
TYPESCRIPT("typescript")
PYTHON("python")
GO("go")
JAVA("java")
KOTLIN("kotlin")
RUBY("ruby")
TERRAFORM("terraform")
CLI("cli")
PHP("php")
CSHARP("csharp")
SQL("sql")
OPENAPI("openapi")
type: Type
One of the following:
SOURCE("source")
DIST("dist")
WHEEL("wheel")
OPENAPI_WITH_TRANSFORMS("openapi-with-transforms")
OPENAPI_WITH_CODE_SAMPLES("openapi-with-code-samples")
OPENAPI_SDK_SPEC("openapi-sdk-spec")
FILE("file")
url: String

URL for direct download

path: Optional<String>

The path of the file, which is only present when using with the type "file" option.

Git
token: String

Temporary GitHub access token

output: JsonValue; "git"constant"git"constant
ref: String

Git reference (commit SHA, branch, or tag)

target: Target
One of the following:
NODE("node")
TYPESCRIPT("typescript")
PYTHON("python")
GO("go")
JAVA("java")
KOTLIN("kotlin")
RUBY("ruby")
TERRAFORM("terraform")
CLI("cli")
PHP("php")
CSHARP("csharp")
SQL("sql")
OPENAPI("openapi")
type: Type
One of the following:
SOURCE("source")
DIST("dist")
WHEEL("wheel")
OPENAPI_WITH_TRANSFORMS("openapi-with-transforms")
OPENAPI_WITH_CODE_SAMPLES("openapi-with-code-samples")
OPENAPI_SDK_SPEC("openapi-sdk-spec")
FILE("file")
url: String

URL to git remote

Download build target output

package com.configure_me_stainless_v0.api.example

import com.configure_me_stainless_v0.api.client.StainlessClient
import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient
import com.configure_me_stainless_v0.api.models.builds.targetoutputs.TargetOutputRetrieveParams
import com.configure_me_stainless_v0.api.models.builds.targetoutputs.TargetOutputRetrieveResponse

fun main() {
    val client: StainlessClient = StainlessOkHttpClient.fromEnv()

    val params: TargetOutputRetrieveParams = TargetOutputRetrieveParams.builder()
        .buildId("build_id")
        .target(TargetOutputRetrieveParams.Target.NODE)
        .type(TargetOutputRetrieveParams.Type.SOURCE)
        .build()
    val targetOutput: TargetOutputRetrieveResponse = client.builds().targetOutputs().retrieve(params)
}
{
  "output": "url",
  "target": "node",
  "type": "source",
  "url": "url",
  "path": "path"
}
Returns Examples
{
  "output": "url",
  "target": "node",
  "type": "source",
  "url": "url",
  "path": "path"
}