func (client *ClientImpl) UpdateGroupEntitlement(ctx context.Context, args UpdateGroupEntitlementArgs) (*GroupEntitlementOperationReference, error) {
	if args.Document == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Document"}
	}
	routeValues := make(map[string]string)
	if args.GroupId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"}
	}
	routeValues["groupId"] = (*args.GroupId).String()
	queryParams := url.Values{}
	if args.RuleOption != nil {
		queryParams.Add("ruleOption", string(*args.RuleOption))
	}
	body, marshalErr := json.Marshal(*args.Document)
	if marshalErr != nil {
		return nil, marshalErr
	}
	locationId, _ := uuid.Parse("2280bffa-58a2-49da-822e-0764a1bb44f7")
	resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "5.1-preview.1", routeValues, queryParams, bytes.NewReader(body), "application/json-patch+json", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue GroupEntitlementOperationReference
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
[Preview API] Update entitlements (License Rule, Extensions Rule, Project memberships etc.) for a group.
package memberentitlementmanagement
import (
	"bytes"
	"context"
	"encoding/json"
	"github.com/google/uuid"
	"github.com/microsoft/azure-devops-go-api/azuredevops"
	"github.com/microsoft/azure-devops-go-api/azuredevops/licensingrule"
	"github.com/microsoft/azure-devops-go-api/azuredevops/webapi"
	"net/http"
	"net/url"
	"strconv"
)
var ResourceAreaId, _ = uuid.Parse("68ddce18-2501-45f1-a17b-7931a9922690")
type Client interface {
	AddGroupEntitlement(context.Context, AddGroupEntitlementArgs) (*GroupEntitlementOperationReference, error)
	AddMemberToGroup(context.Context, AddMemberToGroupArgs) error
	AddUserEntitlement(context.Context, AddUserEntitlementArgs) (*UserEntitlementsPostResponse, error)
	DeleteGroupEntitlement(context.Context, DeleteGroupEntitlementArgs) (*GroupEntitlementOperationReference, error)
	DeleteUserEntitlement(context.Context, DeleteUserEntitlementArgs) error
	GetGroupEntitlement(context.Context, GetGroupEntitlementArgs) (*GroupEntitlement, error)
	GetGroupEntitlements(context.Context, GetGroupEntitlementsArgs) (*[]GroupEntitlement, error)
	GetGroupMembers(context.Context, GetGroupMembersArgs) (*PagedGraphMemberList, error)
	GetUserEntitlement(context.Context, GetUserEntitlementArgs) (*UserEntitlement, error)
	GetUserEntitlements(context.Context, GetUserEntitlementsArgs) (*PagedGraphMemberList, error)
	GetUsersSummary(context.Context, GetUsersSummaryArgs) (*UsersSummary, error)
	RemoveMemberFromGroup(context.Context, RemoveMemberFromGroupArgs) error
	UpdateGroupEntitlement(context.Context, UpdateGroupEntitlementArgs) (*GroupEntitlementOperationReference, error)
	UpdateUserEntitlement(context.Context, UpdateUserEntitlementArgs) (*UserEntitlementsPatchResponse, error)
	UpdateUserEntitlements(context.Context, UpdateUserEntitlementsArgs) (*UserEntitlementOperationReference, error)
}
type ClientImpl struct {
	Client azuredevops.Client
}
func NewClient(ctx context.Context, connection *azuredevops.Connection) (Client, error) {
	client, err := connection.GetClientByResourceAreaId(ctx, ResourceAreaId)
	if err != nil {
		return nil, err
	}
	return &ClientImpl{
		Client: *client,
	}, nil
}
func (client *ClientImpl) AddGroupEntitlement(ctx context.Context, args AddGroupEntitlementArgs) (*GroupEntitlementOperationReference, error) {
	if args.GroupEntitlement == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupEntitlement"}
	}
	queryParams := url.Values{}
	if args.RuleOption != nil {
		queryParams.Add("ruleOption", string(*args.RuleOption))
	}
	body, marshalErr := json.Marshal(*args.GroupEntitlement)
	if marshalErr != nil {
		return nil, marshalErr
	}
	locationId, _ := uuid.Parse("2280bffa-58a2-49da-822e-0764a1bb44f7")
	resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "5.1-preview.1", nil, queryParams, bytes.NewReader(body), "application/json", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue GroupEntitlementOperationReference
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type AddGroupEntitlementArgs struct {
	GroupEntitlement *GroupEntitlement
	RuleOption *licensingrule.RuleOption
}
func (client *ClientImpl) AddMemberToGroup(ctx context.Context, args AddMemberToGroupArgs) error {
	routeValues := make(map[string]string)
	if args.GroupId == nil {
		return &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"}
	}
	routeValues["groupId"] = (*args.GroupId).String()
	if args.MemberId == nil {
		return &azuredevops.ArgumentNilError{ArgumentName: "args.MemberId"}
	}
	routeValues["memberId"] = (*args.MemberId).String()
	locationId, _ := uuid.Parse("45a36e53-5286-4518-aa72-2d29f7acc5d8")
	_, err := client.Client.Send(ctx, http.MethodPut, locationId, "5.1-preview.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return err
	}
	return nil
}
type AddMemberToGroupArgs struct {
	GroupId *uuid.UUID
	MemberId *uuid.UUID
}
func (client *ClientImpl) AddUserEntitlement(ctx context.Context, args AddUserEntitlementArgs) (*UserEntitlementsPostResponse, error) {
	if args.UserEntitlement == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.UserEntitlement"}
	}
	body, marshalErr := json.Marshal(*args.UserEntitlement)
	if marshalErr != nil {
		return nil, marshalErr
	}
	locationId, _ := uuid.Parse("387f832c-dbf2-4643-88e9-c1aa94dbb737")
	resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "5.1-preview.2", nil, nil, bytes.NewReader(body), "application/json", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue UserEntitlementsPostResponse
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type AddUserEntitlementArgs struct {
	UserEntitlement *UserEntitlement
}
func (client *ClientImpl) DeleteGroupEntitlement(ctx context.Context, args DeleteGroupEntitlementArgs) (*GroupEntitlementOperationReference, error) {
	routeValues := make(map[string]string)
	if args.GroupId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"}
	}
	routeValues["groupId"] = (*args.GroupId).String()
	queryParams := url.Values{}
	if args.RuleOption != nil {
		queryParams.Add("ruleOption", string(*args.RuleOption))
	}
	if args.RemoveGroupMembership != nil {
		queryParams.Add("removeGroupMembership", strconv.FormatBool(*args.RemoveGroupMembership))
	}
	locationId, _ := uuid.Parse("2280bffa-58a2-49da-822e-0764a1bb44f7")
	resp, err := client.Client.Send(ctx, http.MethodDelete, locationId, "5.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue GroupEntitlementOperationReference
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type DeleteGroupEntitlementArgs struct {
	GroupId *uuid.UUID
	RuleOption *licensingrule.RuleOption
	RemoveGroupMembership *bool
}
func (client *ClientImpl) DeleteUserEntitlement(ctx context.Context, args DeleteUserEntitlementArgs) error {
	routeValues := make(map[string]string)
	if args.UserId == nil {
		return &azuredevops.ArgumentNilError{ArgumentName: "args.UserId"}
	}
	routeValues["userId"] = (*args.UserId).String()
	locationId, _ := uuid.Parse("8480c6eb-ce60-47e9-88df-eca3c801638b")
	_, err := client.Client.Send(ctx, http.MethodDelete, locationId, "5.1-preview.2", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return err
	}
	return nil
}
type DeleteUserEntitlementArgs struct {
	UserId *uuid.UUID
}
func (client *ClientImpl) GetGroupEntitlement(ctx context.Context, args GetGroupEntitlementArgs) (*GroupEntitlement, error) {
	routeValues := make(map[string]string)
	if args.GroupId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"}
	}
	routeValues["groupId"] = (*args.GroupId).String()
	locationId, _ := uuid.Parse("2280bffa-58a2-49da-822e-0764a1bb44f7")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue GroupEntitlement
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetGroupEntitlementArgs struct {
	GroupId *uuid.UUID
}
func (client *ClientImpl) GetGroupEntitlements(ctx context.Context, args GetGroupEntitlementsArgs) (*[]GroupEntitlement, error) {
	locationId, _ := uuid.Parse("2280bffa-58a2-49da-822e-0764a1bb44f7")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.1", nil, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue []GroupEntitlement
	err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
	return &responseValue, err
}
type GetGroupEntitlementsArgs struct {
}
func (client *ClientImpl) GetGroupMembers(ctx context.Context, args GetGroupMembersArgs) (*PagedGraphMemberList, error) {
	routeValues := make(map[string]string)
	if args.GroupId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"}
	}
	routeValues["groupId"] = (*args.GroupId).String()
	queryParams := url.Values{}
	if args.MaxResults != nil {
		queryParams.Add("maxResults", strconv.Itoa(*args.MaxResults))
	}
	if args.PagingToken != nil {
		queryParams.Add("pagingToken", *args.PagingToken)
	}
	locationId, _ := uuid.Parse("45a36e53-5286-4518-aa72-2d29f7acc5d8")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue PagedGraphMemberList
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetGroupMembersArgs struct {
	GroupId *uuid.UUID
	MaxResults *int
	PagingToken *string
}
func (client *ClientImpl) GetUserEntitlement(ctx context.Context, args GetUserEntitlementArgs) (*UserEntitlement, error) {
	routeValues := make(map[string]string)
	if args.UserId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.UserId"}
	}
	routeValues["userId"] = (*args.UserId).String()
	locationId, _ := uuid.Parse("8480c6eb-ce60-47e9-88df-eca3c801638b")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.2", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue UserEntitlement
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetUserEntitlementArgs struct {
	UserId *uuid.UUID
}
func (client *ClientImpl) GetUserEntitlements(ctx context.Context, args GetUserEntitlementsArgs) (*PagedGraphMemberList, error) {
	queryParams := url.Values{}
	if args.Top != nil {
		queryParams.Add("top", strconv.Itoa(*args.Top))
	}
	if args.Skip != nil {
		queryParams.Add("skip", strconv.Itoa(*args.Skip))
	}
	if args.Filter != nil {
		queryParams.Add("filter", *args.Filter)
	}
	if args.SortOption != nil {
		queryParams.Add("sortOption", *args.SortOption)
	}
	locationId, _ := uuid.Parse("387f832c-dbf2-4643-88e9-c1aa94dbb737")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.2", nil, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue PagedGraphMemberList
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetUserEntitlementsArgs struct {
	Top *int
	Skip *int
	Filter *string
	SortOption *string
}
func (client *ClientImpl) GetUsersSummary(ctx context.Context, args GetUsersSummaryArgs) (*UsersSummary, error) {
	queryParams := url.Values{}
	if args.Select != nil {
		queryParams.Add("select", *args.Select)
	}
	locationId, _ := uuid.Parse("5ae55b13-c9dd-49d1-957e-6e76c152e3d9")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.1", nil, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue UsersSummary
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetUsersSummaryArgs struct {
	Select *string
}
func (client *ClientImpl) RemoveMemberFromGroup(ctx context.Context, args RemoveMemberFromGroupArgs) error {
	routeValues := make(map[string]string)
	if args.GroupId == nil {
		return &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"}
	}
	routeValues["groupId"] = (*args.GroupId).String()
	if args.MemberId == nil {
		return &azuredevops.ArgumentNilError{ArgumentName: "args.MemberId"}
	}
	routeValues["memberId"] = (*args.MemberId).String()
	locationId, _ := uuid.Parse("45a36e53-5286-4518-aa72-2d29f7acc5d8")
	_, err := client.Client.Send(ctx, http.MethodDelete, locationId, "5.1-preview.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return err
	}
	return nil
}
type RemoveMemberFromGroupArgs struct {
	GroupId *uuid.UUID
	MemberId *uuid.UUID
}