// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IosVppEBookAssignment
{
OdataType = "#microsoft.graph.iosVppEBookAssignment",
Target = new DeviceAndAppManagementAssignmentTarget
{
OdataType = "microsoft.graph.deviceAndAppManagementAssignmentTarget",
},
InstallIntent = InstallIntent.Required,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.ManagedEBooks["{managedEBook-id}"].Assignments.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewManagedEBookAssignment()
target := graphmodels.NewDeviceAndAppManagementAssignmentTarget()
requestBody.SetTarget(target)
installIntent := graphmodels.REQUIRED_INSTALLINTENT
requestBody.SetInstallIntent(&installIntent)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignments, err := graphClient.DeviceAppManagement().ManagedEBooks().ByManagedEBookId("managedEBook-id").Assignments().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IosVppEBookAssignment managedEBookAssignment = new IosVppEBookAssignment();
managedEBookAssignment.setOdataType("#microsoft.graph.iosVppEBookAssignment");
DeviceAndAppManagementAssignmentTarget target = new DeviceAndAppManagementAssignmentTarget();
target.setOdataType("microsoft.graph.deviceAndAppManagementAssignmentTarget");
managedEBookAssignment.setTarget(target);
managedEBookAssignment.setInstallIntent(InstallIntent.Required);
ManagedEBookAssignment result = graphClient.deviceAppManagement().managedEBooks().byManagedEBookId("{managedEBook-id}").assignments().post(managedEBookAssignment);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\IosVppEBookAssignment;
use Microsoft\Graph\Generated\Models\DeviceAndAppManagementAssignmentTarget;
use Microsoft\Graph\Generated\Models\InstallIntent;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IosVppEBookAssignment();
$requestBody->setOdataType('#microsoft.graph.iosVppEBookAssignment');
$target = new DeviceAndAppManagementAssignmentTarget();
$target->setOdataType('microsoft.graph.deviceAndAppManagementAssignmentTarget');
$requestBody->setTarget($target);
$requestBody->setInstallIntent(new InstallIntent('required'));
$result = $graphServiceClient->deviceAppManagement()->managedEBooks()->byManagedEBookId('managedEBook-id')->assignments()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.ios_vpp_e_book_assignment import IosVppEBookAssignment
from msgraph.generated.models.device_and_app_management_assignment_target import DeviceAndAppManagementAssignmentTarget
from msgraph.generated.models.install_intent import InstallIntent
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = IosVppEBookAssignment(
odata_type = "#microsoft.graph.iosVppEBookAssignment",
target = DeviceAndAppManagementAssignmentTarget(
odata_type = "microsoft.graph.deviceAndAppManagementAssignmentTarget",
),
install_intent = InstallIntent.Required,
)
result = await graph_client.device_app_management.managed_e_books.by_managed_e_book_id('managedEBook-id').assignments.post(request_body)