// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.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);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphteams "github.com/microsoftgraph/msgraph-beta-sdk-go/teams"
//other-imports
)
requestBody := graphteams.NewSharePostRequestBody()
notifyTeam := true
requestBody.SetNotifyTeam(¬ifyTeam)
startDateTime , err := time.Parse(time.RFC3339, "2018-10-08T00:00:00.000Z")
requestBody.SetStartDateTime(&startDateTime)
endDateTime , err := time.Parse(time.RFC3339, "2018-10-15T00:00:00.000Z")
requestBody.SetEndDateTime(&endDateTime)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Teams().ByTeamId("team-id").Schedule().Share().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teams.item.schedule.share.SharePostRequestBody sharePostRequestBody = new com.microsoft.graph.beta.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\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teams\Item\Schedule\Share\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();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teams.item.schedule.share.share_post_request_body import SharePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SharePostRequestBody(
notify_team = True,
start_date_time = "2018-10-08T00:00:00.000Z",
end_date_time = "2018-10-15T00:00:00.000Z",
)
await graph_client.teams.by_team_id('team-id').schedule.share.post(request_body)