> ## 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 資料模型。在現有群組內建立沒有成員的新角色。角色識別碼和角色名稱在群組內都必須是唯一的。

PFGroupsCreateGroupRoleRequest 資料模型。在現有群組內建立沒有成員的新角色。角色識別碼和角色名稱在群組內都必須是唯一的，但名稱可以與識別碼相同。角色識別碼會在建立時設定，且無法變更。傳回所建立角色的相關資訊。

## 語法

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

### 成員

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

（選擇性）與要求相關聯的選擇性自訂標籤（例如組建編號、外部追蹤識別碼等）。

**`customTagsCount`**   uint32\_t

customTags 的計數

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

群組的識別碼。

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

角色的識別碼。此識別碼在群組內必須是唯一的，且無法變更。角色識別碼的長度必須介於 1 到 64 個字元之間，且僅限使用 a-Z、A-Z、0-9、'('、')'、'\_'、'-' 和 '.'。

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

角色的名稱。此名稱在群組內必須是唯一的，且可在稍後變更。角色名稱的長度必須介於 1 到 100 個字元之間。

## 需求

**標頭：** PFGroupsTypes.h

## 另請參閱

[PFGroupsTypes 成員](/zh-TW/services/playfab/api-references/c/pfgroupstypes/pfgroupstypes_members)


## Related topics

- [PFGroupsCreateRoleAsync](/zh-TW/services/playfab/api-references/c/pfgroups/functions/pfgroupscreateroleasync.md)
- [服務 C API 概觀 - PFGroupsTypes.h](/zh-TW/services/playfab/api-references/c/pfgroupstypes/pfgroupstypes_members.md)
- [PFGroupsCreateGroupRoleResponse](/zh-TW/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupscreategrouproleresponse.md)
- [PFGroupsUpdateGroupRoleRequest](/zh-TW/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupsupdategrouprolerequest.md)
- [PFGroupsCreateRoleGetResult](/zh-TW/services/playfab/api-references/c/pfgroups/functions/pfgroupscreaterolegetresult.md)
