Class ItemsRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.items.ItemsRequestBuilder

public class ItemsRequestBuilder extends BaseRequestBuilder
Provides functionality to build requests for managing Git Items Api.
  • Constructor Details

    • ItemsRequestBuilder

      public ItemsRequestBuilder(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

    • getAsync

      public CompletableFuture<GitItem> getAsync(String repositoryId, String path) throws AzDException
      Get Item Metadata and/or Content for a single item.
      Parameters:
      repositoryId - The name or ID of the repository.
      path - The item path.
      Returns:
      Future of Git item object GitItem
      Throws:
      AzDException - Default Api exception handler.
    • getAsTextAsync

      public CompletableFuture<String> getAsTextAsync(String repositoryId, String path, Consumer<ItemsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
      Parameters:
      repositoryId - The name or ID of the repository.
      path - The item path.
      requestConfiguration - Request configuration of query parameters.
      Returns:
      Item as plain text.
      Throws:
      AzDException - Default Api exception handler.
    • getAsZipAsync

      public CompletableFuture<InputStream> getAsZipAsync(String repositoryId, String path, Consumer<ItemsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
      Parameters:
      repositoryId - The name or ID of the repository.
      path - The item path.
      requestConfiguration - Request configuration of query parameters.
      Returns:
      Item as plain text.
      Throws:
      AzDException - Default Api exception handler.
    • getBatchAsync

      public CompletableFuture<GitItemsList> getBatchAsync(GitItemRequestData gitItemRequestData, String repositoryId) throws AzDException
      Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path
      Parameters:
      gitItemRequestData - Request data to get the items in batch.
      repositoryId - The name or ID of the repository
      Returns:
      List of GitItems.
      Throws:
      AzDException - Default Api exception handler.
    • listAsync

      public CompletableFuture<GitItems> listAsync(String repositoryId) throws AzDException
      Get Item Metadata and/or Content for a collection of items.
      Parameters:
      repositoryId - The name or ID of the repository
      Returns:
      Git items GitItems
      Throws:
      AzDException - Default Api exception handler.
    • listAsync

      public CompletableFuture<GitItems> listAsync(String repositoryId, Consumer<ItemsRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException
      Get Item Metadata and/or Content for a collection of items.
      Parameters:
      repositoryId - The name or ID of the repository
      requestConfiguration - Represents the query parameters
      Returns:
      Git items GitItems
      Throws:
      AzDException - Default Api exception handler.
    • get

      public GitItem get(String repositoryId, String path) throws AzDException
      Get Item Metadata and/or Content for a single item.
      Parameters:
      repositoryId - The name or ID of the repository.
      path - The item path.
      Returns:
      Future of Git item object GitItem
      Throws:
      AzDException - Default Api exception handler.
    • getAsText

      public String getAsText(String repositoryId, String path, Consumer<ItemsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
      Parameters:
      repositoryId - The name or ID of the repository.
      path - The item path.
      requestConfiguration - Request configuration of query parameters.
      Returns:
      Item as plain text.
      Throws:
      AzDException - Default Api exception handler.
    • getAsZip

      public InputStream getAsZip(String repositoryId, String path, Consumer<ItemsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
      Parameters:
      repositoryId - The name or ID of the repository.
      path - The item path.
      requestConfiguration - Request configuration of query parameters.
      Returns:
      Item as plain text.
      Throws:
      AzDException - Default Api exception handler.
    • getBatch

      public GitItemsList getBatch(GitItemRequestData gitItemRequestData, String repositoryId) throws AzDException
      Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path
      Parameters:
      gitItemRequestData - Request data to get the items in batch.
      repositoryId - The name or ID of the repository
      Returns:
      List of GitItems.
      Throws:
      AzDException - Default Api exception handler.
    • list

      public GitItems list(String repositoryId) throws AzDException
      Get Item Metadata and/or Content for a collection of items.
      Parameters:
      repositoryId - The name or ID of the repository
      Returns:
      Git items GitItems
      Throws:
      AzDException - Default Api exception handler.
    • list

      public GitItems list(String repositoryId, Consumer<ItemsRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException
      Get Item Metadata and/or Content for a collection of items.
      Parameters:
      repositoryId - The name or ID of the repository
      requestConfiguration - Represents the query parameters
      Returns:
      Git items GitItems
      Throws:
      AzDException - Default Api exception handler.