## Retrieve `TargetOutputRetrieveResponse builds().targetOutputs().retrieve(TargetOutputRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **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 - `TargetOutputRetrieveParams params` - `String buildId` 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")` - `Optional output` Output format: url (download URL) or git (temporary access token). - `URL("url")` - `GIT("git")` ### Returns - `class TargetOutputRetrieveResponse: A class that can be one of several variants.union` - `Url` - `JsonValue; output "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")` - `String url` URL for direct download - `Git` - `String token` Temporary GitHub access token - `JsonValue; output "git"constant` - `GIT("git")` - `String ref` Git reference (commit SHA, branch, or tag) - `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")` - `String url` URL to git remote ### Example ```java package com.stainless.api.example; import com.stainless.api.client.StainlessClient; import com.stainless.api.client.okhttp.StainlessOkHttpClient; import com.stainless.api.models.builds.targetoutputs.TargetOutputRetrieveParams; import com.stainless.api.models.builds.targetoutputs.TargetOutputRetrieveResponse; public final class Main { private Main() {} public static void main(String[] args) { StainlessClient client = StainlessOkHttpClient.fromEnv(); TargetOutputRetrieveParams params = TargetOutputRetrieveParams.builder() .buildId("build_id") .target(TargetOutputRetrieveParams.Target.NODE) .type(TargetOutputRetrieveParams.Type.SOURCE) .build(); TargetOutputRetrieveResponse targetOutput = client.builds().targetOutputs().retrieve(params); } } ```