Class WorkItemTrackingAttachmentsRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.workitemtracking.attachments.WorkItemTrackingAttachmentsRequestBuilder
Provides functionality to work with work item attachments Api.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the query parameters.static class
Request configuration object for the query parameters.static 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
ConstructorDescriptionWorkItemTrackingAttachmentsRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(InputStream contents, Consumer<WorkItemTrackingAttachmentsRequestBuilder.CreateRequestConfiguration> requestConfiguration) Uploads an attachment.createAsync
(InputStream contents, Consumer<WorkItemTrackingAttachmentsRequestBuilder.CreateRequestConfiguration> requestConfiguration) Uploads an attachment.get
(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) Downloads an attachment.getAsync
(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) Downloads an attachment.getAsZip
(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) Downloads an attachment.getAsZipAsync
(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) Downloads an attachment.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
WorkItemTrackingAttachmentsRequestBuilder
public WorkItemTrackingAttachmentsRequestBuilder(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<AttachmentReference> createAsync(InputStream contents, Consumer<WorkItemTrackingAttachmentsRequestBuilder.CreateRequestConfiguration> requestConfiguration) throws AzDException Uploads an attachment. On accounts with higher attachment upload limits (>130MB), you will need to use chunked upload.- Parameters:
contents
- Stream to upload. Payload to create the attachment.requestConfiguration
- Represents the query parameters.- Returns:
- AttachmentReference
AttachmentReference
- Throws:
AzDException
- Default Api exception handler.
-
getAsync
public CompletableFuture<InputStream> getAsync(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Downloads an attachment.- Parameters:
id
- Attachment IDrequestConfiguration
- Represents the query parameters.- Returns:
- Stream of the attachment content. Use
StreamHelper
to download the attachment contents to a file. - Throws:
AzDException
- Default Api exception handler.
-
getAsZipAsync
public CompletableFuture<InputStream> getAsZipAsync(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Downloads an attachment.- Parameters:
id
- Attachment IDrequestConfiguration
- Represents the query parameters.- Returns:
- Stream of the attachment content. Use
StreamHelper
to download the attachment contents to a file. - Throws:
AzDException
- Default Api exception handler.
-
create
public AttachmentReference create(InputStream contents, Consumer<WorkItemTrackingAttachmentsRequestBuilder.CreateRequestConfiguration> requestConfiguration) throws AzDException Uploads an attachment. On accounts with higher attachment upload limits (>130MB), you will need to use chunked upload.- Parameters:
contents
- Stream to upload. Payload to create the attachment.requestConfiguration
- Represents the query parameters.- Returns:
- AttachmentReference
AttachmentReference
- Throws:
AzDException
- Default Api exception handler.
-
get
public InputStream get(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Downloads an attachment.- Parameters:
id
- Attachment IDrequestConfiguration
- Represents the query parameters.- Returns:
- Stream of the attachment content. Use
StreamHelper
to download the attachment contents to a file. - Throws:
AzDException
- Default Api exception handler.
-
getAsZip
public InputStream getAsZip(String id, Consumer<WorkItemTrackingAttachmentsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Downloads an attachment.- Parameters:
id
- Attachment IDrequestConfiguration
- Represents the query parameters.- Returns:
- Stream of the attachment content. Use
StreamHelper
to download the attachment contents to a file. - Throws:
AzDException
- Default Api exception handler.
-