スケジュール作成プロセスは、 リソース ベースの実行時間の長い操作 (RELO) の One API ガイドラインに準拠しています。
クライアントが PUT メソッドを使用する場合、スケジュールがプロビジョニングされている場合、操作によってスケジュールが置き換えられます。それ以外の場合、操作はバックグラウンドでスケジュール プロビジョニング プロセスを開始します。
PUT https://graph.microsoft.com/v1.0/teams/{teamId}/schedule
Content-type: application/json
{
"enabled": true,
"timeZone": "America/Chicago"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new Schedule
{
Enabled = true,
TimeZone = "America/Chicago",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Schedule.PutAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc teams schedule put --team-id {team-id} --body '{\
"enabled": true,\
"timeZone": "America/Chicago"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Schedule schedule = new Schedule();
schedule.setEnabled(true);
schedule.setTimeZone("America/Chicago");
Schedule result = graphClient.teams().byTeamId("{team-id}").schedule().put(schedule);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Schedule;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Schedule();
$requestBody->setEnabled(true);
$requestBody->setTimeZone('America/Chicago');
$result = $graphServiceClient->teams()->byTeamId('team-id')->schedule()->put($requestBody)->wait();