Package org.azd.git.refs
Class RefsRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.refs.RefsRequestBuilder
Request builder to handle requests for Git Refs Api.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the query parameters.static classRequest 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
ConstructorsConstructorDescriptionRefsRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptionQueries the provided repository for its refs and returns them.list(String repositoryName, Consumer<RefsRequestBuilder.RequestConfiguration> requestConfiguration) Queries the provided repository for its refs and returns them.Queries the provided repository for its refs and returns them.listAsync(String repositoryName, Consumer<RefsRequestBuilder.RequestConfiguration> requestConfiguration) Queries the provided repository for its refs and returns them.Lock or Unlock a branch with repository name and branch name.update(String repositoryName, List<GitRefUpdate> gitRefUpdates) Creating, updating, or deleting refs(branches).updateAsync(String repositoryName, String branchName, boolean isLocked) Lock or Unlock a branch with repository name and branch name.updateAsync(String repositoryName, List<GitRefUpdate> gitRefUpdates) Creating, updating, or deleting refs(branches).Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
RefsRequestBuilder
Instantiates a new RequestBuilder instance and sets the default values.- Parameters:
organizationUrl- Represents organization location request url.accessTokenCredential- Access token credential object.
-
-
Method Details
-
listAsync
Queries the provided repository for its refs and returns them.- Parameters:
repositoryName- The name or ID of the repository.- Returns:
- GitRefs future object
GitRefs. - Throws:
AzDException- Default Api exception handler.
-
listAsync
public CompletableFuture<GitRefs> listAsync(String repositoryName, Consumer<RefsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Queries the provided repository for its refs and returns them.- Parameters:
repositoryName- The name or ID of the repository.- Returns:
- GitRefs future object
GitRefs. - Throws:
AzDException- Default Api exception handler.
-
updateAsync
public CompletableFuture<GitRef> updateAsync(String repositoryName, String branchName, boolean isLocked) throws AzDException Lock or Unlock a branch with repository name and branch name.- Parameters:
repositoryName- The name or ID of the repository.branchName- The name of the branch to lock/unlockisLocked- true to lock the branch and false to unlock.- Returns:
- GitRef
GitRef - Throws:
AzDException- Default Api Exception handler.
-
updateAsync
public CompletableFuture<GitRefUpdateResults> updateAsync(String repositoryName, List<GitRefUpdate> gitRefUpdates) throws AzDException Creating, updating, or deleting refs(branches). Updating a ref means making it point at a different commit than it used to. You must specify both the old and new commit to avoid race conditions.- Parameters:
repositoryName- The name or ID of the repository.gitRefUpdates- Collection of Git Reference object to update.- Returns:
- GitRefUpdateResults
GitRefUpdateResults - Throws:
AzDException- Default Api Exception handler.
-
list
Queries the provided repository for its refs and returns them.- Parameters:
repositoryName- The name or ID of the repository.- Returns:
- GitRefs future object
GitRefs. - Throws:
AzDException- Default Api exception handler.
-
list
public GitRefs list(String repositoryName, Consumer<RefsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Queries the provided repository for its refs and returns them.- Parameters:
repositoryName- The name or ID of the repository.- Returns:
- GitRefs future object
GitRefs. - Throws:
AzDException- Default Api exception handler.
-
update
public GitRef update(String repositoryName, String branchName, boolean isLocked) throws AzDException Lock or Unlock a branch with repository name and branch name.- Parameters:
repositoryName- The name or ID of the repository.branchName- The name of the branch to lock/unlockisLocked- true to lock the branch and false to unlock.- Returns:
- GitRef
GitRef - Throws:
AzDException- Default Api Exception handler.
-
update
public GitRefUpdateResults update(String repositoryName, List<GitRefUpdate> gitRefUpdates) throws AzDException Creating, updating, or deleting refs(branches). Updating a ref means making it point at a different commit than it used to. You must specify both the old and new commit to avoid race conditions.- Parameters:
repositoryName- The name or ID of the repository.gitRefUpdates- Collection of Git Reference object to update.- Returns:
- GitRefUpdateResults
GitRefUpdateResults - Throws:
AzDException- Default Api Exception handler.
-