// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new ProgramControl
{
ControlId = "7e59d237-2fb0-4e5d-b7bb-d4f9f9129213",
ControlTypeId = "6e4f3d20-c5c3-407f-9695-8460952bcc68",
ProgramId = "7e59d237-2fb0-4e5d-b7bb-d4f9f9129213",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.ProgramControls.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.NewProgramControl()
controlId := "7e59d237-2fb0-4e5d-b7bb-d4f9f9129213"
requestBody.SetControlId(&controlId)
controlTypeId := "6e4f3d20-c5c3-407f-9695-8460952bcc68"
requestBody.SetControlTypeId(&controlTypeId)
programId := "7e59d237-2fb0-4e5d-b7bb-d4f9f9129213"
requestBody.SetProgramId(&programId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
programControls, err := graphClient.ProgramControls().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ProgramControl programControl = new ProgramControl();
programControl.setControlId("7e59d237-2fb0-4e5d-b7bb-d4f9f9129213");
programControl.setControlTypeId("6e4f3d20-c5c3-407f-9695-8460952bcc68");
programControl.setProgramId("7e59d237-2fb0-4e5d-b7bb-d4f9f9129213");
ProgramControl result = graphClient.programControls().post(programControl);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ProgramControl;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ProgramControl();
$requestBody->setControlId('7e59d237-2fb0-4e5d-b7bb-d4f9f9129213');
$requestBody->setControlTypeId('6e4f3d20-c5c3-407f-9695-8460952bcc68');
$requestBody->setProgramId('7e59d237-2fb0-4e5d-b7bb-d4f9f9129213');
$result = $graphServiceClient->programControls()->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.program_control import ProgramControl
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ProgramControl(
control_id = "7e59d237-2fb0-4e5d-b7bb-d4f9f9129213",
control_type_id = "6e4f3d20-c5c3-407f-9695-8460952bcc68",
program_id = "7e59d237-2fb0-4e5d-b7bb-d4f9f9129213",
)
result = await graph_client.program_controls.post(request_body)