Package org.azd.helpers.graph
Class GraphHelpersRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.graph.GraphRequestBuilder
org.azd.helpers.graph.GraphHelpersRequestBuilder
Helper request builder that combines multiple Apis to create logical helper methods for ease of use.
-
Nested Class Summary
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
ConstructorDescriptionGraphHelpersRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptionaddUserToGroup
(String emailId, String groupDescriptor) Materialize an existing AAD or MSA user into the VSTS account.createGroup
(String displayName, String description) create a local group at the collection levelcreateGroup
(String displayName, String description, String projectDescriptor) create a local group at the project levelcreateUser
(String emailId) Materialize an existing AAD or MSA user into the VSTS account.getGroupMembersOf
(String groupDescriptor) get subjects (users, groups) that are a member of the specified groupgetMemberOfGroups
(String subjectDescriptor) get groups that the specified subject (user, group) belongs tosubjectLookup
(String... descriptors) resolve descriptors to subjectsMethods inherited from class org.azd.graph.GraphRequestBuilder
descriptors, groups, memberships, membershipStates, providerInfo, servicePrincipals, storageKeys, subjectLookup, subjectQuery, users
Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
GraphHelpersRequestBuilder
public GraphHelpersRequestBuilder(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
-
createUser
Materialize an existing AAD or MSA user into the VSTS account. NOTE: Created users are not active in an account unless they have been explicitly assigned a parent group at creation time or have signed in and been autolicensed through AAD group memberships. Adding a user to an account is required before the user can be added to VSTS groups or assigned an asset. Create a new user using the principal name as a reference to an existing user from an external AD or AAD backed provider. If the user to be added corresponds to a user that was previously deleted, then that user will be restored.- Parameters:
emailId
- provide the user principal name (email address) of the user to be added.- Returns:
- GraphUser
GraphUser
- Throws:
AzDException
- Default Api Exception handler.
-
addUserToGroup
Materialize an existing AAD or MSA user into the VSTS account. Add the newly created user as a member of an existing VSTS group by providing the group descriptor.- Parameters:
emailId
- provide the user principal name (email address) of the user to be added.groupDescriptor
- provide the group descriptor.- Returns:
- GraphUser
GraphUser
- Throws:
AzDException
- Default Api Exception handler.
-
getGroupMembersOf
get subjects (users, groups) that are a member of the specified group- Parameters:
groupDescriptor
- The descriptor of the container group- Returns:
- GraphMemberships
GraphMemberships
- Throws:
AzDException
- Default Api Exception handler.
-
getMemberOfGroups
get groups that the specified subject (user, group) belongs to- Parameters:
subjectDescriptor
- The descriptor of the subject (either user or group) that belongs to a container- Returns:
- GraphMemberships
GraphMemberships
- Throws:
AzDException
- Default Api Exception handler.
-
createGroup
create a local group at the collection level- Parameters:
displayName
- The name of the groupdescription
- A generally more verbose description of the group- Returns:
- GraphMembership
GraphMembership
- Throws:
AzDException
- Default Api Exception handler.
-
createGroup
public GraphGroup createGroup(String displayName, String description, String projectDescriptor) throws AzDException create a local group at the project level- Parameters:
displayName
- The name of the groupdescription
- A generally more verbose description of the group- Returns:
- GraphMembership
GraphMembership
- Throws:
AzDException
- Default Api Exception handler.
-
subjectLookup
resolve descriptors to subjectsRefer to REST API documentation on storage keys
- Parameters:
descriptors
- user and group descriptor strings- Returns:
- SubjectLookupResponse
SubjectLookupResponse
- Throws:
AzDException
- Default Api Exception handler.
-