Class SourceProvidersRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.build.sourceproviders.SourceProvidersRequestBuilder

public class SourceProvidersRequestBuilder extends BaseRequestBuilder
Provides functionality to work with Build Definitions Api.
  • Constructor Details

    • SourceProvidersRequestBuilder

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

    • getFileContentsAsync

      public CompletableFuture<String> getFileContentsAsync(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException
      Gets the contents of a file in the given source code repository.
      Parameters:
      providerName - The name of the source provider. E.g., Github
      requestConfiguration - Consumer of request parameters configuration.
      Returns:
      Contents of the file given String. String
      Throws:
      AzDException - Default Api Exception handler.
    • getPathContentsAsync

      public CompletableFuture<SourceRepositoryItems> getPathContentsAsync(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException
      Gets the contents of a directory in the given source code repository.
      Parameters:
      providerName - The name of the source provider. E.g., Github
      requestConfiguration - Consumer of request parameters configuration.
      Returns:
      SourceRepositoryItems SourceRepositoryItems
      Throws:
      AzDException - Default Api Exception handler.
    • getPullRequestAsync

      public CompletableFuture<SourceProviderPullRequest> getPullRequestAsync(String providerName, String pullRequestId, String repositoryName, String serviceEndpointId) throws AzDException
      Gets a pull request object from source provider.
      Parameters:
      providerName - The name of the source provider
      pullRequestId - Vendor-specific id of the pull request.
      repositoryName - Vendor-specific identifier or the name of the repository that contains the pull request.
      serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
      Returns:
      SourceProviderPullRequest SourceProviderPullRequest
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      Get a list of source providers and their capabilities.
      Returns:
      SourceProviderAttributes SourceProviderAttributes
      Throws:
      AzDException - Default Api Exception handler.
    • listBranchesAsync

      Gets a list of branches for the given source code repository.
      Parameters:
      providerName - The name of the source provider.
      requestConfiguration - Consumer of query parameters to filter.
      Returns:
      SourceProviderBranches SourceProviderBranches
      Throws:
      AzDException - Default Api Exception handler.
    • listRepositoriesAsync

      Gets a list of source code repositories.
      Parameters:
      providerName - The name of the source provider.
      requestConfiguration - Consumer of query parameters to filter.
      Returns:
      SourceRepositories SourceRepositories
      Throws:
      AzDException - Default Api Exception handler.
    • listWebhooksAsync

      public CompletableFuture<RepositoryWebhooks> listWebhooksAsync(String providerName, String serviceEndpointId, String repositoryName) throws AzDException
      Gets a list of webhooks installed in the given source code repository.
      Parameters:
      providerName - The name of the source provider.
      serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
      repositoryName - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
      Returns:
      RepositoryWebhooks RepositoryWebhooks
      Throws:
      AzDException - Default Api Exception handler.
    • restoreAsync

      public CompletableFuture<Void> restoreAsync(String providerName, String serviceEndpointId, String repositoryName, List<String> triggerTypes) throws AzDException
      Recreates the webhooks for the specified triggers in the given source code repository.
      Parameters:
      providerName - The name of the source provider.
      serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
      repositoryName - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
      triggerTypes - The types of triggers to restore webhooks for.
      Returns:
      Void; successful operation
      Throws:
      AzDException - Default Api Exception handler.
    • getFileContents

      public String getFileContents(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException
      Gets the contents of a file in the given source code repository.
      Parameters:
      providerName - The name of the source provider. E.g., Github
      requestConfiguration - Consumer of request parameters configuration.
      Returns:
      Contents of the file given String. String
      Throws:
      AzDException - Default Api Exception handler.
    • getPathContents

      public SourceRepositoryItems getPathContents(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException
      Gets the contents of a directory in the given source code repository.
      Parameters:
      providerName - The name of the source provider. E.g., Github
      requestConfiguration - Consumer of request parameters configuration.
      Returns:
      SourceRepositoryItems SourceRepositoryItems
      Throws:
      AzDException - Default Api Exception handler.
    • getPullRequest

      public SourceProviderPullRequest getPullRequest(String providerName, String pullRequestId, String repositoryName, String serviceEndpointId) throws AzDException
      Gets a pull request object from source provider.
      Parameters:
      providerName - The name of the source provider
      pullRequestId - Vendor-specific id of the pull request.
      repositoryName - Vendor-specific identifier or the name of the repository that contains the pull request.
      serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
      Returns:
      SourceProviderPullRequest SourceProviderPullRequest
      Throws:
      AzDException - Default Api Exception handler.
    • list

      public SourceProviderAttributes list() throws AzDException
      Get a list of source providers and their capabilities.
      Returns:
      SourceProviderAttributes SourceProviderAttributes
      Throws:
      AzDException - Default Api Exception handler.
    • listBranches

      Gets a list of branches for the given source code repository.
      Parameters:
      providerName - The name of the source provider.
      requestConfiguration - Consumer of query parameters to filter.
      Returns:
      SourceProviderBranches SourceProviderBranches
      Throws:
      AzDException - Default Api Exception handler.
    • listRepositories

      public SourceRepositories listRepositories(String providerName, Consumer<SourceProvidersRequestBuilder.GetRepositoriesRequestConfiguration> requestConfiguration) throws AzDException
      Gets a list of source code repositories.
      Parameters:
      providerName - The name of the source provider.
      requestConfiguration - Consumer of query parameters to filter.
      Returns:
      SourceRepositories SourceRepositories
      Throws:
      AzDException - Default Api Exception handler.
    • listWebhooks

      public RepositoryWebhooks listWebhooks(String providerName, String serviceEndpointId, String repositoryName) throws AzDException
      Gets a list of webhooks installed in the given source code repository.
      Parameters:
      providerName - The name of the source provider.
      serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
      repositoryName - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
      Returns:
      RepositoryWebhooks RepositoryWebhooks
      Throws:
      AzDException - Default Api Exception handler.
    • restore

      public Void restore(String providerName, String serviceEndpointId, String repositoryName, List<String> triggerTypes) throws AzDException
      Recreates the webhooks for the specified triggers in the given source code repository.
      Parameters:
      providerName - The name of the source provider.
      serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
      repositoryName - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
      triggerTypes - The types of triggers to restore webhooks for.
      Returns:
      Void; successful operation
      Throws:
      AzDException - Default Api Exception handler.