Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Le processus de création de planification est conforme aux instructions de l’API One pour les opérations à long terme basées sur les ressources (RELO).
Lorsque les clients utilisent la méthode PUT, si la planification est provisionnée, l’opération remplace la planification ; sinon, l’opération démarre le processus d’approvisionnement de planification en arrière-plan.
Pendant l’approvisionnement de planification, les clients peuvent utiliser la méthode GET pour obtenir la planification et examiner la provisionStatus propriété pour l’état actuel de l’approvisionnement. Si l’approvisionnement a échoué, les clients peuvent obtenir des informations supplémentaires à partir de la provisionStatusCode propriété .
Les clients peuvent également inspecter la configuration de la planification.
PUT https://graph.microsoft.com/beta/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.Beta.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);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewSchedule()
enabled := true
requestBody.SetEnabled(&enabled)
timeZone := "America/Chicago"
requestBody.SetTimeZone(&timeZone)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
schedule, err := graphClient.Teams().ByTeamId("team-id").Schedule().Put(context.Background(), requestBody, nil)
// 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\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\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();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.schedule import Schedule
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Schedule(
enabled = True,
time_zone = "America/Chicago",
)
result = await graph_client.teams.by_team_id('team-id').schedule.put(request_body)
// 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.setProvisionStatus(OperationStatus.Completed);
schedule.setProvisionStatusCode(null);
schedule.setOpenShiftsEnabled(true);
schedule.setSwapShiftsRequestsEnabled(true);
schedule.setOfferShiftRequestsEnabled(true);
schedule.setTimeOffRequestsEnabled(true);
schedule.setStartDayOfWeek(DayOfWeek.Tuesday);
schedule.setActivitiesIncludedWhenCopyingShiftsEnabled(true);
schedule.setIsCrossLocationShiftsEnabled(true);
schedule.setIsCrossLocationShiftRequestApprovalRequired(true);
schedule.setTimeClockEnabled(true);
TimeClockSettings timeClockSettings = new TimeClockSettings();
GeoCoordinates approvedLocation = new GeoCoordinates();
approvedLocation.setAltitude(1024.13d);
approvedLocation.setLatitude(26.13246d);
approvedLocation.setLongitude(24.34616d);
timeClockSettings.setApprovedLocation(approvedLocation);
schedule.setTimeClockSettings(timeClockSettings);
Schedule result = graphClient.teams().byTeamId("{team-id}").schedule().put(schedule);