PATCH https://graph.microsoft.com/v1.0/teams/{id}
Content-type: application/json
{
"memberSettings": {
"allowCreateUpdateChannels": true
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "strict"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new Team
{
MemberSettings = new TeamMemberSettings
{
AllowCreateUpdateChannels = true,
},
MessagingSettings = new TeamMessagingSettings
{
AllowUserEditMessages = true,
AllowUserDeleteMessages = true,
},
FunSettings = new TeamFunSettings
{
AllowGiphy = true,
GiphyContentRating = GiphyRatingType.Strict,
},
};
// 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}"].PatchAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc teams patch --team-id {team-id} --body '{\
"memberSettings": {\
"allowCreateUpdateChannels": true\
},\
"messagingSettings": {\
"allowUserEditMessages": true,\
"allowUserDeleteMessages": true\
},\
"funSettings": {\
"allowGiphy": true,\
"giphyContentRating": "strict"\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
memberSettings := graphmodels.NewTeamMemberSettings()
allowCreateUpdateChannels := true
memberSettings.SetAllowCreateUpdateChannels(&allowCreateUpdateChannels)
requestBody.SetMemberSettings(memberSettings)
messagingSettings := graphmodels.NewTeamMessagingSettings()
allowUserEditMessages := true
messagingSettings.SetAllowUserEditMessages(&allowUserEditMessages)
allowUserDeleteMessages := true
messagingSettings.SetAllowUserDeleteMessages(&allowUserDeleteMessages)
requestBody.SetMessagingSettings(messagingSettings)
funSettings := graphmodels.NewTeamFunSettings()
allowGiphy := true
funSettings.SetAllowGiphy(&allowGiphy)
giphyContentRating := graphmodels.STRICT_GIPHYRATINGTYPE
funSettings.SetGiphyContentRating(&giphyContentRating)
requestBody.SetFunSettings(funSettings)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().ByTeamId("team-id").Patch(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.setAllowCreateUpdateChannels(true);
team.setMemberSettings(memberSettings);
TeamMessagingSettings messagingSettings = new TeamMessagingSettings();
messagingSettings.setAllowUserEditMessages(true);
messagingSettings.setAllowUserDeleteMessages(true);
team.setMessagingSettings(messagingSettings);
TeamFunSettings funSettings = new TeamFunSettings();
funSettings.setAllowGiphy(true);
funSettings.setGiphyContentRating(GiphyRatingType.Strict);
team.setFunSettings(funSettings);
Team result = graphClient.teams().byTeamId("{team-id}").patch(team);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const team = {
memberSettings: {
allowCreateUpdateChannels: true
},
messagingSettings: {
allowUserEditMessages: true,
allowUserDeleteMessages: true
},
funSettings: {
allowGiphy: true,
giphyContentRating: 'strict'
}
};
await client.api('/teams/{id}')
.update(team);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Team;
use Microsoft\Graph\Generated\Models\TeamMemberSettings;
use Microsoft\Graph\Generated\Models\TeamMessagingSettings;
use Microsoft\Graph\Generated\Models\TeamFunSettings;
use Microsoft\Graph\Generated\Models\GiphyRatingType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$memberSettings = new TeamMemberSettings();
$memberSettings->setAllowCreateUpdateChannels(true);
$requestBody->setMemberSettings($memberSettings);
$messagingSettings = new TeamMessagingSettings();
$messagingSettings->setAllowUserEditMessages(true);
$messagingSettings->setAllowUserDeleteMessages(true);
$requestBody->setMessagingSettings($messagingSettings);
$funSettings = new TeamFunSettings();
$funSettings->setAllowGiphy(true);
$funSettings->setGiphyContentRating(new GiphyRatingType('strict'));
$requestBody->setFunSettings($funSettings);
$result = $graphServiceClient->teams()->byTeamId('team-id')->patch($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Teams
$params = @{
memberSettings = @{
allowCreateUpdateChannels = $true
}
messagingSettings = @{
allowUserEditMessages = $true
allowUserDeleteMessages = $true
}
funSettings = @{
allowGiphy = $true
giphyContentRating = "strict"
}
}
Update-MgTeam -TeamId $teamId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.team import Team
from msgraph.generated.models.team_member_settings import TeamMemberSettings
from msgraph.generated.models.team_messaging_settings import TeamMessagingSettings
from msgraph.generated.models.team_fun_settings import TeamFunSettings
from msgraph.generated.models.giphy_rating_type import GiphyRatingType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
member_settings = TeamMemberSettings(
allow_create_update_channels = True,
),
messaging_settings = TeamMessagingSettings(
allow_user_edit_messages = True,
allow_user_delete_messages = True,
),
fun_settings = TeamFunSettings(
allow_giphy = True,
giphy_content_rating = GiphyRatingType.Strict,
),
)
result = await graph_client.teams.by_team_id('team-id').patch(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。