Update termsAndConditions
[アーティクル]
01/30/2024
11 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
注: Intune 用 Microsoft Graph API には、テナントの有効な Intune ライセンス が必要です。
termsAndConditions オブジェクトのプロパティを更新します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
✅
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
DeviceManagementServiceConfig.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
DeviceManagementServiceConfig.ReadWrite.All
HTTP 要求
PATCH /deviceManagement/termsAndConditions/{termsAndConditionsId}
PATCH /deviceManagement/termsAndConditions/{termsAndConditionsId}/acceptanceStatuses/{termsAndConditionsAcceptanceStatusId}/termsAndConditions
ヘッダー
値
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
承諾
application/json
要求本文
要求本文で、termsAndConditions オブジェクトの JSON 表記を指定します。
次の表に、termsAndConditions 作成時に必要なプロパティを示します。
プロパティ
型
説明
id
String
T&C ポリシーの一意識別子。
createdDateTime
DateTimeOffset
オブジェクトが作成された DateTime。
lastModifiedDateTime
DateTimeOffset
オブジェクトの最終更新の DateTime。
displayName
String
T&C ポリシー用に管理者が提供した名前。
description
String
管理者が提供した T&C ポリシーの説明。
title
String
管理者が提供した契約条件のタイトル。 ユーザーが T&C ポリシーを承諾する際のプロンプトに表示されます。
bodyText
String
管理者が提供する契約条件の本文で、通常は条件そのものです。 ユーザーが T&C ポリシーを承諾する際のプロンプトに表示されます。
acceptanceStatement
String
使用条件に関する、管理者指定の説明内容です。通常は、T&C ポリシーに定められた使用条件を受け入れることの意味を記載します。 ユーザーが T&C ポリシーを承諾する際のプロンプトに表示されます。
version
Int32
条件の現行バージョンを示す整数。 管理者が条件を変更し、修正された T&C ポリシーをユーザーが再承諾するように求める場合に増分されます。
応答
成功した場合、このメソッドは 200 OK
応答コードと、更新された termsAndConditions オブジェクトを応答本文で返します。
例
要求
以下は、要求の例です。
PATCH https://graph.microsoft.com/v1.0/deviceManagement/termsAndConditions/{termsAndConditionsId}
Content-type: application/json
Content-length: 273
{
"@odata.type": "#microsoft.graph.termsAndConditions",
"displayName": "Display Name value",
"description": "Description value",
"title": "Title value",
"bodyText": "Body Text value",
"acceptanceStatement": "Acceptance Statement value",
"version": 7
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new TermsAndConditions
{
OdataType = "#microsoft.graph.termsAndConditions",
DisplayName = "Display Name value",
Description = "Description value",
Title = "Title value",
BodyText = "Body Text value",
AcceptanceStatement = "Acceptance Statement value",
Version = 7,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.TermsAndConditions["{termsAndConditions-id}"].PatchAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management terms-and-conditions patch --terms-and-conditions-id {termsAndConditions-id} --body '{\
"@odata.type": "#microsoft.graph.termsAndConditions",\
"displayName": "Display Name value",\
"description": "Description value",\
"title": "Title value",\
"bodyText": "Body Text value",\
"acceptanceStatement": "Acceptance Statement value",\
"version": 7\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewTermsAndConditions()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
title := "Title value"
requestBody.SetTitle(&title)
bodyText := "Body Text value"
requestBody.SetBodyText(&bodyText)
acceptanceStatement := "Acceptance Statement value"
requestBody.SetAcceptanceStatement(&acceptanceStatement)
version := int32(7)
requestBody.SetVersion(&version)
termsAndConditions, err := graphClient.DeviceManagement().TermsAndConditions().ByTermsAndConditionsId("termsAndConditions-id").Patch(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TermsAndConditions termsAndConditions = new TermsAndConditions();
termsAndConditions.setOdataType("#microsoft.graph.termsAndConditions");
termsAndConditions.setDisplayName("Display Name value");
termsAndConditions.setDescription("Description value");
termsAndConditions.setTitle("Title value");
termsAndConditions.setBodyText("Body Text value");
termsAndConditions.setAcceptanceStatement("Acceptance Statement value");
termsAndConditions.setVersion(7);
TermsAndConditions result = graphClient.deviceManagement().termsAndConditions().byTermsAndConditionsId("{termsAndConditions-id}").patch(termsAndConditions);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const termsAndConditions = {
'@odata.type': '#microsoft.graph.termsAndConditions',
displayName: 'Display Name value',
description: 'Description value',
title: 'Title value',
bodyText: 'Body Text value',
acceptanceStatement: 'Acceptance Statement value',
version: 7
};
await client.api('/deviceManagement/termsAndConditions/{termsAndConditionsId}')
.update(termsAndConditions);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TermsAndConditions;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TermsAndConditions();
$requestBody->setOdataType('#microsoft.graph.termsAndConditions');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDescription('Description value');
$requestBody->setTitle('Title value');
$requestBody->setBodyText('Body Text value');
$requestBody->setAcceptanceStatement('Acceptance Statement value');
$requestBody->setVersion(7);
$result = $graphServiceClient->deviceManagement()->termsAndConditions()->byTermsAndConditionsId('termsAndConditions-id')->patch($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.termsAndConditions"
displayName = "Display Name value"
description = "Description value"
title = "Title value"
bodyText = "Body Text value"
acceptanceStatement = "Acceptance Statement value"
version = 7
}
Update-MgDeviceManagementTermAndCondition -TermsAndConditionsId $termsAndConditionsId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.terms_and_conditions import TermsAndConditions
graph_client = GraphServiceClient(credentials, scopes)
request_body = TermsAndConditions(
odata_type = "#microsoft.graph.termsAndConditions",
display_name = "Display Name value",
description = "Description value",
title = "Title value",
body_text = "Body Text value",
acceptance_statement = "Acceptance Statement value",
version = 7,
)
result = await graph_client.device_management.terms_and_conditions.by_terms_and_conditions_id('termsAndConditions-id').patch(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 445
{
"@odata.type": "#microsoft.graph.termsAndConditions",
"id": "eefc80cf-80cf-eefc-cf80-fceecf80fcee",
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"displayName": "Display Name value",
"description": "Description value",
"title": "Title value",
"bodyText": "Body Text value",
"acceptanceStatement": "Acceptance Statement value",
"version": 7
}