Update a Group
Last updated on
Use the following function to update a group:
- Go
- 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());