Groups
Overview
AccelByte Cloud's Groups service allows players to gather to chat and play together. This service allows players to create, join, and invite other players to groups. Group admins can also manage join requests and add members to or remove members from their group. The Groups service can be integrated with other services such as Lobby, Statistics, and Leaderboards, to extend its functionality. For example, you can create groups for players that have achieved a specific level or rank in your game.
Group Types
There are three types of groups that can be created:
- Open Groups are searchable and do not require any approval to join. A player can search for the group using the Group Name or Group Code, and then join the group without waiting for a group admin to approve their request.
- Public Groups are searchable but require permission to join. When a player tries to join, they must first wait for a group admin to approve their request. These groups often have membership requirements, such as only allowing players with an MMR of more than 100 to join the group.
- Private Groups can't be searched and require permission to join. Players can only join these groups if they've been invited by an admin.
Prerequisites
Make sure you've read about Roles Management to know the basics of creating a role.
Permissions
Permissions are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage groups in the Admin Portal. For a full list of permissions that impact groups management, see the Groups tab of the Permissions Reference.
Usage | Resource | Action |
---|---|---|
List Group Configuration | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Read |
Create New Configuration | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Create |
Initiate Configuration | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Create |
Get Existing Configuration | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Read |
Delete Group Configuration | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Delete |
Update Existing Configuration | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Update |
Update Existing Configuration Global Rule | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Update |
Delete Existing Configuration Global Rule Based On Allowed Action | ADMIN:NAMESPACE:{namespace}:GROUP:CONFIGURATION | Update |
Get List Of Groups | ADMIN:NAMESPACE:{namespace}:GROUP | Read |
Get Single Group | ADMIN:NAMESPACE:{namespace}:GROUP | Read |
Delete Existing Group | ADMIN:NAMESPACE:{namespace}:GROUP:{groupId} | Delete |
Get a List Of Group Members | ADMIN:NAMESPACE:{namespace}:GROUP:MEMBER | Read |
Get All List Of Member Roles | ADMIN:NAMESPACE:{namespace}:GROUP:ROLE | Read |
Create New Member Role | ADMIN:NAMESPACE:{namespace}:GROUP:ROLE | Create |
Get the Member Role | ADMIN:NAMESPACE:{namespace}:GROUP:ROLE | Read |
Delete Member Role | ADMIN:NAMESPACE:{namespace}:GROUP:ROLE | Delete |
Update Member Role | ADMIN:NAMESPACE:{namespace}:GROUP:ROLE | Update |
Update Member Role Permission | ADMIN:NAMESPACE:{namespace}:GROUP:ROLE | Update |
Permissions work slightly differently depending on whether they are assigned to IAM Clients or Roles assigned to users. For more information, read the Authentication and Authorization documentation.
Manage Groups in the Admin Portal
Create a New Group Role
On the Group Roles page in the Admin Portal, click the Add Role button.
A pop-up window appears. Here, input the Role Name for your new role. Note that Role will appear when you add the Group Configuration later.
Once completed, click Submit.
Add New Permissions to a Group Role
In the Admin Portal, go to the Group Role you created earlier, and in the Group Role Detail click the Add Permission button.
A pop-up window appears. Fill in the required fields:
Input the Permission with the appropriate format.
Choose the Action of the permission.
Once completed, click Add. The permission will be added to the group role.
Create a New Group Configuration
On the Group Configurations page of the Admin Portal, click the Add Configuration button.
Once the form appears, fill in the fields as shown below:
Input the configuration Code with the appropriate format. E.g. group-clan.
Input the configuration Name.
Input a Description of the configuration.
Input the Maximum Group Members.
Select the Group Admin Role and Group Member Role. Make sure you've created a Group Role as it would be displayed in the drop-down list.
Once you've done, click Add. Here you can see your new configuration has been added to the list.
Add Custom Attributes
You can add custom attributes or custom parameters to customize your group information based on your preferences.
In the Group Management dropdown of the Admin Portal, click the List menu.
Choose the Group you want to add the custom attributes to by clicking the View button. Make sure that you have permission to add attributes to a group.
In the Group Details, click the Add Custom Attributes button.
Fill out the custom attributes in JSON format.
When you're done, click Save.
Implement Groups using the Unity SDK
Manage Groups
Create a New Group
You can create a new group once you have a group configuration in your namespace. The members of your group will be admins by default.
- Unity
RuleInformation ruleInformation = new RuleInformation
{
ruleAttribute = "MyRuleAttribute",
ruleCriteria = RuleCriteria.MAXIMUM,
ruleValue = 50.0f
};
Rules rules = new Rules
{
allowedAction = AllowedAction.joinGroup,
ruleDetail = [ruleInformation]
};
GroupRules groupRules = new GroupRules
{
groupCustomRule = {},
groupPredefinedRules = [rules]
};
CreateGroupRequest createGroupRequest = new CreateGroupRequest
{
groupName = "MyNewGroupName",
groupType = GroupType.OPEN,
groupMaxMember = 25,
groupDescription = "MyNewGroupDescription",
groupIcon = "https://example.com",
groupRegion = "US",
groupRules = groupRules,
configurationCode = "MyConfiguration Code",
customAttributes = new Dictionary<string, object>
{
{ "sword", 3 },
{ "armor", 7 }
}
};
AccelBytePlugin.GetGroup().CreateGroup(createGroupRequest, result =>
{
if (result.IsError)
{
// Do something if CreateGroup has an error
Debug.Log($"Error CreateGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if CreateGroup has been successful
}
});
Retrieve a List of Groups
Search for a group by its name or region. The results will be paginated, and you can use offset and limit parameters to limit the list. This function only shows PUBLIC and OPEN groups.
- Unity
string groupName = "SomeGroupName"; // You can leave it blank if you want to fetch all the groups
string groupRegion = "US"; // You can leave it blank if you want to fetch all the groups
int offset = 0;
int limit = 99;
AccelBytePlugin.GetGroup().SearchGroups(groupName, groupRegion, offset, limit, result =>
{
if (result.IsError)
{
// Do something if SearchGroups has an error
Debug.Log($"Error SearchGroups, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if SearchGroups has been successful
}
});
Retrieve Group Information
Get information about a group by using the Group ID.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().GetGroup(groupId, result =>
{
if (result.IsError)
{
// Do something if GetGroup has an error
Debug.Log($"Error GetGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if GetGroup has been successful
}
});
Retrieve a Player's Group Information
You can get your current player's group information by using this function. If the player you requested doesn't belong to any group, the returned status will be ErrorCode.UserNotBelongToAnyGroup, and the player will be able to be invited to a group.
- Unity
AccelBytePlugin.GetGroup().GetMyGroupInfo(result =>
{
if (result.IsError)
{
// Do something if GetMyGroupInfo has an error
Debug.Log($"Error GetMyGroupInfo, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if GetMyGroupInfo has been successful
}
});
Retrieve Other Player's Group Information
This function is to call the group information of other users with a specific user ID.
- Unity
string userid = "SomeUserId";
AccelBytePlugin.GetGroup().GetOtherGroupInfo(userId, result =>
{
if (result.IsError)
{
// Do something if GetOtherGroupInfo has an error
Debug.Log($"Error GetOtherGroupInfo, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if GetOtherGroupInfo has been successful
}
});
Retrieve a Group's Member List
Use this function to get a group's member list.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().GetGroupMemberList(groupId, result =>
{
if (result.IsError)
{
// Do something if GetGroupMemberList has an error
Debug.Log($"Error GetGroupMemberList, Error Code: {result.Error.Code} Error Code: {result.Error.Message}");
}
else
{
// Do something if GetGroupMemberList has been successful
}
});
Update Group Information
A group's information such as its name, icon, description, region, and type can be updated with this function. Only members with an admin role can update the group's information.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().UpdateGroup(groupId, updateGroupRequest, result =>
{
if (result.IsError)
{
// Do something if UpdateGroup has an error
Debug.Log($"Error UpdateGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if UpdateGroup has been successful
}
});
Update a Group's Custom Attributes
You can also update a group's custom attributes separately using this function. Just like the group information update, only members with an admin role can update the group's custom attributes.
- Unity
Dictionary<string, object> customAttributes = new Dictionary<string, object>
{
{ "requirementLevel", 50 },
{ "requirementItem", 25 }
};
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().UpdateGroupCustomAttributes(groupId, customAttributes, result =>
{
if (result.IsError)
{
// Do something if UpdateGroupCustomAttributes has an error
Debug.Log($"Error UpdateGroupCustomAttributes, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if UpdateGroupCustomAttributes has been successful
}
});
Group Interaction
Join Group
Players can request to join open or public groups. An OPEN group will allow players to automatically join, whereas a join request to a PUBLIC group will need to be approved by an admin before the player can join.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().JoinGroup(groupId, result =>
{
if (result.IsError)
{
// Do something if JoinGroup has an error
Debug.Log($"Error JoinGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if JoinGroup has been successful
}
});
Cancel Join Request
After a player requests to join a group, that request can be canceled.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().CancelJoinGroupRequest(groupId, result =>
{
if (result.IsError)
{
// Do something if CancelJoinGroupRequest has an error
Debug.Log($"Error CancelJoinGroupRequest, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if CancelJoinGroupRequest has been successful
}
});
Leave Group
To leave a group, you can use this function.
- Unity
AccelBytePlugin.GetGroup().LeaveGroup(result =>
{
if (result.IsError)
{
// Do something if LeaveGroup has an error
Debug.Log($"Error LeaveGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if LeaveGroup has been successful
}
});
Invite a Player to a Group
Group admins can also invite players to join their group. A PRIVATE group can use this function to add new members. Players need to accept the invitation before they can join the group.
- Unity
string otherUserId = "SomeOtherUserId";
AccelBytePlugin.GetGroup().InviteOtherUserToGroup(otherUserId, result =>
{
if (result.IsError)
{
// Do something if InviteOtherUserToGroup has an error
Debug.Log($"Error InviteOtherUserToGroup, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if InviteOtherUserToGroup has been successful
}
});
string userId = "123456789";
AccelBytePlugin.GetGroup().InviteOtherUserToGroup(userId, result =>
{
Debug.Log("Successfully invite user to the group!");
});
Kick a Group Member
Group admins can also kick group members out of the group.
- Unity
string otherUserId = "SomeOtherUserId";
AccelBytePlugin.GetGroup().KickGroupMember(otherUserId, result =>
{
if (result.IsError)
{
// Do something if KickGroupMember has an error
Debug.Log($"Error KickGroupMember, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if KickGroupMember has been successful
}
});
Get a List of Group Invitation Requests
Players can get the list of group invitation requests, to either accept or reject these invitations.
- Unity
AccelBytePlugin.GetGroup().GetGroupInvitationRequests(result =>
{
if (result.IsError)
{
// Do something if GetGroupInvitationRequests has an error
Debug.Log($"Error GetGroupInvitatioNRequests, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if GetGroupInvitationRequests has been successful
}
});
Accept Group Invitation Request
After getting the invitation list, players can accept an invitation.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().AcceptGroupInvitation(groupId, result =>
{
if (result.IsError)
{
// Do something if AcceptGroupInvitation has an error
Debug.Log($"Error AcceptGroupInvitation, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if AcceptGroupInvitation hasbeen successful
}
});
Reject Group Invitation Request
Players can also reject any invitation request.
- Unity
string groupId = "SomeGroupId";
AccelBytePlugin.GetGroup().RejectGroupInvitation(groupId, result =>
{
if (result.IsError)
{
// Do something if RejectGroupInvitation has an error
Debug.Log($"Error RejectGroupInvitation, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if RejectGroupInvitation has been successful
}
});
Get List of Group Member Join Requests
Group admins can get the list of group member join requests, to either approve or reject them.
- Unity
string groupId = "123456789";
AccelBytePlugin.GetGroup().GetGroupJoinRequests(groupId, result =>
{
foreach(var request in result.Value.data)
{
Debug.Log("UserId: " + request.userId);
}
});
Accept Group Member Join Request
After getting the list of join requests, a group admin can accept them to the group.
- Unity
string otherUserId = "SomeOtherUserId";
AccelBytePlugin.GetGroup().AcceptOtherJoinRequest(otherUserId, result =>
{
if (result.IsError)
{
// Do something if AcceptOtherJoinRequest has an error
Debug.Log($"Error AcceptOtherJoinRequest, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if AcceptOtherJoinRequest has been successful
}
});
Reject Group Member Join Request
Group admin can also reject any member join request.
- Unity
string otherUserId = "SomeOtherUserId";
AccelBytePlugin.GetGroup().RejectOtherJoinRequest(otherUserId, result =>
{
if (result.IsError)
{
// Do something if RejectOtherJoinRequest has an error
Debug.Log($"Error RejectOtherJoinRequest, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if RejectOtherJoinRequest has been successful
}
});
Get Bulk Users' Presence
You can use this endpoint to get users' presence information in bulk.
- Unity
var userIds = new List<string>();
userIds.Add("SomeTargetUserId1");
userIds.Add("SomeTargetUserId2");
userIds.Add("SomeTargetUserId3");
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().BulkGetUserPresence(userIds.ToArray(), result =>
{
if (result.IsError)
{
// Do something if BulkGetUserPresence has an error
Debug.Log($"Error BulkGetUserPresence, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if BulkGetUserPresence has been successful
}
});
Group Roles
Every group member has roles assigned to them, which can be used to restrict or allow access to features such as: inviting a member, kicking a member, etc. Every group member will automatically be assigned to the default member role that is already defined in the group configuration. This can be either an admin group role or a member group role.
Get a List of Group Member Roles
An admin can get a list of the member roles that have already been created in the Admin Portal.
- Unity
AccelBytePlugin.GetGroup().GetMemberRoles(result =>
{
if (result.IsError)
{
// Do something if GetMemberRoles has an error
Debug.Log($"Error GetMemberRoles, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if GetMemberRoles has been successful
}
});
Promote a Member to a Role
An admin can promote a member to a specific role, as long as the role has been defined for that group.
- Unity
string memberRoleId = "SomeMemberRoleId";
string userId = "SomeUserId";
AccelBytePlugin.GetGroup().AssignRoleToMember(memberRoleId, userid, result =>
{
if (result.IsError)
{
// Do something if AssignRoleToMember has an error
Debug.Log($"Error AssignRoleToMember, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if AssignRoleToMember has been successful
}
});
Remove a Member's Role
An admin can also remove a role from a member.
- Unity
string memberRoleId = "SomeMemberRoleId";
string userId = "SomeUserId";
AccelBytePlugin.GetGroup().RemoveRoleFromMember(memberRoleId, userid, result =>
{
if (result.IsError)
{
// Do something if RemoveRoleFromMember has an error
Debug.Log($"Error RemoveRoleFromMember, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if RemoveRoleFromMember has been successful
}
});
Group Notifications
Some group activity will trigger notifications that will be sent to individual players, to group admins, or to all group members. The notification payload will be a JSON formatted string that contains data related to the triggered activity. To retrieve these notifications, you need to add a callback to the OnNotification function.
- Unity
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().OnNotification += result =>
{
if (result.IsError)
{
// Do something if OnNotification has an error
Debug.Log($"Error OnNotification, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if OnNotification has been successful
}
};
Group Invitation Notifications
Here's an example of the payload for a notification sent to a player when they've been invited to join a group:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"kind": "invitation"
}
Group Acceptance Notifications
Here's an example of the payload for a notification sent to a player when their request to join a group has been accepted:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"kind": "accepted-request"
}
Group Rejection Notifications
Here's an example of the payload for a notification sent to a player when their request to join a group has been rejected:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"kind": "rejected-request"
}
New Group Member Notifications
Here's an example of the payload for a notification sent to all group members when a new member has joined their group:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"newGroupMember": "newGroupMemberId",
"kind": "new-member"
}
Member Request Notifications
Here's an example of the payload for a notification sent to group admins when a player has requested to join their group:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"newGroupMember": "newGroupMemberId",
"kind": "join-request"
}
Member Role Assignment Notifications
Here's an example of the payload for a notification sent to a player when a group admin has assigned a role to them:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"newGroupMember": "newGroupMemberId",
"roleId": "roelId",
"kind": "assigned-role"
}
And here's the payload if a group admin removes a role from a player:
{
"groupName": "nameOfGroup",
"groupId": "groupId",
"newGroupMember": "newGroupMemberId",
"roleId": "roelId",
"kind": "removed-role"
}
Connect Custom Services to Groups using the Server SDKs
SDK Initialization
Before using the Cloud Groups service from the SDK, you will need to initialize your server-side SDK to ensure you are authorized and able to perform create, read, update, and delete actions.
Golang SDK Initialization
Before using the Groups service from the Golang SDK, you will need to initialize the SDK by following the steps below:
Create your OAuth Client and assign the necessary permissions to access the Groups service.
Initialize the service using the following function:
- Golang
groupService := &g.GroupService{
Client: factory.NewGroupClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
Once completed, you can use the Golang SDK to create, read, update and delete Groups from your serverless app.
Python SDK Initialization
Before using the Groups service from the Python SDK, you will need to initialize the SDK by following the steps below:
Create your OAuth Client and assign the necessary permissions to access the Groups service.
Once completed, you can use the Python SDK to create, read, update, and delete Groups from your serverless app.
.NET (C#) SDK Initialization
Before using the Group service, you will need to set some permissions. Use the following .NET namespaces:
using AccelByte.Sdk.Api.Group.Model;
using AccelByte.Sdk.Api.Group.Operation;
using AccelByte.Sdk.Api.Group.Wrapper;
Java SDK Initialization
Before using the Group service, you will need to set some permissions. Initialize the Group wrapper from the Group service using the following code:
Group wGroup = new Group(sdk);
Once completed, you can use the SDK to create, read, update, or delete groups.
To use the Group Service, make sure you have the necessary permissions.
Create a Group
Use the following function to create a group:
- Golang
- Python
- C#
- Java
err := groupService.PublicCreateNewGroupV1(input)
if err != nil {
return err
}
return nil
from accelbyte_py_sdk.api.group import create_new_group_public_v1
from accelbyte_py_sdk.api.group.models import ModelsGroupRule
from accelbyte_py_sdk.api.group.models import ModelsGroupRuleGroupCustomRule
from accelbyte_py_sdk.api.group.models import ModelsRule
from accelbyte_py_sdk.api.group.models import ModelsRuleInformation
from accelbyte_py_sdk.api.group.models import ModelsPublicCreateNewGroupRequestV1
result, error = create_new_group_public_v1(
body=ModelsPublicCreateNewGroupRequestV1.create(
configuration_code="<configuration-code>",
custom_attributes={},
group_description="<group-description>",
group_icon="<group-icon>",
group_max_member=20,
group_name="<group-name>",
group_region="<group-region>",
group_rules=ModelsGroupRule.create(
group_custom_rule=ModelsGroupRuleGroupCustomRule.create(
dict_={}
),
group_predefined_rules=[
ModelsRule.create(
allowed_action="<allowed-action>",
rule_detail=[
ModelsRuleInformation.create(
rule_attribute="<rule-attribute>",
rule_criteria="<rule-criteria>",
rule_value=1
)
],
)
]
),
group_type="<group-type>"
)
)
if error:
print(error)
Group wGroup = new Group(sdk);
ModelsPublicCreateNewGroupRequestV1 createGroup = new ModelsPublicCreateNewGroupRequestV1()
{
GroupName = "Name of the Group",
GroupType = "PUBLIC",
GroupDescription = "Group's description",
GroupMaxMember = 100,
GroupRegion = "us",
ConfigurationCode = "<group_configuration_code>"
};
ModelsGroupResponseV1? cGroup = wGroup.CreateNewGroupPublicV1(
CreateNewGroupPublicV1.Builder
.Build(createGroup, sdk.Namespace));
ModelsPublicCreateNewGroupRequestV1 createGroup = ModelsPublicCreateNewGroupRequestV1.builder()
.groupName(groupName)
.groupType(groupType)
.groupDescription(groupDescription)
.groupMaxMember(100)
.groupRegion(groupRegion)
.configurationCode(configurationCode)
.build();
ModelsGroupResponseV1 cGroup = wGroup.createNewGroupPublicV1(CreateNewGroupPublicV1.builder()
.namespace(namespace)
.body(createGroup)
.build());
Delete a Group
Use the following function to delete a group:
- Golang
- Python
- C#
- Java
err := groupService.DeleteGroupPublicV1(input)
if err != nil {
return err
}
return nil
from accelbyte_py_sdk.api.group import delete_group_public_v1
result, error = delete_group_public_v1(
group_id="<group-id>"
)
if error:
print(error)
Group wGroup = new Group(sdk);
wGroup.DeleteGroupPublicV1(
DeleteGroupPublicV1.Builder
.Build("<group_id>", sdk.Namespace));
wGroup.deleteGroupPublicV1(DeleteGroupPublicV1.builder()
.namespace(namespace)
.groupId(groupId)
.build());
Retrieve a Group
Use the following function to retrieve a group:
- Golang
- Python
- C#
- Java
err := groupService.DeleteGroupPublicV1(input)
if err != nil {
return err
}
return nil
from accelbyte_py_sdk.api.group import get_single_group_public_v1
result, error = get_single_group_public_v1(
group_id="<group-id>"
)
if error:
print(error)
Group wGroup = new Group(sdk);
ModelsGroupResponseV1? gGroup = wGroup.GetSingleGroupPublicV1(
GetSingleGroupPublicV1.Builder
.Build("<group_id>", sdk.Namespace));
ModelsGroupResponseV1 gGroup = wGroup.getSingleGroupPublicV1(GetSingleGroupPublicV1.builder()
.namespace(namespace)
.groupId(group_id)
.build());
Update a Group
Use the following function to update a group:
- Golang
- Python
- C#
- Java
err := groupService.DeleteGroupPublicV1(input)
if err != nil {
return err
}
return nil
from accelbyte_py_sdk.api.group import update_single_group_v1
from accelbyte_py_sdk.api.group.models import ModelsUpdateGroupRequestV1
from accelbyte_py_sdk.api.group.models import ModelsUpdateGroupRequestV1CustomAttributes
result, error = update_single_group_v1(
body=ModelsUpdateGroupRequestV1.create(
custom_attributes=ModelsUpdateGroupRequestV1CustomAttributes.create(
dict_={}
),
group_description="<group-description>",
group_icon="<group-icon>",
group_name="<group-name>",
group_region="<group-region>",
group_type="<group-type>"
),
group_id="<group-id>"
)
if error:
print(error)
Group wGroup = new Group(sdk);
ModelsUpdateGroupRequestV1 updateGroup = new ModelsUpdateGroupRequestV1()
{
GroupDescription = "Updated description."
};
ModelsGroupResponseV1? uGroup = wGroup.UpdateSingleGroupV1(
UpdateSingleGroupV1.Builder
.Build(updateGroup, "<group_id>", sdk.Namespace));
ModelsUpdateGroupRequestV1 updateGroup = ModelsUpdateGroupRequestV1.builder()
.groupDescription(groupDescriptionUpdated)
.build();
ModelsGroupResponseV1 uGroup = wGroup.updateSingleGroupV1(UpdateSingleGroupV1.builder()
.namespace(namespace)
.groupId(group_id)
.body(updateGroup)
.build());