## 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. ### Parameters - `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 format: url (download URL) or git (temporary access token). - `URL("url")` - `GIT("git")` - `path: Optional` The path of the file to get when used with "type": "file". ### Returns - `class TargetOutputRetrieveResponse: A class that can be one of several variants.union` - `Url` - `output: JsonValue; "url"constant` - `URL("url")` - `target: Target` - `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")` - `url: String` URL for direct download - `path: Optional` 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("git")` - `ref: String` Git reference (commit SHA, branch, or tag) - `target: Target` - `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")` - `url: String` URL to git remote ### Example ```kotlin 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) } ``` #### Response ```json { "output": "url", "target": "node", "type": "source", "url": "url", "path": "path" } ```