Package org.azd.build.artifacts
Class ArtifactsRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.build.artifacts.ArtifactsRequestBuilder
Provides the functionality to manage Build Artifacts Api.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the query parameters.static class
Request configuration object for the query parameters.Nested classes/interfaces inherited from class org.azd.abstractions.BaseRequestBuilder
BaseRequestBuilder.ProjectExcludeParameter
-
Field Summary
Fields inherited from class org.azd.abstractions.BaseRequestBuilder
accessTokenCredential, apiVersion, area, locationId, organizationUrl, serializer
-
Constructor Summary
ConstructorDescriptionArtifactsRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(int buildId, BuildArtifact buildArtifact) Associates an artifact with a build.createAsync
(int buildId, BuildArtifact buildArtifact) Associates an artifact with a build.Gets a specific artifact for a build.Gets a specific artifact for a build.Gets a specific artifact for a build as a zip file.getAsZipAsync
(int buildId, String artifactName) Gets a specific artifact for a build as a zip file.getFile
(int buildId, String artifactName, Consumer<ArtifactsRequestBuilder.RequestConfiguration> requestConfiguration) Gets a file from the build.getFileAsync
(int buildId, String artifactName, Consumer<ArtifactsRequestBuilder.RequestConfiguration> requestConfiguration) Gets a file from the build.list
(int buildId) Gets all artifacts for a build.listAsync
(int buildId) Gets all artifacts for a build.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
ArtifactsRequestBuilder
Instantiates a new RequestBuilder instance and sets the default values.- Parameters:
organizationUrl
- Represents organization location request url.accessTokenCredential
- Access token credential object.
-
-
Method Details
-
createAsync
public CompletableFuture<BuildArtifact> createAsync(int buildId, BuildArtifact buildArtifact) throws AzDException Associates an artifact with a build.- Parameters:
buildId
- The ID of the build.buildArtifact
- Build artifact to associate.- Returns:
- BuildArtifact future Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
public CompletableFuture<BuildArtifact> getAsync(int buildId, String artifactName) throws AzDException Gets a specific artifact for a build.- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- BuildArtifact future Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
getAsZipAsync
public CompletableFuture<InputStream> getAsZipAsync(int buildId, String artifactName) throws AzDException Gets a specific artifact for a build as a zip file.- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- Input stream future response of artifact
- Throws:
AzDException
- Default Api Exception handler.
-
getFileAsync
public CompletableFuture<InputStream> getFileAsync(int buildId, String artifactName, Consumer<ArtifactsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Gets a file from the build. Returns the file contents as InputStream andStreamHelper
can be used to download the file.- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- Input stream future response of artifact
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
Gets all artifacts for a build.- Parameters:
buildId
- The ID of the build.- Returns:
- BuildArtifacts future Object
BuildArtifacts
- Throws:
AzDException
- Default Api Exception handler.
-
create
Associates an artifact with a build.- Parameters:
buildId
- The ID of the build.buildArtifact
- Build artifact to associate.- Returns:
- BuildArtifact future Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
get
Gets a specific artifact for a build.- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- BuildArtifact future Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
getAsZip
Gets a specific artifact for a build as a zip file.- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- Input stream future response of artifact
- Throws:
AzDException
- Default Api Exception handler.
-
getFile
public InputStream getFile(int buildId, String artifactName, Consumer<ArtifactsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Gets a file from the build. Returns the file contents as InputStream andStreamHelper
can be used to download the file.- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- Input stream future response of artifact
- Throws:
AzDException
- Default Api Exception handler.
-
list
Gets all artifacts for a build.- Parameters:
buildId
- The ID of the build.- Returns:
- BuildArtifacts future Object
BuildArtifacts
- Throws:
AzDException
- Default Api Exception handler.
-