Package org.azd.build.sourceproviders
Class SourceProvidersRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.build.sourceproviders.SourceProvidersRequestBuilder
Provides functionality to work with Build Definitions Api.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
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
ConstructorDescriptionSourceProvidersRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptiongetFileContents
(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) Gets the contents of a file in the given source code repository.getFileContentsAsync
(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) Gets the contents of a file in the given source code repository.getPathContents
(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) Gets the contents of a directory in the given source code repository.getPathContentsAsync
(String providerName, Consumer<SourceProvidersRequestBuilder.GetRequestConfiguration> requestConfiguration) Gets the contents of a directory in the given source code repository.getPullRequest
(String providerName, String pullRequestId, String repositoryName, String serviceEndpointId) Gets a pull request object from source provider.getPullRequestAsync
(String providerName, String pullRequestId, String repositoryName, String serviceEndpointId) Gets a pull request object from source provider.list()
Get a list of source providers and their capabilities.Get a list of source providers and their capabilities.listBranches
(String providerName, Consumer<SourceProvidersRequestBuilder.GetBranchesRequestConfiguration> requestConfiguration) Gets a list of branches for the given source code repository.listBranchesAsync
(String providerName, Consumer<SourceProvidersRequestBuilder.GetBranchesRequestConfiguration> requestConfiguration) Gets a list of branches for the given source code repository.listRepositories
(String providerName, Consumer<SourceProvidersRequestBuilder.GetRepositoriesRequestConfiguration> requestConfiguration) Gets a list of source code repositories.listRepositoriesAsync
(String providerName, Consumer<SourceProvidersRequestBuilder.GetRepositoriesRequestConfiguration> requestConfiguration) Gets a list of source code repositories.listWebhooks
(String providerName, String serviceEndpointId, String repositoryName) Gets a list of webhooks installed in the given source code repository.listWebhooksAsync
(String providerName, String serviceEndpointId, String repositoryName) Gets a list of webhooks installed in the given source code repository.restore
(String providerName, String serviceEndpointId, String repositoryName, List<String> triggerTypes) Recreates the webhooks for the specified triggers in the given source code repository.restoreAsync
(String providerName, String serviceEndpointId, String repositoryName, List<String> triggerTypes) Recreates the webhooks for the specified triggers in the given source code repository.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
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., GithubrequestConfiguration
- 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., GithubrequestConfiguration
- 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 providerpullRequestId
- 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
public CompletableFuture<SourceProviderBranches> listBranchesAsync(String providerName, Consumer<SourceProvidersRequestBuilder.GetBranchesRequestConfiguration> requestConfiguration) throws AzDException 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
public CompletableFuture<SourceRepositories> listRepositoriesAsync(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.
-
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., GithubrequestConfiguration
- 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., GithubrequestConfiguration
- 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 providerpullRequestId
- 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
Get a list of source providers and their capabilities.- Returns:
- SourceProviderAttributes
SourceProviderAttributes
- Throws:
AzDException
- Default Api Exception handler.
-
listBranches
public SourceProviderBranches listBranches(String providerName, Consumer<SourceProvidersRequestBuilder.GetBranchesRequestConfiguration> requestConfiguration) throws AzDException 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.
-