// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "26ac0c0a-08bc-4a7b-a313-839f58044ba5",
RequestType = "AdminAdd",
Justification = "",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Sales",
Description = "https://contoso.sharepoint.com/sites/Sales",
Url = "https://contoso.sharepoint.com/sites/Sales",
ResourceType = "SharePoint Online Site",
OriginId = "https://contoso.sharepoint.com/sites/Sales",
OriginSystem = "SharePointOnline",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageResourceRequests.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("26ac0c0a-08bc-4a7b-a313-839f58044ba5");
accessPackageResourceRequest.setRequestType("AdminAdd");
accessPackageResourceRequest.setJustification("");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Sales");
accessPackageResource.setDescription("https://contoso.sharepoint.com/sites/Sales");
accessPackageResource.setUrl("https://contoso.sharepoint.com/sites/Sales");
accessPackageResource.setResourceType("SharePoint Online Site");
accessPackageResource.setOriginId("https://contoso.sharepoint.com/sites/Sales");
accessPackageResource.setOriginSystem("SharePointOnline");
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "26ac0c0a-08bc-4a7b-a313-839f58044ba5",
request_type = "AdminAdd",
justification = "",
access_package_resource = AccessPackageResource(
display_name = "Sales",
description = "https://contoso.sharepoint.com/sites/Sales",
url = "https://contoso.sharepoint.com/sites/Sales",
resource_type = "SharePoint Online Site",
origin_id = "https://contoso.sharepoint.com/sites/Sales",
origin_system = "SharePointOnline",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "de9315c1-272b-4905-924b-cc112ca180c7",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Community Outreach",
Description = "https://contoso.sharepoint.com/sites/CSR",
ResourceType = "SharePoint Online Site",
OriginId = "https://contoso.sharepoint.com/sites/CSR",
OriginSystem = "SharePointOnline",
AdditionalData = new Dictionary<string, object>
{
{
"accessPackageResourceEnvironment@odata.bind" , "accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57"
},
},
},
RequestType = "AdminAdd",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageResourceRequests.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("de9315c1-272b-4905-924b-cc112ca180c7");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Community Outreach");
accessPackageResource.setDescription("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setResourceType("SharePoint Online Site");
accessPackageResource.setOriginId("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setOriginSystem("SharePointOnline");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("accessPackageResourceEnvironment@odata.bind", "accessPackageResourceEnvironments/615f2218-678f-471f-a60a-02c2f4f80c57");
accessPackageResource.setAdditionalData(additionalData);
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
accessPackageResourceRequest.setRequestType("AdminAdd");
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "de9315c1-272b-4905-924b-cc112ca180c7",
AccessPackageResource = new AccessPackageResource
{
DisplayName = "Community Outreach",
Description = "https://contoso.sharepoint.com/sites/CSR",
ResourceType = "SharePoint Online Site",
OriginId = "https://contoso.sharepoint.com/sites/CSR",
OriginSystem = "SharePointOnline",
AccessPackageResourceEnvironment = new AccessPackageResourceEnvironment
{
OriginId = "https://contoso-admin.sharepoint.com/",
},
},
RequestType = "AdminAdd",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageResourceRequests.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("de9315c1-272b-4905-924b-cc112ca180c7");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Community Outreach");
accessPackageResource.setDescription("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setResourceType("SharePoint Online Site");
accessPackageResource.setOriginId("https://contoso.sharepoint.com/sites/CSR");
accessPackageResource.setOriginSystem("SharePointOnline");
AccessPackageResourceEnvironment accessPackageResourceEnvironment = new AccessPackageResourceEnvironment();
accessPackageResourceEnvironment.setOriginId("https://contoso-admin.sharepoint.com/");
accessPackageResource.setAccessPackageResourceEnvironment(accessPackageResourceEnvironment);
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
accessPackageResourceRequest.setRequestType("AdminAdd");
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
from msgraph_beta.generated.models.access_package_resource_environment import AccessPackageResourceEnvironment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "de9315c1-272b-4905-924b-cc112ca180c7",
access_package_resource = AccessPackageResource(
display_name = "Community Outreach",
description = "https://contoso.sharepoint.com/sites/CSR",
resource_type = "SharePoint Online Site",
origin_id = "https://contoso.sharepoint.com/sites/CSR",
origin_system = "SharePointOnline",
access_package_resource_environment = AccessPackageResourceEnvironment(
origin_id = "https://contoso-admin.sharepoint.com/",
),
),
request_type = "AdminAdd",
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "beedadfe-01d5-4025-910b-84abb9369997",
RequestType = "AdminAdd",
AccessPackageResource = new AccessPackageResource
{
OriginId = "c6294667-7348-4f5a-be73-9d2c65f574f3",
OriginSystem = "AadGroup",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageResourceRequests.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "beedadfe-01d5-4025-910b-84abb9369997"
requestBody.SetCatalogId(&catalogId)
requestType := "AdminAdd"
requestBody.SetRequestType(&requestType)
accessPackageResource := graphmodels.NewAccessPackageResource()
originId := "c6294667-7348-4f5a-be73-9d2c65f574f3"
accessPackageResource.SetOriginId(&originId)
originSystem := "AadGroup"
accessPackageResource.SetOriginSystem(&originSystem)
requestBody.SetAccessPackageResource(accessPackageResource)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("beedadfe-01d5-4025-910b-84abb9369997");
accessPackageResourceRequest.setRequestType("AdminAdd");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setOriginId("c6294667-7348-4f5a-be73-9d2c65f574f3");
accessPackageResource.setOriginSystem("AadGroup");
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('beedadfe-01d5-4025-910b-84abb9369997');
$requestBody->setRequestType('AdminAdd');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setOriginId('c6294667-7348-4f5a-be73-9d2c65f574f3');
$accessPackageResource->setOriginSystem('AadGroup');
$requestBody->setAccessPackageResource($accessPackageResource);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "beedadfe-01d5-4025-910b-84abb9369997",
request_type = "AdminAdd",
access_package_resource = AccessPackageResource(
origin_id = "c6294667-7348-4f5a-be73-9d2c65f574f3",
origin_system = "AadGroup",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageResourceRequest
{
CatalogId = "beedadfe-01d5-4025-910b-84abb9369997",
RequestType = "AdminRemove",
AccessPackageResource = new AccessPackageResource
{
Id = "354078e5-dbce-4894-8af4-0ab274d41662",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageResourceRequests.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageResourceRequest()
catalogId := "beedadfe-01d5-4025-910b-84abb9369997"
requestBody.SetCatalogId(&catalogId)
requestType := "AdminRemove"
requestBody.SetRequestType(&requestType)
accessPackageResource := graphmodels.NewAccessPackageResource()
id := "354078e5-dbce-4894-8af4-0ab274d41662"
accessPackageResource.SetId(&id)
requestBody.SetAccessPackageResource(accessPackageResource)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageResourceRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageResourceRequests().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("beedadfe-01d5-4025-910b-84abb9369997");
accessPackageResourceRequest.setRequestType("AdminRemove");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setId("354078e5-dbce-4894-8af4-0ab274d41662");
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResourceRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageResourceRequest();
$requestBody->setCatalogId('beedadfe-01d5-4025-910b-84abb9369997');
$requestBody->setRequestType('AdminRemove');
$accessPackageResource = new AccessPackageResource();
$accessPackageResource->setId('354078e5-dbce-4894-8af4-0ab274d41662');
$requestBody->setAccessPackageResource($accessPackageResource);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageResourceRequests()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph_beta.generated.models.access_package_resource import AccessPackageResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
catalog_id = "beedadfe-01d5-4025-910b-84abb9369997",
request_type = "AdminRemove",
access_package_resource = AccessPackageResource(
id = "354078e5-dbce-4894-8af4-0ab274d41662",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_resource_requests.post(request_body)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setCatalogId("26ac0c0a-08bc-4a7b-a313-839f58044ba5");
accessPackageResourceRequest.setRequestType("AdminAdd");
accessPackageResourceRequest.setJustification("");
AccessPackageResource accessPackageResource = new AccessPackageResource();
accessPackageResource.setDisplayName("Faculty cafeteria ordering");
accessPackageResource.setDescription("Example application");
accessPackageResource.setUrl("https://myapps.microsoft.com/example.com/signin/Faculty%20cafeteria%20ordering/f1e3b407-942d-4934-9a3f-cef1975cb988/");
accessPackageResource.setResourceType("Application");
accessPackageResource.setOriginId("2f1099a6-d4fc-4cc9-a0ef-ddd3f1bf0b7e");
accessPackageResource.setOriginSystem("AadApplication");
LinkedList<AccessPackageResourceAttribute> attributes = new LinkedList<AccessPackageResourceAttribute>();
AccessPackageResourceAttribute accessPackageResourceAttribute = new AccessPackageResourceAttribute();
accessPackageResourceAttribute.setAttributeName("extension_2b676109c7c74ae2b41549205f1947ed_personalTitle");
accessPackageResourceAttribute.setIsEditable(true);
accessPackageResourceAttribute.setIsPersistedOnAssignmentRemoval(true);
AccessPackageResourceAttributeQuestion attributeSource = new AccessPackageResourceAttributeQuestion();
attributeSource.setOdataType("#microsoft.graph.accessPackageResourceAttributeQuestion");
AccessPackageTextInputQuestion question = new AccessPackageTextInputQuestion();
question.setOdataType("#microsoft.graph.accessPackageTextInputQuestion");
question.setIsRequired(false);
question.setSequence(0);
question.setIsSingleLineQuestion(true);
AccessPackageLocalizedContent text = new AccessPackageLocalizedContent();
text.setDefaultText("Title");
LinkedList<AccessPackageLocalizedText> localizedTexts = new LinkedList<AccessPackageLocalizedText>();
text.setLocalizedTexts(localizedTexts);
question.setText(text);
attributeSource.setQuestion(question);
accessPackageResourceAttribute.setAttributeSource(attributeSource);
AccessPackageUserDirectoryAttributeStore attributeDestination = new AccessPackageUserDirectoryAttributeStore();
attributeDestination.setOdataType("#microsoft.graph.accessPackageUserDirectoryAttributeStore");
accessPackageResourceAttribute.setAttributeDestination(attributeDestination);
attributes.add(accessPackageResourceAttribute);
accessPackageResource.setAttributes(attributes);
accessPackageResourceRequest.setAccessPackageResource(accessPackageResource);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageResourceRequests().post(accessPackageResourceRequest);