Skip to content
FeedbackDashboard

Download build target output

TargetOutputRetrieveResponse Builds.TargetOutputs.Retrieve(TargetOutputRetrieveParamsparameters, CancellationTokencancellationToken = default)
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
TargetOutputRetrieveParams parameters
required string buildID

Build ID

required 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
required Type type
"source"Source
"dist"Dist
"wheel"Wheel
"openapi-with-transforms"OpenAPIWithTransforms
"openapi-with-code-samples"OpenAPIWithCodeSamples
"openapi-sdk-spec"OpenAPISdkSpec
"file"File
Output output

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

"url"Url
"git"Git
string path

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
JsonElement Output "url"constant
required 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
required Type Type
One of the following:
"source"Source
"dist"Dist
"wheel"Wheel
"openapi-with-transforms"OpenAPIWithTransforms
"openapi-with-code-samples"OpenAPIWithCodeSamples
"openapi-sdk-spec"OpenAPISdkSpec
"file"File
required string Url

URL for direct download

string Path

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

Git
required string Token

Temporary GitHub access token

JsonElement Output "git"constant
required string Ref

Git reference (commit SHA, branch, or tag)

required 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
required Type Type
One of the following:
"source"Source
"dist"Dist
"wheel"Wheel
"openapi-with-transforms"OpenAPIWithTransforms
"openapi-with-code-samples"OpenAPIWithCodeSamples
"openapi-sdk-spec"OpenAPISdkSpec
"file"File
required string Url

URL to git remote

Download build target output

TargetOutputRetrieveParams parameters = new()
{
    BuildID = "build_id",
    Target = Target.Node,
    Type = Type.Source,
};

var targetOutput = await client.Builds.TargetOutputs.Retrieve(parameters);

Console.WriteLine(targetOutput);
{
  "output": "url",
  "target": "node",
  "type": "source",
  "url": "url",
  "path": "path"
}
Returns Examples
{
  "output": "url",
  "target": "node",
  "type": "source",
  "url": "url",
  "path": "path"
}