PATCH https://graph.microsoft.com/v1.0/identity/conditionalAccess/namedLocations/1c4427fd-0885-4a3d-8b23-09a899ffa959
Content-type: application/json
{
"@odata.type": "#microsoft.graph.countryNamedLocation",
"displayName": "Updated named location without unknown countries and regions",
"countriesAndRegions": [
"CA",
"IN"
],
"includeUnknownCountriesAndRegions": false
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var namedLocation = new CountryNamedLocation
{
DisplayName = "Updated named location without unknown countries and regions",
CountriesAndRegions = new List<String>()
{
"CA",
"IN"
},
IncludeUnknownCountriesAndRegions = false
};
await graphClient.Identity.ConditionalAccess.NamedLocations["{namedLocation-id}"]
.Request()
.UpdateAsync(namedLocation);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewNamedLocation()
displayName := "Updated named location without unknown countries and regions"
requestBody.SetDisplayName(&displayName)
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.countryNamedLocation",
"countriesAndRegions": []String {
"CA",
"IN",
}
"includeUnknownCountriesAndRegions": false,
}
namedLocationId := "namedLocation-id"
graphClient.Identity().ConditionalAccess().NamedLocationsById(&namedLocationId).Patch(requestBody)