EducationClass の更新
[アーティクル]
01/21/2022
3 人の共同作成者
この記事の内容
名前空間: microsoft.graph
educationClass オブジェクトの プロパティを更新 します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
サポートされていません。
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
EduRoster.ReadWrite.All
HTTP 要求
PATCH /education/classes/{id}
ヘッダー
値
Authorization
ベアラー {token}。必須。
Content-Type
application/json
要求本文
要求本文で、更新する関連フィールドの値を指定します。 要求本文に含まれない既存のプロパティは、以前の値のままになるか、他のプロパティ値の変化に基づいて再計算されます。 最適なパフォーマンスを得るために、変更されていない既存の値を含めないでください。
プロパティ
種類
説明
displayName
String
クラスの名前。
mailNickname
文字列
すべてのメンバーに電子メールを送信する際のメール名 (この機能が有効な場合)。
description
String
クラスの説明。
createdBy
identitySet
クラスを作成したエンティティ。
classCode
String
クラスを識別するために学校が使用するクラス コード。
externalId
String
同期システムからのクラスの ID。
externalSource
educationExternalSource
このクラスの作成方法。 指定できる値は次のとおりです。 sis``manual
externalSourceDetail
文字列
このリソースが生成された外部ソースの名前。
grade
String
クラスの成績レベル。
term
educationTerm
このクラスの学期。
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文で更新された educationClass オブジェクトを返します。
例
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/v1.0/education/classes/{class-id}
Content-type: application/json
{
"description": "History - World History 1",
"displayName": "World History Level 1",
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var educationClass = new EducationClass
{
Description = "History - World History 1",
DisplayName = "World History Level 1"
};
await graphClient.Education.Classes["{educationClass-id}"]
.Request()
.UpdateAsync(educationClass);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
const educationClass = {
description: 'History - World History 1',
displayName: 'World History Level 1',
};
await client.api('/education/classes/{class-id}')
.update(educationClass);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/education/classes/{class-id}"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphEducationClass *educationClass = [[MSGraphEducationClass alloc] init];
[educationClass setDescription:@"History - World History 1"];
[educationClass setDisplayName:@"World History Level 1"];
NSError *error;
NSData *educationClassData = [educationClass getSerializedDataWithError:&error];
[urlRequest setHTTPBody:educationClassData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
EducationClass educationClass = new EducationClass();
educationClass.description = "History - World History 1";
educationClass.displayName = "World History Level 1";
graphClient.education().classes("{class-id}")
.buildRequest()
.patch(educationClass);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewEducationClass()
description := "History - World History 1"
requestBody.SetDescription(&description)
displayName := "World History Level 1"
requestBody.SetDisplayName(&displayName)
educationClassId := "educationClass-id"
graphClient.Education().ClassesById(&educationClassId).Patch(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
Import-Module Microsoft.Graph.Education
$params = @{
Description = "History - World History 1"
DisplayName = "World History Level 1"
}
Update-MgEducationClass -EducationClassId $educationClassId -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.educationClass",
"id": "64ef8ce5-8ce5-64ef-e58c-ef64e58cef64",
"displayName": "String",
"mailNickname": "String",
"description": "String",
"createdBy": {
"@odata.type": "microsoft.graph.identitySet"
},
"classCode": "String",
"externalName": "String",
"externalId": "String",
"externalSource": "String",
"externalSourceDetail": "String",
"grade": "String",
"term": {
"@odata.type": "microsoft.graph.educationTerm"
}
}