EducationAssignmentDefaults の更新
-
[アーティクル]
-
-
名前空間: microsoft.graph
educationAssignmentDefaults オブジェクトのプロパティを更新します。
これらの設定を更新できるのは教師のみです。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
EduAssignments.ReadWriteBasic, EduAssignments.ReadWrite |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
HTTP 要求
PATCH /education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignmentDefaults
| 名前 |
説明 |
| Authorization |
ベアラー {token}。必須。 |
| Content-Type |
application/json. Required. |
要求本文
要求本文で、更新するフィールドの値のみを指定します。
要求本文に含まれない既存のプロパティは、以前の値のままになるか、他のプロパティ値の変化に基づいて再計算されます。 最適なパフォーマンスを得るために、変更されていない既存の値を含めないでください。
| プロパティ |
型 |
説明 |
| addedStudentAction |
educationAddedStudentAction |
割り当て発行日の後に追加された学生のクラス レベルの既定のアクション。 可能な値は、none、assignIfOpen です。 既定値は none です。 |
| addToCalendarAction |
educationAddToCalendarOptions |
割り当てを 公開するときに、 学生と教師の予定表に割り当てを追加する割り当ての 動作を制御 するオプション フィールド。 使用可能な値: none、studentsAndPublisher、studentsAndTeamOwners、unknownFutureValue、studentsOnly。 この進化可能な列挙型Prefer: include - unknown -enum-membersで次の値を取得するには、要求ヘッダーを使用する必要があります。 studentsOnly オプション。 |
| dueTime |
TimeOfDay |
期限フィールドのクラス レベルの既定値。 既定値は 23:59:00 です。 |
| notificationChannelUrl |
String |
割りTeams通知を送信する既定のチャネルです。 既定値は、null です。 |
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文で 更新された educationAssignmentDefaults オブジェクトを返します。
例
要求
PATCH https://graph.microsoft.com/v1.0/education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignmentDefaults
Content-Type: application/json
{
"addedStudentAction": "assignIfOpen",
"notificationChannelUrl": "https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var educationAssignmentDefaults = new EducationAssignmentDefaults
{
AddedStudentAction = EducationAddedStudentAction.AssignIfOpen,
NotificationChannelUrl = "https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')"
};
await graphClient.Education.Classes["{educationClass-id}"].AssignmentDefaults
.Request()
.UpdateAsync(educationAssignmentDefaults);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const educationAssignmentDefaults = {
addedStudentAction: 'assignIfOpen',
notificationChannelUrl: 'https://graph.microsoft.com/beta/teams(\'acdefc6b-2dc6-4e71-b1e9-6d9810ab1793\')/channels(\'3da03fc4-8eac-4459-84fb-1422dc01f65e\')'
};
await client.api('/education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignmentDefaults')
.update(educationAssignmentDefaults);
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/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignmentDefaults"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphEducationAssignmentDefaults *educationAssignmentDefaults = [[MSGraphEducationAssignmentDefaults alloc] init];
[educationAssignmentDefaults setAddedStudentAction: [MSGraphEducationAddedStudentAction assignIfOpen]];
[educationAssignmentDefaults setNotificationChannelUrl:@"https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')"];
NSError *error;
NSData *educationAssignmentDefaultsData = [educationAssignmentDefaults getSerializedDataWithError:&error];
[urlRequest setHTTPBody:educationAssignmentDefaultsData];
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();
EducationAssignmentDefaults educationAssignmentDefaults = new EducationAssignmentDefaults();
educationAssignmentDefaults.addedStudentAction = EducationAddedStudentAction.ASSIGN_IF_OPEN;
educationAssignmentDefaults.notificationChannelUrl = "https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')";
graphClient.education().classes("acdefc6b-2dc6-4e71-b1e9-6d9810ab1793").assignmentDefaults()
.buildRequest()
.patch(educationAssignmentDefaults);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewEducationAssignmentDefaults()
addedStudentAction := "assignIfOpen"
requestBody.SetAddedStudentAction(&addedStudentAction)
notificationChannelUrl := "https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')"
requestBody.SetNotificationChannelUrl(¬ificationChannelUrl)
educationClassId := "educationClass-id"
graphClient.Education().ClassesById(&educationClassId).AssignmentDefaults().Patch(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Education
$params = @{
AddedStudentAction = "assignIfOpen"
NotificationChannelUrl = "https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')"
}
Update-MgEducationClassAssignmentDefault -EducationClassId $educationClassId -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"addedStudentAction": "assignIfOpen",
"dueTime": "String",
"notificationChannelUrl": "https://graph.microsoft.com/beta/teams('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/channels('3da03fc4-8eac-4459-84fb-1422dc01f65e')"
}
関連項目