PATCH https://graph.microsoft.com/beta/teams/{id}
Content-type: application/json
{
"isMembershipLimitedToOwners": true,
"memberSettings": {
"allowCreateUpdateChannels": true
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "strict"
},
"discoverySettings": {
"showInTeamsSearchAndSuggestions": true
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
IsMembershipLimitedToOwners = true,
MemberSettings = new TeamMemberSettings
{
AllowCreateUpdateChannels = true,
},
MessagingSettings = new TeamMessagingSettings
{
AllowUserEditMessages = true,
AllowUserDeleteMessages = true,
},
FunSettings = new TeamFunSettings
{
AllowGiphy = true,
GiphyContentRating = GiphyRatingType.Strict,
},
DiscoverySettings = new TeamDiscoverySettings
{
ShowInTeamsSearchAndSuggestions = true,
},
};
// 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);
mgc-beta teams patch --team-id {team-id} --body '{\
"isMembershipLimitedToOwners": true,\
"memberSettings": {\
"allowCreateUpdateChannels": true\
},\
"messagingSettings": {\
"allowUserEditMessages": true,\
"allowUserDeleteMessages": true\
},\
"funSettings": {\
"allowGiphy": true,\
"giphyContentRating": "strict"\
},\
"discoverySettings": {\
"showInTeamsSearchAndSuggestions": true\
}\
}\
'
// 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.NewTeam()
isMembershipLimitedToOwners := true
requestBody.SetIsMembershipLimitedToOwners(&isMembershipLimitedToOwners)
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)
discoverySettings := graphmodels.NewTeamDiscoverySettings()
showInTeamsSearchAndSuggestions := true
discoverySettings.SetShowInTeamsSearchAndSuggestions(&showInTeamsSearchAndSuggestions)
requestBody.SetDiscoverySettings(discoverySettings)
// 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)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setIsMembershipLimitedToOwners(true);
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);
TeamDiscoverySettings discoverySettings = new TeamDiscoverySettings();
discoverySettings.setShowInTeamsSearchAndSuggestions(true);
team.setDiscoverySettings(discoverySettings);
Team result = graphClient.teams().byTeamId("{team-id}").patch(team);
const options = {
authProvider,
};
const client = Client.init(options);
const team = {
isMembershipLimitedToOwners: true,
memberSettings: {
allowCreateUpdateChannels: true
},
messagingSettings: {
allowUserEditMessages: true,
allowUserDeleteMessages: true
},
funSettings: {
allowGiphy: true,
giphyContentRating: 'strict'
},
discoverySettings: {
showInTeamsSearchAndSuggestions: true
}
};
await client.api('/teams/{id}')
.version('beta')
.update(team);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
use Microsoft\Graph\Beta\Generated\Models\TeamMemberSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamMessagingSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamFunSettings;
use Microsoft\Graph\Beta\Generated\Models\GiphyRatingType;
use Microsoft\Graph\Beta\Generated\Models\TeamDiscoverySettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setIsMembershipLimitedToOwners(true);
$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);
$discoverySettings = new TeamDiscoverySettings();
$discoverySettings->setShowInTeamsSearchAndSuggestions(true);
$requestBody->setDiscoverySettings($discoverySettings);
$result = $graphServiceClient->teams()->byTeamId('team-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
isMembershipLimitedToOwners = $true
memberSettings = @{
allowCreateUpdateChannels = $true
}
messagingSettings = @{
allowUserEditMessages = $true
allowUserDeleteMessages = $true
}
funSettings = @{
allowGiphy = $true
giphyContentRating = "strict"
}
discoverySettings = @{
showInTeamsSearchAndSuggestions = $true
}
}
Update-MgBetaTeam -TeamId $teamId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
from msgraph_beta.generated.models.team_member_settings import TeamMemberSettings
from msgraph_beta.generated.models.team_messaging_settings import TeamMessagingSettings
from msgraph_beta.generated.models.team_fun_settings import TeamFunSettings
from msgraph_beta.generated.models.giphy_rating_type import GiphyRatingType
from msgraph_beta.generated.models.team_discovery_settings import TeamDiscoverySettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
is_membership_limited_to_owners = True,
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,
),
discovery_settings = TeamDiscoverySettings(
show_in_teams_search_and_suggestions = True,
),
)
result = await graph_client.teams.by_team_id('team-id').patch(request_body)