Method: query.removeActivity
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://cloudsearch.googleapis.com/v1/query:removeActivity
网址采用 gRPC 转码语法。
请求正文
请求正文中包含结构如下的数据:
字段 |
userActivity |
object (UserActivity )
包含要删除的数据的用户活动。
|
requestOptions |
object (RequestOptions )
请求选项,例如搜索应用和 clientId。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/cloud_search.query
https://www.googleapis.com/auth/cloud_search
如需了解详情,请参阅授权指南。
UserActivity
用户的单次或批量查询活动。这可以是日志查询或删除查询。
JSON 表示法 |
{
// Union field activity can be only one of the following:
"queryActivity": {
object (QueryActivity )
}
// End of list of possible types for union field activity .
} |
字段 |
联合字段 activity 。 activity 只能是下列其中一项:
|
queryActivity |
object (QueryActivity )
包含需要记录/移除的数据。
|
QueryActivity
JSON 表示法 |
{
"query": string
} |
字段 |
query |
string
要记录/移除的用户输入查询。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Method: query.removeActivity\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [UserActivity](#UserActivity)\n - [JSON representation](#UserActivity.SCHEMA_REPRESENTATION)\n- [QueryActivity](#QueryActivity)\n - [JSON representation](#QueryActivity.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nProvides functionality to remove logged activity for a user.\n\n**Note:** This API requires a standard end user account to execute. A service account can't perform Remove Activity requests directly; to use a service account to perform queries, set up [Google Workspace domain-wide delegation of authority](https://developers.google.com/workspace/cloud-search/docs/guides/delegation/).\n\n### HTTP request\n\n`POST https://cloudsearch.googleapis.com/v1/query:removeActivity`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"userActivity\": { object (/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity) }, \"requestOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/RequestOptions) } } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `userActivity` | `object (`[UserActivity](/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity)`)` User Activity containing the data to be deleted. |\n| `requestOptions` | `object (`[RequestOptions](/workspace/cloud-search/docs/reference/rest/v1/RequestOptions)`)` Request options, such as the search application and clientId. |\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.query`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nUserActivity\n------------\n\nUser's single or bulk query activity. This can be a logging query or deletion query.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `activity` can be only one of the following: \"queryActivity\": { object (/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity) } // End of list of possible types for union field `activity`. } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Union field `activity`. `activity` can be only one of the following: ||\n| `queryActivity` | `object (`[QueryActivity](/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity)`)` Contains data which needs to be logged/removed. |\n\nQueryActivity\n-------------\n\nDetails about a user's query activity.\n\n| JSON representation |\n|-----------------------------|\n| ``` { \"query\": string } ``` |\n\n| Fields ||\n|---------|-------------------------------------------------|\n| `query` | `string` User input query to be logged/removed. |"]]