Package org.azd.test.attachments
Class RunAttachmentRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.test.attachments.RunAttachmentRequestBuilder
Provides functionality to work with Test run attachments Api.
-
Nested Class Summary
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
ConstructorsConstructorDescriptionRunAttachmentRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(int runId, TestAttachmentRequestModel requestModel) Attach a file to a test run.createAsync
(int runId, TestAttachmentRequestModel requestModel) Attach a file to a test run.getAsZip
(int attachmentId, int runId) Download a test result attachment by its ID.getAsZipAsync
(int attachmentId, int runId) Download a test result attachment by its ID.getContent
(int attachmentId, int runId) Download a test run attachment by its ID.getContentAsync
(int attachmentId, int runId) Download a test run attachment by its ID.list
(int runId) Get list of test run attachments reference.listAsync
(int runId) Get list of test run attachments reference.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
RunAttachmentRequestBuilder
public RunAttachmentRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential) 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<TestAttachmentReference> createAsync(int runId, TestAttachmentRequestModel requestModel) throws AzDException Attach a file to a test run.- Parameters:
runId
- ID of the test run against which attachment has to be uploaded.requestModel
- Request body to create the result attachment.- Returns:
- TestAttachmentReference
TestAttachmentReference
- Throws:
AzDException
- Default Api exception handler.
-
getContentAsync
public CompletableFuture<InputStream> getContentAsync(int attachmentId, int runId) throws AzDException Download a test run attachment by its ID.- Parameters:
attachmentId
- ID of the test result attachment to be downloaded.runId
- ID of the test run that contains the result.- Returns:
- InputStream of attachment content.
- Throws:
AzDException
- Default Api exception handler.
-
getAsZipAsync
public CompletableFuture<InputStream> getAsZipAsync(int attachmentId, int runId) throws AzDException Download a test result attachment by its ID.- Parameters:
attachmentId
- ID of the test result attachment to be downloaded.runId
- ID of the test run that contains the result.- Returns:
- InputStream of attachment content as zip file.
- Throws:
AzDException
- Default Api exception handler.
-
listAsync
Get list of test run attachments reference.- Parameters:
runId
- ID of the test run that contains the result.- Returns:
- List of TestAttachment
TestAttachments
- Throws:
AzDException
- Default Api exception handler.
-
create
public TestAttachmentReference create(int runId, TestAttachmentRequestModel requestModel) throws AzDException Attach a file to a test run.- Parameters:
runId
- ID of the test run against which attachment has to be uploaded.requestModel
- Request body to create the result attachment.- Returns:
- TestAttachmentReference
TestAttachmentReference
- Throws:
AzDException
- Default Api exception handler.
-
getContent
Download a test run attachment by its ID.- Parameters:
attachmentId
- ID of the test result attachment to be downloaded.runId
- ID of the test run that contains the result.- Returns:
- InputStream of attachment content.
- Throws:
AzDException
- Default Api exception handler.
-
getAsZip
Download a test result attachment by its ID.- Parameters:
attachmentId
- ID of the test result attachment to be downloaded.runId
- ID of the test run that contains the result.- Returns:
- InputStream of attachment content as zip file.
- Throws:
AzDException
- Default Api exception handler.
-
list
Get list of test run attachments reference.- Parameters:
runId
- ID of the test run that contains the result.- Returns:
- List of TestAttachment
TestAttachments
- Throws:
AzDException
- Default Api exception handler.
-