PATCH https://graph.microsoft.com/beta/networkAccess/tlsInspectionPolicies/b712c469-e7cd-e7cb-738f-94b199570b0d/policyRules/ecf99dcc-6575-4d01-83dc-3fa5a940c76b
Content-Type: application/json
{
"name": "Contoso TLS Rule 1 - Updated",
"priority": 200,
"description": "My TLS rule - Updated",
"action": "bypass",
"settings": {
"status": "disabled"
},
"matchingConditions": {
"destinations": [
{
"@odata.type": "#microsoft.graph.networkaccess.tlsInspectionFqdnDestination",
"values": [
"www.contoso.test-updated.com",
"*.contoso.org"
]
}
]
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Networkaccess;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new PolicyRule
{
Name = "Contoso TLS Rule 1 - Updated",
AdditionalData = new Dictionary<string, object>
{
{
"priority" , 200
},
{
"description" , "My TLS rule - Updated"
},
{
"action" , "bypass"
},
{
"settings" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"status", new UntypedString("disabled")
},
})
},
{
"matchingConditions" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"destinations", new UntypedArray(new List<UntypedNode>
{
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.type", new UntypedString("#microsoft.graph.networkaccess.tlsInspectionFqdnDestination")
},
{
"values", new UntypedArray(new List<UntypedNode>
{
new UntypedString("www.contoso.test-updated.com"),
new UntypedString("*.contoso.org"),
})
},
}),
})
},
})
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.TlsInspectionPolicies["{tlsInspectionPolicy-id}"].PolicyRules["{policyRule-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.networkaccess.PolicyRule policyRule = new com.microsoft.graph.beta.models.networkaccess.PolicyRule();
policyRule.setName("Contoso TLS Rule 1 - Updated");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("priority", 200);
additionalData.put("description", "My TLS rule - Updated");
additionalData.put("action", "bypass");
settings = new ();
settings.setStatus("disabled");
additionalData.put("settings", settings);
matchingConditions = new ();
LinkedList<Object> destinations = new LinkedList<Object>();
property = new ();
property.setOdataType("#microsoft.graph.networkaccess.tlsInspectionFqdnDestination");
LinkedList<String> values = new LinkedList<String>();
values.add("www.contoso.test-updated.com");
values.add("*.contoso.org");
property.setValues(values);
destinations.add(property);
matchingConditions.setDestinations(destinations);
additionalData.put("matchingConditions", matchingConditions);
policyRule.setAdditionalData(additionalData);
com.microsoft.graph.models.networkaccess.PolicyRule result = graphClient.networkAccess().tlsInspectionPolicies().byTlsInspectionPolicyId("{tlsInspectionPolicy-id}").policyRules().byPolicyRuleId("{policyRule-id}").patch(policyRule);
const options = {
authProvider,
};
const client = Client.init(options);
const policyRule = {
name: 'Contoso TLS Rule 1 - Updated',
priority: 200,
description: 'My TLS rule - Updated',
action: 'bypass',
settings: {
status: 'disabled'
},
matchingConditions: {
destinations: [
{
'@odata.type': '#microsoft.graph.networkaccess.tlsInspectionFqdnDestination',
values: [
'www.contoso.test-updated.com',
'*.contoso.org'
]
}
]
}
};
await client.api('/networkAccess/tlsInspectionPolicies/b712c469-e7cd-e7cb-738f-94b199570b0d/policyRules/ecf99dcc-6575-4d01-83dc-3fa5a940c76b')
.version('beta')
.update(policyRule);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Networkaccess\PolicyRule;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PolicyRule();
$requestBody->setName('Contoso TLS Rule 1 - Updated');
$additionalData = [
'priority' => 200,
'description' => 'My TLS rule - Updated',
'action' => 'bypass',
'settings' => [
'status' => 'disabled',
],
'matchingConditions' => [
'destinations' => [
[
'@odata.type' => '#microsoft.graph.networkaccess.tlsInspectionFqdnDestination',
'values' => [
'www.contoso.test-updated.com', '*.contoso.org', ],
],
],
],
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->networkAccess()->tlsInspectionPolicies()->byTlsInspectionPolicyId('tlsInspectionPolicy-id')->policyRules()->byPolicyRuleId('policyRule-id')->patch($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.networkaccess.policy_rule import PolicyRule
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = PolicyRule(
name = "Contoso TLS Rule 1 - Updated",
additional_data = {
"priority" : 200,
"description" : "My TLS rule - Updated",
"action" : "bypass",
"settings" : {
"status" : "disabled",
},
"matching_conditions" : {
"destinations" : [
{
"@odata_type" : "#microsoft.graph.networkaccess.tlsInspectionFqdnDestination",
"values" : [
"www.contoso.test-updated.com",
"*.contoso.org",
],
},
],
},
}
)
result = await graph_client.network_access.tls_inspection_policies.by_tls_inspection_policy_id('tlsInspectionPolicy-id').policy_rules.by_policy_rule_id('policyRule-id').patch(request_body)