Class GroupsRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.graph.groups.GroupsRequestBuilder

public class GroupsRequestBuilder extends BaseRequestBuilder
Provides functionality to work with Graph Groups Api.
  • Constructor Details

    • GroupsRequestBuilder

      public GroupsRequestBuilder(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<GraphGroup> createAsync(GraphGroupCreationContext groupCreationContext) throws AzDException
      Create a new Azure DevOps group or materialize an existing AAD group.

      The body of the request must be a derived type of GraphGroupCreationContext:

      GraphGroupVstsCreationContext Create a new Azure DevOps group that is not backed by an external provider.

      GraphGroupMailAddressCreationContext Create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider.

      GraphGroupOriginIdCreationContext Create a new group using the OriginID as a reference to a group from an external AD or AAD backed provider.

      Optionally, you can add the newly created group as a member of an existing Azure DevOps group and/or specify a custom storage key for the group.
      Parameters:
      groupCreationContext - Request body to create a new group.
      Returns:
      Graph group object GraphGroup
      Throws:
      AzDException - Default Api exception hanlder.
    • createAsync

      public CompletableFuture<GraphGroup> createAsync(GraphGroupCreationContext groupCreationContext, Consumer<GroupsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Create a new Azure DevOps group or materialize an existing AAD group.

      The body of the request must be a derived type of GraphGroupCreationContext:

      GraphGroupVstsCreationContext Create a new Azure DevOps group that is not backed by an external provider.

      GraphGroupMailAddressCreationContext Create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider.

      GraphGroupOriginIdCreationContext Create a new group using the OriginID as a reference to a group from an external AD or AAD backed provider.

      Optionally, you can add the newly created group as a member of an existing Azure DevOps group and/or specify a custom storage key for the group.
      Parameters:
      groupCreationContext - Request body to create a new group.
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      Graph group object GraphGroup
      Throws:
      AzDException - Default Api exception handler.
    • deleteAsync

      public CompletableFuture<Void> deleteAsync(String groupDescriptor) throws AzDException
      Removes an Azure DevOps group from all of its parent groups. The group will still be visible, but membership checks for the group, and all descendants which derive membership through it, will return false.”
      Parameters:
      groupDescriptor - The descriptor of the group to delete.
      Throws:
      AzDException - Default Api exception handler.
    • getAsync

      public CompletableFuture<GraphGroup> getAsync(String groupDescriptor) throws AzDException
      Get a group by its descriptor. The group will be returned even if it has been deleted from the account or has had all its memberships deleted.
      Parameters:
      groupDescriptor - The descriptor of the desired graph group.
      Returns:
      Graph group object GraphGroup
      Throws:
      AzDException - Default Api exception handler.
    • listAsync

      public CompletableFuture<GraphGroups> listAsync() throws AzDException
      Gets a list of all groups in the current scope (usually organization or account). The optional parameters are used to filter down the returned results. Returned results are in no guaranteed order. Since the list of groups may be large, results are returned in pages of groups. If there are more results than can be returned in a single page, the result set will contain a continuation token for retrieval of the next set of results.
      Returns:
      Collection of Graph Group GraphGroups
      Throws:
      AzDException - Default Api exception handler.
    • listAsync

      Gets a list of all groups in the current scope (usually organization or account). The optional parameters are used to filter down the returned results. Returned results are in no guaranteed order. Since the list of groups may be large, results are returned in pages of groups. If there are more results than can be returned in a single page, the result set will contain a continuation token for retrieval of the next set of results.
      Returns:
      Collection of Graph Group GraphGroups
      Throws:
      AzDException - Default Api exception handler.
    • updateAsync

      public CompletableFuture<GraphGroup> updateAsync(JsonPatchDocument patchDocument, String groupDescriptor) throws AzDException
      Update the properties of an Azure DevOps group. Currently limited to only changing the description and account name.

      Example:

      
       [
        {
          "op": "replace",
          "path": "/description",
          "from": null,
          "value": "Updated description"
        }
       ]
       
      Parameters:
      patchDocument - Request body to change the description or account name.
      groupDescriptor - The descriptor of the group to modify.
      Returns:
      Collection of Graph Group GraphGroups
      Throws:
      AzDException - Default Api exception handler.
    • create

      public GraphGroup create(GraphGroupCreationContext groupCreationContext) throws AzDException
      Create a new Azure DevOps group or materialize an existing AAD group.

      The body of the request must be a derived type of GraphGroupCreationContext:

      GraphGroupVstsCreationContext Create a new Azure DevOps group that is not backed by an external provider.

      GraphGroupMailAddressCreationContext Create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider.

      GraphGroupOriginIdCreationContext Create a new group using the OriginID as a reference to a group from an external AD or AAD backed provider.

      Optionally, you can add the newly created group as a member of an existing Azure DevOps group and/or specify a custom storage key for the group.
      Parameters:
      groupCreationContext - Request body to create a new group.
      Returns:
      Graph group object GraphGroup
      Throws:
      AzDException - Default Api exception hanlder.
    • create

      public GraphGroup create(GraphGroupCreationContext groupCreationContext, Consumer<GroupsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Create a new Azure DevOps group or materialize an existing AAD group.

      The body of the request must be a derived type of GraphGroupCreationContext:

      GraphGroupVstsCreationContext Create a new Azure DevOps group that is not backed by an external provider.

      GraphGroupMailAddressCreationContext Create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider.

      GraphGroupOriginIdCreationContext Create a new group using the OriginID as a reference to a group from an external AD or AAD backed provider.

      Optionally, you can add the newly created group as a member of an existing Azure DevOps group and/or specify a custom storage key for the group.
      Parameters:
      groupCreationContext - Request body to create a new group.
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      Graph group object GraphGroup
      Throws:
      AzDException - Default Api exception handler.
    • delete

      public Void delete(String groupDescriptor) throws AzDException
      Removes an Azure DevOps group from all of its parent groups. The group will still be visible, but membership checks for the group, and all descendants which derive membership through it, will return false.”
      Parameters:
      groupDescriptor - The descriptor of the group to delete.
      Throws:
      AzDException - Default Api exception handler.
    • get

      public GraphGroup get(String groupDescriptor) throws AzDException
      Get a group by its descriptor. The group will be returned even if it has been deleted from the account or has had all its memberships deleted.
      Parameters:
      groupDescriptor - The descriptor of the desired graph group.
      Returns:
      Graph group object GraphGroup
      Throws:
      AzDException - Default Api exception handler.
    • list

      public GraphGroups list() throws AzDException
      Gets a list of all groups in the current scope (usually organization or account). The optional parameters are used to filter down the returned results. Returned results are in no guaranteed order. Since the list of groups may be large, results are returned in pages of groups. If there are more results than can be returned in a single page, the result set will contain a continuation token for retrieval of the next set of results.
      Returns:
      Collection of Graph Group GraphGroups
      Throws:
      AzDException - Default Api exception handler.
    • list

      Gets a list of all groups in the current scope (usually organization or account). The optional parameters are used to filter down the returned results. Returned results are in no guaranteed order. Since the list of groups may be large, results are returned in pages of groups. If there are more results than can be returned in a single page, the result set will contain a continuation token for retrieval of the next set of results.
      Parameters:
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      Collection of Graph Group GraphGroups
      Throws:
      AzDException - Default Api exception handler.
    • update

      public GraphGroup update(JsonPatchDocument patchDocument, String groupDescriptor) throws AzDException
      Update the properties of an Azure DevOps group. Currently limited to only changing the description and account name.

      Example:

      
       [
        {
          "op": "replace",
          "path": "/description",
          "from": null,
          "value": "Updated description"
        }
       ]
       
      Parameters:
      patchDocument - Request body to change the description or account name.
      groupDescriptor - The descriptor of the group to modify.
      Returns:
      Collection of Graph Group GraphGroups
      Throws:
      AzDException - Default Api exception handler.