Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.14 KB

File metadata and controls

34 lines (26 loc) · 1.14 KB
description Automatically generated file. DO NOT MODIFY
// Code snippets are only available for the latest major version. Current major version is $v1.*

// Dependencies
import (
	  "context"
	  msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
	  graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
	  //other-imports
)

requestBody := graphmodels.NewAccessPackageAssignmentRequest()
requestType := graphmodels.ADMINADD_ACCESSPACKAGEREQUESTTYPE 
requestBody.SetRequestType(&requestType) 
assignment := graphmodels.NewAccessPackageAssignment()
additionalData := map[string]interface{}{
	"targetId" : "46184453-e63b-4f20-86c2-c557ed5d5df9", 
	"assignmentPolicyId" : "2264bf65-76ba-417b-a27d-54d291f0cbc8", 
	"accessPackageId" : "a914b616-e04e-476b-aa37-91038f0b165b", 
}
assignment.SetAdditionalData(additionalData)
requestBody.SetAssignment(assignment)

// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignmentRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AssignmentRequests().Post(context.Background(), requestBody, nil)