// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Planner.Rosters.Item.AssignSensitivityLabel;
using Microsoft.Graph.Beta.Models;
var requestBody = new AssignSensitivityLabelPostRequestBody
{
AssignmentMethod = SensitivityLabelAssignmentMethod.Standard,
SensitivityLabelId = "7a4d7cc1-f72b-46a3-9831-02680eaf56f9",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Planner.Rosters["{plannerRoster-id}"].AssignSensitivityLabel.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("If-Match", "\"W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"\"");
});
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.planner.rosters.item.assignsensitivitylabel.AssignSensitivityLabelPostRequestBody assignSensitivityLabelPostRequestBody = new com.microsoft.graph.beta.planner.rosters.item.assignsensitivitylabel.AssignSensitivityLabelPostRequestBody();
assignSensitivityLabelPostRequestBody.setAssignmentMethod(SensitivityLabelAssignmentMethod.Standard);
assignSensitivityLabelPostRequestBody.setSensitivityLabelId("7a4d7cc1-f72b-46a3-9831-02680eaf56f9");
var result = graphClient.planner().rosters().byPlannerRosterId("{plannerRoster-id}").assignSensitivityLabel().post(assignSensitivityLabelPostRequestBody, requestConfiguration -> {
requestConfiguration.headers.add("If-Match", "\"W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"\"");
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.planner.rosters.item.assign_sensitivity_label.assign_sensitivity_label_request_builder import AssignSensitivityLabelRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph_beta.generated.planner.rosters.item.assign_sensitivity_label.assign_sensitivity_label_post_request_body import AssignSensitivityLabelPostRequestBody
from msgraph_beta.generated.models.sensitivity_label_assignment_method import SensitivityLabelAssignmentMethod
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AssignSensitivityLabelPostRequestBody(
assignment_method = SensitivityLabelAssignmentMethod.Standard,
sensitivity_label_id = "7a4d7cc1-f72b-46a3-9831-02680eaf56f9",
)
request_configuration = RequestConfiguration()
request_configuration.headers.add("If-Match", "\"W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"\"")
result = await graph_client.planner.rosters.by_planner_roster_id('plannerRoster-id').assign_sensitivity_label.post(request_body, request_configuration = request_configuration)