> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFGroupsCreateGroupRoleRequest

> PFGroupsCreateGroupRoleRequest 数据模型。在现有组中创建一个不包含成员的新角色。角色 ID 和角色名称在组内必须是唯一的。

PFGroupsCreateGroupRoleRequest 数据模型。在现有组中创建一个不包含成员的新角色。角色 ID 和角色名称在组内必须是唯一的，但名称可以与 ID 相同。角色 ID 在创建时设置，不可更改。返回有关所创建角色的信息。

## 语法

```cpp theme={null}
typedef struct PFGroupsCreateGroupRoleRequest {  
    PFStringDictionaryEntry const* customTags;  
    uint32_t customTagsCount;  
    PFEntityKey const* group;  
    const char* roleId;  
    const char* roleName;  
} PFGroupsCreateGroupRoleRequest;  
```

### 成员

**`customTags`**   [PFStringDictionaryEntry](/services/playfab/api-references/c/pftypes/structs/pfstringdictionaryentry) const\*<br />*may be nullptr*

（可选）与请求关联的可选自定义标记（例如生成号、外部跟踪标识符等）。

**`customTagsCount`**   uint32\_t

customTags 的数量

**`group`**   [PFEntityKey](/services/playfab/api-references/c/pftypes/structs/pfentitykey-c) const\*

组的标识符。

**`roleId`**   const char\*<br />*is null-terminated*

角色的 ID。此 ID 在组内必须唯一，且不可更改。角色 ID 长度必须介于 1 到 64 个字符之间，仅限于 a-Z、A-Z、0-9、“(”、“)”、“\_”、“-”和“.”。

**`roleName`**   const char\*<br />*is null-terminated*

角色的名称。此名称在组内必须唯一，可稍后更改。角色名称长度必须介于 1 到 100 个字符之间。

## 要求

**头文件：** PFGroupsTypes.h

## 另请参阅

[PFGroupsTypes 成员](/services/playfab/api-references/c/pfgroupstypes/pfgroupstypes_members)


## Related topics

- [PFGroupsCreateRoleAsync](/zh-CN/services/playfab/api-references/c/pfgroups/functions/pfgroupscreateroleasync.md)
- [服务 C API 概览 - PFGroupsTypes.h](/zh-CN/services/playfab/api-references/c/pfgroupstypes/pfgroupstypes_members.md)
- [PFGroupsCreateGroupRoleResponse](/zh-CN/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupscreategrouproleresponse.md)
- [PFGroupsUpdateGroupRoleRequest](/zh-CN/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupsupdategrouprolerequest.md)
- [PFGroupsDeleteRoleRequest](/zh-CN/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupsdeleterolerequest.md)
