In the request body, supply the values for the relevant printTaskDefinition fields that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
Property
Type
Description
displayName
String
The name of the printTaskDefinition.
createdBy
String
Information about the app that created the task definition. Only the createdBy.displayName property can be updated.
Response
If successful, this method returns a 200 OK response code and an updated printTaskDefinition object in the response body.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new PrintTaskDefinition
{
DisplayName = "Test TaskDefinitionName",
CreatedBy = new AppIdentity
{
DisplayName = "Requesting App Display Name",
},
};
var result = await graphClient.Print.TaskDefinitions["{printTaskDefinition-id}"].PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new PrintTaskDefinition();
$requestBody->setDisplayName('Test TaskDefinitionName');
$createdBy = new AppIdentity();
$createdBy->setDisplayName('Requesting App Display Name');
$requestBody->setCreatedBy($createdBy);
$result = $graphServiceClient->print()->taskDefinitions()->byTaskDefinitionId('printTaskDefinition-id')->patch($requestBody);