Method: events.listDefinitions
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://games.googleapis.com/games/v1/eventDefinitions
查询参数
参数 |
language |
string
此方法返回的字符串的首选语言。
|
maxResults |
integer
响应中可返回的事件定义数量上限,用于分页。对于任何响应,要返回的事件定义的实际数量可能少于指定的 maxResults 。
|
pageToken |
string
上一个请求返回的令牌。
|
响应正文
ListDefinitions 响应。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"kind": string,
"nextPageToken": string,
"items": [
{
object (EventDefinition )
}
]
} |
字段 |
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#eventDefinitionListResponse 。
|
nextPageToken |
string
下一页结果的分页令牌。
|
items[] |
object (EventDefinition )
事件定义。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
如需了解详情,请参阅 OAuth 2.0 概览。
EventDefinition
JSON 表示法 |
{
"id": string,
"visibility": enum (EventVisibility ),
"displayName": string,
"imageUrl": string,
"childEvents": [
{
object (EventChild )
}
],
"description": string,
"isDefaultImageUrl": boolean,
"kind": string
} |
字段 |
id |
string
事件的 ID。
|
visibility |
enum (EventVisibility )
在此定义中跟踪的事件的公开范围。
|
displayName |
string
要为事件显示的名称。
|
imageUrl |
string
代表活动的图片的基准网址。
|
childEvents[] |
object (EventChild )
此事件的子事件列表。
|
description |
string
对此事件所代表内容的说明。
|
isDefaultImageUrl |
boolean
指明要返回的图标图片是默认图片还是游戏提供的图片。
|
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#eventDefinition 。
|
EventVisibility
枚举 |
REVEALED |
所有用户都应能看到此活动。 |
HIDDEN |
此事件应仅向至少记录过一次此事件的用户显示。 |
EventChild
JSON 表示法 |
{
"childId": string,
"kind": string
} |
字段 |
childId |
string
子事件的 ID。
|
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#eventChild 。
|
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Method: events.listDefinitions\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListEventDefinitionsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [EventDefinition](#EventDefinition)\n - [JSON representation](#EventDefinition.SCHEMA_REPRESENTATION)\n- [EventVisibility](#EventVisibility)\n- [EventChild](#EventChild)\n - [JSON representation](#EventChild.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nReturns a list of the event definitions in this application.\n\n### HTTP request\n\n`GET https://games.googleapis.com/games/v1/eventDefinitions`\n\n### Query parameters\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `language` | `string` The preferred language to use for strings returned by this method. |\n| `maxResults` | `integer` The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified `maxResults`. |\n| `pageToken` | `string` The token returned by the previous request. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA ListDefinitions response.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"nextPageToken\": string, \"items\": [ { object (/games/services/web/api/rest/v1/events/listDefinitions#EventDefinition) } ] } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#eventDefinitionListResponse`. |\n| `nextPageToken` | `string` The pagination token for the next page of results. |\n| `items[]` | `object (`[EventDefinition](/games/services/web/api/rest/v1/events/listDefinitions#EventDefinition)`)` The event definitions. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/games`\n- `\n https://www.googleapis.com/auth/games_lite`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).\n\nEventDefinition\n---------------\n\nAn event definition resource.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"visibility\": enum (/games/services/web/api/rest/v1/events/listDefinitions#EventVisibility), \"displayName\": string, \"imageUrl\": string, \"childEvents\": [ { object (/games/services/web/api/rest/v1/events/listDefinitions#EventChild) } ], \"description\": string, \"isDefaultImageUrl\": boolean, \"kind\": string } ``` |\n\n| Fields ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` The ID of the event. |\n| `visibility` | `enum (`[EventVisibility](/games/services/web/api/rest/v1/events/listDefinitions#EventVisibility)`)` The visibility of event being tracked in this definition. |\n| `displayName` | `string` The name to display for the event. |\n| `imageUrl` | `string` The base URL for the image that represents the event. |\n| `childEvents[]` | `object (`[EventChild](/games/services/web/api/rest/v1/events/listDefinitions#EventChild)`)` A list of events that are a child of this event. |\n| `description` | `string` Description of what this event represents. |\n| `isDefaultImageUrl` | `boolean` Indicates whether the icon image being returned is a default image, or is game-provided. |\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#eventDefinition`. |\n\nEventVisibility\n---------------\n\nPossible values for the visibility of an event.\n\n| Enums ||\n|------------|---------------------------------------------------------------------------------------|\n| `REVEALED` | This event should be visible to all users. |\n| `HIDDEN` | This event should only be shown to users that have recorded this event at least once. |\n\nEventChild\n----------\n\nAn event child relationship resource.\n\n| JSON representation |\n|-----------------------------------------------|\n| ``` { \"childId\": string, \"kind\": string } ``` |\n\n| Fields ||\n|-----------|--------------------------------------------------------------------------------------------------------------|\n| `childId` | `string` The ID of the child event. |\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#eventChild`. |"]]