// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Teams.Item.Schedule.Share;
var requestBody = new SharePostRequestBody
{
NotifyTeam = true,
StartDateTime = DateTimeOffset.Parse("2018-10-08T00:00:00.000Z"),
EndDateTime = DateTimeOffset.Parse("2018-10-15T00:00:00.000Z"),
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Teams["{team-id}"].Schedule.Share.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc teams schedule share post --team-id {team-id} --body '{\
"notifyTeam": true,\
"startDateTime": "2018-10-08T00:00:00.000Z",\
"endDateTime": "2018-10-15T00:00:00.000Z"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.teams.item.schedule.share.SharePostRequestBody sharePostRequestBody = new com.microsoft.graph.teams.item.schedule.share.SharePostRequestBody();
sharePostRequestBody.setNotifyTeam(true);
OffsetDateTime startDateTime = OffsetDateTime.parse("2018-10-08T00:00:00.000Z");
sharePostRequestBody.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2018-10-15T00:00:00.000Z");
sharePostRequestBody.setEndDateTime(endDateTime);
graphClient.teams().byTeamId("{team-id}").schedule().share().post(sharePostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\SharePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SharePostRequestBody();
$requestBody->setNotifyTeam(true);
$requestBody->setStartDateTime(new \DateTime('2018-10-08T00:00:00.000Z'));
$requestBody->setEndDateTime(new \DateTime('2018-10-15T00:00:00.000Z'));
$graphServiceClient->teams()->byTeamId('team-id')->schedule()->share()->post($requestBody)->wait();