// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new MobilityManagementPolicy
{
OdataType = "#microsoft.graph.mobilityManagementPolicy",
ComplianceUrl = "https://portal.uem.contoso.com/?portalAction=Compliance",
DiscoveryUrl = "https://enrollment.uem.contoso.com/enrollmentserver/discovery.svc",
TermsOfUseUrl = "https://portal.uem.contoso.com/TermsofUse.aspx",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.MobileDeviceManagementPolicies["{mobilityManagementPolicy-id}"].PatchAsync(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.NewMobilityManagementPolicy()
complianceUrl := "https://portal.uem.contoso.com/?portalAction=Compliance"
requestBody.SetComplianceUrl(&complianceUrl)
discoveryUrl := "https://enrollment.uem.contoso.com/enrollmentserver/discovery.svc"
requestBody.SetDiscoveryUrl(&discoveryUrl)
termsOfUseUrl := "https://portal.uem.contoso.com/TermsofUse.aspx"
requestBody.SetTermsOfUseUrl(&termsOfUseUrl)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mobileDeviceManagementPolicies, err := graphClient.Policies().MobileDeviceManagementPolicies().ByMobilityManagementPolicyId("mobilityManagementPolicy-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MobilityManagementPolicy mobilityManagementPolicy = new MobilityManagementPolicy();
mobilityManagementPolicy.setOdataType("#microsoft.graph.mobilityManagementPolicy");
mobilityManagementPolicy.setComplianceUrl("https://portal.uem.contoso.com/?portalAction=Compliance");
mobilityManagementPolicy.setDiscoveryUrl("https://enrollment.uem.contoso.com/enrollmentserver/discovery.svc");
mobilityManagementPolicy.setTermsOfUseUrl("https://portal.uem.contoso.com/TermsofUse.aspx");
MobilityManagementPolicy result = graphClient.policies().mobileDeviceManagementPolicies().byMobilityManagementPolicyId("{mobilityManagementPolicy-id}").patch(mobilityManagementPolicy);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.mobility_management_policy import MobilityManagementPolicy
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MobilityManagementPolicy(
odata_type = "#microsoft.graph.mobilityManagementPolicy",
compliance_url = "https://portal.uem.contoso.com/?portalAction=Compliance",
discovery_url = "https://enrollment.uem.contoso.com/enrollmentserver/discovery.svc",
terms_of_use_url = "https://portal.uem.contoso.com/TermsofUse.aspx",
)
result = await graph_client.policies.mobile_device_management_policies.by_mobility_management_policy_id('mobilityManagementPolicy-id').patch(request_body)