*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

UserRestriction

代表对用户的限制。

  • 资源路径
  • /cloud/v2/universes/{universe_id}/user-restrictions
  • /cloud/v2/universes/{universe_id}/places/{place_id}/user-restrictions

属性

pathstring

用户限制的资源路径。

格式:

  • universes/{universe_id}/user-restrictions/{user_restriction_id}
  • universes/{universe_id}/places/{place_id}/user-restrictions/{user_restriction_id}.
updateTimestring
仅输出

用户限制最后更新时间戳。. 此字符串格式为 FieldMask

userstring
仅输出

受影响的用户。.

gameJoinRestrictionobject

用户被禁止从父宇宙或场景。.

基本网址

https://apis.roblox.com
UserRestriction 资源

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

List User Restrictions
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions

列出已在宇宙或特定场景点被禁止的用户的用户限制。

范围
universe.user-restriction:read
请求路径参数
universe_idstring
必填

宇宙ID。.

查询参数
maxPageSizenumber

回传回的最大用户限制数量。服务可能返回小于此值。如果未指定,最多返回 10 个用户限制。最大值为 100,更高值设置为 100。.

pageTokenstring

从前一次调用收到的页面代币,用于检索后续页面。

当页面分页时,所有其他参数提供给后续调用的必须与提供页面代币的调用匹配。.

答复

父系列合中的用户限制列表。

userRestrictionsarray<UserRestriction>

指定宇宙或地点的用户限制。.

nextPageTokenstring

您可以将其作为pageToken参数发送的代币来检索下一页。如果该字段被忽略,就没有后续页面。.

GET /cloud/v2/universes/{universe_id}/user-restrictions

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions?maxPageSize=10&pageToken={string}' \
-H 'x-api-key: {your-api-key}'
答复

{
"userRestrictions": [
{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}
],
"nextPageToken": "string"
}

UserRestriction

Get User Restriction
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

获取用户限制。

范围
universe.user-restriction:read
请求路径参数
universe_idstring
必填

宇宙ID。.

user_restriction_idstring
必填

用户限制ID。.

GET /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}' \
-H 'x-api-key: {your-api-key}'
答复

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

Update User Restriction
Beta

PATCH /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

更新用户限制。

范围
universe.user-restriction:write
请求路径参数
universe_idstring
必填

宇宙ID。.

user_restriction_idstring
必填

用户限制ID。.

查询参数
updateMaskstring

要更新的字段列表。

game_join_restriction 字段必须被原子更新;索引到 game_join_restriction (例如 "game_join_restriction.active" ) 的字段面具不支持。. 此字符串格式为 FieldMask

idempotencyKey.keystring

用于不可变性的独特钥。.

idempotencyKey.firstSentstring

第一个请求发送的时戳。

如果这比 idempotency 键的有效期更遥远,那么服务器 必须 返回错误。. 此字符串格式为 FieldMask

请求正文UserRestriction
PATCH /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

curl -L -X PATCH 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}?updateMask={string}&idempotencyKey.key={string}&idempotencyKey.firstSent={string}' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"gameJoinRestriction": {
"active": true,
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true
}
}'
答复

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

List User Restriction Logs
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions:listLogs

列出给定宇宙内用户限制资源的更改。这包括宇宙级和地点级限制。

对于宇宙级限制日志,place字段将为空。

范围
universe.user-restriction:read
请求路径参数
universe_idstring
必填

宇宙ID。.

查询参数
maxPageSizenumber

返回传的最大用户限制日志数量。服务可能返回小于此值。如果未指定,最多返回 10 个用户限制日志。最大值为 100,更高值设置为 100。.

pageTokenstring

从前一次调用收到的页面代币,用于检索后续页面。

当页面分页时,所有其他参数提供给后续调用的必须与提供页面代币的调用匹配。.

filterstring

该字段可以设置为过滤返回的日志。

filter 字段支持很小数量的CEL:

  • user
  • place
  • 比较运营商 == 可用。
  • 还支持 && 逻辑运算器。

作为例子,过滤用户和地点需要形式 filter="user == 'users/123'" && "place == 'places/456'".

答复

返回应用于用户限制资源的更改日志列表。

logsarray<object>

指定宇宙的用户限制日志。.

nextPageTokenstring

您可以将其作为pageToken参数发送的代币来检索下一页。如果该字段被忽略,就没有后续页面。.

GET /cloud/v2/universes/{universe_id}/user-restrictions:listLogs

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions:listLogs?maxPageSize=10&pageToken={string}&filter={string}' \
-H 'x-api-key: {your-api-key}'
答复

{
"logs": [
{
"user": "users/156",
"place": "places/456",
"moderator": {
"robloxUser": "users/156"
},
"createTime": "2023-07-05T12:34:56Z",
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"restrictionType": {
"gameJoinRestriction": {}
},
"excludeAltAccounts": true
}
],
"nextPageToken": "string"
}