From 618af9b0d4e7ed5e80a6b3646735638fb6ef5a75 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Jun 2024 07:13:53 +0000 Subject: [PATCH] feat(all): auto-regenerate discovery clients --- aiplatform/v1/aiplatform-api.json | 740 +- aiplatform/v1/aiplatform-gen.go | 2576 +++++-- aiplatform/v1beta1/aiplatform-api.json | 880 ++- aiplatform/v1beta1/aiplatform-gen.go | 3060 ++++++--- alloydb/v1/alloydb-api.json | 20 +- alloydb/v1/alloydb-gen.go | 8 +- alloydb/v1alpha/alloydb-api.json | 61 +- alloydb/v1alpha/alloydb-gen.go | 45 +- alloydb/v1beta/alloydb-api.json | 61 +- alloydb/v1beta/alloydb-gen.go | 45 +- .../v1/androidmanagement-api.json | 75 +- androidmanagement/v1/androidmanagement-gen.go | 119 + api-list.json | 30 +- .../v1/authorizedbuyersmarketplace-api.json | 4 +- .../v1/authorizedbuyersmarketplace-gen.go | 4 +- batch/v1/batch-api.json | 12 +- batch/v1/batch-gen.go | 36 +- bigtableadmin/v2/bigtableadmin-api.json | 4 +- bigtableadmin/v2/bigtableadmin-gen.go | 8 +- chat/v1/chat-api.json | 4 +- chat/v1/chat-gen.go | 20 +- classroom/v1/classroom-api.json | 1708 ++++- classroom/v1/classroom-gen.go | 6106 ++++++++++++++--- cloudkms/v1/cloudkms-api.json | 53 +- cloudkms/v1/cloudkms-gen.go | 75 + compute/v0.beta/compute-api.json | 20 +- compute/v0.beta/compute-gen.go | 15 +- connectors/v1/connectors-api.json | 19 +- connectors/v1/connectors-gen.go | 8 + connectors/v2/connectors-api.json | 103 +- connectors/v2/connectors-gen.go | 226 - dataform/v1beta1/dataform-api.json | 67 +- dataform/v1beta1/dataform-gen.go | 244 + datamigration/v1/datamigration-api.json | 8 +- datamigration/v1/datamigration-gen.go | 1 + dataplex/v1/dataplex-api.json | 7 +- dataplex/v1/dataplex-gen.go | 11 +- dfareporting/v3.5/dfareporting-api.json | 10 +- dfareporting/v3.5/dfareporting-gen.go | 3 +- dfareporting/v4/dfareporting-api.json | 400 +- dfareporting/v4/dfareporting-gen.go | 391 +- dialogflow/v2/dialogflow-api.json | 4 +- dialogflow/v2/dialogflow-gen.go | 2 +- dialogflow/v2beta1/dialogflow-api.json | 4 +- dialogflow/v2beta1/dialogflow-gen.go | 2 +- discoveryengine/v1/discoveryengine-api.json | 427 +- discoveryengine/v1/discoveryengine-gen.go | 856 ++- .../v1alpha/discoveryengine-api.json | 480 +- .../v1alpha/discoveryengine-gen.go | 1084 ++- .../v1beta/discoveryengine-api.json | 427 +- discoveryengine/v1beta/discoveryengine-gen.go | 1096 ++- displayvideo/v2/displayvideo-api.json | 6 +- displayvideo/v2/displayvideo-gen.go | 6 +- displayvideo/v3/displayvideo-api.json | 8 +- displayvideo/v3/displayvideo-gen.go | 10 +- documentai/v1/documentai-api.json | 4 +- documentai/v1/documentai-gen.go | 6 +- documentai/v1beta3/documentai-api.json | 6 +- documentai/v1beta3/documentai-gen.go | 12 +- domains/v1/domains-api.json | 302 +- domains/v1/domains-gen.go | 521 ++ domains/v1alpha2/domains-api.json | 302 +- domains/v1alpha2/domains-gen.go | 521 ++ domains/v1beta1/domains-api.json | 302 +- domains/v1beta1/domains-gen.go | 521 ++ file/v1/file-api.json | 63 +- file/v1/file-gen.go | 120 + file/v1beta1/file-api.json | 23 +- file/v1beta1/file-gen.go | 12 + firebaseml/v2beta/firebaseml-api.json | 185 +- firebaseml/v2beta/firebaseml-gen.go | 262 +- healthcare/v1/healthcare-api.json | 19 +- healthcare/v1/healthcare-gen.go | 52 +- healthcare/v1beta1/healthcare-api.json | 17 +- healthcare/v1beta1/healthcare-gen.go | 43 +- iam/v1/iam-api.json | 6 +- iam/v1/iam-gen.go | 4 +- iap/v1/iap-api.json | 68 +- iap/v1/iap-gen.go | 114 + jobs/v3/jobs-api.json | 129 +- jobs/v3/jobs-gen.go | 129 - jobs/v3p1beta1/jobs-api.json | 129 +- jobs/v3p1beta1/jobs-gen.go | 129 - jobs/v4/jobs-api.json | 129 +- jobs/v4/jobs-gen.go | 129 - meet/v2/meet-api.json | 1146 ++++ meet/v2/meet-gen.go | 2896 ++++++++ metastore/v1/metastore-api.json | 34 +- metastore/v1/metastore-gen.go | 35 +- metastore/v1alpha/metastore-api.json | 34 +- metastore/v1alpha/metastore-gen.go | 35 +- metastore/v1beta/metastore-api.json | 34 +- metastore/v1beta/metastore-gen.go | 35 +- monitoring/v3/monitoring-api.json | 32 +- monitoring/v3/monitoring-gen.go | 45 +- .../v1/networkmanagement-api.json | 4 +- networkmanagement/v1/networkmanagement-gen.go | 3 + .../v1beta1/networkmanagement-api.json | 9 +- .../v1beta1/networkmanagement-gen.go | 7 + oslogin/v1alpha/oslogin-api.json | 6 +- oslogin/v1alpha/oslogin-gen.go | 10 +- oslogin/v1beta/oslogin-api.json | 6 +- oslogin/v1beta/oslogin-gen.go | 10 +- .../v1/paymentsresellersubscription-api.json | 12 +- .../v1/paymentsresellersubscription-gen.go | 28 +- policysimulator/v1/policysimulator-api.json | 367 +- policysimulator/v1/policysimulator-gen.go | 870 --- sqladmin/v1/sqladmin-api.json | 12 +- sqladmin/v1/sqladmin-gen.go | 8 + sqladmin/v1beta4/sqladmin-api.json | 12 +- sqladmin/v1beta4/sqladmin-gen.go | 8 + walletobjects/v1/walletobjects-api.json | 28 +- walletobjects/v1/walletobjects-gen.go | 38 +- workflows/v1/workflows-api.json | 6 +- workflows/v1/workflows-gen.go | 6 +- 115 files changed, 25145 insertions(+), 6589 deletions(-) create mode 100644 meet/v2/meet-api.json create mode 100644 meet/v2/meet-gen.go diff --git a/aiplatform/v1/aiplatform-api.json b/aiplatform/v1/aiplatform-api.json index a4811e9c70b..1f014b96e7c 100644 --- a/aiplatform/v1/aiplatform-api.json +++ b/aiplatform/v1/aiplatform-api.json @@ -11116,6 +11116,161 @@ } } }, + "notebookExecutionJobs": { + "resources": { + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:cancel", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}", + "httpMethod": "DELETE", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "wait": { + "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}:wait", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.wait", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to wait on.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + }, + "timeout": { + "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", + "format": "google-duration", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}:wait", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, "notebookRuntimeTemplates": { "methods": { "create": { @@ -11377,6 +11532,159 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:cancel", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}", + "httpMethod": "DELETE", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "wait": { + "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}:wait", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.wait", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to wait on.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + }, + "timeout": { + "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", + "format": "google-duration", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}:wait", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } }, "notebookRuntimes": { @@ -11555,17 +11863,170 @@ "required": true, "type": "string" } - }, - "path": "v1/{+name}:upgrade", - "request": { - "$ref": "GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest" - }, - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] + }, + "path": "v1/{+name}:upgrade", + "request": { + "$ref": "GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:cancel", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}", + "httpMethod": "DELETE", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "wait": { + "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}:wait", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.wait", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to wait on.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + }, + "timeout": { + "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", + "format": "google-duration", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}:wait", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } }, @@ -16287,7 +16748,7 @@ } } }, - "revision": "20240609", + "revision": "20240618", "rootUrl": "https://aiplatform.googleapis.com/", "schemas": { "CloudAiLargeModelsVisionGenerateVideoResponse": { @@ -16312,6 +16773,10 @@ "type": "string" }, "type": "array" + }, + "reportingMetrics": { + "$ref": "IntelligenceCloudAutomlXpsReportingMetrics", + "description": "Billable prediction metrics." } }, "type": "object" @@ -16430,6 +16895,10 @@ }, "type": "array" }, + "modelName": { + "description": "The model name used to indexing into the RaiFilterConfig map. Would either be one of imagegeneration@002-006, imagen-3.0-... api endpoint names, or internal names used for mapping to different filter configs (genselfie, ai_watermark) than its api endpoint.", + "type": "string" + }, "raiCategories": { "description": "List of rai categories' information to return", "items": { @@ -17805,7 +18274,8 @@ "OTHER", "BLOCKLIST", "PROHIBITED_CONTENT", - "SPII" + "SPII", + "MALFORMED_FUNCTION_CALL" ], "enumDescriptions": [ "The finish reason is unspecified.", @@ -17816,7 +18286,8 @@ "All other reasons that stopped the token generation", "The token generation was stopped as the response was flagged for the terms which are included from the terminology blocklist.", "The token generation was stopped as the response was flagged for the prohibited contents.", - "The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents." + "The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents.", + "The function call generated by the model is invalid." ], "readOnly": true, "type": "string" @@ -18990,142 +19461,6 @@ }, "type": "object" }, - "GoogleCloudAiplatformV1DatasetDistribution": { - "description": "Distribution computed over a tuning dataset.", - "id": "GoogleCloudAiplatformV1DatasetDistribution", - "properties": { - "buckets": { - "description": "Output only. Defines the histogram bucket.", - "items": { - "$ref": "GoogleCloudAiplatformV1DatasetDistributionDistributionBucket" - }, - "readOnly": true, - "type": "array" - }, - "max": { - "description": "Output only. The maximum of the population values.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "mean": { - "description": "Output only. The arithmetic mean of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "median": { - "description": "Output only. The median of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "min": { - "description": "Output only. The minimum of the population values.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "p5": { - "description": "Output only. The 5th percentile of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "p95": { - "description": "Output only. The 95th percentile of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "sum": { - "description": "Output only. Sum of a given population of values.", - "format": "double", - "readOnly": true, - "type": "number" - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1DatasetDistributionDistributionBucket": { - "description": "Dataset bucket used to create a histogram for the distribution given a population of values.", - "id": "GoogleCloudAiplatformV1DatasetDistributionDistributionBucket", - "properties": { - "count": { - "description": "Output only. Number of values in the bucket.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "left": { - "description": "Output only. Left bound of the bucket.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "right": { - "description": "Output only. Right bound of the bucket.", - "format": "double", - "readOnly": true, - "type": "number" - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1DatasetStats": { - "description": "Statistics computed over a tuning dataset.", - "id": "GoogleCloudAiplatformV1DatasetStats", - "properties": { - "totalBillableCharacterCount": { - "description": "Output only. Number of billable characters in the tuning dataset.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "totalTuningCharacterCount": { - "description": "Output only. Number of tuning characters in the tuning dataset.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "tuningDatasetExampleCount": { - "description": "Output only. Number of examples in the tuning dataset.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "tuningStepCount": { - "description": "Output only. Number of tuning steps for this Tuning Job.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "userDatasetExamples": { - "description": "Output only. Sample user messages in the training dataset uri.", - "items": { - "$ref": "GoogleCloudAiplatformV1Content" - }, - "readOnly": true, - "type": "array" - }, - "userInputTokenDistribution": { - "$ref": "GoogleCloudAiplatformV1DatasetDistribution", - "description": "Output only. Dataset distributions for the user input tokens.", - "readOnly": true - }, - "userMessagePerExampleDistribution": { - "$ref": "GoogleCloudAiplatformV1DatasetDistribution", - "description": "Output only. Dataset distributions for the messages per example.", - "readOnly": true - }, - "userOutputTokenDistribution": { - "$ref": "GoogleCloudAiplatformV1DatasetDistribution", - "description": "Output only. Dataset distributions for the user output tokens.", - "readOnly": true - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1DatasetVersion": { "description": "Describes the dataset version.", "id": "GoogleCloudAiplatformV1DatasetVersion", @@ -19735,18 +20070,6 @@ }, "type": "object" }, - "GoogleCloudAiplatformV1DistillationDataStats": { - "description": "Statistics computed for datasets used for distillation.", - "id": "GoogleCloudAiplatformV1DistillationDataStats", - "properties": { - "trainingDatasetStats": { - "$ref": "GoogleCloudAiplatformV1DatasetStats", - "description": "Output only. Statistics computed for the training dataset.", - "readOnly": true - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1DoubleArray": { "description": "A list of double values.", "id": "GoogleCloudAiplatformV1DoubleArray", @@ -27083,6 +27406,10 @@ "description": "The spec of the pipeline.", "type": "object" }, + "preflightValidations": { + "description": "Optional. Whether to do component level validations before job creation.", + "type": "boolean" + }, "reservedIpRanges": { "description": "A list of names for the reserved ip ranges under the VPC network that can be used for this Pipeline Job's workload. If set, we will deploy the Pipeline Job's workload within the provided ip ranges. Otherwise, the job will be deployed to any ip ranges under the provided VPC network. Example: ['vertex-ai-ip-range'].", "items": { @@ -28548,23 +28875,6 @@ "properties": {}, "type": "object" }, - "GoogleCloudAiplatformV1ReinforcementLearningDataStats": { - "description": "Statistics computed for datasets used for reinforcement learning.", - "id": "GoogleCloudAiplatformV1ReinforcementLearningDataStats", - "properties": { - "preferenceDatasetStats": { - "$ref": "GoogleCloudAiplatformV1DatasetStats", - "description": "Output only. Statistics computed for the preference dataset. This can be either a human preference dataset or a preference dataset generated from AI feedback.", - "readOnly": true - }, - "promptDatasetStats": { - "$ref": "GoogleCloudAiplatformV1DatasetStats", - "description": "Output only. Statistics computed for the prompt dataset used during reinforcement learning.", - "readOnly": true - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1RemoveContextChildrenRequest": { "description": "Request message for MetadataService.DeleteContextChildrenRequest.", "id": "GoogleCloudAiplatformV1RemoveContextChildrenRequest", @@ -35150,14 +35460,6 @@ "description": "The tuning data statistic values for TuningJob.", "id": "GoogleCloudAiplatformV1TuningDataStats", "properties": { - "distillationDataStats": { - "$ref": "GoogleCloudAiplatformV1DistillationDataStats", - "description": "Statistics for distillation." - }, - "reinforcementLearningDataStats": { - "$ref": "GoogleCloudAiplatformV1ReinforcementLearningDataStats", - "description": "Statistics for reinforcement learning." - }, "supervisedTuningDataStats": { "$ref": "GoogleCloudAiplatformV1SupervisedTuningDataStats", "description": "The SFT Tuning data stats." @@ -36145,6 +36447,70 @@ } }, "type": "object" + }, + "IntelligenceCloudAutomlXpsMetricEntry": { + "id": "IntelligenceCloudAutomlXpsMetricEntry", + "properties": { + "argentumMetricId": { + "description": "For billing metrics that are using legacy sku's, set the legacy billing metric id here. This will be sent to Chemist as the \"cloudbilling.googleapis.com/argentum_metric_id\" label. Otherwise leave empty.", + "type": "string" + }, + "doubleValue": { + "description": "A double value.", + "format": "double", + "type": "number" + }, + "int64Value": { + "description": "A signed 64-bit integer value.", + "format": "int64", + "type": "string" + }, + "metricName": { + "description": "The metric name defined in the service configuration.", + "type": "string" + }, + "systemLabels": { + "description": "Billing system labels for this (metric, value) pair.", + "items": { + "$ref": "IntelligenceCloudAutomlXpsMetricEntryLabel" + }, + "type": "array" + } + }, + "type": "object" + }, + "IntelligenceCloudAutomlXpsMetricEntryLabel": { + "id": "IntelligenceCloudAutomlXpsMetricEntryLabel", + "properties": { + "labelName": { + "description": "The name of the label.", + "type": "string" + }, + "labelValue": { + "description": "The value of the label.", + "type": "string" + } + }, + "type": "object" + }, + "IntelligenceCloudAutomlXpsReportingMetrics": { + "id": "IntelligenceCloudAutomlXpsReportingMetrics", + "properties": { + "effectiveTrainingDuration": { + "deprecated": true, + "description": "The effective time training used. If set, this is used for quota management and billing. Deprecated. AutoML BE doesn't use this. Don't set.", + "format": "google-duration", + "type": "string" + }, + "metricEntries": { + "description": "One entry per metric name. The values must be aggregated per metric name.", + "items": { + "$ref": "IntelligenceCloudAutomlXpsMetricEntry" + }, + "type": "array" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/aiplatform/v1/aiplatform-gen.go b/aiplatform/v1/aiplatform-gen.go index 6f11f3efd54..2cd4e67c836 100644 --- a/aiplatform/v1/aiplatform-gen.go +++ b/aiplatform/v1/aiplatform-gen.go @@ -198,6 +198,7 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs.ModelDeploymentMonitoringJobs = NewProjectsLocationsModelDeploymentMonitoringJobsService(s) rs.Models = NewProjectsLocationsModelsService(s) rs.NasJobs = NewProjectsLocationsNasJobsService(s) + rs.NotebookExecutionJobs = NewProjectsLocationsNotebookExecutionJobsService(s) rs.NotebookRuntimeTemplates = NewProjectsLocationsNotebookRuntimeTemplatesService(s) rs.NotebookRuntimes = NewProjectsLocationsNotebookRuntimesService(s) rs.Operations = NewProjectsLocationsOperationsService(s) @@ -250,6 +251,8 @@ type ProjectsLocationsService struct { NasJobs *ProjectsLocationsNasJobsService + NotebookExecutionJobs *ProjectsLocationsNotebookExecutionJobsService + NotebookRuntimeTemplates *ProjectsLocationsNotebookRuntimeTemplatesService NotebookRuntimes *ProjectsLocationsNotebookRuntimesService @@ -956,22 +959,67 @@ type ProjectsLocationsNasJobsNasTrialDetailsService struct { s *Service } +func NewProjectsLocationsNotebookExecutionJobsService(s *Service) *ProjectsLocationsNotebookExecutionJobsService { + rs := &ProjectsLocationsNotebookExecutionJobsService{s: s} + rs.Operations = NewProjectsLocationsNotebookExecutionJobsOperationsService(s) + return rs +} + +type ProjectsLocationsNotebookExecutionJobsService struct { + s *Service + + Operations *ProjectsLocationsNotebookExecutionJobsOperationsService +} + +func NewProjectsLocationsNotebookExecutionJobsOperationsService(s *Service) *ProjectsLocationsNotebookExecutionJobsOperationsService { + rs := &ProjectsLocationsNotebookExecutionJobsOperationsService{s: s} + return rs +} + +type ProjectsLocationsNotebookExecutionJobsOperationsService struct { + s *Service +} + func NewProjectsLocationsNotebookRuntimeTemplatesService(s *Service) *ProjectsLocationsNotebookRuntimeTemplatesService { rs := &ProjectsLocationsNotebookRuntimeTemplatesService{s: s} + rs.Operations = NewProjectsLocationsNotebookRuntimeTemplatesOperationsService(s) return rs } type ProjectsLocationsNotebookRuntimeTemplatesService struct { s *Service + + Operations *ProjectsLocationsNotebookRuntimeTemplatesOperationsService +} + +func NewProjectsLocationsNotebookRuntimeTemplatesOperationsService(s *Service) *ProjectsLocationsNotebookRuntimeTemplatesOperationsService { + rs := &ProjectsLocationsNotebookRuntimeTemplatesOperationsService{s: s} + return rs +} + +type ProjectsLocationsNotebookRuntimeTemplatesOperationsService struct { + s *Service } func NewProjectsLocationsNotebookRuntimesService(s *Service) *ProjectsLocationsNotebookRuntimesService { rs := &ProjectsLocationsNotebookRuntimesService{s: s} + rs.Operations = NewProjectsLocationsNotebookRuntimesOperationsService(s) return rs } type ProjectsLocationsNotebookRuntimesService struct { s *Service + + Operations *ProjectsLocationsNotebookRuntimesOperationsService +} + +func NewProjectsLocationsNotebookRuntimesOperationsService(s *Service) *ProjectsLocationsNotebookRuntimesOperationsService { + rs := &ProjectsLocationsNotebookRuntimesOperationsService{s: s} + return rs +} + +type ProjectsLocationsNotebookRuntimesOperationsService struct { + s *Service } func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { @@ -1298,6 +1346,8 @@ type CloudAiLargeModelsVisionGenerateVideoResponse struct { RaiMediaFilteredCount int64 `json:"raiMediaFilteredCount,omitempty"` // RaiMediaFilteredReasons: Returns rai failure reasons if any. RaiMediaFilteredReasons []string `json:"raiMediaFilteredReasons,omitempty"` + // ReportingMetrics: Billable prediction metrics. + ReportingMetrics *IntelligenceCloudAutomlXpsReportingMetrics `json:"reportingMetrics,omitempty"` // ForceSendFields is a list of field names (e.g. "GeneratedSamples") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -1465,6 +1515,11 @@ func (s *CloudAiLargeModelsVisionNamedBoundingBox) UnmarshalJSON(data []byte) er type CloudAiLargeModelsVisionRaiInfo struct { // DetectedLabels: The list of detected labels for different rai categories. DetectedLabels []*CloudAiLargeModelsVisionRaiInfoDetectedLabels `json:"detectedLabels,omitempty"` + // ModelName: The model name used to indexing into the RaiFilterConfig map. + // Would either be one of imagegeneration@002-006, imagen-3.0-... api endpoint + // names, or internal names used for mapping to different filter configs + // (genselfie, ai_watermark) than its api endpoint. + ModelName string `json:"modelName,omitempty"` // RaiCategories: List of rai categories' information to return RaiCategories []string `json:"raiCategories,omitempty"` // Scores: List of rai scores mapping to the rai categories. Rounded to 1 @@ -3517,6 +3572,8 @@ type GoogleCloudAiplatformV1Candidate struct { // was flagged for the prohibited contents. // "SPII" - The token generation was stopped as the response was flagged for // Sensitive Personally Identifiable Information (SPII) contents. + // "MALFORMED_FUNCTION_CALL" - The function call generated by the model is + // invalid. FinishReason string `json:"finishReason,omitempty"` // GroundingMetadata: Output only. Metadata specifies sources used to ground // generated content. @@ -5168,157 +5225,6 @@ func (s *GoogleCloudAiplatformV1Dataset) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudAiplatformV1DatasetDistribution: Distribution computed over a -// tuning dataset. -type GoogleCloudAiplatformV1DatasetDistribution struct { - // Buckets: Output only. Defines the histogram bucket. - Buckets []*GoogleCloudAiplatformV1DatasetDistributionDistributionBucket `json:"buckets,omitempty"` - // Max: Output only. The maximum of the population values. - Max float64 `json:"max,omitempty"` - // Mean: Output only. The arithmetic mean of the values in the population. - Mean float64 `json:"mean,omitempty"` - // Median: Output only. The median of the values in the population. - Median float64 `json:"median,omitempty"` - // Min: Output only. The minimum of the population values. - Min float64 `json:"min,omitempty"` - // P5: Output only. The 5th percentile of the values in the population. - P5 float64 `json:"p5,omitempty"` - // P95: Output only. The 95th percentile of the values in the population. - P95 float64 `json:"p95,omitempty"` - // Sum: Output only. Sum of a given population of values. - Sum float64 `json:"sum,omitempty"` - // ForceSendFields is a list of field names (e.g. "Buckets") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Buckets") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1DatasetDistribution) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1DatasetDistribution - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1DatasetDistribution) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1DatasetDistribution - var s1 struct { - Max gensupport.JSONFloat64 `json:"max"` - Mean gensupport.JSONFloat64 `json:"mean"` - Median gensupport.JSONFloat64 `json:"median"` - Min gensupport.JSONFloat64 `json:"min"` - P5 gensupport.JSONFloat64 `json:"p5"` - P95 gensupport.JSONFloat64 `json:"p95"` - Sum gensupport.JSONFloat64 `json:"sum"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Max = float64(s1.Max) - s.Mean = float64(s1.Mean) - s.Median = float64(s1.Median) - s.Min = float64(s1.Min) - s.P5 = float64(s1.P5) - s.P95 = float64(s1.P95) - s.Sum = float64(s1.Sum) - return nil -} - -// GoogleCloudAiplatformV1DatasetDistributionDistributionBucket: Dataset bucket -// used to create a histogram for the distribution given a population of -// values. -type GoogleCloudAiplatformV1DatasetDistributionDistributionBucket struct { - // Count: Output only. Number of values in the bucket. - Count int64 `json:"count,omitempty,string"` - // Left: Output only. Left bound of the bucket. - Left float64 `json:"left,omitempty"` - // Right: Output only. Right bound of the bucket. - Right float64 `json:"right,omitempty"` - // ForceSendFields is a list of field names (e.g. "Count") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Count") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1DatasetDistributionDistributionBucket) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1DatasetDistributionDistributionBucket - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1DatasetDistributionDistributionBucket) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1DatasetDistributionDistributionBucket - var s1 struct { - Left gensupport.JSONFloat64 `json:"left"` - Right gensupport.JSONFloat64 `json:"right"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Left = float64(s1.Left) - s.Right = float64(s1.Right) - return nil -} - -// GoogleCloudAiplatformV1DatasetStats: Statistics computed over a tuning -// dataset. -type GoogleCloudAiplatformV1DatasetStats struct { - // TotalBillableCharacterCount: Output only. Number of billable characters in - // the tuning dataset. - TotalBillableCharacterCount int64 `json:"totalBillableCharacterCount,omitempty,string"` - // TotalTuningCharacterCount: Output only. Number of tuning characters in the - // tuning dataset. - TotalTuningCharacterCount int64 `json:"totalTuningCharacterCount,omitempty,string"` - // TuningDatasetExampleCount: Output only. Number of examples in the tuning - // dataset. - TuningDatasetExampleCount int64 `json:"tuningDatasetExampleCount,omitempty,string"` - // TuningStepCount: Output only. Number of tuning steps for this Tuning Job. - TuningStepCount int64 `json:"tuningStepCount,omitempty,string"` - // UserDatasetExamples: Output only. Sample user messages in the training - // dataset uri. - UserDatasetExamples []*GoogleCloudAiplatformV1Content `json:"userDatasetExamples,omitempty"` - // UserInputTokenDistribution: Output only. Dataset distributions for the user - // input tokens. - UserInputTokenDistribution *GoogleCloudAiplatformV1DatasetDistribution `json:"userInputTokenDistribution,omitempty"` - // UserMessagePerExampleDistribution: Output only. Dataset distributions for - // the messages per example. - UserMessagePerExampleDistribution *GoogleCloudAiplatformV1DatasetDistribution `json:"userMessagePerExampleDistribution,omitempty"` - // UserOutputTokenDistribution: Output only. Dataset distributions for the user - // output tokens. - UserOutputTokenDistribution *GoogleCloudAiplatformV1DatasetDistribution `json:"userOutputTokenDistribution,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "TotalBillableCharacterCount") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields - // for more details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "TotalBillableCharacterCount") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1DatasetStats) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1DatasetStats - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1DatasetVersion: Describes the dataset version. type GoogleCloudAiplatformV1DatasetVersion struct { // BigQueryDatasetName: Output only. Name of the associated BigQuery dataset. @@ -6325,30 +6231,6 @@ func (s *GoogleCloudAiplatformV1DiskSpec) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudAiplatformV1DistillationDataStats: Statistics computed for -// datasets used for distillation. -type GoogleCloudAiplatformV1DistillationDataStats struct { - // TrainingDatasetStats: Output only. Statistics computed for the training - // dataset. - TrainingDatasetStats *GoogleCloudAiplatformV1DatasetStats `json:"trainingDatasetStats,omitempty"` - // ForceSendFields is a list of field names (e.g. "TrainingDatasetStats") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "TrainingDatasetStats") to include - // in API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1DistillationDataStats) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1DistillationDataStats - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1DoubleArray: A list of double values. type GoogleCloudAiplatformV1DoubleArray struct { // Values: A list of double values. @@ -16718,6 +16600,9 @@ type GoogleCloudAiplatformV1PipelineJob struct { Network string `json:"network,omitempty"` // PipelineSpec: The spec of the pipeline. PipelineSpec googleapi.RawMessage `json:"pipelineSpec,omitempty"` + // PreflightValidations: Optional. Whether to do component level validations + // before job creation. + PreflightValidations bool `json:"preflightValidations,omitempty"` // ReservedIpRanges: A list of names for the reserved ip ranges under the VPC // network that can be used for this Pipeline Job's workload. If set, we will // deploy the Pipeline Job's workload within the provided ip ranges. Otherwise, @@ -18749,34 +18634,6 @@ func (s *GoogleCloudAiplatformV1RebootPersistentResourceOperationMetadata) Marsh type GoogleCloudAiplatformV1RebootPersistentResourceRequest struct { } -// GoogleCloudAiplatformV1ReinforcementLearningDataStats: Statistics computed -// for datasets used for reinforcement learning. -type GoogleCloudAiplatformV1ReinforcementLearningDataStats struct { - // PreferenceDatasetStats: Output only. Statistics computed for the preference - // dataset. This can be either a human preference dataset or a preference - // dataset generated from AI feedback. - PreferenceDatasetStats *GoogleCloudAiplatformV1DatasetStats `json:"preferenceDatasetStats,omitempty"` - // PromptDatasetStats: Output only. Statistics computed for the prompt dataset - // used during reinforcement learning. - PromptDatasetStats *GoogleCloudAiplatformV1DatasetStats `json:"promptDatasetStats,omitempty"` - // ForceSendFields is a list of field names (e.g. "PreferenceDatasetStats") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PreferenceDatasetStats") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1ReinforcementLearningDataStats) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1ReinforcementLearningDataStats - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1RemoveContextChildrenRequest: Request message for // MetadataService.DeleteContextChildrenRequest. type GoogleCloudAiplatformV1RemoveContextChildrenRequest struct { @@ -28842,19 +28699,15 @@ func (s *GoogleCloudAiplatformV1TunedModel) MarshalJSON() ([]byte, error) { // GoogleCloudAiplatformV1TuningDataStats: The tuning data statistic values for // TuningJob. type GoogleCloudAiplatformV1TuningDataStats struct { - // DistillationDataStats: Statistics for distillation. - DistillationDataStats *GoogleCloudAiplatformV1DistillationDataStats `json:"distillationDataStats,omitempty"` - // ReinforcementLearningDataStats: Statistics for reinforcement learning. - ReinforcementLearningDataStats *GoogleCloudAiplatformV1ReinforcementLearningDataStats `json:"reinforcementLearningDataStats,omitempty"` // SupervisedTuningDataStats: The SFT Tuning data stats. SupervisedTuningDataStats *GoogleCloudAiplatformV1SupervisedTuningDataStats `json:"supervisedTuningDataStats,omitempty"` - // ForceSendFields is a list of field names (e.g. "DistillationDataStats") to - // unconditionally include in API requests. By default, fields with empty or + // ForceSendFields is a list of field names (e.g. "SupervisedTuningDataStats") + // to unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DistillationDataStats") to + // NullFields is a list of field names (e.g. "SupervisedTuningDataStats") to // include in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. @@ -30578,6 +30431,101 @@ func (s *GoogleTypeMoney) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +type IntelligenceCloudAutomlXpsMetricEntry struct { + // ArgentumMetricId: For billing metrics that are using legacy sku's, set the + // legacy billing metric id here. This will be sent to Chemist as the + // "cloudbilling.googleapis.com/argentum_metric_id" label. Otherwise leave + // empty. + ArgentumMetricId string `json:"argentumMetricId,omitempty"` + // DoubleValue: A double value. + DoubleValue float64 `json:"doubleValue,omitempty"` + // Int64Value: A signed 64-bit integer value. + Int64Value int64 `json:"int64Value,omitempty,string"` + // MetricName: The metric name defined in the service configuration. + MetricName string `json:"metricName,omitempty"` + // SystemLabels: Billing system labels for this (metric, value) pair. + SystemLabels []*IntelligenceCloudAutomlXpsMetricEntryLabel `json:"systemLabels,omitempty"` + // ForceSendFields is a list of field names (e.g. "ArgentumMetricId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ArgentumMetricId") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IntelligenceCloudAutomlXpsMetricEntry) MarshalJSON() ([]byte, error) { + type NoMethod IntelligenceCloudAutomlXpsMetricEntry + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *IntelligenceCloudAutomlXpsMetricEntry) UnmarshalJSON(data []byte) error { + type NoMethod IntelligenceCloudAutomlXpsMetricEntry + var s1 struct { + DoubleValue gensupport.JSONFloat64 `json:"doubleValue"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.DoubleValue = float64(s1.DoubleValue) + return nil +} + +type IntelligenceCloudAutomlXpsMetricEntryLabel struct { + // LabelName: The name of the label. + LabelName string `json:"labelName,omitempty"` + // LabelValue: The value of the label. + LabelValue string `json:"labelValue,omitempty"` + // ForceSendFields is a list of field names (e.g. "LabelName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LabelName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IntelligenceCloudAutomlXpsMetricEntryLabel) MarshalJSON() ([]byte, error) { + type NoMethod IntelligenceCloudAutomlXpsMetricEntryLabel + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type IntelligenceCloudAutomlXpsReportingMetrics struct { + // EffectiveTrainingDuration: The effective time training used. If set, this is + // used for quota management and billing. Deprecated. AutoML BE doesn't use + // this. Don't set. + EffectiveTrainingDuration string `json:"effectiveTrainingDuration,omitempty"` + // MetricEntries: One entry per metric name. The values must be aggregated per + // metric name. + MetricEntries []*IntelligenceCloudAutomlXpsMetricEntry `json:"metricEntries,omitempty"` + // ForceSendFields is a list of field names (e.g. "EffectiveTrainingDuration") + // to unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EffectiveTrainingDuration") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IntelligenceCloudAutomlXpsReportingMetrics) MarshalJSON() ([]byte, error) { + type NoMethod IntelligenceCloudAutomlXpsReportingMetrics + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + type ProjectsLocationsGetCall struct { s *Service name string @@ -70392,67 +70340,60 @@ func (c *ProjectsLocationsNasJobsNasTrialDetailsListCall) Pages(ctx context.Cont } } -type ProjectsLocationsNotebookRuntimeTemplatesCreateCall struct { - s *Service - parent string - googlecloudaiplatformv1notebookruntimetemplate *GoogleCloudAiplatformV1NotebookRuntimeTemplate - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookExecutionJobsOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a NotebookRuntimeTemplate. +// Cancel: Starts asynchronous cancellation on a long-running operation. The +// server makes a best effort to cancel the operation, but success is not +// guaranteed. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or +// other methods to check whether the cancellation succeeded or whether the +// operation completed despite cancellation. On successful cancellation, the +// operation is not deleted; instead, it becomes an operation with an +// Operation.error value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. // -// - parent: The resource name of the Location to create the -// NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Create(parent string, googlecloudaiplatformv1notebookruntimetemplate *GoogleCloudAiplatformV1NotebookRuntimeTemplate) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { - c := &ProjectsLocationsNotebookRuntimeTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudaiplatformv1notebookruntimetemplate = googlecloudaiplatformv1notebookruntimetemplate - return c -} - -// NotebookRuntimeTemplateId sets the optional parameter -// "notebookRuntimeTemplateId": User specified ID for the notebook runtime -// template. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) NotebookRuntimeTemplateId(notebookRuntimeTemplateId string) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { - c.urlParams_.Set("notebookRuntimeTemplateId", notebookRuntimeTemplateId) +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Cancel(name string) *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Header() http.Header { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1notebookruntimetemplate) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimeTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -70460,18 +70401,18 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt stri } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.create" call. +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.cancel" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -70490,7 +70431,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -70503,7 +70444,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googlea return ret, nil } -type ProjectsLocationsNotebookRuntimeTemplatesDeleteCall struct { +type ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -70511,14 +70452,14 @@ type ProjectsLocationsNotebookRuntimeTemplatesDeleteCall struct { header_ http.Header } -// Delete: Deletes a NotebookRuntimeTemplate. +// Delete: Deletes a long-running operation. This method indicates that the +// client is no longer interested in the operation result. It does not cancel +// the operation. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. // -// - name: The name of the NotebookRuntimeTemplate resource to be deleted. -// Format: -// `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook -// _runtime_template}`. -func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Delete(name string) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { - c := &ProjectsLocationsNotebookRuntimeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be deleted. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Delete(name string) *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -70526,27 +70467,27 @@ func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Delete(name string) * // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -70564,13 +70505,596 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.delete" call. +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookExecutionJobsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can use this +// method to poll the operation result at intervals as recommended by the API +// service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Get(name string) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.get" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookExecutionJobsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) List(name string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Filter(filter string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsNotebookExecutionJobsOperationsWaitCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Wait: Waits until the specified long-running operation is done or reaches at +// most a specified timeout, returning the latest state. If the operation is +// already done, the latest state is immediately returned. If the timeout +// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout +// is used. If the server does not support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort +// basis. It may return the latest state before the specified timeout +// (including immediately), meaning even an immediate response is no guarantee +// that the operation is done. +// +// - name: The name of the operation resource to wait on. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Wait(name string) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Timeout sets the optional parameter "timeout": The maximum duration to wait +// before timing out. If left blank, the wait will be at most the time +// permitted by the underlying HTTP/RPC protocol. If RPC context deadline is +// also specified, the shorter one will be used. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Timeout(timeout string) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c.urlParams_.Set("timeout", timeout) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.wait" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimeTemplatesCreateCall struct { + s *Service + parent string + googlecloudaiplatformv1notebookruntimetemplate *GoogleCloudAiplatformV1NotebookRuntimeTemplate + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a NotebookRuntimeTemplate. +// +// - parent: The resource name of the Location to create the +// NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Create(parent string, googlecloudaiplatformv1notebookruntimetemplate *GoogleCloudAiplatformV1NotebookRuntimeTemplate) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudaiplatformv1notebookruntimetemplate = googlecloudaiplatformv1notebookruntimetemplate + return c +} + +// NotebookRuntimeTemplateId sets the optional parameter +// "notebookRuntimeTemplateId": User specified ID for the notebook runtime +// template. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) NotebookRuntimeTemplateId(notebookRuntimeTemplateId string) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c.urlParams_.Set("notebookRuntimeTemplateId", notebookRuntimeTemplateId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1notebookruntimetemplate) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimeTemplates") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimeTemplatesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a NotebookRuntimeTemplate. +// +// - name: The name of the NotebookRuntimeTemplate resource to be deleted. +// Format: +// `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook +// _runtime_template}`. +func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Delete(name string) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -71338,61 +71862,60 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesTestIamPermissionsCall) Do(opt return ret, nil } -type ProjectsLocationsNotebookRuntimesAssignCall struct { - s *Service - parent string - googlecloudaiplatformv1assignnotebookruntimerequest *GoogleCloudAiplatformV1AssignNotebookRuntimeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Assign: Assigns a NotebookRuntime to a user for a particular Notebook file. -// This method will either returns an existing assignment or generates a new -// one. +// Cancel: Starts asynchronous cancellation on a long-running operation. The +// server makes a best effort to cancel the operation, but success is not +// guaranteed. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or +// other methods to check whether the cancellation succeeded or whether the +// operation completed despite cancellation. On successful cancellation, the +// operation is not deleted; instead, it becomes an operation with an +// Operation.error value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. // -// - parent: The resource name of the Location to get the NotebookRuntime -// assignment. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsNotebookRuntimesService) Assign(parent string, googlecloudaiplatformv1assignnotebookruntimerequest *GoogleCloudAiplatformV1AssignNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesAssignCall { - c := &ProjectsLocationsNotebookRuntimesAssignCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudaiplatformv1assignnotebookruntimerequest = googlecloudaiplatformv1assignnotebookruntimerequest +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Cancel(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesAssignCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesAssignCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1assignnotebookruntimerequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimes:assign") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -71400,18 +71923,18 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*ht } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.assign" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.cancel" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -71430,7 +71953,7 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -71443,7 +71966,7 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsNotebookRuntimesDeleteCall struct { +type ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -71451,14 +71974,14 @@ type ProjectsLocationsNotebookRuntimesDeleteCall struct { header_ http.Header } -// Delete: Deletes a NotebookRuntime. -// -// - name: The name of the NotebookRuntime resource to be deleted. Instead of -// checking whether the name is in valid NotebookRuntime resource name -// format, directly throw NotFound exception if there is no such -// NotebookRuntime in spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Delete(name string) *ProjectsLocationsNotebookRuntimesDeleteCall { - c := &ProjectsLocationsNotebookRuntimesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Delete: Deletes a long-running operation. This method indicates that the +// client is no longer interested in the operation result. It does not cancel +// the operation. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. +// +// - name: The name of the operation resource to be deleted. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Delete(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -71466,27 +71989,27 @@ func (r *ProjectsLocationsNotebookRuntimesService) Delete(name string) *Projects // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesDeleteCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesDeleteCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -71504,13 +72027,13 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.delete" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -71529,7 +72052,7 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -71542,7 +72065,7 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsNotebookRuntimesGetCall struct { +type ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -71551,14 +72074,13 @@ type ProjectsLocationsNotebookRuntimesGetCall struct { header_ http.Header } -// Get: Gets a NotebookRuntime. +// Get: Gets the latest state of a long-running operation. Clients can use this +// method to poll the operation result at intervals as recommended by the API +// service. // -// - name: The name of the NotebookRuntime resource. Instead of checking -// whether the name is in valid NotebookRuntime resource name format, -// directly throw NotFound exception if there is no such NotebookRuntime in -// spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Get(name string) *ProjectsLocationsNotebookRuntimesGetCall { - c := &ProjectsLocationsNotebookRuntimesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Get(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -71566,7 +72088,7 @@ func (r *ProjectsLocationsNotebookRuntimesService) Get(name string) *ProjectsLoc // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesGetCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -71574,27 +72096,27 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *ProjectsLocationsNotebookRuntimesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesGetCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesGetCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -71615,13 +72137,13 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.get" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudAiplatformV1NotebookRuntime.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1NotebookRuntime, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -71640,7 +72162,7 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudAiplatformV1NotebookRuntime{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -71653,88 +72175,49 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOpti return ret, nil } -type ProjectsLocationsNotebookRuntimesListCall struct { +type ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists NotebookRuntimes in a Location. +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. // -// - parent: The resource name of the Location from which to list the -// NotebookRuntimes. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsNotebookRuntimesService) List(parent string) *ProjectsLocationsNotebookRuntimesListCall { - c := &ProjectsLocationsNotebookRuntimesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) List(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// Filter sets the optional parameter "filter": An expression for filtering the -// results of the request. For field names both snake_case and camelCase are -// supported. * `notebookRuntime` supports = and !=. `notebookRuntime` -// represents the NotebookRuntime ID, i.e. the last segment of the -// NotebookRuntime's resource name. * `displayName` supports = and != and -// regex. * `notebookRuntimeTemplate` supports = and !=. -// `notebookRuntimeTemplate` represents the NotebookRuntimeTemplate ID, i.e. -// the last segment of the NotebookRuntimeTemplate's resource name. * -// `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, -// HEALTH_STATE_UNSPECIFIED]. * `runtimeState` supports = and !=. runtimeState -// enum: [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, -// STOPPED, BEING_UPGRADED, ERROR, INVALID]. * `runtimeUser` supports = and !=. -// * API version is UI only: `uiState` supports = and !=. uiState enum: -// [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, -// UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, -// UI_RESOURCE_STATE_CREATION_FAILED]. * `notebookRuntimeType` supports = and -// !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK]. Some examples: * -// `notebookRuntime="notebookRuntime123" * `displayName="myDisplayName" and -// `displayName=~"myDisplayNameRegex" * -// `notebookRuntimeTemplate="notebookRuntimeTemplate321" * -// `healthState=HEALTHY` * `runtimeState=RUNNING` * -// `runtimeUser="test@google.com" * `uiState=UI_RESOURCE_STATE_BEING_DELETED` -// * `notebookRuntimeType=USER_DEFINED` -func (c *ProjectsLocationsNotebookRuntimesListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimesListCall { +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.urlParams_.Set("filter", filter) return c } -// OrderBy sets the optional parameter "orderBy": A comma-separated list of -// fields to order by, sorted in ascending order. Use "desc" after a field name -// for descending. Supported fields: * `display_name` * `create_time` * -// `update_time` Example: `display_name, create_time desc`. -func (c *ProjectsLocationsNotebookRuntimesListCall) OrderBy(orderBy string) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - // PageSize sets the optional parameter "pageSize": The standard list page // size. -func (c *ProjectsLocationsNotebookRuntimesListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimesListCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list page -// token. Typically obtained via ListNotebookRuntimesResponse.next_page_token -// of the previous NotebookService.ListNotebookRuntimes call. -func (c *ProjectsLocationsNotebookRuntimesListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimesListCall { +// token. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ReadMask sets the optional parameter "readMask": Mask specifying which -// fields to read. -func (c *ProjectsLocationsNotebookRuntimesListCall) ReadMask(readMask string) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("readMask", readMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesListCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -71742,27 +72225,27 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *ProjectsLocationsNotebookRuntimesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesListCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesListCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesListCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -71770,7 +72253,7 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimes") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -71778,18 +72261,18 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.list" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudAiplatformV1ListNotebookRuntimesResponse.ServerResponse.Header -// or (if a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was because +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1ListNotebookRuntimesResponse, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -71808,7 +72291,7 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudAiplatformV1ListNotebookRuntimesResponse{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -71824,7 +72307,7 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOpt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsNotebookRuntimesListCall) Pages(ctx context.Context, f func(*GoogleCloudAiplatformV1ListNotebookRuntimesResponse) error) error { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -71842,61 +72325,174 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) Pages(ctx context.Context, f } } -type ProjectsLocationsNotebookRuntimesStartCall struct { - s *Service - name string - googlecloudaiplatformv1startnotebookruntimerequest *GoogleCloudAiplatformV1StartNotebookRuntimeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Start: Starts a NotebookRuntime. +// Wait: Waits until the specified long-running operation is done or reaches at +// most a specified timeout, returning the latest state. If the operation is +// already done, the latest state is immediately returned. If the timeout +// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout +// is used. If the server does not support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort +// basis. It may return the latest state before the specified timeout +// (including immediately), meaning even an immediate response is no guarantee +// that the operation is done. // -// - name: The name of the NotebookRuntime resource to be started. Instead of -// checking whether the name is in valid NotebookRuntime resource name -// format, directly throw NotFound exception if there is no such -// NotebookRuntime in spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Start(name string, googlecloudaiplatformv1startnotebookruntimerequest *GoogleCloudAiplatformV1StartNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesStartCall { - c := &ProjectsLocationsNotebookRuntimesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to wait on. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Wait(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudaiplatformv1startnotebookruntimerequest = googlecloudaiplatformv1startnotebookruntimerequest + return c +} + +// Timeout sets the optional parameter "timeout": The maximum duration to wait +// before timing out. If left blank, the wait will be at most the time +// permitted by the underlying HTTP/RPC protocol. If RPC context deadline is +// also specified, the shorter one will be used. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Timeout(timeout string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { + c.urlParams_.Set("timeout", timeout) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesStartCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesStartCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.wait" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesAssignCall struct { + s *Service + parent string + googlecloudaiplatformv1assignnotebookruntimerequest *GoogleCloudAiplatformV1AssignNotebookRuntimeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Assign: Assigns a NotebookRuntime to a user for a particular Notebook file. +// This method will either returns an existing assignment or generates a new +// one. +// +// - parent: The resource name of the Location to get the NotebookRuntime +// assignment. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsNotebookRuntimesService) Assign(parent string, googlecloudaiplatformv1assignnotebookruntimerequest *GoogleCloudAiplatformV1AssignNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesAssignCall { + c := &ProjectsLocationsNotebookRuntimesAssignCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudaiplatformv1assignnotebookruntimerequest = googlecloudaiplatformv1assignnotebookruntimerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesAssignCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesAssignCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1startnotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1assignnotebookruntimerequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:start") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimes:assign") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -71904,18 +72500,18 @@ func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*htt } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.start" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimes.assign" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -71947,63 +72543,168 @@ func (c *ProjectsLocationsNotebookRuntimesStartCall) Do(opts ...googleapi.CallOp return ret, nil } -type ProjectsLocationsNotebookRuntimesUpgradeCall struct { - s *Service - name string - googlecloudaiplatformv1upgradenotebookruntimerequest *GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Upgrade: Upgrades a NotebookRuntime. +// Delete: Deletes a NotebookRuntime. // -// - name: The name of the NotebookRuntime resource to be upgrade. Instead of +// - name: The name of the NotebookRuntime resource to be deleted. Instead of // checking whether the name is in valid NotebookRuntime resource name // format, directly throw NotFound exception if there is no such // NotebookRuntime in spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Upgrade(name string, googlecloudaiplatformv1upgradenotebookruntimerequest *GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesUpgradeCall { - c := &ProjectsLocationsNotebookRuntimesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsNotebookRuntimesService) Delete(name string) *ProjectsLocationsNotebookRuntimesDeleteCall { + c := &ProjectsLocationsNotebookRuntimesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudaiplatformv1upgradenotebookruntimerequest = googlecloudaiplatformv1upgradenotebookruntimerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesUpgradeCall { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesUpgradeCall { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1upgradenotebookruntimerequest) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { return nil, err } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a NotebookRuntime. +// +// - name: The name of the NotebookRuntime resource. Instead of checking +// whether the name is in valid NotebookRuntime resource name format, +// directly throw NotFound exception if there is no such NotebookRuntime in +// spanner. +func (r *ProjectsLocationsNotebookRuntimesService) Get(name string) *ProjectsLocationsNotebookRuntimesGetCall { + c := &ProjectsLocationsNotebookRuntimesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:upgrade") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -72014,13 +72715,988 @@ func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.upgrade" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *GoogleCloudAiplatformV1NotebookRuntime.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1NotebookRuntime, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudAiplatformV1NotebookRuntime{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists NotebookRuntimes in a Location. +// +// - parent: The resource name of the Location from which to list the +// NotebookRuntimes. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsNotebookRuntimesService) List(parent string) *ProjectsLocationsNotebookRuntimesListCall { + c := &ProjectsLocationsNotebookRuntimesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": An expression for filtering the +// results of the request. For field names both snake_case and camelCase are +// supported. * `notebookRuntime` supports = and !=. `notebookRuntime` +// represents the NotebookRuntime ID, i.e. the last segment of the +// NotebookRuntime's resource name. * `displayName` supports = and != and +// regex. * `notebookRuntimeTemplate` supports = and !=. +// `notebookRuntimeTemplate` represents the NotebookRuntimeTemplate ID, i.e. +// the last segment of the NotebookRuntimeTemplate's resource name. * +// `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, +// HEALTH_STATE_UNSPECIFIED]. * `runtimeState` supports = and !=. runtimeState +// enum: [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, +// STOPPED, BEING_UPGRADED, ERROR, INVALID]. * `runtimeUser` supports = and !=. +// * API version is UI only: `uiState` supports = and !=. uiState enum: +// [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, +// UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, +// UI_RESOURCE_STATE_CREATION_FAILED]. * `notebookRuntimeType` supports = and +// !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK]. Some examples: * +// `notebookRuntime="notebookRuntime123" * `displayName="myDisplayName" and +// `displayName=~"myDisplayNameRegex" * +// `notebookRuntimeTemplate="notebookRuntimeTemplate321" * +// `healthState=HEALTHY` * `runtimeState=RUNNING` * +// `runtimeUser="test@google.com" * `uiState=UI_RESOURCE_STATE_BEING_DELETED` +// * `notebookRuntimeType=USER_DEFINED` +func (c *ProjectsLocationsNotebookRuntimesListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list of +// fields to order by, sorted in ascending order. Use "desc" after a field name +// for descending. Supported fields: * `display_name` * `create_time` * +// `update_time` Example: `display_name, create_time desc`. +func (c *ProjectsLocationsNotebookRuntimesListCall) OrderBy(orderBy string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookRuntimesListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. Typically obtained via ListNotebookRuntimesResponse.next_page_token +// of the previous NotebookService.ListNotebookRuntimes call. +func (c *ProjectsLocationsNotebookRuntimesListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadMask sets the optional parameter "readMask": Mask specifying which +// fields to read. +func (c *ProjectsLocationsNotebookRuntimesListCall) ReadMask(readMask string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("readMask", readMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/notebookRuntimes") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudAiplatformV1ListNotebookRuntimesResponse.ServerResponse.Header +// or (if a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1ListNotebookRuntimesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudAiplatformV1ListNotebookRuntimesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookRuntimesListCall) Pages(ctx context.Context, f func(*GoogleCloudAiplatformV1ListNotebookRuntimesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsNotebookRuntimesStartCall struct { + s *Service + name string + googlecloudaiplatformv1startnotebookruntimerequest *GoogleCloudAiplatformV1StartNotebookRuntimeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Start: Starts a NotebookRuntime. +// +// - name: The name of the NotebookRuntime resource to be started. Instead of +// checking whether the name is in valid NotebookRuntime resource name +// format, directly throw NotFound exception if there is no such +// NotebookRuntime in spanner. +func (r *ProjectsLocationsNotebookRuntimesService) Start(name string, googlecloudaiplatformv1startnotebookruntimerequest *GoogleCloudAiplatformV1StartNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesStartCall { + c := &ProjectsLocationsNotebookRuntimesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudaiplatformv1startnotebookruntimerequest = googlecloudaiplatformv1startnotebookruntimerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesStartCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesStartCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1startnotebookruntimerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:start") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.start" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesUpgradeCall struct { + s *Service + name string + googlecloudaiplatformv1upgradenotebookruntimerequest *GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Upgrade: Upgrades a NotebookRuntime. +// +// - name: The name of the NotebookRuntime resource to be upgrade. Instead of +// checking whether the name is in valid NotebookRuntime resource name +// format, directly throw NotFound exception if there is no such +// NotebookRuntime in spanner. +func (r *ProjectsLocationsNotebookRuntimesService) Upgrade(name string, googlecloudaiplatformv1upgradenotebookruntimerequest *GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesUpgradeCall { + c := &ProjectsLocationsNotebookRuntimesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudaiplatformv1upgradenotebookruntimerequest = googlecloudaiplatformv1upgradenotebookruntimerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesUpgradeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesUpgradeCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1upgradenotebookruntimerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:upgrade") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.upgrade" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Cancel: Starts asynchronous cancellation on a long-running operation. The +// server makes a best effort to cancel the operation, but success is not +// guaranteed. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or +// other methods to check whether the cancellation succeeded or whether the +// operation completed despite cancellation. On successful cancellation, the +// operation is not deleted; instead, it becomes an operation with an +// Operation.error value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. +// +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Cancel(name string) *ProjectsLocationsNotebookRuntimesOperationsCancelCall { + c := &ProjectsLocationsNotebookRuntimesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsCancelCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsCancelCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.cancel" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a long-running operation. This method indicates that the +// client is no longer interested in the operation result. It does not cancel +// the operation. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. +// +// - name: The name of the operation resource to be deleted. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Delete(name string) *ProjectsLocationsNotebookRuntimesOperationsDeleteCall { + c := &ProjectsLocationsNotebookRuntimesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can use this +// method to poll the operation result at intervals as recommended by the API +// service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Get(name string) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c := &ProjectsLocationsNotebookRuntimesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) List(name string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c := &ProjectsLocationsNotebookRuntimesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsNotebookRuntimesOperationsWaitCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Wait: Waits until the specified long-running operation is done or reaches at +// most a specified timeout, returning the latest state. If the operation is +// already done, the latest state is immediately returned. If the timeout +// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout +// is used. If the server does not support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort +// basis. It may return the latest state before the specified timeout +// (including immediately), meaning even an immediate response is no guarantee +// that the operation is done. +// +// - name: The name of the operation resource to wait on. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Wait(name string) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c := &ProjectsLocationsNotebookRuntimesOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Timeout sets the optional parameter "timeout": The maximum duration to wait +// before timing out. If left blank, the wait will be at most the time +// permitted by the underlying HTTP/RPC protocol. If RPC context deadline is +// also specified, the shorter one will be used. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Timeout(timeout string) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c.urlParams_.Set("timeout", timeout) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:wait") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.wait" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { diff --git a/aiplatform/v1beta1/aiplatform-api.json b/aiplatform/v1beta1/aiplatform-api.json index c674703e5ae..aad686e8724 100644 --- a/aiplatform/v1beta1/aiplatform-api.json +++ b/aiplatform/v1beta1/aiplatform-api.json @@ -1125,7 +1125,7 @@ ], "parameters": { "name": { - "description": "Immutable. Identifier. The resource name of the cached content Format: projects/{project}/locations/{location}/cachedContents/{cached_content}", + "description": "Immutable. Identifier. The server-generated resource name of the cached content Format: projects/{project}/locations/{location}/cachedContents/{cached_content}", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/cachedContents/[^/]+$", "required": true, @@ -13748,6 +13748,159 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:cancel", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}", + "httpMethod": "DELETE", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta1/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "wait": { + "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs/{notebookExecutionJobsId}/operations/{operationsId}:wait", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookExecutionJobs.operations.wait", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to wait on.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + }, + "timeout": { + "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", + "format": "google-duration", + "location": "query", + "type": "string" + } + }, + "path": "v1beta1/{+name}:wait", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } }, "notebookRuntimeTemplates": { @@ -14011,6 +14164,159 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:cancel", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}", + "httpMethod": "DELETE", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta1/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "wait": { + "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimeTemplates/{notebookRuntimeTemplatesId}/operations/{operationsId}:wait", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimeTemplates.operations.wait", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to wait on.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + }, + "timeout": { + "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", + "format": "google-duration", + "location": "query", + "type": "string" + } + }, + "path": "v1beta1/{+name}:wait", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } }, "notebookRuntimes": { @@ -14257,6 +14563,159 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}:cancel", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}:cancel", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}", + "httpMethod": "DELETE", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations", + "httpMethod": "GET", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta1/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "wait": { + "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/notebookRuntimes/{notebookRuntimesId}/operations/{operationsId}:wait", + "httpMethod": "POST", + "id": "aiplatform.projects.locations.notebookRuntimes.operations.wait", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to wait on.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + }, + "timeout": { + "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", + "format": "google-duration", + "location": "query", + "type": "string" + } + }, + "path": "v1beta1/{+name}:wait", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } }, "operations": { @@ -19954,7 +20413,7 @@ } } }, - "revision": "20240609", + "revision": "20240618", "rootUrl": "https://aiplatform.googleapis.com/", "schemas": { "CloudAiLargeModelsVisionGenerateVideoResponse": { @@ -19979,6 +20438,10 @@ "type": "string" }, "type": "array" + }, + "reportingMetrics": { + "$ref": "IntelligenceCloudAutomlXpsReportingMetrics", + "description": "Billable prediction metrics." } }, "type": "object" @@ -20097,6 +20560,10 @@ }, "type": "array" }, + "modelName": { + "description": "The model name used to indexing into the RaiFilterConfig map. Would either be one of imagegeneration@002-006, imagen-3.0-... api endpoint names, or internal names used for mapping to different filter configs (genselfie, ai_watermark) than its api endpoint.", + "type": "string" + }, "raiCategories": { "description": "List of rai categories' information to return", "items": { @@ -21673,6 +22140,10 @@ "readOnly": true, "type": "string" }, + "displayName": { + "description": "Optional. Immutable. The user-generated meaningful display name of the cached content.", + "type": "string" + }, "expireTime": { "description": "Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.", "format": "google-datetime", @@ -21683,7 +22154,7 @@ "type": "string" }, "name": { - "description": "Immutable. Identifier. The resource name of the cached content Format: projects/{project}/locations/{location}/cachedContents/{cached_content}", + "description": "Immutable. Identifier. The server-generated resource name of the cached content Format: projects/{project}/locations/{location}/cachedContents/{cached_content}", "type": "string" }, "systemInstruction": { @@ -21793,7 +22264,8 @@ "OTHER", "BLOCKLIST", "PROHIBITED_CONTENT", - "SPII" + "SPII", + "MALFORMED_FUNCTION_CALL" ], "enumDescriptions": [ "The finish reason is unspecified.", @@ -21804,7 +22276,8 @@ "All other reasons that stopped the token generation", "The token generation was stopped as the response was flagged for the terms which are included from the terminology blocklist.", "The token generation was stopped as the response was flagged for the prohibited contents.", - "The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents." + "The token generation was stopped as the response was flagged for Sensitive Personally Identifiable Information (SPII) contents.", + "The function call generated by the model is invalid." ], "readOnly": true, "type": "string" @@ -23126,142 +23599,6 @@ }, "type": "object" }, - "GoogleCloudAiplatformV1beta1DatasetDistribution": { - "description": "Distribution computed over a tuning dataset.", - "id": "GoogleCloudAiplatformV1beta1DatasetDistribution", - "properties": { - "buckets": { - "description": "Output only. Defines the histogram bucket.", - "items": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket" - }, - "readOnly": true, - "type": "array" - }, - "max": { - "description": "Output only. The maximum of the population values.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "mean": { - "description": "Output only. The arithmetic mean of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "median": { - "description": "Output only. The median of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "min": { - "description": "Output only. The minimum of the population values.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "p5": { - "description": "Output only. The 5th percentile of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "p95": { - "description": "Output only. The 95th percentile of the values in the population.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "sum": { - "description": "Output only. Sum of a given population of values.", - "format": "double", - "readOnly": true, - "type": "number" - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket": { - "description": "Dataset bucket used to create a histogram for the distribution given a population of values.", - "id": "GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket", - "properties": { - "count": { - "description": "Output only. Number of values in the bucket.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "left": { - "description": "Output only. Left bound of the bucket.", - "format": "double", - "readOnly": true, - "type": "number" - }, - "right": { - "description": "Output only. Right bound of the bucket.", - "format": "double", - "readOnly": true, - "type": "number" - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1beta1DatasetStats": { - "description": "Statistics computed over a tuning dataset.", - "id": "GoogleCloudAiplatformV1beta1DatasetStats", - "properties": { - "totalBillableCharacterCount": { - "description": "Output only. Number of billable characters in the tuning dataset.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "totalTuningCharacterCount": { - "description": "Output only. Number of tuning characters in the tuning dataset.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "tuningDatasetExampleCount": { - "description": "Output only. Number of examples in the tuning dataset.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "tuningStepCount": { - "description": "Output only. Number of tuning steps for this Tuning Job.", - "format": "int64", - "readOnly": true, - "type": "string" - }, - "userDatasetExamples": { - "description": "Output only. Sample user messages in the training dataset uri.", - "items": { - "$ref": "GoogleCloudAiplatformV1beta1Content" - }, - "readOnly": true, - "type": "array" - }, - "userInputTokenDistribution": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetDistribution", - "description": "Output only. Dataset distributions for the user input tokens.", - "readOnly": true - }, - "userMessagePerExampleDistribution": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetDistribution", - "description": "Output only. Dataset distributions for the messages per example.", - "readOnly": true - }, - "userOutputTokenDistribution": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetDistribution", - "description": "Output only. Dataset distributions for the user output tokens.", - "readOnly": true - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1beta1DatasetVersion": { "description": "Describes the dataset version.", "id": "GoogleCloudAiplatformV1beta1DatasetVersion", @@ -23888,88 +24225,6 @@ }, "type": "object" }, - "GoogleCloudAiplatformV1beta1DistillationDataStats": { - "description": "Statistics computed for datasets used for distillation.", - "id": "GoogleCloudAiplatformV1beta1DistillationDataStats", - "properties": { - "trainingDatasetStats": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetStats", - "description": "Output only. Statistics computed for the training dataset.", - "readOnly": true - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1beta1DistillationHyperParameters": { - "description": "Hyperparameters for Distillation.", - "id": "GoogleCloudAiplatformV1beta1DistillationHyperParameters", - "properties": { - "adapterSize": { - "description": "Optional. Adapter size for distillation.", - "enum": [ - "ADAPTER_SIZE_UNSPECIFIED", - "ADAPTER_SIZE_ONE", - "ADAPTER_SIZE_FOUR", - "ADAPTER_SIZE_EIGHT", - "ADAPTER_SIZE_SIXTEEN" - ], - "enumDescriptions": [ - "Adapter size is unspecified.", - "Adapter size 1.", - "Adapter size 4.", - "Adapter size 8.", - "Adapter size 16." - ], - "type": "string" - }, - "epochCount": { - "description": "Optional. Number of complete passes the model makes over the entire training dataset during training.", - "format": "int64", - "type": "string" - }, - "learningRateMultiplier": { - "description": "Optional. Multiplier for adjusting the default learning rate.", - "format": "double", - "type": "number" - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1beta1DistillationSpec": { - "description": "Tuning Spec for Distillation.", - "id": "GoogleCloudAiplatformV1beta1DistillationSpec", - "properties": { - "baseTeacherModel": { - "description": "The base teacher model that is being distilled, e.g., \"gemini-1.0-pro-002\".", - "type": "string" - }, - "hyperParameters": { - "$ref": "GoogleCloudAiplatformV1beta1DistillationHyperParameters", - "description": "Optional. Hyperparameters for Distillation." - }, - "pipelineRootDirectory": { - "description": "Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts.", - "type": "string" - }, - "studentModel": { - "description": "The student model that is being tuned, e.g., \"google/gemma-2b-it\".", - "type": "string" - }, - "trainingDatasetUri": { - "description": "Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.", - "type": "string" - }, - "tunedTeacherModelSource": { - "description": "The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`.", - "type": "string" - }, - "validationDatasetUri": { - "description": "Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1beta1DoubleArray": { "description": "A list of double values.", "id": "GoogleCloudAiplatformV1beta1DoubleArray", @@ -27640,17 +27895,6 @@ }, "type": "object" }, - "GoogleCloudAiplatformV1beta1HumanFeedbackConfig": { - "description": "Configures Reinforcement Learning to use human feedback during tuning.", - "id": "GoogleCloudAiplatformV1beta1HumanFeedbackConfig", - "properties": { - "preferenceDatasetUri": { - "description": "Required. Cloud Storage path to human preference data.", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1beta1HyperparameterTuningJob": { "description": "Represents a HyperparameterTuningJob. A HyperparameterTuningJob has a Study specification and multiple CustomJobs with identical CustomJob specification.", "id": "GoogleCloudAiplatformV1beta1HyperparameterTuningJob", @@ -35290,6 +35534,11 @@ "text": { "description": "Optional. The query in text format to get relevant contexts.", "type": "string" + }, + "vectorDistanceThreshold": { + "description": "Optional. Only return contexts with vector distance smaller than the threshold.", + "format": "double", + "type": "number" } }, "type": "object" @@ -35652,72 +35901,6 @@ "properties": {}, "type": "object" }, - "GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats": { - "description": "Statistics computed for datasets used for reinforcement learning.", - "id": "GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats", - "properties": { - "preferenceDatasetStats": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetStats", - "description": "Output only. Statistics computed for the preference dataset. This can be either a human preference dataset or a preference dataset generated from AI feedback.", - "readOnly": true - }, - "promptDatasetStats": { - "$ref": "GoogleCloudAiplatformV1beta1DatasetStats", - "description": "Output only. Statistics computed for the prompt dataset used during reinforcement learning.", - "readOnly": true - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters": { - "description": "Hyperparameters for Reinforcement Learning.", - "id": "GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters", - "properties": { - "epochCount": { - "description": "Optional. Number of training epoches for the tuning job.", - "format": "int64", - "type": "string" - }, - "humanFeedbackConfig": { - "$ref": "GoogleCloudAiplatformV1beta1HumanFeedbackConfig", - "description": "Configures Reinforcement Learning to use human feedback for preference data during tuning." - }, - "klCoefficient": { - "description": "Optional. KL divergence coefficient for Reinforcement Learning.", - "format": "double", - "type": "number" - }, - "learningRateMultiplier": { - "description": "Optional. Learning rate multiplier for Reinforcement Learning.", - "format": "double", - "type": "number" - }, - "rewardModelTrainingConfig": { - "$ref": "GoogleCloudAiplatformV1beta1RewardModelTrainingConfig", - "description": "Configures Reinforcement Learning to train a reward model to learn preference." - } - }, - "type": "object" - }, - "GoogleCloudAiplatformV1beta1ReinforcementLearningSpec": { - "description": "Tuning Spec for Reinforcement Learning.", - "id": "GoogleCloudAiplatformV1beta1ReinforcementLearningSpec", - "properties": { - "hyperParameters": { - "$ref": "GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters", - "description": "Optional. Additional hyper-parameters to use during tuning." - }, - "promptDatasetUri": { - "description": "Required. Cloud Storage path to the prompt dataset to use during Reinforcement Learning.", - "type": "string" - }, - "validationDatasetUri": { - "description": "Optional. Cloud Storage path to the validation dataset to use during Reinforcement Learning.", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1beta1RemoveContextChildrenRequest": { "description": "Request message for MetadataService.DeleteContextChildrenRequest.", "id": "GoogleCloudAiplatformV1beta1RemoveContextChildrenRequest", @@ -36071,23 +36254,6 @@ }, "type": "object" }, - "GoogleCloudAiplatformV1beta1RewardModelTrainingConfig": { - "description": "Configures Reinforcement Learning to learn preference by training a reward model.", - "id": "GoogleCloudAiplatformV1beta1RewardModelTrainingConfig", - "properties": { - "epochCount": { - "description": "Optional. Number of training epoches for the reward model training job.", - "format": "int64", - "type": "string" - }, - "learningRateMultiplier": { - "description": "Optional. Learning rate multiplier for reward model training.", - "format": "double", - "type": "number" - } - }, - "type": "object" - }, "GoogleCloudAiplatformV1beta1RougeInput": { "description": "Input for rouge metric.", "id": "GoogleCloudAiplatformV1beta1RougeInput", @@ -43372,14 +43538,6 @@ "description": "The tuning data statistic values for TuningJob.", "id": "GoogleCloudAiplatformV1beta1TuningDataStats", "properties": { - "distillationDataStats": { - "$ref": "GoogleCloudAiplatformV1beta1DistillationDataStats", - "description": "Statistics for distillation." - }, - "reinforcementLearningDataStats": { - "$ref": "GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats", - "description": "Statistics for reinforcement learning." - }, "supervisedTuningDataStats": { "$ref": "GoogleCloudAiplatformV1beta1SupervisedTuningDataStats", "description": "The SFT Tuning data stats." @@ -43405,10 +43563,6 @@ "description": "Optional. The description of the TuningJob.", "type": "string" }, - "distillationSpec": { - "$ref": "GoogleCloudAiplatformV1beta1DistillationSpec", - "description": "Tuning Spec for Distillation." - }, "encryptionSpec": { "$ref": "GoogleCloudAiplatformV1beta1EncryptionSpec", "description": "Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key." @@ -43446,10 +43600,6 @@ "readOnly": true, "type": "string" }, - "reinforcementLearningSpec": { - "$ref": "GoogleCloudAiplatformV1beta1ReinforcementLearningSpec", - "description": "Tuning Spec for Reinforcement Learning." - }, "startTime": { "description": "Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.", "format": "google-datetime", @@ -44530,6 +44680,70 @@ } }, "type": "object" + }, + "IntelligenceCloudAutomlXpsMetricEntry": { + "id": "IntelligenceCloudAutomlXpsMetricEntry", + "properties": { + "argentumMetricId": { + "description": "For billing metrics that are using legacy sku's, set the legacy billing metric id here. This will be sent to Chemist as the \"cloudbilling.googleapis.com/argentum_metric_id\" label. Otherwise leave empty.", + "type": "string" + }, + "doubleValue": { + "description": "A double value.", + "format": "double", + "type": "number" + }, + "int64Value": { + "description": "A signed 64-bit integer value.", + "format": "int64", + "type": "string" + }, + "metricName": { + "description": "The metric name defined in the service configuration.", + "type": "string" + }, + "systemLabels": { + "description": "Billing system labels for this (metric, value) pair.", + "items": { + "$ref": "IntelligenceCloudAutomlXpsMetricEntryLabel" + }, + "type": "array" + } + }, + "type": "object" + }, + "IntelligenceCloudAutomlXpsMetricEntryLabel": { + "id": "IntelligenceCloudAutomlXpsMetricEntryLabel", + "properties": { + "labelName": { + "description": "The name of the label.", + "type": "string" + }, + "labelValue": { + "description": "The value of the label.", + "type": "string" + } + }, + "type": "object" + }, + "IntelligenceCloudAutomlXpsReportingMetrics": { + "id": "IntelligenceCloudAutomlXpsReportingMetrics", + "properties": { + "effectiveTrainingDuration": { + "deprecated": true, + "description": "The effective time training used. If set, this is used for quota management and billing. Deprecated. AutoML BE doesn't use this. Don't set.", + "format": "google-duration", + "type": "string" + }, + "metricEntries": { + "description": "One entry per metric name. The values must be aggregated per metric name.", + "items": { + "$ref": "IntelligenceCloudAutomlXpsMetricEntry" + }, + "type": "array" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/aiplatform/v1beta1/aiplatform-gen.go b/aiplatform/v1beta1/aiplatform-gen.go index 4f5024498b4..d8bbad73a6a 100644 --- a/aiplatform/v1beta1/aiplatform-gen.go +++ b/aiplatform/v1beta1/aiplatform-gen.go @@ -1210,29 +1210,65 @@ type ProjectsLocationsNasJobsNasTrialDetailsService struct { func NewProjectsLocationsNotebookExecutionJobsService(s *Service) *ProjectsLocationsNotebookExecutionJobsService { rs := &ProjectsLocationsNotebookExecutionJobsService{s: s} + rs.Operations = NewProjectsLocationsNotebookExecutionJobsOperationsService(s) return rs } type ProjectsLocationsNotebookExecutionJobsService struct { s *Service + + Operations *ProjectsLocationsNotebookExecutionJobsOperationsService +} + +func NewProjectsLocationsNotebookExecutionJobsOperationsService(s *Service) *ProjectsLocationsNotebookExecutionJobsOperationsService { + rs := &ProjectsLocationsNotebookExecutionJobsOperationsService{s: s} + return rs +} + +type ProjectsLocationsNotebookExecutionJobsOperationsService struct { + s *Service } func NewProjectsLocationsNotebookRuntimeTemplatesService(s *Service) *ProjectsLocationsNotebookRuntimeTemplatesService { rs := &ProjectsLocationsNotebookRuntimeTemplatesService{s: s} + rs.Operations = NewProjectsLocationsNotebookRuntimeTemplatesOperationsService(s) return rs } type ProjectsLocationsNotebookRuntimeTemplatesService struct { s *Service + + Operations *ProjectsLocationsNotebookRuntimeTemplatesOperationsService +} + +func NewProjectsLocationsNotebookRuntimeTemplatesOperationsService(s *Service) *ProjectsLocationsNotebookRuntimeTemplatesOperationsService { + rs := &ProjectsLocationsNotebookRuntimeTemplatesOperationsService{s: s} + return rs +} + +type ProjectsLocationsNotebookRuntimeTemplatesOperationsService struct { + s *Service } func NewProjectsLocationsNotebookRuntimesService(s *Service) *ProjectsLocationsNotebookRuntimesService { rs := &ProjectsLocationsNotebookRuntimesService{s: s} + rs.Operations = NewProjectsLocationsNotebookRuntimesOperationsService(s) return rs } type ProjectsLocationsNotebookRuntimesService struct { s *Service + + Operations *ProjectsLocationsNotebookRuntimesOperationsService +} + +func NewProjectsLocationsNotebookRuntimesOperationsService(s *Service) *ProjectsLocationsNotebookRuntimesOperationsService { + rs := &ProjectsLocationsNotebookRuntimesOperationsService{s: s} + return rs +} + +type ProjectsLocationsNotebookRuntimesOperationsService struct { + s *Service } func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { @@ -1634,6 +1670,8 @@ type CloudAiLargeModelsVisionGenerateVideoResponse struct { RaiMediaFilteredCount int64 `json:"raiMediaFilteredCount,omitempty"` // RaiMediaFilteredReasons: Returns rai failure reasons if any. RaiMediaFilteredReasons []string `json:"raiMediaFilteredReasons,omitempty"` + // ReportingMetrics: Billable prediction metrics. + ReportingMetrics *IntelligenceCloudAutomlXpsReportingMetrics `json:"reportingMetrics,omitempty"` // ForceSendFields is a list of field names (e.g. "GeneratedSamples") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -1801,6 +1839,11 @@ func (s *CloudAiLargeModelsVisionNamedBoundingBox) UnmarshalJSON(data []byte) er type CloudAiLargeModelsVisionRaiInfo struct { // DetectedLabels: The list of detected labels for different rai categories. DetectedLabels []*CloudAiLargeModelsVisionRaiInfoDetectedLabels `json:"detectedLabels,omitempty"` + // ModelName: The model name used to indexing into the RaiFilterConfig map. + // Would either be one of imagegeneration@002-006, imagen-3.0-... api endpoint + // names, or internal names used for mapping to different filter configs + // (genselfie, ai_watermark) than its api endpoint. + ModelName string `json:"modelName,omitempty"` // RaiCategories: List of rai categories' information to return RaiCategories []string `json:"raiCategories,omitempty"` // Scores: List of rai scores mapping to the rai categories. Rounded to 1 @@ -4198,6 +4241,9 @@ type GoogleCloudAiplatformV1beta1CachedContent struct { Contents []*GoogleCloudAiplatformV1beta1Content `json:"contents,omitempty"` // CreateTime: Output only. Creatation time of the cache entry. CreateTime string `json:"createTime,omitempty"` + // DisplayName: Optional. Immutable. The user-generated meaningful display name + // of the cached content. + DisplayName string `json:"displayName,omitempty"` // ExpireTime: Timestamp of when this resource is considered expired. This is // *always* provided on output, regardless of what was sent on input. ExpireTime string `json:"expireTime,omitempty"` @@ -4205,7 +4251,8 @@ type GoogleCloudAiplatformV1beta1CachedContent struct { // Format: // projects/{project}/locations/{location}/publishers/{publisher}/models/{model} Model string `json:"model,omitempty"` - // Name: Immutable. Identifier. The resource name of the cached content Format: + // Name: Immutable. Identifier. The server-generated resource name of the + // cached content Format: // projects/{project}/locations/{location}/cachedContents/{cached_content} Name string `json:"name,omitempty"` // SystemInstruction: Optional. Input only. Immutable. Developer set system @@ -4313,6 +4360,8 @@ type GoogleCloudAiplatformV1beta1Candidate struct { // was flagged for the prohibited contents. // "SPII" - The token generation was stopped as the response was flagged for // Sensitive Personally Identifiable Information (SPII) contents. + // "MALFORMED_FUNCTION_CALL" - The function call generated by the model is + // invalid. FinishReason string `json:"finishReason,omitempty"` // GroundingMetadata: Output only. Metadata specifies sources used to ground // generated content. @@ -6232,157 +6281,6 @@ func (s *GoogleCloudAiplatformV1beta1Dataset) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudAiplatformV1beta1DatasetDistribution: Distribution computed over -// a tuning dataset. -type GoogleCloudAiplatformV1beta1DatasetDistribution struct { - // Buckets: Output only. Defines the histogram bucket. - Buckets []*GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket `json:"buckets,omitempty"` - // Max: Output only. The maximum of the population values. - Max float64 `json:"max,omitempty"` - // Mean: Output only. The arithmetic mean of the values in the population. - Mean float64 `json:"mean,omitempty"` - // Median: Output only. The median of the values in the population. - Median float64 `json:"median,omitempty"` - // Min: Output only. The minimum of the population values. - Min float64 `json:"min,omitempty"` - // P5: Output only. The 5th percentile of the values in the population. - P5 float64 `json:"p5,omitempty"` - // P95: Output only. The 95th percentile of the values in the population. - P95 float64 `json:"p95,omitempty"` - // Sum: Output only. Sum of a given population of values. - Sum float64 `json:"sum,omitempty"` - // ForceSendFields is a list of field names (e.g. "Buckets") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Buckets") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1DatasetDistribution) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1DatasetDistribution - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1beta1DatasetDistribution) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1beta1DatasetDistribution - var s1 struct { - Max gensupport.JSONFloat64 `json:"max"` - Mean gensupport.JSONFloat64 `json:"mean"` - Median gensupport.JSONFloat64 `json:"median"` - Min gensupport.JSONFloat64 `json:"min"` - P5 gensupport.JSONFloat64 `json:"p5"` - P95 gensupport.JSONFloat64 `json:"p95"` - Sum gensupport.JSONFloat64 `json:"sum"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Max = float64(s1.Max) - s.Mean = float64(s1.Mean) - s.Median = float64(s1.Median) - s.Min = float64(s1.Min) - s.P5 = float64(s1.P5) - s.P95 = float64(s1.P95) - s.Sum = float64(s1.Sum) - return nil -} - -// GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket: Dataset -// bucket used to create a histogram for the distribution given a population of -// values. -type GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket struct { - // Count: Output only. Number of values in the bucket. - Count int64 `json:"count,omitempty,string"` - // Left: Output only. Left bound of the bucket. - Left float64 `json:"left,omitempty"` - // Right: Output only. Right bound of the bucket. - Right float64 `json:"right,omitempty"` - // ForceSendFields is a list of field names (e.g. "Count") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Count") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1beta1DatasetDistributionDistributionBucket - var s1 struct { - Left gensupport.JSONFloat64 `json:"left"` - Right gensupport.JSONFloat64 `json:"right"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Left = float64(s1.Left) - s.Right = float64(s1.Right) - return nil -} - -// GoogleCloudAiplatformV1beta1DatasetStats: Statistics computed over a tuning -// dataset. -type GoogleCloudAiplatformV1beta1DatasetStats struct { - // TotalBillableCharacterCount: Output only. Number of billable characters in - // the tuning dataset. - TotalBillableCharacterCount int64 `json:"totalBillableCharacterCount,omitempty,string"` - // TotalTuningCharacterCount: Output only. Number of tuning characters in the - // tuning dataset. - TotalTuningCharacterCount int64 `json:"totalTuningCharacterCount,omitempty,string"` - // TuningDatasetExampleCount: Output only. Number of examples in the tuning - // dataset. - TuningDatasetExampleCount int64 `json:"tuningDatasetExampleCount,omitempty,string"` - // TuningStepCount: Output only. Number of tuning steps for this Tuning Job. - TuningStepCount int64 `json:"tuningStepCount,omitempty,string"` - // UserDatasetExamples: Output only. Sample user messages in the training - // dataset uri. - UserDatasetExamples []*GoogleCloudAiplatformV1beta1Content `json:"userDatasetExamples,omitempty"` - // UserInputTokenDistribution: Output only. Dataset distributions for the user - // input tokens. - UserInputTokenDistribution *GoogleCloudAiplatformV1beta1DatasetDistribution `json:"userInputTokenDistribution,omitempty"` - // UserMessagePerExampleDistribution: Output only. Dataset distributions for - // the messages per example. - UserMessagePerExampleDistribution *GoogleCloudAiplatformV1beta1DatasetDistribution `json:"userMessagePerExampleDistribution,omitempty"` - // UserOutputTokenDistribution: Output only. Dataset distributions for the user - // output tokens. - UserOutputTokenDistribution *GoogleCloudAiplatformV1beta1DatasetDistribution `json:"userOutputTokenDistribution,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "TotalBillableCharacterCount") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields - // for more details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "TotalBillableCharacterCount") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1DatasetStats) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1DatasetStats - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1beta1DatasetVersion: Describes the dataset version. type GoogleCloudAiplatformV1beta1DatasetVersion struct { // BigQueryDatasetName: Output only. Name of the associated BigQuery dataset. @@ -7416,122 +7314,6 @@ func (s *GoogleCloudAiplatformV1beta1DiskSpec) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudAiplatformV1beta1DistillationDataStats: Statistics computed for -// datasets used for distillation. -type GoogleCloudAiplatformV1beta1DistillationDataStats struct { - // TrainingDatasetStats: Output only. Statistics computed for the training - // dataset. - TrainingDatasetStats *GoogleCloudAiplatformV1beta1DatasetStats `json:"trainingDatasetStats,omitempty"` - // ForceSendFields is a list of field names (e.g. "TrainingDatasetStats") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "TrainingDatasetStats") to include - // in API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1DistillationDataStats) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1DistillationDataStats - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudAiplatformV1beta1DistillationHyperParameters: Hyperparameters for -// Distillation. -type GoogleCloudAiplatformV1beta1DistillationHyperParameters struct { - // AdapterSize: Optional. Adapter size for distillation. - // - // Possible values: - // "ADAPTER_SIZE_UNSPECIFIED" - Adapter size is unspecified. - // "ADAPTER_SIZE_ONE" - Adapter size 1. - // "ADAPTER_SIZE_FOUR" - Adapter size 4. - // "ADAPTER_SIZE_EIGHT" - Adapter size 8. - // "ADAPTER_SIZE_SIXTEEN" - Adapter size 16. - AdapterSize string `json:"adapterSize,omitempty"` - // EpochCount: Optional. Number of complete passes the model makes over the - // entire training dataset during training. - EpochCount int64 `json:"epochCount,omitempty,string"` - // LearningRateMultiplier: Optional. Multiplier for adjusting the default - // learning rate. - LearningRateMultiplier float64 `json:"learningRateMultiplier,omitempty"` - // ForceSendFields is a list of field names (e.g. "AdapterSize") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AdapterSize") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1DistillationHyperParameters) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1DistillationHyperParameters - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1beta1DistillationHyperParameters) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1beta1DistillationHyperParameters - var s1 struct { - LearningRateMultiplier gensupport.JSONFloat64 `json:"learningRateMultiplier"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.LearningRateMultiplier = float64(s1.LearningRateMultiplier) - return nil -} - -// GoogleCloudAiplatformV1beta1DistillationSpec: Tuning Spec for Distillation. -type GoogleCloudAiplatformV1beta1DistillationSpec struct { - // BaseTeacherModel: The base teacher model that is being distilled, e.g., - // "gemini-1.0-pro-002". - BaseTeacherModel string `json:"baseTeacherModel,omitempty"` - // HyperParameters: Optional. Hyperparameters for Distillation. - HyperParameters *GoogleCloudAiplatformV1beta1DistillationHyperParameters `json:"hyperParameters,omitempty"` - // PipelineRootDirectory: Required. A path in a Cloud Storage bucket, which - // will be treated as the root output directory of the distillation pipeline. - // It is used by the system to generate the paths of output artifacts. - PipelineRootDirectory string `json:"pipelineRootDirectory,omitempty"` - // StudentModel: The student model that is being tuned, e.g., - // "google/gemma-2b-it". - StudentModel string `json:"studentModel,omitempty"` - // TrainingDatasetUri: Required. Cloud Storage path to file containing training - // dataset for tuning. The dataset must be formatted as a JSONL file. - TrainingDatasetUri string `json:"trainingDatasetUri,omitempty"` - // TunedTeacherModelSource: The resource name of the Tuned teacher model. - // Format: `projects/{project}/locations/{location}/models/{model}`. - TunedTeacherModelSource string `json:"tunedTeacherModelSource,omitempty"` - // ValidationDatasetUri: Optional. Cloud Storage path to file containing - // validation dataset for tuning. The dataset must be formatted as a JSONL - // file. - ValidationDatasetUri string `json:"validationDatasetUri,omitempty"` - // ForceSendFields is a list of field names (e.g. "BaseTeacherModel") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BaseTeacherModel") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1DistillationSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1DistillationSpec - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1beta1DoubleArray: A list of double values. type GoogleCloudAiplatformV1beta1DoubleArray struct { // Values: A list of double values. @@ -12850,29 +12632,6 @@ func (s *GoogleCloudAiplatformV1beta1GroundingMetadata) MarshalJSON() ([]byte, e return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudAiplatformV1beta1HumanFeedbackConfig: Configures Reinforcement -// Learning to use human feedback during tuning. -type GoogleCloudAiplatformV1beta1HumanFeedbackConfig struct { - // PreferenceDatasetUri: Required. Cloud Storage path to human preference data. - PreferenceDatasetUri string `json:"preferenceDatasetUri,omitempty"` - // ForceSendFields is a list of field names (e.g. "PreferenceDatasetUri") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PreferenceDatasetUri") to include - // in API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1HumanFeedbackConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1HumanFeedbackConfig - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1beta1HyperparameterTuningJob: Represents a // HyperparameterTuningJob. A HyperparameterTuningJob has a Study specification // and multiple CustomJobs with identical CustomJob specification. @@ -23415,6 +23174,9 @@ type GoogleCloudAiplatformV1beta1RagQuery struct { SimilarityTopK int64 `json:"similarityTopK,omitempty"` // Text: Optional. The query in text format to get relevant contexts. Text string `json:"text,omitempty"` + // VectorDistanceThreshold: Optional. Only return contexts with vector distance + // smaller than the threshold. + VectorDistanceThreshold float64 `json:"vectorDistanceThreshold,omitempty"` // ForceSendFields is a list of field names (e.g. "SimilarityTopK") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -23433,6 +23195,20 @@ func (s *GoogleCloudAiplatformV1beta1RagQuery) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +func (s *GoogleCloudAiplatformV1beta1RagQuery) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudAiplatformV1beta1RagQuery + var s1 struct { + VectorDistanceThreshold gensupport.JSONFloat64 `json:"vectorDistanceThreshold"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.VectorDistanceThreshold = float64(s1.VectorDistanceThreshold) + return nil +} + // GoogleCloudAiplatformV1beta1RawPredictRequest: Request message for // PredictionService.RawPredict. type GoogleCloudAiplatformV1beta1RawPredictRequest struct { @@ -24033,114 +23809,6 @@ func (s *GoogleCloudAiplatformV1beta1RebootPersistentResourceOperationMetadata) type GoogleCloudAiplatformV1beta1RebootPersistentResourceRequest struct { } -// GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats: Statistics -// computed for datasets used for reinforcement learning. -type GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats struct { - // PreferenceDatasetStats: Output only. Statistics computed for the preference - // dataset. This can be either a human preference dataset or a preference - // dataset generated from AI feedback. - PreferenceDatasetStats *GoogleCloudAiplatformV1beta1DatasetStats `json:"preferenceDatasetStats,omitempty"` - // PromptDatasetStats: Output only. Statistics computed for the prompt dataset - // used during reinforcement learning. - PromptDatasetStats *GoogleCloudAiplatformV1beta1DatasetStats `json:"promptDatasetStats,omitempty"` - // ForceSendFields is a list of field names (e.g. "PreferenceDatasetStats") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PreferenceDatasetStats") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters: -// Hyperparameters for Reinforcement Learning. -type GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters struct { - // EpochCount: Optional. Number of training epoches for the tuning job. - EpochCount int64 `json:"epochCount,omitempty,string"` - // HumanFeedbackConfig: Configures Reinforcement Learning to use human feedback - // for preference data during tuning. - HumanFeedbackConfig *GoogleCloudAiplatformV1beta1HumanFeedbackConfig `json:"humanFeedbackConfig,omitempty"` - // KlCoefficient: Optional. KL divergence coefficient for Reinforcement - // Learning. - KlCoefficient float64 `json:"klCoefficient,omitempty"` - // LearningRateMultiplier: Optional. Learning rate multiplier for Reinforcement - // Learning. - LearningRateMultiplier float64 `json:"learningRateMultiplier,omitempty"` - // RewardModelTrainingConfig: Configures Reinforcement Learning to train a - // reward model to learn preference. - RewardModelTrainingConfig *GoogleCloudAiplatformV1beta1RewardModelTrainingConfig `json:"rewardModelTrainingConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "EpochCount") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EpochCount") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters - var s1 struct { - KlCoefficient gensupport.JSONFloat64 `json:"klCoefficient"` - LearningRateMultiplier gensupport.JSONFloat64 `json:"learningRateMultiplier"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.KlCoefficient = float64(s1.KlCoefficient) - s.LearningRateMultiplier = float64(s1.LearningRateMultiplier) - return nil -} - -// GoogleCloudAiplatformV1beta1ReinforcementLearningSpec: Tuning Spec for -// Reinforcement Learning. -type GoogleCloudAiplatformV1beta1ReinforcementLearningSpec struct { - // HyperParameters: Optional. Additional hyper-parameters to use during tuning. - HyperParameters *GoogleCloudAiplatformV1beta1ReinforcementLearningHyperParameters `json:"hyperParameters,omitempty"` - // PromptDatasetUri: Required. Cloud Storage path to the prompt dataset to use - // during Reinforcement Learning. - PromptDatasetUri string `json:"promptDatasetUri,omitempty"` - // ValidationDatasetUri: Optional. Cloud Storage path to the validation dataset - // to use during Reinforcement Learning. - ValidationDatasetUri string `json:"validationDatasetUri,omitempty"` - // ForceSendFields is a list of field names (e.g. "HyperParameters") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "HyperParameters") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1ReinforcementLearningSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1ReinforcementLearningSpec - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudAiplatformV1beta1RemoveContextChildrenRequest: Request message // for MetadataService.DeleteContextChildrenRequest. type GoogleCloudAiplatformV1beta1RemoveContextChildrenRequest struct { @@ -24684,47 +24352,6 @@ func (s *GoogleCloudAiplatformV1beta1RetrieveContextsResponse) MarshalJSON() ([] return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudAiplatformV1beta1RewardModelTrainingConfig: Configures -// Reinforcement Learning to learn preference by training a reward model. -type GoogleCloudAiplatformV1beta1RewardModelTrainingConfig struct { - // EpochCount: Optional. Number of training epoches for the reward model - // training job. - EpochCount int64 `json:"epochCount,omitempty,string"` - // LearningRateMultiplier: Optional. Learning rate multiplier for reward model - // training. - LearningRateMultiplier float64 `json:"learningRateMultiplier,omitempty"` - // ForceSendFields is a list of field names (e.g. "EpochCount") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EpochCount") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudAiplatformV1beta1RewardModelTrainingConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudAiplatformV1beta1RewardModelTrainingConfig - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudAiplatformV1beta1RewardModelTrainingConfig) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudAiplatformV1beta1RewardModelTrainingConfig - var s1 struct { - LearningRateMultiplier gensupport.JSONFloat64 `json:"learningRateMultiplier"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.LearningRateMultiplier = float64(s1.LearningRateMultiplier) - return nil -} - // GoogleCloudAiplatformV1beta1RougeInput: Input for rouge metric. type GoogleCloudAiplatformV1beta1RougeInput struct { // Instances: Required. Repeated rouge instances. @@ -35957,19 +35584,15 @@ func (s *GoogleCloudAiplatformV1beta1TunedModel) MarshalJSON() ([]byte, error) { // GoogleCloudAiplatformV1beta1TuningDataStats: The tuning data statistic // values for TuningJob. type GoogleCloudAiplatformV1beta1TuningDataStats struct { - // DistillationDataStats: Statistics for distillation. - DistillationDataStats *GoogleCloudAiplatformV1beta1DistillationDataStats `json:"distillationDataStats,omitempty"` - // ReinforcementLearningDataStats: Statistics for reinforcement learning. - ReinforcementLearningDataStats *GoogleCloudAiplatformV1beta1ReinforcementLearningDataStats `json:"reinforcementLearningDataStats,omitempty"` // SupervisedTuningDataStats: The SFT Tuning data stats. SupervisedTuningDataStats *GoogleCloudAiplatformV1beta1SupervisedTuningDataStats `json:"supervisedTuningDataStats,omitempty"` - // ForceSendFields is a list of field names (e.g. "DistillationDataStats") to - // unconditionally include in API requests. By default, fields with empty or + // ForceSendFields is a list of field names (e.g. "SupervisedTuningDataStats") + // to unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DistillationDataStats") to + // NullFields is a list of field names (e.g. "SupervisedTuningDataStats") to // include in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. @@ -35990,8 +35613,6 @@ type GoogleCloudAiplatformV1beta1TuningJob struct { CreateTime string `json:"createTime,omitempty"` // Description: Optional. The description of the TuningJob. Description string `json:"description,omitempty"` - // DistillationSpec: Tuning Spec for Distillation. - DistillationSpec *GoogleCloudAiplatformV1beta1DistillationSpec `json:"distillationSpec,omitempty"` // EncryptionSpec: Customer-managed encryption key options for a TuningJob. If // this is set, then all resources created by the TuningJob will be encrypted // with the provided encryption key. @@ -36019,8 +35640,6 @@ type GoogleCloudAiplatformV1beta1TuningJob struct { // with the TuningJob. Format: // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. PipelineJob string `json:"pipelineJob,omitempty"` - // ReinforcementLearningSpec: Tuning Spec for Reinforcement Learning. - ReinforcementLearningSpec *GoogleCloudAiplatformV1beta1ReinforcementLearningSpec `json:"reinforcementLearningSpec,omitempty"` // StartTime: Output only. Time when the TuningJob for the first time entered // the `JOB_STATE_RUNNING` state. StartTime string `json:"startTime,omitempty"` @@ -37982,6 +37601,101 @@ func (s *GoogleTypeMoney) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +type IntelligenceCloudAutomlXpsMetricEntry struct { + // ArgentumMetricId: For billing metrics that are using legacy sku's, set the + // legacy billing metric id here. This will be sent to Chemist as the + // "cloudbilling.googleapis.com/argentum_metric_id" label. Otherwise leave + // empty. + ArgentumMetricId string `json:"argentumMetricId,omitempty"` + // DoubleValue: A double value. + DoubleValue float64 `json:"doubleValue,omitempty"` + // Int64Value: A signed 64-bit integer value. + Int64Value int64 `json:"int64Value,omitempty,string"` + // MetricName: The metric name defined in the service configuration. + MetricName string `json:"metricName,omitempty"` + // SystemLabels: Billing system labels for this (metric, value) pair. + SystemLabels []*IntelligenceCloudAutomlXpsMetricEntryLabel `json:"systemLabels,omitempty"` + // ForceSendFields is a list of field names (e.g. "ArgentumMetricId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ArgentumMetricId") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IntelligenceCloudAutomlXpsMetricEntry) MarshalJSON() ([]byte, error) { + type NoMethod IntelligenceCloudAutomlXpsMetricEntry + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *IntelligenceCloudAutomlXpsMetricEntry) UnmarshalJSON(data []byte) error { + type NoMethod IntelligenceCloudAutomlXpsMetricEntry + var s1 struct { + DoubleValue gensupport.JSONFloat64 `json:"doubleValue"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.DoubleValue = float64(s1.DoubleValue) + return nil +} + +type IntelligenceCloudAutomlXpsMetricEntryLabel struct { + // LabelName: The name of the label. + LabelName string `json:"labelName,omitempty"` + // LabelValue: The value of the label. + LabelValue string `json:"labelValue,omitempty"` + // ForceSendFields is a list of field names (e.g. "LabelName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LabelName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IntelligenceCloudAutomlXpsMetricEntryLabel) MarshalJSON() ([]byte, error) { + type NoMethod IntelligenceCloudAutomlXpsMetricEntryLabel + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type IntelligenceCloudAutomlXpsReportingMetrics struct { + // EffectiveTrainingDuration: The effective time training used. If set, this is + // used for quota management and billing. Deprecated. AutoML BE doesn't use + // this. Don't set. + EffectiveTrainingDuration string `json:"effectiveTrainingDuration,omitempty"` + // MetricEntries: One entry per metric name. The values must be aggregated per + // metric name. + MetricEntries []*IntelligenceCloudAutomlXpsMetricEntry `json:"metricEntries,omitempty"` + // ForceSendFields is a list of field names (e.g. "EffectiveTrainingDuration") + // to unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EffectiveTrainingDuration") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IntelligenceCloudAutomlXpsReportingMetrics) MarshalJSON() ([]byte, error) { + type NoMethod IntelligenceCloudAutomlXpsReportingMetrics + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + type MediaUploadCall struct { s *Service parent string @@ -41044,8 +40758,8 @@ type ProjectsLocationsCachedContentsPatchCall struct { // Patch: Updates cached content configurations // -// - name: Immutable. Identifier. The resource name of the cached content -// Format: +// - name: Immutable. Identifier. The server-generated resource name of the +// cached content Format: // projects/{project}/locations/{location}/cachedContents/{cached_content}. func (r *ProjectsLocationsCachedContentsService) Patch(name string, googlecloudaiplatformv1beta1cachedcontent *GoogleCloudAiplatformV1beta1CachedContent) *ProjectsLocationsCachedContentsPatchCall { c := &ProjectsLocationsCachedContentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -87487,67 +87201,60 @@ func (c *ProjectsLocationsNotebookExecutionJobsReportEventCall) Do(opts ...googl return ret, nil } -type ProjectsLocationsNotebookRuntimeTemplatesCreateCall struct { - s *Service - parent string - googlecloudaiplatformv1beta1notebookruntimetemplate *GoogleCloudAiplatformV1beta1NotebookRuntimeTemplate - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookExecutionJobsOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a NotebookRuntimeTemplate. +// Cancel: Starts asynchronous cancellation on a long-running operation. The +// server makes a best effort to cancel the operation, but success is not +// guaranteed. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or +// other methods to check whether the cancellation succeeded or whether the +// operation completed despite cancellation. On successful cancellation, the +// operation is not deleted; instead, it becomes an operation with an +// Operation.error value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. // -// - parent: The resource name of the Location to create the -// NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Create(parent string, googlecloudaiplatformv1beta1notebookruntimetemplate *GoogleCloudAiplatformV1beta1NotebookRuntimeTemplate) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { - c := &ProjectsLocationsNotebookRuntimeTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudaiplatformv1beta1notebookruntimetemplate = googlecloudaiplatformv1beta1notebookruntimetemplate - return c -} - -// NotebookRuntimeTemplateId sets the optional parameter -// "notebookRuntimeTemplateId": User specified ID for the notebook runtime -// template. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) NotebookRuntimeTemplateId(notebookRuntimeTemplateId string) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { - c.urlParams_.Set("notebookRuntimeTemplateId", notebookRuntimeTemplateId) +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Cancel(name string) *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Header() http.Header { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1notebookruntimetemplate) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimeTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -87555,18 +87262,18 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt stri } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.create" call. +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.cancel" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -87585,7 +87292,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -87598,7 +87305,7 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googlea return ret, nil } -type ProjectsLocationsNotebookRuntimeTemplatesDeleteCall struct { +type ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -87606,14 +87313,14 @@ type ProjectsLocationsNotebookRuntimeTemplatesDeleteCall struct { header_ http.Header } -// Delete: Deletes a NotebookRuntimeTemplate. +// Delete: Deletes a long-running operation. This method indicates that the +// client is no longer interested in the operation result. It does not cancel +// the operation. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. // -// - name: The name of the NotebookRuntimeTemplate resource to be deleted. -// Format: -// `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook -// _runtime_template}`. -func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Delete(name string) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { - c := &ProjectsLocationsNotebookRuntimeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource to be deleted. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Delete(name string) *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -87621,27 +87328,27 @@ func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Delete(name string) * // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -87659,13 +87366,596 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.delete" call. +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookExecutionJobsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can use this +// method to poll the operation result at intervals as recommended by the API +// service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Get(name string) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.get" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsNotebookExecutionJobsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookExecutionJobsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) List(name string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Filter(filter string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsNotebookExecutionJobsOperationsWaitCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Wait: Waits until the specified long-running operation is done or reaches at +// most a specified timeout, returning the latest state. If the operation is +// already done, the latest state is immediately returned. If the timeout +// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout +// is used. If the server does not support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort +// basis. It may return the latest state before the specified timeout +// (including immediately), meaning even an immediate response is no guarantee +// that the operation is done. +// +// - name: The name of the operation resource to wait on. +func (r *ProjectsLocationsNotebookExecutionJobsOperationsService) Wait(name string) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c := &ProjectsLocationsNotebookExecutionJobsOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Timeout sets the optional parameter "timeout": The maximum duration to wait +// before timing out. If left blank, the wait will be at most the time +// permitted by the underlying HTTP/RPC protocol. If RPC context deadline is +// also specified, the shorter one will be used. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Timeout(timeout string) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c.urlParams_.Set("timeout", timeout) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Context(ctx context.Context) *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookExecutionJobs.operations.wait" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookExecutionJobsOperationsWaitCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimeTemplatesCreateCall struct { + s *Service + parent string + googlecloudaiplatformv1beta1notebookruntimetemplate *GoogleCloudAiplatformV1beta1NotebookRuntimeTemplate + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a NotebookRuntimeTemplate. +// +// - parent: The resource name of the Location to create the +// NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Create(parent string, googlecloudaiplatformv1beta1notebookruntimetemplate *GoogleCloudAiplatformV1beta1NotebookRuntimeTemplate) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudaiplatformv1beta1notebookruntimetemplate = googlecloudaiplatformv1beta1notebookruntimetemplate + return c +} + +// NotebookRuntimeTemplateId sets the optional parameter +// "notebookRuntimeTemplateId": User specified ID for the notebook runtime +// template. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) NotebookRuntimeTemplateId(notebookRuntimeTemplateId string) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c.urlParams_.Set("notebookRuntimeTemplateId", notebookRuntimeTemplateId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1notebookruntimetemplate) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimeTemplates") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimeTemplatesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a NotebookRuntimeTemplate. +// +// - name: The name of the NotebookRuntimeTemplate resource to be deleted. +// Format: +// `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook +// _runtime_template}`. +func (r *ProjectsLocationsNotebookRuntimeTemplatesService) Delete(name string) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -88433,61 +88723,60 @@ func (c *ProjectsLocationsNotebookRuntimeTemplatesTestIamPermissionsCall) Do(opt return ret, nil } -type ProjectsLocationsNotebookRuntimesAssignCall struct { - s *Service - parent string - googlecloudaiplatformv1beta1assignnotebookruntimerequest *GoogleCloudAiplatformV1beta1AssignNotebookRuntimeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Assign: Assigns a NotebookRuntime to a user for a particular Notebook file. -// This method will either returns an existing assignment or generates a new -// one. +// Cancel: Starts asynchronous cancellation on a long-running operation. The +// server makes a best effort to cancel the operation, but success is not +// guaranteed. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or +// other methods to check whether the cancellation succeeded or whether the +// operation completed despite cancellation. On successful cancellation, the +// operation is not deleted; instead, it becomes an operation with an +// Operation.error value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. // -// - parent: The resource name of the Location to get the NotebookRuntime -// assignment. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsNotebookRuntimesService) Assign(parent string, googlecloudaiplatformv1beta1assignnotebookruntimerequest *GoogleCloudAiplatformV1beta1AssignNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesAssignCall { - c := &ProjectsLocationsNotebookRuntimesAssignCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudaiplatformv1beta1assignnotebookruntimerequest = googlecloudaiplatformv1beta1assignnotebookruntimerequest +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Cancel(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesAssignCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesAssignCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1assignnotebookruntimerequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimes:assign") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -88495,18 +88784,18 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*ht } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.assign" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.cancel" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -88525,7 +88814,7 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -88538,7 +88827,7 @@ func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsNotebookRuntimesDeleteCall struct { +type ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -88546,14 +88835,14 @@ type ProjectsLocationsNotebookRuntimesDeleteCall struct { header_ http.Header } -// Delete: Deletes a NotebookRuntime. -// -// - name: The name of the NotebookRuntime resource to be deleted. Instead of -// checking whether the name is in valid NotebookRuntime resource name -// format, directly throw NotFound exception if there is no such -// NotebookRuntime in spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Delete(name string) *ProjectsLocationsNotebookRuntimesDeleteCall { - c := &ProjectsLocationsNotebookRuntimesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Delete: Deletes a long-running operation. This method indicates that the +// client is no longer interested in the operation result. It does not cancel +// the operation. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. +// +// - name: The name of the operation resource to be deleted. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Delete(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -88561,27 +88850,27 @@ func (r *ProjectsLocationsNotebookRuntimesService) Delete(name string) *Projects // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesDeleteCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesDeleteCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) @@ -88599,13 +88888,13 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.delete" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -88624,7 +88913,7 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -88637,66 +88926,68 @@ func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallO return ret, nil } -type ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall struct { - s *Service - name string - googlecloudaiplatformv1beta1generateaccesstokenrequest *GoogleCloudAiplatformV1beta1GenerateAccessTokenRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// GenerateAccessToken: Internal only: Called from Compute Engine instance to -// obtain EUC for owner Anonymous access: authenticates caller using VM -// identity JWT. Design doc: go/colab-on-vertex-euc-dd +// Get: Gets the latest state of a long-running operation. Clients can use this +// method to poll the operation result at intervals as recommended by the API +// service. // -// - name: The name of the resource requesting the OAuth2 token. Format: -// `projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime -// }` -// `projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_ex -// ecution_job}`. -func (r *ProjectsLocationsNotebookRuntimesService) GenerateAccessToken(name string, googlecloudaiplatformv1beta1generateaccesstokenrequest *GoogleCloudAiplatformV1beta1GenerateAccessTokenRequest) *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall { - c := &ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Get(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudaiplatformv1beta1generateaccesstokenrequest = googlecloudaiplatformv1beta1generateaccesstokenrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generateaccesstokenrequest) - if err != nil { - return nil, err +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:generateAccessToken") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -88707,13 +88998,13 @@ func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.generateAccessToken" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.get" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudAiplatformV1beta1GenerateAccessTokenResponse.ServerResponse.Heade -// r or (if a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was because +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1GenerateAccessTokenResponse, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -88732,7 +89023,7 @@ func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Do(opts ...go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudAiplatformV1beta1GenerateAccessTokenResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -88745,7 +89036,7 @@ func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Do(opts ...go return ret, nil } -type ProjectsLocationsNotebookRuntimesGetCall struct { +type ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -88754,22 +89045,40 @@ type ProjectsLocationsNotebookRuntimesGetCall struct { header_ http.Header } -// Get: Gets a NotebookRuntime. +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. // -// - name: The name of the NotebookRuntime resource. Instead of checking -// whether the name is in valid NotebookRuntime resource name format, -// directly throw NotFound exception if there is no such NotebookRuntime in -// spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Get(name string) *ProjectsLocationsNotebookRuntimesGetCall { - c := &ProjectsLocationsNotebookRuntimesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) List(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesGetCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -88777,27 +89086,27 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *ProjectsLocationsNotebookRuntimesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesGetCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesGetCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -88805,7 +89114,7 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -88818,13 +89127,13 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.get" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.list" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudAiplatformV1beta1NotebookRuntime.ServerResponse.Header or (if a +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a // response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1NotebookRuntime, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -88843,7 +89152,7 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudAiplatformV1beta1NotebookRuntime{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -88856,143 +89165,109 @@ func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOpti return ret, nil } -type ProjectsLocationsNotebookRuntimesListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists NotebookRuntimes in a Location. -// -// - parent: The resource name of the Location from which to list the -// NotebookRuntimes. Format: `projects/{project}/locations/{location}`. -func (r *ProjectsLocationsNotebookRuntimesService) List(parent string) *ProjectsLocationsNotebookRuntimesListCall { - c := &ProjectsLocationsNotebookRuntimesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": An expression for filtering the -// results of the request. For field names both snake_case and camelCase are -// supported. * `notebookRuntime` supports = and !=. `notebookRuntime` -// represents the NotebookRuntime ID, i.e. the last segment of the -// NotebookRuntime's resource name. * `displayName` supports = and != and -// regex. * `notebookRuntimeTemplate` supports = and !=. -// `notebookRuntimeTemplate` represents the NotebookRuntimeTemplate ID, i.e. -// the last segment of the NotebookRuntimeTemplate's resource name. * -// `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, -// HEALTH_STATE_UNSPECIFIED]. * `runtimeState` supports = and !=. runtimeState -// enum: [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, -// STOPPED, BEING_UPGRADED, ERROR, INVALID]. * `runtimeUser` supports = and !=. -// * API version is UI only: `uiState` supports = and !=. uiState enum: -// [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, -// UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, -// UI_RESOURCE_STATE_CREATION_FAILED]. * `notebookRuntimeType` supports = and -// !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK]. Some examples: * -// `notebookRuntime="notebookRuntime123" * `displayName="myDisplayName" and -// `displayName=~"myDisplayNameRegex" * -// `notebookRuntimeTemplate="notebookRuntimeTemplate321" * -// `healthState=HEALTHY` * `runtimeState=RUNNING` * -// `runtimeUser="test@google.com" * `uiState=UI_RESOURCE_STATE_BEING_DELETED` -// * `notebookRuntimeType=USER_DEFINED` -func (c *ProjectsLocationsNotebookRuntimesListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": A comma-separated list of -// fields to order by, sorted in ascending order. Use "desc" after a field name -// for descending. Supported fields: * `display_name` * `create_time` * -// `update_time` Example: `display_name, create_time desc`. -func (c *ProjectsLocationsNotebookRuntimesListCall) OrderBy(orderBy string) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// PageSize sets the optional parameter "pageSize": The standard list page -// size. -func (c *ProjectsLocationsNotebookRuntimesListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": The standard list page -// token. Typically obtained via ListNotebookRuntimesResponse.next_page_token -// of the previous NotebookService.ListNotebookRuntimes call. -func (c *ProjectsLocationsNotebookRuntimesListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("pageToken", pageToken) +// Wait: Waits until the specified long-running operation is done or reaches at +// most a specified timeout, returning the latest state. If the operation is +// already done, the latest state is immediately returned. If the timeout +// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout +// is used. If the server does not support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort +// basis. It may return the latest state before the specified timeout +// (including immediately), meaning even an immediate response is no guarantee +// that the operation is done. +// +// - name: The name of the operation resource to wait on. +func (r *ProjectsLocationsNotebookRuntimeTemplatesOperationsService) Wait(name string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { + c := &ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// ReadMask sets the optional parameter "readMask": Mask specifying which -// fields to read. -func (c *ProjectsLocationsNotebookRuntimesListCall) ReadMask(readMask string) *ProjectsLocationsNotebookRuntimesListCall { - c.urlParams_.Set("readMask", readMask) +// Timeout sets the optional parameter "timeout": The maximum duration to wait +// before timing out. If left blank, the wait will be at most the time +// permitted by the underlying HTTP/RPC protocol. If RPC context deadline is +// also specified, the shorter one will be used. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Timeout(timeout string) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { + c.urlParams_.Set("timeout", timeout) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesListCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsLocationsNotebookRuntimesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesListCall { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesListCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimes") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.list" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimeTemplates.operations.wait" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse.ServerResponse.Head -// er or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse, error) { +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimeTemplatesOperationsWaitCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -89011,7 +89286,7 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -89024,81 +89299,61 @@ func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOpt return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsNotebookRuntimesListCall) Pages(ctx context.Context, f func(*GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsLocationsNotebookRuntimesReportEventCall struct { - s *Service - name string - googlecloudaiplatformv1beta1reportruntimeeventrequest *GoogleCloudAiplatformV1beta1ReportRuntimeEventRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimesAssignCall struct { + s *Service + parent string + googlecloudaiplatformv1beta1assignnotebookruntimerequest *GoogleCloudAiplatformV1beta1AssignNotebookRuntimeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ReportEvent: +// Assign: Assigns a NotebookRuntime to a user for a particular Notebook file. +// This method will either returns an existing assignment or generates a new +// one. // -// - name: The name of the NotebookRuntime resource. Format: -// `projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime -// }`. -func (r *ProjectsLocationsNotebookRuntimesService) ReportEvent(name string, googlecloudaiplatformv1beta1reportruntimeeventrequest *GoogleCloudAiplatformV1beta1ReportRuntimeEventRequest) *ProjectsLocationsNotebookRuntimesReportEventCall { - c := &ProjectsLocationsNotebookRuntimesReportEventCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudaiplatformv1beta1reportruntimeeventrequest = googlecloudaiplatformv1beta1reportruntimeeventrequest +// - parent: The resource name of the Location to get the NotebookRuntime +// assignment. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsNotebookRuntimesService) Assign(parent string, googlecloudaiplatformv1beta1assignnotebookruntimerequest *GoogleCloudAiplatformV1beta1AssignNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesAssignCall { + c := &ProjectsLocationsNotebookRuntimesAssignCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudaiplatformv1beta1assignnotebookruntimerequest = googlecloudaiplatformv1beta1assignnotebookruntimerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesReportEventCall { +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesAssignCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesReportEventCall { +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesAssignCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesReportEventCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimesAssignCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1reportruntimeeventrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1assignnotebookruntimerequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:reportEvent") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimes:assign") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -89106,20 +89361,18 @@ func (c *ProjectsLocationsNotebookRuntimesReportEventCall) doRequest(alt string) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.reportEvent" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimes.assign" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudAiplatformV1beta1ReportRuntimeEventResponse.ServerResponse.Header -// -// or (if a response was returned at all) in error.(*googleapi.Error).Header. -// -// Use googleapi.IsNotModified to check whether the returned error was because +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1ReportRuntimeEventResponse, error) { +func (c *ProjectsLocationsNotebookRuntimesAssignCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -89138,7 +89391,7 @@ func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudAiplatformV1beta1ReportRuntimeEventResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -89151,63 +89404,57 @@ func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Do(opts ...googleapi. return ret, nil } -type ProjectsLocationsNotebookRuntimesStartCall struct { - s *Service - name string - googlecloudaiplatformv1beta1startnotebookruntimerequest *GoogleCloudAiplatformV1beta1StartNotebookRuntimeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Start: Starts a NotebookRuntime. +// Delete: Deletes a NotebookRuntime. // -// - name: The name of the NotebookRuntime resource to be started. Instead of +// - name: The name of the NotebookRuntime resource to be deleted. Instead of // checking whether the name is in valid NotebookRuntime resource name // format, directly throw NotFound exception if there is no such // NotebookRuntime in spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Start(name string, googlecloudaiplatformv1beta1startnotebookruntimerequest *GoogleCloudAiplatformV1beta1StartNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesStartCall { - c := &ProjectsLocationsNotebookRuntimesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsNotebookRuntimesService) Delete(name string) *ProjectsLocationsNotebookRuntimesDeleteCall { + c := &ProjectsLocationsNotebookRuntimesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudaiplatformv1beta1startnotebookruntimerequest = googlecloudaiplatformv1beta1startnotebookruntimerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesStartCall { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesStartCall { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1startnotebookruntimerequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:start") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -89218,13 +89465,13 @@ func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.start" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimes.delete" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesStartCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsNotebookRuntimesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -89256,61 +89503,64 @@ func (c *ProjectsLocationsNotebookRuntimesStartCall) Do(opts ...googleapi.CallOp return ret, nil } -type ProjectsLocationsNotebookRuntimesUpgradeCall struct { - s *Service - name string - googlecloudaiplatformv1beta1upgradenotebookruntimerequest *GoogleCloudAiplatformV1beta1UpgradeNotebookRuntimeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall struct { + s *Service + name string + googlecloudaiplatformv1beta1generateaccesstokenrequest *GoogleCloudAiplatformV1beta1GenerateAccessTokenRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Upgrade: Upgrades a NotebookRuntime. +// GenerateAccessToken: Internal only: Called from Compute Engine instance to +// obtain EUC for owner Anonymous access: authenticates caller using VM +// identity JWT. Design doc: go/colab-on-vertex-euc-dd // -// - name: The name of the NotebookRuntime resource to be upgrade. Instead of -// checking whether the name is in valid NotebookRuntime resource name -// format, directly throw NotFound exception if there is no such -// NotebookRuntime in spanner. -func (r *ProjectsLocationsNotebookRuntimesService) Upgrade(name string, googlecloudaiplatformv1beta1upgradenotebookruntimerequest *GoogleCloudAiplatformV1beta1UpgradeNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesUpgradeCall { - c := &ProjectsLocationsNotebookRuntimesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the resource requesting the OAuth2 token. Format: +// `projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime +// }` +// `projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_ex +// ecution_job}`. +func (r *ProjectsLocationsNotebookRuntimesService) GenerateAccessToken(name string, googlecloudaiplatformv1beta1generateaccesstokenrequest *GoogleCloudAiplatformV1beta1GenerateAccessTokenRequest) *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall { + c := &ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudaiplatformv1beta1upgradenotebookruntimerequest = googlecloudaiplatformv1beta1upgradenotebookruntimerequest + c.googlecloudaiplatformv1beta1generateaccesstokenrequest = googlecloudaiplatformv1beta1generateaccesstokenrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesUpgradeCall { +func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesUpgradeCall { +func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Header() http.Header { +func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1upgradenotebookruntimerequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1generateaccesstokenrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:upgrade") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:generateAccessToken") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -89323,13 +89573,1205 @@ func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "aiplatform.projects.locations.notebookRuntimes.upgrade" call. +// Do executes the "aiplatform.projects.locations.notebookRuntimes.generateAccessToken" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because +// *GoogleCloudAiplatformV1beta1GenerateAccessTokenResponse.ServerResponse.Heade +// r or (if a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsNotebookRuntimesGenerateAccessTokenCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1GenerateAccessTokenResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudAiplatformV1beta1GenerateAccessTokenResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a NotebookRuntime. +// +// - name: The name of the NotebookRuntime resource. Instead of checking +// whether the name is in valid NotebookRuntime resource name format, +// directly throw NotFound exception if there is no such NotebookRuntime in +// spanner. +func (r *ProjectsLocationsNotebookRuntimesService) Get(name string) *ProjectsLocationsNotebookRuntimesGetCall { + c := &ProjectsLocationsNotebookRuntimesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudAiplatformV1beta1NotebookRuntime.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1NotebookRuntime, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudAiplatformV1beta1NotebookRuntime{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists NotebookRuntimes in a Location. +// +// - parent: The resource name of the Location from which to list the +// NotebookRuntimes. Format: `projects/{project}/locations/{location}`. +func (r *ProjectsLocationsNotebookRuntimesService) List(parent string) *ProjectsLocationsNotebookRuntimesListCall { + c := &ProjectsLocationsNotebookRuntimesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": An expression for filtering the +// results of the request. For field names both snake_case and camelCase are +// supported. * `notebookRuntime` supports = and !=. `notebookRuntime` +// represents the NotebookRuntime ID, i.e. the last segment of the +// NotebookRuntime's resource name. * `displayName` supports = and != and +// regex. * `notebookRuntimeTemplate` supports = and !=. +// `notebookRuntimeTemplate` represents the NotebookRuntimeTemplate ID, i.e. +// the last segment of the NotebookRuntimeTemplate's resource name. * +// `healthState` supports = and !=. healthState enum: [HEALTHY, UNHEALTHY, +// HEALTH_STATE_UNSPECIFIED]. * `runtimeState` supports = and !=. runtimeState +// enum: [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, +// STOPPED, BEING_UPGRADED, ERROR, INVALID]. * `runtimeUser` supports = and !=. +// * API version is UI only: `uiState` supports = and !=. uiState enum: +// [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED, +// UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED, +// UI_RESOURCE_STATE_CREATION_FAILED]. * `notebookRuntimeType` supports = and +// !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK]. Some examples: * +// `notebookRuntime="notebookRuntime123" * `displayName="myDisplayName" and +// `displayName=~"myDisplayNameRegex" * +// `notebookRuntimeTemplate="notebookRuntimeTemplate321" * +// `healthState=HEALTHY` * `runtimeState=RUNNING` * +// `runtimeUser="test@google.com" * `uiState=UI_RESOURCE_STATE_BEING_DELETED` +// * `notebookRuntimeType=USER_DEFINED` +func (c *ProjectsLocationsNotebookRuntimesListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list of +// fields to order by, sorted in ascending order. Use "desc" after a field name +// for descending. Supported fields: * `display_name` * `create_time` * +// `update_time` Example: `display_name, create_time desc`. +func (c *ProjectsLocationsNotebookRuntimesListCall) OrderBy(orderBy string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookRuntimesListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. Typically obtained via ListNotebookRuntimesResponse.next_page_token +// of the previous NotebookService.ListNotebookRuntimes call. +func (c *ProjectsLocationsNotebookRuntimesListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadMask sets the optional parameter "readMask": Mask specifying which +// fields to read. +func (c *ProjectsLocationsNotebookRuntimesListCall) ReadMask(readMask string) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("readMask", readMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/notebookRuntimes") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse.ServerResponse.Head +// er or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookRuntimesListCall) Pages(ctx context.Context, f func(*GoogleCloudAiplatformV1beta1ListNotebookRuntimesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsNotebookRuntimesReportEventCall struct { + s *Service + name string + googlecloudaiplatformv1beta1reportruntimeeventrequest *GoogleCloudAiplatformV1beta1ReportRuntimeEventRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ReportEvent: +// +// - name: The name of the NotebookRuntime resource. Format: +// `projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime +// }`. +func (r *ProjectsLocationsNotebookRuntimesService) ReportEvent(name string, googlecloudaiplatformv1beta1reportruntimeeventrequest *GoogleCloudAiplatformV1beta1ReportRuntimeEventRequest) *ProjectsLocationsNotebookRuntimesReportEventCall { + c := &ProjectsLocationsNotebookRuntimesReportEventCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudaiplatformv1beta1reportruntimeeventrequest = googlecloudaiplatformv1beta1reportruntimeeventrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesReportEventCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesReportEventCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesReportEventCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1reportruntimeeventrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:reportEvent") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.reportEvent" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudAiplatformV1beta1ReportRuntimeEventResponse.ServerResponse.Header +// +// or (if a response was returned at all) in error.(*googleapi.Error).Header. +// +// Use googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesReportEventCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAiplatformV1beta1ReportRuntimeEventResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudAiplatformV1beta1ReportRuntimeEventResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesStartCall struct { + s *Service + name string + googlecloudaiplatformv1beta1startnotebookruntimerequest *GoogleCloudAiplatformV1beta1StartNotebookRuntimeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Start: Starts a NotebookRuntime. +// +// - name: The name of the NotebookRuntime resource to be started. Instead of +// checking whether the name is in valid NotebookRuntime resource name +// format, directly throw NotFound exception if there is no such +// NotebookRuntime in spanner. +func (r *ProjectsLocationsNotebookRuntimesService) Start(name string, googlecloudaiplatformv1beta1startnotebookruntimerequest *GoogleCloudAiplatformV1beta1StartNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesStartCall { + c := &ProjectsLocationsNotebookRuntimesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudaiplatformv1beta1startnotebookruntimerequest = googlecloudaiplatformv1beta1startnotebookruntimerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesStartCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesStartCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesStartCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1startnotebookruntimerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:start") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.start" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesStartCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesUpgradeCall struct { + s *Service + name string + googlecloudaiplatformv1beta1upgradenotebookruntimerequest *GoogleCloudAiplatformV1beta1UpgradeNotebookRuntimeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Upgrade: Upgrades a NotebookRuntime. +// +// - name: The name of the NotebookRuntime resource to be upgrade. Instead of +// checking whether the name is in valid NotebookRuntime resource name +// format, directly throw NotFound exception if there is no such +// NotebookRuntime in spanner. +func (r *ProjectsLocationsNotebookRuntimesService) Upgrade(name string, googlecloudaiplatformv1beta1upgradenotebookruntimerequest *GoogleCloudAiplatformV1beta1UpgradeNotebookRuntimeRequest) *ProjectsLocationsNotebookRuntimesUpgradeCall { + c := &ProjectsLocationsNotebookRuntimesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudaiplatformv1beta1upgradenotebookruntimerequest = googlecloudaiplatformv1beta1upgradenotebookruntimerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesUpgradeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesUpgradeCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudaiplatformv1beta1upgradenotebookruntimerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:upgrade") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.upgrade" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesUpgradeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsCancelCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Cancel: Starts asynchronous cancellation on a long-running operation. The +// server makes a best effort to cancel the operation, but success is not +// guaranteed. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or +// other methods to check whether the cancellation succeeded or whether the +// operation completed despite cancellation. On successful cancellation, the +// operation is not deleted; instead, it becomes an operation with an +// Operation.error value with a google.rpc.Status.code of 1, corresponding to +// `Code.CANCELLED`. +// +// - name: The name of the operation resource to be cancelled. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Cancel(name string) *ProjectsLocationsNotebookRuntimesOperationsCancelCall { + c := &ProjectsLocationsNotebookRuntimesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsCancelCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsCancelCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.cancel" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a long-running operation. This method indicates that the +// client is no longer interested in the operation result. It does not cancel +// the operation. If the server doesn't support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. +// +// - name: The name of the operation resource to be deleted. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Delete(name string) *ProjectsLocationsNotebookRuntimesOperationsDeleteCall { + c := &ProjectsLocationsNotebookRuntimesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can use this +// method to poll the operation result at intervals as recommended by the API +// service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Get(name string) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c := &ProjectsLocationsNotebookRuntimesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsNotebookRuntimesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) List(name string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c := &ProjectsLocationsNotebookRuntimesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Filter(filter string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsNotebookRuntimesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsNotebookRuntimesOperationsWaitCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Wait: Waits until the specified long-running operation is done or reaches at +// most a specified timeout, returning the latest state. If the operation is +// already done, the latest state is immediately returned. If the timeout +// specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout +// is used. If the server does not support this method, it returns +// `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort +// basis. It may return the latest state before the specified timeout +// (including immediately), meaning even an immediate response is no guarantee +// that the operation is done. +// +// - name: The name of the operation resource to wait on. +func (r *ProjectsLocationsNotebookRuntimesOperationsService) Wait(name string) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c := &ProjectsLocationsNotebookRuntimesOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Timeout sets the optional parameter "timeout": The maximum duration to wait +// before timing out. If left blank, the wait will be at most the time +// permitted by the underlying HTTP/RPC protocol. If RPC context deadline is +// also specified, the shorter one will be used. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Timeout(timeout string) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c.urlParams_.Set("timeout", timeout) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Fields(s ...googleapi.Field) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Context(ctx context.Context) *ProjectsLocationsNotebookRuntimesOperationsWaitCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wait") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "aiplatform.projects.locations.notebookRuntimes.operations.wait" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsNotebookRuntimesOperationsWaitCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { diff --git a/alloydb/v1/alloydb-api.json b/alloydb/v1/alloydb-api.json index 6d8f38240d2..75a3cae9ea1 100644 --- a/alloydb/v1/alloydb-api.json +++ b/alloydb/v1/alloydb-api.json @@ -1461,7 +1461,7 @@ } } }, - "revision": "20240529", + "revision": "20240605", "rootUrl": "https://alloydb.googleapis.com/", "schemas": { "AuthorizedNetwork": { @@ -4175,11 +4175,17 @@ "description": "Required. Type of aggregation performed on the metric.", "enum": [ "AGGREGATION_TYPE_UNSPECIFIED", - "MAXIMUM" + "PEAK", + "P99", + "P95", + "CURRENT" ], "enumDescriptions": [ "Unspecified aggregation type.", - "Maximum aggregation type." + "PEAK aggregation type.", + "P99 aggregation type.", + "P95 aggregation type.", + "current aggregation type." ], "type": "string" }, @@ -4189,13 +4195,17 @@ "METRIC_TYPE_UNSPECIFIED", "CPU_UTILIZATION", "MEMORY_UTILIZATION", - "NETWORK_CONNECTIONS" + "NETWORK_CONNECTIONS", + "STORAGE_UTILIZATION", + "STORAGE_USED_BYTES" ], "enumDescriptions": [ "Unspecified metric type.", "CPU utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", "Memory utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", - "Number of network connections for a resource." + "Number of network connections for a resource.", + "Storage utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", + "Sotrage used by a resource." ], "type": "string" }, diff --git a/alloydb/v1/alloydb-gen.go b/alloydb/v1/alloydb-gen.go index 1c0a721a636..be3e5ccae7a 100644 --- a/alloydb/v1/alloydb-gen.go +++ b/alloydb/v1/alloydb-gen.go @@ -3136,7 +3136,10 @@ type StorageDatabasecenterPartnerapiV1mainObservabilityMetricData struct { // // Possible values: // "AGGREGATION_TYPE_UNSPECIFIED" - Unspecified aggregation type. - // "MAXIMUM" - Maximum aggregation type. + // "PEAK" - PEAK aggregation type. + // "P99" - P99 aggregation type. + // "P95" - P95 aggregation type. + // "CURRENT" - current aggregation type. AggregationType string `json:"aggregationType,omitempty"` // MetricType: Required. Type of metric like CPU, Memory, etc. // @@ -3147,6 +3150,9 @@ type StorageDatabasecenterPartnerapiV1mainObservabilityMetricData struct { // "MEMORY_UTILIZATION" - Memory utilization for a resource. The value is a // fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases). // "NETWORK_CONNECTIONS" - Number of network connections for a resource. + // "STORAGE_UTILIZATION" - Storage utilization for a resource. The value is a + // fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases). + // "STORAGE_USED_BYTES" - Sotrage used by a resource. MetricType string `json:"metricType,omitempty"` // ObservationTime: Required. The time the metric value was observed. ObservationTime string `json:"observationTime,omitempty"` diff --git a/alloydb/v1alpha/alloydb-api.json b/alloydb/v1alpha/alloydb-api.json index 8aaf75f0125..84fcbc0878d 100644 --- a/alloydb/v1alpha/alloydb-api.json +++ b/alloydb/v1alpha/alloydb-api.json @@ -1461,7 +1461,7 @@ } } }, - "revision": "20240529", + "revision": "20240605", "rootUrl": "https://alloydb.googleapis.com/", "schemas": { "AuthorizedNetwork": { @@ -1954,6 +1954,25 @@ "readOnly": true, "type": "string" }, + "subscriptionType": { + "description": "Optional. Subscription type of the cluster.", + "enum": [ + "SUBSCRIPTION_TYPE_UNSPECIFIED", + "STANDARD", + "TRIAL" + ], + "enumDescriptions": [ + "This is an unknown Subscription type (By default, Subscription Type is STANDARD)", + "Standard subscription.", + "Trial subscription." + ], + "type": "string" + }, + "trialMetadata": { + "$ref": "TrialMetadata", + "description": "Output only. Metadata for free trial clusters", + "readOnly": true + }, "uid": { "description": "Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.", "readOnly": true, @@ -4298,11 +4317,17 @@ "description": "Required. Type of aggregation performed on the metric.", "enum": [ "AGGREGATION_TYPE_UNSPECIFIED", - "MAXIMUM" + "PEAK", + "P99", + "P95", + "CURRENT" ], "enumDescriptions": [ "Unspecified aggregation type.", - "Maximum aggregation type." + "PEAK aggregation type.", + "P99 aggregation type.", + "P95 aggregation type.", + "current aggregation type." ], "type": "string" }, @@ -4312,13 +4337,17 @@ "METRIC_TYPE_UNSPECIFIED", "CPU_UTILIZATION", "MEMORY_UTILIZATION", - "NETWORK_CONNECTIONS" + "NETWORK_CONNECTIONS", + "STORAGE_UTILIZATION", + "STORAGE_USED_BYTES" ], "enumDescriptions": [ "Unspecified metric type.", "CPU utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", "Memory utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", - "Number of network connections for a resource." + "Number of network connections for a resource.", + "Storage utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", + "Sotrage used by a resource." ], "type": "string" }, @@ -4647,6 +4676,28 @@ }, "type": "object" }, + "TrialMetadata": { + "description": "Contains information and all metadata related to TRIAL clusters.", + "id": "TrialMetadata", + "properties": { + "endTime": { + "description": "End time of the trial cluster.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "start time of the trial cluster.", + "format": "google-datetime", + "type": "string" + }, + "upgradeTime": { + "description": "Upgrade time of trial cluster to Standard cluster.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "UpdatePolicy": { "description": "Policy to be used while updating the instance.", "id": "UpdatePolicy", diff --git a/alloydb/v1alpha/alloydb-gen.go b/alloydb/v1alpha/alloydb-gen.go index 2137b4ad68f..e9b3f5852b7 100644 --- a/alloydb/v1alpha/alloydb-gen.go +++ b/alloydb/v1alpha/alloydb-gen.go @@ -659,6 +659,16 @@ type Cluster struct { // cluster are not allowed while the cluster is in this state. // "PROMOTING" - The cluster is being promoted. State string `json:"state,omitempty"` + // SubscriptionType: Optional. Subscription type of the cluster. + // + // Possible values: + // "SUBSCRIPTION_TYPE_UNSPECIFIED" - This is an unknown Subscription type (By + // default, Subscription Type is STANDARD) + // "STANDARD" - Standard subscription. + // "TRIAL" - Trial subscription. + SubscriptionType string `json:"subscriptionType,omitempty"` + // TrialMetadata: Output only. Metadata for free trial clusters + TrialMetadata *TrialMetadata `json:"trialMetadata,omitempty"` // Uid: Output only. The system-generated UID of the resource. The UID is // assigned when the resource is created, and it is retained until it is // deleted. @@ -3267,7 +3277,10 @@ type StorageDatabasecenterPartnerapiV1mainObservabilityMetricData struct { // // Possible values: // "AGGREGATION_TYPE_UNSPECIFIED" - Unspecified aggregation type. - // "MAXIMUM" - Maximum aggregation type. + // "PEAK" - PEAK aggregation type. + // "P99" - P99 aggregation type. + // "P95" - P95 aggregation type. + // "CURRENT" - current aggregation type. AggregationType string `json:"aggregationType,omitempty"` // MetricType: Required. Type of metric like CPU, Memory, etc. // @@ -3278,6 +3291,9 @@ type StorageDatabasecenterPartnerapiV1mainObservabilityMetricData struct { // "MEMORY_UTILIZATION" - Memory utilization for a resource. The value is a // fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases). // "NETWORK_CONNECTIONS" - Number of network connections for a resource. + // "STORAGE_UTILIZATION" - Storage utilization for a resource. The value is a + // fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases). + // "STORAGE_USED_BYTES" - Sotrage used by a resource. MetricType string `json:"metricType,omitempty"` // ObservationTime: Required. The time the metric value was observed. ObservationTime string `json:"observationTime,omitempty"` @@ -3613,6 +3629,33 @@ func (s *TimeBasedRetention) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// TrialMetadata: Contains information and all metadata related to TRIAL +// clusters. +type TrialMetadata struct { + // EndTime: End time of the trial cluster. + EndTime string `json:"endTime,omitempty"` + // StartTime: start time of the trial cluster. + StartTime string `json:"startTime,omitempty"` + // UpgradeTime: Upgrade time of trial cluster to Standard cluster. + UpgradeTime string `json:"upgradeTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TrialMetadata) MarshalJSON() ([]byte, error) { + type NoMethod TrialMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // UpdatePolicy: Policy to be used while updating the instance. type UpdatePolicy struct { // Mode: Mode for updating the instance. diff --git a/alloydb/v1beta/alloydb-api.json b/alloydb/v1beta/alloydb-api.json index c32bf3244c2..17157b7118c 100644 --- a/alloydb/v1beta/alloydb-api.json +++ b/alloydb/v1beta/alloydb-api.json @@ -1458,7 +1458,7 @@ } } }, - "revision": "20240529", + "revision": "20240605", "rootUrl": "https://alloydb.googleapis.com/", "schemas": { "AuthorizedNetwork": { @@ -1935,6 +1935,25 @@ "readOnly": true, "type": "string" }, + "subscriptionType": { + "description": "Optional. Subscription type of the cluster.", + "enum": [ + "SUBSCRIPTION_TYPE_UNSPECIFIED", + "STANDARD", + "TRIAL" + ], + "enumDescriptions": [ + "This is an unknown Subscription type (By default, Subscription Type is STANDARD)", + "Standard subscription.", + "Trial subscription." + ], + "type": "string" + }, + "trialMetadata": { + "$ref": "TrialMetadata", + "description": "Output only. Metadata for free trial clusters", + "readOnly": true + }, "uid": { "description": "Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.", "readOnly": true, @@ -4274,11 +4293,17 @@ "description": "Required. Type of aggregation performed on the metric.", "enum": [ "AGGREGATION_TYPE_UNSPECIFIED", - "MAXIMUM" + "PEAK", + "P99", + "P95", + "CURRENT" ], "enumDescriptions": [ "Unspecified aggregation type.", - "Maximum aggregation type." + "PEAK aggregation type.", + "P99 aggregation type.", + "P95 aggregation type.", + "current aggregation type." ], "type": "string" }, @@ -4288,13 +4313,17 @@ "METRIC_TYPE_UNSPECIFIED", "CPU_UTILIZATION", "MEMORY_UTILIZATION", - "NETWORK_CONNECTIONS" + "NETWORK_CONNECTIONS", + "STORAGE_UTILIZATION", + "STORAGE_USED_BYTES" ], "enumDescriptions": [ "Unspecified metric type.", "CPU utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", "Memory utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", - "Number of network connections for a resource." + "Number of network connections for a resource.", + "Storage utilization for a resource. The value is a fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).", + "Sotrage used by a resource." ], "type": "string" }, @@ -4623,6 +4652,28 @@ }, "type": "object" }, + "TrialMetadata": { + "description": "Contains information and all metadata related to TRIAL clusters.", + "id": "TrialMetadata", + "properties": { + "endTime": { + "description": "End time of the trial cluster.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "start time of the trial cluster.", + "format": "google-datetime", + "type": "string" + }, + "upgradeTime": { + "description": "Upgrade time of trial cluster to Standard cluster.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "UpdatePolicy": { "description": "Policy to be used while updating the instance.", "id": "UpdatePolicy", diff --git a/alloydb/v1beta/alloydb-gen.go b/alloydb/v1beta/alloydb-gen.go index 45d5c236c0a..9f4b8f4b002 100644 --- a/alloydb/v1beta/alloydb-gen.go +++ b/alloydb/v1beta/alloydb-gen.go @@ -651,6 +651,16 @@ type Cluster struct { // cluster are not allowed while the cluster is in this state. // "PROMOTING" - The cluster is being promoted. State string `json:"state,omitempty"` + // SubscriptionType: Optional. Subscription type of the cluster. + // + // Possible values: + // "SUBSCRIPTION_TYPE_UNSPECIFIED" - This is an unknown Subscription type (By + // default, Subscription Type is STANDARD) + // "STANDARD" - Standard subscription. + // "TRIAL" - Trial subscription. + SubscriptionType string `json:"subscriptionType,omitempty"` + // TrialMetadata: Output only. Metadata for free trial clusters + TrialMetadata *TrialMetadata `json:"trialMetadata,omitempty"` // Uid: Output only. The system-generated UID of the resource. The UID is // assigned when the resource is created, and it is retained until it is // deleted. @@ -3257,7 +3267,10 @@ type StorageDatabasecenterPartnerapiV1mainObservabilityMetricData struct { // // Possible values: // "AGGREGATION_TYPE_UNSPECIFIED" - Unspecified aggregation type. - // "MAXIMUM" - Maximum aggregation type. + // "PEAK" - PEAK aggregation type. + // "P99" - P99 aggregation type. + // "P95" - P95 aggregation type. + // "CURRENT" - current aggregation type. AggregationType string `json:"aggregationType,omitempty"` // MetricType: Required. Type of metric like CPU, Memory, etc. // @@ -3268,6 +3281,9 @@ type StorageDatabasecenterPartnerapiV1mainObservabilityMetricData struct { // "MEMORY_UTILIZATION" - Memory utilization for a resource. The value is a // fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases). // "NETWORK_CONNECTIONS" - Number of network connections for a resource. + // "STORAGE_UTILIZATION" - Storage utilization for a resource. The value is a + // fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases). + // "STORAGE_USED_BYTES" - Sotrage used by a resource. MetricType string `json:"metricType,omitempty"` // ObservationTime: Required. The time the metric value was observed. ObservationTime string `json:"observationTime,omitempty"` @@ -3603,6 +3619,33 @@ func (s *TimeBasedRetention) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// TrialMetadata: Contains information and all metadata related to TRIAL +// clusters. +type TrialMetadata struct { + // EndTime: End time of the trial cluster. + EndTime string `json:"endTime,omitempty"` + // StartTime: start time of the trial cluster. + StartTime string `json:"startTime,omitempty"` + // UpgradeTime: Upgrade time of trial cluster to Standard cluster. + UpgradeTime string `json:"upgradeTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TrialMetadata) MarshalJSON() ([]byte, error) { + type NoMethod TrialMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // UpdatePolicy: Policy to be used while updating the instance. type UpdatePolicy struct { // Mode: Mode for updating the instance. diff --git a/androidmanagement/v1/androidmanagement-api.json b/androidmanagement/v1/androidmanagement-api.json index 275aec20b37..8c2c468770a 100644 --- a/androidmanagement/v1/androidmanagement-api.json +++ b/androidmanagement/v1/androidmanagement-api.json @@ -1168,7 +1168,7 @@ } } }, - "revision": "20240612", + "revision": "20240618", "rootUrl": "https://androidmanagement.googleapis.com/", "schemas": { "AdbShellCommandEvent": { @@ -2957,6 +2957,21 @@ }, "type": "object" }, + "DisplaySettings": { + "description": "Controls for the display settings.", + "id": "DisplaySettings", + "properties": { + "screenBrightnessSettings": { + "$ref": "ScreenBrightnessSettings", + "description": "Optional. Controls the screen brightness settings." + }, + "screenTimeoutSettings": { + "$ref": "ScreenTimeoutSettings", + "description": "Optional. Controls the screen timeout settings." + } + }, + "type": "object" + }, "DnsEvent": { "description": "A DNS lookup event was initiated through the standard network stack.", "id": "DnsEvent", @@ -4977,6 +4992,10 @@ "$ref": "DeviceRadioState", "description": "Covers controls for radio state such as Wi-Fi, bluetooth, and more." }, + "displaySettings": { + "$ref": "DisplaySettings", + "description": "Optional. Controls for the display settings." + }, "encryptionPolicy": { "description": "Whether encryption is enabled", "enum": [ @@ -5609,6 +5628,60 @@ }, "type": "object" }, + "ScreenBrightnessSettings": { + "description": "Controls for the screen brightness settings.", + "id": "ScreenBrightnessSettings", + "properties": { + "screenBrightness": { + "description": "Optional. The screen brightness between 1 and 255 where 1 is the lowest and 255 is the highest brightness. A value of 0 (default) means no screen brightness set. Any other value is rejected. screenBrightnessMode must be either BRIGHTNESS_AUTOMATIC or BRIGHTNESS_FIXED to set this. Supported on Android 9 and above on fully managed devices. A NonComplianceDetail with API_LEVEL is reported if the Android version is less than 9.", + "format": "int32", + "type": "integer" + }, + "screenBrightnessMode": { + "description": "Optional. Controls the screen brightness mode.", + "enum": [ + "SCREEN_BRIGHTNESS_MODE_UNSPECIFIED", + "BRIGHTNESS_USER_CHOICE", + "BRIGHTNESS_AUTOMATIC", + "BRIGHTNESS_FIXED" + ], + "enumDescriptions": [ + "Unspecified. Defaults to BRIGHTNESS_USER_CHOICE.", + "The user is allowed to configure the screen brightness. screenBrightness must not be set.", + "The screen brightness mode is automatic in which the brightness is automatically adjusted and the user is not allowed to configure the screen brightness. screenBrightness can still be set and it is taken into account while the brightness is automatically adjusted. Supported on Android 9 and above on fully managed devices. A NonComplianceDetail with API_LEVEL is reported if the Android version is less than 9.", + "The screen brightness mode is fixed in which the brightness is set to screenBrightness and the user is not allowed to configure the screen brightness. screenBrightness must be set. Supported on Android 9 and above on fully managed devices. A NonComplianceDetail with API_LEVEL is reported if the Android version is less than 9." + ], + "type": "string" + } + }, + "type": "object" + }, + "ScreenTimeoutSettings": { + "description": "Controls the screen timeout settings.", + "id": "ScreenTimeoutSettings", + "properties": { + "screenTimeout": { + "description": "Optional. Controls the screen timeout duration. The screen timeout duration must be greater than 0, otherwise it is rejected. Additionally, it should not be greater than maximumTimeToLock, otherwise the screen timeout is set to maximumTimeToLock and a NonComplianceDetail with INVALID_VALUE reason and SCREEN_TIMEOUT_GREATER_THAN_MAXIMUM_TIME_TO_LOCK specific reason is reported. If the screen timeout is less than a certain lower bound, it is set to the lower bound. The lower bound may vary across devices. If this is set, screenTimeoutMode must be SCREEN_TIMEOUT_ENFORCED. Supported on Android 9 and above on fully managed devices. A NonComplianceDetail with API_LEVEL is reported if the Android version is less than 9.", + "format": "google-duration", + "type": "string" + }, + "screenTimeoutMode": { + "description": "Optional. Controls whether the user is allowed to configure the screen timeout.", + "enum": [ + "SCREEN_TIMEOUT_MODE_UNSPECIFIED", + "SCREEN_TIMEOUT_USER_CHOICE", + "SCREEN_TIMEOUT_ENFORCED" + ], + "enumDescriptions": [ + "Unspecified. Defaults to SCREEN_TIMEOUT_USER_CHOICE.", + "The user is allowed to configure the screen timeout. screenTimeout must not be set.", + "The screen timeout is set to screenTimeout and the user is not allowed to configure the timeout. screenTimeout must be set. Supported on Android 9 and above on fully managed devices. A NonComplianceDetail with API_LEVEL is reported if the Android version is less than 9." + ], + "type": "string" + } + }, + "type": "object" + }, "SecurityPosture": { "description": "The security posture of the device, as determined by the current device state and the policies applied.", "id": "SecurityPosture", diff --git a/androidmanagement/v1/androidmanagement-gen.go b/androidmanagement/v1/androidmanagement-gen.go index 35cb5e56acc..3714288d749 100644 --- a/androidmanagement/v1/androidmanagement-gen.go +++ b/androidmanagement/v1/androidmanagement-gen.go @@ -2322,6 +2322,30 @@ func (s *Display) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// DisplaySettings: Controls for the display settings. +type DisplaySettings struct { + // ScreenBrightnessSettings: Optional. Controls the screen brightness settings. + ScreenBrightnessSettings *ScreenBrightnessSettings `json:"screenBrightnessSettings,omitempty"` + // ScreenTimeoutSettings: Optional. Controls the screen timeout settings. + ScreenTimeoutSettings *ScreenTimeoutSettings `json:"screenTimeoutSettings,omitempty"` + // ForceSendFields is a list of field names (e.g. "ScreenBrightnessSettings") + // to unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ScreenBrightnessSettings") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DisplaySettings) MarshalJSON() ([]byte, error) { + type NoMethod DisplaySettings + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // DnsEvent: A DNS lookup event was initiated through the standard network // stack. type DnsEvent struct { @@ -4838,6 +4862,8 @@ type Policy struct { // DeviceRadioState: Covers controls for radio state such as Wi-Fi, bluetooth, // and more. DeviceRadioState *DeviceRadioState `json:"deviceRadioState,omitempty"` + // DisplaySettings: Optional. Controls for the display settings. + DisplaySettings *DisplaySettings `json:"displaySettings,omitempty"` // EncryptionPolicy: Whether encryption is enabled // // Possible values: @@ -5433,6 +5459,99 @@ func (s *RemoteLockEvent) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// ScreenBrightnessSettings: Controls for the screen brightness settings. +type ScreenBrightnessSettings struct { + // ScreenBrightness: Optional. The screen brightness between 1 and 255 where 1 + // is the lowest and 255 is the highest brightness. A value of 0 (default) + // means no screen brightness set. Any other value is rejected. + // screenBrightnessMode must be either BRIGHTNESS_AUTOMATIC or BRIGHTNESS_FIXED + // to set this. Supported on Android 9 and above on fully managed devices. A + // NonComplianceDetail with API_LEVEL is reported if the Android version is + // less than 9. + ScreenBrightness int64 `json:"screenBrightness,omitempty"` + // ScreenBrightnessMode: Optional. Controls the screen brightness mode. + // + // Possible values: + // "SCREEN_BRIGHTNESS_MODE_UNSPECIFIED" - Unspecified. Defaults to + // BRIGHTNESS_USER_CHOICE. + // "BRIGHTNESS_USER_CHOICE" - The user is allowed to configure the screen + // brightness. screenBrightness must not be set. + // "BRIGHTNESS_AUTOMATIC" - The screen brightness mode is automatic in which + // the brightness is automatically adjusted and the user is not allowed to + // configure the screen brightness. screenBrightness can still be set and it is + // taken into account while the brightness is automatically adjusted. Supported + // on Android 9 and above on fully managed devices. A NonComplianceDetail with + // API_LEVEL is reported if the Android version is less than 9. + // "BRIGHTNESS_FIXED" - The screen brightness mode is fixed in which the + // brightness is set to screenBrightness and the user is not allowed to + // configure the screen brightness. screenBrightness must be set. Supported on + // Android 9 and above on fully managed devices. A NonComplianceDetail with + // API_LEVEL is reported if the Android version is less than 9. + ScreenBrightnessMode string `json:"screenBrightnessMode,omitempty"` + // ForceSendFields is a list of field names (e.g. "ScreenBrightness") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ScreenBrightness") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ScreenBrightnessSettings) MarshalJSON() ([]byte, error) { + type NoMethod ScreenBrightnessSettings + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ScreenTimeoutSettings: Controls the screen timeout settings. +type ScreenTimeoutSettings struct { + // ScreenTimeout: Optional. Controls the screen timeout duration. The screen + // timeout duration must be greater than 0, otherwise it is rejected. + // Additionally, it should not be greater than maximumTimeToLock, otherwise the + // screen timeout is set to maximumTimeToLock and a NonComplianceDetail with + // INVALID_VALUE reason and SCREEN_TIMEOUT_GREATER_THAN_MAXIMUM_TIME_TO_LOCK + // specific reason is reported. If the screen timeout is less than a certain + // lower bound, it is set to the lower bound. The lower bound may vary across + // devices. If this is set, screenTimeoutMode must be SCREEN_TIMEOUT_ENFORCED. + // Supported on Android 9 and above on fully managed devices. A + // NonComplianceDetail with API_LEVEL is reported if the Android version is + // less than 9. + ScreenTimeout string `json:"screenTimeout,omitempty"` + // ScreenTimeoutMode: Optional. Controls whether the user is allowed to + // configure the screen timeout. + // + // Possible values: + // "SCREEN_TIMEOUT_MODE_UNSPECIFIED" - Unspecified. Defaults to + // SCREEN_TIMEOUT_USER_CHOICE. + // "SCREEN_TIMEOUT_USER_CHOICE" - The user is allowed to configure the screen + // timeout. screenTimeout must not be set. + // "SCREEN_TIMEOUT_ENFORCED" - The screen timeout is set to screenTimeout and + // the user is not allowed to configure the timeout. screenTimeout must be set. + // Supported on Android 9 and above on fully managed devices. A + // NonComplianceDetail with API_LEVEL is reported if the Android version is + // less than 9. + ScreenTimeoutMode string `json:"screenTimeoutMode,omitempty"` + // ForceSendFields is a list of field names (e.g. "ScreenTimeout") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ScreenTimeout") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ScreenTimeoutSettings) MarshalJSON() ([]byte, error) { + type NoMethod ScreenTimeoutSettings + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // SecurityPosture: The security posture of the device, as determined by the // current device state and the policies applied. type SecurityPosture struct { diff --git a/api-list.json b/api-list.json index 78974c5999c..d2b50d51fcb 100644 --- a/api-list.json +++ b/api-list.json @@ -1396,21 +1396,6 @@ "documentationLink": "https://cloud.google.com/channel", "preferred": true }, - { - "kind": "discovery#directoryItem", - "id": "cloudcommerceprocurement:v1", - "name": "cloudcommerceprocurement", - "version": "v1", - "title": "Cloud Commerce Partner Procurement API", - "description": "Partner API for the Cloud Commerce Procurement Service.", - "discoveryRestUrl": "https://cloudcommerceprocurement.googleapis.com/$discovery/rest?version=v1", - "icons": { - "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", - "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" - }, - "documentationLink": "https://cloud.google.com/marketplace/docs/partners/", - "preferred": true - }, { "kind": "discovery#directoryItem", "id": "cloudcontrolspartner:v1beta", @@ -4086,6 +4071,21 @@ "documentationLink": "https://developers.google.com/analytics/devguides/config/gmp/v1", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "meet:v2", + "name": "meet", + "version": "v2", + "title": "Google Meet API", + "description": "Create and manage meetings in Google Meet.", + "discoveryRestUrl": "https://meet.googleapis.com/$discovery/rest?version=v2", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://developers.google.com/meet/api", + "preferred": true + }, { "kind": "discovery#directoryItem", "id": "memcache:v1beta2", diff --git a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json index 8ad6eab2297..b0e3e4a9fda 100644 --- a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json +++ b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json @@ -980,7 +980,7 @@ ] }, "addNote": { - "description": "Creates a note for this proposal and sends to the seller.", + "description": "Creates a note for this proposal and sends to the seller. This method is not supported for proposals with DealType set to 'PRIVATE_AUCTION'.", "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}:addNote", "httpMethod": "POST", "id": "authorizedbuyersmarketplace.buyers.proposals.addNote", @@ -1367,7 +1367,7 @@ } } }, - "revision": "20240612", + "revision": "20240618", "rootUrl": "https://authorizedbuyersmarketplace.googleapis.com/", "schemas": { "AcceptProposalRequest": { diff --git a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go index 0fd511a64d1..195c5079d43 100644 --- a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go +++ b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go @@ -5662,7 +5662,9 @@ type BuyersProposalsAddNoteCall struct { header_ http.Header } -// AddNote: Creates a note for this proposal and sends to the seller. +// AddNote: Creates a note for this proposal and sends to the seller. This +// method is not supported for proposals with DealType set to +// 'PRIVATE_AUCTION'. // // - proposal: Name of the proposal. Format: // `buyers/{accountId}/proposals/{proposalId}`. diff --git a/batch/v1/batch-api.json b/batch/v1/batch-api.json index 9d9427e2358..66e6a28e61f 100644 --- a/batch/v1/batch-api.json +++ b/batch/v1/batch-api.json @@ -561,7 +561,7 @@ } } }, - "revision": "20240517", + "revision": "20240607", "rootUrl": "https://batch.googleapis.com/", "schemas": { "Accelerator": { @@ -1151,7 +1151,7 @@ "type": "string" }, "type": { - "description": "Disk type as shown in `gcloud compute disk-types list`. For example, local SSD uses type \"local-ssd\". Persistent disks and boot disks use \"pd-balanced\", \"pd-extreme\", \"pd-ssd\" or \"pd-standard\".", + "description": "Disk type as shown in `gcloud compute disk-types list`. For example, local SSD uses type \"local-ssd\". Persistent disks and boot disks use \"pd-balanced\", \"pd-extreme\", \"pd-ssd\" or \"pd-standard\". If not specified, \"pd-standard\" will be used as the default type for non-boot disks, \"pd-balanced\" will be used as the default type for boot disks.", "type": "string" } }, @@ -1260,6 +1260,10 @@ "description": "Set this field true if you want Batch to help fetch drivers from a third party location and install them for GPUs specified in `policy.accelerators` or `instance_template` on your behalf. Default is false. For Container-Optimized Image cases, Batch will install the accelerator driver following milestones of https://cloud.google.com/container-optimized-os/docs/release-notes. For non Container-Optimized Image cases, following https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.", "type": "boolean" }, + "installOpsAgent": { + "description": "Optional. Set this field true if you want Batch to install Ops Agent on your behalf. Default is false.", + "type": "boolean" + }, "instanceTemplate": { "description": "Name of an instance template used to create VMs. Named the field as 'instance_template' instead of 'template' to avoid c++ keyword conflict.", "type": "string" @@ -1384,7 +1388,7 @@ "description": "The attribute requirements of messages to be sent to this Pub/Sub topic. Without this field, no message will be sent." }, "pubsubTopic": { - "description": "The Pub/Sub topic where notifications like the job state changes will be published. The topic must exist in the same project as the job and billings will be charged to this project. If not specified, no Pub/Sub messages will be sent. Topic format: `projects/{project}/topics/{topic}`.", + "description": "The Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job. Specify the topic using the following format: `projects/{project}/topics/{topic}`. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic. For more information about configuring Pub/Sub notifications for a job, see https://cloud.google.com/batch/docs/enable-notifications.", "type": "string" } }, @@ -2267,7 +2271,7 @@ "description": "A Google Cloud Storage (GCS) volume." }, "mountOptions": { - "description": "For Google Cloud Storage (GCS), mount options are the options supported by the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). For existing persistent disks, mount options provided by the mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of multi-writer mode (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). For other attached disks and Network File System (NFS), mount options are these supported by the mount command (https://man7.org/linux/man-pages/man8/mount.8.html).", + "description": "Mount options vary based on the type of storage volume: * For a Cloud Storage bucket, all the mount options provided by the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) are supported. * For an existing persistent disk, all mount options provided by the [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of [multi-writer mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). * For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported.", "items": { "type": "string" }, diff --git a/batch/v1/batch-gen.go b/batch/v1/batch-gen.go index d943939c4a4..dbb7ab5188e 100644 --- a/batch/v1/batch-gen.go +++ b/batch/v1/batch-gen.go @@ -1036,7 +1036,9 @@ type Disk struct { Snapshot string `json:"snapshot,omitempty"` // Type: Disk type as shown in `gcloud compute disk-types list`. For example, // local SSD uses type "local-ssd". Persistent disks and boot disks use - // "pd-balanced", "pd-extreme", "pd-ssd" or "pd-standard". + // "pd-balanced", "pd-extreme", "pd-ssd" or "pd-standard". If not specified, + // "pd-standard" will be used as the default type for non-boot disks, + // "pd-balanced" will be used as the default type for boot disks. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "DiskInterface") to // unconditionally include in API requests. By default, fields with empty or @@ -1184,6 +1186,9 @@ type InstancePolicyOrTemplate struct { // Container-Optimized Image cases, following // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. InstallGpuDrivers bool `json:"installGpuDrivers,omitempty"` + // InstallOpsAgent: Optional. Set this field true if you want Batch to install + // Ops Agent on your behalf. Default is false. + InstallOpsAgent bool `json:"installOpsAgent,omitempty"` // InstanceTemplate: Name of an instance template used to create VMs. Named the // field as 'instance_template' instead of 'template' to avoid c++ keyword // conflict. @@ -1305,11 +1310,15 @@ type JobNotification struct { // Message: The attribute requirements of messages to be sent to this Pub/Sub // topic. Without this field, no message will be sent. Message *Message `json:"message,omitempty"` - // PubsubTopic: The Pub/Sub topic where notifications like the job state - // changes will be published. The topic must exist in the same project as the - // job and billings will be charged to this project. If not specified, no - // Pub/Sub messages will be sent. Topic format: - // `projects/{project}/topics/{topic}`. + // PubsubTopic: The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications are sent + // for this job. Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. Notably, if you want to specify a + // Pub/Sub topic that is in a different project than the job, your + // administrator must grant your project's Batch service agent permission to + // publish to that topic. For more information about configuring Pub/Sub + // notifications for a job, see + // https://cloud.google.com/batch/docs/enable-notifications. PubsubTopic string `json:"pubsubTopic,omitempty"` // ForceSendFields is a list of field names (e.g. "Message") to unconditionally // include in API requests. By default, fields with empty or default values are @@ -2418,16 +2427,15 @@ type Volume struct { DeviceName string `json:"deviceName,omitempty"` // Gcs: A Google Cloud Storage (GCS) volume. Gcs *GCS `json:"gcs,omitempty"` - // MountOptions: For Google Cloud Storage (GCS), mount options are the options - // supported by the gcsfuse tool - // (https://github.com/GoogleCloudPlatform/gcsfuse). For existing persistent - // disks, mount options provided by the mount command + // MountOptions: Mount options vary based on the type of storage volume: * For + // a Cloud Storage bucket, all the mount options provided by the `gcsfuse` tool + // (https://cloud.google.com/storage/docs/gcsfuse-cli) are supported. * For an + // existing persistent disk, all mount options provided by the `mount` command // (https://man7.org/linux/man-pages/man8/mount.8.html) except writing are // supported. This is due to restrictions of multi-writer mode - // (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). For - // other attached disks and Network File System (NFS), mount options are these - // supported by the mount command - // (https://man7.org/linux/man-pages/man8/mount.8.html). + // (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). * + // For any other disk or a Network File System (NFS), all the mount options + // provided by the `mount` command are supported. MountOptions []string `json:"mountOptions,omitempty"` // MountPath: The mount path for the volume, e.g. /mnt/disks/share. MountPath string `json:"mountPath,omitempty"` diff --git a/bigtableadmin/v2/bigtableadmin-api.json b/bigtableadmin/v2/bigtableadmin-api.json index 077a894686d..15c5e3d7137 100644 --- a/bigtableadmin/v2/bigtableadmin-api.json +++ b/bigtableadmin/v2/bigtableadmin-api.json @@ -2194,7 +2194,7 @@ } } }, - "revision": "20240522", + "revision": "20240604", "rootUrl": "https://bigtableadmin.googleapis.com/", "schemas": { "AppProfile": { @@ -2387,7 +2387,7 @@ "type": "string" }, "expireTime": { - "description": "Required. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 90 days from the time the request is received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free the resources used by the backup.", + "description": "Required. The expiration time of the backup. When creating a backup or updating its `expire_time`, the new value must: - Be at most 90 days in the future - Be at least 6 hours in the future Once the `expire_time` has passed, Cloud Bigtable will delete the backup.", "format": "google-datetime", "type": "string" }, diff --git a/bigtableadmin/v2/bigtableadmin-gen.go b/bigtableadmin/v2/bigtableadmin-gen.go index 0f8a68d37b1..50c2cf642ef 100644 --- a/bigtableadmin/v2/bigtableadmin-gen.go +++ b/bigtableadmin/v2/bigtableadmin-gen.go @@ -596,10 +596,10 @@ type Backup struct { // EndTime: Output only. `end_time` is the time that the backup was finished. // The row data in the backup will be no newer than this timestamp. EndTime string `json:"endTime,omitempty"` - // ExpireTime: Required. The expiration time of the backup, with microseconds - // granularity that must be at least 6 hours and at most 90 days from the time - // the request is received. Once the `expire_time` has passed, Cloud Bigtable - // will delete the backup and free the resources used by the backup. + // ExpireTime: Required. The expiration time of the backup. When creating a + // backup or updating its `expire_time`, the new value must: - Be at most 90 + // days in the future - Be at least 6 hours in the future Once the + // `expire_time` has passed, Cloud Bigtable will delete the backup. ExpireTime string `json:"expireTime,omitempty"` // Name: A globally unique identifier for the backup which cannot be changed. // Values are of the form diff --git a/chat/v1/chat-api.json b/chat/v1/chat-api.json index 394fa4bfaf0..cc6d54d8d17 100644 --- a/chat/v1/chat-api.json +++ b/chat/v1/chat-api.json @@ -433,7 +433,7 @@ "type": "string" }, "updateMask": { - "description": "Required. The updated field paths, comma separated if there are multiple. Currently supported field paths: - `display_name` (Only supports changing the display name of a space with the `SPACE` type, or when also including the `space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument error. If you receive the error message `ALREADY_EXISTS` when updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.) - `space_type` (Only supports changing a `GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `space_type` in the update mask and ensure that the specified space has a non-empty display name and the `SPACE` space type. Including the `space_type` mask and the `SPACE` type in the specified space when updating the display name is optional if the existing space already has the `SPACE` type. Trying to update the space type in other ways results in an invalid argument error). - `space_details` - `space_history_state` (Supports [turning history on or off for the space](https://support.google.com/chat/answer/7664687) if [the organization allows users to change their history setting](https://support.google.com/a/answer/7664184). Warning: mutually exclusive with all other field paths.) - Developer Preview: `access_settings.audience` (Supports changing the [access setting](https://support.google.com/chat/answer/11971020) of a space. If no audience is specified in the access setting, the space's access setting is updated to restricted. Warning: mutually exclusive with all other field paths.)", + "description": "Required. The updated field paths, comma separated if there are multiple. Currently supported field paths: - `display_name` (Only supports changing the display name of a space with the `SPACE` type, or when also including the `space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument error. If you receive the error message `ALREADY_EXISTS` when updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.) - `space_type` (Only supports changing a `GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `space_type` in the update mask and ensure that the specified space has a non-empty display name and the `SPACE` space type. Including the `space_type` mask and the `SPACE` type in the specified space when updating the display name is optional if the existing space already has the `SPACE` type. Trying to update the space type in other ways results in an invalid argument error). `space_type` is not supported with admin access. - `space_details` - `space_history_state` (Supports [turning history on or off for the space](https://support.google.com/chat/answer/7664687) if [the organization allows users to change their history setting](https://support.google.com/a/answer/7664184). Warning: mutually exclusive with all other field paths.) `space_history_state` is not supported with admin access. - Developer Preview: `access_settings.audience` (Supports changing the [access setting](https://support.google.com/chat/answer/11971020) of a space. If no audience is specified in the access setting, the space's access setting is updated to restricted. Warning: mutually exclusive with all other field paths.) `access_settings.audience` is not supported with admin access. - Developer Preview: Supports changing the [permission settings](https://support.google.com/chat/answer/13340792) of a space, supported field paths include: `permission_settings.manage_members_and_groups`, `permission_settings.modify_space_details`, `permission_settings.toggle_history`, `permission_settings.use_at_mention_all`, `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, `permission_settings.reply_messages` (Warning: mutually exclusive with all other non-permission settings field paths). `permission_settings` is not supported with admin access.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -1241,7 +1241,7 @@ } } }, - "revision": "20240604", + "revision": "20240613", "rootUrl": "https://chat.googleapis.com/", "schemas": { "AccessoryWidget": { diff --git a/chat/v1/chat-gen.go b/chat/v1/chat-gen.go index 1c02124065c..04bef42878d 100644 --- a/chat/v1/chat-gen.go +++ b/chat/v1/chat-gen.go @@ -6393,16 +6393,28 @@ func (r *SpacesService) Patch(name string, space *Space) *SpacesPatchCall { // the `SPACE` space type. Including the `space_type` mask and the `SPACE` type // in the specified space when updating the display name is optional if the // existing space already has the `SPACE` type. Trying to update the space type -// in other ways results in an invalid argument error). - `space_details` - -// `space_history_state` (Supports turning history on or off for the space +// in other ways results in an invalid argument error). `space_type` is not +// supported with admin access. - `space_details` - `space_history_state` +// (Supports turning history on or off for the space // (https://support.google.com/chat/answer/7664687) if the organization allows // users to change their history setting // (https://support.google.com/a/answer/7664184). Warning: mutually exclusive -// with all other field paths.) - Developer Preview: `access_settings.audience` -// (Supports changing the access setting +// with all other field paths.) `space_history_state` is not supported with +// admin access. - Developer Preview: `access_settings.audience` (Supports +// changing the access setting // (https://support.google.com/chat/answer/11971020) of a space. If no audience // is specified in the access setting, the space's access setting is updated to // restricted. Warning: mutually exclusive with all other field paths.) +// `access_settings.audience` is not supported with admin access. - Developer +// Preview: Supports changing the permission settings +// (https://support.google.com/chat/answer/13340792) of a space, supported +// field paths include: `permission_settings.manage_members_and_groups`, +// `permission_settings.modify_space_details`, +// `permission_settings.toggle_history`, +// `permission_settings.use_at_mention_all`, `permission_settings.manage_apps`, +// `permission_settings.manage_webhooks`, `permission_settings.reply_messages` +// (Warning: mutually exclusive with all other non-permission settings field +// paths). `permission_settings` is not supported with admin access. func (c *SpacesPatchCall) UpdateMask(updateMask string) *SpacesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c diff --git a/classroom/v1/classroom-api.json b/classroom/v1/classroom-api.json index 9c4bf9c582c..954de8b7d2f 100644 --- a/classroom/v1/classroom-api.json +++ b/classroom/v1/classroom-api.json @@ -548,6 +548,50 @@ "https://www.googleapis.com/auth/classroom.announcements.readonly" ] }, + "getAddOnContext": { + "description": "Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/announcements/{itemId}/addOnContext", + "httpMethod": "GET", + "id": "classroom.courses.announcements.getAddOnContext", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. The authorization token is required when neither of the following is true: * The add-on has attachments on the post. * The developer project issuing the request is the same project that created the post.", + "location": "query", + "type": "string" + }, + "attachmentId": { + "description": "Optional. The identifier of the attachment. This field is required for student users and optional for teacher users. If not provided in the student case, an error is returned.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/announcements/{itemId}/addOnContext", + "response": { + "$ref": "AddOnContext" + } + }, "list": { "description": "Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.", "flatPath": "v1/courses/{courseId}/announcements", @@ -681,6 +725,230 @@ "https://www.googleapis.com/auth/classroom.announcements" ] } + }, + "resources": { + "addOnAttachments": { + "methods": { + "create": { + "description": "Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments", + "httpMethod": "POST", + "id": "classroom.courses.announcements.addOnAttachments.create", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. This authorization token is required for in-Classroom attachment creation but optional for partner-first attachment creation. Returns an error if not provided for partner-first attachment creation and the developer projects that created the attachment and its parent stream item do not match.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which to create the attachment. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } + }, + "delete": { + "description": "Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "DELETE", + "id": "classroom.courses.announcements.addOnAttachments.delete", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "Empty" + } + }, + "get": { + "description": "Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "GET", + "id": "classroom.courses.announcements.addOnAttachments.get", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "AddOnAttachment" + } + }, + "list": { + "description": "Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments", + "httpMethod": "GET", + "id": "classroom.courses.announcements.addOnAttachments.list", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial whose attachments should be enumerated. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The maximum number of attachments to return. The service may return fewer than this value. If unspecified, at most 20 attachments will be returned. The maximum value is 20; values above 20 will be coerced to 20.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListAddOnAttachments` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAddOnAttachments` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Identifier of the post under the course whose attachments to enumerate. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments", + "response": { + "$ref": "ListAddOnAttachmentsResponse" + } + }, + "patch": { + "description": "Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "PATCH", + "id": "classroom.courses.announcements.addOnAttachments.patch", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the post under which the attachment is attached.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "description": "Required. Identifier of the post under which the attachment is attached.", + "location": "query", + "type": "string" + }, + "updateMask": { + "description": "Required. Mask that identifies which fields on the attachment to update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `AddOnAttachment` object. If a field that does not support empty values is included in the update mask and not set in the `AddOnAttachment` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * `student_work_review_uri` * `due_date` * `due_time` * `max_points`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } + } + } + } } }, "courseWork": { @@ -777,6 +1045,50 @@ "https://www.googleapis.com/auth/classroom.coursework.students.readonly" ] }, + "getAddOnContext": { + "description": "Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnContext", + "httpMethod": "GET", + "id": "classroom.courses.courseWork.getAddOnContext", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. The authorization token is required when neither of the following is true: * The add-on has attachments on the post. * The developer project issuing the request is the same project that created the post.", + "location": "query", + "type": "string" + }, + "attachmentId": { + "description": "Optional. The identifier of the attachment. This field is required for student users and optional for teacher users. If not provided in the student case, an error is returned.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnContext", + "response": { + "$ref": "AddOnContext" + } + }, "list": { "description": "Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.", "flatPath": "v1/courses/{courseId}/courseWork", @@ -914,90 +1226,426 @@ } }, "resources": { - "studentSubmissions": { + "addOnAttachments": { "methods": { - "get": { - "description": "Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist.", - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", - "httpMethod": "GET", - "id": "classroom.courses.courseWork.studentSubmissions.get", + "create": { + "description": "Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments", + "httpMethod": "POST", + "id": "classroom.courses.courseWork.addOnAttachments.create", "parameterOrder": [ "courseId", - "courseWorkId", - "id" + "itemId" ], "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. This authorization token is required for in-Classroom attachment creation but optional for partner-first attachment creation. Returns an error if not provided for partner-first attachment creation and the developer projects that created the attachment and its parent stream item do not match.", + "location": "query", + "type": "string" + }, "courseId": { - "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "description": "Required. Identifier of the course.", "location": "path", "required": true, "type": "string" }, - "courseWorkId": { - "description": "Identifier of the course work.", + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which to create the attachment. This field is required, but is not marked as such while we are migrating from post_id.", "location": "path", "required": true, "type": "string" }, - "id": { - "description": "Identifier of the student submission.", - "location": "path", - "required": true, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", "type": "string" } }, - "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", - "response": { - "$ref": "StudentSubmission" + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments", + "request": { + "$ref": "AddOnAttachment" }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.me.readonly", - "https://www.googleapis.com/auth/classroom.coursework.students", - "https://www.googleapis.com/auth/classroom.coursework.students.readonly", - "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", - "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" - ] + "response": { + "$ref": "AddOnAttachment" + } }, - "list": { - "description": "Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.", - "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", - "httpMethod": "GET", - "id": "classroom.courses.courseWork.studentSubmissions.list", + "delete": { + "description": "Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "DELETE", + "id": "classroom.courses.courseWork.addOnAttachments.delete", "parameterOrder": [ "courseId", - "courseWorkId" + "itemId", + "attachmentId" ], "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, "courseId": { - "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "description": "Required. Identifier of the course.", "location": "path", "required": true, "type": "string" }, - "courseWorkId": { - "description": "Identifier of the student work to request. This may be set to the string literal `\"-\"` to request student work for all course work in the specified course.", + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", "location": "path", "required": true, "type": "string" }, - "late": { - "description": "Requested lateness value. If specified, returned student submissions are restricted by the requested value. If unspecified, submissions are returned regardless of `late` value.", - "enum": [ - "LATE_VALUES_UNSPECIFIED", - "LATE_ONLY", - "NOT_LATE_ONLY" - ], - "enumDescriptions": [ - "No restriction on submission late values specified.", - "Return StudentSubmissions where late is true.", - "Return StudentSubmissions where late is false." - ], + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", "location": "query", "type": "string" - }, - "pageSize": { - "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "Empty" + } + }, + "get": { + "description": "Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "GET", + "id": "classroom.courses.courseWork.addOnAttachments.get", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "AddOnAttachment" + } + }, + "list": { + "description": "Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments", + "httpMethod": "GET", + "id": "classroom.courses.courseWork.addOnAttachments.list", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial whose attachments should be enumerated. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The maximum number of attachments to return. The service may return fewer than this value. If unspecified, at most 20 attachments will be returned. The maximum value is 20; values above 20 will be coerced to 20.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListAddOnAttachments` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAddOnAttachments` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Identifier of the post under the course whose attachments to enumerate. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments", + "response": { + "$ref": "ListAddOnAttachmentsResponse" + } + }, + "patch": { + "description": "Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "PATCH", + "id": "classroom.courses.courseWork.addOnAttachments.patch", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the post under which the attachment is attached.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "description": "Required. Identifier of the post under which the attachment is attached.", + "location": "query", + "type": "string" + }, + "updateMask": { + "description": "Required. Mask that identifies which fields on the attachment to update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `AddOnAttachment` object. If a field that does not support empty values is included in the update mask and not set in the `AddOnAttachment` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * `student_work_review_uri` * `due_date` * `due_time` * `max_points`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } + } + }, + "resources": { + "studentSubmissions": { + "methods": { + "get": { + "description": "Returns a student submission for an add-on attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "httpMethod": "GET", + "id": "classroom.courses.courseWork.addOnAttachments.studentSubmissions.get", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId", + "submissionId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + }, + "submissionId": { + "description": "Required. Identifier of the student’s submission.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "response": { + "$ref": "AddOnAttachmentStudentSubmission" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" + ] + }, + "patch": { + "description": "Updates data associated with an add-on attachment submission. Requires the add-on to have been the original creator of the attachment and the attachment to have a positive `max_points` value set. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "httpMethod": "PATCH", + "id": "classroom.courses.courseWork.addOnAttachments.studentSubmissions.patch", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId", + "submissionId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + }, + "submissionId": { + "description": "Required. Identifier of the student's submission.", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. Mask that identifies which fields on the attachment to update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `AddOnAttachmentStudentSubmission` object. The following fields may be specified by teachers: * `points_earned`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "request": { + "$ref": "AddOnAttachmentStudentSubmission" + }, + "response": { + "$ref": "AddOnAttachmentStudentSubmission" + } + } + } + } + } + }, + "studentSubmissions": { + "methods": { + "get": { + "description": "Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", + "httpMethod": "GET", + "id": "classroom.courses.courseWork.studentSubmissions.get", + "parameterOrder": [ + "courseId", + "courseWorkId", + "id" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "location": "path", + "required": true, + "type": "string" + }, + "courseWorkId": { + "description": "Identifier of the course work.", + "location": "path", + "required": true, + "type": "string" + }, + "id": { + "description": "Identifier of the student submission.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", + "response": { + "$ref": "StudentSubmission" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me", + "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + "https://www.googleapis.com/auth/classroom.coursework.students", + "https://www.googleapis.com/auth/classroom.coursework.students.readonly", + "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", + "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" + ] + }, + "list": { + "description": "Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.", + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", + "httpMethod": "GET", + "id": "classroom.courses.courseWork.studentSubmissions.list", + "parameterOrder": [ + "courseId", + "courseWorkId" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "location": "path", + "required": true, + "type": "string" + }, + "courseWorkId": { + "description": "Identifier of the student work to request. This may be set to the string literal `\"-\"` to request student work for all course work in the specified course.", + "location": "path", + "required": true, + "type": "string" + }, + "late": { + "description": "Requested lateness value. If specified, returned student submissions are restricted by the requested value. If unspecified, submissions are returned regardless of `late` value.", + "enum": [ + "LATE_VALUES_UNSPECIFIED", + "LATE_ONLY", + "NOT_LATE_ONLY" + ], + "enumDescriptions": [ + "No restriction on submission late values specified.", + "Return StudentSubmissions where late is true.", + "Return StudentSubmissions where late is false." + ], + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", "format": "int32", "location": "query", "type": "integer" @@ -1357,6 +2005,50 @@ "https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly" ] }, + "getAddOnContext": { + "description": "Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnContext", + "httpMethod": "GET", + "id": "classroom.courses.courseWorkMaterials.getAddOnContext", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. The authorization token is required when neither of the following is true: * The add-on has attachments on the post. * The developer project issuing the request is the same project that created the post.", + "location": "query", + "type": "string" + }, + "attachmentId": { + "description": "Optional. The identifier of the attachment. This field is required for student users and optional for teacher users. If not provided in the student case, an error is returned.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnContext", + "response": { + "$ref": "AddOnContext" + } + }, "list": { "description": "Returns a list of course work material that the requester is permitted to view. Course students may only view `PUBLISHED` course work material. Course teachers and domain administrators may view all course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.", "flatPath": "v1/courses/{courseId}/courseWorkMaterials", @@ -1405,66 +2097,669 @@ "location": "query", "type": "string" }, - "pageSize": { - "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", - "format": "int32", - "location": "query", - "type": "integer" + "pageSize": { + "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials", + "response": { + "$ref": "ListCourseWorkMaterialResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courseworkmaterials", + "https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly" + ] + }, + "patch": { + "description": "Updates one or more fields of a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested course work material has already been deleted. * `NOT_FOUND` if the requested course or course work material does not exist", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{id}", + "httpMethod": "PATCH", + "id": "classroom.courses.courseWorkMaterials.patch", + "parameterOrder": [ + "courseId", + "id" + ], + "parameters": { + "courseId": { + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "location": "path", + "required": true, + "type": "string" + }, + "id": { + "description": "Identifier of the course work material.", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Mask that identifies which fields on the course work material to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the course work material object. If a field that does not support empty values is included in the update mask and not set in the course work material object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `description` * `state` * `scheduled_time` * `topic_id`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{id}", + "request": { + "$ref": "CourseWorkMaterial" + }, + "response": { + "$ref": "CourseWorkMaterial" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courseworkmaterials" + ] + } + }, + "resources": { + "addOnAttachments": { + "methods": { + "create": { + "description": "Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments", + "httpMethod": "POST", + "id": "classroom.courses.courseWorkMaterials.addOnAttachments.create", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. This authorization token is required for in-Classroom attachment creation but optional for partner-first attachment creation. Returns an error if not provided for partner-first attachment creation and the developer projects that created the attachment and its parent stream item do not match.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which to create the attachment. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } + }, + "delete": { + "description": "Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "DELETE", + "id": "classroom.courses.courseWorkMaterials.addOnAttachments.delete", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "Empty" + } + }, + "get": { + "description": "Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "GET", + "id": "classroom.courses.courseWorkMaterials.addOnAttachments.get", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "AddOnAttachment" + } + }, + "list": { + "description": "Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments", + "httpMethod": "GET", + "id": "classroom.courses.courseWorkMaterials.addOnAttachments.list", + "parameterOrder": [ + "courseId", + "itemId" + ], + "parameters": { + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial whose attachments should be enumerated. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The maximum number of attachments to return. The service may return fewer than this value. If unspecified, at most 20 attachments will be returned. The maximum value is 20; values above 20 will be coerced to 20.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListAddOnAttachments` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAddOnAttachments` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Optional. Identifier of the post under the course whose attachments to enumerate. Deprecated, use item_id instead.", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments", + "response": { + "$ref": "ListAddOnAttachmentsResponse" + } + }, + "patch": { + "description": "Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}", + "httpMethod": "PATCH", + "id": "classroom.courses.courseWorkMaterials.addOnAttachments.patch", + "parameterOrder": [ + "courseId", + "itemId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the post under which the attachment is attached.", + "location": "path", + "required": true, + "type": "string" + }, + "postId": { + "description": "Required. Identifier of the post under which the attachment is attached.", + "location": "query", + "type": "string" + }, + "updateMask": { + "description": "Required. Mask that identifies which fields on the attachment to update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `AddOnAttachment` object. If a field that does not support empty values is included in the update mask and not set in the `AddOnAttachment` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * `student_work_review_uri` * `due_date` * `due_time` * `max_points`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } + } + } + } + } + }, + "posts": { + "methods": { + "getAddOnContext": { + "description": "Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnContext", + "httpMethod": "GET", + "id": "classroom.courses.posts.getAddOnContext", + "parameterOrder": [ + "courseId", + "postId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. The authorization token is required when neither of the following is true: * The add-on has attachments on the post. * The developer project issuing the request is the same project that created the post.", + "location": "query", + "type": "string" + }, + "attachmentId": { + "description": "Optional. The identifier of the attachment. This field is required for student users and optional for teacher users. If not provided in the student case, an error is returned.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnContext", + "response": { + "$ref": "AddOnContext" + } + } + }, + "resources": { + "addOnAttachments": { + "methods": { + "create": { + "description": "Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments", + "httpMethod": "POST", + "id": "classroom.courses.posts.addOnAttachments.create", + "parameterOrder": [ + "courseId", + "postId" + ], + "parameters": { + "addOnToken": { + "description": "Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. This authorization token is required for in-Classroom attachment creation but optional for partner-first attachment creation. Returns an error if not provided for partner-first attachment creation and the developer projects that created the attachment and its parent stream item do not match.", + "location": "query", + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which to create the attachment. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } + }, + "delete": { + "description": "Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}", + "httpMethod": "DELETE", + "id": "classroom.courses.posts.addOnAttachments.delete", + "parameterOrder": [ + "courseId", + "postId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "Empty" + } + }, + "get": { + "description": "Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}", + "httpMethod": "GET", + "id": "classroom.courses.posts.addOnAttachments.get", + "parameterOrder": [ + "courseId", + "postId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}", + "response": { + "$ref": "AddOnAttachment" + } + }, + "list": { + "description": "Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments", + "httpMethod": "GET", + "id": "classroom.courses.posts.addOnAttachments.list", + "parameterOrder": [ + "courseId", + "postId" + ], + "parameters": { + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial whose attachments should be enumerated. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of attachments to return. The service may return fewer than this value. If unspecified, at most 20 attachments will be returned. The maximum value is 20; values above 20 will be coerced to 20.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListAddOnAttachments` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAddOnAttachments` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Identifier of the post under the course whose attachments to enumerate. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments", + "response": { + "$ref": "ListAddOnAttachmentsResponse" + } }, - "pageToken": { - "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", - "location": "query", - "type": "string" + "patch": { + "description": "Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}", + "httpMethod": "PATCH", + "id": "classroom.courses.posts.addOnAttachments.patch", + "parameterOrder": [ + "courseId", + "postId", + "attachmentId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the post under which the attachment is attached.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Required. Identifier of the post under which the attachment is attached.", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. Mask that identifies which fields on the attachment to update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `AddOnAttachment` object. If a field that does not support empty values is included in the update mask and not set in the `AddOnAttachment` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * `student_work_review_uri` * `due_date` * `due_time` * `max_points`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}", + "request": { + "$ref": "AddOnAttachment" + }, + "response": { + "$ref": "AddOnAttachment" + } } }, - "path": "v1/courses/{courseId}/courseWorkMaterials", - "response": { - "$ref": "ListCourseWorkMaterialResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.courseworkmaterials", - "https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly" - ] - }, - "patch": { - "description": "Updates one or more fields of a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested course work material has already been deleted. * `NOT_FOUND` if the requested course or course work material does not exist", - "flatPath": "v1/courses/{courseId}/courseWorkMaterials/{id}", - "httpMethod": "PATCH", - "id": "classroom.courses.courseWorkMaterials.patch", - "parameterOrder": [ - "courseId", - "id" - ], - "parameters": { - "courseId": { - "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", - "location": "path", - "required": true, - "type": "string" - }, - "id": { - "description": "Identifier of the course work material.", - "location": "path", - "required": true, - "type": "string" - }, - "updateMask": { - "description": "Mask that identifies which fields on the course work material to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the course work material object. If a field that does not support empty values is included in the update mask and not set in the course work material object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `description` * `state` * `scheduled_time` * `topic_id`", - "format": "google-fieldmask", - "location": "query", - "type": "string" + "resources": { + "studentSubmissions": { + "methods": { + "get": { + "description": "Returns a student submission for an add-on attachment. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "httpMethod": "GET", + "id": "classroom.courses.posts.addOnAttachments.studentSubmissions.get", + "parameterOrder": [ + "courseId", + "postId", + "attachmentId", + "submissionId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + }, + "submissionId": { + "description": "Required. Identifier of the student’s submission.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "response": { + "$ref": "AddOnAttachmentStudentSubmission" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly" + ] + }, + "patch": { + "description": "Updates data associated with an add-on attachment submission. Requires the add-on to have been the original creator of the attachment and the attachment to have a positive `max_points` value set. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.", + "flatPath": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "httpMethod": "PATCH", + "id": "classroom.courses.posts.addOnAttachments.studentSubmissions.patch", + "parameterOrder": [ + "courseId", + "postId", + "attachmentId", + "submissionId" + ], + "parameters": { + "attachmentId": { + "description": "Required. Identifier of the attachment.", + "location": "path", + "required": true, + "type": "string" + }, + "courseId": { + "description": "Required. Identifier of the course.", + "location": "path", + "required": true, + "type": "string" + }, + "itemId": { + "description": "Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.", + "location": "query", + "type": "string" + }, + "postId": { + "description": "Optional. Deprecated, use item_id instead.", + "location": "path", + "required": true, + "type": "string" + }, + "submissionId": { + "description": "Required. Identifier of the student's submission.", + "location": "path", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. Mask that identifies which fields on the attachment to update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `AddOnAttachmentStudentSubmission` object. The following fields may be specified by teachers: * `points_earned`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}", + "request": { + "$ref": "AddOnAttachmentStudentSubmission" + }, + "response": { + "$ref": "AddOnAttachmentStudentSubmission" + } + } + } } - }, - "path": "v1/courses/{courseId}/courseWorkMaterials/{id}", - "request": { - "$ref": "CourseWorkMaterial" - }, - "response": { - "$ref": "CourseWorkMaterial" - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.courseworkmaterials" - ] + } } } }, @@ -2400,9 +3695,138 @@ } } }, - "revision": "20231121", + "revision": "20240617", "rootUrl": "https://classroom.googleapis.com/", "schemas": { + "AddOnAttachment": { + "description": "An add-on attachment on a post.", + "id": "AddOnAttachment", + "properties": { + "copyHistory": { + "description": "Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy.", + "items": { + "$ref": "CopyHistory" + }, + "readOnly": true, + "type": "array" + }, + "courseId": { + "description": "Immutable. Identifier of the course.", + "type": "string" + }, + "dueDate": { + "$ref": "Date", + "description": "Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified." + }, + "dueTime": { + "$ref": "TimeOfDay", + "description": "Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified." + }, + "id": { + "description": "Immutable. Classroom-assigned identifier for this attachment, unique per post.", + "type": "string" + }, + "itemId": { + "description": "Immutable. Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. Unique per course.", + "type": "string" + }, + "maxPoints": { + "description": "Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback.", + "format": "double", + "type": "number" + }, + "postId": { + "deprecated": true, + "description": "Immutable. Deprecated, use item_id instead.", + "type": "string" + }, + "studentViewUri": { + "$ref": "EmbedUri", + "description": "Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `postId`, and `attachmentId` query parameters set." + }, + "studentWorkReviewUri": { + "$ref": "EmbedUri", + "description": "URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `postId`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned by google.classroom.AddOns.GetAddOnContext when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded." + }, + "teacherViewUri": { + "$ref": "EmbedUri", + "description": "Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `postId`, and `attachmentId` query parameters set." + }, + "title": { + "description": "Required. Title of this attachment. The title must be between 1 and 1000 characters.", + "type": "string" + } + }, + "type": "object" + }, + "AddOnAttachmentStudentSubmission": { + "description": "Payload for grade update requests.", + "id": "AddOnAttachmentStudentSubmission", + "properties": { + "pointsEarned": { + "description": "Student grade on this attachment. If unset, no grade was set.", + "format": "double", + "type": "number" + }, + "postSubmissionState": { + "description": "Submission state of add-on attachment's parent post (i.e. assignment).", + "enum": [ + "SUBMISSION_STATE_UNSPECIFIED", + "NEW", + "CREATED", + "TURNED_IN", + "RETURNED", + "RECLAIMED_BY_STUDENT" + ], + "enumDescriptions": [ + "No state specified. This should never be returned.", + "The student has never accessed this submission. Attachments are not returned and timestamps is not set.", + "Has been created.", + "Has been turned in to the teacher.", + "Has been returned to the student.", + "Student chose to \"unsubmit\" the assignment." + ], + "type": "string" + }, + "userId": { + "description": "Identifier for the student that owns this submission. This field is part of an experimental API change and is populated only if sufficient scopes are granted.", + "type": "string" + } + }, + "type": "object" + }, + "AddOnContext": { + "description": "Attachment-relevant metadata for Classroom add-ons in the context of a specific post.", + "id": "AddOnContext", + "properties": { + "courseId": { + "description": "Immutable. Identifier of the course.", + "type": "string" + }, + "itemId": { + "description": "Immutable. Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached.", + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Immutable. Deprecated, use item_id instead.", + "type": "string" + }, + "studentContext": { + "$ref": "StudentContext", + "description": "Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course." + }, + "supportsStudentWork": { + "description": "Optional. Whether the post allows the teacher to see student work and passback grades.", + "type": "boolean" + }, + "teacherContext": { + "$ref": "TeacherContext", + "description": "Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course." + } + }, + "type": "object" + }, "Announcement": { "description": "Announcement created by a teacher for students of the course", "id": "Announcement", @@ -2545,6 +3969,30 @@ }, "type": "object" }, + "CopyHistory": { + "description": "Identifier of a previous copy of a given attachment.", + "id": "CopyHistory", + "properties": { + "attachmentId": { + "description": "Immutable. Identifier of the attachment.", + "type": "string" + }, + "courseId": { + "description": "Immutable. Identifier of the course.", + "type": "string" + }, + "itemId": { + "description": "Immutable. Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached.", + "type": "string" + }, + "postId": { + "deprecated": true, + "description": "Immutable. Deprecated, use item_id instead.", + "type": "string" + } + }, + "type": "object" + }, "Course": { "description": "A Course in Classroom.", "id": "Course", @@ -3029,6 +4477,17 @@ }, "type": "object" }, + "EmbedUri": { + "description": "URI to be iframed after being populated with query parameters.", + "id": "EmbedUri", + "properties": { + "uri": { + "description": "Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.", + "type": "string" + } + }, + "type": "object" + }, "Empty": { "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", "id": "Empty", @@ -3348,6 +4807,24 @@ }, "type": "object" }, + "ListAddOnAttachmentsResponse": { + "description": "Response when listing add-on attachments.", + "id": "ListAddOnAttachmentsResponse", + "properties": { + "addOnAttachments": { + "description": "Attachments under the given post.", + "items": { + "$ref": "AddOnAttachment" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, "ListAnnouncementsResponse": { "description": "Response when listing course work.", "id": "ListAnnouncementsResponse", @@ -3849,6 +5326,17 @@ }, "type": "object" }, + "StudentContext": { + "description": "Role-specific context if the requesting user is a student.", + "id": "StudentContext", + "properties": { + "submissionId": { + "description": "Requesting user's submission id to be used for grade passback and to identify the student when showing student work to the teacher. This is set exactly when `supportsStudentWork` is `true`.", + "type": "string" + } + }, + "type": "object" + }, "StudentSubmission": { "description": "Student submission for course work. `StudentSubmission` items are generated when a `CourseWork` item is created. Student submissions that have never been accessed (i.e. with `state` = NEW) may not have a creation time or update time.", "id": "StudentSubmission", @@ -3993,6 +5481,12 @@ }, "type": "object" }, + "TeacherContext": { + "description": "Role-specific context if the requesting user is a teacher.", + "id": "TeacherContext", + "properties": {}, + "type": "object" + }, "TimeOfDay": { "description": "Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.", "id": "TimeOfDay", diff --git a/classroom/v1/classroom-gen.go b/classroom/v1/classroom-gen.go index bf42be86802..78d540d1dc2 100644 --- a/classroom/v1/classroom-gen.go +++ b/classroom/v1/classroom-gen.go @@ -261,6 +261,7 @@ func NewCoursesService(s *Service) *CoursesService { rs.Announcements = NewCoursesAnnouncementsService(s) rs.CourseWork = NewCoursesCourseWorkService(s) rs.CourseWorkMaterials = NewCoursesCourseWorkMaterialsService(s) + rs.Posts = NewCoursesPostsService(s) rs.Students = NewCoursesStudentsService(s) rs.Teachers = NewCoursesTeachersService(s) rs.Topics = NewCoursesTopicsService(s) @@ -278,6 +279,8 @@ type CoursesService struct { CourseWorkMaterials *CoursesCourseWorkMaterialsService + Posts *CoursesPostsService + Students *CoursesStudentsService Teachers *CoursesTeachersService @@ -296,15 +299,28 @@ type CoursesAliasesService struct { func NewCoursesAnnouncementsService(s *Service) *CoursesAnnouncementsService { rs := &CoursesAnnouncementsService{s: s} + rs.AddOnAttachments = NewCoursesAnnouncementsAddOnAttachmentsService(s) return rs } type CoursesAnnouncementsService struct { s *Service + + AddOnAttachments *CoursesAnnouncementsAddOnAttachmentsService +} + +func NewCoursesAnnouncementsAddOnAttachmentsService(s *Service) *CoursesAnnouncementsAddOnAttachmentsService { + rs := &CoursesAnnouncementsAddOnAttachmentsService{s: s} + return rs +} + +type CoursesAnnouncementsAddOnAttachmentsService struct { + s *Service } func NewCoursesCourseWorkService(s *Service) *CoursesCourseWorkService { rs := &CoursesCourseWorkService{s: s} + rs.AddOnAttachments = NewCoursesCourseWorkAddOnAttachmentsService(s) rs.StudentSubmissions = NewCoursesCourseWorkStudentSubmissionsService(s) return rs } @@ -312,9 +328,32 @@ func NewCoursesCourseWorkService(s *Service) *CoursesCourseWorkService { type CoursesCourseWorkService struct { s *Service + AddOnAttachments *CoursesCourseWorkAddOnAttachmentsService + StudentSubmissions *CoursesCourseWorkStudentSubmissionsService } +func NewCoursesCourseWorkAddOnAttachmentsService(s *Service) *CoursesCourseWorkAddOnAttachmentsService { + rs := &CoursesCourseWorkAddOnAttachmentsService{s: s} + rs.StudentSubmissions = NewCoursesCourseWorkAddOnAttachmentsStudentSubmissionsService(s) + return rs +} + +type CoursesCourseWorkAddOnAttachmentsService struct { + s *Service + + StudentSubmissions *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsService +} + +func NewCoursesCourseWorkAddOnAttachmentsStudentSubmissionsService(s *Service) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsService { + rs := &CoursesCourseWorkAddOnAttachmentsStudentSubmissionsService{s: s} + return rs +} + +type CoursesCourseWorkAddOnAttachmentsStudentSubmissionsService struct { + s *Service +} + func NewCoursesCourseWorkStudentSubmissionsService(s *Service) *CoursesCourseWorkStudentSubmissionsService { rs := &CoursesCourseWorkStudentSubmissionsService{s: s} return rs @@ -326,11 +365,56 @@ type CoursesCourseWorkStudentSubmissionsService struct { func NewCoursesCourseWorkMaterialsService(s *Service) *CoursesCourseWorkMaterialsService { rs := &CoursesCourseWorkMaterialsService{s: s} + rs.AddOnAttachments = NewCoursesCourseWorkMaterialsAddOnAttachmentsService(s) return rs } type CoursesCourseWorkMaterialsService struct { s *Service + + AddOnAttachments *CoursesCourseWorkMaterialsAddOnAttachmentsService +} + +func NewCoursesCourseWorkMaterialsAddOnAttachmentsService(s *Service) *CoursesCourseWorkMaterialsAddOnAttachmentsService { + rs := &CoursesCourseWorkMaterialsAddOnAttachmentsService{s: s} + return rs +} + +type CoursesCourseWorkMaterialsAddOnAttachmentsService struct { + s *Service +} + +func NewCoursesPostsService(s *Service) *CoursesPostsService { + rs := &CoursesPostsService{s: s} + rs.AddOnAttachments = NewCoursesPostsAddOnAttachmentsService(s) + return rs +} + +type CoursesPostsService struct { + s *Service + + AddOnAttachments *CoursesPostsAddOnAttachmentsService +} + +func NewCoursesPostsAddOnAttachmentsService(s *Service) *CoursesPostsAddOnAttachmentsService { + rs := &CoursesPostsAddOnAttachmentsService{s: s} + rs.StudentSubmissions = NewCoursesPostsAddOnAttachmentsStudentSubmissionsService(s) + return rs +} + +type CoursesPostsAddOnAttachmentsService struct { + s *Service + + StudentSubmissions *CoursesPostsAddOnAttachmentsStudentSubmissionsService +} + +func NewCoursesPostsAddOnAttachmentsStudentSubmissionsService(s *Service) *CoursesPostsAddOnAttachmentsStudentSubmissionsService { + rs := &CoursesPostsAddOnAttachmentsStudentSubmissionsService{s: s} + return rs +} + +type CoursesPostsAddOnAttachmentsStudentSubmissionsService struct { + s *Service } func NewCoursesStudentsService(s *Service) *CoursesStudentsService { @@ -411,6 +495,188 @@ type UserProfilesGuardiansService struct { s *Service } +// AddOnAttachment: An add-on attachment on a post. +type AddOnAttachment struct { + // CopyHistory: Output only. Identifiers of attachments that were previous + // copies of this attachment. If the attachment was previously copied by virtue + // of its parent post being copied, this enumerates the identifiers of + // attachments that were its previous copies in ascending chronological order + // of copy. + CopyHistory []*CopyHistory `json:"copyHistory,omitempty"` + // CourseId: Immutable. Identifier of the course. + CourseId string `json:"courseId,omitempty"` + // DueDate: Date, in UTC, that work on this attachment is due. This must be + // specified if `due_time` is specified. + DueDate *Date `json:"dueDate,omitempty"` + // DueTime: Time of day, in UTC, that work on this attachment is due. This must + // be specified if `due_date` is specified. + DueTime *TimeOfDay `json:"dueTime,omitempty"` + // Id: Immutable. Classroom-assigned identifier for this attachment, unique per + // post. + Id string `json:"id,omitempty"` + // ItemId: Immutable. Identifier of the announcement, courseWork, or + // courseWorkMaterial under which the attachment is attached. Unique per + // course. + ItemId string `json:"itemId,omitempty"` + // MaxPoints: Maximum grade for this attachment. Can only be set if + // `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the + // attachment supports grade passback. If set, this must be a non-negative + // integer value. When set to zero, the attachment will not support grade + // passback. + MaxPoints float64 `json:"maxPoints,omitempty"` + // PostId: Immutable. Deprecated, use item_id instead. + PostId string `json:"postId,omitempty"` + // StudentViewUri: Required. URI to show the student view of the attachment. + // The URI will be opened in an iframe with the `courseId`, `postId`, and + // `attachmentId` query parameters set. + StudentViewUri *EmbedUri `json:"studentViewUri,omitempty"` + // StudentWorkReviewUri: URI for the teacher to see student work on the + // attachment, if applicable. The URI will be opened in an iframe with the + // `courseId`, `postId`, `attachmentId`, and `submissionId` query parameters + // set. This is the same `submissionId` returned by + // google.classroom.AddOns.GetAddOnContext when a student views the attachment. + // If the URI is omitted or removed, `max_points` will also be discarded. + StudentWorkReviewUri *EmbedUri `json:"studentWorkReviewUri,omitempty"` + // TeacherViewUri: Required. URI to show the teacher view of the attachment. + // The URI will be opened in an iframe with the `courseId`, `postId`, and + // `attachmentId` query parameters set. + TeacherViewUri *EmbedUri `json:"teacherViewUri,omitempty"` + // Title: Required. Title of this attachment. The title must be between 1 and + // 1000 characters. + Title string `json:"title,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CopyHistory") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CopyHistory") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AddOnAttachment) MarshalJSON() ([]byte, error) { + type NoMethod AddOnAttachment + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *AddOnAttachment) UnmarshalJSON(data []byte) error { + type NoMethod AddOnAttachment + var s1 struct { + MaxPoints gensupport.JSONFloat64 `json:"maxPoints"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.MaxPoints = float64(s1.MaxPoints) + return nil +} + +// AddOnAttachmentStudentSubmission: Payload for grade update requests. +type AddOnAttachmentStudentSubmission struct { + // PointsEarned: Student grade on this attachment. If unset, no grade was set. + PointsEarned float64 `json:"pointsEarned,omitempty"` + // PostSubmissionState: Submission state of add-on attachment's parent post + // (i.e. assignment). + // + // Possible values: + // "SUBMISSION_STATE_UNSPECIFIED" - No state specified. This should never be + // returned. + // "NEW" - The student has never accessed this submission. Attachments are + // not returned and timestamps is not set. + // "CREATED" - Has been created. + // "TURNED_IN" - Has been turned in to the teacher. + // "RETURNED" - Has been returned to the student. + // "RECLAIMED_BY_STUDENT" - Student chose to "unsubmit" the assignment. + PostSubmissionState string `json:"postSubmissionState,omitempty"` + // UserId: Identifier for the student that owns this submission. This field is + // part of an experimental API change and is populated only if sufficient + // scopes are granted. + UserId string `json:"userId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "PointsEarned") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "PointsEarned") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AddOnAttachmentStudentSubmission) MarshalJSON() ([]byte, error) { + type NoMethod AddOnAttachmentStudentSubmission + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *AddOnAttachmentStudentSubmission) UnmarshalJSON(data []byte) error { + type NoMethod AddOnAttachmentStudentSubmission + var s1 struct { + PointsEarned gensupport.JSONFloat64 `json:"pointsEarned"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.PointsEarned = float64(s1.PointsEarned) + return nil +} + +// AddOnContext: Attachment-relevant metadata for Classroom add-ons in the +// context of a specific post. +type AddOnContext struct { + // CourseId: Immutable. Identifier of the course. + CourseId string `json:"courseId,omitempty"` + // ItemId: Immutable. Identifier of the announcement, courseWork, or + // courseWorkMaterial under which the attachment is attached. + ItemId string `json:"itemId,omitempty"` + // PostId: Immutable. Deprecated, use item_id instead. + PostId string `json:"postId,omitempty"` + // StudentContext: Add-on context corresponding to the requesting user's role + // as a student. Its presence implies that the requesting user is a student in + // the course. + StudentContext *StudentContext `json:"studentContext,omitempty"` + // SupportsStudentWork: Optional. Whether the post allows the teacher to see + // student work and passback grades. + SupportsStudentWork bool `json:"supportsStudentWork,omitempty"` + // TeacherContext: Add-on context corresponding to the requesting user's role + // as a teacher. Its presence implies that the requesting user is a teacher in + // the course. + TeacherContext *TeacherContext `json:"teacherContext,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CourseId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CourseId") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AddOnContext) MarshalJSON() ([]byte, error) { + type NoMethod AddOnContext + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Announcement: Announcement created by a teacher for students of the course type Announcement struct { // AlternateLink: Absolute link to this announcement in the Classroom web UI. @@ -592,6 +858,35 @@ func (s *CloudPubsubTopic) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// CopyHistory: Identifier of a previous copy of a given attachment. +type CopyHistory struct { + // AttachmentId: Immutable. Identifier of the attachment. + AttachmentId string `json:"attachmentId,omitempty"` + // CourseId: Immutable. Identifier of the course. + CourseId string `json:"courseId,omitempty"` + // ItemId: Immutable. Identifier of the announcement, courseWork, or + // courseWorkMaterial under which the attachment is attached. + ItemId string `json:"itemId,omitempty"` + // PostId: Immutable. Deprecated, use item_id instead. + PostId string `json:"postId,omitempty"` + // ForceSendFields is a list of field names (e.g. "AttachmentId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AttachmentId") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CopyHistory) MarshalJSON() ([]byte, error) { + type NoMethod CopyHistory + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Course: A Course in Classroom. type Course struct { // AlternateLink: Absolute link to this course in the Classroom web UI. @@ -1170,6 +1465,30 @@ func (s *DriveFolder) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// EmbedUri: URI to be iframed after being populated with query parameters. +type EmbedUri struct { + // Uri: Required. URI to be iframed after being populated with query + // parameters. This must be a valid UTF-8 string containing between 1 and 1800 + // characters. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Uri") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *EmbedUri) MarshalJSON() ([]byte, error) { + type NoMethod EmbedUri + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Empty: A generic empty message that you can re-use to avoid defining // duplicated empty messages in your APIs. A typical example is to use it as // the request or the response type of an API method. For instance: service Foo @@ -1592,6 +1911,34 @@ func (s *Link) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// ListAddOnAttachmentsResponse: Response when listing add-on attachments. +type ListAddOnAttachmentsResponse struct { + // AddOnAttachments: Attachments under the given post. + AddOnAttachments []*AddOnAttachment `json:"addOnAttachments,omitempty"` + // NextPageToken: A token, which can be sent as `pageToken` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AddOnAttachments") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AddOnAttachments") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListAddOnAttachmentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAddOnAttachmentsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // ListAnnouncementsResponse: Response when listing course work. type ListAnnouncementsResponse struct { // Announcements: Announcement items that match the request. @@ -2321,6 +2668,30 @@ func (s *Student) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// StudentContext: Role-specific context if the requesting user is a student. +type StudentContext struct { + // SubmissionId: Requesting user's submission id to be used for grade passback + // and to identify the student when showing student work to the teacher. This + // is set exactly when `supportsStudentWork` is `true`. + SubmissionId string `json:"submissionId,omitempty"` + // ForceSendFields is a list of field names (e.g. "SubmissionId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "SubmissionId") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *StudentContext) MarshalJSON() ([]byte, error) { + type NoMethod StudentContext + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // StudentSubmission: Student submission for course work. `StudentSubmission` // items are generated when a `CourseWork` item is created. Student submissions // that have never been accessed (i.e. with `state` = NEW) may not have a @@ -2486,6 +2857,10 @@ func (s *Teacher) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// TeacherContext: Role-specific context if the requesting user is a teacher. +type TeacherContext struct { +} + // TimeOfDay: Represents a time of day. The date and time zone are either not // significant or are specified elsewhere. An API may choose to allow leap // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. @@ -4065,66 +4440,212 @@ func (c *CoursesAnnouncementsGetCall) Do(opts ...googleapi.CallOption) (*Announc return ret, nil } -type CoursesAnnouncementsListCall struct { +type CoursesAnnouncementsGetAddOnContextCall struct { s *Service courseId string + itemId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of announcements that the requester is permitted to -// view. Course students may only view `PUBLISHED` announcements. Course -// teachers and domain administrators may view all announcements. This method -// returns the following error codes: * `PERMISSION_DENIED` if the requesting -// user is not permitted to access the requested course or for access errors. * -// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the -// requested course does not exist. +// GetAddOnContext: Gets metadata for Classroom add-ons in the context of a +// specific post. To maintain the integrity of its own data and permissions +// model, an add-on should call this to validate query parameters and the +// requesting user's role whenever the add-on is opened in an iframe +// (https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). +// This method returns the following error codes: * `PERMISSION_DENIED` for +// access errors. * `INVALID_ARGUMENT` if the request is malformed. * +// `NOT_FOUND` if one of the identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -func (r *CoursesAnnouncementsService) List(courseId string) *CoursesAnnouncementsListCall { - c := &CoursesAnnouncementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesAnnouncementsService) GetAddOnContext(courseId string, itemId string) *CoursesAnnouncementsGetAddOnContextCall { + c := &CoursesAnnouncementsGetAddOnContextCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId + c.itemId = itemId return c } -// AnnouncementStates sets the optional parameter "announcementStates": -// Restriction on the `state` of announcements returned. If this argument is -// left unspecified, the default value is `PUBLISHED`. -// -// Possible values: -// -// "ANNOUNCEMENT_STATE_UNSPECIFIED" - No state specified. This is never -// -// returned. -// -// "PUBLISHED" - Status for announcement that has been published. This is the -// -// default state. -// -// "DRAFT" - Status for an announcement that is not yet published. -// -// Announcement in this state is visible only to course teachers and domain -// administrators. -// -// "DELETED" - Status for announcement that was published but is now deleted. -// -// Announcement in this state is visible only to course teachers and domain -// administrators. Announcement in this state is deleted after some time. -func (c *CoursesAnnouncementsListCall) AnnouncementStates(announcementStates ...string) *CoursesAnnouncementsListCall { - c.urlParams_.SetMulti("announcementStates", append([]string{}, announcementStates...)) +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. The authorization token is +// required when neither of the following is true: * The add-on has attachments +// on the post. * The developer project issuing the request is the same project +// that created the post. +func (c *CoursesAnnouncementsGetAddOnContextCall) AddOnToken(addOnToken string) *CoursesAnnouncementsGetAddOnContextCall { + c.urlParams_.Set("addOnToken", addOnToken) return c } -// OrderBy sets the optional parameter "orderBy": Optional sort ordering for -// results. A comma-separated list of fields with an optional sort direction -// keyword. Supported field is `updateTime`. Supported direction keywords are -// `asc` and `desc`. If not specified, `updateTime desc` is the default -// behavior. Examples: `updateTime asc`, `updateTime` -func (c *CoursesAnnouncementsListCall) OrderBy(orderBy string) *CoursesAnnouncementsListCall { - c.urlParams_.Set("orderBy", orderBy) +// AttachmentId sets the optional parameter "attachmentId": The identifier of +// the attachment. This field is required for student users and optional for +// teacher users. If not provided in the student case, an error is returned. +func (c *CoursesAnnouncementsGetAddOnContextCall) AttachmentId(attachmentId string) *CoursesAnnouncementsGetAddOnContextCall { + c.urlParams_.Set("attachmentId", attachmentId) + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesAnnouncementsGetAddOnContextCall) PostId(postId string) *CoursesAnnouncementsGetAddOnContextCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesAnnouncementsGetAddOnContextCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsGetAddOnContextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesAnnouncementsGetAddOnContextCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsGetAddOnContextCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesAnnouncementsGetAddOnContextCall) Context(ctx context.Context) *CoursesAnnouncementsGetAddOnContextCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesAnnouncementsGetAddOnContextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesAnnouncementsGetAddOnContextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnContext") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.announcements.getAddOnContext" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnContext.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesAnnouncementsGetAddOnContextCall) Do(opts ...googleapi.CallOption) (*AddOnContext, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnContext{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesAnnouncementsListCall struct { + s *Service + courseId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of announcements that the requester is permitted to +// view. Course students may only view `PUBLISHED` announcements. Course +// teachers and domain administrators may view all announcements. This method +// returns the following error codes: * `PERMISSION_DENIED` if the requesting +// user is not permitted to access the requested course or for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the +// requested course does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +func (r *CoursesAnnouncementsService) List(courseId string) *CoursesAnnouncementsListCall { + c := &CoursesAnnouncementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + return c +} + +// AnnouncementStates sets the optional parameter "announcementStates": +// Restriction on the `state` of announcements returned. If this argument is +// left unspecified, the default value is `PUBLISHED`. +// +// Possible values: +// +// "ANNOUNCEMENT_STATE_UNSPECIFIED" - No state specified. This is never +// +// returned. +// +// "PUBLISHED" - Status for announcement that has been published. This is the +// +// default state. +// +// "DRAFT" - Status for an announcement that is not yet published. +// +// Announcement in this state is visible only to course teachers and domain +// administrators. +// +// "DELETED" - Status for announcement that was published but is now deleted. +// +// Announcement in this state is visible only to course teachers and domain +// administrators. Announcement in this state is deleted after some time. +func (c *CoursesAnnouncementsListCall) AnnouncementStates(announcementStates ...string) *CoursesAnnouncementsListCall { + c.urlParams_.SetMulti("announcementStates", append([]string{}, announcementStates...)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Optional sort ordering for +// results. A comma-separated list of fields with an optional sort direction +// keyword. Supported field is `updateTime`. Supported direction keywords are +// `asc` and `desc`. If not specified, `updateTime desc` is the default +// behavior. Examples: `updateTime asc`, `updateTime` +func (c *CoursesAnnouncementsListCall) OrderBy(orderBy string) *CoursesAnnouncementsListCall { + c.urlParams_.Set("orderBy", orderBy) return c } @@ -4491,70 +5012,86 @@ func (c *CoursesAnnouncementsPatchCall) Do(opts ...googleapi.CallOption) (*Annou return ret, nil } -type CoursesCourseWorkCreateCall struct { - s *Service - courseId string - coursework *CourseWork - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesAnnouncementsAddOnAttachmentsCreateCall struct { + s *Service + courseId string + itemId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates course work. The resulting course work (and corresponding -// student submissions) are associated with the Developer Console project of -// the OAuth client ID (https://support.google.com/cloud/answer/6158849) used -// to make the request. Classroom API requests to modify course work and -// student submissions must be made with an OAuth client ID from the associated -// Developer Console project. This method returns the following error codes: * -// `PERMISSION_DENIED` if the requesting user is not permitted to access the -// requested course, create course work in the requested course, share a Drive -// attachment, or for access errors. * `INVALID_ARGUMENT` if the request is -// malformed. * `NOT_FOUND` if the requested course does not exist. * -// `FAILED_PRECONDITION` for the following request error: * -// AttachmentNotVisible +// Create: Creates an add-on attachment under a post. Requires the add-on to +// have permission to create new attachments on the post. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -func (r *CoursesCourseWorkService) Create(courseId string, coursework *CourseWork) *CoursesCourseWorkCreateCall { - c := &CoursesCourseWorkCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which to create the attachment. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesAnnouncementsAddOnAttachmentsService) Create(courseId string, itemId string, addonattachment *AddOnAttachment) *CoursesAnnouncementsAddOnAttachmentsCreateCall { + c := &CoursesAnnouncementsAddOnAttachmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.coursework = coursework + c.itemId = itemId + c.addonattachment = addonattachment + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. This authorization token is +// required for in-Classroom attachment creation but optional for partner-first +// attachment creation. Returns an error if not provided for partner-first +// attachment creation and the developer projects that created the attachment +// and its parent stream item do not match. +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) AddOnToken(addOnToken string) *CoursesAnnouncementsAddOnAttachmentsCreateCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) PostId(postId string) *CoursesAnnouncementsAddOnAttachmentsCreateCall { + c.urlParams_.Set("postId", postId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkCreateCall { +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsAddOnAttachmentsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkCreateCall) Context(ctx context.Context) *CoursesCourseWorkCreateCall { +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) Context(ctx context.Context) *CoursesAnnouncementsAddOnAttachmentsCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkCreateCall) Header() http.Header { +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -4563,16 +5100,18 @@ func (c *CoursesCourseWorkCreateCall) doRequest(alt string) (*http.Response, err req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, + "itemId": c.itemId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.create" call. +// Do executes the "classroom.courses.announcements.addOnAttachments.create" call. // Any non-2xx status code is an error. Response headers are in either -// *CourseWork.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkCreateCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesAnnouncementsAddOnAttachmentsCreateCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4591,7 +5130,7 @@ func (c *CoursesCourseWorkCreateCall) Do(opts ...googleapi.CallOption) (*CourseW if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CourseWork{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4604,65 +5143,71 @@ func (c *CoursesCourseWorkCreateCall) Do(opts ...googleapi.CallOption) (*CourseW return ret, nil } -type CoursesCourseWorkDeleteCall struct { - s *Service - courseId string - id string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesAnnouncementsAddOnAttachmentsDeleteCall struct { + s *Service + courseId string + itemId string + attachmentId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a course work. This request must be made by the Developer -// Console project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work item. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting developer project did not -// create the corresponding course work, if the requesting user is not -// permitted to delete the requested course or for access errors. * -// `FAILED_PRECONDITION` if the requested course work has already been deleted. -// * `NOT_FOUND` if no course exists with the requested ID. +// Delete: Deletes an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - id: Identifier of the course work to delete. This identifier is a -// Classroom-assigned identifier. -func (r *CoursesCourseWorkService) Delete(courseId string, id string) *CoursesCourseWorkDeleteCall { - c := &CoursesCourseWorkDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesAnnouncementsAddOnAttachmentsService) Delete(courseId string, itemId string, attachmentId string) *CoursesAnnouncementsAddOnAttachmentsDeleteCall { + c := &CoursesAnnouncementsAddOnAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id + c.itemId = itemId + c.attachmentId = attachmentId + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) PostId(postId string) *CoursesAnnouncementsAddOnAttachmentsDeleteCall { + c.urlParams_.Set("postId", postId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkDeleteCall { +func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsAddOnAttachmentsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkDeleteCall) Context(ctx context.Context) *CoursesCourseWorkDeleteCall { +func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) Context(ctx context.Context) *CoursesAnnouncementsAddOnAttachmentsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkDeleteCall) Header() http.Header { +func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -4670,18 +5215,19 @@ func (c *CoursesCourseWorkDeleteCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "id": c.id, + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.delete" call. +// Do executes the "classroom.courses.announcements.addOnAttachments.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *CoursesAnnouncementsAddOnAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4713,36 +5259,47 @@ func (c *CoursesCourseWorkDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, return ret, nil } -type CoursesCourseWorkGetCall struct { +type CoursesAnnouncementsAddOnAttachmentsGetCall struct { s *Service courseId string - id string + itemId string + attachmentId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns course work. This method returns the following error codes: * -// `PERMISSION_DENIED` if the requesting user is not permitted to access the -// requested course or course work, or for access errors. * `INVALID_ARGUMENT` -// if the request is malformed. * `NOT_FOUND` if the requested course or course -// work does not exist. +// Get: Returns an add-on attachment. Requires the add-on requesting the +// attachment to be the original creator of the attachment. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - id: Identifier of the course work. -func (r *CoursesCourseWorkService) Get(courseId string, id string) *CoursesCourseWorkGetCall { - c := &CoursesCourseWorkGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesAnnouncementsAddOnAttachmentsService) Get(courseId string, itemId string, attachmentId string) *CoursesAnnouncementsAddOnAttachmentsGetCall { + c := &CoursesAnnouncementsAddOnAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id + c.itemId = itemId + c.attachmentId = attachmentId + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) PostId(postId string) *CoursesAnnouncementsAddOnAttachmentsGetCall { + c.urlParams_.Set("postId", postId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkGetCall { +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsAddOnAttachmentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4750,27 +5307,27 @@ func (c *CoursesCourseWorkGetCall) Fields(s ...googleapi.Field) *CoursesCourseWo // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *CoursesCourseWorkGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkGetCall { +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsAddOnAttachmentsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkGetCall) Context(ctx context.Context) *CoursesCourseWorkGetCall { +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) Context(ctx context.Context) *CoursesAnnouncementsAddOnAttachmentsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkGetCall) Header() http.Header { +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkGetCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -4778,7 +5335,7 @@ func (c *CoursesCourseWorkGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -4786,18 +5343,20 @@ func (c *CoursesCourseWorkGetCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "id": c.id, + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.get" call. +// Do executes the "classroom.courses.announcements.addOnAttachments.get" call. // Any non-2xx status code is an error. Response headers are in either -// *CourseWork.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkGetCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesAnnouncementsAddOnAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4816,7 +5375,7 @@ func (c *CoursesCourseWorkGetCall) Do(opts ...googleapi.CallOption) (*CourseWork if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CourseWork{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4829,90 +5388,63 @@ func (c *CoursesCourseWorkGetCall) Do(opts ...googleapi.CallOption) (*CourseWork return ret, nil } -type CoursesCourseWorkListCall struct { +type CoursesAnnouncementsAddOnAttachmentsListCall struct { s *Service courseId string + itemId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of course work that the requester is permitted to view. -// Course students may only view `PUBLISHED` course work. Course teachers and -// domain administrators may view all course work. This method returns the -// following error codes: * `PERMISSION_DENIED` if the requesting user is not -// permitted to access the requested course or for access errors. * -// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the -// requested course does not exist. +// List: Returns all attachments created by an add-on under the post. Requires +// the add-on to have active attachments on the post or have permission to +// create new attachments on the post. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -func (r *CoursesCourseWorkService) List(courseId string) *CoursesCourseWorkListCall { - c := &CoursesCourseWorkListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// whose attachments should be enumerated. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesAnnouncementsAddOnAttachmentsService) List(courseId string, itemId string) *CoursesAnnouncementsAddOnAttachmentsListCall { + c := &CoursesAnnouncementsAddOnAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId + c.itemId = itemId return c } -// CourseWorkStates sets the optional parameter "courseWorkStates": Restriction -// on the work status to return. Only courseWork that matches is returned. If -// unspecified, items with a work status of `PUBLISHED` is returned. -// -// Possible values: -// -// "COURSE_WORK_STATE_UNSPECIFIED" - No state specified. This is never -// -// returned. -// -// "PUBLISHED" - Status for work that has been published. This is the default -// -// state. -// -// "DRAFT" - Status for work that is not yet published. Work in this state is -// -// visible only to course teachers and domain administrators. -// -// "DELETED" - Status for work that was published but is now deleted. Work in -// -// this state is visible only to course teachers and domain administrators. -// Work in this state is deleted after some time. -func (c *CoursesCourseWorkListCall) CourseWorkStates(courseWorkStates ...string) *CoursesCourseWorkListCall { - c.urlParams_.SetMulti("courseWorkStates", append([]string{}, courseWorkStates...)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Optional sort ordering for -// results. A comma-separated list of fields with an optional sort direction -// keyword. Supported fields are `updateTime` and `dueDate`. Supported -// direction keywords are `asc` and `desc`. If not specified, `updateTime desc` -// is the default behavior. Examples: `dueDate asc,updateTime desc`, -// `updateTime,dueDate desc` -func (c *CoursesCourseWorkListCall) OrderBy(orderBy string) *CoursesCourseWorkListCall { - c.urlParams_.Set("orderBy", orderBy) +// PageSize sets the optional parameter "pageSize": The maximum number of +// attachments to return. The service may return fewer than this value. If +// unspecified, at most 20 attachments will be returned. The maximum value is +// 20; values above 20 will be coerced to 20. +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) PageSize(pageSize int64) *CoursesAnnouncementsAddOnAttachmentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageSize sets the optional parameter "pageSize": Maximum number of items to -// return. Zero or unspecified indicates that the server may assign a maximum. -// The server may return fewer than the specified number of results. -func (c *CoursesCourseWorkListCall) PageSize(pageSize int64) *CoursesCourseWorkListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAddOnAttachments` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListAddOnAttachments` must match the call that provided the page token. +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) PageToken(pageToken string) *CoursesAnnouncementsAddOnAttachmentsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } -// PageToken sets the optional parameter "pageToken": nextPageToken value -// returned from a previous list call, indicating that the subsequent page of -// results should be returned. The list request must be otherwise identical to -// the one that resulted in this token. -func (c *CoursesCourseWorkListCall) PageToken(pageToken string) *CoursesCourseWorkListCall { - c.urlParams_.Set("pageToken", pageToken) +// PostId sets the optional parameter "postId": Identifier of the post under +// the course whose attachments to enumerate. Deprecated, use item_id instead. +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) PostId(postId string) *CoursesAnnouncementsAddOnAttachmentsListCall { + c.urlParams_.Set("postId", postId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkListCall { +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsAddOnAttachmentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4920,27 +5452,27 @@ func (c *CoursesCourseWorkListCall) Fields(s ...googleapi.Field) *CoursesCourseW // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *CoursesCourseWorkListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkListCall { +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsAddOnAttachmentsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkListCall) Context(ctx context.Context) *CoursesCourseWorkListCall { +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) Context(ctx context.Context) *CoursesAnnouncementsAddOnAttachmentsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkListCall) Header() http.Header { +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkListCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -4948,7 +5480,7 @@ func (c *CoursesCourseWorkListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -4957,17 +5489,18 @@ func (c *CoursesCourseWorkListCall) doRequest(alt string) (*http.Response, error req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, + "itemId": c.itemId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.list" call. +// Do executes the "classroom.courses.announcements.addOnAttachments.list" call. // Any non-2xx status code is an error. Response headers are in either -// *ListCourseWorkResponse.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *CoursesCourseWorkListCall) Do(opts ...googleapi.CallOption) (*ListCourseWorkResponse, error) { +// *ListAddOnAttachmentsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ListAddOnAttachmentsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4986,7 +5519,7 @@ func (c *CoursesCourseWorkListCall) Do(opts ...googleapi.CallOption) (*ListCours if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListCourseWorkResponse{ + ret := &ListAddOnAttachmentsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5002,7 +5535,7 @@ func (c *CoursesCourseWorkListCall) Do(opts ...googleapi.CallOption) (*ListCours // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *CoursesCourseWorkListCall) Pages(ctx context.Context, f func(*ListCourseWorkResponse) error) error { +func (c *CoursesAnnouncementsAddOnAttachmentsListCall) Pages(ctx context.Context, f func(*ListAddOnAttachmentsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -5020,86 +5553,110 @@ func (c *CoursesCourseWorkListCall) Pages(ctx context.Context, f func(*ListCours } } -type CoursesCourseWorkModifyAssigneesCall struct { - s *Service - courseId string - id string - modifycourseworkassigneesrequest *ModifyCourseWorkAssigneesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesAnnouncementsAddOnAttachmentsPatchCall struct { + s *Service + courseId string + itemId string + attachmentId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ModifyAssignees: Modifies assignee mode and options of a coursework. Only a -// teacher of the course that contains the coursework may call this method. -// This method returns the following error codes: * `PERMISSION_DENIED` if the -// requesting user is not permitted to access the requested course or course -// work or for access errors. * `INVALID_ARGUMENT` if the request is malformed. -// * `NOT_FOUND` if the requested course or course work does not exist. +// Patch: Updates an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - id: Identifier of the coursework. -func (r *CoursesCourseWorkService) ModifyAssignees(courseId string, id string, modifycourseworkassigneesrequest *ModifyCourseWorkAssigneesRequest) *CoursesCourseWorkModifyAssigneesCall { - c := &CoursesCourseWorkModifyAssigneesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the post under which the attachment is attached. +func (r *CoursesAnnouncementsAddOnAttachmentsService) Patch(courseId string, itemId string, attachmentId string, addonattachment *AddOnAttachment) *CoursesAnnouncementsAddOnAttachmentsPatchCall { + c := &CoursesAnnouncementsAddOnAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id - c.modifycourseworkassigneesrequest = modifycourseworkassigneesrequest + c.itemId = itemId + c.attachmentId = attachmentId + c.addonattachment = addonattachment + return c +} + +// PostId sets the optional parameter "postId": Required. Identifier of the +// post under which the attachment is attached. +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) PostId(postId string) *CoursesAnnouncementsAddOnAttachmentsPatchCall { + c.urlParams_.Set("postId", postId) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Mask that +// identifies which fields on the attachment to update. The update fails if +// invalid fields are specified. If a field supports empty values, it can be +// cleared by specifying it in the update mask and not in the `AddOnAttachment` +// object. If a field that does not support empty values is included in the +// update mask and not set in the `AddOnAttachment` object, an +// `INVALID_ARGUMENT` error is returned. The following fields may be specified +// by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * +// `student_work_review_uri` * `due_date` * `due_time` * `max_points` +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) UpdateMask(updateMask string) *CoursesAnnouncementsAddOnAttachmentsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkModifyAssigneesCall) Fields(s ...googleapi.Field) *CoursesCourseWorkModifyAssigneesCall { +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsAddOnAttachmentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkModifyAssigneesCall) Context(ctx context.Context) *CoursesCourseWorkModifyAssigneesCall { +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) Context(ctx context.Context) *CoursesAnnouncementsAddOnAttachmentsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkModifyAssigneesCall) Header() http.Header { +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkModifyAssigneesCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycourseworkassigneesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}:modifyAssignees") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "id": c.id, + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.modifyAssignees" call. +// Do executes the "classroom.courses.announcements.addOnAttachments.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *CourseWork.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkModifyAssigneesCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesAnnouncementsAddOnAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5118,7 +5675,7 @@ func (c *CoursesCourseWorkModifyAssigneesCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CourseWork{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5131,79 +5688,61 @@ func (c *CoursesCourseWorkModifyAssigneesCall) Do(opts ...googleapi.CallOption) return ret, nil } -type CoursesCourseWorkPatchCall struct { +type CoursesCourseWorkCreateCall struct { s *Service courseId string - id string coursework *CourseWork urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates one or more fields of a course work. See -// google.classroom.v1.CourseWork for details of which fields may be updated -// and who may change them. This request must be made by the Developer Console -// project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work item. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting developer project did not -// create the corresponding course work, if the user is not permitted to make -// the requested modification to the student submission, or for access errors. -// * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if -// the requested course work has already been deleted. * `NOT_FOUND` if the -// requested course, course work, or student submission does not exist. +// Create: Creates course work. The resulting course work (and corresponding +// student submissions) are associated with the Developer Console project of +// the OAuth client ID (https://support.google.com/cloud/answer/6158849) used +// to make the request. Classroom API requests to modify course work and +// student submissions must be made with an OAuth client ID from the associated +// Developer Console project. This method returns the following error codes: * +// `PERMISSION_DENIED` if the requesting user is not permitted to access the +// requested course, create course work in the requested course, share a Drive +// attachment, or for access errors. * `INVALID_ARGUMENT` if the request is +// malformed. * `NOT_FOUND` if the requested course does not exist. * +// `FAILED_PRECONDITION` for the following request error: * +// AttachmentNotVisible // // - courseId: Identifier of the course. This identifier can be either the // Classroom-assigned identifier or an alias. -// - id: Identifier of the course work. -func (r *CoursesCourseWorkService) Patch(courseId string, id string, coursework *CourseWork) *CoursesCourseWorkPatchCall { - c := &CoursesCourseWorkPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *CoursesCourseWorkService) Create(courseId string, coursework *CourseWork) *CoursesCourseWorkCreateCall { + c := &CoursesCourseWorkCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id c.coursework = coursework return c } -// UpdateMask sets the optional parameter "updateMask": Mask that identifies -// which fields on the course work to update. This field is required to do an -// update. The update fails if invalid fields are specified. If a field -// supports empty values, it can be cleared by specifying it in the update mask -// and not in the `CourseWork` object. If a field that does not support empty -// values is included in the update mask and not set in the `CourseWork` -// object, an `INVALID_ARGUMENT` error is returned. The following fields may be -// specified by teachers: * `title` * `description` * `state` * `due_date` * -// `due_time` * `max_points` * `scheduled_time` * -// `submission_modification_mode` * `topic_id` -func (c *CoursesCourseWorkPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkPatchCall { +func (c *CoursesCourseWorkCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkPatchCall) Context(ctx context.Context) *CoursesCourseWorkPatchCall { +func (c *CoursesCourseWorkCreateCall) Context(ctx context.Context) *CoursesCourseWorkCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkPatchCall) Header() http.Header { +func (c *CoursesCourseWorkCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesCourseWorkCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework) @@ -5212,26 +5751,25 @@ func (c *CoursesCourseWorkPatchCall) doRequest(alt string) (*http.Response, erro } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, - "id": c.id, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.patch" call. +// Do executes the "classroom.courses.courseWork.create" call. // Any non-2xx status code is an error. Response headers are in either // *CourseWork.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkPatchCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { +func (c *CoursesCourseWorkCreateCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5263,31 +5801,32 @@ func (c *CoursesCourseWorkPatchCall) Do(opts ...googleapi.CallOption) (*CourseWo return ret, nil } -type CoursesCourseWorkStudentSubmissionsGetCall struct { - s *Service - courseId string - courseWorkId string - id string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type CoursesCourseWorkDeleteCall struct { + s *Service + courseId string + id string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns a student submission. * `PERMISSION_DENIED` if the requesting -// user is not permitted to access the requested course, course work, or -// student submission or for access errors. * `INVALID_ARGUMENT` if the request -// is malformed. * `NOT_FOUND` if the requested course, course work, or student -// submission does not exist. +// Delete: Deletes a course work. This request must be made by the Developer +// Console project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work item. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting developer project did not +// create the corresponding course work, if the requesting user is not +// permitted to delete the requested course or for access errors. * +// `FAILED_PRECONDITION` if the requested course work has already been deleted. +// * `NOT_FOUND` if no course exists with the requested ID. // // - courseId: Identifier of the course. This identifier can be either the // Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the course work. -// - id: Identifier of the student submission. -func (r *CoursesCourseWorkStudentSubmissionsService) Get(courseId string, courseWorkId string, id string) *CoursesCourseWorkStudentSubmissionsGetCall { - c := &CoursesCourseWorkStudentSubmissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - id: Identifier of the course work to delete. This identifier is a +// Classroom-assigned identifier. +func (r *CoursesCourseWorkService) Delete(courseId string, id string) *CoursesCourseWorkDeleteCall { + c := &CoursesCourseWorkDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId c.id = id return c } @@ -5295,28 +5834,1779 @@ func (r *CoursesCourseWorkStudentSubmissionsService) Get(courseId string, course // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsGetCall { +func (c *CoursesCourseWorkDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *CoursesCourseWorkStudentSubmissionsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsGetCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsGetCall { +func (c *CoursesCourseWorkDeleteCall) Context(ctx context.Context) *CoursesCourseWorkDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsGetCall) Header() http.Header { +func (c *CoursesCourseWorkDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkGetCall struct { + s *Service + courseId string + id string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns course work. This method returns the following error codes: * +// `PERMISSION_DENIED` if the requesting user is not permitted to access the +// requested course or course work, or for access errors. * `INVALID_ARGUMENT` +// if the request is malformed. * `NOT_FOUND` if the requested course or course +// work does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - id: Identifier of the course work. +func (r *CoursesCourseWorkService) Get(courseId string, id string) *CoursesCourseWorkGetCall { + c := &CoursesCourseWorkGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkGetCall) Context(ctx context.Context) *CoursesCourseWorkGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *CourseWork.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkGetCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &CourseWork{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkGetAddOnContextCall struct { + s *Service + courseId string + itemId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetAddOnContext: Gets metadata for Classroom add-ons in the context of a +// specific post. To maintain the integrity of its own data and permissions +// model, an add-on should call this to validate query parameters and the +// requesting user's role whenever the add-on is opened in an iframe +// (https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). +// This method returns the following error codes: * `PERMISSION_DENIED` for +// access errors. * `INVALID_ARGUMENT` if the request is malformed. * +// `NOT_FOUND` if one of the identified resources does not exist. +// +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkService) GetAddOnContext(courseId string, itemId string) *CoursesCourseWorkGetAddOnContextCall { + c := &CoursesCourseWorkGetAddOnContextCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. The authorization token is +// required when neither of the following is true: * The add-on has attachments +// on the post. * The developer project issuing the request is the same project +// that created the post. +func (c *CoursesCourseWorkGetAddOnContextCall) AddOnToken(addOnToken string) *CoursesCourseWorkGetAddOnContextCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// AttachmentId sets the optional parameter "attachmentId": The identifier of +// the attachment. This field is required for student users and optional for +// teacher users. If not provided in the student case, an error is returned. +func (c *CoursesCourseWorkGetAddOnContextCall) AttachmentId(attachmentId string) *CoursesCourseWorkGetAddOnContextCall { + c.urlParams_.Set("attachmentId", attachmentId) + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkGetAddOnContextCall) PostId(postId string) *CoursesCourseWorkGetAddOnContextCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkGetAddOnContextCall) Fields(s ...googleapi.Field) *CoursesCourseWorkGetAddOnContextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkGetAddOnContextCall) IfNoneMatch(entityTag string) *CoursesCourseWorkGetAddOnContextCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkGetAddOnContextCall) Context(ctx context.Context) *CoursesCourseWorkGetAddOnContextCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkGetAddOnContextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkGetAddOnContextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnContext") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.getAddOnContext" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnContext.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkGetAddOnContextCall) Do(opts ...googleapi.CallOption) (*AddOnContext, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnContext{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkListCall struct { + s *Service + courseId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of course work that the requester is permitted to view. +// Course students may only view `PUBLISHED` course work. Course teachers and +// domain administrators may view all course work. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user is not +// permitted to access the requested course or for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the +// requested course does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +func (r *CoursesCourseWorkService) List(courseId string) *CoursesCourseWorkListCall { + c := &CoursesCourseWorkListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + return c +} + +// CourseWorkStates sets the optional parameter "courseWorkStates": Restriction +// on the work status to return. Only courseWork that matches is returned. If +// unspecified, items with a work status of `PUBLISHED` is returned. +// +// Possible values: +// +// "COURSE_WORK_STATE_UNSPECIFIED" - No state specified. This is never +// +// returned. +// +// "PUBLISHED" - Status for work that has been published. This is the default +// +// state. +// +// "DRAFT" - Status for work that is not yet published. Work in this state is +// +// visible only to course teachers and domain administrators. +// +// "DELETED" - Status for work that was published but is now deleted. Work in +// +// this state is visible only to course teachers and domain administrators. +// Work in this state is deleted after some time. +func (c *CoursesCourseWorkListCall) CourseWorkStates(courseWorkStates ...string) *CoursesCourseWorkListCall { + c.urlParams_.SetMulti("courseWorkStates", append([]string{}, courseWorkStates...)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Optional sort ordering for +// results. A comma-separated list of fields with an optional sort direction +// keyword. Supported fields are `updateTime` and `dueDate`. Supported +// direction keywords are `asc` and `desc`. If not specified, `updateTime desc` +// is the default behavior. Examples: `dueDate asc,updateTime desc`, +// `updateTime,dueDate desc` +func (c *CoursesCourseWorkListCall) OrderBy(orderBy string) *CoursesCourseWorkListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of items to +// return. Zero or unspecified indicates that the server may assign a maximum. +// The server may return fewer than the specified number of results. +func (c *CoursesCourseWorkListCall) PageSize(pageSize int64) *CoursesCourseWorkListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken value +// returned from a previous list call, indicating that the subsequent page of +// results should be returned. The list request must be otherwise identical to +// the one that resulted in this token. +func (c *CoursesCourseWorkListCall) PageToken(pageToken string) *CoursesCourseWorkListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkListCall) Context(ctx context.Context) *CoursesCourseWorkListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListCourseWorkResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkListCall) Do(opts ...googleapi.CallOption) (*ListCourseWorkResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListCourseWorkResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *CoursesCourseWorkListCall) Pages(ctx context.Context, f func(*ListCourseWorkResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type CoursesCourseWorkModifyAssigneesCall struct { + s *Service + courseId string + id string + modifycourseworkassigneesrequest *ModifyCourseWorkAssigneesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ModifyAssignees: Modifies assignee mode and options of a coursework. Only a +// teacher of the course that contains the coursework may call this method. +// This method returns the following error codes: * `PERMISSION_DENIED` if the +// requesting user is not permitted to access the requested course or course +// work or for access errors. * `INVALID_ARGUMENT` if the request is malformed. +// * `NOT_FOUND` if the requested course or course work does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - id: Identifier of the coursework. +func (r *CoursesCourseWorkService) ModifyAssignees(courseId string, id string, modifycourseworkassigneesrequest *ModifyCourseWorkAssigneesRequest) *CoursesCourseWorkModifyAssigneesCall { + c := &CoursesCourseWorkModifyAssigneesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.id = id + c.modifycourseworkassigneesrequest = modifycourseworkassigneesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkModifyAssigneesCall) Fields(s ...googleapi.Field) *CoursesCourseWorkModifyAssigneesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkModifyAssigneesCall) Context(ctx context.Context) *CoursesCourseWorkModifyAssigneesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkModifyAssigneesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkModifyAssigneesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycourseworkassigneesrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}:modifyAssignees") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.modifyAssignees" call. +// Any non-2xx status code is an error. Response headers are in either +// *CourseWork.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkModifyAssigneesCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &CourseWork{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkPatchCall struct { + s *Service + courseId string + id string + coursework *CourseWork + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates one or more fields of a course work. See +// google.classroom.v1.CourseWork for details of which fields may be updated +// and who may change them. This request must be made by the Developer Console +// project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work item. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting developer project did not +// create the corresponding course work, if the user is not permitted to make +// the requested modification to the student submission, or for access errors. +// * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if +// the requested course work has already been deleted. * `NOT_FOUND` if the +// requested course, course work, or student submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - id: Identifier of the course work. +func (r *CoursesCourseWorkService) Patch(courseId string, id string, coursework *CourseWork) *CoursesCourseWorkPatchCall { + c := &CoursesCourseWorkPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.id = id + c.coursework = coursework + return c +} + +// UpdateMask sets the optional parameter "updateMask": Mask that identifies +// which fields on the course work to update. This field is required to do an +// update. The update fails if invalid fields are specified. If a field +// supports empty values, it can be cleared by specifying it in the update mask +// and not in the `CourseWork` object. If a field that does not support empty +// values is included in the update mask and not set in the `CourseWork` +// object, an `INVALID_ARGUMENT` error is returned. The following fields may be +// specified by teachers: * `title` * `description` * `state` * `due_date` * +// `due_time` * `max_points` * `scheduled_time` * +// `submission_modification_mode` * `topic_id` +func (c *CoursesCourseWorkPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkPatchCall) Context(ctx context.Context) *CoursesCourseWorkPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *CourseWork.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkPatchCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &CourseWork{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkAddOnAttachmentsCreateCall struct { + s *Service + courseId string + itemId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates an add-on attachment under a post. Requires the add-on to +// have permission to create new attachments on the post. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. +// +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which to create the attachment. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkAddOnAttachmentsService) Create(courseId string, itemId string, addonattachment *AddOnAttachment) *CoursesCourseWorkAddOnAttachmentsCreateCall { + c := &CoursesCourseWorkAddOnAttachmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.addonattachment = addonattachment + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. This authorization token is +// required for in-Classroom attachment creation but optional for partner-first +// attachment creation. Returns an error if not provided for partner-first +// attachment creation and the developer projects that created the attachment +// and its parent stream item do not match. +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) AddOnToken(addOnToken string) *CoursesCourseWorkAddOnAttachmentsCreateCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsCreateCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkAddOnAttachmentsCreateCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnAttachment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkAddOnAttachmentsDeleteCall struct { + s *Service + courseId string + itemId string + attachmentId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. +// +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkAddOnAttachmentsService) Delete(courseId string, itemId string, attachmentId string) *CoursesCourseWorkAddOnAttachmentsDeleteCall { + c := &CoursesCourseWorkAddOnAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.attachmentId = attachmentId + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsDeleteCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkAddOnAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkAddOnAttachmentsGetCall struct { + s *Service + courseId string + itemId string + attachmentId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns an add-on attachment. Requires the add-on requesting the +// attachment to be the original creator of the attachment. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. +// +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkAddOnAttachmentsService) Get(courseId string, itemId string, attachmentId string) *CoursesCourseWorkAddOnAttachmentsGetCall { + c := &CoursesCourseWorkAddOnAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.attachmentId = attachmentId + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsGetCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkAddOnAttachmentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkAddOnAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnAttachment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkAddOnAttachmentsListCall struct { + s *Service + courseId string + itemId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns all attachments created by an add-on under the post. Requires +// the add-on to have active attachments on the post or have permission to +// create new attachments on the post. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. +// +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// whose attachments should be enumerated. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkAddOnAttachmentsService) List(courseId string, itemId string) *CoursesCourseWorkAddOnAttachmentsListCall { + c := &CoursesCourseWorkAddOnAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// attachments to return. The service may return fewer than this value. If +// unspecified, at most 20 attachments will be returned. The maximum value is +// 20; values above 20 will be coerced to 20. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) PageSize(pageSize int64) *CoursesCourseWorkAddOnAttachmentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAddOnAttachments` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListAddOnAttachments` must match the call that provided the page token. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) PageToken(pageToken string) *CoursesCourseWorkAddOnAttachmentsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// PostId sets the optional parameter "postId": Identifier of the post under +// the course whose attachments to enumerate. Deprecated, use item_id instead. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsListCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkAddOnAttachmentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAddOnAttachmentsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ListAddOnAttachmentsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListAddOnAttachmentsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *CoursesCourseWorkAddOnAttachmentsListCall) Pages(ctx context.Context, f func(*ListAddOnAttachmentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type CoursesCourseWorkAddOnAttachmentsPatchCall struct { + s *Service + courseId string + itemId string + attachmentId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. +// +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the post under which the attachment is attached. +func (r *CoursesCourseWorkAddOnAttachmentsService) Patch(courseId string, itemId string, attachmentId string, addonattachment *AddOnAttachment) *CoursesCourseWorkAddOnAttachmentsPatchCall { + c := &CoursesCourseWorkAddOnAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.attachmentId = attachmentId + c.addonattachment = addonattachment + return c +} + +// PostId sets the optional parameter "postId": Required. Identifier of the +// post under which the attachment is attached. +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsPatchCall { + c.urlParams_.Set("postId", postId) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Mask that +// identifies which fields on the attachment to update. The update fails if +// invalid fields are specified. If a field supports empty values, it can be +// cleared by specifying it in the update mask and not in the `AddOnAttachment` +// object. If a field that does not support empty values is included in the +// update mask and not set in the `AddOnAttachment` object, an +// `INVALID_ARGUMENT` error is returned. The following fields may be specified +// by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * +// `student_work_review_uri` * `due_date` * `due_time` * `max_points` +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkAddOnAttachmentsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkAddOnAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnAttachment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall struct { + s *Service + courseId string + itemId string + attachmentId string + submissionId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns a student submission for an add-on attachment. This method +// returns the following error codes: * `PERMISSION_DENIED` for access errors. +// * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of +// the identified resources does not exist. +// +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +// - submissionId: Identifier of the student’s submission. +func (r *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsService) Get(courseId string, itemId string, attachmentId string, submissionId string) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall { + c := &CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.attachmentId = attachmentId + c.submissionId = submissionId + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, + "submissionId": c.submissionId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.studentSubmissions.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnAttachmentStudentSubmission.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsGetCall) Do(opts ...googleapi.CallOption) (*AddOnAttachmentStudentSubmission, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnAttachmentStudentSubmission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall struct { + s *Service + courseId string + itemId string + attachmentId string + submissionId string + addonattachmentstudentsubmission *AddOnAttachmentStudentSubmission + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates data associated with an add-on attachment submission. +// Requires the add-on to have been the original creator of the attachment and +// the attachment to have a positive `max_points` value set. This method +// returns the following error codes: * `PERMISSION_DENIED` for access errors. +// * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of +// the identified resources does not exist. +// +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +// - submissionId: Identifier of the student's submission. +func (r *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsService) Patch(courseId string, itemId string, attachmentId string, submissionId string, addonattachmentstudentsubmission *AddOnAttachmentStudentSubmission) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall { + c := &CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.attachmentId = attachmentId + c.submissionId = submissionId + c.addonattachmentstudentsubmission = addonattachmentstudentsubmission + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) PostId(postId string) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall { + c.urlParams_.Set("postId", postId) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Mask that +// identifies which fields on the attachment to update. The update fails if +// invalid fields are specified. If a field supports empty values, it can be +// cleared by specifying it in the update mask and not in the +// `AddOnAttachmentStudentSubmission` object. The following fields may be +// specified by teachers: * `points_earned` +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) Context(ctx context.Context) *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachmentstudentsubmission) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{itemId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, + "submissionId": c.submissionId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.addOnAttachments.studentSubmissions.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnAttachmentStudentSubmission.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesCourseWorkAddOnAttachmentsStudentSubmissionsPatchCall) Do(opts ...googleapi.CallOption) (*AddOnAttachmentStudentSubmission, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnAttachmentStudentSubmission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkStudentSubmissionsGetCall struct { + s *Service + courseId string + courseWorkId string + id string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns a student submission. * `PERMISSION_DENIED` if the requesting +// user is not permitted to access the requested course, course work, or +// student submission or for access errors. * `INVALID_ARGUMENT` if the request +// is malformed. * `NOT_FOUND` if the requested course, course work, or student +// submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the course work. +// - id: Identifier of the student submission. +func (r *CoursesCourseWorkStudentSubmissionsService) Get(courseId string, courseWorkId string, id string) *CoursesCourseWorkStudentSubmissionsGetCall { + c := &CoursesCourseWorkStudentSubmissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkStudentSubmissionsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsGetCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } @@ -5331,28 +7621,1805 @@ func (c *CoursesCourseWorkStudentSubmissionsGetCall) doRequest(alt string) (*htt var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *StudentSubmission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkStudentSubmissionsGetCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &StudentSubmission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkStudentSubmissionsListCall struct { + s *Service + courseId string + courseWorkId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of student submissions that the requester is permitted +// to view, factoring in the OAuth scopes of the request. `-` may be specified +// as the `course_work_id` to include student submissions for multiple course +// work items. Course students may only view their own work. Course teachers +// and domain administrators may view all student submissions. This method +// returns the following error codes: * `PERMISSION_DENIED` if the requesting +// user is not permitted to access the requested course or course work, or for +// access errors. * `INVALID_ARGUMENT` if the request is malformed. * +// `NOT_FOUND` if the requested course does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the student work to request. This may be set +// to the string literal "-" to request student work for all course work in +// the specified course. +func (r *CoursesCourseWorkStudentSubmissionsService) List(courseId string, courseWorkId string) *CoursesCourseWorkStudentSubmissionsListCall { + c := &CoursesCourseWorkStudentSubmissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + return c +} + +// Late sets the optional parameter "late": Requested lateness value. If +// specified, returned student submissions are restricted by the requested +// value. If unspecified, submissions are returned regardless of `late` value. +// +// Possible values: +// +// "LATE_VALUES_UNSPECIFIED" - No restriction on submission late values +// +// specified. +// +// "LATE_ONLY" - Return StudentSubmissions where late is true. +// "NOT_LATE_ONLY" - Return StudentSubmissions where late is false. +func (c *CoursesCourseWorkStudentSubmissionsListCall) Late(late string) *CoursesCourseWorkStudentSubmissionsListCall { + c.urlParams_.Set("late", late) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of items to +// return. Zero or unspecified indicates that the server may assign a maximum. +// The server may return fewer than the specified number of results. +func (c *CoursesCourseWorkStudentSubmissionsListCall) PageSize(pageSize int64) *CoursesCourseWorkStudentSubmissionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken value +// returned from a previous list call, indicating that the subsequent page of +// results should be returned. The list request must be otherwise identical to +// the one that resulted in this token. +func (c *CoursesCourseWorkStudentSubmissionsListCall) PageToken(pageToken string) *CoursesCourseWorkStudentSubmissionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// States sets the optional parameter "states": Requested submission states. If +// specified, returned student submissions match one of the specified +// submission states. +// +// Possible values: +// +// "SUBMISSION_STATE_UNSPECIFIED" - No state specified. This should never be +// +// returned. +// +// "NEW" - The student has never accessed this submission. Attachments are +// +// not returned and timestamps is not set. +// +// "CREATED" - Has been created. +// "TURNED_IN" - Has been turned in to the teacher. +// "RETURNED" - Has been returned to the student. +// "RECLAIMED_BY_STUDENT" - Student chose to "unsubmit" the assignment. +func (c *CoursesCourseWorkStudentSubmissionsListCall) States(states ...string) *CoursesCourseWorkStudentSubmissionsListCall { + c.urlParams_.SetMulti("states", append([]string{}, states...)) + return c +} + +// UserId sets the optional parameter "userId": Optional argument to restrict +// returned student work to those owned by the student with the specified +// identifier. The identifier can be one of the following: * the numeric +// identifier for the user * the email address of the user * the string literal +// "me", indicating the requesting user +func (c *CoursesCourseWorkStudentSubmissionsListCall) UserId(userId string) *CoursesCourseWorkStudentSubmissionsListCall { + c.urlParams_.Set("userId", userId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkStudentSubmissionsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsListCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkStudentSubmissionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListStudentSubmissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesCourseWorkStudentSubmissionsListCall) Do(opts ...googleapi.CallOption) (*ListStudentSubmissionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListStudentSubmissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *CoursesCourseWorkStudentSubmissionsListCall) Pages(ctx context.Context, f func(*ListStudentSubmissionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall struct { + s *Service + courseId string + courseWorkId string + id string + modifyattachmentsrequest *ModifyAttachmentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ModifyAttachments: Modifies attachments of student submission. Attachments +// may only be added to student submissions belonging to course work objects +// with a `workType` of `ASSIGNMENT`. This request must be made by the +// Developer Console project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work item. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to +// access the requested course or course work, if the user is not permitted to +// modify attachments on the requested student submission, or for access +// errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if +// the requested course, course work, or student submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the course work. +// - id: Identifier of the student submission. +func (r *CoursesCourseWorkStudentSubmissionsService) ModifyAttachments(courseId string, courseWorkId string, id string, modifyattachmentsrequest *ModifyAttachmentsRequest) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall { + c := &CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + c.id = id + c.modifyattachmentsrequest = modifyattachmentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyattachmentsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.modifyAttachments" call. +// Any non-2xx status code is an error. Response headers are in either +// *StudentSubmission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &StudentSubmission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkStudentSubmissionsPatchCall struct { + s *Service + courseId string + courseWorkId string + id string + studentsubmission *StudentSubmission + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates one or more fields of a student submission. See +// google.classroom.v1.StudentSubmission for details of which fields may be +// updated and who may change them. This request must be made by the Developer +// Console project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work item. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting developer project did not +// create the corresponding course work, if the user is not permitted to make +// the requested modification to the student submission, or for access errors. +// * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the +// requested course, course work, or student submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the course work. +// - id: Identifier of the student submission. +func (r *CoursesCourseWorkStudentSubmissionsService) Patch(courseId string, courseWorkId string, id string, studentsubmission *StudentSubmission) *CoursesCourseWorkStudentSubmissionsPatchCall { + c := &CoursesCourseWorkStudentSubmissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + c.id = id + c.studentsubmission = studentsubmission + return c +} + +// UpdateMask sets the optional parameter "updateMask": Mask that identifies +// which fields on the student submission to update. This field is required to +// do an update. The update fails if invalid fields are specified. The +// following fields may be specified by teachers: * `draft_grade` * +// `assigned_grade` +func (c *CoursesCourseWorkStudentSubmissionsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkStudentSubmissionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.studentsubmission) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *StudentSubmission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &StudentSubmission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkStudentSubmissionsReclaimCall struct { + s *Service + courseId string + courseWorkId string + id string + reclaimstudentsubmissionrequest *ReclaimStudentSubmissionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Reclaim: Reclaims a student submission on behalf of the student that owns +// it. Reclaiming a student submission transfers ownership of attached Drive +// files to the student and updates the submission state. Only the student that +// owns the requested student submission may call this method, and only for a +// student submission that has been turned in. This request must be made by the +// Developer Console project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work item. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to +// access the requested course or course work, unsubmit the requested student +// submission, or for access errors. * `FAILED_PRECONDITION` if the student +// submission has not been turned in. * `INVALID_ARGUMENT` if the request is +// malformed. * `NOT_FOUND` if the requested course, course work, or student +// submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the course work. +// - id: Identifier of the student submission. +func (r *CoursesCourseWorkStudentSubmissionsService) Reclaim(courseId string, courseWorkId string, id string, reclaimstudentsubmissionrequest *ReclaimStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsReclaimCall { + c := &CoursesCourseWorkStudentSubmissionsReclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + c.id = id + c.reclaimstudentsubmissionrequest = reclaimstudentsubmissionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReclaimCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReclaimCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.reclaimstudentsubmissionrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.reclaim" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkStudentSubmissionsReturnCall struct { + s *Service + courseId string + courseWorkId string + id string + returnstudentsubmissionrequest *ReturnStudentSubmissionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Return: Returns a student submission. Returning a student submission +// transfers ownership of attached Drive files to the student and may also +// update the submission state. Unlike the Classroom application, returning a +// student submission does not set assignedGrade to the draftGrade value. Only +// a teacher of the course that contains the requested student submission may +// call this method. This request must be made by the Developer Console project +// of the OAuth client ID (https://support.google.com/cloud/answer/6158849) +// used to create the corresponding course work item. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user is not +// permitted to access the requested course or course work, return the +// requested student submission, or for access errors. * `INVALID_ARGUMENT` if +// the request is malformed. * `NOT_FOUND` if the requested course, course +// work, or student submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the course work. +// - id: Identifier of the student submission. +func (r *CoursesCourseWorkStudentSubmissionsService) Return(courseId string, courseWorkId string, id string, returnstudentsubmissionrequest *ReturnStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsReturnCall { + c := &CoursesCourseWorkStudentSubmissionsReturnCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + c.id = id + c.returnstudentsubmissionrequest = returnstudentsubmissionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReturnCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReturnCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkStudentSubmissionsReturnCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnstudentsubmissionrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.return" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkStudentSubmissionsTurnInCall struct { + s *Service + courseId string + courseWorkId string + id string + turninstudentsubmissionrequest *TurnInStudentSubmissionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TurnIn: Turns in a student submission. Turning in a student submission +// transfers ownership of attached Drive files to the teacher and may also +// update the submission state. This may only be called by the student that +// owns the specified student submission. This request must be made by the +// Developer Console project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work item. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to +// access the requested course or course work, turn in the requested student +// submission, or for access errors. * `INVALID_ARGUMENT` if the request is +// malformed. * `NOT_FOUND` if the requested course, course work, or student +// submission does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - courseWorkId: Identifier of the course work. +// - id: Identifier of the student submission. +func (r *CoursesCourseWorkStudentSubmissionsService) TurnIn(courseId string, courseWorkId string, id string, turninstudentsubmissionrequest *TurnInStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsTurnInCall { + c := &CoursesCourseWorkStudentSubmissionsTurnInCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseWorkId = courseWorkId + c.id = id + c.turninstudentsubmissionrequest = turninstudentsubmissionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsTurnInCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsTurnInCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.turninstudentsubmissionrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "courseWorkId": c.courseWorkId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWork.studentSubmissions.turnIn" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsCreateCall struct { + s *Service + courseId string + courseworkmaterial *CourseWorkMaterial + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a course work material. This method returns the following +// error codes: * `PERMISSION_DENIED` if the requesting user is not permitted +// to access the requested course, create course work material in the requested +// course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` +// if the request is malformed or if more than 20 * materials are provided. * +// `NOT_FOUND` if the requested course does not exist. * `FAILED_PRECONDITION` +// for the following request error: * AttachmentNotVisible +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +func (r *CoursesCourseWorkMaterialsService) Create(courseId string, courseworkmaterial *CourseWorkMaterial) *CoursesCourseWorkMaterialsCreateCall { + c := &CoursesCourseWorkMaterialsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.courseworkmaterial = courseworkmaterial + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsCreateCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkMaterialsCreateCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &CourseWorkMaterial{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsDeleteCall struct { + s *Service + courseId string + id string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a course work material. This request must be made by the +// Developer Console project of the OAuth client ID +// (https://support.google.com/cloud/answer/6158849) used to create the +// corresponding course work material item. This method returns the following +// error codes: * `PERMISSION_DENIED` if the requesting developer project did +// not create the corresponding course work material, if the requesting user is +// not permitted to delete the requested course or for access errors. * +// `FAILED_PRECONDITION` if the requested course work material has already been +// deleted. * `NOT_FOUND` if no course exists with the requested ID. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - id: Identifier of the course work material to delete. This identifier is a +// Classroom-assigned identifier. +func (r *CoursesCourseWorkMaterialsService) Delete(courseId string, id string) *CoursesCourseWorkMaterialsDeleteCall { + c := &CoursesCourseWorkMaterialsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsDeleteCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkMaterialsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsGetCall struct { + s *Service + courseId string + id string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns a course work material. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to +// access the requested course or course work material, or for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the +// requested course or course work material does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - id: Identifier of the course work material. +func (r *CoursesCourseWorkMaterialsService) Get(courseId string, id string) *CoursesCourseWorkMaterialsGetCall { + c := &CoursesCourseWorkMaterialsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkMaterialsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsGetCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkMaterialsGetCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &CourseWorkMaterial{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsGetAddOnContextCall struct { + s *Service + courseId string + itemId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetAddOnContext: Gets metadata for Classroom add-ons in the context of a +// specific post. To maintain the integrity of its own data and permissions +// model, an add-on should call this to validate query parameters and the +// requesting user's role whenever the add-on is opened in an iframe +// (https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). +// This method returns the following error codes: * `PERMISSION_DENIED` for +// access errors. * `INVALID_ARGUMENT` if the request is malformed. * +// `NOT_FOUND` if one of the identified resources does not exist. +// +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkMaterialsService) GetAddOnContext(courseId string, itemId string) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c := &CoursesCourseWorkMaterialsGetAddOnContextCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. The authorization token is +// required when neither of the following is true: * The add-on has attachments +// on the post. * The developer project issuing the request is the same project +// that created the post. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) AddOnToken(addOnToken string) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// AttachmentId sets the optional parameter "attachmentId": The identifier of +// the attachment. This field is required for student users and optional for +// teacher users. If not provided in the student case, an error is returned. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) AttachmentId(attachmentId string) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c.urlParams_.Set("attachmentId", attachmentId) + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) PostId(postId string) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsGetAddOnContextCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnContext") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.getAddOnContext" call. +// Any non-2xx status code is an error. Response headers are in either +// *AddOnContext.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkMaterialsGetAddOnContextCall) Do(opts ...googleapi.CallOption) (*AddOnContext, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AddOnContext{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsListCall struct { + s *Service + courseId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of course work material that the requester is permitted +// to view. Course students may only view `PUBLISHED` course work material. +// Course teachers and domain administrators may view all course work material. +// This method returns the following error codes: * `PERMISSION_DENIED` if the +// requesting user is not permitted to access the requested course or for +// access errors. * `INVALID_ARGUMENT` if the request is malformed. * +// `NOT_FOUND` if the requested course does not exist. +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +func (r *CoursesCourseWorkMaterialsService) List(courseId string) *CoursesCourseWorkMaterialsListCall { + c := &CoursesCourseWorkMaterialsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + return c +} + +// CourseWorkMaterialStates sets the optional parameter +// "courseWorkMaterialStates": Restriction on the work status to return. Only +// course work material that matches is returned. If unspecified, items with a +// work status of `PUBLISHED` is returned. +// +// Possible values: +// +// "COURSEWORK_MATERIAL_STATE_UNSPECIFIED" - No state specified. This is +// +// never returned. +// +// "PUBLISHED" - Status for course work material that has been published. +// +// This is the default state. +// +// "DRAFT" - Status for a course work material that is not yet published. +// +// Course work material in this state is visible only to course teachers and +// domain administrators. +// +// "DELETED" - Status for course work material that was published but is now +// +// deleted. Course work material in this state is visible only to course +// teachers and domain administrators. Course work material in this state is +// deleted after some time. +func (c *CoursesCourseWorkMaterialsListCall) CourseWorkMaterialStates(courseWorkMaterialStates ...string) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.SetMulti("courseWorkMaterialStates", append([]string{}, courseWorkMaterialStates...)) + return c +} + +// MaterialDriveId sets the optional parameter "materialDriveId": Optional +// filtering for course work material with at least one Drive material whose ID +// matches the provided string. If `material_link` is also specified, course +// work material must have materials matching both filters. +func (c *CoursesCourseWorkMaterialsListCall) MaterialDriveId(materialDriveId string) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.Set("materialDriveId", materialDriveId) + return c +} + +// MaterialLink sets the optional parameter "materialLink": Optional filtering +// for course work material with at least one link material whose URL partially +// matches the provided string. +func (c *CoursesCourseWorkMaterialsListCall) MaterialLink(materialLink string) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.Set("materialLink", materialLink) + return c +} + +// OrderBy sets the optional parameter "orderBy": Optional sort ordering for +// results. A comma-separated list of fields with an optional sort direction +// keyword. Supported field is `updateTime`. Supported direction keywords are +// `asc` and `desc`. If not specified, `updateTime desc` is the default +// behavior. Examples: `updateTime asc`, `updateTime` +func (c *CoursesCourseWorkMaterialsListCall) OrderBy(orderBy string) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of items to +// return. Zero or unspecified indicates that the server may assign a maximum. +// The server may return fewer than the specified number of results. +func (c *CoursesCourseWorkMaterialsListCall) PageSize(pageSize int64) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken value +// returned from a previous list call, indicating that the subsequent page of +// results should be returned. The list request must be otherwise identical to +// the one that resulted in this token. +func (c *CoursesCourseWorkMaterialsListCall) PageToken(pageToken string) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkMaterialsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsListCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListCourseWorkMaterialResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesCourseWorkMaterialsListCall) Do(opts ...googleapi.CallOption) (*ListCourseWorkMaterialResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListCourseWorkMaterialResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *CoursesCourseWorkMaterialsListCall) Pages(ctx context.Context, f func(*ListCourseWorkMaterialResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type CoursesCourseWorkMaterialsPatchCall struct { + s *Service + courseId string + id string + courseworkmaterial *CourseWorkMaterial + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates one or more fields of a course work material. This method +// returns the following error codes: * `PERMISSION_DENIED` if the requesting +// developer project for access errors. * `INVALID_ARGUMENT` if the request is +// malformed. * `FAILED_PRECONDITION` if the requested course work material has +// already been deleted. * `NOT_FOUND` if the requested course or course work +// material does not exist +// +// - courseId: Identifier of the course. This identifier can be either the +// Classroom-assigned identifier or an alias. +// - id: Identifier of the course work material. +func (r *CoursesCourseWorkMaterialsService) Patch(courseId string, id string, courseworkmaterial *CourseWorkMaterial) *CoursesCourseWorkMaterialsPatchCall { + c := &CoursesCourseWorkMaterialsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.id = id + c.courseworkmaterial = courseworkmaterial + return c +} + +// UpdateMask sets the optional parameter "updateMask": Mask that identifies +// which fields on the course work material to update. This field is required +// to do an update. The update fails if invalid fields are specified. If a +// field supports empty values, it can be cleared by specifying it in the +// update mask and not in the course work material object. If a field that does +// not support empty values is included in the update mask and not set in the +// course work material object, an `INVALID_ARGUMENT` error is returned. The +// following fields may be specified by teachers: * `title` * `description` * +// `state` * `scheduled_time` * `topic_id` +func (c *CoursesCourseWorkMaterialsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkMaterialsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsPatchCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkMaterialsPatchCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &CourseWorkMaterial{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall struct { + s *Service + courseId string + itemId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates an add-on attachment under a post. Requires the add-on to +// have permission to create new attachments on the post. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. +// +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which to create the attachment. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkMaterialsAddOnAttachmentsService) Create(courseId string, itemId string, addonattachment *AddOnAttachment) *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall { + c := &CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.addonattachment = addonattachment + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. This authorization token is +// required for in-Classroom attachment creation but optional for partner-first +// attachment creation. Returns an error if not provided for partner-first +// attachment creation and the developer projects that created the attachment +// and its parent stream item do not match. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) AddOnToken(addOnToken string) *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) PostId(postId string) *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall { + c.urlParams_.Set("postId", postId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "courseWorkId": c.courseWorkId, - "id": c.id, + "courseId": c.courseId, + "itemId": c.itemId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.get" call. +// Do executes the "classroom.courses.courseWorkMaterials.addOnAttachments.create" call. // Any non-2xx status code is an error. Response headers are in either -// *StudentSubmission.ServerResponse.Header or (if a response was returned at +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *CoursesCourseWorkStudentSubmissionsGetCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsCreateCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5371,7 +9438,7 @@ func (c *CoursesCourseWorkStudentSubmissionsGetCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &StudentSubmission{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5384,109 +9451,163 @@ func (c *CoursesCourseWorkStudentSubmissionsGetCall) Do(opts ...googleapi.CallOp return ret, nil } -type CoursesCourseWorkStudentSubmissionsListCall struct { +type CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall struct { s *Service courseId string - courseWorkId string + itemId string + attachmentId string urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of student submissions that the requester is permitted -// to view, factoring in the OAuth scopes of the request. `-` may be specified -// as the `course_work_id` to include student submissions for multiple course -// work items. Course students may only view their own work. Course teachers -// and domain administrators may view all student submissions. This method -// returns the following error codes: * `PERMISSION_DENIED` if the requesting -// user is not permitted to access the requested course or course work, or for -// access errors. * `INVALID_ARGUMENT` if the request is malformed. * -// `NOT_FOUND` if the requested course does not exist. +// Delete: Deletes an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the student work to request. This may be set -// to the string literal "-" to request student work for all course work in -// the specified course. -func (r *CoursesCourseWorkStudentSubmissionsService) List(courseId string, courseWorkId string) *CoursesCourseWorkStudentSubmissionsListCall { - c := &CoursesCourseWorkStudentSubmissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkMaterialsAddOnAttachmentsService) Delete(courseId string, itemId string, attachmentId string) *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall { + c := &CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId + c.itemId = itemId + c.attachmentId = attachmentId return c } -// Late sets the optional parameter "late": Requested lateness value. If -// specified, returned student submissions are restricted by the requested -// value. If unspecified, submissions are returned regardless of `late` value. -// -// Possible values: -// -// "LATE_VALUES_UNSPECIFIED" - No restriction on submission late values -// -// specified. -// -// "LATE_ONLY" - Return StudentSubmissions where late is true. -// "NOT_LATE_ONLY" - Return StudentSubmissions where late is false. -func (c *CoursesCourseWorkStudentSubmissionsListCall) Late(late string) *CoursesCourseWorkStudentSubmissionsListCall { - c.urlParams_.Set("late", late) +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) PostId(postId string) *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall { + c.urlParams_.Set("postId", postId) return c } -// PageSize sets the optional parameter "pageSize": Maximum number of items to -// return. Zero or unspecified indicates that the server may assign a maximum. -// The server may return fewer than the specified number of results. -func (c *CoursesCourseWorkStudentSubmissionsListCall) PageSize(pageSize int64) *CoursesCourseWorkStudentSubmissionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// PageToken sets the optional parameter "pageToken": nextPageToken value -// returned from a previous list call, indicating that the subsequent page of -// results should be returned. The list request must be otherwise identical to -// the one that resulted in this token. -func (c *CoursesCourseWorkStudentSubmissionsListCall) PageToken(pageToken string) *CoursesCourseWorkStudentSubmissionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Context sets the context to be used in this call's Do method. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall { + c.ctx_ = ctx return c } -// States sets the optional parameter "states": Requested submission states. If -// specified, returned student submissions match one of the specified -// submission states. -// -// Possible values: -// -// "SUBMISSION_STATE_UNSPECIFIED" - No state specified. This should never be -// -// returned. -// -// "NEW" - The student has never accessed this submission. Attachments are -// -// not returned and timestamps is not set. +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "classroom.courses.courseWorkMaterials.addOnAttachments.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type CoursesCourseWorkMaterialsAddOnAttachmentsGetCall struct { + s *Service + courseId string + itemId string + attachmentId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns an add-on attachment. Requires the add-on requesting the +// attachment to be the original creator of the attachment. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. // -// "CREATED" - Has been created. -// "TURNED_IN" - Has been turned in to the teacher. -// "RETURNED" - Has been returned to the student. -// "RECLAIMED_BY_STUDENT" - Student chose to "unsubmit" the assignment. -func (c *CoursesCourseWorkStudentSubmissionsListCall) States(states ...string) *CoursesCourseWorkStudentSubmissionsListCall { - c.urlParams_.SetMulti("states", append([]string{}, states...)) +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// under which the attachment is attached. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkMaterialsAddOnAttachmentsService) Get(courseId string, itemId string, attachmentId string) *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall { + c := &CoursesCourseWorkMaterialsAddOnAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.courseId = courseId + c.itemId = itemId + c.attachmentId = attachmentId return c } -// UserId sets the optional parameter "userId": Optional argument to restrict -// returned student work to those owned by the student with the specified -// identifier. The identifier can be one of the following: * the numeric -// identifier for the user * the email address of the user * the string literal -// "me", indicating the requesting user -func (c *CoursesCourseWorkStudentSubmissionsListCall) UserId(userId string) *CoursesCourseWorkStudentSubmissionsListCall { - c.urlParams_.Set("userId", userId) +// PostId sets the optional parameter "postId": Deprecated, use item_id +// instead. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) PostId(postId string) *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall { + c.urlParams_.Set("postId", postId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsListCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5494,27 +9615,27 @@ func (c *CoursesCourseWorkStudentSubmissionsListCall) Fields(s ...googleapi.Fiel // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *CoursesCourseWorkStudentSubmissionsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsListCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsListCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsListCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsListCall) Header() http.Header { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkStudentSubmissionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -5522,7 +9643,7 @@ func (c *CoursesCourseWorkStudentSubmissionsListCall) doRequest(alt string) (*ht var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -5531,18 +9652,19 @@ func (c *CoursesCourseWorkStudentSubmissionsListCall) doRequest(alt string) (*ht req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, - "courseWorkId": c.courseWorkId, + "itemId": c.itemId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.list" call. +// Do executes the "classroom.courses.courseWorkMaterials.addOnAttachments.get" call. // Any non-2xx status code is an error. Response headers are in either -// *ListStudentSubmissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *CoursesCourseWorkStudentSubmissionsListCall) Do(opts ...googleapi.CallOption) (*ListStudentSubmissionsResponse, error) { +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5561,7 +9683,7 @@ func (c *CoursesCourseWorkStudentSubmissionsListCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListStudentSubmissionsResponse{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5574,117 +9696,119 @@ func (c *CoursesCourseWorkStudentSubmissionsListCall) Do(opts ...googleapi.CallO return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *CoursesCourseWorkStudentSubmissionsListCall) Pages(ctx context.Context, f func(*ListStudentSubmissionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall struct { - s *Service - courseId string - courseWorkId string - id string - modifyattachmentsrequest *ModifyAttachmentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesCourseWorkMaterialsAddOnAttachmentsListCall struct { + s *Service + courseId string + itemId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// ModifyAttachments: Modifies attachments of student submission. Attachments -// may only be added to student submissions belonging to course work objects -// with a `workType` of `ASSIGNMENT`. This request must be made by the -// Developer Console project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work item. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to -// access the requested course or course work, if the user is not permitted to -// modify attachments on the requested student submission, or for access -// errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if -// the requested course, course work, or student submission does not exist. +// List: Returns all attachments created by an add-on under the post. Requires +// the add-on to have active attachments on the post or have permission to +// create new attachments on the post. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the course work. -// - id: Identifier of the student submission. -func (r *CoursesCourseWorkStudentSubmissionsService) ModifyAttachments(courseId string, courseWorkId string, id string, modifyattachmentsrequest *ModifyAttachmentsRequest) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall { - c := &CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - itemId: Identifier of the announcement, courseWork, or courseWorkMaterial +// whose attachments should be enumerated. This field is required, but is not +// marked as such while we are migrating from post_id. +func (r *CoursesCourseWorkMaterialsAddOnAttachmentsService) List(courseId string, itemId string) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { + c := &CoursesCourseWorkMaterialsAddOnAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId - c.id = id - c.modifyattachmentsrequest = modifyattachmentsrequest + c.itemId = itemId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// attachments to return. The service may return fewer than this value. If +// unspecified, at most 20 attachments will be returned. The maximum value is +// 20; values above 20 will be coerced to 20. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) PageSize(pageSize int64) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAddOnAttachments` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListAddOnAttachments` must match the call that provided the page token. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) PageToken(pageToken string) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// PostId sets the optional parameter "postId": Identifier of the post under +// the course whose attachments to enumerate. Deprecated, use item_id instead. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) PostId(postId string) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { + c.urlParams_.Set("postId", postId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsAddOnAttachmentsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Header() http.Header { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyattachmentsrequest) - if err != nil { - return nil, err +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "courseWorkId": c.courseWorkId, - "id": c.id, + "courseId": c.courseId, + "itemId": c.itemId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.modifyAttachments" call. +// Do executes the "classroom.courses.courseWorkMaterials.addOnAttachments.list" call. // Any non-2xx status code is an error. Response headers are in either -// *StudentSubmission.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) { +// *ListAddOnAttachmentsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ListAddOnAttachmentsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5703,7 +9827,7 @@ func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Do(opts ...go if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &StudentSubmission{ + ret := &ListAddOnAttachmentsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5716,48 +9840,73 @@ func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Do(opts ...go return ret, nil } -type CoursesCourseWorkStudentSubmissionsPatchCall struct { - s *Service - courseId string - courseWorkId string - id string - studentsubmission *StudentSubmission - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsListCall) Pages(ctx context.Context, f func(*ListAddOnAttachmentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Patch: Updates one or more fields of a student submission. See -// google.classroom.v1.StudentSubmission for details of which fields may be -// updated and who may change them. This request must be made by the Developer -// Console project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work item. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting developer project did not -// create the corresponding course work, if the user is not permitted to make -// the requested modification to the student submission, or for access errors. -// * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the -// requested course, course work, or student submission does not exist. +type CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall struct { + s *Service + courseId string + itemId string + attachmentId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the course work. -// - id: Identifier of the student submission. -func (r *CoursesCourseWorkStudentSubmissionsService) Patch(courseId string, courseWorkId string, id string, studentsubmission *StudentSubmission) *CoursesCourseWorkStudentSubmissionsPatchCall { - c := &CoursesCourseWorkStudentSubmissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - itemId: Identifier of the post under which the attachment is attached. +func (r *CoursesCourseWorkMaterialsAddOnAttachmentsService) Patch(courseId string, itemId string, attachmentId string, addonattachment *AddOnAttachment) *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall { + c := &CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId - c.id = id - c.studentsubmission = studentsubmission + c.itemId = itemId + c.attachmentId = attachmentId + c.addonattachment = addonattachment return c } -// UpdateMask sets the optional parameter "updateMask": Mask that identifies -// which fields on the student submission to update. This field is required to -// do an update. The update fails if invalid fields are specified. The -// following fields may be specified by teachers: * `draft_grade` * -// `assigned_grade` -func (c *CoursesCourseWorkStudentSubmissionsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkStudentSubmissionsPatchCall { +// PostId sets the optional parameter "postId": Required. Identifier of the +// post under which the attachment is attached. +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) PostId(postId string) *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall { + c.urlParams_.Set("postId", postId) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Mask that +// identifies which fields on the attachment to update. The update fails if +// invalid fields are specified. If a field supports empty values, it can be +// cleared by specifying it in the update mask and not in the `AddOnAttachment` +// object. If a field that does not support empty values is included in the +// update mask and not set in the `AddOnAttachment` object, an +// `INVALID_ARGUMENT` error is returned. The following fields may be specified +// by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * +// `student_work_review_uri` * `due_date` * `due_time` * `max_points` +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -5765,36 +9914,36 @@ func (c *CoursesCourseWorkStudentSubmissionsPatchCall) UpdateMask(updateMask str // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsPatchCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsPatchCall { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Header() http.Header { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.studentsubmission) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{itemId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { @@ -5803,19 +9952,19 @@ func (c *CoursesCourseWorkStudentSubmissionsPatchCall) doRequest(alt string) (*h req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, - "courseWorkId": c.courseWorkId, - "id": c.id, + "itemId": c.itemId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.patch" call. +// Do executes the "classroom.courses.courseWorkMaterials.addOnAttachments.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *StudentSubmission.ServerResponse.Header or (if a response was returned at +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) { +func (c *CoursesCourseWorkMaterialsAddOnAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5834,7 +9983,7 @@ func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &StudentSubmission{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5847,98 +9996,121 @@ func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Do(opts ...googleapi.Call return ret, nil } -type CoursesCourseWorkStudentSubmissionsReclaimCall struct { - s *Service - courseId string - courseWorkId string - id string - reclaimstudentsubmissionrequest *ReclaimStudentSubmissionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesPostsGetAddOnContextCall struct { + s *Service + courseId string + postId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Reclaim: Reclaims a student submission on behalf of the student that owns -// it. Reclaiming a student submission transfers ownership of attached Drive -// files to the student and updates the submission state. Only the student that -// owns the requested student submission may call this method, and only for a -// student submission that has been turned in. This request must be made by the -// Developer Console project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work item. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to -// access the requested course or course work, unsubmit the requested student -// submission, or for access errors. * `FAILED_PRECONDITION` if the student -// submission has not been turned in. * `INVALID_ARGUMENT` if the request is -// malformed. * `NOT_FOUND` if the requested course, course work, or student -// submission does not exist. +// GetAddOnContext: Gets metadata for Classroom add-ons in the context of a +// specific post. To maintain the integrity of its own data and permissions +// model, an add-on should call this to validate query parameters and the +// requesting user's role whenever the add-on is opened in an iframe +// (https://developers.google.com/classroom/add-ons/get-started/iframes/iframes-overview). +// This method returns the following error codes: * `PERMISSION_DENIED` for +// access errors. * `INVALID_ARGUMENT` if the request is malformed. * +// `NOT_FOUND` if one of the identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the course work. -// - id: Identifier of the student submission. -func (r *CoursesCourseWorkStudentSubmissionsService) Reclaim(courseId string, courseWorkId string, id string, reclaimstudentsubmissionrequest *ReclaimStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsReclaimCall { - c := &CoursesCourseWorkStudentSubmissionsReclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - postId: Optional. Deprecated, use item_id instead. +func (r *CoursesPostsService) GetAddOnContext(courseId string, postId string) *CoursesPostsGetAddOnContextCall { + c := &CoursesPostsGetAddOnContextCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId - c.id = id - c.reclaimstudentsubmissionrequest = reclaimstudentsubmissionrequest + c.postId = postId + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. The authorization token is +// required when neither of the following is true: * The add-on has attachments +// on the post. * The developer project issuing the request is the same project +// that created the post. +func (c *CoursesPostsGetAddOnContextCall) AddOnToken(addOnToken string) *CoursesPostsGetAddOnContextCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// AttachmentId sets the optional parameter "attachmentId": The identifier of +// the attachment. This field is required for student users and optional for +// teacher users. If not provided in the student case, an error is returned. +func (c *CoursesPostsGetAddOnContextCall) AttachmentId(attachmentId string) *CoursesPostsGetAddOnContextCall { + c.urlParams_.Set("attachmentId", attachmentId) + return c +} + +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial under which the attachment is attached. +// This field is required, but is not marked as such while we are migrating +// from post_id. +func (c *CoursesPostsGetAddOnContextCall) ItemId(itemId string) *CoursesPostsGetAddOnContextCall { + c.urlParams_.Set("itemId", itemId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReclaimCall { +func (c *CoursesPostsGetAddOnContextCall) Fields(s ...googleapi.Field) *CoursesPostsGetAddOnContextCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesPostsGetAddOnContextCall) IfNoneMatch(entityTag string) *CoursesPostsGetAddOnContextCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReclaimCall { +func (c *CoursesPostsGetAddOnContextCall) Context(ctx context.Context) *CoursesPostsGetAddOnContextCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Header() http.Header { +func (c *CoursesPostsGetAddOnContextCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } - -func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.reclaimstudentsubmissionrequest) - if err != nil { - return nil, err + +func (c *CoursesPostsGetAddOnContextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnContext") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "courseWorkId": c.courseWorkId, - "id": c.id, + "courseId": c.courseId, + "postId": c.postId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.reclaim" call. +// Do executes the "classroom.courses.posts.getAddOnContext" call. // Any non-2xx status code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *AddOnContext.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *CoursesPostsGetAddOnContextCall) Do(opts ...googleapi.CallOption) (*AddOnContext, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5957,7 +10129,7 @@ func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &AddOnContext{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5970,77 +10142,86 @@ func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Do(opts ...googleapi.Ca return ret, nil } -type CoursesCourseWorkStudentSubmissionsReturnCall struct { - s *Service - courseId string - courseWorkId string - id string - returnstudentsubmissionrequest *ReturnStudentSubmissionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesPostsAddOnAttachmentsCreateCall struct { + s *Service + courseId string + postId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Return: Returns a student submission. Returning a student submission -// transfers ownership of attached Drive files to the student and may also -// update the submission state. Unlike the Classroom application, returning a -// student submission does not set assignedGrade to the draftGrade value. Only -// a teacher of the course that contains the requested student submission may -// call this method. This request must be made by the Developer Console project -// of the OAuth client ID (https://support.google.com/cloud/answer/6158849) -// used to create the corresponding course work item. This method returns the -// following error codes: * `PERMISSION_DENIED` if the requesting user is not -// permitted to access the requested course or course work, return the -// requested student submission, or for access errors. * `INVALID_ARGUMENT` if -// the request is malformed. * `NOT_FOUND` if the requested course, course -// work, or student submission does not exist. +// Create: Creates an add-on attachment under a post. Requires the add-on to +// have permission to create new attachments on the post. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the course work. -// - id: Identifier of the student submission. -func (r *CoursesCourseWorkStudentSubmissionsService) Return(courseId string, courseWorkId string, id string, returnstudentsubmissionrequest *ReturnStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsReturnCall { - c := &CoursesCourseWorkStudentSubmissionsReturnCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - postId: Optional. Deprecated, use item_id instead. +func (r *CoursesPostsAddOnAttachmentsService) Create(courseId string, postId string, addonattachment *AddOnAttachment) *CoursesPostsAddOnAttachmentsCreateCall { + c := &CoursesPostsAddOnAttachmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId - c.id = id - c.returnstudentsubmissionrequest = returnstudentsubmissionrequest + c.postId = postId + c.addonattachment = addonattachment + return c +} + +// AddOnToken sets the optional parameter "addOnToken": Token that authorizes +// the request. The token is passed as a query parameter when the user is +// redirected from Classroom to the add-on's URL. This authorization token is +// required for in-Classroom attachment creation but optional for partner-first +// attachment creation. Returns an error if not provided for partner-first +// attachment creation and the developer projects that created the attachment +// and its parent stream item do not match. +func (c *CoursesPostsAddOnAttachmentsCreateCall) AddOnToken(addOnToken string) *CoursesPostsAddOnAttachmentsCreateCall { + c.urlParams_.Set("addOnToken", addOnToken) + return c +} + +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial under which to create the attachment. This +// field is required, but is not marked as such while we are migrating from +// post_id. +func (c *CoursesPostsAddOnAttachmentsCreateCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsCreateCall { + c.urlParams_.Set("itemId", itemId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReturnCall { +func (c *CoursesPostsAddOnAttachmentsCreateCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReturnCall { +func (c *CoursesPostsAddOnAttachmentsCreateCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsCreateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkStudentSubmissionsReturnCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesPostsAddOnAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnstudentsubmissionrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -6048,19 +10229,19 @@ func (c *CoursesCourseWorkStudentSubmissionsReturnCall) doRequest(alt string) (* } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "courseWorkId": c.courseWorkId, - "id": c.id, + "courseId": c.courseId, + "postId": c.postId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.return" call. +// Do executes the "classroom.courses.posts.addOnAttachments.create" call. // Any non-2xx status code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *CoursesPostsAddOnAttachmentsCreateCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6079,7 +10260,7 @@ func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6092,96 +10273,91 @@ func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Do(opts ...googleapi.Cal return ret, nil } -type CoursesCourseWorkStudentSubmissionsTurnInCall struct { - s *Service - courseId string - courseWorkId string - id string - turninstudentsubmissionrequest *TurnInStudentSubmissionRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesPostsAddOnAttachmentsDeleteCall struct { + s *Service + courseId string + postId string + attachmentId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// TurnIn: Turns in a student submission. Turning in a student submission -// transfers ownership of attached Drive files to the teacher and may also -// update the submission state. This may only be called by the student that -// owns the specified student submission. This request must be made by the -// Developer Console project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work item. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to -// access the requested course or course work, turn in the requested student -// submission, or for access errors. * `INVALID_ARGUMENT` if the request is -// malformed. * `NOT_FOUND` if the requested course, course work, or student -// submission does not exist. +// Delete: Deletes an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - courseWorkId: Identifier of the course work. -// - id: Identifier of the student submission. -func (r *CoursesCourseWorkStudentSubmissionsService) TurnIn(courseId string, courseWorkId string, id string, turninstudentsubmissionrequest *TurnInStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsTurnInCall { - c := &CoursesCourseWorkStudentSubmissionsTurnInCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - postId: Optional. Deprecated, use item_id instead. +func (r *CoursesPostsAddOnAttachmentsService) Delete(courseId string, postId string, attachmentId string) *CoursesPostsAddOnAttachmentsDeleteCall { + c := &CoursesPostsAddOnAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseWorkId = courseWorkId - c.id = id - c.turninstudentsubmissionrequest = turninstudentsubmissionrequest + c.postId = postId + c.attachmentId = attachmentId + return c +} + +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial under which the attachment is attached. +// This field is required, but is not marked as such while we are migrating +// from post_id. +func (c *CoursesPostsAddOnAttachmentsDeleteCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsDeleteCall { + c.urlParams_.Set("itemId", itemId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsTurnInCall { +func (c *CoursesPostsAddOnAttachmentsDeleteCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsTurnInCall { +func (c *CoursesPostsAddOnAttachmentsDeleteCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *CoursesPostsAddOnAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.turninstudentsubmissionrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, - "courseWorkId": c.courseWorkId, - "id": c.id, + "postId": c.postId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWork.studentSubmissions.turnIn" call. +// Do executes the "classroom.courses.posts.addOnAttachments.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Empty.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +func (c *CoursesPostsAddOnAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6213,84 +10389,104 @@ func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Do(opts ...googleapi.Cal return ret, nil } -type CoursesCourseWorkMaterialsCreateCall struct { - s *Service - courseId string - courseworkmaterial *CourseWorkMaterial - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesPostsAddOnAttachmentsGetCall struct { + s *Service + courseId string + postId string + attachmentId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a course work material. This method returns the following -// error codes: * `PERMISSION_DENIED` if the requesting user is not permitted -// to access the requested course, create course work material in the requested -// course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` -// if the request is malformed or if more than 20 * materials are provided. * -// `NOT_FOUND` if the requested course does not exist. * `FAILED_PRECONDITION` -// for the following request error: * AttachmentNotVisible +// Get: Returns an add-on attachment. Requires the add-on requesting the +// attachment to be the original creator of the attachment. This method returns +// the following error codes: * `PERMISSION_DENIED` for access errors. * +// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the +// identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -func (r *CoursesCourseWorkMaterialsService) Create(courseId string, courseworkmaterial *CourseWorkMaterial) *CoursesCourseWorkMaterialsCreateCall { - c := &CoursesCourseWorkMaterialsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - postId: Optional. Deprecated, use item_id instead. +func (r *CoursesPostsAddOnAttachmentsService) Get(courseId string, postId string, attachmentId string) *CoursesPostsAddOnAttachmentsGetCall { + c := &CoursesPostsAddOnAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.courseworkmaterial = courseworkmaterial + c.postId = postId + c.attachmentId = attachmentId + return c +} + +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial under which the attachment is attached. +// This field is required, but is not marked as such while we are migrating +// from post_id. +func (c *CoursesPostsAddOnAttachmentsGetCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsGetCall { + c.urlParams_.Set("itemId", itemId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkMaterialsCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsCreateCall { +func (c *CoursesPostsAddOnAttachmentsGetCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesPostsAddOnAttachmentsGetCall) IfNoneMatch(entityTag string) *CoursesPostsAddOnAttachmentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkMaterialsCreateCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsCreateCall { +func (c *CoursesPostsAddOnAttachmentsGetCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkMaterialsCreateCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkMaterialsCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial) - if err != nil { - return nil, err +func (c *CoursesPostsAddOnAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, + "courseId": c.courseId, + "postId": c.postId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWorkMaterials.create" call. +// Do executes the "classroom.courses.posts.addOnAttachments.get" call. // Any non-2xx status code is an error. Response headers are in either -// *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *CoursesCourseWorkMaterialsCreateCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) { +func (c *CoursesPostsAddOnAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6309,7 +10505,7 @@ func (c *CoursesCourseWorkMaterialsCreateCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CourseWorkMaterial{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6322,84 +10518,120 @@ func (c *CoursesCourseWorkMaterialsCreateCall) Do(opts ...googleapi.CallOption) return ret, nil } -type CoursesCourseWorkMaterialsDeleteCall struct { - s *Service - courseId string - id string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesPostsAddOnAttachmentsListCall struct { + s *Service + courseId string + postId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a course work material. This request must be made by the -// Developer Console project of the OAuth client ID -// (https://support.google.com/cloud/answer/6158849) used to create the -// corresponding course work material item. This method returns the following -// error codes: * `PERMISSION_DENIED` if the requesting developer project did -// not create the corresponding course work material, if the requesting user is -// not permitted to delete the requested course or for access errors. * -// `FAILED_PRECONDITION` if the requested course work material has already been -// deleted. * `NOT_FOUND` if no course exists with the requested ID. +// List: Returns all attachments created by an add-on under the post. Requires +// the add-on to have active attachments on the post or have permission to +// create new attachments on the post. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - id: Identifier of the course work material to delete. This identifier is a -// Classroom-assigned identifier. -func (r *CoursesCourseWorkMaterialsService) Delete(courseId string, id string) *CoursesCourseWorkMaterialsDeleteCall { - c := &CoursesCourseWorkMaterialsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - courseId: Identifier of the course. +// - postId: Optional. Identifier of the post under the course whose +// attachments to enumerate. Deprecated, use item_id instead. +func (r *CoursesPostsAddOnAttachmentsService) List(courseId string, postId string) *CoursesPostsAddOnAttachmentsListCall { + c := &CoursesPostsAddOnAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id + c.postId = postId + return c +} + +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial whose attachments should be enumerated. +// This field is required, but is not marked as such while we are migrating +// from post_id. +func (c *CoursesPostsAddOnAttachmentsListCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsListCall { + c.urlParams_.Set("itemId", itemId) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// attachments to return. The service may return fewer than this value. If +// unspecified, at most 20 attachments will be returned. The maximum value is +// 20; values above 20 will be coerced to 20. +func (c *CoursesPostsAddOnAttachmentsListCall) PageSize(pageSize int64) *CoursesPostsAddOnAttachmentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAddOnAttachments` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListAddOnAttachments` must match the call that provided the page token. +func (c *CoursesPostsAddOnAttachmentsListCall) PageToken(pageToken string) *CoursesPostsAddOnAttachmentsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkMaterialsDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsDeleteCall { +func (c *CoursesPostsAddOnAttachmentsListCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *CoursesPostsAddOnAttachmentsListCall) IfNoneMatch(entityTag string) *CoursesPostsAddOnAttachmentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkMaterialsDeleteCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsDeleteCall { +func (c *CoursesPostsAddOnAttachmentsListCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkMaterialsDeleteCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkMaterialsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesPostsAddOnAttachmentsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "courseId": c.courseId, - "id": c.id, + "postId": c.postId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWorkMaterials.delete" call. +// Do executes the "classroom.courses.posts.addOnAttachments.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *CoursesCourseWorkMaterialsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { +// *ListAddOnAttachmentsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesPostsAddOnAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ListAddOnAttachmentsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6418,7 +10650,7 @@ func (c *CoursesCourseWorkMaterialsDeleteCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Empty{ + ret := &ListAddOnAttachmentsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6431,92 +10663,131 @@ func (c *CoursesCourseWorkMaterialsDeleteCall) Do(opts ...googleapi.CallOption) return ret, nil } -type CoursesCourseWorkMaterialsGetCall struct { - s *Service - courseId string - id string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *CoursesPostsAddOnAttachmentsListCall) Pages(ctx context.Context, f func(*ListAddOnAttachmentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Get: Returns a course work material. This method returns the following error -// codes: * `PERMISSION_DENIED` if the requesting user is not permitted to -// access the requested course or course work material, or for access errors. * -// `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the -// requested course or course work material does not exist. +type CoursesPostsAddOnAttachmentsPatchCall struct { + s *Service + courseId string + postId string + attachmentId string + addonattachment *AddOnAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an add-on attachment. Requires the add-on to have been the +// original creator of the attachment. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the +// request is malformed. * `NOT_FOUND` if one of the identified resources does +// not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - id: Identifier of the course work material. -func (r *CoursesCourseWorkMaterialsService) Get(courseId string, id string) *CoursesCourseWorkMaterialsGetCall { - c := &CoursesCourseWorkMaterialsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - postId: Identifier of the post under which the attachment is attached. +func (r *CoursesPostsAddOnAttachmentsService) Patch(courseId string, postId string, attachmentId string, addonattachment *AddOnAttachment) *CoursesPostsAddOnAttachmentsPatchCall { + c := &CoursesPostsAddOnAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id + c.postId = postId + c.attachmentId = attachmentId + c.addonattachment = addonattachment + return c +} + +// ItemId sets the optional parameter "itemId": Identifier of the post under +// which the attachment is attached. +func (c *CoursesPostsAddOnAttachmentsPatchCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsPatchCall { + c.urlParams_.Set("itemId", itemId) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Mask that +// identifies which fields on the attachment to update. The update fails if +// invalid fields are specified. If a field supports empty values, it can be +// cleared by specifying it in the update mask and not in the `AddOnAttachment` +// object. If a field that does not support empty values is included in the +// update mask and not set in the `AddOnAttachment` object, an +// `INVALID_ARGUMENT` error is returned. The following fields may be specified +// by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * +// `student_work_review_uri` * `due_date` * `due_time` * `max_points` +func (c *CoursesPostsAddOnAttachmentsPatchCall) UpdateMask(updateMask string) *CoursesPostsAddOnAttachmentsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkMaterialsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsGetCall { +func (c *CoursesPostsAddOnAttachmentsPatchCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *CoursesCourseWorkMaterialsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkMaterialsGetCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsGetCall { +func (c *CoursesPostsAddOnAttachmentsPatchCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkMaterialsGetCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkMaterialsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *CoursesPostsAddOnAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachment) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "id": c.id, + "courseId": c.courseId, + "postId": c.postId, + "attachmentId": c.attachmentId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWorkMaterials.get" call. +// Do executes the "classroom.courses.posts.addOnAttachments.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at +// *AddOnAttachment.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *CoursesCourseWorkMaterialsGetCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) { +func (c *CoursesPostsAddOnAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*AddOnAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6535,7 +10806,7 @@ func (c *CoursesCourseWorkMaterialsGetCall) Do(opts ...googleapi.CallOption) (*C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CourseWorkMaterial{ + ret := &AddOnAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6548,109 +10819,49 @@ func (c *CoursesCourseWorkMaterialsGetCall) Do(opts ...googleapi.CallOption) (*C return ret, nil } -type CoursesCourseWorkMaterialsListCall struct { +type CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall struct { s *Service courseId string + postId string + attachmentId string + submissionId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of course work material that the requester is permitted -// to view. Course students may only view `PUBLISHED` course work material. -// Course teachers and domain administrators may view all course work material. -// This method returns the following error codes: * `PERMISSION_DENIED` if the -// requesting user is not permitted to access the requested course or for -// access errors. * `INVALID_ARGUMENT` if the request is malformed. * -// `NOT_FOUND` if the requested course does not exist. +// Get: Returns a student submission for an add-on attachment. This method +// returns the following error codes: * `PERMISSION_DENIED` for access errors. +// * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of +// the identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -func (r *CoursesCourseWorkMaterialsService) List(courseId string) *CoursesCourseWorkMaterialsListCall { - c := &CoursesCourseWorkMaterialsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - postId: Optional. Deprecated, use item_id instead. +// - submissionId: Identifier of the student’s submission. +func (r *CoursesPostsAddOnAttachmentsStudentSubmissionsService) Get(courseId string, postId string, attachmentId string, submissionId string) *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall { + c := &CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId + c.postId = postId + c.attachmentId = attachmentId + c.submissionId = submissionId return c } -// CourseWorkMaterialStates sets the optional parameter -// "courseWorkMaterialStates": Restriction on the work status to return. Only -// course work material that matches is returned. If unspecified, items with a -// work status of `PUBLISHED` is returned. -// -// Possible values: -// -// "COURSEWORK_MATERIAL_STATE_UNSPECIFIED" - No state specified. This is -// -// never returned. -// -// "PUBLISHED" - Status for course work material that has been published. -// -// This is the default state. -// -// "DRAFT" - Status for a course work material that is not yet published. -// -// Course work material in this state is visible only to course teachers and -// domain administrators. -// -// "DELETED" - Status for course work material that was published but is now -// -// deleted. Course work material in this state is visible only to course -// teachers and domain administrators. Course work material in this state is -// deleted after some time. -func (c *CoursesCourseWorkMaterialsListCall) CourseWorkMaterialStates(courseWorkMaterialStates ...string) *CoursesCourseWorkMaterialsListCall { - c.urlParams_.SetMulti("courseWorkMaterialStates", append([]string{}, courseWorkMaterialStates...)) - return c -} - -// MaterialDriveId sets the optional parameter "materialDriveId": Optional -// filtering for course work material with at least one Drive material whose ID -// matches the provided string. If `material_link` is also specified, course -// work material must have materials matching both filters. -func (c *CoursesCourseWorkMaterialsListCall) MaterialDriveId(materialDriveId string) *CoursesCourseWorkMaterialsListCall { - c.urlParams_.Set("materialDriveId", materialDriveId) - return c -} - -// MaterialLink sets the optional parameter "materialLink": Optional filtering -// for course work material with at least one link material whose URL partially -// matches the provided string. -func (c *CoursesCourseWorkMaterialsListCall) MaterialLink(materialLink string) *CoursesCourseWorkMaterialsListCall { - c.urlParams_.Set("materialLink", materialLink) - return c -} - -// OrderBy sets the optional parameter "orderBy": Optional sort ordering for -// results. A comma-separated list of fields with an optional sort direction -// keyword. Supported field is `updateTime`. Supported direction keywords are -// `asc` and `desc`. If not specified, `updateTime desc` is the default -// behavior. Examples: `updateTime asc`, `updateTime` -func (c *CoursesCourseWorkMaterialsListCall) OrderBy(orderBy string) *CoursesCourseWorkMaterialsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "pageSize": Maximum number of items to -// return. Zero or unspecified indicates that the server may assign a maximum. -// The server may return fewer than the specified number of results. -func (c *CoursesCourseWorkMaterialsListCall) PageSize(pageSize int64) *CoursesCourseWorkMaterialsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": nextPageToken value -// returned from a previous list call, indicating that the subsequent page of -// results should be returned. The list request must be otherwise identical to -// the one that resulted in this token. -func (c *CoursesCourseWorkMaterialsListCall) PageToken(pageToken string) *CoursesCourseWorkMaterialsListCall { - c.urlParams_.Set("pageToken", pageToken) +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial under which the attachment is attached. +// This field is required, but is not marked as such while we are migrating +// from post_id. +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall { + c.urlParams_.Set("itemId", itemId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkMaterialsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsListCall { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6658,27 +10869,27 @@ func (c *CoursesCourseWorkMaterialsListCall) Fields(s ...googleapi.Field) *Cours // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *CoursesCourseWorkMaterialsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsListCall { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) IfNoneMatch(entityTag string) *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkMaterialsListCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsListCall { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkMaterialsListCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkMaterialsListCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -6686,7 +10897,7 @@ func (c *CoursesCourseWorkMaterialsListCall) doRequest(alt string) (*http.Respon var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6694,18 +10905,21 @@ func (c *CoursesCourseWorkMaterialsListCall) doRequest(alt string) (*http.Respon } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, + "courseId": c.courseId, + "postId": c.postId, + "attachmentId": c.attachmentId, + "submissionId": c.submissionId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWorkMaterials.list" call. +// Do executes the "classroom.courses.posts.addOnAttachments.studentSubmissions.get" call. // Any non-2xx status code is an error. Response headers are in either -// *ListCourseWorkMaterialResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *AddOnAttachmentStudentSubmission.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *CoursesCourseWorkMaterialsListCall) Do(opts ...googleapi.CallOption) (*ListCourseWorkMaterialResponse, error) { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsGetCall) Do(opts ...googleapi.CallOption) (*AddOnAttachmentStudentSubmission, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6724,7 +10938,7 @@ func (c *CoursesCourseWorkMaterialsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListCourseWorkMaterialResponse{ + ret := &AddOnAttachmentStudentSubmission{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6737,65 +10951,55 @@ func (c *CoursesCourseWorkMaterialsListCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *CoursesCourseWorkMaterialsListCall) Pages(ctx context.Context, f func(*ListCourseWorkMaterialResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type CoursesCourseWorkMaterialsPatchCall struct { - s *Service - courseId string - id string - courseworkmaterial *CourseWorkMaterial - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall struct { + s *Service + courseId string + postId string + attachmentId string + submissionId string + addonattachmentstudentsubmission *AddOnAttachmentStudentSubmission + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates one or more fields of a course work material. This method -// returns the following error codes: * `PERMISSION_DENIED` if the requesting -// developer project for access errors. * `INVALID_ARGUMENT` if the request is -// malformed. * `FAILED_PRECONDITION` if the requested course work material has -// already been deleted. * `NOT_FOUND` if the requested course or course work -// material does not exist +// Patch: Updates data associated with an add-on attachment submission. +// Requires the add-on to have been the original creator of the attachment and +// the attachment to have a positive `max_points` value set. This method +// returns the following error codes: * `PERMISSION_DENIED` for access errors. +// * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of +// the identified resources does not exist. // -// - courseId: Identifier of the course. This identifier can be either the -// Classroom-assigned identifier or an alias. -// - id: Identifier of the course work material. -func (r *CoursesCourseWorkMaterialsService) Patch(courseId string, id string, courseworkmaterial *CourseWorkMaterial) *CoursesCourseWorkMaterialsPatchCall { - c := &CoursesCourseWorkMaterialsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - attachmentId: Identifier of the attachment. +// - courseId: Identifier of the course. +// - postId: Optional. Deprecated, use item_id instead. +// - submissionId: Identifier of the student's submission. +func (r *CoursesPostsAddOnAttachmentsStudentSubmissionsService) Patch(courseId string, postId string, attachmentId string, submissionId string, addonattachmentstudentsubmission *AddOnAttachmentStudentSubmission) *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall { + c := &CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.courseId = courseId - c.id = id - c.courseworkmaterial = courseworkmaterial + c.postId = postId + c.attachmentId = attachmentId + c.submissionId = submissionId + c.addonattachmentstudentsubmission = addonattachmentstudentsubmission return c } -// UpdateMask sets the optional parameter "updateMask": Mask that identifies -// which fields on the course work material to update. This field is required -// to do an update. The update fails if invalid fields are specified. If a -// field supports empty values, it can be cleared by specifying it in the -// update mask and not in the course work material object. If a field that does -// not support empty values is included in the update mask and not set in the -// course work material object, an `INVALID_ARGUMENT` error is returned. The -// following fields may be specified by teachers: * `title` * `description` * -// `state` * `scheduled_time` * `topic_id` -func (c *CoursesCourseWorkMaterialsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkMaterialsPatchCall { +// ItemId sets the optional parameter "itemId": Identifier of the announcement, +// courseWork, or courseWorkMaterial under which the attachment is attached. +// This field is required, but is not marked as such while we are migrating +// from post_id. +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) ItemId(itemId string) *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall { + c.urlParams_.Set("itemId", itemId) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. Mask that +// identifies which fields on the attachment to update. The update fails if +// invalid fields are specified. If a field supports empty values, it can be +// cleared by specifying it in the update mask and not in the +// `AddOnAttachmentStudentSubmission` object. The following fields may be +// specified by teachers: * `points_earned` +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) UpdateMask(updateMask string) *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -6803,36 +11007,36 @@ func (c *CoursesCourseWorkMaterialsPatchCall) UpdateMask(updateMask string) *Cou // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *CoursesCourseWorkMaterialsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsPatchCall { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) Fields(s ...googleapi.Field) *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *CoursesCourseWorkMaterialsPatchCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsPatchCall { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) Context(ctx context.Context) *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *CoursesCourseWorkMaterialsPatchCall) Header() http.Header { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *CoursesCourseWorkMaterialsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addonattachmentstudentsubmission) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/posts/{postId}/addOnAttachments/{attachmentId}/studentSubmissions/{submissionId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { @@ -6840,19 +11044,21 @@ func (c *CoursesCourseWorkMaterialsPatchCall) doRequest(alt string) (*http.Respo } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "courseId": c.courseId, - "id": c.id, + "courseId": c.courseId, + "postId": c.postId, + "attachmentId": c.attachmentId, + "submissionId": c.submissionId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "classroom.courses.courseWorkMaterials.patch" call. +// Do executes the "classroom.courses.posts.addOnAttachments.studentSubmissions.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *CoursesCourseWorkMaterialsPatchCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) { +// *AddOnAttachmentStudentSubmission.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesPostsAddOnAttachmentsStudentSubmissionsPatchCall) Do(opts ...googleapi.CallOption) (*AddOnAttachmentStudentSubmission, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6871,7 +11077,7 @@ func (c *CoursesCourseWorkMaterialsPatchCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CourseWorkMaterial{ + ret := &AddOnAttachmentStudentSubmission{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, diff --git a/cloudkms/v1/cloudkms-api.json b/cloudkms/v1/cloudkms-api.json index d14b423139f..14f33467e67 100644 --- a/cloudkms/v1/cloudkms-api.json +++ b/cloudkms/v1/cloudkms-api.json @@ -33,6 +33,11 @@ "description": "Regional Endpoint", "endpointUrl": "https://cloudkms.me-central2.rep.googleapis.com/", "location": "me-central2" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://cloudkms.us-east1.rep.googleapis.com/", + "location": "us-east1" } ], "fullyEncodeReservedExpansion": true, @@ -2056,7 +2061,7 @@ } } }, - "revision": "20240513", + "revision": "20240611", "rootUrl": "https://cloudkms.googleapis.com/", "schemas": { "AsymmetricDecryptRequest": { @@ -2381,6 +2386,10 @@ "description": "Immutable. Whether this key may contain imported versions only.", "type": "boolean" }, + "keyAccessJustificationsPolicy": { + "$ref": "KeyAccessJustificationsPolicy", + "description": "Optional. The policy used for Key Access Justifications Policy Enforcement. If this field is present and this key is enrolled in Key Access Justifications Policy Enforcement, the policy will be evaluated in Encrypt, Decrypt, and Sign operations, and the operation will fail if rejected by the policy. The policy is defined by specifying zero or more allowed justification codes. https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes By default, this field is absent, and all justification codes are allowed." + }, "labels": { "additionalProperties": { "type": "string" @@ -3270,6 +3279,48 @@ }, "type": "object" }, + "KeyAccessJustificationsPolicy": { + "description": "A KeyAccessJustificationsPolicy specifies zero or more allowed AccessReason values for Encrypt, Decrypt, and Sign requests on a CryptoKey.", + "id": "KeyAccessJustificationsPolicy", + "properties": { + "allowedAccessReasons": { + "description": "The list of allowed reasons for access to a CryptoKey. Zero allowed access reasons means all Encrypt, Decrypt, and Sign requests for the CryptoKey associated with this policy will fail.", + "items": { + "enum": [ + "REASON_UNSPECIFIED", + "CUSTOMER_INITIATED_SUPPORT", + "GOOGLE_INITIATED_SERVICE", + "THIRD_PARTY_DATA_REQUEST", + "GOOGLE_INITIATED_REVIEW", + "CUSTOMER_INITIATED_ACCESS", + "GOOGLE_INITIATED_SYSTEM_OPERATION", + "REASON_NOT_EXPECTED", + "MODIFIED_CUSTOMER_INITIATED_ACCESS", + "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION", + "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT", + "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING" + ], + "enumDescriptions": [ + "Unspecified access reason.", + "Customer-initiated support.", + "Google-initiated access for system management and troubleshooting.", + "Google-initiated access in response to a legal request or legal process.", + "Google-initiated access for security, fraud, abuse, or compliance purposes.", + "Customer uses their account to perform any access to their own data which their IAM policy authorizes.", + "Google systems access customer data to help optimize the structure of the data or quality for future uses by the customer.", + "No reason is expected for this key request.", + "Customer uses their account to perform any access to their own data which their IAM policy authorizes, and one of the following is true: * A Google administrator has reset the root-access account associated with the user's organization within the past 7 days. * A Google-initiated emergency access operation has interacted with a resource in the same project or folder as the currently accessed resource within the past 7 days.", + "Google systems access customer data to help optimize the structure of the data or quality for future uses by the customer, and one of the following is true: * A Google administrator has reset the root-access account associated with the user's organization within the past 7 days. * A Google-initiated emergency access operation has interacted with a resource in the same project or folder as the currently accessed resource within the past 7 days.", + "Google-initiated access to maintain system reliability.", + "One of the following operations is being executed while simultaneously encountering an internal technical issue which prevented a more precise justification code from being generated: * Your account has been used to perform any access to your own data which your IAM policy authorizes. * An automated Google system operates on encrypted customer data which your IAM policy authorizes. * Customer-initiated Google support access. * Google-initiated support access to protect system reliability." + ], + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "KeyHandle": { "description": "Resource-oriented representation of a request to Cloud KMS Autokey and the resulting provisioning of a CryptoKey.", "id": "KeyHandle", diff --git a/cloudkms/v1/cloudkms-gen.go b/cloudkms/v1/cloudkms-gen.go index a6fcb994898..1461692b8d0 100644 --- a/cloudkms/v1/cloudkms-gen.go +++ b/cloudkms/v1/cloudkms-gen.go @@ -820,6 +820,15 @@ type CryptoKey struct { DestroyScheduledDuration string `json:"destroyScheduledDuration,omitempty"` // ImportOnly: Immutable. Whether this key may contain imported versions only. ImportOnly bool `json:"importOnly,omitempty"` + // KeyAccessJustificationsPolicy: Optional. The policy used for Key Access + // Justifications Policy Enforcement. If this field is present and this key is + // enrolled in Key Access Justifications Policy Enforcement, the policy will be + // evaluated in Encrypt, Decrypt, and Sign operations, and the operation will + // fail if rejected by the policy. The policy is defined by specifying zero or + // more allowed justification codes. + // https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes + // By default, this field is absent, and all justification codes are allowed. + KeyAccessJustificationsPolicy *KeyAccessJustificationsPolicy `json:"keyAccessJustificationsPolicy,omitempty"` // Labels: Labels with user-defined metadata. For more information, see // Labeling Keys (https://cloud.google.com/kms/docs/labeling-keys). Labels map[string]string `json:"labels,omitempty"` @@ -1922,6 +1931,72 @@ func (s *ImportJob) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// KeyAccessJustificationsPolicy: A KeyAccessJustificationsPolicy specifies +// zero or more allowed AccessReason values for Encrypt, Decrypt, and Sign +// requests on a CryptoKey. +type KeyAccessJustificationsPolicy struct { + // AllowedAccessReasons: The list of allowed reasons for access to a CryptoKey. + // Zero allowed access reasons means all Encrypt, Decrypt, and Sign requests + // for the CryptoKey associated with this policy will fail. + // + // Possible values: + // "REASON_UNSPECIFIED" - Unspecified access reason. + // "CUSTOMER_INITIATED_SUPPORT" - Customer-initiated support. + // "GOOGLE_INITIATED_SERVICE" - Google-initiated access for system management + // and troubleshooting. + // "THIRD_PARTY_DATA_REQUEST" - Google-initiated access in response to a + // legal request or legal process. + // "GOOGLE_INITIATED_REVIEW" - Google-initiated access for security, fraud, + // abuse, or compliance purposes. + // "CUSTOMER_INITIATED_ACCESS" - Customer uses their account to perform any + // access to their own data which their IAM policy authorizes. + // "GOOGLE_INITIATED_SYSTEM_OPERATION" - Google systems access customer data + // to help optimize the structure of the data or quality for future uses by the + // customer. + // "REASON_NOT_EXPECTED" - No reason is expected for this key request. + // "MODIFIED_CUSTOMER_INITIATED_ACCESS" - Customer uses their account to + // perform any access to their own data which their IAM policy authorizes, and + // one of the following is true: * A Google administrator has reset the + // root-access account associated with the user's organization within the past + // 7 days. * A Google-initiated emergency access operation has interacted with + // a resource in the same project or folder as the currently accessed resource + // within the past 7 days. + // "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION" - Google systems access + // customer data to help optimize the structure of the data or quality for + // future uses by the customer, and one of the following is true: * A Google + // administrator has reset the root-access account associated with the user's + // organization within the past 7 days. * A Google-initiated emergency access + // operation has interacted with a resource in the same project or folder as + // the currently accessed resource within the past 7 days. + // "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT" - Google-initiated access to + // maintain system reliability. + // "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING" - One of the following operations + // is being executed while simultaneously encountering an internal technical + // issue which prevented a more precise justification code from being + // generated: * Your account has been used to perform any access to your own + // data which your IAM policy authorizes. * An automated Google system operates + // on encrypted customer data which your IAM policy authorizes. * + // Customer-initiated Google support access. * Google-initiated support access + // to protect system reliability. + AllowedAccessReasons []string `json:"allowedAccessReasons,omitempty"` + // ForceSendFields is a list of field names (e.g. "AllowedAccessReasons") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AllowedAccessReasons") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *KeyAccessJustificationsPolicy) MarshalJSON() ([]byte, error) { + type NoMethod KeyAccessJustificationsPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // KeyHandle: Resource-oriented representation of a request to Cloud KMS // Autokey and the resulting provisioning of a CryptoKey. type KeyHandle struct { diff --git a/compute/v0.beta/compute-api.json b/compute/v0.beta/compute-api.json index fc48228646b..ebebb370b97 100644 --- a/compute/v0.beta/compute-api.json +++ b/compute/v0.beta/compute-api.json @@ -41579,7 +41579,7 @@ } } }, - "revision": "20240526", + "revision": "20240604", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AWSV4Signature": { @@ -42812,6 +42812,22 @@ "description": "Whether to enable UEFI networking for instance creation.", "type": "boolean" }, + "performanceMonitoringUnit": { + "description": "Type of Performance Monitoring Unit requested on instance.", + "enum": [ + "ARCHITECTURAL", + "ENHANCED", + "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED", + "STANDARD" + ], + "enumDescriptions": [ + "Architecturally defined non-LLC events.", + "Most documented core/L2 and LLC events.", + "", + "Most documented core/L2 events." + ], + "type": "string" + }, "threadsPerCore": { "description": "The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed.", "format": "int32", @@ -90871,7 +90887,7 @@ "description": "Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true." }, "weight": { - "description": "Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. The value must be from 0 to 1000.", + "description": "Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. The value must be from 0 to 1000.", "format": "uint32", "type": "integer" } diff --git a/compute/v0.beta/compute-gen.go b/compute/v0.beta/compute-gen.go index 75769462506..9a3a8df9dc7 100644 --- a/compute/v0.beta/compute-gen.go +++ b/compute/v0.beta/compute-gen.go @@ -2681,6 +2681,15 @@ type AdvancedMachineFeatures struct { // EnableUefiNetworking: Whether to enable UEFI networking for instance // creation. EnableUefiNetworking bool `json:"enableUefiNetworking,omitempty"` + // PerformanceMonitoringUnit: Type of Performance Monitoring Unit requested on + // instance. + // + // Possible values: + // "ARCHITECTURAL" - Architecturally defined non-LLC events. + // "ENHANCED" - Most documented core/L2 and LLC events. + // "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED" + // "STANDARD" - Most documented core/L2 events. + PerformanceMonitoringUnit string `json:"performanceMonitoringUnit,omitempty"` // ThreadsPerCore: The number of threads per physical core. To disable // simultaneous multithreading (SMT) set this to 1. If unset, the maximum // number of threads supported per core by the underlying processor is assumed. @@ -56542,8 +56551,10 @@ type WeightedBackendService struct { // routeAction) . The selection of a backend service is determined only for new // traffic. Once a user's request has been directed to a backend service, // subsequent requests are sent to the same backend service as determined by - // the backend service's session affinity policy. The value must be from 0 to - // 1000. + // the backend service's session affinity policy. Don't configure session + // affinity if you're using weighted traffic splitting. If you do, the weighted + // traffic splitting configuration takes precedence. The value must be from 0 + // to 1000. Weight int64 `json:"weight,omitempty"` // ForceSendFields is a list of field names (e.g. "BackendService") to // unconditionally include in API requests. By default, fields with empty or diff --git a/connectors/v1/connectors-api.json b/connectors/v1/connectors-api.json index 127d3843dad..81f9a6c9132 100644 --- a/connectors/v1/connectors-api.json +++ b/connectors/v1/connectors-api.json @@ -2427,7 +2427,7 @@ } } }, - "revision": "20240606", + "revision": "20240612", "rootUrl": "https://connectors.googleapis.com/", "schemas": { "AuditConfig": { @@ -3114,6 +3114,23 @@ "readOnly": true, "type": "string" }, + "connectorType": { + "description": "Output only. The type of the connector.", + "enum": [ + "CONNECTOR_TYPE_UNSPECIFIED", + "CONNECTOR_TYPE_GOOGLE", + "CONNECTOR_TYPE_TECHNICAL", + "CONNECTOR_TYPE_THIRD_PARTY" + ], + "enumDescriptions": [ + "Default value.", + "Google connectors.", + "Technical connectors.", + "Third Party connectors." + ], + "readOnly": true, + "type": "string" + }, "createTime": { "description": "Output only. Created time.", "format": "google-datetime", diff --git a/connectors/v1/connectors-gen.go b/connectors/v1/connectors-gen.go index de232571579..079361cc826 100644 --- a/connectors/v1/connectors-gen.go +++ b/connectors/v1/connectors-gen.go @@ -1041,6 +1041,14 @@ func (s *ConnectionStatus) MarshalJSON() ([]byte, error) { type Connector struct { // Category: Output only. Category of the connector. Category string `json:"category,omitempty"` + // ConnectorType: Output only. The type of the connector. + // + // Possible values: + // "CONNECTOR_TYPE_UNSPECIFIED" - Default value. + // "CONNECTOR_TYPE_GOOGLE" - Google connectors. + // "CONNECTOR_TYPE_TECHNICAL" - Technical connectors. + // "CONNECTOR_TYPE_THIRD_PARTY" - Third Party connectors. + ConnectorType string `json:"connectorType,omitempty"` // CreateTime: Output only. Created time. CreateTime string `json:"createTime,omitempty"` // Description: Output only. Description of the resource. diff --git a/connectors/v2/connectors-api.json b/connectors/v2/connectors-api.json index abfc5629dd9..a130456565d 100644 --- a/connectors/v2/connectors-api.json +++ b/connectors/v2/connectors-api.json @@ -650,45 +650,6 @@ ] } } - }, - "entitieswithacls": { - "methods": { - "list": { - "description": "Lists entity rows with ACLs of a particular entity type contained in the request. Note: 1. Currently, only max of one 'sort_by' column is supported. 2. If no 'sort_by' column is provided, the primary key of the table is used. If zero or more than one primary key is available, we default to the unpaginated list entities logic which only returns the first page. 3. The values of the 'sort_by' columns must uniquely identify an entity row, otherwise undefined behaviors may be observed during pagination. 4. Since transactions are not supported, any updates, inserts or deletes during pagination can lead to stale data being returned or other unexpected behaviors.", - "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/connections/{connectionsId}/entityTypes/{entityTypesId}/entitieswithacls", - "httpMethod": "GET", - "id": "connectors.projects.locations.connections.entityTypes.entitieswithacls.list", - "parameterOrder": [ - "parent" - ], - "parameters": { - "conditions": { - "description": "Conditions to be used when listing entities. From a proto standpoint, There are no restrictions on what can be passed using this field. The connector documentation should have information about what format of filters/conditions are supported.", - "location": "query", - "type": "string" - }, - "gsutilUri": { - "description": "Format: gs://object_path", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/connections/[^/]+/entityTypes/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v2/{+parent}/entitieswithacls", - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } } } } @@ -699,7 +660,7 @@ } } }, - "revision": "20240606", + "revision": "20240612", "rootUrl": "https://connectors.googleapis.com/", "schemas": { "AccessCredentials": { @@ -1918,41 +1879,6 @@ }, "type": "object" }, - "Operation": { - "description": "This resource represents a long-running operation that is the result of a network API call.", - "id": "Operation", - "properties": { - "done": { - "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", - "type": "boolean" - }, - "error": { - "$ref": "Status", - "description": "The error result of the operation in case of failure or cancellation." - }, - "metadata": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", - "type": "object" - }, - "name": { - "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", - "type": "string" - }, - "response": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", - "type": "object" - } - }, - "type": "object" - }, "PerSliSloEligibility": { "description": "PerSliSloEligibility is a mapping from an SLI name to eligibility.", "id": "PerSliSloEligibility", @@ -2435,33 +2361,6 @@ }, "type": "object" }, - "Status": { - "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", - "id": "Status", - "properties": { - "code": { - "description": "The status code, which should be an enum value of google.rpc.Code.", - "format": "int32", - "type": "integer" - }, - "details": { - "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", - "items": { - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", - "type": "string" - } - }, - "type": "object" - }, "TimeOfDay": { "description": "Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.", "id": "TimeOfDay", diff --git a/connectors/v2/connectors-gen.go b/connectors/v2/connectors-gen.go index 8ca2eea8fd8..e8db63cc214 100644 --- a/connectors/v2/connectors-gen.go +++ b/connectors/v2/connectors-gen.go @@ -205,7 +205,6 @@ type ProjectsLocationsConnectionsActionsService struct { func NewProjectsLocationsConnectionsEntityTypesService(s *Service) *ProjectsLocationsConnectionsEntityTypesService { rs := &ProjectsLocationsConnectionsEntityTypesService{s: s} rs.Entities = NewProjectsLocationsConnectionsEntityTypesEntitiesService(s) - rs.Entitieswithacls = NewProjectsLocationsConnectionsEntityTypesEntitieswithaclsService(s) return rs } @@ -213,8 +212,6 @@ type ProjectsLocationsConnectionsEntityTypesService struct { s *Service Entities *ProjectsLocationsConnectionsEntityTypesEntitiesService - - Entitieswithacls *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsService } func NewProjectsLocationsConnectionsEntityTypesEntitiesService(s *Service) *ProjectsLocationsConnectionsEntityTypesEntitiesService { @@ -226,15 +223,6 @@ type ProjectsLocationsConnectionsEntityTypesEntitiesService struct { s *Service } -func NewProjectsLocationsConnectionsEntityTypesEntitieswithaclsService(s *Service) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsService { - rs := &ProjectsLocationsConnectionsEntityTypesEntitieswithaclsService{s: s} - return rs -} - -type ProjectsLocationsConnectionsEntityTypesEntitieswithaclsService struct { - s *Service -} - // AccessCredentials: AccessCredentials includes the OAuth access token, and // the other fields returned along with it. type AccessCredentials struct { @@ -1357,53 +1345,6 @@ func (s *NotificationParameter) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// Operation: This resource represents a long-running operation that is the -// result of a network API call. -type Operation struct { - // Done: If the value is `false`, it means the operation is still in progress. - // If `true`, the operation is completed, and either `error` or `response` is - // available. - Done bool `json:"done,omitempty"` - // Error: The error result of the operation in case of failure or cancellation. - Error *Status `json:"error,omitempty"` - // Metadata: Service-specific metadata associated with the operation. It - // typically contains progress information and common metadata such as create - // time. Some services might not provide such metadata. Any method that returns - // a long-running operation should document the metadata type, if any. - Metadata googleapi.RawMessage `json:"metadata,omitempty"` - // Name: The server-assigned name, which is only unique within the same service - // that originally returns it. If you use the default HTTP mapping, the `name` - // should be a resource name ending with `operations/{unique_id}`. - Name string `json:"name,omitempty"` - // Response: The normal, successful response of the operation. If the original - // method returns no data on success, such as `Delete`, the response is - // `google.protobuf.Empty`. If the original method is standard - // `Get`/`Create`/`Update`, the response should be the resource. For other - // methods, the response should have the type `XxxResponse`, where `Xxx` is the - // original method name. For example, if the original method name is - // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - Response googleapi.RawMessage `json:"response,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the server. - googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Done") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Done") to include in API requests - // with the JSON null value. By default, fields with empty values are omitted - // from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *Operation) MarshalJSON() ([]byte, error) { - type NoMethod Operation - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // PerSliSloEligibility: PerSliSloEligibility is a mapping from an SLI name to // eligibility. type PerSliSloEligibility struct { @@ -1796,40 +1737,6 @@ func (s *SloMetadata) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// Status: The `Status` type defines a logical error model that is suitable for -// different programming environments, including REST APIs and RPC APIs. It is -// used by gRPC (https://github.com/grpc). Each `Status` message contains three -// pieces of data: error code, error message, and error details. You can find -// out more about this error model and how to work with it in the API Design -// Guide (https://cloud.google.com/apis/design/errors). -type Status struct { - // Code: The status code, which should be an enum value of google.rpc.Code. - Code int64 `json:"code,omitempty"` - // Details: A list of messages that carry the error details. There is a common - // set of message types for APIs to use. - Details []googleapi.RawMessage `json:"details,omitempty"` - // Message: A developer-facing error message, which should be in English. Any - // user-facing error message should be localized and sent in the - // google.rpc.Status.details field, or localized by the client. - Message string `json:"message,omitempty"` - // ForceSendFields is a list of field names (e.g. "Code") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Code") to include in API requests - // with the JSON null value. By default, fields with empty values are omitted - // from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *Status) MarshalJSON() ([]byte, error) { - type NoMethod Status - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // TimeOfDay: Represents a time of day. The date and time zone are either not // significant or are specified elsewhere. An API may choose to allow leap // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. @@ -3959,136 +3866,3 @@ func (c *ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithCondit } return ret, nil } - -type ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists entity rows with ACLs of a particular entity type contained in -// the request. Note: 1. Currently, only max of one 'sort_by' column is -// supported. 2. If no 'sort_by' column is provided, the primary key of the -// table is used. If zero or more than one primary key is available, we default -// to the unpaginated list entities logic which only returns the first page. 3. -// The values of the 'sort_by' columns must uniquely identify an entity row, -// otherwise undefined behaviors may be observed during pagination. 4. Since -// transactions are not supported, any updates, inserts or deletes during -// pagination can lead to stale data being returned or other unexpected -// behaviors. -// -// - parent: Resource name of the Entity Type. Format: -// projects/{project}/locations/{location}/connections/{connection}/entityType -// s/{type}. -func (r *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsService) List(parent string) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall { - c := &ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Conditions sets the optional parameter "conditions": Conditions to be used -// when listing entities. From a proto standpoint, There are no restrictions on -// what can be passed using this field. The connector documentation should have -// information about what format of filters/conditions are supported. -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) Conditions(conditions string) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall { - c.urlParams_.Set("conditions", conditions) - return c -} - -// GsutilUri sets the optional parameter "gsutilUri": Format: gs://object_path -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) GsutilUri(gsutilUri string) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall { - c.urlParams_.Set("gsutilUri", gsutilUri) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) Context(ctx context.Context) *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entitieswithacls") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "connectors.projects.locations.connections.entityTypes.entitieswithacls.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsLocationsConnectionsEntityTypesEntitieswithaclsListCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} diff --git a/dataform/v1beta1/dataform-api.json b/dataform/v1beta1/dataform-api.json index 13d80998c09..7668fc96c4c 100644 --- a/dataform/v1beta1/dataform-api.json +++ b/dataform/v1beta1/dataform-api.json @@ -782,6 +782,71 @@ "https://www.googleapis.com/auth/cloud-platform" ] } + }, + "resources": { + "comments": { + "methods": { + "getIamPolicy": { + "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/commentThreads/{commentThreadsId}/comments/{commentsId}:getIamPolicy", + "httpMethod": "GET", + "id": "dataform.projects.locations.repositories.commentThreads.comments.getIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "options.requestedPolicyVersion": { + "description": "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", + "format": "int32", + "location": "query", + "type": "integer" + }, + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/commentThreads/[^/]+/comments/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:getIamPolicy", + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/commentThreads/{commentThreadsId}/comments/{commentsId}:setIamPolicy", + "httpMethod": "POST", + "id": "dataform.projects.locations.repositories.commentThreads.comments.setIamPolicy", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/commentThreads/[^/]+/comments/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } } }, "compilationResults": { @@ -2171,7 +2236,7 @@ } } }, - "revision": "20240504", + "revision": "20240608", "rootUrl": "https://dataform.googleapis.com/", "schemas": { "Assertion": { diff --git a/dataform/v1beta1/dataform-gen.go b/dataform/v1beta1/dataform-gen.go index 16a3d98df4a..dbd72c5d793 100644 --- a/dataform/v1beta1/dataform-gen.go +++ b/dataform/v1beta1/dataform-gen.go @@ -219,11 +219,23 @@ type ProjectsLocationsRepositoriesService struct { func NewProjectsLocationsRepositoriesCommentThreadsService(s *Service) *ProjectsLocationsRepositoriesCommentThreadsService { rs := &ProjectsLocationsRepositoriesCommentThreadsService{s: s} + rs.Comments = NewProjectsLocationsRepositoriesCommentThreadsCommentsService(s) return rs } type ProjectsLocationsRepositoriesCommentThreadsService struct { s *Service + + Comments *ProjectsLocationsRepositoriesCommentThreadsCommentsService +} + +func NewProjectsLocationsRepositoriesCommentThreadsCommentsService(s *Service) *ProjectsLocationsRepositoriesCommentThreadsCommentsService { + rs := &ProjectsLocationsRepositoriesCommentThreadsCommentsService{s: s} + return rs +} + +type ProjectsLocationsRepositoriesCommentThreadsCommentsService struct { + s *Service } func NewProjectsLocationsRepositoriesCompilationResultsService(s *Service) *ProjectsLocationsRepositoriesCompilationResultsService { @@ -5498,6 +5510,238 @@ func (c *ProjectsLocationsRepositoriesCommentThreadsSetIamPolicyCall) Do(opts .. return ret, nil } +type ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall struct { + s *Service + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the access control policy for a resource. Returns an +// empty policy if the resource exists and does not have a policy set. +// +// - resource: REQUIRED: The resource for which the policy is being requested. +// See Resource names (https://cloud.google.com/apis/design/resource_names) +// for the appropriate value for this field. +func (r *ProjectsLocationsRepositoriesCommentThreadsCommentsService) GetIamPolicy(resource string) *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall { + c := &ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "options.requestedPolicyVersion": The maximum policy version that will be +// used to format the policy. Valid values are 0, 1, and 3. Requests specifying +// an invalid value will be rejected. Requests for policies with any +// conditional role bindings must specify version 3. Policies with no +// conditional role bindings may specify any valid value or leave the field +// unset. The policy in the response might use the policy version that you +// specified, or it might use a lower policy version. For example, if you +// specify version 3, but the policy has no conditional role bindings, the +// response uses version 1. To learn which resources support conditions in +// their IAM policies, see the IAM documentation +// (https://cloud.google.com/iam/help/conditions/resource-policies). +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall { + c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "dataform.projects.locations.repositories.commentThreads.comments.getIamPolicy" call. +// Any non-2xx status code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, +// and `PERMISSION_DENIED` errors. +// +// - resource: REQUIRED: The resource for which the policy is being specified. +// See Resource names (https://cloud.google.com/apis/design/resource_names) +// for the appropriate value for this field. +func (r *ProjectsLocationsRepositoriesCommentThreadsCommentsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall { + c := &ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "dataform.projects.locations.repositories.commentThreads.comments.setIamPolicy" call. +// Any non-2xx status code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsLocationsRepositoriesCommentThreadsCommentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsRepositoriesCompilationResultsCreateCall struct { s *Service parent string diff --git a/datamigration/v1/datamigration-api.json b/datamigration/v1/datamigration-api.json index 802ffe2a6b0..e4394c42877 100644 --- a/datamigration/v1/datamigration-api.json +++ b/datamigration/v1/datamigration-api.json @@ -2125,7 +2125,7 @@ } } }, - "revision": "20240522", + "revision": "20240609", "rootUrl": "https://datamigration.googleapis.com/", "schemas": { "AlloyDbConnectionProfile": { @@ -4479,7 +4479,8 @@ "PROMOTE_IN_PROGRESS", "WAITING_FOR_SOURCE_WRITES_TO_STOP", "PREPARING_THE_DUMP", - "READY_FOR_PROMOTE" + "READY_FOR_PROMOTE", + "DIFF_BACKUP" ], "enumDescriptions": [ "The phase of the migration job is unknown.", @@ -4488,7 +4489,8 @@ "The migration job is running the promote phase.", "Only RDS flow - waiting for source writes to stop", "Only RDS flow - the sources writes stopped, waiting for dump to begin", - "The migration job is ready to be promoted." + "The migration job is ready to be promoted.", + "The migration job is in the differential backup phase." ], "readOnly": true, "type": "string" diff --git a/datamigration/v1/datamigration-gen.go b/datamigration/v1/datamigration-gen.go index 54dd2987c89..52155d73c89 100644 --- a/datamigration/v1/datamigration-gen.go +++ b/datamigration/v1/datamigration-gen.go @@ -2813,6 +2813,7 @@ type MigrationJob struct { // "PREPARING_THE_DUMP" - Only RDS flow - the sources writes stopped, waiting // for dump to begin // "READY_FOR_PROMOTE" - The migration job is ready to be promoted. + // "DIFF_BACKUP" - The migration job is in the differential backup phase. Phase string `json:"phase,omitempty"` // ReverseSshConnectivity: The details needed to communicate to the source over // Reverse SSH tunnel connectivity. diff --git a/dataplex/v1/dataplex-api.json b/dataplex/v1/dataplex-api.json index f0722b3dfd0..b5d600fcee0 100644 --- a/dataplex/v1/dataplex-api.json +++ b/dataplex/v1/dataplex-api.json @@ -5271,7 +5271,7 @@ } } }, - "revision": "20240529", + "revision": "20240611", "rootUrl": "https://dataplex.googleapis.com/", "schemas": { "Empty": { @@ -7687,6 +7687,11 @@ "description": "Status of the data scan execution.", "id": "GoogleCloudDataplexV1DataScanExecutionStatus", "properties": { + "latestJobCreateTime": { + "description": "Optional. The time when the DataScanJob execution was created.", + "format": "google-datetime", + "type": "string" + }, "latestJobEndTime": { "description": "The time when the latest DataScanJob ended.", "format": "google-datetime", diff --git a/dataplex/v1/dataplex-gen.go b/dataplex/v1/dataplex-gen.go index 5b6b4a2bb65..3f3ad1346cb 100644 --- a/dataplex/v1/dataplex-gen.go +++ b/dataplex/v1/dataplex-gen.go @@ -3531,19 +3531,22 @@ func (s *GoogleCloudDataplexV1DataScanExecutionSpec) MarshalJSON() ([]byte, erro // GoogleCloudDataplexV1DataScanExecutionStatus: Status of the data scan // execution. type GoogleCloudDataplexV1DataScanExecutionStatus struct { + // LatestJobCreateTime: Optional. The time when the DataScanJob execution was + // created. + LatestJobCreateTime string `json:"latestJobCreateTime,omitempty"` // LatestJobEndTime: The time when the latest DataScanJob ended. LatestJobEndTime string `json:"latestJobEndTime,omitempty"` // LatestJobStartTime: The time when the latest DataScanJob started. LatestJobStartTime string `json:"latestJobStartTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "LatestJobEndTime") to + // ForceSendFields is a list of field names (e.g. "LatestJobCreateTime") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "LatestJobEndTime") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See + // NullFields is a list of field names (e.g. "LatestJobCreateTime") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } diff --git a/dfareporting/v3.5/dfareporting-api.json b/dfareporting/v3.5/dfareporting-api.json index 3c131737fe0..846c2a97896 100644 --- a/dfareporting/v3.5/dfareporting-api.json +++ b/dfareporting/v3.5/dfareporting-api.json @@ -161,7 +161,7 @@ } } }, - "revision": "20230523", + "revision": "20240613", "rootUrl": "https://dfareporting.googleapis.com/", "schemas": { "ClickTag": { @@ -752,7 +752,8 @@ "BE0", "LLQ", "LLQ1", - "LLQ2" + "LLQ2", + "LLQ3" ], "enumDescriptions": [ "Application-selectable traffic classes Best effort", @@ -764,8 +765,9 @@ "Network control", "Best effort at high packet loss", "Low-latency queue (LLQ) best effort (go/llq)", - "LLQ best effort (go/llq2)", - "LLQ assured forwarding priority 2 (go/llq2)" + "LLQ assured forwarding priority 1 (go/llq2)", + "LLQ assured forwarding priority 2 (go/llq2)", + "LLQ assured forwarding priority 3 (go/llq3)" ], "type": "string" }, diff --git a/dfareporting/v3.5/dfareporting-gen.go b/dfareporting/v3.5/dfareporting-gen.go index dae9d7cdc40..e670662b713 100644 --- a/dfareporting/v3.5/dfareporting-gen.go +++ b/dfareporting/v3.5/dfareporting-gen.go @@ -679,8 +679,9 @@ type MediaResponseInfo struct { // "NC0" - Network control // "BE0" - Best effort at high packet loss // "LLQ" - Low-latency queue (LLQ) best effort (go/llq) - // "LLQ1" - LLQ best effort (go/llq2) + // "LLQ1" - LLQ assured forwarding priority 1 (go/llq2) // "LLQ2" - LLQ assured forwarding priority 2 (go/llq2) + // "LLQ3" - LLQ assured forwarding priority 3 (go/llq3) TrafficClassField string `json:"trafficClassField,omitempty"` // VerifyHashFromHeader: Tells Scotty to verify hashes on the agent's behalf by // parsing out the X-Goog-Hash header. diff --git a/dfareporting/v4/dfareporting-api.json b/dfareporting/v4/dfareporting-api.json index 4a8fd187699..690beeaafdc 100644 --- a/dfareporting/v4/dfareporting-api.json +++ b/dfareporting/v4/dfareporting-api.json @@ -441,7 +441,7 @@ ] }, "patch": { - "description": "Updates an existing user role. This method supports patch semantics.", + "description": "Updates an existing account user profile. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/accountUserProfiles", "httpMethod": "PATCH", "id": "dfareporting.accountUserProfiles.patch", @@ -975,7 +975,7 @@ ] }, "patch": { - "description": "Updates an existing event tag. This method supports patch semantics.", + "description": "Updates an existing ad. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/ads", "httpMethod": "PATCH", "id": "dfareporting.ads.patch", @@ -1512,7 +1512,7 @@ ] }, "patch": { - "description": "Updates an existing advertiser. This method supports patch semantics.", + "description": "Updates an existing landing page. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/advertiserLandingPages", "httpMethod": "PATCH", "id": "dfareporting.advertiserLandingPages.patch", @@ -2450,7 +2450,7 @@ ] }, "patch": { - "description": "Updates an existing creative. This method supports patch semantics.", + "description": "Updates an existing campaign. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/campaigns", "httpMethod": "PATCH", "id": "dfareporting.campaigns.patch", @@ -5433,7 +5433,7 @@ ] }, "patch": { - "description": "Updates an existing event tag. This method supports patch semantics.", + "description": "Updates an existing floodlight activity. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/floodlightActivities", "httpMethod": "PATCH", "id": "dfareporting.floodlightActivities.patch", @@ -5670,7 +5670,7 @@ ] }, "patch": { - "description": "Updates an existing event tag. This method supports patch semantics.", + "description": "Updates an existing floodlight activity group. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/floodlightActivityGroups", "httpMethod": "PATCH", "id": "dfareporting.floodlightActivityGroups.patch", @@ -5808,7 +5808,7 @@ ] }, "patch": { - "description": "Updates an existing event tag. This method supports patch semantics.", + "description": "Updates an existing floodlight configuration. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/floodlightConfigurations", "httpMethod": "PATCH", "id": "dfareporting.floodlightConfigurations.patch", @@ -7897,7 +7897,7 @@ ] }, "patch": { - "description": "Updates an existing RemarketingListShare. This method supports patch semantics.", + "description": "Updates an existing remarketing list share. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/remarketingListShares", "httpMethod": "PATCH", "id": "dfareporting.remarketingListShares.patch", @@ -8121,7 +8121,7 @@ ] }, "patch": { - "description": "Updates an existing RemarketingList. This method supports patch semantics.", + "description": "Updates an existing remarketing list. This method supports patch semantics.", "flatPath": "userprofiles/{userprofilesId}/remarketingLists", "httpMethod": "PATCH", "id": "dfareporting.remarketingLists.patch", @@ -10067,7 +10067,7 @@ } } }, - "revision": "20240201", + "revision": "20240613", "rootUrl": "https://dfareporting.googleapis.com/", "schemas": { "Account": { @@ -10379,7 +10379,7 @@ "type": "string" }, "email": { - "description": "Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion.", + "description": "Email of the user profile. The email address must be linked to a Google Account. This field is required on insertion and is read-only after insertion.", "type": "string" }, "id": { @@ -11754,54 +11754,6 @@ }, "type": "object" }, - "ChannelGrouping": { - "description": "Represents a DfaReporting channel grouping.", - "id": "ChannelGrouping", - "properties": { - "fallbackName": { - "description": "ChannelGrouping fallback name.", - "type": "string" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#channelGrouping.", - "type": "string" - }, - "name": { - "description": "ChannelGrouping name.", - "type": "string" - }, - "rules": { - "description": "The rules contained within this channel grouping.", - "items": { - "$ref": "ChannelGroupingRule" - }, - "type": "array" - } - }, - "type": "object" - }, - "ChannelGroupingRule": { - "description": "Represents a DfaReporting channel grouping rule.", - "id": "ChannelGroupingRule", - "properties": { - "disjunctiveMatchStatements": { - "description": "The disjunctive match statements contained within this rule.", - "items": { - "$ref": "DisjunctiveMatchStatement" - }, - "type": "array" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#channelGroupingRule.", - "type": "string" - }, - "name": { - "description": "Rule name.", - "type": "string" - } - }, - "type": "object" - }, "CitiesListResponse": { "description": "City List Response", "id": "CitiesListResponse", @@ -11983,14 +11935,6 @@ "description": "The kind of resource this is, in this case dfareporting#compatibleFields.", "type": "string" }, - "pathAttributionReportCompatibleFields": { - "$ref": "PathReportCompatibleFields", - "description": "Contains items that are compatible to be selected for a report of type \"PATH_ATTRIBUTION\"." - }, - "pathReportCompatibleFields": { - "$ref": "PathReportCompatibleFields", - "description": "Contains items that are compatible to be selected for a report of type \"PATH\"." - }, "pathToConversionReportCompatibleFields": { "$ref": "PathToConversionReportCompatibleFields", "description": "Contains items that are compatible to be selected for a report of type \"PATH_TO_CONVERSION\"." @@ -13722,12 +13666,12 @@ "Click tag invalid (failed url validation).", "Orphaned asset not referenced.", "Primary html file missing.", - "Reference to a third-party resource. Problematic because the volume of ad serving could bring down unprepared web servers due to high load. e.g. http://www.zibble.net/smiles.gif", + "Reference to a third-party resource.", "Reference to INAPP MRAID feature.", "Reference to INAPP ADMOB feature.", "Invalid file type referenced.", - "Invalid zip passed in (could not extract from zip", - "A relative file was linked to that wasn't included in zip. e.g. images/missing_file.gif", + "Invalid zip passed in", + "A relative file was linked to that wasn't included in zip.", "Max flash version at 11.", "Whether the asset uses secure urls or not.", "File detail empty.", @@ -15076,24 +15020,6 @@ }, "type": "object" }, - "DisjunctiveMatchStatement": { - "description": "Represents a Disjunctive Match Statement resource, which is a conjunction (and) of disjunctive (or) boolean statements.", - "id": "DisjunctiveMatchStatement", - "properties": { - "eventFilters": { - "description": "The event filters contained within this disjunctive match statement.", - "items": { - "$ref": "EventFilter" - }, - "type": "array" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#disjunctiveMatchStatement.", - "type": "string" - } - }, - "type": "object" - }, "DynamicTargetingKey": { "description": "Contains properties of a dynamic targeting key. Dynamic targeting keys are unique, user-friendly labels, created at the advertiser level in DCM, that can be assigned to ads, creatives, and placements and used for targeting with Studio dynamic creatives. Use these labels instead of numeric Campaign Manager IDs (such as placement IDs) to save time and avoid errors in your dynamic feeds.", "id": "DynamicTargetingKey", @@ -15200,25 +15126,6 @@ }, "type": "object" }, - "EventFilter": { - "description": "Represents a DfaReporting event filter.", - "id": "EventFilter", - "properties": { - "dimensionFilter": { - "$ref": "PathReportDimensionValue", - "description": "The dimension filter contained within this EventFilter." - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#eventFilter.", - "type": "string" - }, - "uvarFilter": { - "$ref": "UvarFilter", - "description": "Filter on a custom variable." - } - }, - "type": "object" - }, "EventTag": { "description": "Contains properties of an event tag.", "id": "EventTag", @@ -15506,11 +15413,11 @@ "id": "FloodlightActivitiesGenerateTagResponse", "properties": { "floodlightActivityTag": { - "description": "Generated tag for this Floodlight activity. For global site tags, this is the event snippet.", + "description": "Generated tag for this Floodlight activity. For Google tags, this is the event snippet.", "type": "string" }, "globalSiteTagGlobalSnippet": { - "description": "The global snippet section of a global site tag. The global site tag sets new cookies on your domain, which will store a unique identifier for a user or the ad click that brought the user to your site. Learn more.", + "description": "The global snippet section of a Google tag. The Google tag sets new cookies on your domain, which will store a unique identifier for a user or the ad click that brought the user to your site. Learn more.", "type": "string" }, "kind": { @@ -16847,7 +16754,8 @@ "MEASUREMENT_PARTNER_LINK_OPT_OUT", "MEASUREMENT_PARTNER_LINK_OPT_OUT_PENDING", "MEASUREMENT_PARTNER_LINK_WRAPPING_PENDING", - "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING" + "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING", + "MEASUREMENT_PARTNER_UNLINK_PENDING" ], "enumDescriptions": [ "Unlinked.", @@ -16857,7 +16765,8 @@ "Link opt-out by user.", "Link opt-out pending sync.", "Link wrap answer pending.", - "Mode change pending." + "Mode change pending.", + "Partner unlink pending." ], "type": "string" }, @@ -16895,7 +16804,8 @@ "MEASUREMENT_PARTNER_LINK_OPT_OUT", "MEASUREMENT_PARTNER_LINK_OPT_OUT_PENDING", "MEASUREMENT_PARTNER_LINK_WRAPPING_PENDING", - "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING" + "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING", + "MEASUREMENT_PARTNER_UNLINK_PENDING" ], "enumDescriptions": [ "Unlinked.", @@ -16905,7 +16815,8 @@ "Link opt-out by user.", "Link opt-out pending sync.", "Link wrap answer pending.", - "Mode change pending." + "Mode change pending.", + "Partner unlink pending." ], "type": "string" }, @@ -16944,7 +16855,8 @@ "MEASUREMENT_PARTNER_LINK_OPT_OUT", "MEASUREMENT_PARTNER_LINK_OPT_OUT_PENDING", "MEASUREMENT_PARTNER_LINK_WRAPPING_PENDING", - "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING" + "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING", + "MEASUREMENT_PARTNER_UNLINK_PENDING" ], "enumDescriptions": [ "Unlinked.", @@ -16954,7 +16866,8 @@ "Link opt-out by user.", "Link opt-out pending sync.", "Link wrap answer pending.", - "Mode change pending." + "Mode change pending.", + "Partner unlink pending." ], "type": "string" }, @@ -17631,124 +17544,6 @@ }, "type": "object" }, - "PathFilter": { - "description": "Represents a DfaReporting path filter.", - "id": "PathFilter", - "properties": { - "eventFilters": { - "description": "Event filters in path report.", - "items": { - "$ref": "EventFilter" - }, - "type": "array" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#pathFilter.", - "type": "string" - }, - "pathMatchPosition": { - "description": "Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.", - "enum": [ - "PATH_MATCH_POSITION_UNSPECIFIED", - "ANY", - "FIRST", - "LAST" - ], - "enumDescriptions": [ - "", - "", - "", - "" - ], - "type": "string" - } - }, - "type": "object" - }, - "PathReportCompatibleFields": { - "description": "Represents fields that are compatible to be selected for a report of type \"PATH\".", - "id": "PathReportCompatibleFields", - "properties": { - "channelGroupings": { - "description": "Dimensions which are compatible to be selected in the \"channelGroupings\" section of the report.", - "items": { - "$ref": "Dimension" - }, - "type": "array" - }, - "dimensions": { - "description": "Dimensions which are compatible to be selected in the \"dimensions\" section of the report.", - "items": { - "$ref": "Dimension" - }, - "type": "array" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#pathReportCompatibleFields.", - "type": "string" - }, - "metrics": { - "description": "Metrics which are compatible to be selected in the \"metricNames\" section of the report.", - "items": { - "$ref": "Metric" - }, - "type": "array" - }, - "pathFilters": { - "description": "Dimensions which are compatible to be selected in the \"pathFilters\" section of the report.", - "items": { - "$ref": "Dimension" - }, - "type": "array" - } - }, - "type": "object" - }, - "PathReportDimensionValue": { - "description": "Represents a PathReportDimensionValue resource.", - "id": "PathReportDimensionValue", - "properties": { - "dimensionName": { - "description": "The name of the dimension.", - "type": "string" - }, - "ids": { - "description": "The possible ID's associated with the value if available.", - "items": { - "type": "string" - }, - "type": "array" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#pathReportDimensionValue.", - "type": "string" - }, - "matchType": { - "description": "Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.", - "enum": [ - "EXACT", - "BEGINS_WITH", - "CONTAINS", - "WILDCARD_EXPRESSION" - ], - "enumDescriptions": [ - "", - "", - "", - "" - ], - "type": "string" - }, - "values": { - "description": "The possible values of the dimension.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, "PathToConversionReportCompatibleFields": { "description": "Represents fields that are compatible to be selected for a report of type \"PATH_TO_CONVERSION\".", "id": "PathToConversionReportCompatibleFields", @@ -19391,98 +19186,6 @@ "format": "int64", "type": "string" }, - "pathAttributionCriteria": { - "description": "The report criteria for a report of type \"PATH_ATTRIBUTION\".", - "properties": { - "activityFilters": { - "description": "The list of 'dfa:activity' values to filter on.", - "items": { - "$ref": "DimensionValue" - }, - "type": "array" - }, - "customChannelGrouping": { - "$ref": "ChannelGrouping", - "description": "Channel Grouping." - }, - "dateRange": { - "$ref": "DateRange", - "description": "The date range this report should be run for." - }, - "dimensions": { - "description": "The list of dimensions the report should include.", - "items": { - "$ref": "SortedDimension" - }, - "type": "array" - }, - "floodlightConfigId": { - "$ref": "DimensionValue", - "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." - }, - "metricNames": { - "description": "The list of names of metrics the report should include.", - "items": { - "type": "string" - }, - "type": "array" - }, - "pathFilters": { - "description": "Path Filters.", - "items": { - "$ref": "PathFilter" - }, - "type": "array" - } - }, - "type": "object" - }, - "pathCriteria": { - "description": "The report criteria for a report of type \"PATH\".", - "properties": { - "activityFilters": { - "description": "The list of 'dfa:activity' values to filter on.", - "items": { - "$ref": "DimensionValue" - }, - "type": "array" - }, - "customChannelGrouping": { - "$ref": "ChannelGrouping", - "description": "Channel Grouping." - }, - "dateRange": { - "$ref": "DateRange", - "description": "The date range this report should be run for." - }, - "dimensions": { - "description": "The list of dimensions the report should include.", - "items": { - "$ref": "SortedDimension" - }, - "type": "array" - }, - "floodlightConfigId": { - "$ref": "DimensionValue", - "description": "The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the value needs to be 'dfa:floodlightConfigId'." - }, - "metricNames": { - "description": "The list of names of metrics the report should include.", - "items": { - "type": "string" - }, - "type": "array" - }, - "pathFilters": { - "description": "Path Filters.", - "items": { - "$ref": "PathFilter" - }, - "type": "array" - } - }, - "type": "object" - }, "pathToConversionCriteria": { "description": "The report criteria for a report of type \"PATH_TO_CONVERSION\".", "properties": { @@ -19716,17 +19419,13 @@ "REACH", "PATH_TO_CONVERSION", "CROSS_DIMENSION_REACH", - "FLOODLIGHT", - "PATH", - "PATH_ATTRIBUTION" + "FLOODLIGHT" ], "enumDescriptions": [ "", "", "", "", - "", - "", "" ], "type": "string" @@ -21302,47 +21001,6 @@ }, "type": "object" }, - "UvarFilter": { - "description": "Defines the filtering on a single uvar.", - "id": "UvarFilter", - "properties": { - "complement": { - "description": "Return rows which don't match this filter.", - "type": "boolean" - }, - "index": { - "description": "Custom variable index the filter is applied to.", - "format": "int64", - "type": "string" - }, - "kind": { - "description": "The kind of resource this is, in this case dfareporting#uvarFilter.", - "type": "string" - }, - "match": { - "description": "Indicates how the filter should be matched to the values.", - "enum": [ - "UNSPECIFIED", - "EXACT", - "CONTAINS" - ], - "enumDescriptions": [ - "", - "", - "" - ], - "type": "string" - }, - "values": { - "description": "Values to filter on.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, "VideoFormat": { "description": "Contains information about supported video formats.", "id": "VideoFormat", diff --git a/dfareporting/v4/dfareporting-gen.go b/dfareporting/v4/dfareporting-gen.go index 3e4825a15c1..284414fa3a3 100644 --- a/dfareporting/v4/dfareporting-gen.go +++ b/dfareporting/v4/dfareporting-gen.go @@ -1242,7 +1242,7 @@ type AccountUserProfile struct { CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"` // Comments: Comments for this user profile. Comments string `json:"comments,omitempty"` - // Email: Email of the user profile. The email addresss must be linked to a + // Email: Email of the user profile. The email address must be linked to a // Google Account. This field is required on insertion and is read-only after // insertion. Email string `json:"email,omitempty"` @@ -2653,63 +2653,6 @@ func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// ChannelGrouping: Represents a DfaReporting channel grouping. -type ChannelGrouping struct { - // FallbackName: ChannelGrouping fallback name. - FallbackName string `json:"fallbackName,omitempty"` - // Kind: The kind of resource this is, in this case - // dfareporting#channelGrouping. - Kind string `json:"kind,omitempty"` - // Name: ChannelGrouping name. - Name string `json:"name,omitempty"` - // Rules: The rules contained within this channel grouping. - Rules []*ChannelGroupingRule `json:"rules,omitempty"` - // ForceSendFields is a list of field names (e.g. "FallbackName") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "FallbackName") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *ChannelGrouping) MarshalJSON() ([]byte, error) { - type NoMethod ChannelGrouping - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// ChannelGroupingRule: Represents a DfaReporting channel grouping rule. -type ChannelGroupingRule struct { - // DisjunctiveMatchStatements: The disjunctive match statements contained - // within this rule. - DisjunctiveMatchStatements []*DisjunctiveMatchStatement `json:"disjunctiveMatchStatements,omitempty"` - // Kind: The kind of resource this is, in this case - // dfareporting#channelGroupingRule. - Kind string `json:"kind,omitempty"` - // Name: Rule name. - Name string `json:"name,omitempty"` - // ForceSendFields is a list of field names (e.g. "DisjunctiveMatchStatements") - // to unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DisjunctiveMatchStatements") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *ChannelGroupingRule) MarshalJSON() ([]byte, error) { - type NoMethod ChannelGroupingRule - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // CitiesListResponse: City List Response type CitiesListResponse struct { // Cities: City collection. @@ -2938,12 +2881,6 @@ type CompatibleFields struct { // Kind: The kind of resource this is, in this case // dfareporting#compatibleFields. Kind string `json:"kind,omitempty"` - // PathAttributionReportCompatibleFields: Contains items that are compatible to - // be selected for a report of type "PATH_ATTRIBUTION". - PathAttributionReportCompatibleFields *PathReportCompatibleFields `json:"pathAttributionReportCompatibleFields,omitempty"` - // PathReportCompatibleFields: Contains items that are compatible to be - // selected for a report of type "PATH". - PathReportCompatibleFields *PathReportCompatibleFields `json:"pathReportCompatibleFields,omitempty"` // PathToConversionReportCompatibleFields: Contains items that are compatible // to be selected for a report of type "PATH_TO_CONVERSION". PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"` @@ -4490,14 +4427,12 @@ type CreativeAssetMetadata struct { // "ORPHANED_ASSET" - Orphaned asset not referenced. // "PRIMARY_HTML_MISSING" - Primary html file missing. // "EXTERNAL_FILE_REFERENCED" - Reference to a third-party resource. - // Problematic because the volume of ad serving could bring down unprepared web - // servers due to high load. e.g. http://www.zibble.net/smiles.gif // "MRAID_REFERENCED" - Reference to INAPP MRAID feature. // "ADMOB_REFERENCED" - Reference to INAPP ADMOB feature. // "FILE_TYPE_INVALID" - Invalid file type referenced. - // "ZIP_INVALID" - Invalid zip passed in (could not extract from zip + // "ZIP_INVALID" - Invalid zip passed in // "LINKED_FILE_NOT_FOUND" - A relative file was linked to that wasn't - // included in zip. e.g. images/missing_file.gif + // included in zip. // "MAX_FLASH_VERSION_11" - Max flash version at 11. // "NOT_SSL_COMPLIANT" - Whether the asset uses secure urls or not. // "FILE_DETAIL_EMPTY" - File detail empty. @@ -5891,34 +5826,6 @@ func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// DisjunctiveMatchStatement: Represents a Disjunctive Match Statement -// resource, which is a conjunction (and) of disjunctive (or) boolean -// statements. -type DisjunctiveMatchStatement struct { - // EventFilters: The event filters contained within this disjunctive match - // statement. - EventFilters []*EventFilter `json:"eventFilters,omitempty"` - // Kind: The kind of resource this is, in this case - // dfareporting#disjunctiveMatchStatement. - Kind string `json:"kind,omitempty"` - // ForceSendFields is a list of field names (e.g. "EventFilters") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EventFilters") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *DisjunctiveMatchStatement) MarshalJSON() ([]byte, error) { - type NoMethod DisjunctiveMatchStatement - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // DynamicTargetingKey: Contains properties of a dynamic targeting key. Dynamic // targeting keys are unique, user-friendly labels, created at the advertiser // level in DCM, that can be assigned to ads, creatives, and placements and @@ -6040,32 +5947,6 @@ func (s *EncryptionInfo) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// EventFilter: Represents a DfaReporting event filter. -type EventFilter struct { - // DimensionFilter: The dimension filter contained within this EventFilter. - DimensionFilter *PathReportDimensionValue `json:"dimensionFilter,omitempty"` - // Kind: The kind of resource this is, in this case dfareporting#eventFilter. - Kind string `json:"kind,omitempty"` - // UvarFilter: Filter on a custom variable. - UvarFilter *UvarFilter `json:"uvarFilter,omitempty"` - // ForceSendFields is a list of field names (e.g. "DimensionFilter") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DimensionFilter") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *EventFilter) MarshalJSON() ([]byte, error) { - type NoMethod EventFilter - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // EventTag: Contains properties of an event tag. type EventTag struct { // AccountId: Account ID of this event tag. This is a read-only field that can @@ -6366,12 +6247,12 @@ func (s *Flight) MarshalJSON() ([]byte, error) { // Response type FloodlightActivitiesGenerateTagResponse struct { // FloodlightActivityTag: Generated tag for this Floodlight activity. For - // global site tags, this is the event snippet. + // Google tags, this is the event snippet. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"` - // GlobalSiteTagGlobalSnippet: The global snippet section of a global site tag. - // The global site tag sets new cookies on your domain, which will store a - // unique identifier for a user or the ad click that brought the user to your - // site. Learn more. + // GlobalSiteTagGlobalSnippet: The global snippet section of a Google tag. The + // Google tag sets new cookies on your domain, which will store a unique + // identifier for a user or the ad click that brought the user to your site. + // Learn more. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed string // "dfareporting#floodlightActivitiesGenerateTagResponse". @@ -7632,6 +7513,7 @@ type MeasurementPartnerAdvertiserLink struct { // "MEASUREMENT_PARTNER_LINK_OPT_OUT_PENDING" - Link opt-out pending sync. // "MEASUREMENT_PARTNER_LINK_WRAPPING_PENDING" - Link wrap answer pending. // "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING" - Mode change pending. + // "MEASUREMENT_PARTNER_UNLINK_PENDING" - Partner unlink pending. LinkStatus string `json:"linkStatus,omitempty"` // MeasurementPartner: Measurement partner used for tag wrapping. // @@ -7672,6 +7554,7 @@ type MeasurementPartnerCampaignLink struct { // "MEASUREMENT_PARTNER_LINK_OPT_OUT_PENDING" - Link opt-out pending sync. // "MEASUREMENT_PARTNER_LINK_WRAPPING_PENDING" - Link wrap answer pending. // "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING" - Mode change pending. + // "MEASUREMENT_PARTNER_UNLINK_PENDING" - Partner unlink pending. LinkStatus string `json:"linkStatus,omitempty"` // MeasurementPartner: Measurement partner used for tag wrapping. // @@ -7714,6 +7597,7 @@ type MeasurementPartnerWrappingData struct { // "MEASUREMENT_PARTNER_LINK_OPT_OUT_PENDING" - Link opt-out pending sync. // "MEASUREMENT_PARTNER_LINK_WRAPPING_PENDING" - Link wrap answer pending. // "MEASUREMENT_PARTNER_MODE_CHANGE_PENDING" - Mode change pending. + // "MEASUREMENT_PARTNER_UNLINK_PENDING" - Partner unlink pending. LinkStatus string `json:"linkStatus,omitempty"` // MeasurementPartner: Measurement partner used for wrapping the placement. // @@ -8451,119 +8335,6 @@ func (s *OrdersListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// PathFilter: Represents a DfaReporting path filter. -type PathFilter struct { - // EventFilters: Event filters in path report. - EventFilters []*EventFilter `json:"eventFilters,omitempty"` - // Kind: The kind of resource this is, in this case dfareporting#pathFilter. - Kind string `json:"kind,omitempty"` - // PathMatchPosition: Determines how the 'value' field is matched when - // filtering. If not specified, defaults to EXACT. If set to - // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length - // character sequences, and it can be escaped with a backslash. Note, only paid - // search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT. - // - // Possible values: - // "PATH_MATCH_POSITION_UNSPECIFIED" - // "ANY" - // "FIRST" - // "LAST" - PathMatchPosition string `json:"pathMatchPosition,omitempty"` - // ForceSendFields is a list of field names (e.g. "EventFilters") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EventFilters") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *PathFilter) MarshalJSON() ([]byte, error) { - type NoMethod PathFilter - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// PathReportCompatibleFields: Represents fields that are compatible to be -// selected for a report of type "PATH". -type PathReportCompatibleFields struct { - // ChannelGroupings: Dimensions which are compatible to be selected in the - // "channelGroupings" section of the report. - ChannelGroupings []*Dimension `json:"channelGroupings,omitempty"` - // Dimensions: Dimensions which are compatible to be selected in the - // "dimensions" section of the report. - Dimensions []*Dimension `json:"dimensions,omitempty"` - // Kind: The kind of resource this is, in this case - // dfareporting#pathReportCompatibleFields. - Kind string `json:"kind,omitempty"` - // Metrics: Metrics which are compatible to be selected in the "metricNames" - // section of the report. - Metrics []*Metric `json:"metrics,omitempty"` - // PathFilters: Dimensions which are compatible to be selected in the - // "pathFilters" section of the report. - PathFilters []*Dimension `json:"pathFilters,omitempty"` - // ForceSendFields is a list of field names (e.g. "ChannelGroupings") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ChannelGroupings") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *PathReportCompatibleFields) MarshalJSON() ([]byte, error) { - type NoMethod PathReportCompatibleFields - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// PathReportDimensionValue: Represents a PathReportDimensionValue resource. -type PathReportDimensionValue struct { - // DimensionName: The name of the dimension. - DimensionName string `json:"dimensionName,omitempty"` - // Ids: The possible ID's associated with the value if available. - Ids []string `json:"ids,omitempty"` - // Kind: The kind of resource this is, in this case - // dfareporting#pathReportDimensionValue. - Kind string `json:"kind,omitempty"` - // MatchType: Determines how the 'value' field is matched when filtering. If - // not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is - // allowed as a placeholder for variable length character sequences, and it can - // be escaped with a backslash. Note, only paid search dimensions - // ('dfa:paidSearch*') allow a matchType other than EXACT. - // - // Possible values: - // "EXACT" - // "BEGINS_WITH" - // "CONTAINS" - // "WILDCARD_EXPRESSION" - MatchType string `json:"matchType,omitempty"` - // Values: The possible values of the dimension. - Values []string `json:"values,omitempty"` - // ForceSendFields is a list of field names (e.g. "DimensionName") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DimensionName") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *PathReportDimensionValue) MarshalJSON() ([]byte, error) { - type NoMethod PathReportDimensionValue - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // PathToConversionReportCompatibleFields: Represents fields that are // compatible to be selected for a report of type "PATH_TO_CONVERSION". type PathToConversionReportCompatibleFields struct { @@ -9937,11 +9708,6 @@ type Report struct { Name string `json:"name,omitempty"` // OwnerProfileId: The user profile id of the owner of this report. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"` - // PathAttributionCriteria: The report criteria for a report of type - // "PATH_ATTRIBUTION". - PathAttributionCriteria *ReportPathAttributionCriteria `json:"pathAttributionCriteria,omitempty"` - // PathCriteria: The report criteria for a report of type "PATH". - PathCriteria *ReportPathCriteria `json:"pathCriteria,omitempty"` // PathToConversionCriteria: The report criteria for a report of type // "PATH_TO_CONVERSION". PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"` @@ -9960,8 +9726,6 @@ type Report struct { // "PATH_TO_CONVERSION" // "CROSS_DIMENSION_REACH" // "FLOODLIGHT" - // "PATH" - // "PATH_ATTRIBUTION" Type string `json:"type,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. @@ -10166,79 +9930,6 @@ func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// ReportPathAttributionCriteria: The report criteria for a report of type -// "PATH_ATTRIBUTION". -type ReportPathAttributionCriteria struct { - // ActivityFilters: The list of 'dfa:activity' values to filter on. - ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"` - // CustomChannelGrouping: Channel Grouping. - CustomChannelGrouping *ChannelGrouping `json:"customChannelGrouping,omitempty"` - // DateRange: The date range this report should be run for. - DateRange *DateRange `json:"dateRange,omitempty"` - // Dimensions: The list of dimensions the report should include. - Dimensions []*SortedDimension `json:"dimensions,omitempty"` - // FloodlightConfigId: The floodlight ID for which to show data in this report. - // All advertisers associated with that ID will automatically be added. The - // dimension of the value needs to be 'dfa:floodlightConfigId'. - FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` - // MetricNames: The list of names of metrics the report should include. - MetricNames []string `json:"metricNames,omitempty"` - // PathFilters: Path Filters. - PathFilters []*PathFilter `json:"pathFilters,omitempty"` - // ForceSendFields is a list of field names (e.g. "ActivityFilters") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ActivityFilters") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *ReportPathAttributionCriteria) MarshalJSON() ([]byte, error) { - type NoMethod ReportPathAttributionCriteria - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// ReportPathCriteria: The report criteria for a report of type "PATH". -type ReportPathCriteria struct { - // ActivityFilters: The list of 'dfa:activity' values to filter on. - ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"` - // CustomChannelGrouping: Channel Grouping. - CustomChannelGrouping *ChannelGrouping `json:"customChannelGrouping,omitempty"` - // DateRange: The date range this report should be run for. - DateRange *DateRange `json:"dateRange,omitempty"` - // Dimensions: The list of dimensions the report should include. - Dimensions []*SortedDimension `json:"dimensions,omitempty"` - // FloodlightConfigId: The floodlight ID for which to show data in this report. - // All advertisers associated with that ID will automatically be added. The - // dimension of the value needs to be 'dfa:floodlightConfigId'. - FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"` - // MetricNames: The list of names of metrics the report should include. - MetricNames []string `json:"metricNames,omitempty"` - // PathFilters: Path Filters. - PathFilters []*PathFilter `json:"pathFilters,omitempty"` - // ForceSendFields is a list of field names (e.g. "ActivityFilters") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ActivityFilters") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *ReportPathCriteria) MarshalJSON() ([]byte, error) { - type NoMethod ReportPathCriteria - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // ReportPathToConversionCriteria: The report criteria for a report of type // "PATH_TO_CONVERSION". type ReportPathToConversionCriteria struct { @@ -12128,41 +11819,6 @@ func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// UvarFilter: Defines the filtering on a single uvar. -type UvarFilter struct { - // Complement: Return rows which don't match this filter. - Complement bool `json:"complement,omitempty"` - // Index: Custom variable index the filter is applied to. - Index int64 `json:"index,omitempty,string"` - // Kind: The kind of resource this is, in this case dfareporting#uvarFilter. - Kind string `json:"kind,omitempty"` - // Match: Indicates how the filter should be matched to the values. - // - // Possible values: - // "UNSPECIFIED" - // "EXACT" - // "CONTAINS" - Match string `json:"match,omitempty"` - // Values: Values to filter on. - Values []string `json:"values,omitempty"` - // ForceSendFields is a list of field names (e.g. "Complement") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Complement") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *UvarFilter) MarshalJSON() ([]byte, error) { - type NoMethod UvarFilter - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // VideoFormat: Contains information about supported video formats. type VideoFormat struct { // FileType: File type of the video format. @@ -13297,7 +12953,8 @@ type AccountUserProfilesPatchCall struct { header_ http.Header } -// Patch: Updates an existing user role. This method supports patch semantics. +// Patch: Updates an existing account user profile. This method supports patch +// semantics. // // - id: AccountUserProfile ID. // - profileId: User profile ID associated with this request. @@ -14587,7 +14244,7 @@ type AdsPatchCall struct { header_ http.Header } -// Patch: Updates an existing event tag. This method supports patch semantics. +// Patch: Updates an existing ad. This method supports patch semantics. // // - id: RemarketingList ID. // - profileId: User profile ID associated with this request. @@ -16074,7 +15731,8 @@ type AdvertiserLandingPagesPatchCall struct { header_ http.Header } -// Patch: Updates an existing advertiser. This method supports patch semantics. +// Patch: Updates an existing landing page. This method supports patch +// semantics. // // - id: Landing Page ID. // - profileId: User profile ID associated with this request. @@ -18557,7 +18215,7 @@ type CampaignsPatchCall struct { header_ http.Header } -// Patch: Updates an existing creative. This method supports patch semantics. +// Patch: Updates an existing campaign. This method supports patch semantics. // // - id: Campaign ID. // - profileId: User profile ID associated with this request. @@ -26138,7 +25796,8 @@ type FloodlightActivitiesPatchCall struct { header_ http.Header } -// Patch: Updates an existing event tag. This method supports patch semantics. +// Patch: Updates an existing floodlight activity. This method supports patch +// semantics. // // - id: EventTag ID. // - profileId: User profile ID associated with this request. @@ -26780,7 +26439,8 @@ type FloodlightActivityGroupsPatchCall struct { header_ http.Header } -// Patch: Updates an existing event tag. This method supports patch semantics. +// Patch: Updates an existing floodlight activity group. This method supports +// patch semantics. // // - id: EventTag ID. // - profileId: User profile ID associated with this request. @@ -27218,7 +26878,8 @@ type FloodlightConfigurationsPatchCall struct { header_ http.Header } -// Patch: Updates an existing event tag. This method supports patch semantics. +// Patch: Updates an existing floodlight configuration. This method supports +// patch semantics. // // - id: EventTag ID. // - profileId: User profile ID associated with this request. @@ -32603,8 +32264,8 @@ type RemarketingListSharesPatchCall struct { header_ http.Header } -// Patch: Updates an existing RemarketingListShare. This method supports patch -// semantics. +// Patch: Updates an existing remarketing list share. This method supports +// patch semantics. // // - id: RemarketingList ID. // - profileId: User profile ID associated with this request. @@ -33220,7 +32881,7 @@ type RemarketingListsPatchCall struct { header_ http.Header } -// Patch: Updates an existing RemarketingList. This method supports patch +// Patch: Updates an existing remarketing list. This method supports patch // semantics. // // - id: RemarketingList ID. diff --git a/dialogflow/v2/dialogflow-api.json b/dialogflow/v2/dialogflow-api.json index 858c633dcba..0cf213fe637 100644 --- a/dialogflow/v2/dialogflow-api.json +++ b/dialogflow/v2/dialogflow-api.json @@ -8655,7 +8655,7 @@ } } }, - "revision": "20240603", + "revision": "20240607", "rootUrl": "https://dialogflow.googleapis.com/", "schemas": { "GoogleCloudDialogflowCxV3AdvancedSettings": { @@ -15753,7 +15753,7 @@ "id": "GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig", "properties": { "disableHighLatencyFeaturesSyncDelivery": { - "description": "Optional. When disable_high_latency_features_sync_delivery is true and using the AnalyzeContent API, we will not deliver the responses from high latency features in the API response. The human_agent_assistant_config.notification_config must be configured and enable_event_based_suggestion must be set to true to receive the responses from high latency features in Pub/Sub. High latency feature(s): KNOWLEDGE_ASSIST.", + "description": "Optional. When disable_high_latency_features_sync_delivery is true and using the AnalyzeContent API, we will not deliver the responses from high latency features in the API response. The human_agent_assistant_config.notification_config must be configured and enable_event_based_suggestion must be set to true to receive the responses from high latency features in Pub/Sub. High latency feature(s): KNOWLEDGE_ASSIST", "type": "boolean" }, "featureConfigs": { diff --git a/dialogflow/v2/dialogflow-gen.go b/dialogflow/v2/dialogflow-gen.go index ea166261e36..1a7323e0fc2 100644 --- a/dialogflow/v2/dialogflow-gen.go +++ b/dialogflow/v2/dialogflow-gen.go @@ -10983,7 +10983,7 @@ type GoogleCloudDialogflowV2HumanAgentAssistantConfigSuggestionConfig struct { // human_agent_assistant_config.notification_config must be configured and // enable_event_based_suggestion must be set to true to receive the responses // from high latency features in Pub/Sub. High latency feature(s): - // KNOWLEDGE_ASSIST. + // KNOWLEDGE_ASSIST DisableHighLatencyFeaturesSyncDelivery bool `json:"disableHighLatencyFeaturesSyncDelivery,omitempty"` // FeatureConfigs: Configuration of different suggestion features. One feature // can have only one config. diff --git a/dialogflow/v2beta1/dialogflow-api.json b/dialogflow/v2beta1/dialogflow-api.json index a7d69e6e8e3..5fd94fc0828 100644 --- a/dialogflow/v2beta1/dialogflow-api.json +++ b/dialogflow/v2beta1/dialogflow-api.json @@ -8023,7 +8023,7 @@ } } }, - "revision": "20240605", + "revision": "20240607", "rootUrl": "https://dialogflow.googleapis.com/", "schemas": { "GoogleCloudDialogflowCxV3AdvancedSettings": { @@ -17190,7 +17190,7 @@ "id": "GoogleCloudDialogflowV2beta1HumanAgentAssistantConfigSuggestionConfig", "properties": { "disableHighLatencyFeaturesSyncDelivery": { - "description": "Optional. When disable_high_latency_features_sync_delivery is true and using the AnalyzeContent API, we will not deliver the responses from high latency features in the API response. The human_agent_assistant_config.notification_config must be configured and enable_event_based_suggestion must be set to true to receive the responses from high latency features in Pub/Sub. High latency feature(s): KNOWLEDGE_ASSIST.", + "description": "Optional. When disable_high_latency_features_sync_delivery is true and using the AnalyzeContent API, we will not deliver the responses from high latency features in the API response. The human_agent_assistant_config.notification_config must be configured and enable_event_based_suggestion must be set to true to receive the responses from high latency features in Pub/Sub. High latency feature(s): KNOWLEDGE_ASSIST", "type": "boolean" }, "featureConfigs": { diff --git a/dialogflow/v2beta1/dialogflow-gen.go b/dialogflow/v2beta1/dialogflow-gen.go index 1796f55a3fb..4b8704c9722 100644 --- a/dialogflow/v2beta1/dialogflow-gen.go +++ b/dialogflow/v2beta1/dialogflow-gen.go @@ -13726,7 +13726,7 @@ type GoogleCloudDialogflowV2beta1HumanAgentAssistantConfigSuggestionConfig struc // human_agent_assistant_config.notification_config must be configured and // enable_event_based_suggestion must be set to true to receive the responses // from high latency features in Pub/Sub. High latency feature(s): - // KNOWLEDGE_ASSIST. + // KNOWLEDGE_ASSIST DisableHighLatencyFeaturesSyncDelivery bool `json:"disableHighLatencyFeaturesSyncDelivery,omitempty"` // FeatureConfigs: Configuration of different suggestion features. One feature // can have only one config. diff --git a/discoveryengine/v1/discoveryengine-api.json b/discoveryengine/v1/discoveryengine-api.json index 58e343b2e07..60244e12dfb 100644 --- a/discoveryengine/v1/discoveryengine-api.json +++ b/discoveryengine/v1/discoveryengine-api.json @@ -772,6 +772,66 @@ } } }, + "completionSuggestions": { + "methods": { + "import": { + "description": "Imports CompletionSuggestions for a DataStore.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/completionSuggestions:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/completionSuggestions:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Permanently deletes all CompletionSuggestions for a DataStore.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/completionSuggestions:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/completionSuggestions:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "controls": { "methods": { "create": { @@ -3911,6 +3971,66 @@ } } }, + "completionSuggestions": { + "methods": { + "import": { + "description": "Imports CompletionSuggestions for a DataStore.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/completionSuggestions:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.completionSuggestions.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/completionSuggestions:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Permanently deletes all CompletionSuggestions for a DataStore.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/completionSuggestions:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.completionSuggestions.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/completionSuggestions:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "controls": { "methods": { "create": { @@ -5591,7 +5711,7 @@ } } }, - "revision": "20240612", + "revision": "20240617", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -5783,14 +5903,16 @@ "ADVERSARIAL_QUERY_IGNORED", "NON_ANSWER_SEEKING_QUERY_IGNORED", "OUT_OF_DOMAIN_QUERY_IGNORED", - "POTENTIAL_POLICY_VIOLATION" + "POTENTIAL_POLICY_VIOLATION", + "NO_RELEVANT_CONTENT" ], "enumDescriptions": [ "Default value. The answer skipped reason is not specified.", "The adversarial query ignored case.", "The non-answer seeking query ignored case.", "The out-of-domain query ignored case. Google skips the answer if there are no high-relevance search results.", - "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic." + "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic.", + "The no relevant content case. Google skips the answer if there is no relevant content in the retrieved search results." ], "type": "string" }, @@ -7116,6 +7238,47 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1CompletionSuggestion": { + "description": "Autocomplete suggestions that are imported from Customer.", + "id": "GoogleCloudDiscoveryengineV1CompletionSuggestion", + "properties": { + "alternativePhrases": { + "description": "Alternative matching phrases for this suggestion.", + "items": { + "type": "string" + }, + "type": "array" + }, + "frequency": { + "description": "Frequency of this suggestion. Will be used to rank suggestions when score is not available.", + "format": "int64", + "type": "string" + }, + "globalScore": { + "description": "Global score of this suggestion. Control how this suggestion would be scored / ranked.", + "format": "double", + "type": "number" + }, + "groupId": { + "description": "If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.", + "type": "string" + }, + "groupScore": { + "description": "The score of this suggestion within its group.", + "format": "double", + "type": "number" + }, + "languageCode": { + "description": "BCP-47 language code of this suggestion.", + "type": "string" + }, + "suggestion": { + "description": "Required. The suggestion text.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1Condition": { "description": "Defines circumstances to be checked before allowing a behavior", "id": "GoogleCloudDiscoveryengineV1Condition", @@ -7818,7 +7981,7 @@ "type": "string" }, "uri": { - "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 100 MB for other formats.", + "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.", "type": "string" } }, @@ -8292,6 +8455,88 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest": { + "description": "Request message for CompletionService.ImportCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest", + "properties": { + "bigquerySource": { + "$ref": "GoogleCloudDiscoveryengineV1BigQuerySource", + "description": "BigQuery input source." + }, + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1ImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "gcsSource": { + "$ref": "GoogleCloudDiscoveryengineV1GcsSource", + "description": "Cloud Storage location for the input content." + }, + "inlineSource": { + "$ref": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource", + "description": "The Inline source for suggestion entries." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource": { + "description": "The inline source for CompletionSuggestions.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource", + "properties": { + "suggestions": { + "description": "Required. A list of all denylist entries to import. Max of 1000 items.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1CompletionSuggestion" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1ImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata", @@ -8938,6 +9183,47 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the PurgeCompletionSuggestions operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest": { + "description": "Request message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest", + "properties": {}, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse": { + "description": "Response message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse", + "properties": { + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + }, + "purgeSucceeded": { + "description": "Whether the completion suggestions were successfully purged.", + "type": "boolean" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata", @@ -9629,7 +9915,7 @@ "description": "Required. The facet key specification." }, "limit": { - "description": "Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "description": "Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. For aggregation in healthcare search, when the [FacetKey.key] is \"healthcare_aggregation_key\", the limit will be overridden to 10,000 internally, regardless of the value set here. If this field is negative, an `INVALID_ARGUMENT` is returned.", "format": "int32", "type": "integer" } @@ -10524,14 +10810,16 @@ "ADVERSARIAL_QUERY_IGNORED", "NON_ANSWER_SEEKING_QUERY_IGNORED", "OUT_OF_DOMAIN_QUERY_IGNORED", - "POTENTIAL_POLICY_VIOLATION" + "POTENTIAL_POLICY_VIOLATION", + "NO_RELEVANT_CONTENT" ], "enumDescriptions": [ "Default value. The answer skipped reason is not specified.", "The adversarial query ignored case.", "The non-answer seeking query ignored case.", "The out-of-domain query ignored case. Google skips the answer if there are no high-relevance search results.", - "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic." + "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic.", + "The no relevant content case. Google skips the answer if there is no relevant content in the retrieved search results." ], "type": "string" }, @@ -12121,6 +12409,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata", @@ -12397,6 +12730,41 @@ "properties": {}, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the PurgeCompletionSuggestions operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse": { + "description": "Response message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse", + "properties": { + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + }, + "purgeSucceeded": { + "description": "Whether the completion suggestions were successfully purged.", + "type": "boolean" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata", @@ -13802,6 +14170,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata", diff --git a/discoveryengine/v1/discoveryengine-gen.go b/discoveryengine/v1/discoveryengine-gen.go index b7d4169a64c..6601fa8d247 100644 --- a/discoveryengine/v1/discoveryengine-gen.go +++ b/discoveryengine/v1/discoveryengine-gen.go @@ -241,6 +241,7 @@ type ProjectsLocationsCollectionsDataConnectorOperationsService struct { func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { rs := &ProjectsLocationsCollectionsDataStoresService{s: s} rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.CompletionSuggestions = NewProjectsLocationsCollectionsDataStoresCompletionSuggestionsService(s) rs.Controls = NewProjectsLocationsCollectionsDataStoresControlsService(s) rs.Conversations = NewProjectsLocationsCollectionsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsCollectionsDataStoresModelsService(s) @@ -259,6 +260,8 @@ type ProjectsLocationsCollectionsDataStoresService struct { Branches *ProjectsLocationsCollectionsDataStoresBranchesService + CompletionSuggestions *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService + Controls *ProjectsLocationsCollectionsDataStoresControlsService Conversations *ProjectsLocationsCollectionsDataStoresConversationsService @@ -313,6 +316,15 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsCollectionsDataStoresCompletionSuggestionsService(s *Service) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService { + rs := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService struct { + s *Service +} + func NewProjectsLocationsCollectionsDataStoresControlsService(s *Service) *ProjectsLocationsCollectionsDataStoresControlsService { rs := &ProjectsLocationsCollectionsDataStoresControlsService{s: s} return rs @@ -568,6 +580,7 @@ type ProjectsLocationsCollectionsOperationsService struct { func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) + rs.CompletionSuggestions = NewProjectsLocationsDataStoresCompletionSuggestionsService(s) rs.Controls = NewProjectsLocationsDataStoresControlsService(s) rs.Conversations = NewProjectsLocationsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsDataStoresModelsService(s) @@ -586,6 +599,8 @@ type ProjectsLocationsDataStoresService struct { Branches *ProjectsLocationsDataStoresBranchesService + CompletionSuggestions *ProjectsLocationsDataStoresCompletionSuggestionsService + Controls *ProjectsLocationsDataStoresControlsService Conversations *ProjectsLocationsDataStoresConversationsService @@ -640,6 +655,15 @@ type ProjectsLocationsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresCompletionSuggestionsService(s *Service) *ProjectsLocationsDataStoresCompletionSuggestionsService { + rs := &ProjectsLocationsDataStoresCompletionSuggestionsService{s: s} + return rs +} + +type ProjectsLocationsDataStoresCompletionSuggestionsService struct { + s *Service +} + func NewProjectsLocationsDataStoresControlsService(s *Service) *ProjectsLocationsDataStoresControlsService { rs := &ProjectsLocationsDataStoresControlsService{s: s} return rs @@ -1097,6 +1121,8 @@ type GoogleCloudDiscoveryengineV1Answer struct { // "POTENTIAL_POLICY_VIOLATION" - The potential policy violation case. Google // skips the answer if there is a potential policy violation detected. This // includes content that may be violent or toxic. + // "NO_RELEVANT_CONTENT" - The no relevant content case. Google skips the + // answer if there is no relevant content in the retrieved search results. AnswerSkippedReasons []string `json:"answerSkippedReasons,omitempty"` // AnswerText: The textual answer. AnswerText string `json:"answerText,omitempty"` @@ -2944,6 +2970,61 @@ func (s *GoogleCloudDiscoveryengineV1CompletionInfo) MarshalJSON() ([]byte, erro return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1CompletionSuggestion: Autocomplete suggestions +// that are imported from Customer. +type GoogleCloudDiscoveryengineV1CompletionSuggestion struct { + // AlternativePhrases: Alternative matching phrases for this suggestion. + AlternativePhrases []string `json:"alternativePhrases,omitempty"` + // Frequency: Frequency of this suggestion. Will be used to rank suggestions + // when score is not available. + Frequency int64 `json:"frequency,omitempty,string"` + // GlobalScore: Global score of this suggestion. Control how this suggestion + // would be scored / ranked. + GlobalScore float64 `json:"globalScore,omitempty"` + // GroupId: If two suggestions have the same groupId, they will not be returned + // together. Instead the one ranked higher will be returned. This can be used + // to deduplicate semantically identical suggestions. + GroupId string `json:"groupId,omitempty"` + // GroupScore: The score of this suggestion within its group. + GroupScore float64 `json:"groupScore,omitempty"` + // LanguageCode: BCP-47 language code of this suggestion. + LanguageCode string `json:"languageCode,omitempty"` + // Suggestion: Required. The suggestion text. + Suggestion string `json:"suggestion,omitempty"` + // ForceSendFields is a list of field names (e.g. "AlternativePhrases") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AlternativePhrases") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1CompletionSuggestion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1CompletionSuggestion + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1CompletionSuggestion) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1CompletionSuggestion + var s1 struct { + GlobalScore gensupport.JSONFloat64 `json:"globalScore"` + GroupScore gensupport.JSONFloat64 `json:"groupScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.GlobalScore = float64(s1.GlobalScore) + s.GroupScore = float64(s1.GroupScore) + return nil +} + // GoogleCloudDiscoveryengineV1Condition: Defines circumstances to be checked // before allowing a behavior type GoogleCloudDiscoveryengineV1Condition struct { @@ -3913,7 +3994,7 @@ type GoogleCloudDiscoveryengineV1DocumentContent struct { RawBytes string `json:"rawBytes,omitempty"` // Uri: The URI of the content. Only Cloud Storage URIs (e.g. // `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 - // MB for text-based formats, 100 MB for other formats. + // MB for text-based formats, 200 MB for other formats. Uri string `json:"uri,omitempty"` // ForceSendFields is a list of field names (e.g. "MimeType") to // unconditionally include in API requests. By default, fields with empty or @@ -4608,6 +4689,117 @@ func (s *GoogleCloudDiscoveryengineV1GroundingFact) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata: Metadata +// related to the progress of the ImportCompletionSuggestions operation. This +// will be returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest: Request +// message for CompletionService.ImportCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest struct { + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1BigQuerySource `json:"bigquerySource,omitempty"` + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1ImportErrorConfig `json:"errorConfig,omitempty"` + // GcsSource: Cloud Storage location for the input content. + GcsSource *GoogleCloudDiscoveryengineV1GcsSource `json:"gcsSource,omitempty"` + // InlineSource: The Inline source for suggestion entries. + InlineSource *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource `json:"inlineSource,omitempty"` + // ForceSendFields is a list of field names (e.g. "BigquerySource") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BigquerySource") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource: +// The inline source for CompletionSuggestions. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource struct { + // Suggestions: Required. A list of all denylist entries to import. Max of 1000 + // items. + Suggestions []*GoogleCloudDiscoveryengineV1CompletionSuggestion `json:"suggestions,omitempty"` + // ForceSendFields is a list of field names (e.g. "Suggestions") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Suggestions") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse: Response of +// the CompletionService.ImportCompletionSuggestions method. If the long +// running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1ImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1ImportDocumentsMetadata: Metadata related to the // progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -5552,6 +5744,63 @@ func (s *GoogleCloudDiscoveryengineV1ProvisionProjectRequest) MarshalJSON() ([]b return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata: Metadata +// related to the progress of the PurgeCompletionSuggestions operation. This is +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest: Request +// message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest struct { +} + +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse: Response +// message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // PurgeSucceeded: Whether the completion suggestions were successfully purged. + PurgeSucceeded bool `json:"purgeSucceeded,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata: Metadata related to the // progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -6702,8 +6951,10 @@ type GoogleCloudDiscoveryengineV1SearchRequestFacetSpec struct { FacetKey *GoogleCloudDiscoveryengineV1SearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` // Limit: Maximum facet values that are returned for this facet. If // unspecified, defaults to 20. The maximum allowed value is 300. Values above - // 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is - // returned. + // 300 are coerced to 300. For aggregation in healthcare search, when the + // [FacetKey.key] is "healthcare_aggregation_key", the limit will be overridden + // to 10,000 internally, regardless of the value set here. If this field is + // negative, an `INVALID_ARGUMENT` is returned. Limit int64 `json:"limit,omitempty"` // ForceSendFields is a list of field names (e.g. "EnableDynamicPosition") to // unconditionally include in API requests. By default, fields with empty or @@ -7982,6 +8233,8 @@ type GoogleCloudDiscoveryengineV1alphaAnswer struct { // "POTENTIAL_POLICY_VIOLATION" - The potential policy violation case. Google // skips the answer if there is a potential policy violation detected. This // includes content that may be violent or toxic. + // "NO_RELEVANT_CONTENT" - The no relevant content case. Google skips the + // answer if there is no relevant content in the retrieved search results. AnswerSkippedReasons []string `json:"answerSkippedReasons,omitempty"` // AnswerText: The textual answer. AnswerText string `json:"answerText,omitempty"` @@ -10074,6 +10327,65 @@ func (s *GoogleCloudDiscoveryengineV1alphaIdpConfigExternalIdpConfig) MarshalJSO return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata: +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse: +// Response of the CompletionService.ImportCompletionSuggestions method. If the +// long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata: Metadata related // to the progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -10423,6 +10735,59 @@ func (s *GoogleCloudDiscoveryengineV1alphaProjectServiceTerms) MarshalJSON() ([] type GoogleCloudDiscoveryengineV1alphaProvisionProjectMetadata struct { } +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata: +// Metadata related to the progress of the PurgeCompletionSuggestions +// operation. This is returned by the google.longrunning.Operation.metadata +// field. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse: +// Response message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // PurgeSucceeded: Whether the completion suggestions were successfully purged. + PurgeSucceeded bool `json:"purgeSucceeded,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata: Metadata related to // the progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -12282,15 +12647,74 @@ func (s *GoogleCloudDiscoveryengineV1betaEngineSearchEngineConfig) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata related to -// the progress of the ImportDocuments operation. This is returned by the +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata: +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the // google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata struct { // CreateTime: Operation create time. CreateTime string `json:"createTime,omitempty"` - // FailureCount: Count of entries that encountered errors while processing. + // FailureCount: Count of CompletionSuggestions that failed to be imported. FailureCount int64 `json:"failureCount,omitempty,string"` - // SuccessCount: Count of entries that were processed successfully. + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse: +// Response of the CompletionService.ImportCompletionSuggestions method. If the +// long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata related to +// the progress of the ImportDocuments operation. This is returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of entries that encountered errors while processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of entries that were processed successfully. SuccessCount int64 `json:"successCount,omitempty,string"` // TotalCount: Total count of entries that were processed. TotalCount int64 `json:"totalCount,omitempty,string"` @@ -15680,6 +16104,214 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages } } +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1importcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Imports CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to import customer +// autocomplete suggestions. Follows pattern +// `projects/*/locations/*/collections/*/dataStores/*`. +func (r *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService) Import(parent string, googleclouddiscoveryenginev1importcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest = googleclouddiscoveryenginev1importcompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/completionSuggestions:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.import" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1purgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Purge: Permanently deletes all CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to purge completion +// suggestions. Follows pattern +// projects/*/locations/*/collections/*/dataStores/*. +func (r *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService) Purge(parent string, googleclouddiscoveryenginev1purgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { + c := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest = googleclouddiscoveryenginev1purgecompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/completionSuggestions:purge") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.purge" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsCollectionsDataStoresControlsCreateCall struct { s *Service parent string @@ -27246,6 +27878,214 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx contex } } +type ProjectsLocationsDataStoresCompletionSuggestionsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1importcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Imports CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to import customer +// autocomplete suggestions. Follows pattern +// `projects/*/locations/*/collections/*/dataStores/*`. +func (r *ProjectsLocationsDataStoresCompletionSuggestionsService) Import(parent string, googleclouddiscoveryenginev1importcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c := &ProjectsLocationsDataStoresCompletionSuggestionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest = googleclouddiscoveryenginev1importcompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1importcompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/completionSuggestions:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.completionSuggestions.import" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1purgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Purge: Permanently deletes all CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to purge completion +// suggestions. Follows pattern +// projects/*/locations/*/collections/*/dataStores/*. +func (r *ProjectsLocationsDataStoresCompletionSuggestionsService) Purge(parent string, googleclouddiscoveryenginev1purgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c := &ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest = googleclouddiscoveryenginev1purgecompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1purgecompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/completionSuggestions:purge") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.completionSuggestions.purge" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsDataStoresControlsCreateCall struct { s *Service parent string diff --git a/discoveryengine/v1alpha/discoveryengine-api.json b/discoveryengine/v1alpha/discoveryengine-api.json index b47789b6240..298aa0b6c5c 100644 --- a/discoveryengine/v1alpha/discoveryengine-api.json +++ b/discoveryengine/v1alpha/discoveryengine-api.json @@ -797,13 +797,13 @@ "PROCESSED_DOCUMENT_TYPE_UNSPECIFIED", "PARSED_DOCUMENT", "CHUNKED_DOCUMENT", - "PNG_CONVERTED_DOCUMENT" + "IMAGE_CONVERTED_DOCUMENT" ], "enumDescriptions": [ "Default value.", "Available for all data store parsing configs.", "Only available if ChunkingConfig is enabled on the data store.", - "Returns the converted PNG Image bytes if available." + "Returns the converted Image bytes (as JPEG or PNG) if available." ], "location": "query", "type": "string" @@ -1117,6 +1117,66 @@ } } }, + "completionSuggestions": { + "methods": { + "import": { + "description": "Imports CompletionSuggestions for a DataStore.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/completionSuggestions:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/completionSuggestions:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Permanently deletes all CompletionSuggestions for a DataStore.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/completionSuggestions:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/completionSuggestions:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "controls": { "methods": { "create": { @@ -4448,13 +4508,13 @@ "PROCESSED_DOCUMENT_TYPE_UNSPECIFIED", "PARSED_DOCUMENT", "CHUNKED_DOCUMENT", - "PNG_CONVERTED_DOCUMENT" + "IMAGE_CONVERTED_DOCUMENT" ], "enumDescriptions": [ "Default value.", "Available for all data store parsing configs.", "Only available if ChunkingConfig is enabled on the data store.", - "Returns the converted PNG Image bytes if available." + "Returns the converted Image bytes (as JPEG or PNG) if available." ], "location": "query", "type": "string" @@ -4768,6 +4828,66 @@ } } }, + "completionSuggestions": { + "methods": { + "import": { + "description": "Imports CompletionSuggestions for a DataStore.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/completionSuggestions:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.completionSuggestions.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/completionSuggestions:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Permanently deletes all CompletionSuggestions for a DataStore.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/completionSuggestions:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.completionSuggestions.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/completionSuggestions:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "controls": { "methods": { "create": { @@ -6641,7 +6761,7 @@ } } }, - "revision": "20240612", + "revision": "20240617", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiDistribution": { @@ -7754,6 +7874,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1ImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata", @@ -7990,6 +8155,41 @@ "properties": {}, "type": "object" }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the PurgeCompletionSuggestions operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse": { + "description": "Response message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse", + "properties": { + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + }, + "purgeSucceeded": { + "description": "Whether the completion suggestions were successfully purged.", + "type": "boolean" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata", @@ -8322,14 +8522,16 @@ "ADVERSARIAL_QUERY_IGNORED", "NON_ANSWER_SEEKING_QUERY_IGNORED", "OUT_OF_DOMAIN_QUERY_IGNORED", - "POTENTIAL_POLICY_VIOLATION" + "POTENTIAL_POLICY_VIOLATION", + "NO_RELEVANT_CONTENT" ], "enumDescriptions": [ "Default value. The answer skipped reason is not specified.", "The adversarial query ignored case.", "The non-answer seeking query ignored case.", "The out-of-domain query ignored case. Google skips the answer if there are no high-relevance search results.", - "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic." + "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic.", + "The no relevant content case. Google skips the answer if there is no relevant content in the retrieved search results." ], "type": "string" }, @@ -9478,11 +9680,11 @@ "id": "GoogleCloudDiscoveryengineV1alphaCheckRequirementRequest", "properties": { "requirementType": { - "description": "A Requirement.type specifying the requirement to check.", + "description": "The type specifying the requirement to check. The supported types are: * `discoveryengine.googleapis.com/media_recs/general/all/warning` * `discoveryengine.googleapis.com/media_recs/oyml/cvr/warning` * `discoveryengine.googleapis.com/media_recs/rfy/cvr/warning` * `discoveryengine.googleapis.com/media_recs/mlt/cvr/warning` * `discoveryengine.googleapis.com/media_recs/mp/cvr/warning` * `discoveryengine.googleapis.com/media_recs/oyml/wdps/warning` * `discoveryengine.googleapis.com/media_recs/rfy/wdps/warning` * `discoveryengine.googleapis.com/media_recs/mlt/wdps/warning`", "type": "string" }, "resources": { - "description": "The resources to be checked for this requirement.", + "description": "The type needed for the monitored resources: * `discoveryengine.googleapis.com/Branch`. * The labels needed for this resource: * `project_number` * `location_id` * `collection_id` * `datastore_id` * `branch_id` * `discoveryengine.googleapis.com/DataStore` * The labels needed for this resource: * `project_number` * `location_id` * `collection_id` * `datastore_id`", "items": { "$ref": "GoogleApiMonitoredResource" }, @@ -9492,7 +9694,7 @@ "type": "object" }, "GoogleCloudDiscoveryengineV1alphaCheckRequirementResponse": { - "description": "Response for CheckRequirement method.", + "description": "Response for the CheckRequirement method.", "id": "GoogleCloudDiscoveryengineV1alphaCheckRequirementResponse", "properties": { "metricResults": { @@ -9753,6 +9955,47 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaCompletionSuggestion": { + "description": "Autocomplete suggestions that are imported from Customer.", + "id": "GoogleCloudDiscoveryengineV1alphaCompletionSuggestion", + "properties": { + "alternativePhrases": { + "description": "Alternative matching phrases for this suggestion.", + "items": { + "type": "string" + }, + "type": "array" + }, + "frequency": { + "description": "Frequency of this suggestion. Will be used to rank suggestions when score is not available.", + "format": "int64", + "type": "string" + }, + "globalScore": { + "description": "Global score of this suggestion. Control how this suggestion would be scored / ranked.", + "format": "double", + "type": "number" + }, + "groupId": { + "description": "If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.", + "type": "string" + }, + "groupScore": { + "description": "The score of this suggestion within its group.", + "format": "double", + "type": "number" + }, + "languageCode": { + "description": "BCP-47 language code of this suggestion.", + "type": "string" + }, + "suggestion": { + "description": "Required. The suggestion text.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaCondition": { "description": "Defines circumstances to be checked before allowing a behavior", "id": "GoogleCloudDiscoveryengineV1alphaCondition", @@ -10568,7 +10811,7 @@ "type": "string" }, "uri": { - "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 100 MB for other formats.", + "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.", "type": "string" } }, @@ -11485,6 +11728,88 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest": { + "description": "Request message for CompletionService.ImportCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest", + "properties": { + "bigquerySource": { + "$ref": "GoogleCloudDiscoveryengineV1alphaBigQuerySource", + "description": "BigQuery input source." + }, + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "gcsSource": { + "$ref": "GoogleCloudDiscoveryengineV1alphaGcsSource", + "description": "Cloud Storage location for the input content." + }, + "inlineSource": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource", + "description": "The Inline source for suggestion entries." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource": { + "description": "The inline source for CompletionSuggestions.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource", + "properties": { + "suggestions": { + "description": "Required. A list of all denylist entries to import. Max of 1000 items.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaCompletionSuggestion" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata", @@ -12243,6 +12568,47 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the PurgeCompletionSuggestions operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest": { + "description": "Request message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest", + "properties": {}, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse": { + "description": "Response message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse", + "properties": { + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + }, + "purgeSucceeded": { + "description": "Whether the completion suggestions were successfully purged.", + "type": "boolean" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata", @@ -12834,7 +13200,7 @@ "type": "array" }, "type": { - "description": "The requirement type, used as an identifier. Must be unique. The type should prefix with service name to avoid possible collision. It's encoraged to use natural hierarchical grouping for similar requirements. Examples: * `library.googleapis.com/books/min_available_books` * `discoveryengine.googleapis.com/media_rec/recommended_for_you/conversion_rate`", + "description": "The requirement type, used as an identifier. Must be unique. The type should prefix with service name to avoid possible collision. It's encouraged to use natural hierarchical grouping for similar requirements. Examples: * `library.googleapis.com/books/min_available_books` * `discoveryengine.googleapis.com/media_rec/recommended_for_you/conversion_rate`", "type": "string" }, "violationSamplesBindings": { @@ -13070,10 +13436,32 @@ "description": "The Unicode country/region code (CLDR) of a location, such as \"US\" and \"419\". For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). If set, then results will be boosted based on the region_code provided.", "type": "string" }, + "relevanceThreshold": { + "description": "The relevance threshold of the search results. Default to Google defined threshold, leveraging a balance of precision and recall to deliver both highly accurate results and comprehensive coverage of relevant information.", + "enum": [ + "RELEVANCE_THRESHOLD_UNSPECIFIED", + "LOWEST", + "LOW", + "MEDIUM", + "HIGH" + ], + "enumDescriptions": [ + "Default value. In this case, server behavior defaults to Google defined threshold.", + "Lowest relevance threshold.", + "Low relevance threshold.", + "Medium relevance threshold.", + "High relevance threshold." + ], + "type": "string" + }, "safeSearch": { "description": "Whether to turn on safe search. This is only supported for website search.", "type": "boolean" }, + "searchAsYouTypeSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec", + "description": "Search as you type configuration. Only supported for the IndustryVertical.MEDIA vertical." + }, "spellCorrectionSpec": { "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec", "description": "The spell correction specification that specifies the mode under which spell correction takes effect." @@ -13423,7 +13811,7 @@ "description": "Required. The facet key specification." }, "limit": { - "description": "Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "description": "Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. For aggregation in healthcare search, when the [FacetKey.key] is \"healthcare_aggregation_key\", the limit will be overridden to 10,000 internally, regardless of the value set here. If this field is negative, an `INVALID_ARGUMENT` is returned.", "format": "int32", "type": "integer" } @@ -13513,6 +13901,27 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec": { + "description": "Specification for search as you type in search requests.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec", + "properties": { + "condition": { + "description": "The condition under which search as you type should occur. Default to Condition.DISABLED.", + "enum": [ + "CONDITION_UNSPECIFIED", + "DISABLED", + "ENABLED" + ], + "enumDescriptions": [ + "Server behavior defaults to Condition.DISABLED.", + "Disables Search As You Type.", + "Enables Search As You Type." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec": { "description": "The specification for query spell correction.", "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec", @@ -15488,6 +15897,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata", diff --git a/discoveryengine/v1alpha/discoveryengine-gen.go b/discoveryengine/v1alpha/discoveryengine-gen.go index fbf51dffb4a..623d6760271 100644 --- a/discoveryengine/v1alpha/discoveryengine-gen.go +++ b/discoveryengine/v1alpha/discoveryengine-gen.go @@ -250,6 +250,7 @@ type ProjectsLocationsCollectionsDataConnectorOperationsService struct { func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { rs := &ProjectsLocationsCollectionsDataStoresService{s: s} rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.CompletionSuggestions = NewProjectsLocationsCollectionsDataStoresCompletionSuggestionsService(s) rs.Controls = NewProjectsLocationsCollectionsDataStoresControlsService(s) rs.Conversations = NewProjectsLocationsCollectionsDataStoresConversationsService(s) rs.CustomModels = NewProjectsLocationsCollectionsDataStoresCustomModelsService(s) @@ -269,6 +270,8 @@ type ProjectsLocationsCollectionsDataStoresService struct { Branches *ProjectsLocationsCollectionsDataStoresBranchesService + CompletionSuggestions *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService + Controls *ProjectsLocationsCollectionsDataStoresControlsService Conversations *ProjectsLocationsCollectionsDataStoresConversationsService @@ -337,6 +340,15 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsCollectionsDataStoresCompletionSuggestionsService(s *Service) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService { + rs := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService struct { + s *Service +} + func NewProjectsLocationsCollectionsDataStoresControlsService(s *Service) *ProjectsLocationsCollectionsDataStoresControlsService { rs := &ProjectsLocationsCollectionsDataStoresControlsService{s: s} return rs @@ -601,6 +613,7 @@ type ProjectsLocationsCollectionsOperationsService struct { func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) + rs.CompletionSuggestions = NewProjectsLocationsDataStoresCompletionSuggestionsService(s) rs.Controls = NewProjectsLocationsDataStoresControlsService(s) rs.Conversations = NewProjectsLocationsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsDataStoresModelsService(s) @@ -619,6 +632,8 @@ type ProjectsLocationsDataStoresService struct { Branches *ProjectsLocationsDataStoresBranchesService + CompletionSuggestions *ProjectsLocationsDataStoresCompletionSuggestionsService + Controls *ProjectsLocationsDataStoresControlsService Conversations *ProjectsLocationsDataStoresConversationsService @@ -685,6 +700,15 @@ type ProjectsLocationsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresCompletionSuggestionsService(s *Service) *ProjectsLocationsDataStoresCompletionSuggestionsService { + rs := &ProjectsLocationsDataStoresCompletionSuggestionsService{s: s} + return rs +} + +type ProjectsLocationsDataStoresCompletionSuggestionsService struct { + s *Service +} + func NewProjectsLocationsDataStoresControlsService(s *Service) *ProjectsLocationsDataStoresControlsService { rs := &ProjectsLocationsDataStoresControlsService{s: s} return rs @@ -2617,6 +2641,64 @@ func (s *GoogleCloudDiscoveryengineV1EngineSearchEngineConfig) MarshalJSON() ([] return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata: Metadata +// related to the progress of the ImportCompletionSuggestions operation. This +// will be returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse: Response of +// the CompletionService.ImportCompletionSuggestions method. If the long +// running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1ImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1ImportDocumentsMetadata: Metadata related to the // progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -2911,6 +2993,58 @@ func (s *GoogleCloudDiscoveryengineV1ProjectServiceTerms) MarshalJSON() ([]byte, type GoogleCloudDiscoveryengineV1ProvisionProjectMetadata struct { } +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata: Metadata +// related to the progress of the PurgeCompletionSuggestions operation. This is +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse: Response +// message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // PurgeSucceeded: Whether the completion suggestions were successfully purged. + PurgeSucceeded bool `json:"purgeSucceeded,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata: Metadata related to the // progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -3347,6 +3481,8 @@ type GoogleCloudDiscoveryengineV1alphaAnswer struct { // "POTENTIAL_POLICY_VIOLATION" - The potential policy violation case. Google // skips the answer if there is a potential policy violation detected. This // includes content that may be violent or toxic. + // "NO_RELEVANT_CONTENT" - The no relevant content case. Google skips the + // answer if there is no relevant content in the retrieved search results. AnswerSkippedReasons []string `json:"answerSkippedReasons,omitempty"` // AnswerText: The textual answer. AnswerText string `json:"answerText,omitempty"` @@ -4935,9 +5071,22 @@ func (s *GoogleCloudDiscoveryengineV1alphaCheckGroundingSpec) UnmarshalJSON(data // GoogleCloudDiscoveryengineV1alphaCheckRequirementRequest: Request for // CheckRequirement method. type GoogleCloudDiscoveryengineV1alphaCheckRequirementRequest struct { - // RequirementType: A Requirement.type specifying the requirement to check. + // RequirementType: The type specifying the requirement to check. The supported + // types are: * `discoveryengine.googleapis.com/media_recs/general/all/warning` + // * `discoveryengine.googleapis.com/media_recs/oyml/cvr/warning` * + // `discoveryengine.googleapis.com/media_recs/rfy/cvr/warning` * + // `discoveryengine.googleapis.com/media_recs/mlt/cvr/warning` * + // `discoveryengine.googleapis.com/media_recs/mp/cvr/warning` * + // `discoveryengine.googleapis.com/media_recs/oyml/wdps/warning` * + // `discoveryengine.googleapis.com/media_recs/rfy/wdps/warning` * + // `discoveryengine.googleapis.com/media_recs/mlt/wdps/warning` RequirementType string `json:"requirementType,omitempty"` - // Resources: The resources to be checked for this requirement. + // Resources: The type needed for the monitored resources: * + // `discoveryengine.googleapis.com/Branch`. * The labels needed for this + // resource: * `project_number` * `location_id` * `collection_id` * + // `datastore_id` * `branch_id` * `discoveryengine.googleapis.com/DataStore` * + // The labels needed for this resource: * `project_number` * `location_id` * + // `collection_id` * `datastore_id` Resources []*GoogleApiMonitoredResource `json:"resources,omitempty"` // ForceSendFields is a list of field names (e.g. "RequirementType") to // unconditionally include in API requests. By default, fields with empty or @@ -4957,7 +5106,7 @@ func (s *GoogleCloudDiscoveryengineV1alphaCheckRequirementRequest) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaCheckRequirementResponse: Response for +// GoogleCloudDiscoveryengineV1alphaCheckRequirementResponse: Response for the // CheckRequirement method. type GoogleCloudDiscoveryengineV1alphaCheckRequirementResponse struct { // MetricResults: Metric results. @@ -5310,6 +5459,61 @@ func (s *GoogleCloudDiscoveryengineV1alphaCompletionInfo) MarshalJSON() ([]byte, return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaCompletionSuggestion: Autocomplete +// suggestions that are imported from Customer. +type GoogleCloudDiscoveryengineV1alphaCompletionSuggestion struct { + // AlternativePhrases: Alternative matching phrases for this suggestion. + AlternativePhrases []string `json:"alternativePhrases,omitempty"` + // Frequency: Frequency of this suggestion. Will be used to rank suggestions + // when score is not available. + Frequency int64 `json:"frequency,omitempty,string"` + // GlobalScore: Global score of this suggestion. Control how this suggestion + // would be scored / ranked. + GlobalScore float64 `json:"globalScore,omitempty"` + // GroupId: If two suggestions have the same groupId, they will not be returned + // together. Instead the one ranked higher will be returned. This can be used + // to deduplicate semantically identical suggestions. + GroupId string `json:"groupId,omitempty"` + // GroupScore: The score of this suggestion within its group. + GroupScore float64 `json:"groupScore,omitempty"` + // LanguageCode: BCP-47 language code of this suggestion. + LanguageCode string `json:"languageCode,omitempty"` + // Suggestion: Required. The suggestion text. + Suggestion string `json:"suggestion,omitempty"` + // ForceSendFields is a list of field names (e.g. "AlternativePhrases") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AlternativePhrases") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaCompletionSuggestion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaCompletionSuggestion + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1alphaCompletionSuggestion) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaCompletionSuggestion + var s1 struct { + GlobalScore gensupport.JSONFloat64 `json:"globalScore"` + GroupScore gensupport.JSONFloat64 `json:"groupScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.GlobalScore = float64(s1.GlobalScore) + s.GroupScore = float64(s1.GroupScore) + return nil +} + // GoogleCloudDiscoveryengineV1alphaCondition: Defines circumstances to be // checked before allowing a behavior type GoogleCloudDiscoveryengineV1alphaCondition struct { @@ -6419,7 +6623,7 @@ type GoogleCloudDiscoveryengineV1alphaDocumentContent struct { RawBytes string `json:"rawBytes,omitempty"` // Uri: The URI of the content. Only Cloud Storage URIs (e.g. // `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 - // MB for text-based formats, 100 MB for other formats. + // MB for text-based formats, 200 MB for other formats. Uri string `json:"uri,omitempty"` // ForceSendFields is a list of field names (e.g. "MimeType") to // unconditionally include in API requests. By default, fields with empty or @@ -7752,6 +7956,118 @@ func (s *GoogleCloudDiscoveryengineV1alphaIdpConfigExternalIdpConfig) MarshalJSO return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata: +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest: Request +// message for CompletionService.ImportCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest struct { + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1alphaBigQuerySource `json:"bigquerySource,omitempty"` + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` + // GcsSource: Cloud Storage location for the input content. + GcsSource *GoogleCloudDiscoveryengineV1alphaGcsSource `json:"gcsSource,omitempty"` + // InlineSource: The Inline source for suggestion entries. + InlineSource *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource `json:"inlineSource,omitempty"` + // ForceSendFields is a list of field names (e.g. "BigquerySource") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BigquerySource") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSour +// ce: The inline source for CompletionSuggestions. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource struct { + // Suggestions: Required. A list of all denylist entries to import. Max of 1000 + // items. + Suggestions []*GoogleCloudDiscoveryengineV1alphaCompletionSuggestion `json:"suggestions,omitempty"` + // ForceSendFields is a list of field names (e.g. "Suggestions") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Suggestions") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequestInlineSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse: +// Response of the CompletionService.ImportCompletionSuggestions method. If the +// long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata: Metadata related // to the progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -8882,6 +9198,64 @@ func (s *GoogleCloudDiscoveryengineV1alphaProvisionProjectRequest) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata: +// Metadata related to the progress of the PurgeCompletionSuggestions +// operation. This is returned by the google.longrunning.Operation.metadata +// field. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest: Request +// message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest struct { +} + +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse: +// Response message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // PurgeSucceeded: Whether the completion suggestions were successfully purged. + PurgeSucceeded bool `json:"purgeSucceeded,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata: Metadata related to // the progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -9714,7 +10088,7 @@ type GoogleCloudDiscoveryengineV1alphaRequirement struct { // ThresholdBindings: A list of threshold bindings to be used in `condition`. ThresholdBindings []*GoogleCloudDiscoveryengineV1alphaRequirementThresholdBinding `json:"thresholdBindings,omitempty"` // Type: The requirement type, used as an identifier. Must be unique. The type - // should prefix with service name to avoid possible collision. It's encoraged + // should prefix with service name to avoid possible collision. It's encouraged // to use natural hierarchical grouping for similar requirements. Examples: * // `library.googleapis.com/books/min_available_books` * // `discoveryengine.googleapis.com/media_rec/recommended_for_you/conversion_rate @@ -10058,9 +10432,25 @@ type GoogleCloudDiscoveryengineV1alphaSearchRequest struct { // (https://cloud.google.com/apis/design/standard_fields). If set, then results // will be boosted based on the region_code provided. RegionCode string `json:"regionCode,omitempty"` + // RelevanceThreshold: The relevance threshold of the search results. Default + // to Google defined threshold, leveraging a balance of precision and recall to + // deliver both highly accurate results and comprehensive coverage of relevant + // information. + // + // Possible values: + // "RELEVANCE_THRESHOLD_UNSPECIFIED" - Default value. In this case, server + // behavior defaults to Google defined threshold. + // "LOWEST" - Lowest relevance threshold. + // "LOW" - Low relevance threshold. + // "MEDIUM" - Medium relevance threshold. + // "HIGH" - High relevance threshold. + RelevanceThreshold string `json:"relevanceThreshold,omitempty"` // SafeSearch: Whether to turn on safe search. This is only supported for // website search. SafeSearch bool `json:"safeSearch,omitempty"` + // SearchAsYouTypeSpec: Search as you type configuration. Only supported for + // the IndustryVertical.MEDIA vertical. + SearchAsYouTypeSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec `json:"searchAsYouTypeSpec,omitempty"` // SpellCorrectionSpec: The spell correction specification that specifies the // mode under which spell correction takes effect. SpellCorrectionSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` @@ -10721,8 +11111,10 @@ type GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec struct { FacetKey *GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` // Limit: Maximum facet values that are returned for this facet. If // unspecified, defaults to 20. The maximum allowed value is 300. Values above - // 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is - // returned. + // 300 are coerced to 300. For aggregation in healthcare search, when the + // [FacetKey.key] is "healthcare_aggregation_key", the limit will be overridden + // to 10,000 internally, regardless of the value set here. If this field is + // negative, an `INVALID_ARGUMENT` is returned. Limit int64 `json:"limit,omitempty"` // ForceSendFields is a list of field names (e.g. "EnableDynamicPosition") to // unconditionally include in API requests. By default, fields with empty or @@ -10860,9 +11252,38 @@ func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec) Marsh return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec: The -// specification for query spell correction. -type GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec struct { +// GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec: +// Specification for search as you type in search requests. +type GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec struct { + // Condition: The condition under which search as you type should occur. + // Default to Condition.DISABLED. + // + // Possible values: + // "CONDITION_UNSPECIFIED" - Server behavior defaults to Condition.DISABLED. + // "DISABLED" - Disables Search As You Type. + // "ENABLED" - Enables Search As You Type. + Condition string `json:"condition,omitempty"` + // ForceSendFields is a list of field names (e.g. "Condition") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Condition") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec: The +// specification for query spell correction. +type GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec struct { // Mode: The mode under which spell correction replaces the original search // query. Defaults to Mode.AUTO. // @@ -13585,6 +14006,65 @@ func (s *GoogleCloudDiscoveryengineV1betaEngineSearchEngineConfig) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata: +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse: +// Response of the CompletionService.ImportCompletionSuggestions method. If the +// long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata related to // the progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -17134,9 +17614,9 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetProcessedDocu // // data store. // -// "PNG_CONVERTED_DOCUMENT" - Returns the converted PNG Image bytes if +// "IMAGE_CONVERTED_DOCUMENT" - Returns the converted Image bytes (as JPEG or // -// available. +// PNG) if available. func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetProcessedDocumentCall) ProcessedDocumentType(processedDocumentType string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetProcessedDocumentCall { c.urlParams_.Set("processedDocumentType", processedDocumentType) return c @@ -18172,13 +18652,267 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Imports CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to import customer +// autocomplete suggestions. Follows pattern +// `projects/*/locations/*/collections/*/dataStores/*`. +func (r *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService) Import(parent string, googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest = googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/completionSuggestions:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.import" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18210,104 +18944,79 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt return ret, nil } -type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the request. If -// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// Purge: Permanently deletes all CompletionSuggestions for a DataStore. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list filter. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list page -// size. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list page -// token. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: The parent data store resource name for which to purge completion +// suggestions. Follows pattern +// projects/*/locations/*/collections/*/dataStores/*. +func (r *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { + c := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest = googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/completionSuggestions:purge") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.purge" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -18326,7 +19035,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -18339,27 +19048,6 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - type ProjectsLocationsCollectionsDataStoresControlsCreateCall struct { s *Service parent string @@ -30620,9 +31308,9 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetProcessedDocumentCall) P // // data store. // -// "PNG_CONVERTED_DOCUMENT" - Returns the converted PNG Image bytes if +// "IMAGE_CONVERTED_DOCUMENT" - Returns the converted Image bytes (as JPEG or // -// available. +// PNG) if available. func (c *ProjectsLocationsDataStoresBranchesDocumentsGetProcessedDocumentCall) ProcessedDocumentType(processedDocumentType string) *ProjectsLocationsDataStoresBranchesDocumentsGetProcessedDocumentCall { c.urlParams_.Set("processedDocumentType", processedDocumentType) return c @@ -31846,6 +32534,214 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx contex } } +type ProjectsLocationsDataStoresCompletionSuggestionsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Imports CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to import customer +// autocomplete suggestions. Follows pattern +// `projects/*/locations/*/collections/*/dataStores/*`. +func (r *ProjectsLocationsDataStoresCompletionSuggestionsService) Import(parent string, googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsRequest) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c := &ProjectsLocationsDataStoresCompletionSuggestionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest = googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportcompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/completionSuggestions:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.completionSuggestions.import" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Purge: Permanently deletes all CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to purge completion +// suggestions. Follows pattern +// projects/*/locations/*/collections/*/dataStores/*. +func (r *ProjectsLocationsDataStoresCompletionSuggestionsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsRequest) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c := &ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest = googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgecompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/completionSuggestions:purge") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.completionSuggestions.purge" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsDataStoresControlsCreateCall struct { s *Service parent string diff --git a/discoveryengine/v1beta/discoveryengine-api.json b/discoveryengine/v1beta/discoveryengine-api.json index 337a28801ef..d2340120752 100644 --- a/discoveryengine/v1beta/discoveryengine-api.json +++ b/discoveryengine/v1beta/discoveryengine-api.json @@ -800,6 +800,66 @@ } } }, + "completionSuggestions": { + "methods": { + "import": { + "description": "Imports CompletionSuggestions for a DataStore.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/completionSuggestions:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/completionSuggestions:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Permanently deletes all CompletionSuggestions for a DataStore.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/completionSuggestions:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/completionSuggestions:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "controls": { "methods": { "create": { @@ -4242,6 +4302,66 @@ } } }, + "completionSuggestions": { + "methods": { + "import": { + "description": "Imports CompletionSuggestions for a DataStore.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/completionSuggestions:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.completionSuggestions.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/completionSuggestions:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Permanently deletes all CompletionSuggestions for a DataStore.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/completionSuggestions:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.completionSuggestions.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/completionSuggestions:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "controls": { "methods": { "create": { @@ -5989,7 +6109,7 @@ } } }, - "revision": "20240612", + "revision": "20240617", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -6916,6 +7036,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1ImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata", @@ -7152,6 +7317,41 @@ "properties": {}, "type": "object" }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the PurgeCompletionSuggestions operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse": { + "description": "Response message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse", + "properties": { + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + }, + "purgeSucceeded": { + "description": "Whether the completion suggestions were successfully purged.", + "type": "boolean" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata", @@ -7453,14 +7653,16 @@ "ADVERSARIAL_QUERY_IGNORED", "NON_ANSWER_SEEKING_QUERY_IGNORED", "OUT_OF_DOMAIN_QUERY_IGNORED", - "POTENTIAL_POLICY_VIOLATION" + "POTENTIAL_POLICY_VIOLATION", + "NO_RELEVANT_CONTENT" ], "enumDescriptions": [ "Default value. The answer skipped reason is not specified.", "The adversarial query ignored case.", "The non-answer seeking query ignored case.", "The out-of-domain query ignored case. Google skips the answer if there are no high-relevance search results.", - "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic." + "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic.", + "The no relevant content case. Google skips the answer if there is no relevant content in the retrieved search results." ], "type": "string" }, @@ -9050,6 +9252,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata", @@ -9326,6 +9573,41 @@ "properties": {}, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the PurgeCompletionSuggestions operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse": { + "description": "Response message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse", + "properties": { + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + }, + "purgeSucceeded": { + "description": "Whether the completion suggestions were successfully purged.", + "type": "boolean" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata", @@ -9942,14 +10224,16 @@ "ADVERSARIAL_QUERY_IGNORED", "NON_ANSWER_SEEKING_QUERY_IGNORED", "OUT_OF_DOMAIN_QUERY_IGNORED", - "POTENTIAL_POLICY_VIOLATION" + "POTENTIAL_POLICY_VIOLATION", + "NO_RELEVANT_CONTENT" ], "enumDescriptions": [ "Default value. The answer skipped reason is not specified.", "The adversarial query ignored case.", "The non-answer seeking query ignored case.", "The out-of-domain query ignored case. Google skips the answer if there are no high-relevance search results.", - "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic." + "The potential policy violation case. Google skips the answer if there is a potential policy violation detected. This includes content that may be violent or toxic.", + "The no relevant content case. Google skips the answer if there is no relevant content in the retrieved search results." ], "type": "string" }, @@ -11280,6 +11564,47 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaCompletionSuggestion": { + "description": "Autocomplete suggestions that are imported from Customer.", + "id": "GoogleCloudDiscoveryengineV1betaCompletionSuggestion", + "properties": { + "alternativePhrases": { + "description": "Alternative matching phrases for this suggestion.", + "items": { + "type": "string" + }, + "type": "array" + }, + "frequency": { + "description": "Frequency of this suggestion. Will be used to rank suggestions when score is not available.", + "format": "int64", + "type": "string" + }, + "globalScore": { + "description": "Global score of this suggestion. Control how this suggestion would be scored / ranked.", + "format": "double", + "type": "number" + }, + "groupId": { + "description": "If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.", + "type": "string" + }, + "groupScore": { + "description": "The score of this suggestion within its group.", + "format": "double", + "type": "number" + }, + "languageCode": { + "description": "BCP-47 language code of this suggestion.", + "type": "string" + }, + "suggestion": { + "description": "Required. The suggestion text.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaCondition": { "description": "Defines circumstances to be checked before allowing a behavior", "id": "GoogleCloudDiscoveryengineV1betaCondition", @@ -12043,7 +12368,7 @@ "type": "string" }, "uri": { - "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 100 MB for other formats.", + "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.", "type": "string" } }, @@ -12543,6 +12868,88 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata": { + "description": "Metadata related to the progress of the ImportCompletionSuggestions operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of CompletionSuggestions that failed to be imported.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of CompletionSuggestions successfully imported.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest": { + "description": "Request message for CompletionService.ImportCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest", + "properties": { + "bigquerySource": { + "$ref": "GoogleCloudDiscoveryengineV1betaBigQuerySource", + "description": "BigQuery input source." + }, + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "gcsSource": { + "$ref": "GoogleCloudDiscoveryengineV1betaGcsSource", + "description": "Cloud Storage location for the input content." + }, + "inlineSource": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource", + "description": "The Inline source for suggestion entries." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource": { + "description": "The inline source for CompletionSuggestions.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource", + "properties": { + "suggestions": { + "description": "Required. A list of all denylist entries to import. Max of 1000 items.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaCompletionSuggestion" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse": { + "description": "Response of the CompletionService.ImportCompletionSuggestions method. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.", + "id": "GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse", + "properties": { + "errorConfig": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportErrorConfig", + "description": "The desired location of errors incurred during the Import." + }, + "errorSamples": { + "description": "A sample of errors encountered while processing the request.", + "items": { + "$ref": "GoogleRpcStatus" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata", @@ -13253,6 +13660,12 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest": { + "description": "Request message for CompletionService.PurgeCompletionSuggestions method.", + "id": "GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest", + "properties": {}, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata": { "description": "Metadata related to the progress of the PurgeDocuments operation. This will be returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata", @@ -14098,7 +14511,7 @@ "description": "Required. The facet key specification." }, "limit": { - "description": "Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "description": "Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. For aggregation in healthcare search, when the [FacetKey.key] is \"healthcare_aggregation_key\", the limit will be overridden to 10,000 internally, regardless of the value set here. If this field is negative, an `INVALID_ARGUMENT` is returned.", "format": "int32", "type": "integer" } diff --git a/discoveryengine/v1beta/discoveryengine-gen.go b/discoveryengine/v1beta/discoveryengine-gen.go index a24d0462572..1680ab6f214 100644 --- a/discoveryengine/v1beta/discoveryengine-gen.go +++ b/discoveryengine/v1beta/discoveryengine-gen.go @@ -241,6 +241,7 @@ type ProjectsLocationsCollectionsDataConnectorOperationsService struct { func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { rs := &ProjectsLocationsCollectionsDataStoresService{s: s} rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.CompletionSuggestions = NewProjectsLocationsCollectionsDataStoresCompletionSuggestionsService(s) rs.Controls = NewProjectsLocationsCollectionsDataStoresControlsService(s) rs.Conversations = NewProjectsLocationsCollectionsDataStoresConversationsService(s) rs.CustomModels = NewProjectsLocationsCollectionsDataStoresCustomModelsService(s) @@ -260,6 +261,8 @@ type ProjectsLocationsCollectionsDataStoresService struct { Branches *ProjectsLocationsCollectionsDataStoresBranchesService + CompletionSuggestions *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService + Controls *ProjectsLocationsCollectionsDataStoresControlsService Conversations *ProjectsLocationsCollectionsDataStoresConversationsService @@ -316,6 +319,15 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsCollectionsDataStoresCompletionSuggestionsService(s *Service) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService { + rs := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService struct { + s *Service +} + func NewProjectsLocationsCollectionsDataStoresControlsService(s *Service) *ProjectsLocationsCollectionsDataStoresControlsService { rs := &ProjectsLocationsCollectionsDataStoresControlsService{s: s} return rs @@ -580,6 +592,7 @@ type ProjectsLocationsCollectionsOperationsService struct { func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) + rs.CompletionSuggestions = NewProjectsLocationsDataStoresCompletionSuggestionsService(s) rs.Controls = NewProjectsLocationsDataStoresControlsService(s) rs.Conversations = NewProjectsLocationsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsDataStoresModelsService(s) @@ -598,6 +611,8 @@ type ProjectsLocationsDataStoresService struct { Branches *ProjectsLocationsDataStoresBranchesService + CompletionSuggestions *ProjectsLocationsDataStoresCompletionSuggestionsService + Controls *ProjectsLocationsDataStoresControlsService Conversations *ProjectsLocationsDataStoresConversationsService @@ -652,6 +667,15 @@ type ProjectsLocationsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresCompletionSuggestionsService(s *Service) *ProjectsLocationsDataStoresCompletionSuggestionsService { + rs := &ProjectsLocationsDataStoresCompletionSuggestionsService{s: s} + return rs +} + +type ProjectsLocationsDataStoresCompletionSuggestionsService struct { + s *Service +} + func NewProjectsLocationsDataStoresControlsService(s *Service) *ProjectsLocationsDataStoresControlsService { rs := &ProjectsLocationsDataStoresControlsService{s: s} return rs @@ -2144,6 +2168,64 @@ func (s *GoogleCloudDiscoveryengineV1EngineSearchEngineConfig) MarshalJSON() ([] return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata: Metadata +// related to the progress of the ImportCompletionSuggestions operation. This +// will be returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse: Response of +// the CompletionService.ImportCompletionSuggestions method. If the long +// running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1ImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1ImportDocumentsMetadata: Metadata related to the // progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -2438,6 +2520,58 @@ func (s *GoogleCloudDiscoveryengineV1ProjectServiceTerms) MarshalJSON() ([]byte, type GoogleCloudDiscoveryengineV1ProvisionProjectMetadata struct { } +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata: Metadata +// related to the progress of the PurgeCompletionSuggestions operation. This is +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse: Response +// message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // PurgeSucceeded: Whether the completion suggestions were successfully purged. + PurgeSucceeded bool `json:"purgeSucceeded,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata: Metadata related to the // progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -2828,6 +2962,8 @@ type GoogleCloudDiscoveryengineV1alphaAnswer struct { // "POTENTIAL_POLICY_VIOLATION" - The potential policy violation case. Google // skips the answer if there is a potential policy violation detected. This // includes content that may be violent or toxic. + // "NO_RELEVANT_CONTENT" - The no relevant content case. Google skips the + // answer if there is no relevant content in the retrieved search results. AnswerSkippedReasons []string `json:"answerSkippedReasons,omitempty"` // AnswerText: The textual answer. AnswerText string `json:"answerText,omitempty"` @@ -4920,6 +5056,65 @@ func (s *GoogleCloudDiscoveryengineV1alphaIdpConfigExternalIdpConfig) MarshalJSO return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata: +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of CompletionSuggestions that failed to be imported. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of CompletionSuggestions successfully imported. + SuccessCount int64 `json:"successCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse: +// Response of the CompletionService.ImportCompletionSuggestions method. If the +// long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata: Metadata related // to the progress of the ImportDocuments operation. This is returned by the // google.longrunning.Operation.metadata field. @@ -5269,6 +5464,59 @@ func (s *GoogleCloudDiscoveryengineV1alphaProjectServiceTerms) MarshalJSON() ([] type GoogleCloudDiscoveryengineV1alphaProvisionProjectMetadata struct { } +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata: +// Metadata related to the progress of the PurgeCompletionSuggestions +// operation. This is returned by the google.longrunning.Operation.metadata +// field. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse: +// Response message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // PurgeSucceeded: Whether the completion suggestions were successfully purged. + PurgeSucceeded bool `json:"purgeSucceeded,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata: Metadata related to // the progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -6047,6 +6295,8 @@ type GoogleCloudDiscoveryengineV1betaAnswer struct { // "POTENTIAL_POLICY_VIOLATION" - The potential policy violation case. Google // skips the answer if there is a potential policy violation detected. This // includes content that may be violent or toxic. + // "NO_RELEVANT_CONTENT" - The no relevant content case. Google skips the + // answer if there is no relevant content in the retrieved search results. AnswerSkippedReasons []string `json:"answerSkippedReasons,omitempty"` // AnswerText: The textual answer. AnswerText string `json:"answerText,omitempty"` @@ -7899,6 +8149,61 @@ func (s *GoogleCloudDiscoveryengineV1betaCompletionInfo) MarshalJSON() ([]byte, return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1betaCompletionSuggestion: Autocomplete +// suggestions that are imported from Customer. +type GoogleCloudDiscoveryengineV1betaCompletionSuggestion struct { + // AlternativePhrases: Alternative matching phrases for this suggestion. + AlternativePhrases []string `json:"alternativePhrases,omitempty"` + // Frequency: Frequency of this suggestion. Will be used to rank suggestions + // when score is not available. + Frequency int64 `json:"frequency,omitempty,string"` + // GlobalScore: Global score of this suggestion. Control how this suggestion + // would be scored / ranked. + GlobalScore float64 `json:"globalScore,omitempty"` + // GroupId: If two suggestions have the same groupId, they will not be returned + // together. Instead the one ranked higher will be returned. This can be used + // to deduplicate semantically identical suggestions. + GroupId string `json:"groupId,omitempty"` + // GroupScore: The score of this suggestion within its group. + GroupScore float64 `json:"groupScore,omitempty"` + // LanguageCode: BCP-47 language code of this suggestion. + LanguageCode string `json:"languageCode,omitempty"` + // Suggestion: Required. The suggestion text. + Suggestion string `json:"suggestion,omitempty"` + // ForceSendFields is a list of field names (e.g. "AlternativePhrases") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AlternativePhrases") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaCompletionSuggestion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCompletionSuggestion + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1betaCompletionSuggestion) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaCompletionSuggestion + var s1 struct { + GlobalScore gensupport.JSONFloat64 `json:"globalScore"` + GroupScore gensupport.JSONFloat64 `json:"groupScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.GlobalScore = float64(s1.GlobalScore) + s.GroupScore = float64(s1.GroupScore) + return nil +} + // GoogleCloudDiscoveryengineV1betaCondition: Defines circumstances to be // checked before allowing a behavior type GoogleCloudDiscoveryengineV1betaCondition struct { @@ -8917,7 +9222,7 @@ type GoogleCloudDiscoveryengineV1betaDocumentContent struct { RawBytes string `json:"rawBytes,omitempty"` // Uri: The URI of the content. Only Cloud Storage URIs (e.g. // `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 - // MB for text-based formats, 100 MB for other formats. + // MB for text-based formats, 200 MB for other formats. Uri string `json:"uri,omitempty"` // ForceSendFields is a list of field names (e.g. "MimeType") to // unconditionally include in API requests. By default, fields with empty or @@ -9675,18 +9980,17 @@ func (s *GoogleCloudDiscoveryengineV1betaGroundingFact) MarshalJSON() ([]byte, e return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata related to -// the progress of the ImportDocuments operation. This is returned by the +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata: +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the // google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata struct { // CreateTime: Operation create time. CreateTime string `json:"createTime,omitempty"` - // FailureCount: Count of entries that encountered errors while processing. + // FailureCount: Count of CompletionSuggestions that failed to be imported. FailureCount int64 `json:"failureCount,omitempty,string"` - // SuccessCount: Count of entries that were processed successfully. + // SuccessCount: Count of CompletionSuggestions successfully imported. SuccessCount int64 `json:"successCount,omitempty,string"` - // TotalCount: Total count of entries that were processed. - TotalCount int64 `json:"totalCount,omitempty,string"` // UpdateTime: Operation last update time. If the operation is done, this is // also the finish time. UpdateTime string `json:"updateTime,omitempty"` @@ -9703,53 +10007,166 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsRequest: Request message for -// Import methods. -type GoogleCloudDiscoveryengineV1betaImportDocumentsRequest struct { - // AlloyDbSource: AlloyDB input source. - AlloyDbSource *GoogleCloudDiscoveryengineV1betaAlloyDbSource `json:"alloyDbSource,omitempty"` - // AutoGenerateIds: Whether to automatically generate IDs for the documents if - // absent. If set to `true`, Document.ids are automatically generated based on - // the hash of the payload, where IDs may not be consistent during multiple - // imports. In which case ReconciliationMode.FULL is highly recommended to - // avoid duplicate contents. If unset or set to `false`, Document.ids have to - // be specified using id_field, otherwise, documents without IDs fail to be - // imported. Supported data sources: * GcsSource. GcsSource.data_schema must be - // `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * - // BigQuerySource. BigQuerySource.data_schema must be `custom` or `csv`. - // Otherwise, an INVALID_ARGUMENT error is thrown. * SpannerSource. * - // CloudSqlSource. * FirestoreSource. * BigtableSource. - AutoGenerateIds bool `json:"autoGenerateIds,omitempty"` +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest: Request +// message for CompletionService.ImportCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest struct { // BigquerySource: BigQuery input source. BigquerySource *GoogleCloudDiscoveryengineV1betaBigQuerySource `json:"bigquerySource,omitempty"` - // BigtableSource: Cloud Bigtable input source. - BigtableSource *GoogleCloudDiscoveryengineV1betaBigtableSource `json:"bigtableSource,omitempty"` - // CloudSqlSource: Cloud SQL input source. - CloudSqlSource *GoogleCloudDiscoveryengineV1betaCloudSqlSource `json:"cloudSqlSource,omitempty"` // ErrorConfig: The desired location of errors incurred during the Import. ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` - // FhirStoreSource: FhirStore input source. - FhirStoreSource *GoogleCloudDiscoveryengineV1betaFhirStoreSource `json:"fhirStoreSource,omitempty"` - // FirestoreSource: Firestore input source. - FirestoreSource *GoogleCloudDiscoveryengineV1betaFirestoreSource `json:"firestoreSource,omitempty"` // GcsSource: Cloud Storage location for the input content. GcsSource *GoogleCloudDiscoveryengineV1betaGcsSource `json:"gcsSource,omitempty"` - // IdField: The field indicates the ID field or column to be used as unique IDs - // of the documents. For GcsSource it is the key of the JSON field. For - // instance, `my_id` for JSON `{"my_id": "some_uuid"}`. For others, it may be - // the column name of the table where the unique ids are stored. The values of - // the JSON field or the table column are used as the Document.ids. The JSON - // field or the table column must be of string type, and the values must be set - // as valid strings conform to RFC-1034 (https://tools.ietf.org/html/rfc1034) - // with 1-63 characters. Otherwise, documents without valid IDs fail to be - // imported. Only set this field when auto_generate_ids is unset or set as - // `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is unset, a - // default value `_id` is used when importing from the allowed data sources. + // InlineSource: The Inline source for suggestion entries. + InlineSource *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource `json:"inlineSource,omitempty"` + // ForceSendFields is a list of field names (e.g. "BigquerySource") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BigquerySource") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSourc +// e: The inline source for CompletionSuggestions. +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource struct { + // Suggestions: Required. A list of all denylist entries to import. Max of 1000 + // items. + Suggestions []*GoogleCloudDiscoveryengineV1betaCompletionSuggestion `json:"suggestions,omitempty"` + // ForceSendFields is a list of field names (e.g. "Suggestions") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Suggestions") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequestInlineSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse: +// Response of the CompletionService.ImportCompletionSuggestions method. If the +// long running operation is done, this message is returned by the +// google.longrunning.Operations.response field if the operation is successful. +type GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse struct { + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ErrorConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata related to +// the progress of the ImportDocuments operation. This is returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + // FailureCount: Count of entries that encountered errors while processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + // TotalCount: Total count of entries that were processed. + TotalCount int64 `json:"totalCount,omitempty,string"` + // UpdateTime: Operation last update time. If the operation is done, this is + // also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsRequest: Request message for +// Import methods. +type GoogleCloudDiscoveryengineV1betaImportDocumentsRequest struct { + // AlloyDbSource: AlloyDB input source. + AlloyDbSource *GoogleCloudDiscoveryengineV1betaAlloyDbSource `json:"alloyDbSource,omitempty"` + // AutoGenerateIds: Whether to automatically generate IDs for the documents if + // absent. If set to `true`, Document.ids are automatically generated based on + // the hash of the payload, where IDs may not be consistent during multiple + // imports. In which case ReconciliationMode.FULL is highly recommended to + // avoid duplicate contents. If unset or set to `false`, Document.ids have to + // be specified using id_field, otherwise, documents without IDs fail to be + // imported. Supported data sources: * GcsSource. GcsSource.data_schema must be + // `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * + // BigQuerySource. BigQuerySource.data_schema must be `custom` or `csv`. + // Otherwise, an INVALID_ARGUMENT error is thrown. * SpannerSource. * + // CloudSqlSource. * FirestoreSource. * BigtableSource. + AutoGenerateIds bool `json:"autoGenerateIds,omitempty"` + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1betaBigQuerySource `json:"bigquerySource,omitempty"` + // BigtableSource: Cloud Bigtable input source. + BigtableSource *GoogleCloudDiscoveryengineV1betaBigtableSource `json:"bigtableSource,omitempty"` + // CloudSqlSource: Cloud SQL input source. + CloudSqlSource *GoogleCloudDiscoveryengineV1betaCloudSqlSource `json:"cloudSqlSource,omitempty"` + // ErrorConfig: The desired location of errors incurred during the Import. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + // FhirStoreSource: FhirStore input source. + FhirStoreSource *GoogleCloudDiscoveryengineV1betaFhirStoreSource `json:"fhirStoreSource,omitempty"` + // FirestoreSource: Firestore input source. + FirestoreSource *GoogleCloudDiscoveryengineV1betaFirestoreSource `json:"firestoreSource,omitempty"` + // GcsSource: Cloud Storage location for the input content. + GcsSource *GoogleCloudDiscoveryengineV1betaGcsSource `json:"gcsSource,omitempty"` + // IdField: The field indicates the ID field or column to be used as unique IDs + // of the documents. For GcsSource it is the key of the JSON field. For + // instance, `my_id` for JSON `{"my_id": "some_uuid"}`. For others, it may be + // the column name of the table where the unique ids are stored. The values of + // the JSON field or the table column are used as the Document.ids. The JSON + // field or the table column must be of string type, and the values must be set + // as valid strings conform to RFC-1034 (https://tools.ietf.org/html/rfc1034) + // with 1-63 characters. Otherwise, documents without valid IDs fail to be + // imported. Only set this field when auto_generate_ids is unset or set as + // `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is unset, a + // default value `_id` is used when importing from the allowed data sources. // Supported data sources: * GcsSource. GcsSource.data_schema must be `custom` // or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * BigQuerySource. // BigQuerySource.data_schema must be `custom` or `csv`. Otherwise, an @@ -10711,6 +11128,11 @@ func (s *GoogleCloudDiscoveryengineV1betaProvisionProjectRequest) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest: Request +// message for CompletionService.PurgeCompletionSuggestions method. +type GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest struct { +} + // GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata: Metadata related to // the progress of the PurgeDocuments operation. This will be returned by the // google.longrunning.Operation.metadata field. @@ -12096,8 +12518,10 @@ type GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec struct { FacetKey *GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` // Limit: Maximum facet values that are returned for this facet. If // unspecified, defaults to 20. The maximum allowed value is 300. Values above - // 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is - // returned. + // 300 are coerced to 300. For aggregation in healthcare search, when the + // [FacetKey.key] is "healthcare_aggregation_key", the limit will be overridden + // to 10,000 internally, regardless of the value set here. If this field is + // negative, an `INVALID_ARGUMENT` is returned. Limit int64 `json:"limit,omitempty"` // ForceSendFields is a list of field names (e.g. "EnableDynamicPosition") to // unconditionally include in API requests. By default, fields with empty or @@ -16337,13 +16761,267 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the request. If +// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list filter. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list page +// size. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list page +// token. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Imports CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to import customer +// autocomplete suggestions. Follows pattern +// `projects/*/locations/*/collections/*/dataStores/*`. +func (r *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService) Import(parent string, googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest = googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/completionSuggestions:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.import" call. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16375,104 +17053,79 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt return ret, nil } -type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the request. If -// the server doesn't support this method, it returns `UNIMPLEMENTED`. +// Purge: Permanently deletes all CompletionSuggestions for a DataStore. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list filter. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list page -// size. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list page -// token. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: The parent data store resource name for which to purge completion +// suggestions. Follows pattern +// projects/*/locations/*/collections/*/dataStores/*. +func (r *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsService) Purge(parent string, googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { + c := &ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest = googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/completionSuggestions:purge") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completionSuggestions.purge" call. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsDataStoresCompletionSuggestionsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -16491,7 +17144,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -16504,27 +17157,6 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - type ProjectsLocationsCollectionsDataStoresControlsCreateCall struct { s *Service parent string @@ -29261,6 +29893,214 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx contex } } +type ProjectsLocationsDataStoresCompletionSuggestionsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Imports CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to import customer +// autocomplete suggestions. Follows pattern +// `projects/*/locations/*/collections/*/dataStores/*`. +func (r *ProjectsLocationsDataStoresCompletionSuggestionsService) Import(parent string, googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsRequest) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c := &ProjectsLocationsDataStoresCompletionSuggestionsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest = googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompletionSuggestionsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportcompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/completionSuggestions:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.completionSuggestions.import" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Purge: Permanently deletes all CompletionSuggestions for a DataStore. +// +// - parent: The parent data store resource name for which to purge completion +// suggestions. Follows pattern +// projects/*/locations/*/collections/*/dataStores/*. +func (r *ProjectsLocationsDataStoresCompletionSuggestionsService) Purge(parent string, googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest *GoogleCloudDiscoveryengineV1betaPurgeCompletionSuggestionsRequest) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c := &ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest = googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgecompletionsuggestionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/completionSuggestions:purge") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.completionSuggestions.purge" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresCompletionSuggestionsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsDataStoresControlsCreateCall struct { s *Service parent string diff --git a/displayvideo/v2/displayvideo-api.json b/displayvideo/v2/displayvideo-api.json index 4a8c93a84d3..0214ede2934 100644 --- a/displayvideo/v2/displayvideo-api.json +++ b/displayvideo/v2/displayvideo-api.json @@ -4869,7 +4869,7 @@ "type": "string" }, "targetingType": { - "description": "Required. Identifies the type of this assigned targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`", + "description": "Required. Identifies the type of this assigned targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * `TARGETING_TYPE_KEYWORD`", "enum": [ "TARGETING_TYPE_UNSPECIFIED", "TARGETING_TYPE_CHANNEL", @@ -5026,7 +5026,7 @@ "type": "string" }, "targetingType": { - "description": "Required. Identifies the type of assigned targeting options to list. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`", + "description": "Required. Identifies the type of assigned targeting options to list. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * `TARGETING_TYPE_KEYWORD`", "enum": [ "TARGETING_TYPE_UNSPECIFIED", "TARGETING_TYPE_CHANNEL", @@ -9267,7 +9267,7 @@ } } }, - "revision": "20240530", + "revision": "20240618", "rootUrl": "https://displayvideo.googleapis.com/", "schemas": { "ActivateManualTriggerRequest": { diff --git a/displayvideo/v2/displayvideo-gen.go b/displayvideo/v2/displayvideo-gen.go index f7f797acd93..b8a2412b5d4 100644 --- a/displayvideo/v2/displayvideo-gen.go +++ b/displayvideo/v2/displayvideo-gen.go @@ -26114,7 +26114,8 @@ type AdvertisersTargetingTypesAssignedTargetingOptionsGetCall struct { // Supported targeting types: * `TARGETING_TYPE_CHANNEL` * // `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * // `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * -// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`. +// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * +// `TARGETING_TYPE_KEYWORD`. func (r *AdvertisersTargetingTypesAssignedTargetingOptionsService) Get(advertiserId int64, targetingType string, assignedTargetingOptionId string) *AdvertisersTargetingTypesAssignedTargetingOptionsGetCall { c := &AdvertisersTargetingTypesAssignedTargetingOptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.advertiserId = advertiserId @@ -26232,7 +26233,8 @@ type AdvertisersTargetingTypesAssignedTargetingOptionsListCall struct { // Supported targeting types: * `TARGETING_TYPE_CHANNEL` * // `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * // `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * -// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`. +// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * +// `TARGETING_TYPE_KEYWORD`. func (r *AdvertisersTargetingTypesAssignedTargetingOptionsService) List(advertiserId int64, targetingType string) *AdvertisersTargetingTypesAssignedTargetingOptionsListCall { c := &AdvertisersTargetingTypesAssignedTargetingOptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.advertiserId = advertiserId diff --git a/displayvideo/v3/displayvideo-api.json b/displayvideo/v3/displayvideo-api.json index 9b10bb2a2a3..f320f0a9856 100644 --- a/displayvideo/v3/displayvideo-api.json +++ b/displayvideo/v3/displayvideo-api.json @@ -5189,7 +5189,7 @@ "type": "string" }, "targetingType": { - "description": "Required. Identifies the type of this assigned targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`", + "description": "Required. Identifies the type of this assigned targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * `TARGETING_TYPE_KEYWORD`", "enum": [ "TARGETING_TYPE_UNSPECIFIED", "TARGETING_TYPE_CHANNEL", @@ -5346,7 +5346,7 @@ "type": "string" }, "targetingType": { - "description": "Required. Identifies the type of assigned targeting options to list. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`", + "description": "Required. Identifies the type of assigned targeting options to list. Supported targeting types: * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * `TARGETING_TYPE_KEYWORD`", "enum": [ "TARGETING_TYPE_UNSPECIFIED", "TARGETING_TYPE_CHANNEL", @@ -9222,7 +9222,7 @@ } } }, - "revision": "20240613", + "revision": "20240618", "rootUrl": "https://displayvideo.googleapis.com/", "schemas": { "ActiveViewVideoViewabilityMetricConfig": { @@ -16876,7 +16876,7 @@ "type": "string" }, "optimizationObjective": { - "description": "Optional. The optimization objective of the insertion order.", + "description": "Optional. The optimization objective of the insertion order. **This field is only available to allowlisted customers.** If a customer is not allowlisted, this field will be null and attempts to set it will return an error.", "enum": [ "OPTIMIZATION_OBJECTIVE_UNSPECIFIED", "CONVERSION", diff --git a/displayvideo/v3/displayvideo-gen.go b/displayvideo/v3/displayvideo-gen.go index 05c7052f845..0f26b9939ee 100644 --- a/displayvideo/v3/displayvideo-gen.go +++ b/displayvideo/v3/displayvideo-gen.go @@ -9355,7 +9355,9 @@ type InsertionOrder struct { // Name: Output only. The resource name of the insertion order. Name string `json:"name,omitempty"` // OptimizationObjective: Optional. The optimization objective of the insertion - // order. + // order. **This field is only available to allowlisted customers.** If a + // customer is not allowlisted, this field will be null and attempts to set it + // will return an error. // // Possible values: // "OPTIMIZATION_OBJECTIVE_UNSPECIFIED" - Type value is not specified or is @@ -27069,7 +27071,8 @@ type AdvertisersTargetingTypesAssignedTargetingOptionsGetCall struct { // Supported targeting types: * `TARGETING_TYPE_CHANNEL` * // `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * // `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * -// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`. +// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * +// `TARGETING_TYPE_KEYWORD`. func (r *AdvertisersTargetingTypesAssignedTargetingOptionsService) Get(advertiserId int64, targetingType string, assignedTargetingOptionId string) *AdvertisersTargetingTypesAssignedTargetingOptionsGetCall { c := &AdvertisersTargetingTypesAssignedTargetingOptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.advertiserId = advertiserId @@ -27187,7 +27190,8 @@ type AdvertisersTargetingTypesAssignedTargetingOptionsListCall struct { // Supported targeting types: * `TARGETING_TYPE_CHANNEL` * // `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` * // `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * -// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL`. +// `TARGETING_TYPE_YOUTUBE_VIDEO` * `TARGETING_TYPE_YOUTUBE_CHANNEL` * +// `TARGETING_TYPE_KEYWORD`. func (r *AdvertisersTargetingTypesAssignedTargetingOptionsService) List(advertiserId int64, targetingType string) *AdvertisersTargetingTypesAssignedTargetingOptionsListCall { c := &AdvertisersTargetingTypesAssignedTargetingOptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.advertiserId = advertiserId diff --git a/documentai/v1/documentai-api.json b/documentai/v1/documentai-api.json index d1b76b78143..ede5f2e0596 100644 --- a/documentai/v1/documentai-api.json +++ b/documentai/v1/documentai-api.json @@ -422,7 +422,7 @@ ] }, "create": { - "description": "Creates a processor from the ProcessorType provided. The processor will be at `ENABLED` state by default after its creation.", + "description": "Creates a processor from the ProcessorType provided. The processor will be at `ENABLED` state by default after its creation. Note that this method requires the `documentai.processors.create` permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/processors", "httpMethod": "POST", "id": "documentai.projects.locations.processors.create", @@ -1042,7 +1042,7 @@ } } }, - "revision": "20240531", + "revision": "20240615", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { diff --git a/documentai/v1/documentai-gen.go b/documentai/v1/documentai-gen.go index 78181e7165a..463866c476c 100644 --- a/documentai/v1/documentai-gen.go +++ b/documentai/v1/documentai-gen.go @@ -12713,7 +12713,11 @@ type ProjectsLocationsProcessorsCreateCall struct { } // Create: Creates a processor from the ProcessorType provided. The processor -// will be at `ENABLED` state by default after its creation. +// will be at `ENABLED` state by default after its creation. Note that this +// method requires the `documentai.processors.create` permission on the +// project, which is highly privileged. A user or service account with this +// permission can create new processors that can interact with any gcs bucket +// in your project. // // - parent: The parent (project and location) under which to create the // processor. Format: `projects/{project}/locations/{location}`. diff --git a/documentai/v1beta3/documentai-api.json b/documentai/v1beta3/documentai-api.json index 1b80e01ded3..dbefc13fd49 100644 --- a/documentai/v1beta3/documentai-api.json +++ b/documentai/v1beta3/documentai-api.json @@ -393,7 +393,7 @@ ] }, "create": { - "description": "Creates a processor from the ProcessorType provided. The processor will be at `ENABLED` state by default after its creation.", + "description": "Creates a processor from the ProcessorType provided. The processor will be at `ENABLED` state by default after its creation. Note that this method requires the `documentai.processors.create` permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project.", "flatPath": "v1beta3/projects/{projectsId}/locations/{locationsId}/processors", "httpMethod": "POST", "id": "documentai.projects.locations.processors.create", @@ -619,7 +619,7 @@ ] }, "updateDataset": { - "description": "Updates metadata associated with a dataset.", + "description": "Updates metadata associated with a dataset. Note that this method requires the `documentai.googleapis.com/datasets.update` permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project.", "flatPath": "v1beta3/projects/{projectsId}/locations/{locationsId}/processors/{processorsId}/dataset", "httpMethod": "PATCH", "id": "documentai.projects.locations.processors.updateDataset", @@ -1284,7 +1284,7 @@ } } }, - "revision": "20240531", + "revision": "20240615", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { diff --git a/documentai/v1beta3/documentai-gen.go b/documentai/v1beta3/documentai-gen.go index a11d8677198..492ebafa482 100644 --- a/documentai/v1beta3/documentai-gen.go +++ b/documentai/v1beta3/documentai-gen.go @@ -13182,7 +13182,11 @@ type ProjectsLocationsProcessorsCreateCall struct { } // Create: Creates a processor from the ProcessorType provided. The processor -// will be at `ENABLED` state by default after its creation. +// will be at `ENABLED` state by default after its creation. Note that this +// method requires the `documentai.processors.create` permission on the +// project, which is highly privileged. A user or service account with this +// permission can create new processors that can interact with any gcs bucket +// in your project. // // - parent: The parent (project and location) under which to create the // processor. Format: `projects/{project}/locations/{location}`. @@ -14051,7 +14055,11 @@ type ProjectsLocationsProcessorsUpdateDatasetCall struct { header_ http.Header } -// UpdateDataset: Updates metadata associated with a dataset. +// UpdateDataset: Updates metadata associated with a dataset. Note that this +// method requires the `documentai.googleapis.com/datasets.update` permission +// on the project, which is highly privileged. A user or service account with +// this permission can create new processors that can interact with any gcs +// bucket in your project. // // - name: Dataset resource name. Format: // `projects/{project}/locations/{location}/processors/{processor}/dataset`. diff --git a/domains/v1/domains-api.json b/domains/v1/domains-api.json index 8bdf6ba3cc9..aab00b42f26 100644 --- a/domains/v1/domains-api.json +++ b/domains/v1/domains-api.json @@ -684,6 +684,42 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "retrieveGoogleDomainsDnsRecords": { + "description": "Lists the DNS records from the Google Domains DNS zone for domains that use the deprecated `google_domains_dns` in the `Registration`'s `dns_settings`.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registrations/{registrationsId}:retrieveGoogleDomainsDnsRecords", + "httpMethod": "GET", + "id": "domains.projects.locations.registrations.retrieveGoogleDomainsDnsRecords", + "parameterOrder": [ + "registration" + ], + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of results to return.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. When set to the `next_page_token` from a prior response, provides the next page of results.", + "location": "query", + "type": "string" + }, + "registration": { + "description": "Required. The name of the `Registration` whose Google Domains DNS records details you are retrieving, in the format `projects/*/locations/*/registrations/*`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/registrations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+registration}:retrieveGoogleDomainsDnsRecords", + "response": { + "$ref": "RetrieveGoogleDomainsDnsRecordsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "retrieveGoogleDomainsForwardingConfig": { "description": "Lists the deprecated domain and email forwarding configurations you set up in the deprecated Google Domains UI. The configuration is present only for domains with the `google_domains_redirects_data_available` set to `true` in the `Registration`'s `dns_settings`. A forwarding configuration might not work correctly if required DNS records are not present in the domain's authoritative DNS Zone.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registrations/{registrationsId}:retrieveGoogleDomainsForwardingConfig", @@ -929,7 +965,7 @@ } } }, - "revision": "20240603", + "revision": "20240610", "rootUrl": "https://domains.googleapis.com/", "schemas": { "AuditConfig": { @@ -1188,6 +1224,11 @@ "$ref": "GoogleDomainsDns", "deprecated": true, "description": "Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). The free DNS zone provided by [Google Domains](https://domains.google/)." + }, + "googleDomainsRedirectsDataAvailable": { + "description": "Output only. Indicates if this `Registration` has configured one of the following deprecated Google Domains DNS features: * Domain forwarding (HTTP `301` and `302` response status codes), * Email forwarding. See https://cloud.google.com/domains/docs/deprecations/feature-deprecations for more details. If any of these features is enabled call the `RetrieveGoogleDomainsForwardingConfig` method to get details about the feature's configuration. A forwarding configuration might not work correctly if required DNS records are not present in the domain's authoritative DNS Zone.", + "readOnly": true, + "type": "boolean" } }, "type": "object" @@ -1391,6 +1432,52 @@ }, "type": "object" }, + "GeoPolicy": { + "description": "Configures a `RRSetRoutingPolicy` that routes based on the geo location of the querying user.", + "id": "GeoPolicy", + "properties": { + "enableFencing": { + "description": "Without fencing, if health check fails for all configured items in the current geo bucket, we failover to the next nearest geo bucket. With fencing, if health checking is enabled, as long as some targets in the current geo bucket are healthy, we return only the healthy targets. However, if all targets are unhealthy, we don't failover to the next nearest bucket; instead, we return all the items in the current bucket even when all targets are unhealthy.", + "type": "boolean" + }, + "item": { + "description": "The primary geo routing configuration. If there are multiple items with the same location, an error is returned instead.", + "items": { + "$ref": "GeoPolicyItem" + }, + "type": "array" + } + }, + "type": "object" + }, + "GeoPolicyItem": { + "description": "ResourceRecordSet data for one geo location.", + "id": "GeoPolicyItem", + "properties": { + "healthCheckedTargets": { + "$ref": "HealthCheckTargets", + "description": "For A and AAAA types only. Endpoints to return in the query result only if they are healthy. These can be specified along with `rrdata` within this item." + }, + "location": { + "description": "The geo-location granularity is a GCP region. This location string should correspond to a GCP region. e.g. \"us-east1\", \"southamerica-east1\", \"asia-east1\", etc.", + "type": "string" + }, + "rrdata": { + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "DNSSEC generated signatures for all the `rrdata` within this item. If health checked targets are provided for DNSSEC enabled zones, there's a restriction of 1 IP address per item.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GlueRecord": { "description": "Defines a host on your domain that is a DNS name server for your domain and/or other domains. Glue records are a way of making the IP address of a name server known, even when it serves DNS queries for its parent domain. For example, when `ns.example.com` is a name server for `example.com`, the host `ns.example.com` must have a glue record to break the circular DNS reference.", "id": "GlueRecord", @@ -1454,6 +1541,20 @@ }, "type": "object" }, + "HealthCheckTargets": { + "description": "HealthCheckTargets describes endpoints to health-check when responding to Routing Policy queries. Only the healthy endpoints will be included in the response.", + "id": "HealthCheckTargets", + "properties": { + "internalLoadBalancer": { + "description": "Configuration for internal load balancers to be health checked.", + "items": { + "$ref": "LoadBalancerTarget" + }, + "type": "array" + } + }, + "type": "object" + }, "ImportDomainRequest": { "deprecated": true, "description": "Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). Request for the `ImportDomain` method.", @@ -1538,6 +1639,63 @@ }, "type": "object" }, + "LoadBalancerTarget": { + "description": "The configuration for an individual load balancer to health check.", + "id": "LoadBalancerTarget", + "properties": { + "ipAddress": { + "description": "The frontend IP address of the load balancer to health check.", + "type": "string" + }, + "ipProtocol": { + "description": "The protocol of the load balancer to health check.", + "enum": [ + "UNDEFINED", + "TCP", + "UDP" + ], + "enumDescriptions": [ + "", + "Indicates the load balancer is accessible via TCP.", + "Indicates the load balancer is accessible via UDP." + ], + "type": "string" + }, + "loadBalancerType": { + "description": "The type of load balancer specified by this target. This value must match the configuration of the load balancer located at the LoadBalancerTarget's IP address, port, and region. Use the following: - *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. - *regionalL7ilb*: for a regional internal Application Load Balancer. - *globalL7ilb*: for a global internal Application Load Balancer. ", + "enum": [ + "NONE", + "GLOBAL_L7ILB", + "REGIONAL_L4ILB", + "REGIONAL_L7ILB" + ], + "enumDescriptions": [ + "", + "Indicates the load balancer is a Cross-Region Application Load Balancer.", + "Indicates the load balancer is a Regional Network Passthrough Load Balancer.", + "Indicates the load balancer is a Regional Application Load Balancer." + ], + "type": "string" + }, + "networkUrl": { + "description": "The fully qualified URL of the network that the load balancer is attached to. This should be formatted like `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`.", + "type": "string" + }, + "port": { + "description": "The configured port of the load balancer.", + "type": "string" + }, + "project": { + "description": "The project ID in which the load balancer is located.", + "type": "string" + }, + "region": { + "description": "The region in which the load balancer is located.", + "type": "string" + } + }, + "type": "object" + }, "Location": { "description": "A resource that represents a Google Cloud location.", "id": "Location", @@ -1831,6 +1989,50 @@ }, "type": "object" }, + "PrimaryBackupPolicy": { + "description": "Configures a RRSetRoutingPolicy such that all queries are responded with the primary_targets if they are healthy. And if all of them are unhealthy, then we fallback to a geo localized policy.", + "id": "PrimaryBackupPolicy", + "properties": { + "backupGeoTargets": { + "$ref": "GeoPolicy", + "description": "Backup targets provide a regional failover policy for the otherwise global primary targets. If serving state is set to `BACKUP`, this policy essentially becomes a geo routing policy." + }, + "primaryTargets": { + "$ref": "HealthCheckTargets", + "description": "Endpoints that are health checked before making the routing decision. Unhealthy endpoints are omitted from the results. If all endpoints are unhealthy, we serve a response based on the `backup_geo_targets`." + }, + "trickleTraffic": { + "description": "When serving state is `PRIMARY`, this field provides the option of sending a small percentage of the traffic to the backup targets.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "RRSetRoutingPolicy": { + "description": "A RRSetRoutingPolicy represents ResourceRecordSet data that is returned dynamically with the response varying based on configured properties such as geolocation or by weighted random selection.", + "id": "RRSetRoutingPolicy", + "properties": { + "geo": { + "$ref": "GeoPolicy" + }, + "geoPolicy": { + "$ref": "GeoPolicy", + "deprecated": true + }, + "primaryBackup": { + "$ref": "PrimaryBackupPolicy" + }, + "wrr": { + "$ref": "WrrPolicy" + }, + "wrrPolicy": { + "$ref": "WrrPolicy", + "deprecated": true + } + }, + "type": "object" + }, "RegisterDomainRequest": { "description": "Request for the `RegisterDomain` method.", "id": "RegisterDomainRequest", @@ -2182,6 +2384,62 @@ "properties": {}, "type": "object" }, + "ResourceRecordSet": { + "description": "A unit of data that is returned by the DNS servers.", + "id": "ResourceRecordSet", + "properties": { + "name": { + "description": "For example, www.example.com.", + "type": "string" + }, + "routingPolicy": { + "$ref": "RRSetRoutingPolicy", + "description": "Configures dynamic query responses based on either the geo location of the querying user or a weighted round robin based routing policy. A valid `ResourceRecordSet` contains only `rrdata` (for static resolution) or a `routing_policy` (for dynamic resolution)." + }, + "rrdata": { + "description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.", + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "As defined in RFC 4034 (section 3.2).", + "items": { + "type": "string" + }, + "type": "array" + }, + "ttl": { + "description": "Number of seconds that this `ResourceRecordSet` can be cached by resolvers.", + "format": "int32", + "type": "integer" + }, + "type": { + "description": "The identifier of a supported record type. See the list of Supported DNS record types.", + "type": "string" + } + }, + "type": "object" + }, + "RetrieveGoogleDomainsDnsRecordsResponse": { + "description": "Response for the `RetrieveGoogleDomainsDnsRecords` method.", + "id": "RetrieveGoogleDomainsDnsRecordsResponse", + "properties": { + "nextPageToken": { + "description": "When present, there are more results to retrieve. Set `page_token` to this value on a subsequent call to get the next page of results.", + "type": "string" + }, + "rrset": { + "description": "The resource record set resources (DNS Zone records).", + "items": { + "$ref": "ResourceRecordSet" + }, + "type": "array" + } + }, + "type": "object" + }, "RetrieveGoogleDomainsForwardingConfigResponse": { "description": "Response for the `RetrieveGoogleDomainsForwardingConfig` method.", "id": "RetrieveGoogleDomainsForwardingConfigResponse", @@ -2438,6 +2696,48 @@ } }, "type": "object" + }, + "WrrPolicy": { + "description": "Configures a RRSetRoutingPolicy that routes in a weighted round robin fashion.", + "id": "WrrPolicy", + "properties": { + "item": { + "items": { + "$ref": "WrrPolicyItem" + }, + "type": "array" + } + }, + "type": "object" + }, + "WrrPolicyItem": { + "description": "A routing block which contains the routing information for one WRR item.", + "id": "WrrPolicyItem", + "properties": { + "healthCheckedTargets": { + "$ref": "HealthCheckTargets", + "description": "Endpoints that are health checked before making the routing decision. The unhealthy endpoints are omitted from the result. If all endpoints within a bucket are unhealthy, we choose a different bucket (sampled with respect to its weight) for responding. If DNSSEC is enabled for this zone, only one of `rrdata` or `health_checked_targets` can be set." + }, + "rrdata": { + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "DNSSEC generated signatures for all the `rrdata` within this item. Note that if health checked targets are provided for DNSSEC enabled zones, there's a restriction of 1 IP address per item.", + "items": { + "type": "string" + }, + "type": "array" + }, + "weight": { + "description": "The weight corresponding to this `WrrPolicyItem` object. When multiple `WrrPolicyItem` objects are configured, the probability of returning an `WrrPolicyItem` object's data is proportional to its weight relative to the sum of weights configured for all items. This weight must be non-negative.", + "format": "double", + "type": "number" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/domains/v1/domains-gen.go b/domains/v1/domains-gen.go index a3a62460ab4..95429f06164 100644 --- a/domains/v1/domains-gen.go +++ b/domains/v1/domains-gen.go @@ -628,6 +628,17 @@ type DnsSettings struct { // (https://cloud.google.com/domains/docs/deprecations/feature-deprecations). // The free DNS zone provided by Google Domains (https://domains.google/). GoogleDomainsDns *GoogleDomainsDns `json:"googleDomainsDns,omitempty"` + // GoogleDomainsRedirectsDataAvailable: Output only. Indicates if this + // `Registration` has configured one of the following deprecated Google Domains + // DNS features: * Domain forwarding (HTTP `301` and `302` response status + // codes), * Email forwarding. See + // https://cloud.google.com/domains/docs/deprecations/feature-deprecations for + // more details. If any of these features is enabled call the + // `RetrieveGoogleDomainsForwardingConfig` method to get details about the + // feature's configuration. A forwarding configuration might not work correctly + // if required DNS records are not present in the domain's authoritative DNS + // Zone. + GoogleDomainsRedirectsDataAvailable bool `json:"googleDomainsRedirectsDataAvailable,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomDns") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -875,6 +886,71 @@ func (s *Expr) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GeoPolicy: Configures a `RRSetRoutingPolicy` that routes based on the geo +// location of the querying user. +type GeoPolicy struct { + // EnableFencing: Without fencing, if health check fails for all configured + // items in the current geo bucket, we failover to the next nearest geo bucket. + // With fencing, if health checking is enabled, as long as some targets in the + // current geo bucket are healthy, we return only the healthy targets. However, + // if all targets are unhealthy, we don't failover to the next nearest bucket; + // instead, we return all the items in the current bucket even when all targets + // are unhealthy. + EnableFencing bool `json:"enableFencing,omitempty"` + // Item: The primary geo routing configuration. If there are multiple items + // with the same location, an error is returned instead. + Item []*GeoPolicyItem `json:"item,omitempty"` + // ForceSendFields is a list of field names (e.g. "EnableFencing") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EnableFencing") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoPolicy) MarshalJSON() ([]byte, error) { + type NoMethod GeoPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GeoPolicyItem: ResourceRecordSet data for one geo location. +type GeoPolicyItem struct { + // HealthCheckedTargets: For A and AAAA types only. Endpoints to return in the + // query result only if they are healthy. These can be specified along with + // `rrdata` within this item. + HealthCheckedTargets *HealthCheckTargets `json:"healthCheckedTargets,omitempty"` + // Location: The geo-location granularity is a GCP region. This location string + // should correspond to a GCP region. e.g. "us-east1", "southamerica-east1", + // "asia-east1", etc. + Location string `json:"location,omitempty"` + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: DNSSEC generated signatures for all the `rrdata` within + // this item. If health checked targets are provided for DNSSEC enabled zones, + // there's a restriction of 1 IP address per item. + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // ForceSendFields is a list of field names (e.g. "HealthCheckedTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "HealthCheckedTargets") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoPolicyItem) MarshalJSON() ([]byte, error) { + type NoMethod GeoPolicyItem + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GlueRecord: Defines a host on your domain that is a DNS name server for your // domain and/or other domains. Glue records are a way of making the IP address // of a name server known, even when it serves DNS queries for its parent @@ -957,6 +1033,31 @@ func (s *GoogleDomainsDns) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// HealthCheckTargets: HealthCheckTargets describes endpoints to health-check +// when responding to Routing Policy queries. Only the healthy endpoints will +// be included in the response. +type HealthCheckTargets struct { + // InternalLoadBalancer: Configuration for internal load balancers to be health + // checked. + InternalLoadBalancer []*LoadBalancerTarget `json:"internalLoadBalancer,omitempty"` + // ForceSendFields is a list of field names (e.g. "InternalLoadBalancer") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "InternalLoadBalancer") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *HealthCheckTargets) MarshalJSON() ([]byte, error) { + type NoMethod HealthCheckTargets + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // ImportDomainRequest: Deprecated: For more information, see Cloud Domains // feature deprecation // (https://cloud.google.com/domains/docs/deprecations/feature-deprecations). @@ -1093,6 +1194,63 @@ func (s *ListRegistrationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// LoadBalancerTarget: The configuration for an individual load balancer to +// health check. +type LoadBalancerTarget struct { + // IpAddress: The frontend IP address of the load balancer to health check. + IpAddress string `json:"ipAddress,omitempty"` + // IpProtocol: The protocol of the load balancer to health check. + // + // Possible values: + // "UNDEFINED" + // "TCP" - Indicates the load balancer is accessible via TCP. + // "UDP" - Indicates the load balancer is accessible via UDP. + IpProtocol string `json:"ipProtocol,omitempty"` + // LoadBalancerType: The type of load balancer specified by this target. This + // value must match the configuration of the load balancer located at the + // LoadBalancerTarget's IP address, port, and region. Use the following: - + // *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. + // - *regionalL7ilb*: for a regional internal Application Load Balancer. - + // *globalL7ilb*: for a global internal Application Load Balancer. + // + // Possible values: + // "NONE" + // "GLOBAL_L7ILB" - Indicates the load balancer is a Cross-Region Application + // Load Balancer. + // "REGIONAL_L4ILB" - Indicates the load balancer is a Regional Network + // Passthrough Load Balancer. + // "REGIONAL_L7ILB" - Indicates the load balancer is a Regional Application + // Load Balancer. + LoadBalancerType string `json:"loadBalancerType,omitempty"` + // NetworkUrl: The fully qualified URL of the network that the load balancer is + // attached to. This should be formatted like + // `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{ne + // twork}`. + NetworkUrl string `json:"networkUrl,omitempty"` + // Port: The configured port of the load balancer. + Port string `json:"port,omitempty"` + // Project: The project ID in which the load balancer is located. + Project string `json:"project,omitempty"` + // Region: The region in which the load balancer is located. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "IpAddress") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "IpAddress") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoadBalancerTarget) MarshalJSON() ([]byte, error) { + type NoMethod LoadBalancerTarget + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Location: A resource that represents a Google Cloud location. type Location struct { // DisplayName: The friendly name for this location, typically a nearby city @@ -1521,6 +1679,80 @@ func (s *PostalAddress) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// PrimaryBackupPolicy: Configures a RRSetRoutingPolicy such that all queries +// are responded with the primary_targets if they are healthy. And if all of +// them are unhealthy, then we fallback to a geo localized policy. +type PrimaryBackupPolicy struct { + // BackupGeoTargets: Backup targets provide a regional failover policy for the + // otherwise global primary targets. If serving state is set to `BACKUP`, this + // policy essentially becomes a geo routing policy. + BackupGeoTargets *GeoPolicy `json:"backupGeoTargets,omitempty"` + // PrimaryTargets: Endpoints that are health checked before making the routing + // decision. Unhealthy endpoints are omitted from the results. If all endpoints + // are unhealthy, we serve a response based on the `backup_geo_targets`. + PrimaryTargets *HealthCheckTargets `json:"primaryTargets,omitempty"` + // TrickleTraffic: When serving state is `PRIMARY`, this field provides the + // option of sending a small percentage of the traffic to the backup targets. + TrickleTraffic float64 `json:"trickleTraffic,omitempty"` + // ForceSendFields is a list of field names (e.g. "BackupGeoTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BackupGeoTargets") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PrimaryBackupPolicy) MarshalJSON() ([]byte, error) { + type NoMethod PrimaryBackupPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *PrimaryBackupPolicy) UnmarshalJSON(data []byte) error { + type NoMethod PrimaryBackupPolicy + var s1 struct { + TrickleTraffic gensupport.JSONFloat64 `json:"trickleTraffic"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.TrickleTraffic = float64(s1.TrickleTraffic) + return nil +} + +// RRSetRoutingPolicy: A RRSetRoutingPolicy represents ResourceRecordSet data +// that is returned dynamically with the response varying based on configured +// properties such as geolocation or by weighted random selection. +type RRSetRoutingPolicy struct { + Geo *GeoPolicy `json:"geo,omitempty"` + GeoPolicy *GeoPolicy `json:"geoPolicy,omitempty"` + PrimaryBackup *PrimaryBackupPolicy `json:"primaryBackup,omitempty"` + Wrr *WrrPolicy `json:"wrr,omitempty"` + WrrPolicy *WrrPolicy `json:"wrrPolicy,omitempty"` + // ForceSendFields is a list of field names (e.g. "Geo") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Geo") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RRSetRoutingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod RRSetRoutingPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // RegisterDomainRequest: Request for the `RegisterDomain` method. type RegisterDomainRequest struct { // ContactNotices: The list of contact notices that the caller acknowledges. @@ -1888,6 +2120,74 @@ func (s *RenewDomainRequest) MarshalJSON() ([]byte, error) { type ResetAuthorizationCodeRequest struct { } +// ResourceRecordSet: A unit of data that is returned by the DNS servers. +type ResourceRecordSet struct { + // Name: For example, www.example.com. + Name string `json:"name,omitempty"` + // RoutingPolicy: Configures dynamic query responses based on either the geo + // location of the querying user or a weighted round robin based routing + // policy. A valid `ResourceRecordSet` contains only `rrdata` (for static + // resolution) or a `routing_policy` (for dynamic resolution). + RoutingPolicy *RRSetRoutingPolicy `json:"routingPolicy,omitempty"` + // Rrdata: As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- + // see examples. + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: As defined in RFC 4034 (section 3.2). + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // Ttl: Number of seconds that this `ResourceRecordSet` can be cached by + // resolvers. + Ttl int64 `json:"ttl,omitempty"` + // Type: The identifier of a supported record type. See the list of Supported + // DNS record types. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "Name") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Name") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) { + type NoMethod ResourceRecordSet + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RetrieveGoogleDomainsDnsRecordsResponse: Response for the +// `RetrieveGoogleDomainsDnsRecords` method. +type RetrieveGoogleDomainsDnsRecordsResponse struct { + // NextPageToken: When present, there are more results to retrieve. Set + // `page_token` to this value on a subsequent call to get the next page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + // Rrset: The resource record set resources (DNS Zone records). + Rrset []*ResourceRecordSet `json:"rrset,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RetrieveGoogleDomainsDnsRecordsResponse) MarshalJSON() ([]byte, error) { + type NoMethod RetrieveGoogleDomainsDnsRecordsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // RetrieveGoogleDomainsForwardingConfigResponse: Response for the // `RetrieveGoogleDomainsForwardingConfig` method. type RetrieveGoogleDomainsForwardingConfigResponse struct { @@ -2267,6 +2567,80 @@ func (s *TransferParameters) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// WrrPolicy: Configures a RRSetRoutingPolicy that routes in a weighted round +// robin fashion. +type WrrPolicy struct { + Item []*WrrPolicyItem `json:"item,omitempty"` + // ForceSendFields is a list of field names (e.g. "Item") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Item") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WrrPolicy) MarshalJSON() ([]byte, error) { + type NoMethod WrrPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// WrrPolicyItem: A routing block which contains the routing information for +// one WRR item. +type WrrPolicyItem struct { + // HealthCheckedTargets: Endpoints that are health checked before making the + // routing decision. The unhealthy endpoints are omitted from the result. If + // all endpoints within a bucket are unhealthy, we choose a different bucket + // (sampled with respect to its weight) for responding. If DNSSEC is enabled + // for this zone, only one of `rrdata` or `health_checked_targets` can be set. + HealthCheckedTargets *HealthCheckTargets `json:"healthCheckedTargets,omitempty"` + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: DNSSEC generated signatures for all the `rrdata` within + // this item. Note that if health checked targets are provided for DNSSEC + // enabled zones, there's a restriction of 1 IP address per item. + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // Weight: The weight corresponding to this `WrrPolicyItem` object. When + // multiple `WrrPolicyItem` objects are configured, the probability of + // returning an `WrrPolicyItem` object's data is proportional to its weight + // relative to the sum of weights configured for all items. This weight must be + // non-negative. + Weight float64 `json:"weight,omitempty"` + // ForceSendFields is a list of field names (e.g. "HealthCheckedTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "HealthCheckedTargets") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WrrPolicyItem) MarshalJSON() ([]byte, error) { + type NoMethod WrrPolicyItem + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *WrrPolicyItem) UnmarshalJSON(data []byte) error { + type NoMethod WrrPolicyItem + var s1 struct { + Weight gensupport.JSONFloat64 `json:"weight"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Weight = float64(s1.Weight) + return nil +} + type ProjectsLocationsGetCall struct { s *Service name string @@ -4492,6 +4866,153 @@ func (c *ProjectsLocationsRegistrationsRetrieveAuthorizationCodeCall) Do(opts .. return ret, nil } +type ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall struct { + s *Service + registration string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// RetrieveGoogleDomainsDnsRecords: Lists the DNS records from the Google +// Domains DNS zone for domains that use the deprecated `google_domains_dns` in +// the `Registration`'s `dns_settings`. +// +// - registration: The name of the `Registration` whose Google Domains DNS +// records details you are retrieving, in the format +// `projects/*/locations/*/registrations/*`. +func (r *ProjectsLocationsRegistrationsService) RetrieveGoogleDomainsDnsRecords(registration string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c := &ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.registration = registration + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of results +// to return. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) PageSize(pageSize int64) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": When set to the +// `next_page_token` from a prior response, provides the next page of results. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) PageToken(pageToken string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) IfNoneMatch(entityTag string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Context(ctx context.Context) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+registration}:retrieveGoogleDomainsDnsRecords") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "registration": c.registration, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "domains.projects.locations.registrations.retrieveGoogleDomainsDnsRecords" call. +// Any non-2xx status code is an error. Response headers are in either +// *RetrieveGoogleDomainsDnsRecordsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Do(opts ...googleapi.CallOption) (*RetrieveGoogleDomainsDnsRecordsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RetrieveGoogleDomainsDnsRecordsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Pages(ctx context.Context, f func(*RetrieveGoogleDomainsDnsRecordsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + type ProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigCall struct { s *Service registration string diff --git a/domains/v1alpha2/domains-api.json b/domains/v1alpha2/domains-api.json index d6943d80151..47d28a368f0 100644 --- a/domains/v1alpha2/domains-api.json +++ b/domains/v1alpha2/domains-api.json @@ -684,6 +684,42 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "retrieveGoogleDomainsDnsRecords": { + "description": "Lists the DNS records from the Google Domains DNS zone for domains that use the deprecated `google_domains_dns` in the `Registration`'s `dns_settings`.", + "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/registrations/{registrationsId}:retrieveGoogleDomainsDnsRecords", + "httpMethod": "GET", + "id": "domains.projects.locations.registrations.retrieveGoogleDomainsDnsRecords", + "parameterOrder": [ + "registration" + ], + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of results to return.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. When set to the `next_page_token` from a prior response, provides the next page of results.", + "location": "query", + "type": "string" + }, + "registration": { + "description": "Required. The name of the `Registration` whose Google Domains DNS records details you are retrieving, in the format `projects/*/locations/*/registrations/*`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/registrations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha2/{+registration}:retrieveGoogleDomainsDnsRecords", + "response": { + "$ref": "RetrieveGoogleDomainsDnsRecordsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "retrieveGoogleDomainsForwardingConfig": { "description": "Lists the deprecated domain and email forwarding configurations you set up in the deprecated Google Domains UI. The configuration is present only for domains with the `google_domains_redirects_data_available` set to `true` in the `Registration`'s `dns_settings`. A forwarding configuration might not work correctly if required DNS records are not present in the domain's authoritative DNS Zone.", "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/registrations/{registrationsId}:retrieveGoogleDomainsForwardingConfig", @@ -929,7 +965,7 @@ } } }, - "revision": "20240603", + "revision": "20240610", "rootUrl": "https://domains.googleapis.com/", "schemas": { "AuditConfig": { @@ -1188,6 +1224,11 @@ "$ref": "GoogleDomainsDns", "deprecated": true, "description": "Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). The free DNS zone provided by [Google Domains](https://domains.google/)." + }, + "googleDomainsRedirectsDataAvailable": { + "description": "Output only. Indicates if this `Registration` has configured one of the following deprecated Google Domains DNS features: * Domain forwarding (HTTP `301` and `302` response status codes), * Email forwarding. See https://cloud.google.com/domains/docs/deprecations/feature-deprecations for more details. If any of these features is enabled call the `RetrieveGoogleDomainsForwardingConfig` method to get details about the feature's configuration. A forwarding configuration might not work correctly if required DNS records are not present in the domain's authoritative DNS Zone.", + "readOnly": true, + "type": "boolean" } }, "type": "object" @@ -1391,6 +1432,52 @@ }, "type": "object" }, + "GeoPolicy": { + "description": "Configures a `RRSetRoutingPolicy` that routes based on the geo location of the querying user.", + "id": "GeoPolicy", + "properties": { + "enableFencing": { + "description": "Without fencing, if health check fails for all configured items in the current geo bucket, we failover to the next nearest geo bucket. With fencing, if health checking is enabled, as long as some targets in the current geo bucket are healthy, we return only the healthy targets. However, if all targets are unhealthy, we don't failover to the next nearest bucket; instead, we return all the items in the current bucket even when all targets are unhealthy.", + "type": "boolean" + }, + "item": { + "description": "The primary geo routing configuration. If there are multiple items with the same location, an error is returned instead.", + "items": { + "$ref": "GeoPolicyItem" + }, + "type": "array" + } + }, + "type": "object" + }, + "GeoPolicyItem": { + "description": "ResourceRecordSet data for one geo location.", + "id": "GeoPolicyItem", + "properties": { + "healthCheckedTargets": { + "$ref": "HealthCheckTargets", + "description": "For A and AAAA types only. Endpoints to return in the query result only if they are healthy. These can be specified along with `rrdata` within this item." + }, + "location": { + "description": "The geo-location granularity is a GCP region. This location string should correspond to a GCP region. e.g. \"us-east1\", \"southamerica-east1\", \"asia-east1\", etc.", + "type": "string" + }, + "rrdata": { + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "DNSSEC generated signatures for all the `rrdata` within this item. If health checked targets are provided for DNSSEC enabled zones, there's a restriction of 1 IP address per item.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GlueRecord": { "description": "Defines a host on your domain that is a DNS name server for your domain and/or other domains. Glue records are a way of making the IP address of a name server known, even when it serves DNS queries for its parent domain. For example, when `ns.example.com` is a name server for `example.com`, the host `ns.example.com` must have a glue record to break the circular DNS reference.", "id": "GlueRecord", @@ -1454,6 +1541,20 @@ }, "type": "object" }, + "HealthCheckTargets": { + "description": "HealthCheckTargets describes endpoints to health-check when responding to Routing Policy queries. Only the healthy endpoints will be included in the response.", + "id": "HealthCheckTargets", + "properties": { + "internalLoadBalancer": { + "description": "Configuration for internal load balancers to be health checked.", + "items": { + "$ref": "LoadBalancerTarget" + }, + "type": "array" + } + }, + "type": "object" + }, "ImportDomainRequest": { "deprecated": true, "description": "Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). Request for the `ImportDomain` method.", @@ -1538,6 +1639,63 @@ }, "type": "object" }, + "LoadBalancerTarget": { + "description": "The configuration for an individual load balancer to health check.", + "id": "LoadBalancerTarget", + "properties": { + "ipAddress": { + "description": "The frontend IP address of the load balancer to health check.", + "type": "string" + }, + "ipProtocol": { + "description": "The protocol of the load balancer to health check.", + "enum": [ + "UNDEFINED", + "TCP", + "UDP" + ], + "enumDescriptions": [ + "", + "Indicates the load balancer is accessible via TCP.", + "Indicates the load balancer is accessible via UDP." + ], + "type": "string" + }, + "loadBalancerType": { + "description": "The type of load balancer specified by this target. This value must match the configuration of the load balancer located at the LoadBalancerTarget's IP address, port, and region. Use the following: - *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. - *regionalL7ilb*: for a regional internal Application Load Balancer. - *globalL7ilb*: for a global internal Application Load Balancer. ", + "enum": [ + "NONE", + "GLOBAL_L7ILB", + "REGIONAL_L4ILB", + "REGIONAL_L7ILB" + ], + "enumDescriptions": [ + "", + "Indicates the load balancer is a Cross-Region Application Load Balancer.", + "Indicates the load balancer is a Regional Network Passthrough Load Balancer.", + "Indicates the load balancer is a Regional Application Load Balancer." + ], + "type": "string" + }, + "networkUrl": { + "description": "The fully qualified URL of the network that the load balancer is attached to. This should be formatted like `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`.", + "type": "string" + }, + "port": { + "description": "The configured port of the load balancer.", + "type": "string" + }, + "project": { + "description": "The project ID in which the load balancer is located.", + "type": "string" + }, + "region": { + "description": "The region in which the load balancer is located.", + "type": "string" + } + }, + "type": "object" + }, "Location": { "description": "A resource that represents a Google Cloud location.", "id": "Location", @@ -1831,6 +1989,50 @@ }, "type": "object" }, + "PrimaryBackupPolicy": { + "description": "Configures a RRSetRoutingPolicy such that all queries are responded with the primary_targets if they are healthy. And if all of them are unhealthy, then we fallback to a geo localized policy.", + "id": "PrimaryBackupPolicy", + "properties": { + "backupGeoTargets": { + "$ref": "GeoPolicy", + "description": "Backup targets provide a regional failover policy for the otherwise global primary targets. If serving state is set to `BACKUP`, this policy essentially becomes a geo routing policy." + }, + "primaryTargets": { + "$ref": "HealthCheckTargets", + "description": "Endpoints that are health checked before making the routing decision. Unhealthy endpoints are omitted from the results. If all endpoints are unhealthy, we serve a response based on the `backup_geo_targets`." + }, + "trickleTraffic": { + "description": "When serving state is `PRIMARY`, this field provides the option of sending a small percentage of the traffic to the backup targets.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "RRSetRoutingPolicy": { + "description": "A RRSetRoutingPolicy represents ResourceRecordSet data that is returned dynamically with the response varying based on configured properties such as geolocation or by weighted random selection.", + "id": "RRSetRoutingPolicy", + "properties": { + "geo": { + "$ref": "GeoPolicy" + }, + "geoPolicy": { + "$ref": "GeoPolicy", + "deprecated": true + }, + "primaryBackup": { + "$ref": "PrimaryBackupPolicy" + }, + "wrr": { + "$ref": "WrrPolicy" + }, + "wrrPolicy": { + "$ref": "WrrPolicy", + "deprecated": true + } + }, + "type": "object" + }, "RegisterDomainRequest": { "description": "Request for the `RegisterDomain` method.", "id": "RegisterDomainRequest", @@ -2197,6 +2399,62 @@ "properties": {}, "type": "object" }, + "ResourceRecordSet": { + "description": "A unit of data that is returned by the DNS servers.", + "id": "ResourceRecordSet", + "properties": { + "name": { + "description": "For example, www.example.com.", + "type": "string" + }, + "routingPolicy": { + "$ref": "RRSetRoutingPolicy", + "description": "Configures dynamic query responses based on either the geo location of the querying user or a weighted round robin based routing policy. A valid `ResourceRecordSet` contains only `rrdata` (for static resolution) or a `routing_policy` (for dynamic resolution)." + }, + "rrdata": { + "description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.", + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "As defined in RFC 4034 (section 3.2).", + "items": { + "type": "string" + }, + "type": "array" + }, + "ttl": { + "description": "Number of seconds that this `ResourceRecordSet` can be cached by resolvers.", + "format": "int32", + "type": "integer" + }, + "type": { + "description": "The identifier of a supported record type. See the list of Supported DNS record types.", + "type": "string" + } + }, + "type": "object" + }, + "RetrieveGoogleDomainsDnsRecordsResponse": { + "description": "Response for the `RetrieveGoogleDomainsDnsRecords` method.", + "id": "RetrieveGoogleDomainsDnsRecordsResponse", + "properties": { + "nextPageToken": { + "description": "When present, there are more results to retrieve. Set `page_token` to this value on a subsequent call to get the next page of results.", + "type": "string" + }, + "rrset": { + "description": "The resource record set resources (DNS Zone records).", + "items": { + "$ref": "ResourceRecordSet" + }, + "type": "array" + } + }, + "type": "object" + }, "RetrieveGoogleDomainsForwardingConfigResponse": { "description": "Response for the `RetrieveGoogleDomainsForwardingConfig` method.", "id": "RetrieveGoogleDomainsForwardingConfigResponse", @@ -2453,6 +2711,48 @@ } }, "type": "object" + }, + "WrrPolicy": { + "description": "Configures a RRSetRoutingPolicy that routes in a weighted round robin fashion.", + "id": "WrrPolicy", + "properties": { + "item": { + "items": { + "$ref": "WrrPolicyItem" + }, + "type": "array" + } + }, + "type": "object" + }, + "WrrPolicyItem": { + "description": "A routing block which contains the routing information for one WRR item.", + "id": "WrrPolicyItem", + "properties": { + "healthCheckedTargets": { + "$ref": "HealthCheckTargets", + "description": "Endpoints that are health checked before making the routing decision. The unhealthy endpoints are omitted from the result. If all endpoints within a bucket are unhealthy, we choose a different bucket (sampled with respect to its weight) for responding. If DNSSEC is enabled for this zone, only one of `rrdata` or `health_checked_targets` can be set." + }, + "rrdata": { + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "DNSSEC generated signatures for all the `rrdata` within this item. Note that if health checked targets are provided for DNSSEC enabled zones, there's a restriction of 1 IP address per item.", + "items": { + "type": "string" + }, + "type": "array" + }, + "weight": { + "description": "The weight corresponding to this `WrrPolicyItem` object. When multiple `WrrPolicyItem` objects are configured, the probability of returning an `WrrPolicyItem` object's data is proportional to its weight relative to the sum of weights configured for all items. This weight must be non-negative.", + "format": "double", + "type": "number" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/domains/v1alpha2/domains-gen.go b/domains/v1alpha2/domains-gen.go index d2382e84eb4..998a17aa25f 100644 --- a/domains/v1alpha2/domains-gen.go +++ b/domains/v1alpha2/domains-gen.go @@ -628,6 +628,17 @@ type DnsSettings struct { // (https://cloud.google.com/domains/docs/deprecations/feature-deprecations). // The free DNS zone provided by Google Domains (https://domains.google/). GoogleDomainsDns *GoogleDomainsDns `json:"googleDomainsDns,omitempty"` + // GoogleDomainsRedirectsDataAvailable: Output only. Indicates if this + // `Registration` has configured one of the following deprecated Google Domains + // DNS features: * Domain forwarding (HTTP `301` and `302` response status + // codes), * Email forwarding. See + // https://cloud.google.com/domains/docs/deprecations/feature-deprecations for + // more details. If any of these features is enabled call the + // `RetrieveGoogleDomainsForwardingConfig` method to get details about the + // feature's configuration. A forwarding configuration might not work correctly + // if required DNS records are not present in the domain's authoritative DNS + // Zone. + GoogleDomainsRedirectsDataAvailable bool `json:"googleDomainsRedirectsDataAvailable,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomDns") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -875,6 +886,71 @@ func (s *Expr) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GeoPolicy: Configures a `RRSetRoutingPolicy` that routes based on the geo +// location of the querying user. +type GeoPolicy struct { + // EnableFencing: Without fencing, if health check fails for all configured + // items in the current geo bucket, we failover to the next nearest geo bucket. + // With fencing, if health checking is enabled, as long as some targets in the + // current geo bucket are healthy, we return only the healthy targets. However, + // if all targets are unhealthy, we don't failover to the next nearest bucket; + // instead, we return all the items in the current bucket even when all targets + // are unhealthy. + EnableFencing bool `json:"enableFencing,omitempty"` + // Item: The primary geo routing configuration. If there are multiple items + // with the same location, an error is returned instead. + Item []*GeoPolicyItem `json:"item,omitempty"` + // ForceSendFields is a list of field names (e.g. "EnableFencing") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EnableFencing") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoPolicy) MarshalJSON() ([]byte, error) { + type NoMethod GeoPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GeoPolicyItem: ResourceRecordSet data for one geo location. +type GeoPolicyItem struct { + // HealthCheckedTargets: For A and AAAA types only. Endpoints to return in the + // query result only if they are healthy. These can be specified along with + // `rrdata` within this item. + HealthCheckedTargets *HealthCheckTargets `json:"healthCheckedTargets,omitempty"` + // Location: The geo-location granularity is a GCP region. This location string + // should correspond to a GCP region. e.g. "us-east1", "southamerica-east1", + // "asia-east1", etc. + Location string `json:"location,omitempty"` + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: DNSSEC generated signatures for all the `rrdata` within + // this item. If health checked targets are provided for DNSSEC enabled zones, + // there's a restriction of 1 IP address per item. + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // ForceSendFields is a list of field names (e.g. "HealthCheckedTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "HealthCheckedTargets") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoPolicyItem) MarshalJSON() ([]byte, error) { + type NoMethod GeoPolicyItem + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GlueRecord: Defines a host on your domain that is a DNS name server for your // domain and/or other domains. Glue records are a way of making the IP address // of a name server known, even when it serves DNS queries for its parent @@ -957,6 +1033,31 @@ func (s *GoogleDomainsDns) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// HealthCheckTargets: HealthCheckTargets describes endpoints to health-check +// when responding to Routing Policy queries. Only the healthy endpoints will +// be included in the response. +type HealthCheckTargets struct { + // InternalLoadBalancer: Configuration for internal load balancers to be health + // checked. + InternalLoadBalancer []*LoadBalancerTarget `json:"internalLoadBalancer,omitempty"` + // ForceSendFields is a list of field names (e.g. "InternalLoadBalancer") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "InternalLoadBalancer") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *HealthCheckTargets) MarshalJSON() ([]byte, error) { + type NoMethod HealthCheckTargets + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // ImportDomainRequest: Deprecated: For more information, see Cloud Domains // feature deprecation // (https://cloud.google.com/domains/docs/deprecations/feature-deprecations). @@ -1093,6 +1194,63 @@ func (s *ListRegistrationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// LoadBalancerTarget: The configuration for an individual load balancer to +// health check. +type LoadBalancerTarget struct { + // IpAddress: The frontend IP address of the load balancer to health check. + IpAddress string `json:"ipAddress,omitempty"` + // IpProtocol: The protocol of the load balancer to health check. + // + // Possible values: + // "UNDEFINED" + // "TCP" - Indicates the load balancer is accessible via TCP. + // "UDP" - Indicates the load balancer is accessible via UDP. + IpProtocol string `json:"ipProtocol,omitempty"` + // LoadBalancerType: The type of load balancer specified by this target. This + // value must match the configuration of the load balancer located at the + // LoadBalancerTarget's IP address, port, and region. Use the following: - + // *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. + // - *regionalL7ilb*: for a regional internal Application Load Balancer. - + // *globalL7ilb*: for a global internal Application Load Balancer. + // + // Possible values: + // "NONE" + // "GLOBAL_L7ILB" - Indicates the load balancer is a Cross-Region Application + // Load Balancer. + // "REGIONAL_L4ILB" - Indicates the load balancer is a Regional Network + // Passthrough Load Balancer. + // "REGIONAL_L7ILB" - Indicates the load balancer is a Regional Application + // Load Balancer. + LoadBalancerType string `json:"loadBalancerType,omitempty"` + // NetworkUrl: The fully qualified URL of the network that the load balancer is + // attached to. This should be formatted like + // `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{ne + // twork}`. + NetworkUrl string `json:"networkUrl,omitempty"` + // Port: The configured port of the load balancer. + Port string `json:"port,omitempty"` + // Project: The project ID in which the load balancer is located. + Project string `json:"project,omitempty"` + // Region: The region in which the load balancer is located. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "IpAddress") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "IpAddress") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoadBalancerTarget) MarshalJSON() ([]byte, error) { + type NoMethod LoadBalancerTarget + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Location: A resource that represents a Google Cloud location. type Location struct { // DisplayName: The friendly name for this location, typically a nearby city @@ -1521,6 +1679,80 @@ func (s *PostalAddress) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// PrimaryBackupPolicy: Configures a RRSetRoutingPolicy such that all queries +// are responded with the primary_targets if they are healthy. And if all of +// them are unhealthy, then we fallback to a geo localized policy. +type PrimaryBackupPolicy struct { + // BackupGeoTargets: Backup targets provide a regional failover policy for the + // otherwise global primary targets. If serving state is set to `BACKUP`, this + // policy essentially becomes a geo routing policy. + BackupGeoTargets *GeoPolicy `json:"backupGeoTargets,omitempty"` + // PrimaryTargets: Endpoints that are health checked before making the routing + // decision. Unhealthy endpoints are omitted from the results. If all endpoints + // are unhealthy, we serve a response based on the `backup_geo_targets`. + PrimaryTargets *HealthCheckTargets `json:"primaryTargets,omitempty"` + // TrickleTraffic: When serving state is `PRIMARY`, this field provides the + // option of sending a small percentage of the traffic to the backup targets. + TrickleTraffic float64 `json:"trickleTraffic,omitempty"` + // ForceSendFields is a list of field names (e.g. "BackupGeoTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BackupGeoTargets") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PrimaryBackupPolicy) MarshalJSON() ([]byte, error) { + type NoMethod PrimaryBackupPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *PrimaryBackupPolicy) UnmarshalJSON(data []byte) error { + type NoMethod PrimaryBackupPolicy + var s1 struct { + TrickleTraffic gensupport.JSONFloat64 `json:"trickleTraffic"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.TrickleTraffic = float64(s1.TrickleTraffic) + return nil +} + +// RRSetRoutingPolicy: A RRSetRoutingPolicy represents ResourceRecordSet data +// that is returned dynamically with the response varying based on configured +// properties such as geolocation or by weighted random selection. +type RRSetRoutingPolicy struct { + Geo *GeoPolicy `json:"geo,omitempty"` + GeoPolicy *GeoPolicy `json:"geoPolicy,omitempty"` + PrimaryBackup *PrimaryBackupPolicy `json:"primaryBackup,omitempty"` + Wrr *WrrPolicy `json:"wrr,omitempty"` + WrrPolicy *WrrPolicy `json:"wrrPolicy,omitempty"` + // ForceSendFields is a list of field names (e.g. "Geo") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Geo") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RRSetRoutingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod RRSetRoutingPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // RegisterDomainRequest: Request for the `RegisterDomain` method. type RegisterDomainRequest struct { // ContactNotices: The list of contact notices that the caller acknowledges. @@ -1895,6 +2127,74 @@ func (s *RenewDomainRequest) MarshalJSON() ([]byte, error) { type ResetAuthorizationCodeRequest struct { } +// ResourceRecordSet: A unit of data that is returned by the DNS servers. +type ResourceRecordSet struct { + // Name: For example, www.example.com. + Name string `json:"name,omitempty"` + // RoutingPolicy: Configures dynamic query responses based on either the geo + // location of the querying user or a weighted round robin based routing + // policy. A valid `ResourceRecordSet` contains only `rrdata` (for static + // resolution) or a `routing_policy` (for dynamic resolution). + RoutingPolicy *RRSetRoutingPolicy `json:"routingPolicy,omitempty"` + // Rrdata: As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- + // see examples. + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: As defined in RFC 4034 (section 3.2). + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // Ttl: Number of seconds that this `ResourceRecordSet` can be cached by + // resolvers. + Ttl int64 `json:"ttl,omitempty"` + // Type: The identifier of a supported record type. See the list of Supported + // DNS record types. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "Name") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Name") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) { + type NoMethod ResourceRecordSet + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RetrieveGoogleDomainsDnsRecordsResponse: Response for the +// `RetrieveGoogleDomainsDnsRecords` method. +type RetrieveGoogleDomainsDnsRecordsResponse struct { + // NextPageToken: When present, there are more results to retrieve. Set + // `page_token` to this value on a subsequent call to get the next page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + // Rrset: The resource record set resources (DNS Zone records). + Rrset []*ResourceRecordSet `json:"rrset,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RetrieveGoogleDomainsDnsRecordsResponse) MarshalJSON() ([]byte, error) { + type NoMethod RetrieveGoogleDomainsDnsRecordsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // RetrieveGoogleDomainsForwardingConfigResponse: Response for the // `RetrieveGoogleDomainsForwardingConfig` method. type RetrieveGoogleDomainsForwardingConfigResponse struct { @@ -2274,6 +2574,80 @@ func (s *TransferParameters) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// WrrPolicy: Configures a RRSetRoutingPolicy that routes in a weighted round +// robin fashion. +type WrrPolicy struct { + Item []*WrrPolicyItem `json:"item,omitempty"` + // ForceSendFields is a list of field names (e.g. "Item") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Item") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WrrPolicy) MarshalJSON() ([]byte, error) { + type NoMethod WrrPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// WrrPolicyItem: A routing block which contains the routing information for +// one WRR item. +type WrrPolicyItem struct { + // HealthCheckedTargets: Endpoints that are health checked before making the + // routing decision. The unhealthy endpoints are omitted from the result. If + // all endpoints within a bucket are unhealthy, we choose a different bucket + // (sampled with respect to its weight) for responding. If DNSSEC is enabled + // for this zone, only one of `rrdata` or `health_checked_targets` can be set. + HealthCheckedTargets *HealthCheckTargets `json:"healthCheckedTargets,omitempty"` + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: DNSSEC generated signatures for all the `rrdata` within + // this item. Note that if health checked targets are provided for DNSSEC + // enabled zones, there's a restriction of 1 IP address per item. + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // Weight: The weight corresponding to this `WrrPolicyItem` object. When + // multiple `WrrPolicyItem` objects are configured, the probability of + // returning an `WrrPolicyItem` object's data is proportional to its weight + // relative to the sum of weights configured for all items. This weight must be + // non-negative. + Weight float64 `json:"weight,omitempty"` + // ForceSendFields is a list of field names (e.g. "HealthCheckedTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "HealthCheckedTargets") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WrrPolicyItem) MarshalJSON() ([]byte, error) { + type NoMethod WrrPolicyItem + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *WrrPolicyItem) UnmarshalJSON(data []byte) error { + type NoMethod WrrPolicyItem + var s1 struct { + Weight gensupport.JSONFloat64 `json:"weight"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Weight = float64(s1.Weight) + return nil +} + type ProjectsLocationsGetCall struct { s *Service name string @@ -4499,6 +4873,153 @@ func (c *ProjectsLocationsRegistrationsRetrieveAuthorizationCodeCall) Do(opts .. return ret, nil } +type ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall struct { + s *Service + registration string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// RetrieveGoogleDomainsDnsRecords: Lists the DNS records from the Google +// Domains DNS zone for domains that use the deprecated `google_domains_dns` in +// the `Registration`'s `dns_settings`. +// +// - registration: The name of the `Registration` whose Google Domains DNS +// records details you are retrieving, in the format +// `projects/*/locations/*/registrations/*`. +func (r *ProjectsLocationsRegistrationsService) RetrieveGoogleDomainsDnsRecords(registration string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c := &ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.registration = registration + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of results +// to return. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) PageSize(pageSize int64) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": When set to the +// `next_page_token` from a prior response, provides the next page of results. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) PageToken(pageToken string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) IfNoneMatch(entityTag string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Context(ctx context.Context) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+registration}:retrieveGoogleDomainsDnsRecords") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "registration": c.registration, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "domains.projects.locations.registrations.retrieveGoogleDomainsDnsRecords" call. +// Any non-2xx status code is an error. Response headers are in either +// *RetrieveGoogleDomainsDnsRecordsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Do(opts ...googleapi.CallOption) (*RetrieveGoogleDomainsDnsRecordsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RetrieveGoogleDomainsDnsRecordsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Pages(ctx context.Context, f func(*RetrieveGoogleDomainsDnsRecordsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + type ProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigCall struct { s *Service registration string diff --git a/domains/v1beta1/domains-api.json b/domains/v1beta1/domains-api.json index 288619a03ec..4b23d8b5ad7 100644 --- a/domains/v1beta1/domains-api.json +++ b/domains/v1beta1/domains-api.json @@ -684,6 +684,42 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "retrieveGoogleDomainsDnsRecords": { + "description": "Lists the DNS records from the Google Domains DNS zone for domains that use the deprecated `google_domains_dns` in the `Registration`'s `dns_settings`.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registrations/{registrationsId}:retrieveGoogleDomainsDnsRecords", + "httpMethod": "GET", + "id": "domains.projects.locations.registrations.retrieveGoogleDomainsDnsRecords", + "parameterOrder": [ + "registration" + ], + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of results to return.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. When set to the `next_page_token` from a prior response, provides the next page of results.", + "location": "query", + "type": "string" + }, + "registration": { + "description": "Required. The name of the `Registration` whose Google Domains DNS records details you are retrieving, in the format `projects/*/locations/*/registrations/*`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/registrations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+registration}:retrieveGoogleDomainsDnsRecords", + "response": { + "$ref": "RetrieveGoogleDomainsDnsRecordsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "retrieveGoogleDomainsForwardingConfig": { "description": "Lists the deprecated domain and email forwarding configurations you set up in the deprecated Google Domains UI. The configuration is present only for domains with the `google_domains_redirects_data_available` set to `true` in the `Registration`'s `dns_settings`. A forwarding configuration might not work correctly if required DNS records are not present in the domain's authoritative DNS Zone.", "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registrations/{registrationsId}:retrieveGoogleDomainsForwardingConfig", @@ -929,7 +965,7 @@ } } }, - "revision": "20240603", + "revision": "20240610", "rootUrl": "https://domains.googleapis.com/", "schemas": { "AuditConfig": { @@ -1188,6 +1224,11 @@ "$ref": "GoogleDomainsDns", "deprecated": true, "description": "Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). The free DNS zone provided by [Google Domains](https://domains.google/)." + }, + "googleDomainsRedirectsDataAvailable": { + "description": "Output only. Indicates if this `Registration` has configured one of the following deprecated Google Domains DNS features: * Domain forwarding (HTTP `301` and `302` response status codes), * Email forwarding. See https://cloud.google.com/domains/docs/deprecations/feature-deprecations for more details. If any of these features is enabled call the `RetrieveGoogleDomainsForwardingConfig` method to get details about the feature's configuration. A forwarding configuration might not work correctly if required DNS records are not present in the domain's authoritative DNS Zone.", + "readOnly": true, + "type": "boolean" } }, "type": "object" @@ -1391,6 +1432,52 @@ }, "type": "object" }, + "GeoPolicy": { + "description": "Configures a `RRSetRoutingPolicy` that routes based on the geo location of the querying user.", + "id": "GeoPolicy", + "properties": { + "enableFencing": { + "description": "Without fencing, if health check fails for all configured items in the current geo bucket, we failover to the next nearest geo bucket. With fencing, if health checking is enabled, as long as some targets in the current geo bucket are healthy, we return only the healthy targets. However, if all targets are unhealthy, we don't failover to the next nearest bucket; instead, we return all the items in the current bucket even when all targets are unhealthy.", + "type": "boolean" + }, + "item": { + "description": "The primary geo routing configuration. If there are multiple items with the same location, an error is returned instead.", + "items": { + "$ref": "GeoPolicyItem" + }, + "type": "array" + } + }, + "type": "object" + }, + "GeoPolicyItem": { + "description": "ResourceRecordSet data for one geo location.", + "id": "GeoPolicyItem", + "properties": { + "healthCheckedTargets": { + "$ref": "HealthCheckTargets", + "description": "For A and AAAA types only. Endpoints to return in the query result only if they are healthy. These can be specified along with `rrdata` within this item." + }, + "location": { + "description": "The geo-location granularity is a GCP region. This location string should correspond to a GCP region. e.g. \"us-east1\", \"southamerica-east1\", \"asia-east1\", etc.", + "type": "string" + }, + "rrdata": { + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "DNSSEC generated signatures for all the `rrdata` within this item. If health checked targets are provided for DNSSEC enabled zones, there's a restriction of 1 IP address per item.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GlueRecord": { "description": "Defines a host on your domain that is a DNS name server for your domain and/or other domains. Glue records are a way of making the IP address of a name server known, even when it serves DNS queries for its parent domain. For example, when `ns.example.com` is a name server for `example.com`, the host `ns.example.com` must have a glue record to break the circular DNS reference.", "id": "GlueRecord", @@ -1454,6 +1541,20 @@ }, "type": "object" }, + "HealthCheckTargets": { + "description": "HealthCheckTargets describes endpoints to health-check when responding to Routing Policy queries. Only the healthy endpoints will be included in the response.", + "id": "HealthCheckTargets", + "properties": { + "internalLoadBalancer": { + "description": "Configuration for internal load balancers to be health checked.", + "items": { + "$ref": "LoadBalancerTarget" + }, + "type": "array" + } + }, + "type": "object" + }, "ImportDomainRequest": { "deprecated": true, "description": "Deprecated: For more information, see [Cloud Domains feature deprecation](https://cloud.google.com/domains/docs/deprecations/feature-deprecations). Request for the `ImportDomain` method.", @@ -1538,6 +1639,63 @@ }, "type": "object" }, + "LoadBalancerTarget": { + "description": "The configuration for an individual load balancer to health check.", + "id": "LoadBalancerTarget", + "properties": { + "ipAddress": { + "description": "The frontend IP address of the load balancer to health check.", + "type": "string" + }, + "ipProtocol": { + "description": "The protocol of the load balancer to health check.", + "enum": [ + "UNDEFINED", + "TCP", + "UDP" + ], + "enumDescriptions": [ + "", + "Indicates the load balancer is accessible via TCP.", + "Indicates the load balancer is accessible via UDP." + ], + "type": "string" + }, + "loadBalancerType": { + "description": "The type of load balancer specified by this target. This value must match the configuration of the load balancer located at the LoadBalancerTarget's IP address, port, and region. Use the following: - *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. - *regionalL7ilb*: for a regional internal Application Load Balancer. - *globalL7ilb*: for a global internal Application Load Balancer. ", + "enum": [ + "NONE", + "GLOBAL_L7ILB", + "REGIONAL_L4ILB", + "REGIONAL_L7ILB" + ], + "enumDescriptions": [ + "", + "Indicates the load balancer is a Cross-Region Application Load Balancer.", + "Indicates the load balancer is a Regional Network Passthrough Load Balancer.", + "Indicates the load balancer is a Regional Application Load Balancer." + ], + "type": "string" + }, + "networkUrl": { + "description": "The fully qualified URL of the network that the load balancer is attached to. This should be formatted like `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}`.", + "type": "string" + }, + "port": { + "description": "The configured port of the load balancer.", + "type": "string" + }, + "project": { + "description": "The project ID in which the load balancer is located.", + "type": "string" + }, + "region": { + "description": "The region in which the load balancer is located.", + "type": "string" + } + }, + "type": "object" + }, "Location": { "description": "A resource that represents a Google Cloud location.", "id": "Location", @@ -1831,6 +1989,50 @@ }, "type": "object" }, + "PrimaryBackupPolicy": { + "description": "Configures a RRSetRoutingPolicy such that all queries are responded with the primary_targets if they are healthy. And if all of them are unhealthy, then we fallback to a geo localized policy.", + "id": "PrimaryBackupPolicy", + "properties": { + "backupGeoTargets": { + "$ref": "GeoPolicy", + "description": "Backup targets provide a regional failover policy for the otherwise global primary targets. If serving state is set to `BACKUP`, this policy essentially becomes a geo routing policy." + }, + "primaryTargets": { + "$ref": "HealthCheckTargets", + "description": "Endpoints that are health checked before making the routing decision. Unhealthy endpoints are omitted from the results. If all endpoints are unhealthy, we serve a response based on the `backup_geo_targets`." + }, + "trickleTraffic": { + "description": "When serving state is `PRIMARY`, this field provides the option of sending a small percentage of the traffic to the backup targets.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "RRSetRoutingPolicy": { + "description": "A RRSetRoutingPolicy represents ResourceRecordSet data that is returned dynamically with the response varying based on configured properties such as geolocation or by weighted random selection.", + "id": "RRSetRoutingPolicy", + "properties": { + "geo": { + "$ref": "GeoPolicy" + }, + "geoPolicy": { + "$ref": "GeoPolicy", + "deprecated": true + }, + "primaryBackup": { + "$ref": "PrimaryBackupPolicy" + }, + "wrr": { + "$ref": "WrrPolicy" + }, + "wrrPolicy": { + "$ref": "WrrPolicy", + "deprecated": true + } + }, + "type": "object" + }, "RegisterDomainRequest": { "description": "Request for the `RegisterDomain` method.", "id": "RegisterDomainRequest", @@ -2182,6 +2384,62 @@ "properties": {}, "type": "object" }, + "ResourceRecordSet": { + "description": "A unit of data that is returned by the DNS servers.", + "id": "ResourceRecordSet", + "properties": { + "name": { + "description": "For example, www.example.com.", + "type": "string" + }, + "routingPolicy": { + "$ref": "RRSetRoutingPolicy", + "description": "Configures dynamic query responses based on either the geo location of the querying user or a weighted round robin based routing policy. A valid `ResourceRecordSet` contains only `rrdata` (for static resolution) or a `routing_policy` (for dynamic resolution)." + }, + "rrdata": { + "description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.", + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "As defined in RFC 4034 (section 3.2).", + "items": { + "type": "string" + }, + "type": "array" + }, + "ttl": { + "description": "Number of seconds that this `ResourceRecordSet` can be cached by resolvers.", + "format": "int32", + "type": "integer" + }, + "type": { + "description": "The identifier of a supported record type. See the list of Supported DNS record types.", + "type": "string" + } + }, + "type": "object" + }, + "RetrieveGoogleDomainsDnsRecordsResponse": { + "description": "Response for the `RetrieveGoogleDomainsDnsRecords` method.", + "id": "RetrieveGoogleDomainsDnsRecordsResponse", + "properties": { + "nextPageToken": { + "description": "When present, there are more results to retrieve. Set `page_token` to this value on a subsequent call to get the next page of results.", + "type": "string" + }, + "rrset": { + "description": "The resource record set resources (DNS Zone records).", + "items": { + "$ref": "ResourceRecordSet" + }, + "type": "array" + } + }, + "type": "object" + }, "RetrieveGoogleDomainsForwardingConfigResponse": { "description": "Response for the `RetrieveGoogleDomainsForwardingConfig` method.", "id": "RetrieveGoogleDomainsForwardingConfigResponse", @@ -2438,6 +2696,48 @@ } }, "type": "object" + }, + "WrrPolicy": { + "description": "Configures a RRSetRoutingPolicy that routes in a weighted round robin fashion.", + "id": "WrrPolicy", + "properties": { + "item": { + "items": { + "$ref": "WrrPolicyItem" + }, + "type": "array" + } + }, + "type": "object" + }, + "WrrPolicyItem": { + "description": "A routing block which contains the routing information for one WRR item.", + "id": "WrrPolicyItem", + "properties": { + "healthCheckedTargets": { + "$ref": "HealthCheckTargets", + "description": "Endpoints that are health checked before making the routing decision. The unhealthy endpoints are omitted from the result. If all endpoints within a bucket are unhealthy, we choose a different bucket (sampled with respect to its weight) for responding. If DNSSEC is enabled for this zone, only one of `rrdata` or `health_checked_targets` can be set." + }, + "rrdata": { + "items": { + "type": "string" + }, + "type": "array" + }, + "signatureRrdata": { + "description": "DNSSEC generated signatures for all the `rrdata` within this item. Note that if health checked targets are provided for DNSSEC enabled zones, there's a restriction of 1 IP address per item.", + "items": { + "type": "string" + }, + "type": "array" + }, + "weight": { + "description": "The weight corresponding to this `WrrPolicyItem` object. When multiple `WrrPolicyItem` objects are configured, the probability of returning an `WrrPolicyItem` object's data is proportional to its weight relative to the sum of weights configured for all items. This weight must be non-negative.", + "format": "double", + "type": "number" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/domains/v1beta1/domains-gen.go b/domains/v1beta1/domains-gen.go index 31c469cac2d..3386bd61d4e 100644 --- a/domains/v1beta1/domains-gen.go +++ b/domains/v1beta1/domains-gen.go @@ -628,6 +628,17 @@ type DnsSettings struct { // (https://cloud.google.com/domains/docs/deprecations/feature-deprecations). // The free DNS zone provided by Google Domains (https://domains.google/). GoogleDomainsDns *GoogleDomainsDns `json:"googleDomainsDns,omitempty"` + // GoogleDomainsRedirectsDataAvailable: Output only. Indicates if this + // `Registration` has configured one of the following deprecated Google Domains + // DNS features: * Domain forwarding (HTTP `301` and `302` response status + // codes), * Email forwarding. See + // https://cloud.google.com/domains/docs/deprecations/feature-deprecations for + // more details. If any of these features is enabled call the + // `RetrieveGoogleDomainsForwardingConfig` method to get details about the + // feature's configuration. A forwarding configuration might not work correctly + // if required DNS records are not present in the domain's authoritative DNS + // Zone. + GoogleDomainsRedirectsDataAvailable bool `json:"googleDomainsRedirectsDataAvailable,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomDns") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -875,6 +886,71 @@ func (s *Expr) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GeoPolicy: Configures a `RRSetRoutingPolicy` that routes based on the geo +// location of the querying user. +type GeoPolicy struct { + // EnableFencing: Without fencing, if health check fails for all configured + // items in the current geo bucket, we failover to the next nearest geo bucket. + // With fencing, if health checking is enabled, as long as some targets in the + // current geo bucket are healthy, we return only the healthy targets. However, + // if all targets are unhealthy, we don't failover to the next nearest bucket; + // instead, we return all the items in the current bucket even when all targets + // are unhealthy. + EnableFencing bool `json:"enableFencing,omitempty"` + // Item: The primary geo routing configuration. If there are multiple items + // with the same location, an error is returned instead. + Item []*GeoPolicyItem `json:"item,omitempty"` + // ForceSendFields is a list of field names (e.g. "EnableFencing") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EnableFencing") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoPolicy) MarshalJSON() ([]byte, error) { + type NoMethod GeoPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GeoPolicyItem: ResourceRecordSet data for one geo location. +type GeoPolicyItem struct { + // HealthCheckedTargets: For A and AAAA types only. Endpoints to return in the + // query result only if they are healthy. These can be specified along with + // `rrdata` within this item. + HealthCheckedTargets *HealthCheckTargets `json:"healthCheckedTargets,omitempty"` + // Location: The geo-location granularity is a GCP region. This location string + // should correspond to a GCP region. e.g. "us-east1", "southamerica-east1", + // "asia-east1", etc. + Location string `json:"location,omitempty"` + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: DNSSEC generated signatures for all the `rrdata` within + // this item. If health checked targets are provided for DNSSEC enabled zones, + // there's a restriction of 1 IP address per item. + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // ForceSendFields is a list of field names (e.g. "HealthCheckedTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "HealthCheckedTargets") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoPolicyItem) MarshalJSON() ([]byte, error) { + type NoMethod GeoPolicyItem + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GlueRecord: Defines a host on your domain that is a DNS name server for your // domain and/or other domains. Glue records are a way of making the IP address // of a name server known, even when it serves DNS queries for its parent @@ -957,6 +1033,31 @@ func (s *GoogleDomainsDns) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// HealthCheckTargets: HealthCheckTargets describes endpoints to health-check +// when responding to Routing Policy queries. Only the healthy endpoints will +// be included in the response. +type HealthCheckTargets struct { + // InternalLoadBalancer: Configuration for internal load balancers to be health + // checked. + InternalLoadBalancer []*LoadBalancerTarget `json:"internalLoadBalancer,omitempty"` + // ForceSendFields is a list of field names (e.g. "InternalLoadBalancer") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "InternalLoadBalancer") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *HealthCheckTargets) MarshalJSON() ([]byte, error) { + type NoMethod HealthCheckTargets + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // ImportDomainRequest: Deprecated: For more information, see Cloud Domains // feature deprecation // (https://cloud.google.com/domains/docs/deprecations/feature-deprecations). @@ -1093,6 +1194,63 @@ func (s *ListRegistrationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// LoadBalancerTarget: The configuration for an individual load balancer to +// health check. +type LoadBalancerTarget struct { + // IpAddress: The frontend IP address of the load balancer to health check. + IpAddress string `json:"ipAddress,omitempty"` + // IpProtocol: The protocol of the load balancer to health check. + // + // Possible values: + // "UNDEFINED" + // "TCP" - Indicates the load balancer is accessible via TCP. + // "UDP" - Indicates the load balancer is accessible via UDP. + IpProtocol string `json:"ipProtocol,omitempty"` + // LoadBalancerType: The type of load balancer specified by this target. This + // value must match the configuration of the load balancer located at the + // LoadBalancerTarget's IP address, port, and region. Use the following: - + // *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. + // - *regionalL7ilb*: for a regional internal Application Load Balancer. - + // *globalL7ilb*: for a global internal Application Load Balancer. + // + // Possible values: + // "NONE" + // "GLOBAL_L7ILB" - Indicates the load balancer is a Cross-Region Application + // Load Balancer. + // "REGIONAL_L4ILB" - Indicates the load balancer is a Regional Network + // Passthrough Load Balancer. + // "REGIONAL_L7ILB" - Indicates the load balancer is a Regional Application + // Load Balancer. + LoadBalancerType string `json:"loadBalancerType,omitempty"` + // NetworkUrl: The fully qualified URL of the network that the load balancer is + // attached to. This should be formatted like + // `https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{ne + // twork}`. + NetworkUrl string `json:"networkUrl,omitempty"` + // Port: The configured port of the load balancer. + Port string `json:"port,omitempty"` + // Project: The project ID in which the load balancer is located. + Project string `json:"project,omitempty"` + // Region: The region in which the load balancer is located. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "IpAddress") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "IpAddress") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoadBalancerTarget) MarshalJSON() ([]byte, error) { + type NoMethod LoadBalancerTarget + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Location: A resource that represents a Google Cloud location. type Location struct { // DisplayName: The friendly name for this location, typically a nearby city @@ -1521,6 +1679,80 @@ func (s *PostalAddress) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// PrimaryBackupPolicy: Configures a RRSetRoutingPolicy such that all queries +// are responded with the primary_targets if they are healthy. And if all of +// them are unhealthy, then we fallback to a geo localized policy. +type PrimaryBackupPolicy struct { + // BackupGeoTargets: Backup targets provide a regional failover policy for the + // otherwise global primary targets. If serving state is set to `BACKUP`, this + // policy essentially becomes a geo routing policy. + BackupGeoTargets *GeoPolicy `json:"backupGeoTargets,omitempty"` + // PrimaryTargets: Endpoints that are health checked before making the routing + // decision. Unhealthy endpoints are omitted from the results. If all endpoints + // are unhealthy, we serve a response based on the `backup_geo_targets`. + PrimaryTargets *HealthCheckTargets `json:"primaryTargets,omitempty"` + // TrickleTraffic: When serving state is `PRIMARY`, this field provides the + // option of sending a small percentage of the traffic to the backup targets. + TrickleTraffic float64 `json:"trickleTraffic,omitempty"` + // ForceSendFields is a list of field names (e.g. "BackupGeoTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BackupGeoTargets") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PrimaryBackupPolicy) MarshalJSON() ([]byte, error) { + type NoMethod PrimaryBackupPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *PrimaryBackupPolicy) UnmarshalJSON(data []byte) error { + type NoMethod PrimaryBackupPolicy + var s1 struct { + TrickleTraffic gensupport.JSONFloat64 `json:"trickleTraffic"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.TrickleTraffic = float64(s1.TrickleTraffic) + return nil +} + +// RRSetRoutingPolicy: A RRSetRoutingPolicy represents ResourceRecordSet data +// that is returned dynamically with the response varying based on configured +// properties such as geolocation or by weighted random selection. +type RRSetRoutingPolicy struct { + Geo *GeoPolicy `json:"geo,omitempty"` + GeoPolicy *GeoPolicy `json:"geoPolicy,omitempty"` + PrimaryBackup *PrimaryBackupPolicy `json:"primaryBackup,omitempty"` + Wrr *WrrPolicy `json:"wrr,omitempty"` + WrrPolicy *WrrPolicy `json:"wrrPolicy,omitempty"` + // ForceSendFields is a list of field names (e.g. "Geo") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Geo") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RRSetRoutingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod RRSetRoutingPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // RegisterDomainRequest: Request for the `RegisterDomain` method. type RegisterDomainRequest struct { // ContactNotices: The list of contact notices that the caller acknowledges. @@ -1888,6 +2120,74 @@ func (s *RenewDomainRequest) MarshalJSON() ([]byte, error) { type ResetAuthorizationCodeRequest struct { } +// ResourceRecordSet: A unit of data that is returned by the DNS servers. +type ResourceRecordSet struct { + // Name: For example, www.example.com. + Name string `json:"name,omitempty"` + // RoutingPolicy: Configures dynamic query responses based on either the geo + // location of the querying user or a weighted round robin based routing + // policy. A valid `ResourceRecordSet` contains only `rrdata` (for static + // resolution) or a `routing_policy` (for dynamic resolution). + RoutingPolicy *RRSetRoutingPolicy `json:"routingPolicy,omitempty"` + // Rrdata: As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- + // see examples. + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: As defined in RFC 4034 (section 3.2). + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // Ttl: Number of seconds that this `ResourceRecordSet` can be cached by + // resolvers. + Ttl int64 `json:"ttl,omitempty"` + // Type: The identifier of a supported record type. See the list of Supported + // DNS record types. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "Name") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Name") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) { + type NoMethod ResourceRecordSet + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RetrieveGoogleDomainsDnsRecordsResponse: Response for the +// `RetrieveGoogleDomainsDnsRecords` method. +type RetrieveGoogleDomainsDnsRecordsResponse struct { + // NextPageToken: When present, there are more results to retrieve. Set + // `page_token` to this value on a subsequent call to get the next page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + // Rrset: The resource record set resources (DNS Zone records). + Rrset []*ResourceRecordSet `json:"rrset,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RetrieveGoogleDomainsDnsRecordsResponse) MarshalJSON() ([]byte, error) { + type NoMethod RetrieveGoogleDomainsDnsRecordsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // RetrieveGoogleDomainsForwardingConfigResponse: Response for the // `RetrieveGoogleDomainsForwardingConfig` method. type RetrieveGoogleDomainsForwardingConfigResponse struct { @@ -2267,6 +2567,80 @@ func (s *TransferParameters) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// WrrPolicy: Configures a RRSetRoutingPolicy that routes in a weighted round +// robin fashion. +type WrrPolicy struct { + Item []*WrrPolicyItem `json:"item,omitempty"` + // ForceSendFields is a list of field names (e.g. "Item") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Item") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WrrPolicy) MarshalJSON() ([]byte, error) { + type NoMethod WrrPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// WrrPolicyItem: A routing block which contains the routing information for +// one WRR item. +type WrrPolicyItem struct { + // HealthCheckedTargets: Endpoints that are health checked before making the + // routing decision. The unhealthy endpoints are omitted from the result. If + // all endpoints within a bucket are unhealthy, we choose a different bucket + // (sampled with respect to its weight) for responding. If DNSSEC is enabled + // for this zone, only one of `rrdata` or `health_checked_targets` can be set. + HealthCheckedTargets *HealthCheckTargets `json:"healthCheckedTargets,omitempty"` + Rrdata []string `json:"rrdata,omitempty"` + // SignatureRrdata: DNSSEC generated signatures for all the `rrdata` within + // this item. Note that if health checked targets are provided for DNSSEC + // enabled zones, there's a restriction of 1 IP address per item. + SignatureRrdata []string `json:"signatureRrdata,omitempty"` + // Weight: The weight corresponding to this `WrrPolicyItem` object. When + // multiple `WrrPolicyItem` objects are configured, the probability of + // returning an `WrrPolicyItem` object's data is proportional to its weight + // relative to the sum of weights configured for all items. This weight must be + // non-negative. + Weight float64 `json:"weight,omitempty"` + // ForceSendFields is a list of field names (e.g. "HealthCheckedTargets") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "HealthCheckedTargets") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WrrPolicyItem) MarshalJSON() ([]byte, error) { + type NoMethod WrrPolicyItem + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *WrrPolicyItem) UnmarshalJSON(data []byte) error { + type NoMethod WrrPolicyItem + var s1 struct { + Weight gensupport.JSONFloat64 `json:"weight"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Weight = float64(s1.Weight) + return nil +} + type ProjectsLocationsGetCall struct { s *Service name string @@ -4492,6 +4866,153 @@ func (c *ProjectsLocationsRegistrationsRetrieveAuthorizationCodeCall) Do(opts .. return ret, nil } +type ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall struct { + s *Service + registration string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// RetrieveGoogleDomainsDnsRecords: Lists the DNS records from the Google +// Domains DNS zone for domains that use the deprecated `google_domains_dns` in +// the `Registration`'s `dns_settings`. +// +// - registration: The name of the `Registration` whose Google Domains DNS +// records details you are retrieving, in the format +// `projects/*/locations/*/registrations/*`. +func (r *ProjectsLocationsRegistrationsService) RetrieveGoogleDomainsDnsRecords(registration string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c := &ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.registration = registration + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of results +// to return. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) PageSize(pageSize int64) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": When set to the +// `next_page_token` from a prior response, provides the next page of results. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) PageToken(pageToken string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) IfNoneMatch(entityTag string) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Context(ctx context.Context) *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+registration}:retrieveGoogleDomainsDnsRecords") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "registration": c.registration, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "domains.projects.locations.registrations.retrieveGoogleDomainsDnsRecords" call. +// Any non-2xx status code is an error. Response headers are in either +// *RetrieveGoogleDomainsDnsRecordsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Do(opts ...googleapi.CallOption) (*RetrieveGoogleDomainsDnsRecordsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RetrieveGoogleDomainsDnsRecordsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsRegistrationsRetrieveGoogleDomainsDnsRecordsCall) Pages(ctx context.Context, f func(*RetrieveGoogleDomainsDnsRecordsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + type ProjectsLocationsRegistrationsRetrieveGoogleDomainsForwardingConfigCall struct { s *Service registration string diff --git a/file/v1/file-api.json b/file/v1/file-api.json index e3004c7b550..fc1fef208b1 100644 --- a/file/v1/file-api.json +++ b/file/v1/file-api.json @@ -519,6 +519,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "promoteReplica": { + "description": "Promote an standby instance (replica).", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:promoteReplica", + "httpMethod": "POST", + "id": "file.projects.locations.instances.promoteReplica", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the instance, in the format `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:promoteReplica", + "request": { + "$ref": "PromoteReplicaRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "restore": { "description": "Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:restore", @@ -874,7 +902,7 @@ } } }, - "revision": "20240511", + "revision": "20240608", "rootUrl": "https://file.googleapis.com/", "schemas": { "Backup": { @@ -990,6 +1018,13 @@ "format": "int64", "readOnly": true, "type": "string" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: \"123/environment\": \"production\", \"123/costCenter\": \"marketing\"", + "type": "object" } }, "type": "object" @@ -1440,7 +1475,8 @@ "SUSPENDED", "SUSPENDING", "RESUMING", - "REVERTING" + "REVERTING", + "PROMOTING" ], "enumDescriptions": [ "State not set.", @@ -1453,7 +1489,8 @@ "The instance is suspended. You can get further details from the `suspension_reasons` field of the `Instance` resource.", "The instance is in the process of becoming suspended.", "The instance is in the process of becoming active.", - "The instance is reverting to a snapshot." + "The instance is reverting to a snapshot.", + "The replica instance is being promoted." ], "readOnly": true, "type": "string" @@ -1479,6 +1516,13 @@ "readOnly": true, "type": "array" }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: \"123/environment\": \"production\", \"123/costCenter\": \"marketing\"", + "type": "object" + }, "tier": { "description": "The service tier of the instance.", "enum": [ @@ -1894,6 +1938,12 @@ }, "type": "object" }, + "PromoteReplicaRequest": { + "description": "PromoteReplicaRequest promotes a Filestore standby instance (replica).", + "id": "PromoteReplicaRequest", + "properties": {}, + "type": "object" + }, "ReplicaConfig": { "description": "Replica configuration for the instance.", "id": "ReplicaConfig", @@ -2088,6 +2138,13 @@ ], "readOnly": true, "type": "string" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: \"123/environment\": \"production\", \"123/costCenter\": \"marketing\"", + "type": "object" } }, "type": "object" diff --git a/file/v1/file-gen.go b/file/v1/file-gen.go index 72bf8834e92..23839bf6ac7 100644 --- a/file/v1/file-gen.go +++ b/file/v1/file-gen.go @@ -295,6 +295,10 @@ type Backup struct { // backups share storage, this number is expected to change with backup // creation/deletion. StorageBytes int64 `json:"storageBytes,omitempty,string"` + // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to + // this resource. For example: "123/environment": "production", + // "123/costCenter": "marketing" + Tags map[string]string `json:"tags,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` @@ -886,6 +890,7 @@ type Instance struct { // "SUSPENDING" - The instance is in the process of becoming suspended. // "RESUMING" - The instance is in the process of becoming active. // "REVERTING" - The instance is reverting to a snapshot. + // "PROMOTING" - The replica instance is being promoted. State string `json:"state,omitempty"` // StatusMessage: Output only. Additional information about the instance state, // if available. @@ -898,6 +903,10 @@ type Instance struct { // "KMS_KEY_ISSUE" - The KMS key used by the instance is either revoked or // denied access to. SuspensionReasons []string `json:"suspensionReasons,omitempty"` + // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to + // this resource. For example: "123/environment": "production", + // "123/costCenter": "marketing" + Tags map[string]string `json:"tags,omitempty"` // Tier: The service tier of the instance. // // Possible values: @@ -1405,6 +1414,11 @@ func (s *OperationMetadata) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// PromoteReplicaRequest: PromoteReplicaRequest promotes a Filestore standby +// instance (replica). +type PromoteReplicaRequest struct { +} + // ReplicaConfig: Replica configuration for the instance. type ReplicaConfig struct { // LastActiveSyncTime: Output only. The timestamp of the latest replication @@ -1594,6 +1608,10 @@ type Snapshot struct { // "READY" - Snapshot is available for use. // "DELETING" - Snapshot is being deleted. State string `json:"state,omitempty"` + // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to + // this resource. For example: "123/environment": "production", + // "123/costCenter": "marketing" + Tags map[string]string `json:"tags,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` @@ -3204,6 +3222,108 @@ func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) ( return ret, nil } +type ProjectsLocationsInstancesPromoteReplicaCall struct { + s *Service + name string + promotereplicarequest *PromoteReplicaRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// PromoteReplica: Promote an standby instance (replica). +// +// - name: The resource name of the instance, in the format +// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. +func (r *ProjectsLocationsInstancesService) PromoteReplica(name string, promotereplicarequest *PromoteReplicaRequest) *ProjectsLocationsInstancesPromoteReplicaCall { + c := &ProjectsLocationsInstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.promotereplicarequest = promotereplicarequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsInstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPromoteReplicaCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsInstancesPromoteReplicaCall) Context(ctx context.Context) *ProjectsLocationsInstancesPromoteReplicaCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsInstancesPromoteReplicaCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsInstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotereplicarequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:promoteReplica") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "file.projects.locations.instances.promoteReplica" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsLocationsInstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsInstancesRestoreCall struct { s *Service name string diff --git a/file/v1beta1/file-api.json b/file/v1beta1/file-api.json index e55e2883888..572c163770d 100644 --- a/file/v1beta1/file-api.json +++ b/file/v1beta1/file-api.json @@ -1069,7 +1069,7 @@ } } }, - "revision": "20240511", + "revision": "20240608", "rootUrl": "https://file.googleapis.com/", "schemas": { "Backup": { @@ -1185,6 +1185,13 @@ "format": "int64", "readOnly": true, "type": "string" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: \"123/environment\": \"production\", \"123/costCenter\": \"marketing\"", + "type": "object" } }, "type": "object" @@ -1731,6 +1738,13 @@ "readOnly": true, "type": "array" }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: \"123/environment\": \"production\", \"123/costCenter\": \"marketing\"", + "type": "object" + }, "tier": { "description": "The service tier of the instance.", "enum": [ @@ -2475,6 +2489,13 @@ ], "readOnly": true, "type": "string" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: \"123/environment\": \"production\", \"123/costCenter\": \"marketing\"", + "type": "object" } }, "type": "object" diff --git a/file/v1beta1/file-gen.go b/file/v1beta1/file-gen.go index d1443716343..9f1b30fb8b5 100644 --- a/file/v1beta1/file-gen.go +++ b/file/v1beta1/file-gen.go @@ -306,6 +306,10 @@ type Backup struct { // backups share storage, this number is expected to change with backup // creation/deletion. StorageBytes int64 `json:"storageBytes,omitempty,string"` + // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to + // this resource. For example: "123/environment": "production", + // "123/costCenter": "marketing" + Tags map[string]string `json:"tags,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` @@ -962,6 +966,10 @@ type Instance struct { // "KMS_KEY_ISSUE" - The KMS key used by the instance is either revoked or // denied access to. SuspensionReasons []string `json:"suspensionReasons,omitempty"` + // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to + // this resource. For example: "123/environment": "production", + // "123/costCenter": "marketing" + Tags map[string]string `json:"tags,omitempty"` // Tier: The service tier of the instance. // // Possible values: @@ -1793,6 +1801,10 @@ type Snapshot struct { // "READY" - Snapshot is available for use. // "DELETING" - Snapshot is being deleted. State string `json:"state,omitempty"` + // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to + // this resource. For example: "123/environment": "production", + // "123/costCenter": "marketing" + Tags map[string]string `json:"tags,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` diff --git a/firebaseml/v2beta/firebaseml-api.json b/firebaseml/v2beta/firebaseml-api.json index 86ff2dd8ea2..97b99fc162c 100644 --- a/firebaseml/v2beta/firebaseml-api.json +++ b/firebaseml/v2beta/firebaseml-api.json @@ -206,7 +206,7 @@ } } }, - "revision": "20240611", + "revision": "20240617", "rootUrl": "https://firebaseml.googleapis.com/", "schemas": { "Date": { @@ -728,10 +728,136 @@ "properties": {}, "type": "object" }, + "GoogleCloudAiplatformV1beta1GroundingAttribution": { + "description": "Grounding attribution.", + "id": "GoogleCloudAiplatformV1beta1GroundingAttribution", + "properties": { + "confidenceScore": { + "description": "Optional. Output only. Confidence score of the attribution. Ranges from 0 to 1. 1 is the most confident.", + "format": "float", + "readOnly": true, + "type": "number" + }, + "retrievedContext": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext", + "description": "Optional. Attribution from context retrieved by the retrieval tools." + }, + "segment": { + "$ref": "GoogleCloudAiplatformV1beta1Segment", + "description": "Output only. Segment of the content this attribution belongs to.", + "readOnly": true + }, + "web": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingAttributionWeb", + "description": "Optional. Attribution from the web." + } + }, + "type": "object" + }, + "GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext": { + "description": "Attribution from context retrieved by the retrieval tools.", + "id": "GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext", + "properties": { + "title": { + "description": "Output only. Title of the attribution.", + "readOnly": true, + "type": "string" + }, + "uri": { + "description": "Output only. URI reference of the attribution.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudAiplatformV1beta1GroundingAttributionWeb": { + "description": "Attribution from the web.", + "id": "GoogleCloudAiplatformV1beta1GroundingAttributionWeb", + "properties": { + "title": { + "description": "Output only. Title of the attribution.", + "readOnly": true, + "type": "string" + }, + "uri": { + "description": "Output only. URI reference of the attribution.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudAiplatformV1beta1GroundingChunk": { + "description": "Grounding chunk.", + "id": "GoogleCloudAiplatformV1beta1GroundingChunk", + "properties": { + "retrievedContext": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext", + "description": "Grounding chunk from context retrieved by the retrieval tools." + }, + "web": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingChunkWeb", + "description": "Grounding chunk from the web." + } + }, + "type": "object" + }, + "GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext": { + "description": "Chunk from context retrieved by the retrieval tools.", + "id": "GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext", + "properties": { + "title": { + "description": "Title of the attribution.", + "type": "string" + }, + "uri": { + "description": "URI reference of the attribution.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudAiplatformV1beta1GroundingChunkWeb": { + "description": "Chunk from the web.", + "id": "GoogleCloudAiplatformV1beta1GroundingChunkWeb", + "properties": { + "title": { + "description": "Title of the chunk.", + "type": "string" + }, + "uri": { + "description": "URI reference of the chunk.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudAiplatformV1beta1GroundingMetadata": { "description": "Metadata returned to client when grounding is enabled.", "id": "GoogleCloudAiplatformV1beta1GroundingMetadata", "properties": { + "groundingAttributions": { + "description": "Optional. List of grounding attributions.", + "items": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingAttribution" + }, + "type": "array" + }, + "groundingChunks": { + "description": "List of supporting references retrieved from specified grounding source.", + "items": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingChunk" + }, + "type": "array" + }, + "groundingSupports": { + "description": "Optional. List of grounding support.", + "items": { + "$ref": "GoogleCloudAiplatformV1beta1GroundingSupport" + }, + "type": "array" + }, "retrievalQueries": { "description": "Optional. Queries executed by the retrieval tools.", "items": { @@ -753,6 +879,33 @@ }, "type": "object" }, + "GoogleCloudAiplatformV1beta1GroundingSupport": { + "description": "Grounding support.", + "id": "GoogleCloudAiplatformV1beta1GroundingSupport", + "properties": { + "confidenceScores": { + "description": "Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices.", + "items": { + "format": "float", + "type": "number" + }, + "type": "array" + }, + "groundingChunkIndices": { + "description": "A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.", + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + }, + "segment": { + "$ref": "GoogleCloudAiplatformV1beta1Segment", + "description": "Segment of the content this support belongs to." + } + }, + "type": "object" + }, "GoogleCloudAiplatformV1beta1Part": { "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.", "id": "GoogleCloudAiplatformV1beta1Part", @@ -1079,6 +1232,36 @@ }, "type": "object" }, + "GoogleCloudAiplatformV1beta1Segment": { + "description": "Segment of the content.", + "id": "GoogleCloudAiplatformV1beta1Segment", + "properties": { + "endIndex": { + "description": "Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "partIndex": { + "description": "Output only. The index of a Part object within its parent Content object.", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "startIndex": { + "description": "Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.", + "format": "int32", + "readOnly": true, + "type": "integer" + }, + "text": { + "description": "Output only. The text corresponding to the segment from the response.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudAiplatformV1beta1Tool": { "description": "Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).", "id": "GoogleCloudAiplatformV1beta1Tool", diff --git a/firebaseml/v2beta/firebaseml-gen.go b/firebaseml/v2beta/firebaseml-gen.go index e15d1fffc3c..dd684157f22 100644 --- a/firebaseml/v2beta/firebaseml-gen.go +++ b/firebaseml/v2beta/firebaseml-gen.go @@ -852,9 +852,184 @@ func (s *GoogleCloudAiplatformV1beta1GenerationConfig) UnmarshalJSON(data []byte type GoogleCloudAiplatformV1beta1GoogleSearchRetrieval struct { } +// GoogleCloudAiplatformV1beta1GroundingAttribution: Grounding attribution. +type GoogleCloudAiplatformV1beta1GroundingAttribution struct { + // ConfidenceScore: Optional. Output only. Confidence score of the attribution. + // Ranges from 0 to 1. 1 is the most confident. + ConfidenceScore float64 `json:"confidenceScore,omitempty"` + // RetrievedContext: Optional. Attribution from context retrieved by the + // retrieval tools. + RetrievedContext *GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext `json:"retrievedContext,omitempty"` + // Segment: Output only. Segment of the content this attribution belongs to. + Segment *GoogleCloudAiplatformV1beta1Segment `json:"segment,omitempty"` + // Web: Optional. Attribution from the web. + Web *GoogleCloudAiplatformV1beta1GroundingAttributionWeb `json:"web,omitempty"` + // ForceSendFields is a list of field names (e.g. "ConfidenceScore") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConfidenceScore") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingAttribution) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingAttribution + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudAiplatformV1beta1GroundingAttribution) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudAiplatformV1beta1GroundingAttribution + var s1 struct { + ConfidenceScore gensupport.JSONFloat64 `json:"confidenceScore"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ConfidenceScore = float64(s1.ConfidenceScore) + return nil +} + +// GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext: +// Attribution from context retrieved by the retrieval tools. +type GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext struct { + // Title: Output only. Title of the attribution. + Title string `json:"title,omitempty"` + // Uri: Output only. URI reference of the attribution. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Title") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Title") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingAttributionRetrievedContext + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudAiplatformV1beta1GroundingAttributionWeb: Attribution from the +// web. +type GoogleCloudAiplatformV1beta1GroundingAttributionWeb struct { + // Title: Output only. Title of the attribution. + Title string `json:"title,omitempty"` + // Uri: Output only. URI reference of the attribution. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Title") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Title") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingAttributionWeb) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingAttributionWeb + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudAiplatformV1beta1GroundingChunk: Grounding chunk. +type GoogleCloudAiplatformV1beta1GroundingChunk struct { + // RetrievedContext: Grounding chunk from context retrieved by the retrieval + // tools. + RetrievedContext *GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext `json:"retrievedContext,omitempty"` + // Web: Grounding chunk from the web. + Web *GoogleCloudAiplatformV1beta1GroundingChunkWeb `json:"web,omitempty"` + // ForceSendFields is a list of field names (e.g. "RetrievedContext") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "RetrievedContext") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingChunk) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingChunk + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext: Chunk from +// context retrieved by the retrieval tools. +type GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext struct { + // Title: Title of the attribution. + Title string `json:"title,omitempty"` + // Uri: URI reference of the attribution. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Title") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Title") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingChunkRetrievedContext + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudAiplatformV1beta1GroundingChunkWeb: Chunk from the web. +type GoogleCloudAiplatformV1beta1GroundingChunkWeb struct { + // Title: Title of the chunk. + Title string `json:"title,omitempty"` + // Uri: URI reference of the chunk. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Title") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Title") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingChunkWeb) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingChunkWeb + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudAiplatformV1beta1GroundingMetadata: Metadata returned to client // when grounding is enabled. type GoogleCloudAiplatformV1beta1GroundingMetadata struct { + // GroundingAttributions: Optional. List of grounding attributions. + GroundingAttributions []*GoogleCloudAiplatformV1beta1GroundingAttribution `json:"groundingAttributions,omitempty"` + // GroundingChunks: List of supporting references retrieved from specified + // grounding source. + GroundingChunks []*GoogleCloudAiplatformV1beta1GroundingChunk `json:"groundingChunks,omitempty"` + // GroundingSupports: Optional. List of grounding support. + GroundingSupports []*GoogleCloudAiplatformV1beta1GroundingSupport `json:"groundingSupports,omitempty"` // RetrievalQueries: Optional. Queries executed by the retrieval tools. RetrievalQueries []string `json:"retrievalQueries,omitempty"` // SearchEntryPoint: Optional. Google search entry for the following-up web @@ -863,15 +1038,15 @@ type GoogleCloudAiplatformV1beta1GroundingMetadata struct { // WebSearchQueries: Optional. Web search queries for the following-up web // search. WebSearchQueries []string `json:"webSearchQueries,omitempty"` - // ForceSendFields is a list of field names (e.g. "RetrievalQueries") to + // ForceSendFields is a list of field names (e.g. "GroundingAttributions") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "RetrievalQueries") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See + // NullFields is a list of field names (e.g. "GroundingAttributions") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -881,6 +1056,54 @@ func (s *GoogleCloudAiplatformV1beta1GroundingMetadata) MarshalJSON() ([]byte, e return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudAiplatformV1beta1GroundingSupport: Grounding support. +type GoogleCloudAiplatformV1beta1GroundingSupport struct { + // ConfidenceScores: Confidence score of the support references. Ranges from 0 + // to 1. 1 is the most confident. This list must have the same size as the + // grounding_chunk_indices. + ConfidenceScores []float64 `json:"confidenceScores,omitempty"` + // GroundingChunkIndices: A list of indices (into 'grounding_chunk') specifying + // the citations associated with the claim. For instance [1,3,4] means that + // grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved + // content attributed to the claim. + GroundingChunkIndices []int64 `json:"groundingChunkIndices,omitempty"` + // Segment: Segment of the content this support belongs to. + Segment *GoogleCloudAiplatformV1beta1Segment `json:"segment,omitempty"` + // ForceSendFields is a list of field names (e.g. "ConfidenceScores") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConfidenceScores") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1GroundingSupport) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1GroundingSupport + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudAiplatformV1beta1GroundingSupport) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudAiplatformV1beta1GroundingSupport + var s1 struct { + ConfidenceScores []gensupport.JSONFloat64 `json:"confidenceScores"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ConfidenceScores = make([]float64, len(s1.ConfidenceScores)) + for i := range s1.ConfidenceScores { + s.ConfidenceScores[i] = float64(s1.ConfidenceScores[i]) + } + return nil +} + // GoogleCloudAiplatformV1beta1Part: A datatype containing media that is part // of a multi-part `Content` message. A `Part` consists of data which has an // associated datatype. A `Part` can only contain one of the accepted types in @@ -1200,6 +1423,37 @@ func (s *GoogleCloudAiplatformV1beta1SearchEntryPoint) MarshalJSON() ([]byte, er return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudAiplatformV1beta1Segment: Segment of the content. +type GoogleCloudAiplatformV1beta1Segment struct { + // EndIndex: Output only. End index in the given Part, measured in bytes. + // Offset from the start of the Part, exclusive, starting at zero. + EndIndex int64 `json:"endIndex,omitempty"` + // PartIndex: Output only. The index of a Part object within its parent Content + // object. + PartIndex int64 `json:"partIndex,omitempty"` + // StartIndex: Output only. Start index in the given Part, measured in bytes. + // Offset from the start of the Part, inclusive, starting at zero. + StartIndex int64 `json:"startIndex,omitempty"` + // Text: Output only. The text corresponding to the segment from the response. + Text string `json:"text,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndIndex") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndIndex") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudAiplatformV1beta1Segment) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudAiplatformV1beta1Segment + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudAiplatformV1beta1Tool: Tool details that the model may use to // generate response. A `Tool` is a piece of code that enables the system to // interact with external systems to perform an action, or set of actions, diff --git a/healthcare/v1/healthcare-api.json b/healthcare/v1/healthcare-api.json index 26505f53657..b5a840dd6cd 100644 --- a/healthcare/v1/healthcare-api.json +++ b/healthcare/v1/healthcare-api.json @@ -4554,7 +4554,7 @@ } } }, - "revision": "20240429", + "revision": "20240605", "rootUrl": "https://healthcare.googleapis.com/", "schemas": { "ActivateConsentRequest": { @@ -5084,12 +5084,16 @@ "description": "A message representing a health dataset. A health dataset represents a collection of healthcare data pertaining to one or more patients. This may include multiple modalities of healthcare data, such as electronic medical records or medical imaging data.", "id": "Dataset", "properties": { + "encryptionSpec": { + "$ref": "EncryptionSpec", + "description": "Optional. Customer-managed encryption key spec for a Dataset. If set, this Dataset and all of its sub-resources will be secured by this key. If empty, the Dataset is secured by the default Google encryption key." + }, "name": { "description": "Identifier. Resource name of the dataset, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.", "type": "string" }, "timeZone": { - "description": "The default timezone used by this dataset. Must be a either a valid IANA time zone name such as \"America/New_York\" or empty, which defaults to UTC. This is used for parsing times in resources, such as HL7 messages, where no explicit timezone is specified.", + "description": "Optional. The default timezone used by this dataset. Must be a either a valid IANA time zone name such as \"America/New_York\" or empty, which defaults to UTC. This is used for parsing times in resources, such as HL7 messages, where no explicit timezone is specified.", "type": "string" } }, @@ -5347,6 +5351,17 @@ "properties": {}, "type": "object" }, + "EncryptionSpec": { + "description": "Represents a customer-managed encryption key spec that can be applied to a resource.", + "id": "EncryptionSpec", + "properties": { + "kmsKeyName": { + "description": "Required. The resource name of customer-managed encryption key that is used to secure a resource and its sub-resources. Only the key in the same location as this Dataset is allowed to be used for encryption. Format is: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + } + }, + "type": "object" + }, "Entity": { "description": "The candidate entities that an entity mention could link to.", "id": "Entity", diff --git a/healthcare/v1/healthcare-gen.go b/healthcare/v1/healthcare-gen.go index ff06cf23cb6..9ea7f2ff1f1 100644 --- a/healthcare/v1/healthcare-gen.go +++ b/healthcare/v1/healthcare-gen.go @@ -1218,26 +1218,31 @@ func (s *CryptoHashConfig) MarshalJSON() ([]byte, error) { // patients. This may include multiple modalities of healthcare data, such as // electronic medical records or medical imaging data. type Dataset struct { + // EncryptionSpec: Optional. Customer-managed encryption key spec for a + // Dataset. If set, this Dataset and all of its sub-resources will be secured + // by this key. If empty, the Dataset is secured by the default Google + // encryption key. + EncryptionSpec *EncryptionSpec `json:"encryptionSpec,omitempty"` // Name: Identifier. Resource name of the dataset, of the form // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. Name string `json:"name,omitempty"` - // TimeZone: The default timezone used by this dataset. Must be a either a - // valid IANA time zone name such as "America/New_York" or empty, which - // defaults to UTC. This is used for parsing times in resources, such as HL7 - // messages, where no explicit timezone is specified. + // TimeZone: Optional. The default timezone used by this dataset. Must be a + // either a valid IANA time zone name such as "America/New_York" or empty, + // which defaults to UTC. This is used for parsing times in resources, such as + // HL7 messages, where no explicit timezone is specified. TimeZone string `json:"timeZone,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Name") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Name") to include in API requests - // with the JSON null value. By default, fields with empty values are omitted - // from API requests. See + // NullFields is a list of field names (e.g. "EncryptionSpec") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -1652,6 +1657,33 @@ type Empty struct { googleapi.ServerResponse `json:"-"` } +// EncryptionSpec: Represents a customer-managed encryption key spec that can +// be applied to a resource. +type EncryptionSpec struct { + // KmsKeyName: Required. The resource name of customer-managed encryption key + // that is used to secure a resource and its sub-resources. Only the key in the + // same location as this Dataset is allowed to be used for encryption. Format + // is: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + KmsKeyName string `json:"kmsKeyName,omitempty"` + // ForceSendFields is a list of field names (e.g. "KmsKeyName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "KmsKeyName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod EncryptionSpec + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Entity: The candidate entities that an entity mention could link to. type Entity struct { // EntityId: entity_id is a first class field entity_id uniquely identifies diff --git a/healthcare/v1beta1/healthcare-api.json b/healthcare/v1beta1/healthcare-api.json index 5706ead608c..3d372508452 100644 --- a/healthcare/v1beta1/healthcare-api.json +++ b/healthcare/v1beta1/healthcare-api.json @@ -5672,7 +5672,7 @@ } } }, - "revision": "20240521", + "revision": "20240605", "rootUrl": "https://healthcare.googleapis.com/", "schemas": { "AccessDeterminationLogConfig": { @@ -6681,6 +6681,10 @@ "description": "A message representing a health dataset. A health dataset represents a collection of healthcare data pertaining to one or more patients. This may include multiple modalities of healthcare data, such as electronic medical records or medical imaging data.", "id": "Dataset", "properties": { + "encryptionSpec": { + "$ref": "EncryptionSpec", + "description": "Customer-managed encryption key spec for a Dataset. If set, this Dataset and all of its sub-resources will be secured by this key. If empty, the Dataset is secured by the default Google encryption key." + }, "name": { "description": "Identifier. Resource name of the dataset, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.", "type": "string" @@ -7035,6 +7039,17 @@ "properties": {}, "type": "object" }, + "EncryptionSpec": { + "description": "Represents a customer-managed encryption key spec that can be applied to a resource.", + "id": "EncryptionSpec", + "properties": { + "kmsKeyName": { + "description": "Required. The resource name of customer-managed encryption key that is used to secure a resource and its sub-resources. Only the key in the same location as this dataset is allowed to be used for encryption. Format is: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`", + "type": "string" + } + }, + "type": "object" + }, "Entity": { "description": "The candidate entities that an entity mention could link to.", "id": "Entity", diff --git a/healthcare/v1beta1/healthcare-gen.go b/healthcare/v1beta1/healthcare-gen.go index 4f724443dda..22d3af3dd23 100644 --- a/healthcare/v1beta1/healthcare-gen.go +++ b/healthcare/v1beta1/healthcare-gen.go @@ -2027,6 +2027,10 @@ type CryptoHashField struct { // patients. This may include multiple modalities of healthcare data, such as // electronic medical records or medical imaging data. type Dataset struct { + // EncryptionSpec: Customer-managed encryption key spec for a Dataset. If set, + // this Dataset and all of its sub-resources will be secured by this key. If + // empty, the Dataset is secured by the default Google encryption key. + EncryptionSpec *EncryptionSpec `json:"encryptionSpec,omitempty"` // Name: Identifier. Resource name of the dataset, of the form // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. Name string `json:"name,omitempty"` @@ -2038,15 +2042,15 @@ type Dataset struct { // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Name") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See + // ForceSendFields is a list of field names (e.g. "EncryptionSpec") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Name") to include in API requests - // with the JSON null value. By default, fields with empty values are omitted - // from API requests. See + // NullFields is a list of field names (e.g. "EncryptionSpec") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -2577,6 +2581,33 @@ type Empty struct { googleapi.ServerResponse `json:"-"` } +// EncryptionSpec: Represents a customer-managed encryption key spec that can +// be applied to a resource. +type EncryptionSpec struct { + // KmsKeyName: Required. The resource name of customer-managed encryption key + // that is used to secure a resource and its sub-resources. Only the key in the + // same location as this dataset is allowed to be used for encryption. Format + // is: + // `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + KmsKeyName string `json:"kmsKeyName,omitempty"` + // ForceSendFields is a list of field names (e.g. "KmsKeyName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "KmsKeyName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *EncryptionSpec) MarshalJSON() ([]byte, error) { + type NoMethod EncryptionSpec + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Entity: The candidate entities that an entity mention could link to. type Entity struct { // EntityId: entity_id is a first class field entity_id uniquely identifies diff --git a/iam/v1/iam-api.json b/iam/v1/iam-api.json index aacbc83fc93..e01dfa655c9 100644 --- a/iam/v1/iam-api.json +++ b/iam/v1/iam-api.json @@ -3216,7 +3216,7 @@ } } }, - "revision": "20240530", + "revision": "20240617", "rootUrl": "https://iam.googleapis.com/", "schemas": { "AccessRestrictions": { @@ -3718,7 +3718,7 @@ "id": "GoogleIamAdminV1WorkforcePoolProviderSaml", "properties": { "idpMetadataXml": { - "description": "Required. SAML Identity provider configuration metadata xml doc. The xml document should comply with [SAML 2.0 specification](https://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf). The max size of the acceptable xml document will be bounded to 128k characters. The metadata xml document should satisfy the following constraints: 1) Must contain an Identity Provider Entity ID. 2) Must contain at least one non-expired signing key certificate. 3) For each signing key: a) Valid from should be no more than 7 days from now. b) Valid to should be no more than 15 years in the future. 4) Up to 3 IdP signing keys are allowed in the metadata xml. When updating the provider's metadata xml, at least one non-expired signing key must overlap with the existing metadata. This requirement is skipped if there are no non-expired signing keys present in the existing metadata.", + "description": "Required. SAML Identity provider configuration metadata xml doc. The xml document should comply with [SAML 2.0 specification](https://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf). The max size of the acceptable xml document will be bounded to 128k characters. The metadata xml document should satisfy the following constraints: 1) Must contain an Identity Provider Entity ID. 2) Must contain at least one non-expired signing key certificate. 3) For each signing key: a) Valid from should be no more than 7 days from now. b) Valid to should be no more than 20 years in the future. 4) Up to 3 IdP signing keys are allowed in the metadata xml. When updating the provider's metadata xml, at least one non-expired signing key must overlap with the existing metadata. This requirement is skipped if there are no non-expired signing keys present in the existing metadata.", "type": "string" } }, @@ -4631,7 +4631,7 @@ "id": "Saml", "properties": { "idpMetadataXml": { - "description": "Required. SAML identity provider (IdP) configuration metadata XML doc. The XML document must comply with the [SAML 2.0 specification](https://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf). The maximum size of an acceptable XML document is 128K characters. The SAML metadata XML document must satisfy the following constraints: * Must contain an IdP Entity ID. * Must contain at least one non-expired signing certificate. * For each signing certificate, the expiration must be: * From no more than 7 days in the future. * To no more than 15 years in the future. * Up to three IdP signing keys are allowed. When updating the provider's metadata XML, at least one non-expired signing key must overlap with the existing metadata. This requirement is skipped if there are no non-expired signing keys present in the existing metadata.", + "description": "Required. SAML identity provider (IdP) configuration metadata XML doc. The XML document must comply with the [SAML 2.0 specification](https://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf). The maximum size of an acceptable XML document is 128K characters. The SAML metadata XML document must satisfy the following constraints: * Must contain an IdP Entity ID. * Must contain at least one non-expired signing certificate. * For each signing certificate, the expiration must be: * From no more than 7 days in the future. * To no more than 20 years in the future. * Up to three IdP signing keys are allowed. When updating the provider's metadata XML, at least one non-expired signing key must overlap with the existing metadata. This requirement is skipped if there are no non-expired signing keys present in the existing metadata.", "type": "string" } }, diff --git a/iam/v1/iam-gen.go b/iam/v1/iam-gen.go index 2b457fc84e4..33f6f7b3e2d 100644 --- a/iam/v1/iam-gen.go +++ b/iam/v1/iam-gen.go @@ -1407,7 +1407,7 @@ type GoogleIamAdminV1WorkforcePoolProviderSaml struct { // constraints: 1) Must contain an Identity Provider Entity ID. 2) Must contain // at least one non-expired signing key certificate. 3) For each signing key: // a) Valid from should be no more than 7 days from now. b) Valid to should be - // no more than 15 years in the future. 4) Up to 3 IdP signing keys are allowed + // no more than 20 years in the future. 4) Up to 3 IdP signing keys are allowed // in the metadata xml. When updating the provider's metadata xml, at least one // non-expired signing key must overlap with the existing metadata. This // requirement is skipped if there are no non-expired signing keys present in @@ -2677,7 +2677,7 @@ type Saml struct { // metadata XML document must satisfy the following constraints: * Must contain // an IdP Entity ID. * Must contain at least one non-expired signing // certificate. * For each signing certificate, the expiration must be: * From - // no more than 7 days in the future. * To no more than 15 years in the future. + // no more than 7 days in the future. * To no more than 20 years in the future. // * Up to three IdP signing keys are allowed. When updating the provider's // metadata XML, at least one non-expired signing key must overlap with the // existing metadata. This requirement is skipped if there are no non-expired diff --git a/iap/v1/iap-api.json b/iap/v1/iap-api.json index 259ce3792f3..4d5a80ebcd6 100644 --- a/iap/v1/iap-api.json +++ b/iap/v1/iap-api.json @@ -682,7 +682,7 @@ } } }, - "revision": "20240527", + "revision": "20240617", "rootUrl": "https://iap.googleapis.com/", "schemas": { "AccessDeniedPageSettings": { @@ -1058,6 +1058,22 @@ }, "type": "object" }, + "NextStateOfTags": { + "description": "Used for calculating the next state of tags on the resource being passed for the CheckCustomConstraints RPC call. The detail evaluation of each field is described in go/op-create-update-time-tags and go/tags-in-orgpolicy-requests.", + "id": "NextStateOfTags", + "properties": { + "tagsFullState": { + "$ref": "TagsFullState" + }, + "tagsFullStateForChildResource": { + "$ref": "TagsFullStateForChildResource" + }, + "tagsPartialState": { + "$ref": "TagsPartialState" + } + }, + "type": "object" + }, "OAuth2": { "description": "The OAuth 2.0 Settings", "id": "OAuth2", @@ -1241,6 +1257,10 @@ "description": "The **relative** name of the resource, which is the URI path of the resource without the leading \"/\". See https://cloud.google.com/iam/docs/conditions-resource-attributes#resource-name for examples used by other GCP Services. This field is **required** for services integrated with resource-attribute-based IAM conditions and/or CustomOrgPolicy. This field requires special handling for parents-only permissions such as `create` and `list`. See the document linked below for further details. See go/iam-conditions-sig-g3#populate-resource-attributes for specific details on populating this field.", "type": "string" }, + "nextStateOfTags": { + "$ref": "NextStateOfTags", + "description": "Used for calculating the next state of tags on the resource being passed for Custom Org Policy enforcement. NOTE: Only one of the tags representations (i.e. numeric or namespaced) should be populated. The input tags will be converted to the same representation before the calculation. This behavior intentionally may differ from other tags related fields in CheckPolicy request, which may require both formats to be passed in. IMPORTANT: If tags are unchanged, this field should not be set." + }, "service": { "description": "The name of the service this resource belongs to. It is configured using the official_service_name of the Service as defined in service configurations under //configs/cloud/resourcetypes. For example, the official_service_name of cloud resource manager service is set as 'cloudresourcemanager.googleapis.com' according to //configs/cloud/resourcetypes/google/cloud/resourcemanager/prod.yaml This field is **required** for services integrated with resource-attribute-based IAM conditions and/or CustomOrgPolicy. This field requires special handling for parents-only permissions such as `create` and `list`. See the document linked below for further details. See go/iam-conditions-sig-g3#populate-resource-attributes for specific details on populating this field.", "type": "string" @@ -1263,6 +1283,52 @@ }, "type": "object" }, + "TagsFullState": { + "id": "TagsFullState", + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "If TagsFullState is initialized, the values in this field fully represent all the tags in the next state (the current tag values are not used). If tags.size() == 0, the next state of tags would be no tags for evaluation purposes. Only one type of tags reference (numeric or namespace) is required to be passed.", + "type": "object" + } + }, + "type": "object" + }, + "TagsFullStateForChildResource": { + "id": "TagsFullStateForChildResource", + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "If TagsFullStateForChildResource is initialized, the values in this field represent all the tags in the next state for the child resource. Only one type of tags reference (numeric or namespace) is required to be passed. IMPORTANT: This field should only be used when the target resource IAM policy name is UNKNOWN and the resource's parent IAM policy name is being passed in the request.", + "type": "object" + } + }, + "type": "object" + }, + "TagsPartialState": { + "id": "TagsPartialState", + "properties": { + "tagKeysToRemove": { + "description": "Keys of the tags that should be removed for evaluation purposes. IMPORTANT: Currently only numeric references are supported. Once support for namespace references is added, both the tag references (numeric and namespace) will be removed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "tagsToUpsert": { + "additionalProperties": { + "type": "string" + }, + "description": "Tags that’ll be updated or added to the current state of tags for evaluation purposes. If a key exists in both \"tags_to_upsert\" and \"tag_keys_to_remove\", the one in \"tag_keys_to_remove\" is ignored. Only one type of tags reference (numeric or namespace) is required to be passed.", + "type": "object" + } + }, + "type": "object" + }, "TestIamPermissionsRequest": { "description": "Request message for `TestIamPermissions` method.", "id": "TestIamPermissionsRequest", diff --git a/iap/v1/iap-gen.go b/iap/v1/iap-gen.go index 3b821f122c2..4731e168f4d 100644 --- a/iap/v1/iap-gen.go +++ b/iap/v1/iap-gen.go @@ -903,6 +903,32 @@ func (s *ListTunnelDestGroupsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// NextStateOfTags: Used for calculating the next state of tags on the resource +// being passed for the CheckCustomConstraints RPC call. The detail evaluation +// of each field is described in go/op-create-update-time-tags and +// go/tags-in-orgpolicy-requests. +type NextStateOfTags struct { + TagsFullState *TagsFullState `json:"tagsFullState,omitempty"` + TagsFullStateForChildResource *TagsFullStateForChildResource `json:"tagsFullStateForChildResource,omitempty"` + TagsPartialState *TagsPartialState `json:"tagsPartialState,omitempty"` + // ForceSendFields is a list of field names (e.g. "TagsFullState") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "TagsFullState") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *NextStateOfTags) MarshalJSON() ([]byte, error) { + type NoMethod NextStateOfTags + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // OAuth2: The OAuth 2.0 Settings type OAuth2 struct { // ClientId: The OAuth 2.0 client ID registered in the workforce identity @@ -1210,6 +1236,14 @@ type Resource struct { // further details. See go/iam-conditions-sig-g3#populate-resource-attributes // for specific details on populating this field. Name string `json:"name,omitempty"` + // NextStateOfTags: Used for calculating the next state of tags on the resource + // being passed for Custom Org Policy enforcement. NOTE: Only one of the tags + // representations (i.e. numeric or namespaced) should be populated. The input + // tags will be converted to the same representation before the calculation. + // This behavior intentionally may differ from other tags related fields in + // CheckPolicy request, which may require both formats to be passed in. + // IMPORTANT: If tags are unchanged, this field should not be set. + NextStateOfTags *NextStateOfTags `json:"nextStateOfTags,omitempty"` // Service: The name of the service this resource belongs to. It is configured // using the official_service_name of the Service as defined in service // configurations under //configs/cloud/resourcetypes. For example, the @@ -1278,6 +1312,86 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +type TagsFullState struct { + // Tags: If TagsFullState is initialized, the values in this field fully + // represent all the tags in the next state (the current tag values are not + // used). If tags.size() == 0, the next state of tags would be no tags for + // evaluation purposes. Only one type of tags reference (numeric or namespace) + // is required to be passed. + Tags map[string]string `json:"tags,omitempty"` + // ForceSendFields is a list of field names (e.g. "Tags") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Tags") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TagsFullState) MarshalJSON() ([]byte, error) { + type NoMethod TagsFullState + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type TagsFullStateForChildResource struct { + // Tags: If TagsFullStateForChildResource is initialized, the values in this + // field represent all the tags in the next state for the child resource. Only + // one type of tags reference (numeric or namespace) is required to be passed. + // IMPORTANT: This field should only be used when the target resource IAM + // policy name is UNKNOWN and the resource's parent IAM policy name is being + // passed in the request. + Tags map[string]string `json:"tags,omitempty"` + // ForceSendFields is a list of field names (e.g. "Tags") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Tags") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TagsFullStateForChildResource) MarshalJSON() ([]byte, error) { + type NoMethod TagsFullStateForChildResource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type TagsPartialState struct { + // TagKeysToRemove: Keys of the tags that should be removed for evaluation + // purposes. IMPORTANT: Currently only numeric references are supported. Once + // support for namespace references is added, both the tag references (numeric + // and namespace) will be removed. + TagKeysToRemove []string `json:"tagKeysToRemove,omitempty"` + // TagsToUpsert: Tags that’ll be updated or added to the current state of + // tags for evaluation purposes. If a key exists in both "tags_to_upsert" and + // "tag_keys_to_remove", the one in "tag_keys_to_remove" is ignored. Only one + // type of tags reference (numeric or namespace) is required to be passed. + TagsToUpsert map[string]string `json:"tagsToUpsert,omitempty"` + // ForceSendFields is a list of field names (e.g. "TagKeysToRemove") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "TagKeysToRemove") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TagsPartialState) MarshalJSON() ([]byte, error) { + type NoMethod TagsPartialState + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // TestIamPermissionsRequest: Request message for `TestIamPermissions` method. type TestIamPermissionsRequest struct { // Permissions: The set of permissions to check for the `resource`. Permissions diff --git a/jobs/v3/jobs-api.json b/jobs/v3/jobs-api.json index d0e295a1bc4..c265740e822 100644 --- a/jobs/v3/jobs-api.json +++ b/jobs/v3/jobs-api.json @@ -652,7 +652,7 @@ } } }, - "revision": "20230906", + "revision": "20240614", "rootUrl": "https://jobs.googleapis.com/", "schemas": { "ApplicationInfo": { @@ -2248,20 +2248,6 @@ }, "type": "object" }, - "MendelDebugInput": { - "description": "Message representing input to a Mendel server for debug forcing. See go/mendel-debug-forcing for more details. Next ID: 2", - "id": "MendelDebugInput", - "properties": { - "namespacedDebugInput": { - "additionalProperties": { - "$ref": "NamespacedDebugInput" - }, - "description": "When a request spans multiple servers, a MendelDebugInput may travel with the request and take effect in all the servers. This field is a map of namespaces to NamespacedMendelDebugInput protos. In a single server, up to two NamespacedMendelDebugInput protos are applied: 1. NamespacedMendelDebugInput with the global namespace (key == \"\"). 2. NamespacedMendelDebugInput with the server's namespace. When both NamespacedMendelDebugInput protos are present, they are merged. See go/mendel-debug-forcing for more details.", - "type": "object" - } - }, - "type": "object" - }, "Money": { "description": "Represents an amount of money with its currency type.", "id": "Money", @@ -2283,119 +2269,6 @@ }, "type": "object" }, - "NamespacedDebugInput": { - "description": "Next ID: 16", - "id": "NamespacedDebugInput", - "properties": { - "absolutelyForcedExpNames": { - "description": "Set of experiment names to be absolutely forced. These experiments will be forced without evaluating the conditions.", - "items": { - "type": "string" - }, - "type": "array" - }, - "absolutelyForcedExpTags": { - "description": "Set of experiment tags to be absolutely forced. The experiments with these tags will be forced without evaluating the conditions.", - "items": { - "type": "string" - }, - "type": "array" - }, - "absolutelyForcedExps": { - "description": "Set of experiment ids to be absolutely forced. These ids will be forced without evaluating the conditions.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "conditionallyForcedExpNames": { - "description": "Set of experiment names to be conditionally forced. These experiments will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "type": "string" - }, - "type": "array" - }, - "conditionallyForcedExpTags": { - "description": "Set of experiment tags to be conditionally forced. The experiments with these tags will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "type": "string" - }, - "type": "array" - }, - "conditionallyForcedExps": { - "description": "Set of experiment ids to be conditionally forced. These ids will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "disableAutomaticEnrollmentSelection": { - "description": "If true, disable automatic enrollment selection (at all diversion points). Automatic enrollment selection means experiment selection process based on the experiment's automatic enrollment condition. This does not disable selection of forced experiments. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "disableExpNames": { - "description": "Set of experiment names to be disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together. If a name corresponds to a domain, the domain itself and all descendant experiments and domains are disabled together.", - "items": { - "type": "string" - }, - "type": "array" - }, - "disableExpTags": { - "description": "Set of experiment tags to be disabled. All experiments that are tagged with one or more of these tags are disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together.", - "items": { - "type": "string" - }, - "type": "array" - }, - "disableExps": { - "description": "Set of experiment ids to be disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together. If an ID corresponds to a domain, the domain itself and all descendant experiments and domains are disabled together.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "disableManualEnrollmentSelection": { - "description": "If true, disable manual enrollment selection (at all diversion points). Manual enrollment selection means experiment selection process based on the request's manual enrollment states (a.k.a. opt-in experiments). This does not disable selection of forced experiments. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "disableOrganicSelection": { - "description": "If true, disable organic experiment selection (at all diversion points). Organic selection means experiment selection process based on traffic allocation and diversion condition evaluation. This does not disable selection of forced experiments. This is useful in cases when it is not known whether experiment selection behavior is responsible for a error or breakage. Disabling organic selection may help to isolate the cause of a given problem. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "forcedFlags": { - "additionalProperties": { - "type": "string" - }, - "description": "Flags to force in a particular experiment state. Map from flag name to flag value.", - "type": "object" - }, - "forcedRollouts": { - "additionalProperties": { - "type": "boolean" - }, - "description": "Rollouts to force in a particular experiment state. Map from rollout name to rollout value.", - "type": "object" - }, - "testingMode": { - "description": "Sets different testing modes. See the documentation in the TestingMode message for more information.", - "enum": [ - "TESTING_MODE_UNSPECIFIED", - "TESTING_MODE_ALL_OFF", - "TESTING_MODE_ALL_ON" - ], - "enumDescriptions": [ - "", - "", - "" - ], - "type": "string" - } - }, - "type": "object" - }, "NumericBucketingOption": { "description": "Input only. Use this field to specify bucketing option for the histogram search response.", "id": "NumericBucketingOption", diff --git a/jobs/v3/jobs-gen.go b/jobs/v3/jobs-gen.go index 285cb10d4c1..9d844c84e4c 100644 --- a/jobs/v3/jobs-gen.go +++ b/jobs/v3/jobs-gen.go @@ -2276,36 +2276,6 @@ func (s *MatchingJob) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// MendelDebugInput: Message representing input to a Mendel server for debug -// forcing. See go/mendel-debug-forcing for more details. Next ID: 2 -type MendelDebugInput struct { - // NamespacedDebugInput: When a request spans multiple servers, a - // MendelDebugInput may travel with the request and take effect in all the - // servers. This field is a map of namespaces to NamespacedMendelDebugInput - // protos. In a single server, up to two NamespacedMendelDebugInput protos are - // applied: 1. NamespacedMendelDebugInput with the global namespace (key == - // ""). 2. NamespacedMendelDebugInput with the server's namespace. When both - // NamespacedMendelDebugInput protos are present, they are merged. See - // go/mendel-debug-forcing for more details. - NamespacedDebugInput map[string]NamespacedDebugInput `json:"namespacedDebugInput,omitempty"` - // ForceSendFields is a list of field names (e.g. "NamespacedDebugInput") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NamespacedDebugInput") to include - // in API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *MendelDebugInput) MarshalJSON() ([]byte, error) { - type NoMethod MendelDebugInput - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // Money: Represents an amount of money with its currency type. type Money struct { // CurrencyCode: The three-letter currency code defined in ISO 4217. @@ -2337,105 +2307,6 @@ func (s *Money) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// NamespacedDebugInput: Next ID: 16 -type NamespacedDebugInput struct { - // AbsolutelyForcedExpNames: Set of experiment names to be absolutely forced. - // These experiments will be forced without evaluating the conditions. - AbsolutelyForcedExpNames []string `json:"absolutelyForcedExpNames,omitempty"` - // AbsolutelyForcedExpTags: Set of experiment tags to be absolutely forced. The - // experiments with these tags will be forced without evaluating the - // conditions. - AbsolutelyForcedExpTags []string `json:"absolutelyForcedExpTags,omitempty"` - // AbsolutelyForcedExps: Set of experiment ids to be absolutely forced. These - // ids will be forced without evaluating the conditions. - AbsolutelyForcedExps []int64 `json:"absolutelyForcedExps,omitempty"` - // ConditionallyForcedExpNames: Set of experiment names to be conditionally - // forced. These experiments will be forced only if their conditions and their - // parent domain's conditions are true. - ConditionallyForcedExpNames []string `json:"conditionallyForcedExpNames,omitempty"` - // ConditionallyForcedExpTags: Set of experiment tags to be conditionally - // forced. The experiments with these tags will be forced only if their - // conditions and their parent domain's conditions are true. - ConditionallyForcedExpTags []string `json:"conditionallyForcedExpTags,omitempty"` - // ConditionallyForcedExps: Set of experiment ids to be conditionally forced. - // These ids will be forced only if their conditions and their parent domain's - // conditions are true. - ConditionallyForcedExps []int64 `json:"conditionallyForcedExps,omitempty"` - // DisableAutomaticEnrollmentSelection: If true, disable automatic enrollment - // selection (at all diversion points). Automatic enrollment selection means - // experiment selection process based on the experiment's automatic enrollment - // condition. This does not disable selection of forced experiments. Setting - // this field to false does not change anything in the experiment selection - // process. - DisableAutomaticEnrollmentSelection bool `json:"disableAutomaticEnrollmentSelection,omitempty"` - // DisableExpNames: Set of experiment names to be disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. If a name - // corresponds to a domain, the domain itself and all descendant experiments - // and domains are disabled together. - DisableExpNames []string `json:"disableExpNames,omitempty"` - // DisableExpTags: Set of experiment tags to be disabled. All experiments that - // are tagged with one or more of these tags are disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. - DisableExpTags []string `json:"disableExpTags,omitempty"` - // DisableExps: Set of experiment ids to be disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. If an ID - // corresponds to a domain, the domain itself and all descendant experiments - // and domains are disabled together. - DisableExps []int64 `json:"disableExps,omitempty"` - // DisableManualEnrollmentSelection: If true, disable manual enrollment - // selection (at all diversion points). Manual enrollment selection means - // experiment selection process based on the request's manual enrollment states - // (a.k.a. opt-in experiments). This does not disable selection of forced - // experiments. Setting this field to false does not change anything in the - // experiment selection process. - DisableManualEnrollmentSelection bool `json:"disableManualEnrollmentSelection,omitempty"` - // DisableOrganicSelection: If true, disable organic experiment selection (at - // all diversion points). Organic selection means experiment selection process - // based on traffic allocation and diversion condition evaluation. This does - // not disable selection of forced experiments. This is useful in cases when it - // is not known whether experiment selection behavior is responsible for a - // error or breakage. Disabling organic selection may help to isolate the cause - // of a given problem. Setting this field to false does not change anything in - // the experiment selection process. - DisableOrganicSelection bool `json:"disableOrganicSelection,omitempty"` - // ForcedFlags: Flags to force in a particular experiment state. Map from flag - // name to flag value. - ForcedFlags map[string]string `json:"forcedFlags,omitempty"` - // ForcedRollouts: Rollouts to force in a particular experiment state. Map from - // rollout name to rollout value. - ForcedRollouts map[string]bool `json:"forcedRollouts,omitempty"` - // TestingMode: Sets different testing modes. See the documentation in the - // TestingMode message for more information. - // - // Possible values: - // "TESTING_MODE_UNSPECIFIED" - // "TESTING_MODE_ALL_OFF" - // "TESTING_MODE_ALL_ON" - TestingMode string `json:"testingMode,omitempty"` - // ForceSendFields is a list of field names (e.g. "AbsolutelyForcedExpNames") - // to unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AbsolutelyForcedExpNames") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *NamespacedDebugInput) MarshalJSON() ([]byte, error) { - type NoMethod NamespacedDebugInput - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // NumericBucketingOption: Input only. Use this field to specify bucketing // option for the histogram search response. type NumericBucketingOption struct { diff --git a/jobs/v3p1beta1/jobs-api.json b/jobs/v3p1beta1/jobs-api.json index d04ece33e2b..c771224c2f3 100644 --- a/jobs/v3p1beta1/jobs-api.json +++ b/jobs/v3p1beta1/jobs-api.json @@ -682,7 +682,7 @@ } } }, - "revision": "20230906", + "revision": "20240614", "rootUrl": "https://jobs.googleapis.com/", "schemas": { "ApplicationInfo": { @@ -2352,20 +2352,6 @@ }, "type": "object" }, - "MendelDebugInput": { - "description": "Message representing input to a Mendel server for debug forcing. See go/mendel-debug-forcing for more details. Next ID: 2", - "id": "MendelDebugInput", - "properties": { - "namespacedDebugInput": { - "additionalProperties": { - "$ref": "NamespacedDebugInput" - }, - "description": "When a request spans multiple servers, a MendelDebugInput may travel with the request and take effect in all the servers. This field is a map of namespaces to NamespacedMendelDebugInput protos. In a single server, up to two NamespacedMendelDebugInput protos are applied: 1. NamespacedMendelDebugInput with the global namespace (key == \"\"). 2. NamespacedMendelDebugInput with the server's namespace. When both NamespacedMendelDebugInput protos are present, they are merged. See go/mendel-debug-forcing for more details.", - "type": "object" - } - }, - "type": "object" - }, "Money": { "description": "Represents an amount of money with its currency type.", "id": "Money", @@ -2387,119 +2373,6 @@ }, "type": "object" }, - "NamespacedDebugInput": { - "description": "Next ID: 16", - "id": "NamespacedDebugInput", - "properties": { - "absolutelyForcedExpNames": { - "description": "Set of experiment names to be absolutely forced. These experiments will be forced without evaluating the conditions.", - "items": { - "type": "string" - }, - "type": "array" - }, - "absolutelyForcedExpTags": { - "description": "Set of experiment tags to be absolutely forced. The experiments with these tags will be forced without evaluating the conditions.", - "items": { - "type": "string" - }, - "type": "array" - }, - "absolutelyForcedExps": { - "description": "Set of experiment ids to be absolutely forced. These ids will be forced without evaluating the conditions.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "conditionallyForcedExpNames": { - "description": "Set of experiment names to be conditionally forced. These experiments will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "type": "string" - }, - "type": "array" - }, - "conditionallyForcedExpTags": { - "description": "Set of experiment tags to be conditionally forced. The experiments with these tags will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "type": "string" - }, - "type": "array" - }, - "conditionallyForcedExps": { - "description": "Set of experiment ids to be conditionally forced. These ids will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "disableAutomaticEnrollmentSelection": { - "description": "If true, disable automatic enrollment selection (at all diversion points). Automatic enrollment selection means experiment selection process based on the experiment's automatic enrollment condition. This does not disable selection of forced experiments. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "disableExpNames": { - "description": "Set of experiment names to be disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together. If a name corresponds to a domain, the domain itself and all descendant experiments and domains are disabled together.", - "items": { - "type": "string" - }, - "type": "array" - }, - "disableExpTags": { - "description": "Set of experiment tags to be disabled. All experiments that are tagged with one or more of these tags are disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together.", - "items": { - "type": "string" - }, - "type": "array" - }, - "disableExps": { - "description": "Set of experiment ids to be disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together. If an ID corresponds to a domain, the domain itself and all descendant experiments and domains are disabled together.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "disableManualEnrollmentSelection": { - "description": "If true, disable manual enrollment selection (at all diversion points). Manual enrollment selection means experiment selection process based on the request's manual enrollment states (a.k.a. opt-in experiments). This does not disable selection of forced experiments. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "disableOrganicSelection": { - "description": "If true, disable organic experiment selection (at all diversion points). Organic selection means experiment selection process based on traffic allocation and diversion condition evaluation. This does not disable selection of forced experiments. This is useful in cases when it is not known whether experiment selection behavior is responsible for a error or breakage. Disabling organic selection may help to isolate the cause of a given problem. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "forcedFlags": { - "additionalProperties": { - "type": "string" - }, - "description": "Flags to force in a particular experiment state. Map from flag name to flag value.", - "type": "object" - }, - "forcedRollouts": { - "additionalProperties": { - "type": "boolean" - }, - "description": "Rollouts to force in a particular experiment state. Map from rollout name to rollout value.", - "type": "object" - }, - "testingMode": { - "description": "Sets different testing modes. See the documentation in the TestingMode message for more information.", - "enum": [ - "TESTING_MODE_UNSPECIFIED", - "TESTING_MODE_ALL_OFF", - "TESTING_MODE_ALL_ON" - ], - "enumDescriptions": [ - "", - "", - "" - ], - "type": "string" - } - }, - "type": "object" - }, "NumericBucketingOption": { "description": "Input only. Use this field to specify bucketing option for the histogram search response.", "id": "NumericBucketingOption", diff --git a/jobs/v3p1beta1/jobs-gen.go b/jobs/v3p1beta1/jobs-gen.go index 38bd457edd4..91a0f358a89 100644 --- a/jobs/v3p1beta1/jobs-gen.go +++ b/jobs/v3p1beta1/jobs-gen.go @@ -2467,36 +2467,6 @@ func (s *MatchingJob) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// MendelDebugInput: Message representing input to a Mendel server for debug -// forcing. See go/mendel-debug-forcing for more details. Next ID: 2 -type MendelDebugInput struct { - // NamespacedDebugInput: When a request spans multiple servers, a - // MendelDebugInput may travel with the request and take effect in all the - // servers. This field is a map of namespaces to NamespacedMendelDebugInput - // protos. In a single server, up to two NamespacedMendelDebugInput protos are - // applied: 1. NamespacedMendelDebugInput with the global namespace (key == - // ""). 2. NamespacedMendelDebugInput with the server's namespace. When both - // NamespacedMendelDebugInput protos are present, they are merged. See - // go/mendel-debug-forcing for more details. - NamespacedDebugInput map[string]NamespacedDebugInput `json:"namespacedDebugInput,omitempty"` - // ForceSendFields is a list of field names (e.g. "NamespacedDebugInput") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NamespacedDebugInput") to include - // in API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *MendelDebugInput) MarshalJSON() ([]byte, error) { - type NoMethod MendelDebugInput - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // Money: Represents an amount of money with its currency type. type Money struct { // CurrencyCode: The three-letter currency code defined in ISO 4217. @@ -2528,105 +2498,6 @@ func (s *Money) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// NamespacedDebugInput: Next ID: 16 -type NamespacedDebugInput struct { - // AbsolutelyForcedExpNames: Set of experiment names to be absolutely forced. - // These experiments will be forced without evaluating the conditions. - AbsolutelyForcedExpNames []string `json:"absolutelyForcedExpNames,omitempty"` - // AbsolutelyForcedExpTags: Set of experiment tags to be absolutely forced. The - // experiments with these tags will be forced without evaluating the - // conditions. - AbsolutelyForcedExpTags []string `json:"absolutelyForcedExpTags,omitempty"` - // AbsolutelyForcedExps: Set of experiment ids to be absolutely forced. These - // ids will be forced without evaluating the conditions. - AbsolutelyForcedExps []int64 `json:"absolutelyForcedExps,omitempty"` - // ConditionallyForcedExpNames: Set of experiment names to be conditionally - // forced. These experiments will be forced only if their conditions and their - // parent domain's conditions are true. - ConditionallyForcedExpNames []string `json:"conditionallyForcedExpNames,omitempty"` - // ConditionallyForcedExpTags: Set of experiment tags to be conditionally - // forced. The experiments with these tags will be forced only if their - // conditions and their parent domain's conditions are true. - ConditionallyForcedExpTags []string `json:"conditionallyForcedExpTags,omitempty"` - // ConditionallyForcedExps: Set of experiment ids to be conditionally forced. - // These ids will be forced only if their conditions and their parent domain's - // conditions are true. - ConditionallyForcedExps []int64 `json:"conditionallyForcedExps,omitempty"` - // DisableAutomaticEnrollmentSelection: If true, disable automatic enrollment - // selection (at all diversion points). Automatic enrollment selection means - // experiment selection process based on the experiment's automatic enrollment - // condition. This does not disable selection of forced experiments. Setting - // this field to false does not change anything in the experiment selection - // process. - DisableAutomaticEnrollmentSelection bool `json:"disableAutomaticEnrollmentSelection,omitempty"` - // DisableExpNames: Set of experiment names to be disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. If a name - // corresponds to a domain, the domain itself and all descendant experiments - // and domains are disabled together. - DisableExpNames []string `json:"disableExpNames,omitempty"` - // DisableExpTags: Set of experiment tags to be disabled. All experiments that - // are tagged with one or more of these tags are disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. - DisableExpTags []string `json:"disableExpTags,omitempty"` - // DisableExps: Set of experiment ids to be disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. If an ID - // corresponds to a domain, the domain itself and all descendant experiments - // and domains are disabled together. - DisableExps []int64 `json:"disableExps,omitempty"` - // DisableManualEnrollmentSelection: If true, disable manual enrollment - // selection (at all diversion points). Manual enrollment selection means - // experiment selection process based on the request's manual enrollment states - // (a.k.a. opt-in experiments). This does not disable selection of forced - // experiments. Setting this field to false does not change anything in the - // experiment selection process. - DisableManualEnrollmentSelection bool `json:"disableManualEnrollmentSelection,omitempty"` - // DisableOrganicSelection: If true, disable organic experiment selection (at - // all diversion points). Organic selection means experiment selection process - // based on traffic allocation and diversion condition evaluation. This does - // not disable selection of forced experiments. This is useful in cases when it - // is not known whether experiment selection behavior is responsible for a - // error or breakage. Disabling organic selection may help to isolate the cause - // of a given problem. Setting this field to false does not change anything in - // the experiment selection process. - DisableOrganicSelection bool `json:"disableOrganicSelection,omitempty"` - // ForcedFlags: Flags to force in a particular experiment state. Map from flag - // name to flag value. - ForcedFlags map[string]string `json:"forcedFlags,omitempty"` - // ForcedRollouts: Rollouts to force in a particular experiment state. Map from - // rollout name to rollout value. - ForcedRollouts map[string]bool `json:"forcedRollouts,omitempty"` - // TestingMode: Sets different testing modes. See the documentation in the - // TestingMode message for more information. - // - // Possible values: - // "TESTING_MODE_UNSPECIFIED" - // "TESTING_MODE_ALL_OFF" - // "TESTING_MODE_ALL_ON" - TestingMode string `json:"testingMode,omitempty"` - // ForceSendFields is a list of field names (e.g. "AbsolutelyForcedExpNames") - // to unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AbsolutelyForcedExpNames") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *NamespacedDebugInput) MarshalJSON() ([]byte, error) { - type NoMethod NamespacedDebugInput - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // NumericBucketingOption: Input only. Use this field to specify bucketing // option for the histogram search response. type NumericBucketingOption struct { diff --git a/jobs/v4/jobs-api.json b/jobs/v4/jobs-api.json index 21937bf1bcc..86981177cc4 100644 --- a/jobs/v4/jobs-api.json +++ b/jobs/v4/jobs-api.json @@ -903,7 +903,7 @@ } } }, - "revision": "20230906", + "revision": "20240614", "rootUrl": "https://jobs.googleapis.com/", "schemas": { "ApplicationInfo": { @@ -2443,20 +2443,6 @@ }, "type": "object" }, - "MendelDebugInput": { - "description": "Message representing input to a Mendel server for debug forcing. See go/mendel-debug-forcing for more details. Next ID: 2", - "id": "MendelDebugInput", - "properties": { - "namespacedDebugInput": { - "additionalProperties": { - "$ref": "NamespacedDebugInput" - }, - "description": "When a request spans multiple servers, a MendelDebugInput may travel with the request and take effect in all the servers. This field is a map of namespaces to NamespacedMendelDebugInput protos. In a single server, up to two NamespacedMendelDebugInput protos are applied: 1. NamespacedMendelDebugInput with the global namespace (key == \"\"). 2. NamespacedMendelDebugInput with the server's namespace. When both NamespacedMendelDebugInput protos are present, they are merged. See go/mendel-debug-forcing for more details.", - "type": "object" - } - }, - "type": "object" - }, "Money": { "description": "Represents an amount of money with its currency type.", "id": "Money", @@ -2478,119 +2464,6 @@ }, "type": "object" }, - "NamespacedDebugInput": { - "description": "Next ID: 16", - "id": "NamespacedDebugInput", - "properties": { - "absolutelyForcedExpNames": { - "description": "Set of experiment names to be absolutely forced. These experiments will be forced without evaluating the conditions.", - "items": { - "type": "string" - }, - "type": "array" - }, - "absolutelyForcedExpTags": { - "description": "Set of experiment tags to be absolutely forced. The experiments with these tags will be forced without evaluating the conditions.", - "items": { - "type": "string" - }, - "type": "array" - }, - "absolutelyForcedExps": { - "description": "Set of experiment ids to be absolutely forced. These ids will be forced without evaluating the conditions.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "conditionallyForcedExpNames": { - "description": "Set of experiment names to be conditionally forced. These experiments will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "type": "string" - }, - "type": "array" - }, - "conditionallyForcedExpTags": { - "description": "Set of experiment tags to be conditionally forced. The experiments with these tags will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "type": "string" - }, - "type": "array" - }, - "conditionallyForcedExps": { - "description": "Set of experiment ids to be conditionally forced. These ids will be forced only if their conditions and their parent domain's conditions are true.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "disableAutomaticEnrollmentSelection": { - "description": "If true, disable automatic enrollment selection (at all diversion points). Automatic enrollment selection means experiment selection process based on the experiment's automatic enrollment condition. This does not disable selection of forced experiments. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "disableExpNames": { - "description": "Set of experiment names to be disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together. If a name corresponds to a domain, the domain itself and all descendant experiments and domains are disabled together.", - "items": { - "type": "string" - }, - "type": "array" - }, - "disableExpTags": { - "description": "Set of experiment tags to be disabled. All experiments that are tagged with one or more of these tags are disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together.", - "items": { - "type": "string" - }, - "type": "array" - }, - "disableExps": { - "description": "Set of experiment ids to be disabled. If an experiment is disabled, it is never selected nor forced. If an aggregate experiment is disabled, its partitions are disabled together. If an experiment with an enrollment is disabled, the enrollment is disabled together. If an ID corresponds to a domain, the domain itself and all descendant experiments and domains are disabled together.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - }, - "disableManualEnrollmentSelection": { - "description": "If true, disable manual enrollment selection (at all diversion points). Manual enrollment selection means experiment selection process based on the request's manual enrollment states (a.k.a. opt-in experiments). This does not disable selection of forced experiments. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "disableOrganicSelection": { - "description": "If true, disable organic experiment selection (at all diversion points). Organic selection means experiment selection process based on traffic allocation and diversion condition evaluation. This does not disable selection of forced experiments. This is useful in cases when it is not known whether experiment selection behavior is responsible for a error or breakage. Disabling organic selection may help to isolate the cause of a given problem. Setting this field to false does not change anything in the experiment selection process.", - "type": "boolean" - }, - "forcedFlags": { - "additionalProperties": { - "type": "string" - }, - "description": "Flags to force in a particular experiment state. Map from flag name to flag value.", - "type": "object" - }, - "forcedRollouts": { - "additionalProperties": { - "type": "boolean" - }, - "description": "Rollouts to force in a particular experiment state. Map from rollout name to rollout value.", - "type": "object" - }, - "testingMode": { - "description": "Sets different testing modes. See the documentation in the TestingMode message for more information.", - "enum": [ - "TESTING_MODE_UNSPECIFIED", - "TESTING_MODE_ALL_OFF", - "TESTING_MODE_ALL_ON" - ], - "enumDescriptions": [ - "", - "", - "" - ], - "type": "string" - } - }, - "type": "object" - }, "Operation": { "description": "This resource represents a long-running operation that is the result of a network API call.", "id": "Operation", diff --git a/jobs/v4/jobs-gen.go b/jobs/v4/jobs-gen.go index dfe00983992..2cafee8e11a 100644 --- a/jobs/v4/jobs-gen.go +++ b/jobs/v4/jobs-gen.go @@ -2223,36 +2223,6 @@ func (s *MatchingJob) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// MendelDebugInput: Message representing input to a Mendel server for debug -// forcing. See go/mendel-debug-forcing for more details. Next ID: 2 -type MendelDebugInput struct { - // NamespacedDebugInput: When a request spans multiple servers, a - // MendelDebugInput may travel with the request and take effect in all the - // servers. This field is a map of namespaces to NamespacedMendelDebugInput - // protos. In a single server, up to two NamespacedMendelDebugInput protos are - // applied: 1. NamespacedMendelDebugInput with the global namespace (key == - // ""). 2. NamespacedMendelDebugInput with the server's namespace. When both - // NamespacedMendelDebugInput protos are present, they are merged. See - // go/mendel-debug-forcing for more details. - NamespacedDebugInput map[string]NamespacedDebugInput `json:"namespacedDebugInput,omitempty"` - // ForceSendFields is a list of field names (e.g. "NamespacedDebugInput") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NamespacedDebugInput") to include - // in API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *MendelDebugInput) MarshalJSON() ([]byte, error) { - type NoMethod MendelDebugInput - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // Money: Represents an amount of money with its currency type. type Money struct { // CurrencyCode: The three-letter currency code defined in ISO 4217. @@ -2284,105 +2254,6 @@ func (s *Money) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// NamespacedDebugInput: Next ID: 16 -type NamespacedDebugInput struct { - // AbsolutelyForcedExpNames: Set of experiment names to be absolutely forced. - // These experiments will be forced without evaluating the conditions. - AbsolutelyForcedExpNames []string `json:"absolutelyForcedExpNames,omitempty"` - // AbsolutelyForcedExpTags: Set of experiment tags to be absolutely forced. The - // experiments with these tags will be forced without evaluating the - // conditions. - AbsolutelyForcedExpTags []string `json:"absolutelyForcedExpTags,omitempty"` - // AbsolutelyForcedExps: Set of experiment ids to be absolutely forced. These - // ids will be forced without evaluating the conditions. - AbsolutelyForcedExps []int64 `json:"absolutelyForcedExps,omitempty"` - // ConditionallyForcedExpNames: Set of experiment names to be conditionally - // forced. These experiments will be forced only if their conditions and their - // parent domain's conditions are true. - ConditionallyForcedExpNames []string `json:"conditionallyForcedExpNames,omitempty"` - // ConditionallyForcedExpTags: Set of experiment tags to be conditionally - // forced. The experiments with these tags will be forced only if their - // conditions and their parent domain's conditions are true. - ConditionallyForcedExpTags []string `json:"conditionallyForcedExpTags,omitempty"` - // ConditionallyForcedExps: Set of experiment ids to be conditionally forced. - // These ids will be forced only if their conditions and their parent domain's - // conditions are true. - ConditionallyForcedExps []int64 `json:"conditionallyForcedExps,omitempty"` - // DisableAutomaticEnrollmentSelection: If true, disable automatic enrollment - // selection (at all diversion points). Automatic enrollment selection means - // experiment selection process based on the experiment's automatic enrollment - // condition. This does not disable selection of forced experiments. Setting - // this field to false does not change anything in the experiment selection - // process. - DisableAutomaticEnrollmentSelection bool `json:"disableAutomaticEnrollmentSelection,omitempty"` - // DisableExpNames: Set of experiment names to be disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. If a name - // corresponds to a domain, the domain itself and all descendant experiments - // and domains are disabled together. - DisableExpNames []string `json:"disableExpNames,omitempty"` - // DisableExpTags: Set of experiment tags to be disabled. All experiments that - // are tagged with one or more of these tags are disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. - DisableExpTags []string `json:"disableExpTags,omitempty"` - // DisableExps: Set of experiment ids to be disabled. If an experiment is - // disabled, it is never selected nor forced. If an aggregate experiment is - // disabled, its partitions are disabled together. If an experiment with an - // enrollment is disabled, the enrollment is disabled together. If an ID - // corresponds to a domain, the domain itself and all descendant experiments - // and domains are disabled together. - DisableExps []int64 `json:"disableExps,omitempty"` - // DisableManualEnrollmentSelection: If true, disable manual enrollment - // selection (at all diversion points). Manual enrollment selection means - // experiment selection process based on the request's manual enrollment states - // (a.k.a. opt-in experiments). This does not disable selection of forced - // experiments. Setting this field to false does not change anything in the - // experiment selection process. - DisableManualEnrollmentSelection bool `json:"disableManualEnrollmentSelection,omitempty"` - // DisableOrganicSelection: If true, disable organic experiment selection (at - // all diversion points). Organic selection means experiment selection process - // based on traffic allocation and diversion condition evaluation. This does - // not disable selection of forced experiments. This is useful in cases when it - // is not known whether experiment selection behavior is responsible for a - // error or breakage. Disabling organic selection may help to isolate the cause - // of a given problem. Setting this field to false does not change anything in - // the experiment selection process. - DisableOrganicSelection bool `json:"disableOrganicSelection,omitempty"` - // ForcedFlags: Flags to force in a particular experiment state. Map from flag - // name to flag value. - ForcedFlags map[string]string `json:"forcedFlags,omitempty"` - // ForcedRollouts: Rollouts to force in a particular experiment state. Map from - // rollout name to rollout value. - ForcedRollouts map[string]bool `json:"forcedRollouts,omitempty"` - // TestingMode: Sets different testing modes. See the documentation in the - // TestingMode message for more information. - // - // Possible values: - // "TESTING_MODE_UNSPECIFIED" - // "TESTING_MODE_ALL_OFF" - // "TESTING_MODE_ALL_ON" - TestingMode string `json:"testingMode,omitempty"` - // ForceSendFields is a list of field names (e.g. "AbsolutelyForcedExpNames") - // to unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AbsolutelyForcedExpNames") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *NamespacedDebugInput) MarshalJSON() ([]byte, error) { - type NoMethod NamespacedDebugInput - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // Operation: This resource represents a long-running operation that is the // result of a network API call. type Operation struct { diff --git a/meet/v2/meet-api.json b/meet/v2/meet-api.json new file mode 100644 index 00000000000..7a3b4dd4c2b --- /dev/null +++ b/meet/v2/meet-api.json @@ -0,0 +1,1146 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/meetings.space.created": { + "description": "Create, edit, and see information about your Google Meet conferences created by the app." + }, + "https://www.googleapis.com/auth/meetings.space.readonly": { + "description": "Read information about any of your Google Meet conferences" + } + } + } + }, + "basePath": "", + "baseUrl": "https://meet.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Meet", + "description": "Create and manage meetings in Google Meet.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/meet/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "meet:v2", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://meet.mtls.googleapis.com/", + "name": "meet", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "conferenceRecords": { + "methods": { + "get": { + "description": "Gets a conference record by conference ID.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}", + "httpMethod": "GET", + "id": "meet.conferenceRecords.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the conference.", + "location": "path", + "pattern": "^conferenceRecords/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "ConferenceRecord" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "list": { + "description": "Lists the conference records. By default, ordered by start time and in descending order.", + "flatPath": "v2/conferenceRecords", + "httpMethod": "GET", + "id": "meet.conferenceRecords.list", + "parameterOrder": [], + "parameters": { + "filter": { + "description": "Optional. User specified filtering condition in [EBNF format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The following are the filterable fields: * `space.meeting_code` * `space.name` * `start_time` * `end_time` For example, `space.meeting_code = \"abc-mnop-xyz\"`.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Maximum number of conference records to return. The service might return fewer than this value. If unspecified, at most 25 conference records are returned. The maximum value is 100; values above 100 are coerced to 100. Maximum might change in the future.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token returned from previous List Call.", + "location": "query", + "type": "string" + } + }, + "path": "v2/conferenceRecords", + "response": { + "$ref": "ListConferenceRecordsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + } + }, + "resources": { + "participants": { + "methods": { + "get": { + "description": "Gets a participant by participant ID.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/participants/{participantsId}", + "httpMethod": "GET", + "id": "meet.conferenceRecords.participants.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the participant.", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/participants/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Participant" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "list": { + "description": "Lists the participants in a conference record. By default, ordered by join time and in descending order. This API supports `fields` as standard parameters like every other API. However, when the `fields` request parameter is omitted, this API defaults to `'participants/*, next_page_token'`.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/participants", + "httpMethod": "GET", + "id": "meet.conferenceRecords.participants.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. User specified filtering condition in [EBNF format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The following are the filterable fields: * `earliest_start_time` * `latest_end_time` For example, `latest_end_time IS NULL` returns active participants in the conference.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of participants to return. The service might return fewer than this value. If unspecified, at most 100 participants are returned. The maximum value is 250; values above 250 are coerced to 250. Maximum might change in the future.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Page token returned from previous List Call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Format: `conferenceRecords/{conference_record}`", + "location": "path", + "pattern": "^conferenceRecords/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/participants", + "response": { + "$ref": "ListParticipantsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + } + }, + "resources": { + "participantSessions": { + "methods": { + "get": { + "description": "Gets a participant session by participant session ID.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/participants/{participantsId}/participantSessions/{participantSessionsId}", + "httpMethod": "GET", + "id": "meet.conferenceRecords.participants.participantSessions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the participant.", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/participants/[^/]+/participantSessions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "ParticipantSession" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "list": { + "description": "Lists the participant sessions of a participant in a conference record. By default, ordered by join time and in descending order. This API supports `fields` as standard parameters like every other API. However, when the `fields` request parameter is omitted this API defaults to `'participantsessions/*, next_page_token'`.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/participants/{participantsId}/participantSessions", + "httpMethod": "GET", + "id": "meet.conferenceRecords.participants.participantSessions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. User specified filtering condition in [EBNF format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The following are the filterable fields: * `start_time` * `end_time` For example, `end_time IS NULL` returns active participant sessions in the conference record.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Maximum number of participant sessions to return. The service might return fewer than this value. If unspecified, at most 100 participants are returned. The maximum value is 250; values above 250 are coerced to 250. Maximum might change in the future.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token returned from previous List Call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Format: `conferenceRecords/{conference_record}/participants/{participant}`", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/participants/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/participantSessions", + "response": { + "$ref": "ListParticipantSessionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + } + } + } + } + }, + "recordings": { + "methods": { + "get": { + "description": "Gets a recording by recording ID.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/recordings/{recordingsId}", + "httpMethod": "GET", + "id": "meet.conferenceRecords.recordings.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the recording.", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/recordings/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Recording" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "list": { + "description": "Lists the recording resources from the conference record. By default, ordered by start time and in ascending order.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/recordings", + "httpMethod": "GET", + "id": "meet.conferenceRecords.recordings.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Maximum number of recordings to return. The service might return fewer than this value. If unspecified, at most 10 recordings are returned. The maximum value is 100; values above 100 are coerced to 100. Maximum might change in the future.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Page token returned from previous List Call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Format: `conferenceRecords/{conference_record}`", + "location": "path", + "pattern": "^conferenceRecords/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/recordings", + "response": { + "$ref": "ListRecordingsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + } + } + }, + "transcripts": { + "methods": { + "get": { + "description": "Gets a transcript by transcript ID.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/transcripts/{transcriptsId}", + "httpMethod": "GET", + "id": "meet.conferenceRecords.transcripts.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the transcript.", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/transcripts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Transcript" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "list": { + "description": "Lists the set of transcripts from the conference record. By default, ordered by start time and in ascending order.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/transcripts", + "httpMethod": "GET", + "id": "meet.conferenceRecords.transcripts.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Maximum number of transcripts to return. The service might return fewer than this value. If unspecified, at most 10 transcripts are returned. The maximum value is 100; values above 100 are coerced to 100. Maximum might change in the future.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Page token returned from previous List Call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Format: `conferenceRecords/{conference_record}`", + "location": "path", + "pattern": "^conferenceRecords/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/transcripts", + "response": { + "$ref": "ListTranscriptsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + } + }, + "resources": { + "entries": { + "methods": { + "get": { + "description": "Gets a `TranscriptEntry` resource by entry ID. Note: The transcript entries returned by the Google Meet API might not match the transcription found in the Google Docs transcript file. This can occur when the Google Docs transcript file is modified after generation.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/transcripts/{transcriptsId}/entries/{entriesId}", + "httpMethod": "GET", + "id": "meet.conferenceRecords.transcripts.entries.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the `TranscriptEntry`.", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/transcripts/[^/]+/entries/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "TranscriptEntry" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "list": { + "description": "Lists the structured transcript entries per transcript. By default, ordered by start time and in ascending order. Note: The transcript entries returned by the Google Meet API might not match the transcription found in the Google Docs transcript file. This can occur when the Google Docs transcript file is modified after generation.", + "flatPath": "v2/conferenceRecords/{conferenceRecordsId}/transcripts/{transcriptsId}/entries", + "httpMethod": "GET", + "id": "meet.conferenceRecords.transcripts.entries.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Maximum number of entries to return. The service might return fewer than this value. If unspecified, at most 10 entries are returned. The maximum value is 100; values above 100 are coerced to 100. Maximum might change in the future.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Page token returned from previous List Call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Format: `conferenceRecords/{conference_record}/transcripts/{transcript}`", + "location": "path", + "pattern": "^conferenceRecords/[^/]+/transcripts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/entries", + "response": { + "$ref": "ListTranscriptEntriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + } + } + } + } + } + } + }, + "spaces": { + "methods": { + "create": { + "description": "Creates a space.", + "flatPath": "v2/spaces", + "httpMethod": "POST", + "id": "meet.spaces.create", + "parameterOrder": [], + "parameters": {}, + "path": "v2/spaces", + "request": { + "$ref": "Space" + }, + "response": { + "$ref": "Space" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created" + ] + }, + "endActiveConference": { + "description": "Ends an active conference (if there's one).", + "flatPath": "v2/spaces/{spacesId}:endActiveConference", + "httpMethod": "POST", + "id": "meet.spaces.endActiveConference", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the space.", + "location": "path", + "pattern": "^spaces/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}:endActiveConference", + "request": { + "$ref": "EndActiveConferenceRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created" + ] + }, + "get": { + "description": "Gets a space by `space_id` or `meeting_code`.", + "flatPath": "v2/spaces/{spacesId}", + "httpMethod": "GET", + "id": "meet.spaces.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the space.", + "location": "path", + "pattern": "^spaces/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Space" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly" + ] + }, + "patch": { + "description": "Updates a space.", + "flatPath": "v2/spaces/{spacesId}", + "httpMethod": "PATCH", + "id": "meet.spaces.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Resource name of the space. Format: `spaces/{space}`", + "location": "path", + "pattern": "^spaces/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. Field mask used to specify the fields to be updated in the space. If update_mask isn't provided, it defaults to '*' and updates all fields provided in the request, including deleting fields not set in the request.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+name}", + "request": { + "$ref": "Space" + }, + "response": { + "$ref": "Space" + }, + "scopes": [ + "https://www.googleapis.com/auth/meetings.space.created" + ] + } + } + } + }, + "revision": "20240617", + "rootUrl": "https://meet.googleapis.com/", + "schemas": { + "ActiveConference": { + "description": "Active conference.", + "id": "ActiveConference", + "properties": { + "conferenceRecord": { + "description": "Output only. Reference to 'ConferenceRecord' resource. Format: `conferenceRecords/{conference_record}` where `{conference_record}` is a unique ID for each instance of a call within a space.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "AnonymousUser": { + "description": "User who joins anonymously (meaning not signed into a Google Account).", + "id": "AnonymousUser", + "properties": { + "displayName": { + "description": "Output only. User provided name when they join a conference anonymously.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ConferenceRecord": { + "description": "Single instance of a meeting held in a space.", + "id": "ConferenceRecord", + "properties": { + "endTime": { + "description": "Output only. Timestamp when the conference ended. Set for past conferences. Unset if the conference is ongoing.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "expireTime": { + "description": "Output only. Server enforced expiration time for when this conference record resource is deleted. The resource is deleted 30 days after the conference ends.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. Resource name of the conference record. Format: `conferenceRecords/{conference_record}` where `{conference_record}` is a unique ID for each instance of a call within a space.", + "type": "string" + }, + "space": { + "description": "Output only. The space where the conference was held.", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. Timestamp when the conference started. Always set.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "DocsDestination": { + "description": "Google Docs location where the transcript file is saved.", + "id": "DocsDestination", + "properties": { + "document": { + "description": "Output only. The document ID for the underlying Google Docs transcript file. For example, \"1kuceFZohVoCh6FulBHxwy6I15Ogpc4hP\". Use the `documents.get` method of the Google Docs API (https://developers.google.com/docs/api/reference/rest/v1/documents/get) to fetch the content.", + "readOnly": true, + "type": "string" + }, + "exportUri": { + "description": "Output only. URI for the Google Docs transcript file. Use `https://docs.google.com/document/d/{$DocumentId}/view` to browse the transcript in the browser.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "DriveDestination": { + "description": "Export location where a recording file is saved in Google Drive.", + "id": "DriveDestination", + "properties": { + "exportUri": { + "description": "Output only. Link used to play back the recording file in the browser. For example, `https://drive.google.com/file/d/{$fileId}/view`.", + "readOnly": true, + "type": "string" + }, + "file": { + "description": "Output only. The `fileId` for the underlying MP4 file. For example, \"1kuceFZohVoCh6FulBHxwy6I15Ogpc4hP\". Use `$ GET https://www.googleapis.com/drive/v3/files/{$fileId}?alt=media` to download the blob. For more information, see https://developers.google.com/drive/api/v3/reference/files/get.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "EndActiveConferenceRequest": { + "description": "Request to end an ongoing conference of a space.", + "id": "EndActiveConferenceRequest", + "properties": {}, + "type": "object" + }, + "ListConferenceRecordsResponse": { + "description": "Response of ListConferenceRecords method.", + "id": "ListConferenceRecordsResponse", + "properties": { + "conferenceRecords": { + "description": "List of conferences in one page.", + "items": { + "$ref": "ConferenceRecord" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token to be circulated back for further List call if current List does NOT include all the Conferences. Unset if all conferences have been returned.", + "type": "string" + } + }, + "type": "object" + }, + "ListParticipantSessionsResponse": { + "description": "Response of ListParticipants method.", + "id": "ListParticipantSessionsResponse", + "properties": { + "nextPageToken": { + "description": "Token to be circulated back for further List call if current List doesn't include all the participants. Unset if all participants are returned.", + "type": "string" + }, + "participantSessions": { + "description": "List of participants in one page.", + "items": { + "$ref": "ParticipantSession" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListParticipantsResponse": { + "description": "Response of ListParticipants method.", + "id": "ListParticipantsResponse", + "properties": { + "nextPageToken": { + "description": "Token to be circulated back for further List call if current List doesn't include all the participants. Unset if all participants are returned.", + "type": "string" + }, + "participants": { + "description": "List of participants in one page.", + "items": { + "$ref": "Participant" + }, + "type": "array" + }, + "totalSize": { + "description": "Total, exact number of `participants`. By default, this field isn't included in the response. Set the field mask in [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters) to receive this field in the response.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "ListRecordingsResponse": { + "description": "Response for ListRecordings method.", + "id": "ListRecordingsResponse", + "properties": { + "nextPageToken": { + "description": "Token to be circulated back for further List call if current List doesn't include all the recordings. Unset if all recordings are returned.", + "type": "string" + }, + "recordings": { + "description": "List of recordings in one page.", + "items": { + "$ref": "Recording" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListTranscriptEntriesResponse": { + "description": "Response for ListTranscriptEntries method.", + "id": "ListTranscriptEntriesResponse", + "properties": { + "nextPageToken": { + "description": "Token to be circulated back for further List call if current List doesn't include all the transcript entries. Unset if all entries are returned.", + "type": "string" + }, + "transcriptEntries": { + "description": "List of TranscriptEntries in one page.", + "items": { + "$ref": "TranscriptEntry" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListTranscriptsResponse": { + "description": "Response for ListTranscripts method.", + "id": "ListTranscriptsResponse", + "properties": { + "nextPageToken": { + "description": "Token to be circulated back for further List call if current List doesn't include all the transcripts. Unset if all transcripts are returned.", + "type": "string" + }, + "transcripts": { + "description": "List of transcripts in one page.", + "items": { + "$ref": "Transcript" + }, + "type": "array" + } + }, + "type": "object" + }, + "Participant": { + "description": "User who attended or is attending a conference.", + "id": "Participant", + "properties": { + "anonymousUser": { + "$ref": "AnonymousUser", + "description": "Anonymous user." + }, + "earliestStartTime": { + "description": "Output only. Time when the participant first joined the meeting.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "latestEndTime": { + "description": "Output only. Time when the participant left the meeting for the last time. This can be null if it's an active meeting.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Resource name of the participant. Format: `conferenceRecords/{conference_record}/participants/{participant}`", + "readOnly": true, + "type": "string" + }, + "phoneUser": { + "$ref": "PhoneUser", + "description": "User calling from their phone." + }, + "signedinUser": { + "$ref": "SignedinUser", + "description": "Signed-in user." + } + }, + "type": "object" + }, + "ParticipantSession": { + "description": "Refers to each unique join or leave session when a user joins a conference from a device. Note that any time a user joins the conference a new unique ID is assigned. That means if a user joins a space multiple times from the same device, they're assigned different IDs, and are also be treated as different participant sessions.", + "id": "ParticipantSession", + "properties": { + "endTime": { + "description": "Output only. Timestamp when the user session ends. Unset if the user session hasn’t ended.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. Session id.", + "type": "string" + }, + "startTime": { + "description": "Output only. Timestamp when the user session starts.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "PhoneUser": { + "description": "User dialing in from a phone where the user's identity is unknown because they haven't signed in with a Google Account.", + "id": "PhoneUser", + "properties": { + "displayName": { + "description": "Output only. Partially redacted user's phone number when calling.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "Recording": { + "description": "Metadata about a recording created during a conference.", + "id": "Recording", + "properties": { + "driveDestination": { + "$ref": "DriveDestination", + "description": "Output only. Recording is saved to Google Drive as an MP4 file. The `drive_destination` includes the Drive `fileId` that can be used to download the file using the `files.get` method of the Drive API.", + "readOnly": true + }, + "endTime": { + "description": "Output only. Timestamp when the recording ended.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Resource name of the recording. Format: `conferenceRecords/{conference_record}/recordings/{recording}` where `{recording}` is a 1:1 mapping to each unique recording session during the conference.", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. Timestamp when the recording started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. Current state.", + "enum": [ + "STATE_UNSPECIFIED", + "STARTED", + "ENDED", + "FILE_GENERATED" + ], + "enumDescriptions": [ + "Default, never used.", + "An active recording session has started.", + "This recording session has ended, but the recording file hasn't been generated yet.", + "Recording file is generated and ready to download." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "SignedinUser": { + "description": "A signed-in user can be: a) An individual joining from a personal computer, mobile device, or through companion mode. b) A robot account used by conference room devices.", + "id": "SignedinUser", + "properties": { + "displayName": { + "description": "Output only. For a personal device, it's the user's first name and last name. For a robot account, it's the administrator-specified device name. For example, \"Altostrat Room\".", + "readOnly": true, + "type": "string" + }, + "user": { + "description": "Output only. Unique ID for the user. Interoperable with Admin SDK API and People API. Format: `users/{user}`", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "Space": { + "description": "Virtual place where conferences are held. Only one active conference can be held in one space at any given time.", + "id": "Space", + "properties": { + "activeConference": { + "$ref": "ActiveConference", + "description": "Active conference, if it exists." + }, + "config": { + "$ref": "SpaceConfig", + "description": "Configuration pertaining to the meeting space." + }, + "meetingCode": { + "description": "Output only. Type friendly code to join the meeting. Format: `[a-z]+-[a-z]+-[a-z]+` such as `abc-mnop-xyz`. The maximum length is 128 characters. Can only be used as an alias of the space ID to get the space.", + "readOnly": true, + "type": "string" + }, + "meetingUri": { + "description": "Output only. URI used to join meetings, such as `https://meet.google.com/abc-mnop-xyz`.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Immutable. Resource name of the space. Format: `spaces/{space}`", + "type": "string" + } + }, + "type": "object" + }, + "SpaceConfig": { + "description": "The configuration pertaining to a meeting space.", + "id": "SpaceConfig", + "properties": { + "accessType": { + "description": "Access type of the meeting space that determines who can join without knocking. Default: The user's default access settings. Controlled by the user's admin for enterprise users or RESTRICTED.", + "enum": [ + "ACCESS_TYPE_UNSPECIFIED", + "OPEN", + "TRUSTED", + "RESTRICTED" + ], + "enumDescriptions": [ + "Default value specified by the user's organization. Note: This is never returned, as the configured access type is returned instead.", + "Anyone with the join information (for example, the URL or phone access information) can join without knocking.", + "Members of the host's organization, invited external users, and dial-in users can join without knocking. Everyone else must knock.", + "Only invitees can join without knocking. Everyone else must knock." + ], + "type": "string" + }, + "entryPointAccess": { + "description": "Defines the entry points that can be used to join meetings hosted in this meeting space. Default: EntryPointAccess.ALL", + "enum": [ + "ENTRY_POINT_ACCESS_UNSPECIFIED", + "ALL", + "CREATOR_APP_ONLY" + ], + "enumDescriptions": [ + "Unused.", + "All entry points are allowed.", + "Only entry points owned by the Google Cloud project that created the space can be used to join meetings in this space. Apps can use the Meet Embed SDK Web or mobile Meet SDKs to create owned entry points." + ], + "type": "string" + } + }, + "type": "object" + }, + "Transcript": { + "description": "Metadata for a transcript generated from a conference. It refers to the ASR (Automatic Speech Recognition) result of user's speech during the conference.", + "id": "Transcript", + "properties": { + "docsDestination": { + "$ref": "DocsDestination", + "description": "Output only. Where the Google Docs transcript is saved.", + "readOnly": true + }, + "endTime": { + "description": "Output only. Timestamp when the transcript stopped.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Resource name of the transcript. Format: `conferenceRecords/{conference_record}/transcripts/{transcript}`, where `{transcript}` is a 1:1 mapping to each unique transcription session of the conference.", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. Timestamp when the transcript started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. Current state.", + "enum": [ + "STATE_UNSPECIFIED", + "STARTED", + "ENDED", + "FILE_GENERATED" + ], + "enumDescriptions": [ + "Default, never used.", + "An active transcript session has started.", + "This transcript session has ended, but the transcript file hasn't been generated yet.", + "Transcript file is generated and ready to download." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "TranscriptEntry": { + "description": "Single entry for one user’s speech during a transcript session.", + "id": "TranscriptEntry", + "properties": { + "endTime": { + "description": "Output only. Timestamp when the transcript entry ended.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "Output only. Language of spoken text, such as \"en-US\". IETF BCP 47 syntax (https://tools.ietf.org/html/bcp47)", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Resource name of the entry. Format: \"conferenceRecords/{conference_record}/transcripts/{transcript}/entries/{entry}\"", + "readOnly": true, + "type": "string" + }, + "participant": { + "description": "Output only. Refers to the participant who speaks.", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. Timestamp when the transcript entry started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "text": { + "description": "Output only. The transcribed text of the participant's voice, at maximum 10K words. Note that the limit is subject to change.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Google Meet API", + "version": "v2", + "version_module": true +} \ No newline at end of file diff --git a/meet/v2/meet-gen.go b/meet/v2/meet-gen.go new file mode 100644 index 00000000000..c42135769cd --- /dev/null +++ b/meet/v2/meet-gen.go @@ -0,0 +1,2896 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package meet provides access to the Google Meet API. +// +// For product documentation, see: https://developers.google.com/meet/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/meet/v2" +// ... +// ctx := context.Background() +// meetService, err := meet.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// By default, all available scopes (see "Constants") are used to authenticate. +// To restrict scopes, use [google.golang.org/api/option.WithScopes]: +// +// meetService, err := meet.NewService(ctx, option.WithScopes(meet.MeetingsSpaceReadonlyScope)) +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// meetService, err := meet.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// meetService, err := meet.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package meet // import "google.golang.org/api/meet/v2" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "meet:v2" +const apiName = "meet" +const apiVersion = "v2" +const basePath = "https://meet.googleapis.com/" +const basePathTemplate = "https://meet.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://meet.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Create, edit, and see information about your Google Meet conferences created + // by the app. + MeetingsSpaceCreatedScope = "https://www.googleapis.com/auth/meetings.space.created" + + // Read information about any of your Google Meet conferences + MeetingsSpaceReadonlyScope = "https://www.googleapis.com/auth/meetings.space.readonly" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/meetings.space.created", + "https://www.googleapis.com/auth/meetings.space.readonly", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.ConferenceRecords = NewConferenceRecordsService(s) + s.Spaces = NewSpacesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + ConferenceRecords *ConferenceRecordsService + + Spaces *SpacesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewConferenceRecordsService(s *Service) *ConferenceRecordsService { + rs := &ConferenceRecordsService{s: s} + rs.Participants = NewConferenceRecordsParticipantsService(s) + rs.Recordings = NewConferenceRecordsRecordingsService(s) + rs.Transcripts = NewConferenceRecordsTranscriptsService(s) + return rs +} + +type ConferenceRecordsService struct { + s *Service + + Participants *ConferenceRecordsParticipantsService + + Recordings *ConferenceRecordsRecordingsService + + Transcripts *ConferenceRecordsTranscriptsService +} + +func NewConferenceRecordsParticipantsService(s *Service) *ConferenceRecordsParticipantsService { + rs := &ConferenceRecordsParticipantsService{s: s} + rs.ParticipantSessions = NewConferenceRecordsParticipantsParticipantSessionsService(s) + return rs +} + +type ConferenceRecordsParticipantsService struct { + s *Service + + ParticipantSessions *ConferenceRecordsParticipantsParticipantSessionsService +} + +func NewConferenceRecordsParticipantsParticipantSessionsService(s *Service) *ConferenceRecordsParticipantsParticipantSessionsService { + rs := &ConferenceRecordsParticipantsParticipantSessionsService{s: s} + return rs +} + +type ConferenceRecordsParticipantsParticipantSessionsService struct { + s *Service +} + +func NewConferenceRecordsRecordingsService(s *Service) *ConferenceRecordsRecordingsService { + rs := &ConferenceRecordsRecordingsService{s: s} + return rs +} + +type ConferenceRecordsRecordingsService struct { + s *Service +} + +func NewConferenceRecordsTranscriptsService(s *Service) *ConferenceRecordsTranscriptsService { + rs := &ConferenceRecordsTranscriptsService{s: s} + rs.Entries = NewConferenceRecordsTranscriptsEntriesService(s) + return rs +} + +type ConferenceRecordsTranscriptsService struct { + s *Service + + Entries *ConferenceRecordsTranscriptsEntriesService +} + +func NewConferenceRecordsTranscriptsEntriesService(s *Service) *ConferenceRecordsTranscriptsEntriesService { + rs := &ConferenceRecordsTranscriptsEntriesService{s: s} + return rs +} + +type ConferenceRecordsTranscriptsEntriesService struct { + s *Service +} + +func NewSpacesService(s *Service) *SpacesService { + rs := &SpacesService{s: s} + return rs +} + +type SpacesService struct { + s *Service +} + +// ActiveConference: Active conference. +type ActiveConference struct { + // ConferenceRecord: Output only. Reference to 'ConferenceRecord' resource. + // Format: `conferenceRecords/{conference_record}` where `{conference_record}` + // is a unique ID for each instance of a call within a space. + ConferenceRecord string `json:"conferenceRecord,omitempty"` + // ForceSendFields is a list of field names (e.g. "ConferenceRecord") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConferenceRecord") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ActiveConference) MarshalJSON() ([]byte, error) { + type NoMethod ActiveConference + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// AnonymousUser: User who joins anonymously (meaning not signed into a Google +// Account). +type AnonymousUser struct { + // DisplayName: Output only. User provided name when they join a conference + // anonymously. + DisplayName string `json:"displayName,omitempty"` + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DisplayName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AnonymousUser) MarshalJSON() ([]byte, error) { + type NoMethod AnonymousUser + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ConferenceRecord: Single instance of a meeting held in a space. +type ConferenceRecord struct { + // EndTime: Output only. Timestamp when the conference ended. Set for past + // conferences. Unset if the conference is ongoing. + EndTime string `json:"endTime,omitempty"` + // ExpireTime: Output only. Server enforced expiration time for when this + // conference record resource is deleted. The resource is deleted 30 days after + // the conference ends. + ExpireTime string `json:"expireTime,omitempty"` + // Name: Identifier. Resource name of the conference record. Format: + // `conferenceRecords/{conference_record}` where `{conference_record}` is a + // unique ID for each instance of a call within a space. + Name string `json:"name,omitempty"` + // Space: Output only. The space where the conference was held. + Space string `json:"space,omitempty"` + // StartTime: Output only. Timestamp when the conference started. Always set. + StartTime string `json:"startTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ConferenceRecord) MarshalJSON() ([]byte, error) { + type NoMethod ConferenceRecord + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// DocsDestination: Google Docs location where the transcript file is saved. +type DocsDestination struct { + // Document: Output only. The document ID for the underlying Google Docs + // transcript file. For example, "1kuceFZohVoCh6FulBHxwy6I15Ogpc4hP". Use the + // `documents.get` method of the Google Docs API + // (https://developers.google.com/docs/api/reference/rest/v1/documents/get) to + // fetch the content. + Document string `json:"document,omitempty"` + // ExportUri: Output only. URI for the Google Docs transcript file. Use + // `https://docs.google.com/document/d/{$DocumentId}/view` to browse the + // transcript in the browser. + ExportUri string `json:"exportUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Document") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DocsDestination) MarshalJSON() ([]byte, error) { + type NoMethod DocsDestination + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// DriveDestination: Export location where a recording file is saved in Google +// Drive. +type DriveDestination struct { + // ExportUri: Output only. Link used to play back the recording file in the + // browser. For example, `https://drive.google.com/file/d/{$fileId}/view`. + ExportUri string `json:"exportUri,omitempty"` + // File: Output only. The `fileId` for the underlying MP4 file. For example, + // "1kuceFZohVoCh6FulBHxwy6I15Ogpc4hP". Use `$ GET + // https://www.googleapis.com/drive/v3/files/{$fileId}?alt=media` to download + // the blob. For more information, see + // https://developers.google.com/drive/api/v3/reference/files/get. + File string `json:"file,omitempty"` + // ForceSendFields is a list of field names (e.g. "ExportUri") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ExportUri") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DriveDestination) MarshalJSON() ([]byte, error) { + type NoMethod DriveDestination + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// EndActiveConferenceRequest: Request to end an ongoing conference of a space. +type EndActiveConferenceRequest struct { +} + +// ListConferenceRecordsResponse: Response of ListConferenceRecords method. +type ListConferenceRecordsResponse struct { + // ConferenceRecords: List of conferences in one page. + ConferenceRecords []*ConferenceRecord `json:"conferenceRecords,omitempty"` + // NextPageToken: Token to be circulated back for further List call if current + // List does NOT include all the Conferences. Unset if all conferences have + // been returned. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ConferenceRecords") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConferenceRecords") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListConferenceRecordsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListConferenceRecordsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListParticipantSessionsResponse: Response of ListParticipants method. +type ListParticipantSessionsResponse struct { + // NextPageToken: Token to be circulated back for further List call if current + // List doesn't include all the participants. Unset if all participants are + // returned. + NextPageToken string `json:"nextPageToken,omitempty"` + // ParticipantSessions: List of participants in one page. + ParticipantSessions []*ParticipantSession `json:"participantSessions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListParticipantSessionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListParticipantSessionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListParticipantsResponse: Response of ListParticipants method. +type ListParticipantsResponse struct { + // NextPageToken: Token to be circulated back for further List call if current + // List doesn't include all the participants. Unset if all participants are + // returned. + NextPageToken string `json:"nextPageToken,omitempty"` + // Participants: List of participants in one page. + Participants []*Participant `json:"participants,omitempty"` + // TotalSize: Total, exact number of `participants`. By default, this field + // isn't included in the response. Set the field mask in SystemParameterContext + // (https://cloud.google.com/apis/docs/system-parameters) to receive this field + // in the response. + TotalSize int64 `json:"totalSize,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListParticipantsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListParticipantsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListRecordingsResponse: Response for ListRecordings method. +type ListRecordingsResponse struct { + // NextPageToken: Token to be circulated back for further List call if current + // List doesn't include all the recordings. Unset if all recordings are + // returned. + NextPageToken string `json:"nextPageToken,omitempty"` + // Recordings: List of recordings in one page. + Recordings []*Recording `json:"recordings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListRecordingsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListRecordingsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListTranscriptEntriesResponse: Response for ListTranscriptEntries method. +type ListTranscriptEntriesResponse struct { + // NextPageToken: Token to be circulated back for further List call if current + // List doesn't include all the transcript entries. Unset if all entries are + // returned. + NextPageToken string `json:"nextPageToken,omitempty"` + // TranscriptEntries: List of TranscriptEntries in one page. + TranscriptEntries []*TranscriptEntry `json:"transcriptEntries,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListTranscriptEntriesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListTranscriptEntriesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListTranscriptsResponse: Response for ListTranscripts method. +type ListTranscriptsResponse struct { + // NextPageToken: Token to be circulated back for further List call if current + // List doesn't include all the transcripts. Unset if all transcripts are + // returned. + NextPageToken string `json:"nextPageToken,omitempty"` + // Transcripts: List of transcripts in one page. + Transcripts []*Transcript `json:"transcripts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListTranscriptsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListTranscriptsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Participant: User who attended or is attending a conference. +type Participant struct { + // AnonymousUser: Anonymous user. + AnonymousUser *AnonymousUser `json:"anonymousUser,omitempty"` + // EarliestStartTime: Output only. Time when the participant first joined the + // meeting. + EarliestStartTime string `json:"earliestStartTime,omitempty"` + // LatestEndTime: Output only. Time when the participant left the meeting for + // the last time. This can be null if it's an active meeting. + LatestEndTime string `json:"latestEndTime,omitempty"` + // Name: Output only. Resource name of the participant. Format: + // `conferenceRecords/{conference_record}/participants/{participant}` + Name string `json:"name,omitempty"` + // PhoneUser: User calling from their phone. + PhoneUser *PhoneUser `json:"phoneUser,omitempty"` + // SignedinUser: Signed-in user. + SignedinUser *SignedinUser `json:"signedinUser,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AnonymousUser") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AnonymousUser") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Participant) MarshalJSON() ([]byte, error) { + type NoMethod Participant + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ParticipantSession: Refers to each unique join or leave session when a user +// joins a conference from a device. Note that any time a user joins the +// conference a new unique ID is assigned. That means if a user joins a space +// multiple times from the same device, they're assigned different IDs, and are +// also be treated as different participant sessions. +type ParticipantSession struct { + // EndTime: Output only. Timestamp when the user session ends. Unset if the + // user session hasn’t ended. + EndTime string `json:"endTime,omitempty"` + // Name: Identifier. Session id. + Name string `json:"name,omitempty"` + // StartTime: Output only. Timestamp when the user session starts. + StartTime string `json:"startTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ParticipantSession) MarshalJSON() ([]byte, error) { + type NoMethod ParticipantSession + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PhoneUser: User dialing in from a phone where the user's identity is unknown +// because they haven't signed in with a Google Account. +type PhoneUser struct { + // DisplayName: Output only. Partially redacted user's phone number when + // calling. + DisplayName string `json:"displayName,omitempty"` + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DisplayName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PhoneUser) MarshalJSON() ([]byte, error) { + type NoMethod PhoneUser + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Recording: Metadata about a recording created during a conference. +type Recording struct { + // DriveDestination: Output only. Recording is saved to Google Drive as an MP4 + // file. The `drive_destination` includes the Drive `fileId` that can be used + // to download the file using the `files.get` method of the Drive API. + DriveDestination *DriveDestination `json:"driveDestination,omitempty"` + // EndTime: Output only. Timestamp when the recording ended. + EndTime string `json:"endTime,omitempty"` + // Name: Output only. Resource name of the recording. Format: + // `conferenceRecords/{conference_record}/recordings/{recording}` where + // `{recording}` is a 1:1 mapping to each unique recording session during the + // conference. + Name string `json:"name,omitempty"` + // StartTime: Output only. Timestamp when the recording started. + StartTime string `json:"startTime,omitempty"` + // State: Output only. Current state. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default, never used. + // "STARTED" - An active recording session has started. + // "ENDED" - This recording session has ended, but the recording file hasn't + // been generated yet. + // "FILE_GENERATED" - Recording file is generated and ready to download. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "DriveDestination") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DriveDestination") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Recording) MarshalJSON() ([]byte, error) { + type NoMethod Recording + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// SignedinUser: A signed-in user can be: a) An individual joining from a +// personal computer, mobile device, or through companion mode. b) A robot +// account used by conference room devices. +type SignedinUser struct { + // DisplayName: Output only. For a personal device, it's the user's first name + // and last name. For a robot account, it's the administrator-specified device + // name. For example, "Altostrat Room". + DisplayName string `json:"displayName,omitempty"` + // User: Output only. Unique ID for the user. Interoperable with Admin SDK API + // and People API. Format: `users/{user}` + User string `json:"user,omitempty"` + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DisplayName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *SignedinUser) MarshalJSON() ([]byte, error) { + type NoMethod SignedinUser + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Space: Virtual place where conferences are held. Only one active conference +// can be held in one space at any given time. +type Space struct { + // ActiveConference: Active conference, if it exists. + ActiveConference *ActiveConference `json:"activeConference,omitempty"` + // Config: Configuration pertaining to the meeting space. + Config *SpaceConfig `json:"config,omitempty"` + // MeetingCode: Output only. Type friendly code to join the meeting. Format: + // `[a-z]+-[a-z]+-[a-z]+` such as `abc-mnop-xyz`. The maximum length is 128 + // characters. Can only be used as an alias of the space ID to get the space. + MeetingCode string `json:"meetingCode,omitempty"` + // MeetingUri: Output only. URI used to join meetings, such as + // `https://meet.google.com/abc-mnop-xyz`. + MeetingUri string `json:"meetingUri,omitempty"` + // Name: Immutable. Resource name of the space. Format: `spaces/{space}` + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ActiveConference") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ActiveConference") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Space) MarshalJSON() ([]byte, error) { + type NoMethod Space + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// SpaceConfig: The configuration pertaining to a meeting space. +type SpaceConfig struct { + // AccessType: Access type of the meeting space that determines who can join + // without knocking. Default: The user's default access settings. Controlled by + // the user's admin for enterprise users or RESTRICTED. + // + // Possible values: + // "ACCESS_TYPE_UNSPECIFIED" - Default value specified by the user's + // organization. Note: This is never returned, as the configured access type is + // returned instead. + // "OPEN" - Anyone with the join information (for example, the URL or phone + // access information) can join without knocking. + // "TRUSTED" - Members of the host's organization, invited external users, + // and dial-in users can join without knocking. Everyone else must knock. + // "RESTRICTED" - Only invitees can join without knocking. Everyone else must + // knock. + AccessType string `json:"accessType,omitempty"` + // EntryPointAccess: Defines the entry points that can be used to join meetings + // hosted in this meeting space. Default: EntryPointAccess.ALL + // + // Possible values: + // "ENTRY_POINT_ACCESS_UNSPECIFIED" - Unused. + // "ALL" - All entry points are allowed. + // "CREATOR_APP_ONLY" - Only entry points owned by the Google Cloud project + // that created the space can be used to join meetings in this space. Apps can + // use the Meet Embed SDK Web or mobile Meet SDKs to create owned entry points. + EntryPointAccess string `json:"entryPointAccess,omitempty"` + // ForceSendFields is a list of field names (e.g. "AccessType") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AccessType") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *SpaceConfig) MarshalJSON() ([]byte, error) { + type NoMethod SpaceConfig + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Transcript: Metadata for a transcript generated from a conference. It refers +// to the ASR (Automatic Speech Recognition) result of user's speech during the +// conference. +type Transcript struct { + // DocsDestination: Output only. Where the Google Docs transcript is saved. + DocsDestination *DocsDestination `json:"docsDestination,omitempty"` + // EndTime: Output only. Timestamp when the transcript stopped. + EndTime string `json:"endTime,omitempty"` + // Name: Output only. Resource name of the transcript. Format: + // `conferenceRecords/{conference_record}/transcripts/{transcript}`, where + // `{transcript}` is a 1:1 mapping to each unique transcription session of the + // conference. + Name string `json:"name,omitempty"` + // StartTime: Output only. Timestamp when the transcript started. + StartTime string `json:"startTime,omitempty"` + // State: Output only. Current state. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default, never used. + // "STARTED" - An active transcript session has started. + // "ENDED" - This transcript session has ended, but the transcript file + // hasn't been generated yet. + // "FILE_GENERATED" - Transcript file is generated and ready to download. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "DocsDestination") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DocsDestination") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Transcript) MarshalJSON() ([]byte, error) { + type NoMethod Transcript + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TranscriptEntry: Single entry for one user’s speech during a transcript +// session. +type TranscriptEntry struct { + // EndTime: Output only. Timestamp when the transcript entry ended. + EndTime string `json:"endTime,omitempty"` + // LanguageCode: Output only. Language of spoken text, such as "en-US". IETF + // BCP 47 syntax (https://tools.ietf.org/html/bcp47) + LanguageCode string `json:"languageCode,omitempty"` + // Name: Output only. Resource name of the entry. Format: + // "conferenceRecords/{conference_record}/transcripts/{transcript}/entries/{entr + // y}" + Name string `json:"name,omitempty"` + // Participant: Output only. Refers to the participant who speaks. + Participant string `json:"participant,omitempty"` + // StartTime: Output only. Timestamp when the transcript entry started. + StartTime string `json:"startTime,omitempty"` + // Text: Output only. The transcribed text of the participant's voice, at + // maximum 10K words. Note that the limit is subject to change. + Text string `json:"text,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TranscriptEntry) MarshalJSON() ([]byte, error) { + type NoMethod TranscriptEntry + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type ConferenceRecordsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a conference record by conference ID. +// +// - name: Resource name of the conference. +func (r *ConferenceRecordsService) Get(name string) *ConferenceRecordsGetCall { + c := &ConferenceRecordsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsGetCall) Fields(s ...googleapi.Field) *ConferenceRecordsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsGetCall) IfNoneMatch(entityTag string) *ConferenceRecordsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsGetCall) Context(ctx context.Context) *ConferenceRecordsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *ConferenceRecord.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ConferenceRecordsGetCall) Do(opts ...googleapi.CallOption) (*ConferenceRecord, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ConferenceRecord{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ConferenceRecordsListCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the conference records. By default, ordered by start time and in +// descending order. +func (r *ConferenceRecordsService) List() *ConferenceRecordsListCall { + c := &ConferenceRecordsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// Filter sets the optional parameter "filter": User specified filtering +// condition in EBNF format +// (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The +// following are the filterable fields: * `space.meeting_code` * `space.name` * +// `start_time` * `end_time` For example, `space.meeting_code = +// "abc-mnop-xyz". +func (c *ConferenceRecordsListCall) Filter(filter string) *ConferenceRecordsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// conference records to return. The service might return fewer than this +// value. If unspecified, at most 25 conference records are returned. The +// maximum value is 100; values above 100 are coerced to 100. Maximum might +// change in the future. +func (c *ConferenceRecordsListCall) PageSize(pageSize int64) *ConferenceRecordsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token returned from +// previous List Call. +func (c *ConferenceRecordsListCall) PageToken(pageToken string) *ConferenceRecordsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsListCall) Fields(s ...googleapi.Field) *ConferenceRecordsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsListCall) IfNoneMatch(entityTag string) *ConferenceRecordsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsListCall) Context(ctx context.Context) *ConferenceRecordsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/conferenceRecords") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListConferenceRecordsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ConferenceRecordsListCall) Do(opts ...googleapi.CallOption) (*ListConferenceRecordsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListConferenceRecordsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConferenceRecordsListCall) Pages(ctx context.Context, f func(*ListConferenceRecordsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ConferenceRecordsParticipantsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a participant by participant ID. +// +// - name: Resource name of the participant. +func (r *ConferenceRecordsParticipantsService) Get(name string) *ConferenceRecordsParticipantsGetCall { + c := &ConferenceRecordsParticipantsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsParticipantsGetCall) Fields(s ...googleapi.Field) *ConferenceRecordsParticipantsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsParticipantsGetCall) IfNoneMatch(entityTag string) *ConferenceRecordsParticipantsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsParticipantsGetCall) Context(ctx context.Context) *ConferenceRecordsParticipantsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsParticipantsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsParticipantsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.participants.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Participant.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ConferenceRecordsParticipantsGetCall) Do(opts ...googleapi.CallOption) (*Participant, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Participant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ConferenceRecordsParticipantsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the participants in a conference record. By default, ordered by +// join time and in descending order. This API supports `fields` as standard +// parameters like every other API. However, when the `fields` request +// parameter is omitted, this API defaults to `'participants/*, +// next_page_token'`. +// +// - parent: Format: `conferenceRecords/{conference_record}`. +func (r *ConferenceRecordsParticipantsService) List(parent string) *ConferenceRecordsParticipantsListCall { + c := &ConferenceRecordsParticipantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": User specified filtering +// condition in EBNF format +// (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The +// following are the filterable fields: * `earliest_start_time` * +// `latest_end_time` For example, `latest_end_time IS NULL` returns active +// participants in the conference. +func (c *ConferenceRecordsParticipantsListCall) Filter(filter string) *ConferenceRecordsParticipantsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// participants to return. The service might return fewer than this value. If +// unspecified, at most 100 participants are returned. The maximum value is +// 250; values above 250 are coerced to 250. Maximum might change in the +// future. +func (c *ConferenceRecordsParticipantsListCall) PageSize(pageSize int64) *ConferenceRecordsParticipantsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token returned from +// previous List Call. +func (c *ConferenceRecordsParticipantsListCall) PageToken(pageToken string) *ConferenceRecordsParticipantsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsParticipantsListCall) Fields(s ...googleapi.Field) *ConferenceRecordsParticipantsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsParticipantsListCall) IfNoneMatch(entityTag string) *ConferenceRecordsParticipantsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsParticipantsListCall) Context(ctx context.Context) *ConferenceRecordsParticipantsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsParticipantsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsParticipantsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/participants") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.participants.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListParticipantsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ConferenceRecordsParticipantsListCall) Do(opts ...googleapi.CallOption) (*ListParticipantsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListParticipantsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConferenceRecordsParticipantsListCall) Pages(ctx context.Context, f func(*ListParticipantsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ConferenceRecordsParticipantsParticipantSessionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a participant session by participant session ID. +// +// - name: Resource name of the participant. +func (r *ConferenceRecordsParticipantsParticipantSessionsService) Get(name string) *ConferenceRecordsParticipantsParticipantSessionsGetCall { + c := &ConferenceRecordsParticipantsParticipantSessionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) Fields(s ...googleapi.Field) *ConferenceRecordsParticipantsParticipantSessionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) IfNoneMatch(entityTag string) *ConferenceRecordsParticipantsParticipantSessionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) Context(ctx context.Context) *ConferenceRecordsParticipantsParticipantSessionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.participants.participantSessions.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *ParticipantSession.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ConferenceRecordsParticipantsParticipantSessionsGetCall) Do(opts ...googleapi.CallOption) (*ParticipantSession, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ParticipantSession{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ConferenceRecordsParticipantsParticipantSessionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the participant sessions of a participant in a conference +// record. By default, ordered by join time and in descending order. This API +// supports `fields` as standard parameters like every other API. However, when +// the `fields` request parameter is omitted this API defaults to +// `'participantsessions/*, next_page_token'`. +// +// - parent: Format: +// `conferenceRecords/{conference_record}/participants/{participant}`. +func (r *ConferenceRecordsParticipantsParticipantSessionsService) List(parent string) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c := &ConferenceRecordsParticipantsParticipantSessionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": User specified filtering +// condition in EBNF format +// (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). The +// following are the filterable fields: * `start_time` * `end_time` For +// example, `end_time IS NULL` returns active participant sessions in the +// conference record. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) Filter(filter string) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// participant sessions to return. The service might return fewer than this +// value. If unspecified, at most 100 participants are returned. The maximum +// value is 250; values above 250 are coerced to 250. Maximum might change in +// the future. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) PageSize(pageSize int64) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token returned from +// previous List Call. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) PageToken(pageToken string) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) Fields(s ...googleapi.Field) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) IfNoneMatch(entityTag string) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) Context(ctx context.Context) *ConferenceRecordsParticipantsParticipantSessionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/participantSessions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.participants.participantSessions.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListParticipantSessionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) Do(opts ...googleapi.CallOption) (*ListParticipantSessionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListParticipantSessionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConferenceRecordsParticipantsParticipantSessionsListCall) Pages(ctx context.Context, f func(*ListParticipantSessionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ConferenceRecordsRecordingsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a recording by recording ID. +// +// - name: Resource name of the recording. +func (r *ConferenceRecordsRecordingsService) Get(name string) *ConferenceRecordsRecordingsGetCall { + c := &ConferenceRecordsRecordingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsRecordingsGetCall) Fields(s ...googleapi.Field) *ConferenceRecordsRecordingsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsRecordingsGetCall) IfNoneMatch(entityTag string) *ConferenceRecordsRecordingsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsRecordingsGetCall) Context(ctx context.Context) *ConferenceRecordsRecordingsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsRecordingsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsRecordingsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.recordings.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Recording.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ConferenceRecordsRecordingsGetCall) Do(opts ...googleapi.CallOption) (*Recording, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Recording{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ConferenceRecordsRecordingsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the recording resources from the conference record. By default, +// ordered by start time and in ascending order. +// +// - parent: Format: `conferenceRecords/{conference_record}`. +func (r *ConferenceRecordsRecordingsService) List(parent string) *ConferenceRecordsRecordingsListCall { + c := &ConferenceRecordsRecordingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// recordings to return. The service might return fewer than this value. If +// unspecified, at most 10 recordings are returned. The maximum value is 100; +// values above 100 are coerced to 100. Maximum might change in the future. +func (c *ConferenceRecordsRecordingsListCall) PageSize(pageSize int64) *ConferenceRecordsRecordingsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token returned from +// previous List Call. +func (c *ConferenceRecordsRecordingsListCall) PageToken(pageToken string) *ConferenceRecordsRecordingsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsRecordingsListCall) Fields(s ...googleapi.Field) *ConferenceRecordsRecordingsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsRecordingsListCall) IfNoneMatch(entityTag string) *ConferenceRecordsRecordingsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsRecordingsListCall) Context(ctx context.Context) *ConferenceRecordsRecordingsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsRecordingsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsRecordingsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/recordings") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.recordings.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListRecordingsResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ConferenceRecordsRecordingsListCall) Do(opts ...googleapi.CallOption) (*ListRecordingsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListRecordingsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConferenceRecordsRecordingsListCall) Pages(ctx context.Context, f func(*ListRecordingsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ConferenceRecordsTranscriptsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a transcript by transcript ID. +// +// - name: Resource name of the transcript. +func (r *ConferenceRecordsTranscriptsService) Get(name string) *ConferenceRecordsTranscriptsGetCall { + c := &ConferenceRecordsTranscriptsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsTranscriptsGetCall) Fields(s ...googleapi.Field) *ConferenceRecordsTranscriptsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsTranscriptsGetCall) IfNoneMatch(entityTag string) *ConferenceRecordsTranscriptsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsTranscriptsGetCall) Context(ctx context.Context) *ConferenceRecordsTranscriptsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsTranscriptsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsTranscriptsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.transcripts.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Transcript.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ConferenceRecordsTranscriptsGetCall) Do(opts ...googleapi.CallOption) (*Transcript, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Transcript{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ConferenceRecordsTranscriptsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the set of transcripts from the conference record. By default, +// ordered by start time and in ascending order. +// +// - parent: Format: `conferenceRecords/{conference_record}`. +func (r *ConferenceRecordsTranscriptsService) List(parent string) *ConferenceRecordsTranscriptsListCall { + c := &ConferenceRecordsTranscriptsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// transcripts to return. The service might return fewer than this value. If +// unspecified, at most 10 transcripts are returned. The maximum value is 100; +// values above 100 are coerced to 100. Maximum might change in the future. +func (c *ConferenceRecordsTranscriptsListCall) PageSize(pageSize int64) *ConferenceRecordsTranscriptsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token returned from +// previous List Call. +func (c *ConferenceRecordsTranscriptsListCall) PageToken(pageToken string) *ConferenceRecordsTranscriptsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsTranscriptsListCall) Fields(s ...googleapi.Field) *ConferenceRecordsTranscriptsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsTranscriptsListCall) IfNoneMatch(entityTag string) *ConferenceRecordsTranscriptsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsTranscriptsListCall) Context(ctx context.Context) *ConferenceRecordsTranscriptsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsTranscriptsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsTranscriptsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/transcripts") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.transcripts.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListTranscriptsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ConferenceRecordsTranscriptsListCall) Do(opts ...googleapi.CallOption) (*ListTranscriptsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListTranscriptsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConferenceRecordsTranscriptsListCall) Pages(ctx context.Context, f func(*ListTranscriptsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type ConferenceRecordsTranscriptsEntriesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a `TranscriptEntry` resource by entry ID. Note: The transcript +// entries returned by the Google Meet API might not match the transcription +// found in the Google Docs transcript file. This can occur when the Google +// Docs transcript file is modified after generation. +// +// - name: Resource name of the `TranscriptEntry`. +func (r *ConferenceRecordsTranscriptsEntriesService) Get(name string) *ConferenceRecordsTranscriptsEntriesGetCall { + c := &ConferenceRecordsTranscriptsEntriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsTranscriptsEntriesGetCall) Fields(s ...googleapi.Field) *ConferenceRecordsTranscriptsEntriesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsTranscriptsEntriesGetCall) IfNoneMatch(entityTag string) *ConferenceRecordsTranscriptsEntriesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsTranscriptsEntriesGetCall) Context(ctx context.Context) *ConferenceRecordsTranscriptsEntriesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsTranscriptsEntriesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsTranscriptsEntriesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.transcripts.entries.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *TranscriptEntry.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ConferenceRecordsTranscriptsEntriesGetCall) Do(opts ...googleapi.CallOption) (*TranscriptEntry, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &TranscriptEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type ConferenceRecordsTranscriptsEntriesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the structured transcript entries per transcript. By default, +// ordered by start time and in ascending order. Note: The transcript entries +// returned by the Google Meet API might not match the transcription found in +// the Google Docs transcript file. This can occur when the Google Docs +// transcript file is modified after generation. +// +// - parent: Format: +// `conferenceRecords/{conference_record}/transcripts/{transcript}`. +func (r *ConferenceRecordsTranscriptsEntriesService) List(parent string) *ConferenceRecordsTranscriptsEntriesListCall { + c := &ConferenceRecordsTranscriptsEntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of entries +// to return. The service might return fewer than this value. If unspecified, +// at most 10 entries are returned. The maximum value is 100; values above 100 +// are coerced to 100. Maximum might change in the future. +func (c *ConferenceRecordsTranscriptsEntriesListCall) PageSize(pageSize int64) *ConferenceRecordsTranscriptsEntriesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token returned from +// previous List Call. +func (c *ConferenceRecordsTranscriptsEntriesListCall) PageToken(pageToken string) *ConferenceRecordsTranscriptsEntriesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ConferenceRecordsTranscriptsEntriesListCall) Fields(s ...googleapi.Field) *ConferenceRecordsTranscriptsEntriesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ConferenceRecordsTranscriptsEntriesListCall) IfNoneMatch(entityTag string) *ConferenceRecordsTranscriptsEntriesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ConferenceRecordsTranscriptsEntriesListCall) Context(ctx context.Context) *ConferenceRecordsTranscriptsEntriesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ConferenceRecordsTranscriptsEntriesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ConferenceRecordsTranscriptsEntriesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/entries") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.conferenceRecords.transcripts.entries.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListTranscriptEntriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ConferenceRecordsTranscriptsEntriesListCall) Do(opts ...googleapi.CallOption) (*ListTranscriptEntriesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListTranscriptEntriesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ConferenceRecordsTranscriptsEntriesListCall) Pages(ctx context.Context, f func(*ListTranscriptEntriesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type SpacesCreateCall struct { + s *Service + space *Space + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a space. +func (r *SpacesService) Create(space *Space) *SpacesCreateCall { + c := &SpacesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.space = space + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *SpacesCreateCall) Fields(s ...googleapi.Field) *SpacesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *SpacesCreateCall) Context(ctx context.Context) *SpacesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *SpacesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *SpacesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.space) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/spaces") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.spaces.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *Space.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *SpacesCreateCall) Do(opts ...googleapi.CallOption) (*Space, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Space{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type SpacesEndActiveConferenceCall struct { + s *Service + name string + endactiveconferencerequest *EndActiveConferenceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// EndActiveConference: Ends an active conference (if there's one). +// +// - name: Resource name of the space. +func (r *SpacesService) EndActiveConference(name string, endactiveconferencerequest *EndActiveConferenceRequest) *SpacesEndActiveConferenceCall { + c := &SpacesEndActiveConferenceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.endactiveconferencerequest = endactiveconferencerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *SpacesEndActiveConferenceCall) Fields(s ...googleapi.Field) *SpacesEndActiveConferenceCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *SpacesEndActiveConferenceCall) Context(ctx context.Context) *SpacesEndActiveConferenceCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *SpacesEndActiveConferenceCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *SpacesEndActiveConferenceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.endactiveconferencerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:endActiveConference") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.spaces.endActiveConference" call. +// Any non-2xx status code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *SpacesEndActiveConferenceCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type SpacesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a space by `space_id` or `meeting_code`. +// +// - name: Resource name of the space. +func (r *SpacesService) Get(name string) *SpacesGetCall { + c := &SpacesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *SpacesGetCall) Fields(s ...googleapi.Field) *SpacesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *SpacesGetCall) IfNoneMatch(entityTag string) *SpacesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *SpacesGetCall) Context(ctx context.Context) *SpacesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *SpacesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *SpacesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.spaces.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Space.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *SpacesGetCall) Do(opts ...googleapi.CallOption) (*Space, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Space{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type SpacesPatchCall struct { + s *Service + name string + space *Space + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a space. +// +// - name: Immutable. Resource name of the space. Format: `spaces/{space}`. +func (r *SpacesService) Patch(name string, space *Space) *SpacesPatchCall { + c := &SpacesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.space = space + return c +} + +// UpdateMask sets the optional parameter "updateMask": Field mask used to +// specify the fields to be updated in the space. If update_mask isn't +// provided, it defaults to '*' and updates all fields provided in the request, +// including deleting fields not set in the request. +func (c *SpacesPatchCall) UpdateMask(updateMask string) *SpacesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *SpacesPatchCall) Fields(s ...googleapi.Field) *SpacesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *SpacesPatchCall) Context(ctx context.Context) *SpacesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *SpacesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *SpacesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.space) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "meet.spaces.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *Space.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *SpacesPatchCall) Do(opts ...googleapi.CallOption) (*Space, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Space{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} diff --git a/metastore/v1/metastore-api.json b/metastore/v1/metastore-api.json index d1975cf3d43..a45b25f1306 100644 --- a/metastore/v1/metastore-api.json +++ b/metastore/v1/metastore-api.json @@ -1495,7 +1495,7 @@ } } }, - "revision": "20240510", + "revision": "20240611", "rootUrl": "https://metastore.googleapis.com/", "schemas": { "AlterMetadataResourceLocationRequest": { @@ -1748,31 +1748,6 @@ }, "type": "object" }, - "CustomRegionMetadata": { - "description": "Metadata about a custom region. This is only populated if the region is a custom region. For single/multi regions, it will be empty.", - "id": "CustomRegionMetadata", - "properties": { - "optionalReadOnlyRegions": { - "description": "The read-only regions for this custom region.", - "items": { - "type": "string" - }, - "type": "array" - }, - "requiredReadWriteRegions": { - "description": "The read-write regions for this custom region.", - "items": { - "type": "string" - }, - "type": "array" - }, - "witnessRegion": { - "description": "The Spanner witness region for this custom region.", - "type": "string" - } - }, - "type": "object" - }, "DataCatalogConfig": { "description": "Specifies how metastore metadata should be integrated with the Data Catalog service.", "id": "DataCatalogConfig", @@ -2279,13 +2254,6 @@ "description": "Metadata about the service in a location.", "id": "LocationMetadata", "properties": { - "customRegionMetadata": { - "description": "Possible configurations supported if the current region is a custom region.", - "items": { - "$ref": "CustomRegionMetadata" - }, - "type": "array" - }, "multiRegionMetadata": { "$ref": "MultiRegionMetadata", "description": "The multi-region metadata if the current region is a multi-region." diff --git a/metastore/v1/metastore-gen.go b/metastore/v1/metastore-gen.go index d7623eeb93f..d8c39644f6c 100644 --- a/metastore/v1/metastore-gen.go +++ b/metastore/v1/metastore-gen.go @@ -652,34 +652,6 @@ func (s *Consumer) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// CustomRegionMetadata: Metadata about a custom region. This is only populated -// if the region is a custom region. For single/multi regions, it will be -// empty. -type CustomRegionMetadata struct { - // OptionalReadOnlyRegions: The read-only regions for this custom region. - OptionalReadOnlyRegions []string `json:"optionalReadOnlyRegions,omitempty"` - // RequiredReadWriteRegions: The read-write regions for this custom region. - RequiredReadWriteRegions []string `json:"requiredReadWriteRegions,omitempty"` - // WitnessRegion: The Spanner witness region for this custom region. - WitnessRegion string `json:"witnessRegion,omitempty"` - // ForceSendFields is a list of field names (e.g. "OptionalReadOnlyRegions") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "OptionalReadOnlyRegions") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *CustomRegionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod CustomRegionMetadata - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // DataCatalogConfig: Specifies how metastore metadata should be integrated // with the Data Catalog service. type DataCatalogConfig struct { @@ -1319,9 +1291,6 @@ func (s *Location) MarshalJSON() ([]byte, error) { // LocationMetadata: Metadata about the service in a location. type LocationMetadata struct { - // CustomRegionMetadata: Possible configurations supported if the current - // region is a custom region. - CustomRegionMetadata []*CustomRegionMetadata `json:"customRegionMetadata,omitempty"` // MultiRegionMetadata: The multi-region metadata if the current region is a // multi-region. MultiRegionMetadata *MultiRegionMetadata `json:"multiRegionMetadata,omitempty"` @@ -1330,13 +1299,13 @@ type LocationMetadata struct { // guarantees that exactly one HiveMetastoreVersion in the list will set // is_default. SupportedHiveMetastoreVersions []*HiveMetastoreVersion `json:"supportedHiveMetastoreVersions,omitempty"` - // ForceSendFields is a list of field names (e.g. "CustomRegionMetadata") to + // ForceSendFields is a list of field names (e.g. "MultiRegionMetadata") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CustomRegionMetadata") to include + // NullFields is a list of field names (e.g. "MultiRegionMetadata") to include // in API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. diff --git a/metastore/v1alpha/metastore-api.json b/metastore/v1alpha/metastore-api.json index ba1a5112a98..78eb6b515a8 100644 --- a/metastore/v1alpha/metastore-api.json +++ b/metastore/v1alpha/metastore-api.json @@ -1796,7 +1796,7 @@ } } }, - "revision": "20240510", + "revision": "20240611", "rootUrl": "https://metastore.googleapis.com/", "schemas": { "AlterMetadataResourceLocationRequest": { @@ -2196,31 +2196,6 @@ }, "type": "object" }, - "CustomRegionMetadata": { - "description": "Metadata about a custom region. This is only populated if the region is a custom region. For single/multi regions, it will be empty.", - "id": "CustomRegionMetadata", - "properties": { - "optionalReadOnlyRegions": { - "description": "The read-only regions for this custom region.", - "items": { - "type": "string" - }, - "type": "array" - }, - "requiredReadWriteRegions": { - "description": "The read-write regions for this custom region.", - "items": { - "type": "string" - }, - "type": "array" - }, - "witnessRegion": { - "description": "The Spanner witness region for this custom region.", - "type": "string" - } - }, - "type": "object" - }, "DataCatalogConfig": { "description": "Specifies how metastore metadata should be integrated with the Data Catalog service.", "id": "DataCatalogConfig", @@ -2794,13 +2769,6 @@ "description": "Metadata about the service in a location.", "id": "LocationMetadata", "properties": { - "customRegionMetadata": { - "description": "Possible configurations supported if the current region is a custom region.", - "items": { - "$ref": "CustomRegionMetadata" - }, - "type": "array" - }, "multiRegionMetadata": { "$ref": "MultiRegionMetadata", "description": "The multi-region metadata if the current region is a multi-region." diff --git a/metastore/v1alpha/metastore-gen.go b/metastore/v1alpha/metastore-gen.go index 00f4f9b0912..63efc58e002 100644 --- a/metastore/v1alpha/metastore-gen.go +++ b/metastore/v1alpha/metastore-gen.go @@ -907,34 +907,6 @@ func (s *Consumer) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// CustomRegionMetadata: Metadata about a custom region. This is only populated -// if the region is a custom region. For single/multi regions, it will be -// empty. -type CustomRegionMetadata struct { - // OptionalReadOnlyRegions: The read-only regions for this custom region. - OptionalReadOnlyRegions []string `json:"optionalReadOnlyRegions,omitempty"` - // RequiredReadWriteRegions: The read-write regions for this custom region. - RequiredReadWriteRegions []string `json:"requiredReadWriteRegions,omitempty"` - // WitnessRegion: The Spanner witness region for this custom region. - WitnessRegion string `json:"witnessRegion,omitempty"` - // ForceSendFields is a list of field names (e.g. "OptionalReadOnlyRegions") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "OptionalReadOnlyRegions") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *CustomRegionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod CustomRegionMetadata - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // DataCatalogConfig: Specifies how metastore metadata should be integrated // with the Data Catalog service. type DataCatalogConfig struct { @@ -1696,9 +1668,6 @@ func (s *Location) MarshalJSON() ([]byte, error) { // LocationMetadata: Metadata about the service in a location. type LocationMetadata struct { - // CustomRegionMetadata: Possible configurations supported if the current - // region is a custom region. - CustomRegionMetadata []*CustomRegionMetadata `json:"customRegionMetadata,omitempty"` // MultiRegionMetadata: The multi-region metadata if the current region is a // multi-region. MultiRegionMetadata *MultiRegionMetadata `json:"multiRegionMetadata,omitempty"` @@ -1707,13 +1676,13 @@ type LocationMetadata struct { // guarantees that exactly one HiveMetastoreVersion in the list will set // is_default. SupportedHiveMetastoreVersions []*HiveMetastoreVersion `json:"supportedHiveMetastoreVersions,omitempty"` - // ForceSendFields is a list of field names (e.g. "CustomRegionMetadata") to + // ForceSendFields is a list of field names (e.g. "MultiRegionMetadata") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CustomRegionMetadata") to include + // NullFields is a list of field names (e.g. "MultiRegionMetadata") to include // in API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. diff --git a/metastore/v1beta/metastore-api.json b/metastore/v1beta/metastore-api.json index 9f1a71d2c7c..98d74e7da57 100644 --- a/metastore/v1beta/metastore-api.json +++ b/metastore/v1beta/metastore-api.json @@ -1796,7 +1796,7 @@ } } }, - "revision": "20240510", + "revision": "20240611", "rootUrl": "https://metastore.googleapis.com/", "schemas": { "AlterMetadataResourceLocationRequest": { @@ -2196,31 +2196,6 @@ }, "type": "object" }, - "CustomRegionMetadata": { - "description": "Metadata about a custom region. This is only populated if the region is a custom region. For single/multi regions, it will be empty.", - "id": "CustomRegionMetadata", - "properties": { - "optionalReadOnlyRegions": { - "description": "The read-only regions for this custom region.", - "items": { - "type": "string" - }, - "type": "array" - }, - "requiredReadWriteRegions": { - "description": "The read-write regions for this custom region.", - "items": { - "type": "string" - }, - "type": "array" - }, - "witnessRegion": { - "description": "The Spanner witness region for this custom region.", - "type": "string" - } - }, - "type": "object" - }, "DataCatalogConfig": { "description": "Specifies how metastore metadata should be integrated with the Data Catalog service.", "id": "DataCatalogConfig", @@ -2794,13 +2769,6 @@ "description": "Metadata about the service in a location.", "id": "LocationMetadata", "properties": { - "customRegionMetadata": { - "description": "Possible configurations supported if the current region is a custom region.", - "items": { - "$ref": "CustomRegionMetadata" - }, - "type": "array" - }, "multiRegionMetadata": { "$ref": "MultiRegionMetadata", "description": "The multi-region metadata if the current region is a multi-region." diff --git a/metastore/v1beta/metastore-gen.go b/metastore/v1beta/metastore-gen.go index 2fb45db2513..8dff9f80460 100644 --- a/metastore/v1beta/metastore-gen.go +++ b/metastore/v1beta/metastore-gen.go @@ -907,34 +907,6 @@ func (s *Consumer) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// CustomRegionMetadata: Metadata about a custom region. This is only populated -// if the region is a custom region. For single/multi regions, it will be -// empty. -type CustomRegionMetadata struct { - // OptionalReadOnlyRegions: The read-only regions for this custom region. - OptionalReadOnlyRegions []string `json:"optionalReadOnlyRegions,omitempty"` - // RequiredReadWriteRegions: The read-write regions for this custom region. - RequiredReadWriteRegions []string `json:"requiredReadWriteRegions,omitempty"` - // WitnessRegion: The Spanner witness region for this custom region. - WitnessRegion string `json:"witnessRegion,omitempty"` - // ForceSendFields is a list of field names (e.g. "OptionalReadOnlyRegions") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "OptionalReadOnlyRegions") to - // include in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *CustomRegionMetadata) MarshalJSON() ([]byte, error) { - type NoMethod CustomRegionMetadata - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // DataCatalogConfig: Specifies how metastore metadata should be integrated // with the Data Catalog service. type DataCatalogConfig struct { @@ -1696,9 +1668,6 @@ func (s *Location) MarshalJSON() ([]byte, error) { // LocationMetadata: Metadata about the service in a location. type LocationMetadata struct { - // CustomRegionMetadata: Possible configurations supported if the current - // region is a custom region. - CustomRegionMetadata []*CustomRegionMetadata `json:"customRegionMetadata,omitempty"` // MultiRegionMetadata: The multi-region metadata if the current region is a // multi-region. MultiRegionMetadata *MultiRegionMetadata `json:"multiRegionMetadata,omitempty"` @@ -1707,13 +1676,13 @@ type LocationMetadata struct { // guarantees that exactly one HiveMetastoreVersion in the list will set // is_default. SupportedHiveMetastoreVersions []*HiveMetastoreVersion `json:"supportedHiveMetastoreVersions,omitempty"` - // ForceSendFields is a list of field names (e.g. "CustomRegionMetadata") to + // ForceSendFields is a list of field names (e.g. "MultiRegionMetadata") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CustomRegionMetadata") to include + // NullFields is a list of field names (e.g. "MultiRegionMetadata") to include // in API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. diff --git a/monitoring/v3/monitoring-api.json b/monitoring/v3/monitoring-api.json index b9b07932b48..c75ead2a5eb 100644 --- a/monitoring/v3/monitoring-api.json +++ b/monitoring/v3/monitoring-api.json @@ -2714,7 +2714,7 @@ } } }, - "revision": "20240602", + "revision": "20240616", "rootUrl": "https://monitoring.googleapis.com/", "schemas": { "Aggregation": { @@ -3457,15 +3457,22 @@ "id": "Documentation", "properties": { "content": { - "description": "The body of the documentation, interpreted according to mime_type. The content may not exceed 8,192 Unicode characters and may not exceed more than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. This text can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables).", + "description": "The body of the documentation, interpreted according to mime_type. The content may not exceed 8,192 Unicode characters and may not exceed more than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. This text can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars).", "type": "string" }, + "links": { + "description": "Optional. Links to content such as playbooks, repositories, and other resources. This field can contain up to 3 entries.", + "items": { + "$ref": "Link" + }, + "type": "array" + }, "mimeType": { "description": "The format of the content field. Presently, only the value \"text/markdown\" is supported. See Markdown (https://en.wikipedia.org/wiki/Markdown) for more information.", "type": "string" }, "subject": { - "description": "Optional. The subject line of the notification. The subject line may not exceed 10,240 bytes. In notifications generated by this policy, the contents of the subject line after variable expansion will be truncated to 255 bytes or shorter at the latest UTF-8 character boundary. The 255-byte limit is recommended by this thread (https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). It is both the limit imposed by some third-party ticketing products and it is common to define textual fields in databases as VARCHAR(255).The contents of the subject line can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables). If this field is missing or empty, a default subject line will be generated.", + "description": "Optional. The subject line of the notification. The subject line may not exceed 10,240 bytes. In notifications generated by this policy, the contents of the subject line after variable expansion will be truncated to 255 bytes or shorter at the latest UTF-8 character boundary. The 255-byte limit is recommended by this thread (https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). It is both the limit imposed by some third-party ticketing products and it is common to define textual fields in databases as VARCHAR(255).The contents of the subject line can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). If this field is missing or empty, a default subject line will be generated.", "type": "string" } }, @@ -4106,6 +4113,21 @@ }, "type": "object" }, + "Link": { + "description": "Links to content such as playbooks, repositories, and other resources.", + "id": "Link", + "properties": { + "displayName": { + "description": "A short display name for the link. The display name must not be empty or exceed 63 characters. Example: \"playbook\".", + "type": "string" + }, + "url": { + "description": "The url of a webpage. A url can be templatized by using variables in the path or the query parameters. The total length of a URL should not exceed 2083 characters before and after variable expansion. Example: \"https://my_domain.com/playbook?name=${resource.name}\"", + "type": "string" + } + }, + "type": "object" + }, "ListAlertPoliciesResponse": { "description": "The protocol for the ListAlertPolicies response.", "id": "ListAlertPoliciesResponse", @@ -5158,7 +5180,7 @@ "additionalProperties": { "type": "string" }, - "description": "Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). Label values can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables). The only available variable names are the names of the labels in the PromQL result, including \"__name__\" and \"value\". \"labels\" may be empty.", + "description": "Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). Label values can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). The only available variable names are the names of the labels in the PromQL result, including \"__name__\" and \"value\". \"labels\" may be empty.", "type": "object" }, "query": { @@ -5459,7 +5481,7 @@ "type": "string" }, "goal": { - "description": "The fraction of service that must be good in order for this objective to be met. 0 \u003c goal \u003c= 0.999.", + "description": "The fraction of service that must be good in order for this objective to be met. 0 \u003c goal \u003c= 0.9999.", "format": "double", "type": "number" }, diff --git a/monitoring/v3/monitoring-gen.go b/monitoring/v3/monitoring-gen.go index eb9f1e2a541..769a4d52a3b 100644 --- a/monitoring/v3/monitoring-gen.go +++ b/monitoring/v3/monitoring-gen.go @@ -1601,8 +1601,11 @@ type Documentation struct { // The content may not exceed 8,192 Unicode characters and may not exceed more // than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. This // text can be templatized by using variables - // (https://cloud.google.com/monitoring/alerts/doc-variables). + // (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). Content string `json:"content,omitempty"` + // Links: Optional. Links to content such as playbooks, repositories, and other + // resources. This field can contain up to 3 entries. + Links []*Link `json:"links,omitempty"` // MimeType: The format of the content field. Presently, only the value // "text/markdown" is supported. See Markdown // (https://en.wikipedia.org/wiki/Markdown) for more information. @@ -1616,8 +1619,8 @@ type Documentation struct { // It is both the limit imposed by some third-party ticketing products and it // is common to define textual fields in databases as VARCHAR(255).The contents // of the subject line can be templatized by using variables - // (https://cloud.google.com/monitoring/alerts/doc-variables). If this field is - // missing or empty, a default subject line will be generated. + // (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). If this + // field is missing or empty, a default subject line will be generated. Subject string `json:"subject,omitempty"` // ForceSendFields is a list of field names (e.g. "Content") to unconditionally // include in API requests. By default, fields with empty or default values are @@ -2578,6 +2581,34 @@ func (s *Linear) UnmarshalJSON(data []byte) error { return nil } +// Link: Links to content such as playbooks, repositories, and other resources. +type Link struct { + // DisplayName: A short display name for the link. The display name must not be + // empty or exceed 63 characters. Example: "playbook". + DisplayName string `json:"displayName,omitempty"` + // Url: The url of a webpage. A url can be templatized by using variables in + // the path or the query parameters. The total length of a URL should not + // exceed 2083 characters before and after variable expansion. Example: + // "https://my_domain.com/playbook?name=${resource.name}" + Url string `json:"url,omitempty"` + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DisplayName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Link) MarshalJSON() ([]byte, error) { + type NoMethod Link + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // ListAlertPoliciesResponse: The protocol for the ListAlertPolicies response. type ListAlertPoliciesResponse struct { // AlertPolicies: The returned alert policies. @@ -4262,9 +4293,9 @@ type PrometheusQueryLanguageCondition struct { // Label names must be valid // (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). // Label values can be templatized by using variables - // (https://cloud.google.com/monitoring/alerts/doc-variables). The only - // available variable names are the names of the labels in the PromQL result, - // including "__name__" and "value". "labels" may be empty. + // (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). The + // only available variable names are the names of the labels in the PromQL + // result, including "__name__" and "value". "labels" may be empty. Labels map[string]string `json:"labels,omitempty"` // Query: Required. The PromQL expression to evaluate. Every evaluation cycle // this expression is evaluated at the current time, and all resultant time @@ -4671,7 +4702,7 @@ type ServiceLevelObjective struct { // DisplayName: Name used for UI elements listing this SLO. DisplayName string `json:"displayName,omitempty"` // Goal: The fraction of service that must be good in order for this objective - // to be met. 0 < goal <= 0.999. + // to be met. 0 < goal <= 0.9999. Goal float64 `json:"goal,omitempty"` // Name: Identifier. Resource name for this ServiceLevelObjective. The format // is: diff --git a/networkmanagement/v1/networkmanagement-api.json b/networkmanagement/v1/networkmanagement-api.json index 787a1aaba96..e563cea816b 100644 --- a/networkmanagement/v1/networkmanagement-api.json +++ b/networkmanagement/v1/networkmanagement-api.json @@ -591,7 +591,7 @@ } } }, - "revision": "20240515", + "revision": "20240605", "rootUrl": "https://networkmanagement.googleapis.com/", "schemas": { "AbortInfo": { @@ -1120,6 +1120,7 @@ "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC", "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION", "CLOUD_SQL_INSTANCE_NO_ROUTE", + "CLOUD_SQL_CONNECTOR_REQUIRED", "CLOUD_FUNCTION_NOT_ACTIVE", "VPC_CONNECTOR_NOT_SET", "VPC_CONNECTOR_NOT_RUNNING", @@ -1185,6 +1186,7 @@ "Packet sent from a Cloud SQL instance to an external IP address is not allowed. The Cloud SQL instance is not configured to send packets to external IP addresses.", "Packet sent from a Cloud SQL instance with only a public IP address to a private IP address.", "Packet was dropped because there is no route from a Cloud SQL instance to a destination network.", + "Packet was dropped because the Cloud SQL instance requires all connections to use Cloud SQL connectors and to target the Cloud SQL proxy port (3307).", "Packet could be dropped because the Cloud Function is not in an active status.", "Packet could be dropped because no VPC connector is set.", "Packet could be dropped because the VPC connector is not in a running state.", diff --git a/networkmanagement/v1/networkmanagement-gen.go b/networkmanagement/v1/networkmanagement-gen.go index 08057fdbd79..97c33f1ffbf 100644 --- a/networkmanagement/v1/networkmanagement-gen.go +++ b/networkmanagement/v1/networkmanagement-gen.go @@ -946,6 +946,9 @@ type DropInfo struct { // Cloud SQL instance with only a public IP address to a private IP address. // "CLOUD_SQL_INSTANCE_NO_ROUTE" - Packet was dropped because there is no // route from a Cloud SQL instance to a destination network. + // "CLOUD_SQL_CONNECTOR_REQUIRED" - Packet was dropped because the Cloud SQL + // instance requires all connections to use Cloud SQL connectors and to target + // the Cloud SQL proxy port (3307). // "CLOUD_FUNCTION_NOT_ACTIVE" - Packet could be dropped because the Cloud // Function is not in an active status. // "VPC_CONNECTOR_NOT_SET" - Packet could be dropped because no VPC connector diff --git a/networkmanagement/v1beta1/networkmanagement-api.json b/networkmanagement/v1beta1/networkmanagement-api.json index 8b60a461c33..0c7b5260552 100644 --- a/networkmanagement/v1beta1/networkmanagement-api.json +++ b/networkmanagement/v1beta1/networkmanagement-api.json @@ -591,7 +591,7 @@ } } }, - "revision": "20240515", + "revision": "20240605", "rootUrl": "https://networkmanagement.googleapis.com/", "schemas": { "AbortInfo": { @@ -893,6 +893,11 @@ "description": "Location in which this revision is deployed.", "type": "string" }, + "serviceName": { + "deprecated": true, + "description": "ID of Cloud Run Service this revision belongs to. Was never set, is not exported to v1 proto and public protos. Do not export to v1beta1 public proto.", + "type": "string" + }, "serviceUri": { "description": "URI of Cloud Run service this revision belongs to.", "type": "string" @@ -1120,6 +1125,7 @@ "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC", "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION", "CLOUD_SQL_INSTANCE_NO_ROUTE", + "CLOUD_SQL_CONNECTOR_REQUIRED", "CLOUD_FUNCTION_NOT_ACTIVE", "VPC_CONNECTOR_NOT_SET", "VPC_CONNECTOR_NOT_RUNNING", @@ -1185,6 +1191,7 @@ "Packet sent from a Cloud SQL instance to an external IP address is not allowed. The Cloud SQL instance is not configured to send packets to external IP addresses.", "Packet sent from a Cloud SQL instance with only a public IP address to a private IP address.", "Packet was dropped because there is no route from a Cloud SQL instance to a destination network.", + "Packet was dropped because the Cloud SQL instance requires all connections to use Cloud SQL connectors and to target the Cloud SQL proxy port (3307).", "Packet could be dropped because the Cloud Function is not in an active status.", "Packet could be dropped because no VPC connector is set.", "Packet could be dropped because the VPC connector is not in a running state.", diff --git a/networkmanagement/v1beta1/networkmanagement-gen.go b/networkmanagement/v1beta1/networkmanagement-gen.go index d6a7b4fae92..fbd2a332abb 100644 --- a/networkmanagement/v1beta1/networkmanagement-gen.go +++ b/networkmanagement/v1beta1/networkmanagement-gen.go @@ -631,6 +631,10 @@ type CloudRunRevisionInfo struct { DisplayName string `json:"displayName,omitempty"` // Location: Location in which this revision is deployed. Location string `json:"location,omitempty"` + // ServiceName: ID of Cloud Run Service this revision belongs to. Was never + // set, is not exported to v1 proto and public protos. Do not export to v1beta1 + // public proto. + ServiceName string `json:"serviceName,omitempty"` // ServiceUri: URI of Cloud Run service this revision belongs to. ServiceUri string `json:"serviceUri,omitempty"` // Uri: URI of a Cloud Run revision. @@ -946,6 +950,9 @@ type DropInfo struct { // Cloud SQL instance with only a public IP address to a private IP address. // "CLOUD_SQL_INSTANCE_NO_ROUTE" - Packet was dropped because there is no // route from a Cloud SQL instance to a destination network. + // "CLOUD_SQL_CONNECTOR_REQUIRED" - Packet was dropped because the Cloud SQL + // instance requires all connections to use Cloud SQL connectors and to target + // the Cloud SQL proxy port (3307). // "CLOUD_FUNCTION_NOT_ACTIVE" - Packet could be dropped because the Cloud // Function is not in an active status. // "VPC_CONNECTOR_NOT_SET" - Packet could be dropped because no VPC connector diff --git a/oslogin/v1alpha/oslogin-api.json b/oslogin/v1alpha/oslogin-api.json index e6014d79224..8b530003c7a 100644 --- a/oslogin/v1alpha/oslogin-api.json +++ b/oslogin/v1alpha/oslogin-api.json @@ -298,7 +298,7 @@ ], "parameters": { "parent": { - "description": "The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.", + "description": "The parent project and region for the signing request.", "location": "path", "pattern": "^users/[^/]+/projects/[^/]+/locations/[^/]+$", "required": true, @@ -331,7 +331,7 @@ ], "parameters": { "parent": { - "description": "The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.", + "description": "The parent project and region for the signing request.", "location": "path", "pattern": "^users/[^/]+/projects/[^/]+/zones/[^/]+$", "required": true, @@ -477,7 +477,7 @@ } } }, - "revision": "20231217", + "revision": "20240609", "rootUrl": "https://oslogin.googleapis.com/", "schemas": { "Empty": { diff --git a/oslogin/v1alpha/oslogin-gen.go b/oslogin/v1alpha/oslogin-gen.go index 29e653fcf0e..d5fc4183a3e 100644 --- a/oslogin/v1alpha/oslogin-gen.go +++ b/oslogin/v1alpha/oslogin-gen.go @@ -919,10 +919,7 @@ type UsersProjectsLocationsSignSshPublicKeyCall struct { // SignSshPublicKey: Signs an SSH public key for a user to authenticate to a // virtual machine on Google Compute Engine. // -// - parent: The parent project and zone for the signing request. This is -// needed to properly ensure per-organization ISS processing and potentially -// to provide for the possibility of zone-specific certificates used in the -// signing process. +// - parent: The parent project and region for the signing request. func (r *UsersProjectsLocationsService) SignSshPublicKey(parent string, signsshpublickeyrequest *SignSshPublicKeyRequest) *UsersProjectsLocationsSignSshPublicKeyCall { c := &UsersProjectsLocationsSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -1025,10 +1022,7 @@ type UsersProjectsZonesSignSshPublicKeyCall struct { // SignSshPublicKey: Signs an SSH public key for a user to authenticate to a // virtual machine on Google Compute Engine. // -// - parent: The parent project and zone for the signing request. This is -// needed to properly ensure per-organization ISS processing and potentially -// to provide for the possibility of zone-specific certificates used in the -// signing process. +// - parent: The parent project and region for the signing request. func (r *UsersProjectsZonesService) SignSshPublicKey(parent string, signsshpublickeyrequest *SignSshPublicKeyRequest) *UsersProjectsZonesSignSshPublicKeyCall { c := &UsersProjectsZonesSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent diff --git a/oslogin/v1beta/oslogin-api.json b/oslogin/v1beta/oslogin-api.json index c7e74aab739..0c83a44d57a 100644 --- a/oslogin/v1beta/oslogin-api.json +++ b/oslogin/v1beta/oslogin-api.json @@ -268,7 +268,7 @@ ], "parameters": { "parent": { - "description": "The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.", + "description": "The parent project and region for the signing request.", "location": "path", "pattern": "^users/[^/]+/projects/[^/]+/locations/[^/]+$", "required": true, @@ -301,7 +301,7 @@ ], "parameters": { "parent": { - "description": "The parent project and zone for the signing request. This is needed to properly ensure per-organization ISS processing and potentially to provide for the possibility of zone-specific certificates used in the signing process.", + "description": "The parent project and region for the signing request.", "location": "path", "pattern": "^users/[^/]+/projects/[^/]+/zones/[^/]+$", "required": true, @@ -447,7 +447,7 @@ } } }, - "revision": "20231217", + "revision": "20240609", "rootUrl": "https://oslogin.googleapis.com/", "schemas": { "Empty": { diff --git a/oslogin/v1beta/oslogin-gen.go b/oslogin/v1beta/oslogin-gen.go index 6f93489462d..c4e63c0135e 100644 --- a/oslogin/v1beta/oslogin-gen.go +++ b/oslogin/v1beta/oslogin-gen.go @@ -887,10 +887,7 @@ type UsersProjectsLocationsSignSshPublicKeyCall struct { // SignSshPublicKey: Signs an SSH public key for a user to authenticate to an // instance. // -// - parent: The parent project and zone for the signing request. This is -// needed to properly ensure per-organization ISS processing and potentially -// to provide for the possibility of zone-specific certificates used in the -// signing process. +// - parent: The parent project and region for the signing request. func (r *UsersProjectsLocationsService) SignSshPublicKey(parent string, signsshpublickeyrequest *SignSshPublicKeyRequest) *UsersProjectsLocationsSignSshPublicKeyCall { c := &UsersProjectsLocationsSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -993,10 +990,7 @@ type UsersProjectsZonesSignSshPublicKeyCall struct { // SignSshPublicKey: Signs an SSH public key for a user to authenticate to an // instance. // -// - parent: The parent project and zone for the signing request. This is -// needed to properly ensure per-organization ISS processing and potentially -// to provide for the possibility of zone-specific certificates used in the -// signing process. +// - parent: The parent project and region for the signing request. func (r *UsersProjectsZonesService) SignSshPublicKey(parent string, signsshpublickeyrequest *SignSshPublicKeyRequest) *UsersProjectsZonesSignSshPublicKeyCall { c := &UsersProjectsZonesSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent diff --git a/paymentsresellersubscription/v1/paymentsresellersubscription-api.json b/paymentsresellersubscription/v1/paymentsresellersubscription-api.json index 32ea0a98266..44e9ae9ed22 100644 --- a/paymentsresellersubscription/v1/paymentsresellersubscription-api.json +++ b/paymentsresellersubscription/v1/paymentsresellersubscription-api.json @@ -110,7 +110,7 @@ "products": { "methods": { "list": { - "description": "To retrieve the products that can be resold by the partner. It should be autenticated with a service account.", + "description": "To retrieve the products that can be resold by the partner. It should be autenticated with a service account. - This API doesn't apply to YouTube products currently.", "flatPath": "v1/partners/{partnersId}/products", "httpMethod": "GET", "id": "paymentsresellersubscription.partners.products.list", @@ -183,7 +183,7 @@ ] }, "list": { - "description": "To retrieve the promotions, such as free trial, that can be used by the partner. It should be autenticated with a service account.", + "description": "Retrieves the promotions, such as free trial, that can be used by the partner. - This API doesn't apply to YouTube promotions currently. It should be autenticated with a service account.", "flatPath": "v1/partners/{partnersId}/promotions", "httpMethod": "GET", "id": "paymentsresellersubscription.partners.promotions.list", @@ -403,7 +403,7 @@ ] }, "undoCancel": { - "description": "Used by partners to revoke the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. It should be called directly by the partner using service accounts.", + "description": "Revokes the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. - **This API doesn't apply to YouTube subscriptions.** It should be called directly by the partner using service accounts.", "flatPath": "v1/partners/{partnersId}/subscriptions/{subscriptionsId}:undoCancel", "httpMethod": "POST", "id": "paymentsresellersubscription.partners.subscriptions.undoCancel", @@ -435,7 +435,7 @@ } } }, - "revision": "20240404", + "revision": "20240617", "rootUrl": "https://paymentsresellersubscription.googleapis.com/", "schemas": { "GoogleCloudPaymentsResellerSubscriptionV1Amount": { @@ -459,7 +459,7 @@ "id": "GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest", "properties": { "cancelImmediately": { - "description": "Optional. If true, Google will cancel the subscription immediately, and may or may not (based on the contract) issue a prorated refund for the remainder of the billing cycle. Otherwise, Google defers the cancelation at renewal_time, and will not issue a refund.", + "description": "Optional. If true, Google will cancel the subscription immediately, and may or may not (based on the contract) issue a prorated refund for the remainder of the billing cycle. Otherwise, Google defers the cancelation at renewal_time, and will not issue a refund. - YouTube subscriptions must use this option currently. However, the user will still have access to the subscription until the end of the billing cycle.", "type": "boolean" }, "cancellationReason": { @@ -535,7 +535,7 @@ "type": "object" }, "GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest": { - "description": "Partner request for entitling the previously provisioned subscription to an end user. The end user identity is inferred from the request OAuth context.", + "description": "LINT.IfChange Partner request for entitling the previously provisioned subscription to an end user. The end user identity is inferred from the request OAuth context.", "id": "GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest", "properties": { "lineItemEntitlementDetails": { diff --git a/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go b/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go index 51a90998ea5..be7018ab31e 100644 --- a/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go +++ b/paymentsresellersubscription/v1/paymentsresellersubscription-gen.go @@ -231,7 +231,9 @@ type GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest struct { // CancelImmediately: Optional. If true, Google will cancel the subscription // immediately, and may or may not (based on the contract) issue a prorated // refund for the remainder of the billing cycle. Otherwise, Google defers the - // cancelation at renewal_time, and will not issue a refund. + // cancelation at renewal_time, and will not issue a refund. - YouTube + // subscriptions must use this option currently. However, the user will still + // have access to the subscription until the end of the billing cycle. CancelImmediately bool `json:"cancelImmediately,omitempty"` // CancellationReason: Specifies the reason for the cancellation. // @@ -330,9 +332,10 @@ func (s *GoogleCloudPaymentsResellerSubscriptionV1Duration) MarshalJSON() ([]byt return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest: Partner -// request for entitling the previously provisioned subscription to an end -// user. The end user identity is inferred from the request OAuth context. +// GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest: +// LINT.IfChange Partner request for entitling the previously provisioned +// subscription to an end user. The end user identity is inferred from the +// request OAuth context. type GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest struct { // LineItemEntitlementDetails: Optional. The line items to be entitled. If // unspecified, all line items will be entitled. @@ -1556,7 +1559,8 @@ type PartnersProductsListCall struct { } // List: To retrieve the products that can be resold by the partner. It should -// be autenticated with a service account. +// be autenticated with a service account. - This API doesn't apply to YouTube +// products currently. // // - parent: The parent, the partner that can resell. Format: // partners/{partner}. @@ -1847,8 +1851,9 @@ type PartnersPromotionsListCall struct { header_ http.Header } -// List: To retrieve the promotions, such as free trial, that can be used by -// the partner. It should be autenticated with a service account. +// List: Retrieves the promotions, such as free trial, that can be used by the +// partner. - This API doesn't apply to YouTube promotions currently. It should +// be autenticated with a service account. // // - parent: The parent, the partner that can resell. Format: // partners/{partner}. @@ -2672,10 +2677,11 @@ type PartnersSubscriptionsUndoCancelCall struct { header_ http.Header } -// UndoCancel: Used by partners to revoke the pending cancellation of a -// subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If -// the subscription is already cancelled, the request will fail. It should be -// called directly by the partner using service accounts. +// UndoCancel: Revokes the pending cancellation of a subscription, which is +// currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is +// already cancelled, the request will fail. - **This API doesn't apply to +// YouTube subscriptions.** It should be called directly by the partner using +// service accounts. // // - name: The name of the subscription resource whose pending cancellation // needs to be undone. It will have the format of diff --git a/policysimulator/v1/policysimulator-api.json b/policysimulator/v1/policysimulator-api.json index 39c5dd799e3..28b676548e0 100644 --- a/policysimulator/v1/policysimulator-api.json +++ b/policysimulator/v1/policysimulator-api.json @@ -390,102 +390,6 @@ "locations": { "resources": { "orgPolicyViolationsPreviews": { - "methods": { - "create": { - "description": "CreateOrgPolicyViolationsPreview creates an OrgPolicyViolationsPreview for the proposed changes in the provided OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are inferred from these specified changes.", - "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/orgPolicyViolationsPreviews", - "httpMethod": "POST", - "id": "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create", - "parameterOrder": [ - "parent" - ], - "parameters": { - "orgPolicyViolationsPreviewId": { - "description": "Optional. An optional user-specified ID for the OrgPolicyViolationsPreview. If not provided, a random ID will be generated.", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. The organization under which this OrgPolicyViolationsPreview will be created. Example: `organizations/my-example-org/locations/global`", - "location": "path", - "pattern": "^organizations/[^/]+/locations/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/orgPolicyViolationsPreviews", - "request": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview" - }, - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "get": { - "description": "GetOrgPolicyViolationsPreview gets the specified OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for at least 7 days.", - "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreviewsId}", - "httpMethod": "GET", - "id": "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The name of the OrgPolicyViolationsPreview to get.", - "location": "path", - "pattern": "^organizations/[^/]+/locations/[^/]+/orgPolicyViolationsPreviews/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}", - "response": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "description": "ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview in an organization. Each OrgPolicyViolationsPreview is available for at least 7 days.", - "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/orgPolicyViolationsPreviews", - "httpMethod": "GET", - "id": "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list", - "parameterOrder": [ - "parent" - ], - "parameters": { - "pageSize": { - "description": "Optional. The maximum number of items to return. The service may return fewer than this value. If unspecified, at most 5 items will be returned. The maximum value is 10; values above 10 will be coerced to 10.", - "format": "int32", - "location": "query", - "type": "integer" - }, - "pageToken": { - "description": "Optional. A page token, received from a previous call. Provide this to retrieve the subsequent page. When paginating, all other parameters must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. The parent the violations are scoped to. Format: `organizations/{organization}/locations/{location}` Example: `organizations/my-example-org/locations/global`", - "location": "path", - "pattern": "^organizations/[^/]+/locations/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/orgPolicyViolationsPreviews", - "response": { - "$ref": "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - }, "resources": { "operations": { "methods": { @@ -515,46 +419,6 @@ ] } } - }, - "orgPolicyViolations": { - "methods": { - "list": { - "description": "ListOrgPolicyViolations lists the OrgPolicyViolations that are present in an OrgPolicyViolationsPreview.", - "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreviewsId}/orgPolicyViolations", - "httpMethod": "GET", - "id": "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list", - "parameterOrder": [ - "parent" - ], - "parameters": { - "pageSize": { - "description": "Optional. The maximum number of items to return. The service may return fewer than this value. If unspecified, at most 50 items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", - "format": "int32", - "location": "query", - "type": "integer" - }, - "pageToken": { - "description": "Optional. A page token, received from a previous call. Provide this to retrieve the subsequent page. When paginating, all other parameters must match the call that provided the page token.", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. The OrgPolicyViolationsPreview to get OrgPolicyViolations from. Format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview}", - "location": "path", - "pattern": "^organizations/[^/]+/locations/[^/]+/orgPolicyViolationsPreviews/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+parent}/orgPolicyViolations", - "response": { - "$ref": "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } } } }, @@ -942,7 +806,7 @@ } } }, - "revision": "20240505", + "revision": "20240617", "rootUrl": "https://policysimulator.googleapis.com/", "schemas": { "GoogleCloudOrgpolicyV2AlternatePolicySpec": { @@ -1413,42 +1277,6 @@ }, "type": "object" }, - "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse": { - "description": "ListOrgPolicyViolationsPreviewsResponse is the response message for OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews.", - "id": "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse", - "properties": { - "nextPageToken": { - "description": "A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages.", - "type": "string" - }, - "orgPolicyViolationsPreviews": { - "description": "The list of OrgPolicyViolationsPreview", - "items": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview" - }, - "type": "array" - } - }, - "type": "object" - }, - "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse": { - "description": "ListOrgPolicyViolationsResponse is the response message for OrgPolicyViolationsPreviewService.ListOrgPolicyViolations", - "id": "GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse", - "properties": { - "nextPageToken": { - "description": "A token that you can use to retrieve the next page of results. If this field is omitted, there are no subsequent pages.", - "type": "string" - }, - "orgPolicyViolations": { - "description": "The list of OrgPolicyViolations", - "items": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyViolation" - }, - "type": "array" - } - }, - "type": "object" - }, "GoogleCloudPolicysimulatorV1ListReplayResultsResponse": { "description": "Response message for Simulator.ListReplayResults.", "id": "GoogleCloudPolicysimulatorV1ListReplayResultsResponse", @@ -1467,177 +1295,6 @@ }, "type": "object" }, - "GoogleCloudPolicysimulatorV1OrgPolicyOverlay": { - "description": "The proposed changes to OrgPolicy.", - "id": "GoogleCloudPolicysimulatorV1OrgPolicyOverlay", - "properties": { - "customConstraints": { - "description": "Optional. The OrgPolicy CustomConstraint changes to preview violations for. Any existing CustomConstraints with the same name will be overridden in the simulation. That is, violations will be determined as if all custom constraints in the overlay were instantiated. Only a single custom_constraint is supported in the overlay at a time. For evaluating multiple constraints, multiple `GenerateOrgPolicyViolationsPreview` requests are made, where each request evaluates a single constraint.", - "items": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay" - }, - "type": "array" - }, - "policies": { - "description": "Optional. The OrgPolicy changes to preview violations for. Any existing OrgPolicies with the same name will be overridden in the simulation. That is, violations will be determined as if all policies in the overlay were created or updated.", - "items": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay" - }, - "type": "array" - } - }, - "type": "object" - }, - "GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay": { - "description": "A change to an OrgPolicy custom constraint.", - "id": "GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay", - "properties": { - "customConstraint": { - "$ref": "GoogleCloudOrgpolicyV2CustomConstraint", - "description": "Optional. The new or updated custom constraint." - }, - "customConstraintParent": { - "description": "Optional. Resource the constraint is attached to. Example: \"organization/987654\"", - "type": "string" - } - }, - "type": "object" - }, - "GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay": { - "description": "A change to an OrgPolicy.", - "id": "GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay", - "properties": { - "policy": { - "$ref": "GoogleCloudOrgpolicyV2Policy", - "description": "Optional. The new or updated OrgPolicy." - }, - "policyParent": { - "description": "Optional. The parent of the policy we are attaching to. Example: \"projects/123456\"", - "type": "string" - } - }, - "type": "object" - }, - "GoogleCloudPolicysimulatorV1OrgPolicyViolation": { - "description": "OrgPolicyViolation is a resource representing a single resource violating a single OrgPolicy constraint.", - "id": "GoogleCloudPolicysimulatorV1OrgPolicyViolation", - "properties": { - "customConstraint": { - "$ref": "GoogleCloudOrgpolicyV2CustomConstraint", - "description": "The custom constraint being violated." - }, - "error": { - "$ref": "GoogleRpcStatus", - "description": "Any error encountered during the evaluation." - }, - "name": { - "description": "The name of the `OrgPolicyViolation`. Example: organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f/orgPolicyViolations/38ce`", - "type": "string" - }, - "resource": { - "$ref": "GoogleCloudPolicysimulatorV1ResourceContext", - "description": "The resource violating the constraint." - } - }, - "type": "object" - }, - "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview": { - "description": "OrgPolicyViolationsPreview is a resource providing a preview of the violations that will exist if an OrgPolicy change is made. The list of violations are modeled as child resources and retrieved via a ListOrgPolicyViolations API call. There are potentially more OrgPolicyViolations than could fit in an embedded field. Thus, the use of a child resource instead of a field.", - "id": "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview", - "properties": { - "createTime": { - "description": "Output only. Time when this `OrgPolicyViolationsPreview` was created.", - "format": "google-datetime", - "readOnly": true, - "type": "string" - }, - "customConstraints": { - "description": "Output only. The names of the constraints against which all `OrgPolicyViolations` were evaluated. If `OrgPolicyOverlay` only contains `PolicyOverlay` then it contains the name of the configured custom constraint, applicable to the specified policies. Otherwise it contains the name of the constraint specified in `CustomConstraintOverlay`. Format: `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`", - "items": { - "type": "string" - }, - "readOnly": true, - "type": "array" - }, - "name": { - "description": "Output only. The resource name of the `OrgPolicyViolationsPreview`. It has the following format: `organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview}` Example: `organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506a5f7f`", - "readOnly": true, - "type": "string" - }, - "overlay": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyOverlay", - "description": "Required. The proposed changes we are previewing violations for." - }, - "resourceCounts": { - "$ref": "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts", - "description": "Output only. A summary of the state of all resources scanned for compliance with the changed OrgPolicy.", - "readOnly": true - }, - "state": { - "description": "Output only. The state of the `OrgPolicyViolationsPreview`.", - "enum": [ - "PREVIEW_STATE_UNSPECIFIED", - "PREVIEW_PENDING", - "PREVIEW_RUNNING", - "PREVIEW_SUCCEEDED", - "PREVIEW_FAILED" - ], - "enumDescriptions": [ - "The state is unspecified.", - "The OrgPolicyViolationsPreview has not been created yet.", - "The OrgPolicyViolationsPreview is currently being created.", - "The OrgPolicyViolationsPreview creation finished successfully.", - "The OrgPolicyViolationsPreview creation failed with an error." - ], - "readOnly": true, - "type": "string" - }, - "violationsCount": { - "description": "Output only. The number of OrgPolicyViolations in this `OrgPolicyViolationsPreview`. This count may differ from `resource_summary.noncompliant_count` because each OrgPolicyViolation is specific to a resource **and** constraint. If there are multiple constraints being evaluated (i.e. multiple policies in the overlay), a single resource may violate multiple constraints.", - "format": "int32", - "readOnly": true, - "type": "integer" - } - }, - "type": "object" - }, - "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts": { - "description": "A summary of the state of all resources scanned for compliance with the changed OrgPolicy.", - "id": "GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts", - "properties": { - "compliant": { - "description": "Output only. Number of scanned resources with zero violations.", - "format": "int32", - "readOnly": true, - "type": "integer" - }, - "errors": { - "description": "Output only. Number of resources that returned an error when scanned.", - "format": "int32", - "readOnly": true, - "type": "integer" - }, - "noncompliant": { - "description": "Output only. Number of scanned resources with at least one violation.", - "format": "int32", - "readOnly": true, - "type": "integer" - }, - "scanned": { - "description": "Output only. Number of resources checked for compliance. Must equal: unenforced + noncompliant + compliant + error", - "format": "int32", - "readOnly": true, - "type": "integer" - }, - "unenforced": { - "description": "Output only. Number of resources where the constraint was not enforced, i.e. the Policy set `enforced: false` for that resource.", - "format": "int32", - "readOnly": true, - "type": "integer" - } - }, - "type": "object" - }, "GoogleCloudPolicysimulatorV1Replay": { "description": "A resource describing a `Replay`, or simulation.", "id": "GoogleCloudPolicysimulatorV1Replay", @@ -1793,28 +1450,6 @@ }, "type": "object" }, - "GoogleCloudPolicysimulatorV1ResourceContext": { - "description": "ResourceContext provides the context we know about a resource. It is similar in concept to google.cloud.asset.v1.Resource, but focuses on the information specifically used by Simulator.", - "id": "GoogleCloudPolicysimulatorV1ResourceContext", - "properties": { - "ancestors": { - "description": "The ancestry path of the resource in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and ends at root. If the resource is a project, folder, or organization, the ancestry path starts from the resource itself. Example: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]`", - "items": { - "type": "string" - }, - "type": "array" - }, - "assetType": { - "description": "The asset type of the resource as defined by CAIS. Example: `compute.googleapis.com/Firewall` See [Supported asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information.", - "type": "string" - }, - "resource": { - "description": "The full name of the resource. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information.", - "type": "string" - } - }, - "type": "object" - }, "GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMetadata": { "description": "CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about an OrgPolicyViolationsPreview generations operation.", "id": "GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMetadata", diff --git a/policysimulator/v1/policysimulator-gen.go b/policysimulator/v1/policysimulator-gen.go index ec3ef3f4740..1fc125166be 100644 --- a/policysimulator/v1/policysimulator-gen.go +++ b/policysimulator/v1/policysimulator-gen.go @@ -283,7 +283,6 @@ type OrganizationsLocationsService struct { func NewOrganizationsLocationsOrgPolicyViolationsPreviewsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsService { rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsService{s: s} rs.Operations = NewOrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService(s) - rs.OrgPolicyViolations = NewOrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService(s) return rs } @@ -291,8 +290,6 @@ type OrganizationsLocationsOrgPolicyViolationsPreviewsService struct { s *Service Operations *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService - - OrgPolicyViolations *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService } func NewOrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService { @@ -304,15 +301,6 @@ type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService struct { s *Service } -func NewOrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService { - rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService{s: s} - return rs -} - -type OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService struct { - s *Service -} - func NewOrganizationsLocationsReplaysService(s *Service) *OrganizationsLocationsReplaysService { rs := &OrganizationsLocationsReplaysService{s: s} rs.Operations = NewOrganizationsLocationsReplaysOperationsService(s) @@ -1043,66 +1031,6 @@ func (s *GoogleCloudPolicysimulatorV1ExplainedPolicy) MarshalJSON() ([]byte, err return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse: -// ListOrgPolicyViolationsPreviewsResponse is the response message for -// OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews. -type GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse struct { - // NextPageToken: A token that you can use to retrieve the next page of - // results. If this field is omitted, there are no subsequent pages. - NextPageToken string `json:"nextPageToken,omitempty"` - // OrgPolicyViolationsPreviews: The list of OrgPolicyViolationsPreview - OrgPolicyViolationsPreviews []*GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview `json:"orgPolicyViolationsPreviews,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the server. - googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse: -// ListOrgPolicyViolationsResponse is the response message for -// OrgPolicyViolationsPreviewService.ListOrgPolicyViolations -type GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse struct { - // NextPageToken: A token that you can use to retrieve the next page of - // results. If this field is omitted, there are no subsequent pages. - NextPageToken string `json:"nextPageToken,omitempty"` - // OrgPolicyViolations: The list of OrgPolicyViolations - OrgPolicyViolations []*GoogleCloudPolicysimulatorV1OrgPolicyViolation `json:"orgPolicyViolations,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the server. - googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudPolicysimulatorV1ListReplayResultsResponse: Response message for // Simulator.ListReplayResults. type GoogleCloudPolicysimulatorV1ListReplayResultsResponse struct { @@ -1133,232 +1061,6 @@ func (s *GoogleCloudPolicysimulatorV1ListReplayResultsResponse) MarshalJSON() ([ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudPolicysimulatorV1OrgPolicyOverlay: The proposed changes to -// OrgPolicy. -type GoogleCloudPolicysimulatorV1OrgPolicyOverlay struct { - // CustomConstraints: Optional. The OrgPolicy CustomConstraint changes to - // preview violations for. Any existing CustomConstraints with the same name - // will be overridden in the simulation. That is, violations will be determined - // as if all custom constraints in the overlay were instantiated. Only a single - // custom_constraint is supported in the overlay at a time. For evaluating - // multiple constraints, multiple `GenerateOrgPolicyViolationsPreview` requests - // are made, where each request evaluates a single constraint. - CustomConstraints []*GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay `json:"customConstraints,omitempty"` - // Policies: Optional. The OrgPolicy changes to preview violations for. Any - // existing OrgPolicies with the same name will be overridden in the - // simulation. That is, violations will be determined as if all policies in the - // overlay were created or updated. - Policies []*GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay `json:"policies,omitempty"` - // ForceSendFields is a list of field names (e.g. "CustomConstraints") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CustomConstraints") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1OrgPolicyOverlay) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyOverlay - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay: A -// change to an OrgPolicy custom constraint. -type GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay struct { - // CustomConstraint: Optional. The new or updated custom constraint. - CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"` - // CustomConstraintParent: Optional. Resource the constraint is attached to. - // Example: "organization/987654" - CustomConstraintParent string `json:"customConstraintParent,omitempty"` - // ForceSendFields is a list of field names (e.g. "CustomConstraint") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CustomConstraint") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay: A change to an -// OrgPolicy. -type GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay struct { - // Policy: Optional. The new or updated OrgPolicy. - Policy *GoogleCloudOrgpolicyV2Policy `json:"policy,omitempty"` - // PolicyParent: Optional. The parent of the policy we are attaching to. - // Example: "projects/123456" - PolicyParent string `json:"policyParent,omitempty"` - // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Policy") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudPolicysimulatorV1OrgPolicyViolation: OrgPolicyViolation is a -// resource representing a single resource violating a single OrgPolicy -// constraint. -type GoogleCloudPolicysimulatorV1OrgPolicyViolation struct { - // CustomConstraint: The custom constraint being violated. - CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"` - // Error: Any error encountered during the evaluation. - Error *GoogleRpcStatus `json:"error,omitempty"` - // Name: The name of the `OrgPolicyViolation`. Example: - // organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506 - // a5f7f/orgPolicyViolations/38ce` - Name string `json:"name,omitempty"` - // Resource: The resource violating the constraint. - Resource *GoogleCloudPolicysimulatorV1ResourceContext `json:"resource,omitempty"` - // ForceSendFields is a list of field names (e.g. "CustomConstraint") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CustomConstraint") to include in - // API requests with the JSON null value. By default, fields with empty values - // are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1OrgPolicyViolation) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyViolation - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview: -// OrgPolicyViolationsPreview is a resource providing a preview of the -// violations that will exist if an OrgPolicy change is made. The list of -// violations are modeled as child resources and retrieved via a -// ListOrgPolicyViolations API call. There are potentially more -// OrgPolicyViolations than could fit in an embedded field. Thus, the use of a -// child resource instead of a field. -type GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview struct { - // CreateTime: Output only. Time when this `OrgPolicyViolationsPreview` was - // created. - CreateTime string `json:"createTime,omitempty"` - // CustomConstraints: Output only. The names of the constraints against which - // all `OrgPolicyViolations` were evaluated. If `OrgPolicyOverlay` only - // contains `PolicyOverlay` then it contains the name of the configured custom - // constraint, applicable to the specified policies. Otherwise it contains the - // name of the constraint specified in `CustomConstraintOverlay`. Format: - // `organizations/{organization_id}/customConstraints/{custom_constraint_id}` - // Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` - CustomConstraints []string `json:"customConstraints,omitempty"` - // Name: Output only. The resource name of the `OrgPolicyViolationsPreview`. It - // has the following format: - // `organizations/{organization}/locations/{location}/orgPolicyViolationsPreview - // s/{orgPolicyViolationsPreview}` Example: - // `organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/50 - // 6a5f7f` - Name string `json:"name,omitempty"` - // Overlay: Required. The proposed changes we are previewing violations for. - Overlay *GoogleCloudPolicysimulatorV1OrgPolicyOverlay `json:"overlay,omitempty"` - // ResourceCounts: Output only. A summary of the state of all resources scanned - // for compliance with the changed OrgPolicy. - ResourceCounts *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts `json:"resourceCounts,omitempty"` - // State: Output only. The state of the `OrgPolicyViolationsPreview`. - // - // Possible values: - // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified. - // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created - // yet. - // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being - // created. - // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished - // successfully. - // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an - // error. - State string `json:"state,omitempty"` - // ViolationsCount: Output only. The number of OrgPolicyViolations in this - // `OrgPolicyViolationsPreview`. This count may differ from - // `resource_summary.noncompliant_count` because each OrgPolicyViolation is - // specific to a resource **and** constraint. If there are multiple constraints - // being evaluated (i.e. multiple policies in the overlay), a single resource - // may violate multiple constraints. - ViolationsCount int64 `json:"violationsCount,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the server. - googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - -// GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts: A -// summary of the state of all resources scanned for compliance with the -// changed OrgPolicy. -type GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts struct { - // Compliant: Output only. Number of scanned resources with zero violations. - Compliant int64 `json:"compliant,omitempty"` - // Errors: Output only. Number of resources that returned an error when - // scanned. - Errors int64 `json:"errors,omitempty"` - // Noncompliant: Output only. Number of scanned resources with at least one - // violation. - Noncompliant int64 `json:"noncompliant,omitempty"` - // Scanned: Output only. Number of resources checked for compliance. Must - // equal: unenforced + noncompliant + compliant + error - Scanned int64 `json:"scanned,omitempty"` - // Unenforced: Output only. Number of resources where the constraint was not - // enforced, i.e. the Policy set `enforced: false` for that resource. - Unenforced int64 `json:"unenforced,omitempty"` - // ForceSendFields is a list of field names (e.g. "Compliant") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Compliant") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudPolicysimulatorV1Replay: A resource describing a `Replay`, or // simulation. type GoogleCloudPolicysimulatorV1Replay struct { @@ -1576,49 +1278,6 @@ func (s *GoogleCloudPolicysimulatorV1ReplayResultsSummary) MarshalJSON() ([]byte return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// GoogleCloudPolicysimulatorV1ResourceContext: ResourceContext provides the -// context we know about a resource. It is similar in concept to -// google.cloud.asset.v1.Resource, but focuses on the information specifically -// used by Simulator. -type GoogleCloudPolicysimulatorV1ResourceContext struct { - // Ancestors: The ancestry path of the resource in Google Cloud resource - // hierarchy - // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), - // represented as a list of relative resource names. An ancestry path starts - // with the closest ancestor in the hierarchy and ends at root. If the resource - // is a project, folder, or organization, the ancestry path starts from the - // resource itself. Example: `["projects/123456789", "folders/5432", - // "organizations/1234"]` - Ancestors []string `json:"ancestors,omitempty"` - // AssetType: The asset type of the resource as defined by CAIS. Example: - // `compute.googleapis.com/Firewall` See Supported asset types - // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) for - // more information. - AssetType string `json:"assetType,omitempty"` - // Resource: The full name of the resource. Example: - // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/insta - // nce1` See Resource names - // (https://cloud.google.com/apis/design/resource_names#full_resource_name) for - // more information. - Resource string `json:"resource,omitempty"` - // ForceSendFields is a list of field names (e.g. "Ancestors") to - // unconditionally include in API requests. By default, fields with empty or - // default values are omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more - // details. - ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Ancestors") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See - // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudPolicysimulatorV1ResourceContext) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudPolicysimulatorV1ResourceContext - return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) -} - // GoogleCloudPolicysimulatorV1alphaCreateOrgPolicyViolationsPreviewOperationMet // adata: CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about // an OrgPolicyViolationsPreview generations operation. @@ -3648,384 +3307,6 @@ func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunnin } } -type OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall struct { - s *Service - parent string - googlecloudpolicysimulatorv1orgpolicyviolationspreview *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Create: CreateOrgPolicyViolationsPreview creates an -// OrgPolicyViolationsPreview for the proposed changes in the provided -// OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are -// specified by this `OrgPolicyOverlay`. The resources to scan are inferred -// from these specified changes. -// -// - parent: The organization under which this OrgPolicyViolationsPreview will -// be created. Example: `organizations/my-example-org/locations/global`. -func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Create(parent string, googlecloudpolicysimulatorv1orgpolicyviolationspreview *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall { - c := &OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudpolicysimulatorv1orgpolicyviolationspreview = googlecloudpolicysimulatorv1orgpolicyviolationspreview - return c -} - -// OrgPolicyViolationsPreviewId sets the optional parameter -// "orgPolicyViolationsPreviewId": An optional user-specified ID for the -// OrgPolicyViolationsPreview. If not provided, a random ID will be generated. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) OrgPolicyViolationsPreviewId(orgPolicyViolationsPreviewId string) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall { - c.urlParams_.Set("orgPolicyViolationsPreviewId", orgPolicyViolationsPreviewId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudpolicysimulatorv1orgpolicyviolationspreview) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/orgPolicyViolationsPreviews") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create" call. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleLongrunningOperation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Get: GetOrgPolicyViolationsPreview gets the specified -// OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for -// at least 7 days. -// -// - name: The name of the OrgPolicyViolationsPreview to get. -func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Get(name string) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall { - c := &OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get" call. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.ServerResponse.Header -// -// or (if a response was returned at all) in error.(*googleapi.Error).Header. -// -// Use googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type OrganizationsLocationsOrgPolicyViolationsPreviewsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview -// in an organization. Each OrgPolicyViolationsPreview is available for at -// least 7 days. -// -// - parent: The parent the violations are scoped to. Format: -// `organizations/{organization}/locations/{location}` Example: -// `organizations/my-example-org/locations/global`. -func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) List(parent string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall { - c := &OrganizationsLocationsOrgPolicyViolationsPreviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number of items -// to return. The service may return fewer than this value. If unspecified, at -// most 5 items will be returned. The maximum value is 10; values above 10 will -// be coerced to 10. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) PageSize(pageSize int64) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, received -// from a previous call. Provide this to retrieve the subsequent page. When -// paginating, all other parameters must match the call that provided the page -// token. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) PageToken(pageToken string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/orgPolicyViolationsPreviews") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse.ServerRe -// sponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct { s *Service name string @@ -4136,157 +3417,6 @@ func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do( return ret, nil } -type OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: ListOrgPolicyViolations lists the OrgPolicyViolations that are present -// in an OrgPolicyViolationsPreview. -// -// - parent: The OrgPolicyViolationsPreview to get OrgPolicyViolations from. -// Format: -// organizations/{organization}/locations/{location}/orgPolicyViolationsPrevie -// ws/{orgPolicyViolationsPreview}. -func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService) List(parent string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall { - c := &OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number of items -// to return. The service may return fewer than this value. If unspecified, at -// most 50 items will be returned. The maximum value is 1000; values above 1000 -// will be coerced to 1000. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, received -// from a previous call. Provide this to retrieve the subsequent page. When -// paginating, all other parameters must match the call that provided the page -// token. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) PageToken(pageToken string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/orgPolicyViolations") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse.ServerResponse.H -// eader or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - type OrganizationsLocationsReplaysCreateCall struct { s *Service parent string diff --git a/sqladmin/v1/sqladmin-api.json b/sqladmin/v1/sqladmin-api.json index 61b3d97f641..de08e553b7b 100644 --- a/sqladmin/v1/sqladmin-api.json +++ b/sqladmin/v1/sqladmin-api.json @@ -2267,7 +2267,7 @@ } } }, - "revision": "20240529", + "revision": "20240613", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -5376,6 +5376,10 @@ ], "type": "string" }, + "enableDataplexIntegration": { + "description": "Optional. By default, Cloud SQL instances have schema extraction disabled for Dataplex. When this parameter is set to true, schema extraction for Dataplex on Cloud SQL instances is activated.", + "type": "boolean" + }, "enableGoogleMlIntegration": { "description": "Optional. When this parameter is set to true, Cloud SQL instances can connect to Vertex AI to pass requests for real-time predictions and insights to the AI. The default value is false. This applies only to Cloud SQL for PostgreSQL instances.", "type": "boolean" @@ -5546,7 +5550,8 @@ "INSUFFICIENT_MACHINE_TIER", "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED", "EXTENSIONS_NOT_MIGRATED", - "PG_CRON_FLAG_ENABLED_IN_REPLICA" + "PG_CRON_FLAG_ENABLED_IN_REPLICA", + "EXTENSIONS_NOT_ENABLED_IN_REPLICA" ], "enumDescriptions": [ "", @@ -5596,7 +5601,8 @@ "The data size of the source instance is greater than 1 TB, the number of cores of the replica instance is less than 8, and the memory of the replica is less than 32 GB.", "The warning message indicates the unsupported extensions will not be migrated to the destination.", "The warning message indicates the pg_cron extension and settings will not be migrated to the destination.", - "The error message indicates that pg_cron flags are enabled on the destination which is not supported during the migration." + "The error message indicates that pg_cron flags are enabled on the destination which is not supported during the migration.", + "This error message indicates that the specified extensions are not enabled on destination instance. For example, before you can migrate data to the destination instance, you must enable the PGAudit extension on the instance." ], "type": "string" } diff --git a/sqladmin/v1/sqladmin-gen.go b/sqladmin/v1/sqladmin-gen.go index d6b3211fc8e..f9c823fd93a 100644 --- a/sqladmin/v1/sqladmin-gen.go +++ b/sqladmin/v1/sqladmin-gen.go @@ -3571,6 +3571,10 @@ type Settings struct { // "ENTERPRISE" - The instance is an enterprise edition. // "ENTERPRISE_PLUS" - The instance is an Enterprise Plus edition. Edition string `json:"edition,omitempty"` + // EnableDataplexIntegration: Optional. By default, Cloud SQL instances have + // schema extraction disabled for Dataplex. When this parameter is set to true, + // schema extraction for Dataplex on Cloud SQL instances is activated. + EnableDataplexIntegration bool `json:"enableDataplexIntegration,omitempty"` // EnableGoogleMlIntegration: Optional. When this parameter is set to true, // Cloud SQL instances can connect to Vertex AI to pass requests for real-time // predictions and insights to the AI. The default value is false. This applies @@ -3790,6 +3794,10 @@ type SqlExternalSyncSettingError struct { // "PG_CRON_FLAG_ENABLED_IN_REPLICA" - The error message indicates that // pg_cron flags are enabled on the destination which is not supported during // the migration. + // "EXTENSIONS_NOT_ENABLED_IN_REPLICA" - This error message indicates that + // the specified extensions are not enabled on destination instance. For + // example, before you can migrate data to the destination instance, you must + // enable the PGAudit extension on the instance. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Detail") to unconditionally // include in API requests. By default, fields with empty or default values are diff --git a/sqladmin/v1beta4/sqladmin-api.json b/sqladmin/v1beta4/sqladmin-api.json index 72c96abfa96..b26443bc36c 100644 --- a/sqladmin/v1beta4/sqladmin-api.json +++ b/sqladmin/v1beta4/sqladmin-api.json @@ -2267,7 +2267,7 @@ } } }, - "revision": "20240529", + "revision": "20240613", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -5381,6 +5381,10 @@ ], "type": "string" }, + "enableDataplexIntegration": { + "description": "Optional. By default, Cloud SQL instances have schema extraction disabled for Dataplex. When this parameter is set to true, schema extraction for Dataplex on Cloud SQL instances is activated.", + "type": "boolean" + }, "enableGoogleMlIntegration": { "description": "Optional. When this parameter is set to true, Cloud SQL instances can connect to Vertex AI to pass requests for real-time predictions and insights to the AI. The default value is false. This applies only to Cloud SQL for PostgreSQL instances.", "type": "boolean" @@ -5551,7 +5555,8 @@ "INSUFFICIENT_MACHINE_TIER", "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED", "EXTENSIONS_NOT_MIGRATED", - "PG_CRON_FLAG_ENABLED_IN_REPLICA" + "PG_CRON_FLAG_ENABLED_IN_REPLICA", + "EXTENSIONS_NOT_ENABLED_IN_REPLICA" ], "enumDescriptions": [ "", @@ -5601,7 +5606,8 @@ "The data size of the source instance is greater than 1 TB, the number of cores of the replica instance is less than 8, and the memory of the replica is less than 32 GB.", "The warning message indicates the unsupported extensions will not be migrated to the destination.", "The warning message indicates the pg_cron extension and settings will not be migrated to the destination.", - "The error message indicates that pg_cron flags are enabled on the destination which is not supported during the migration." + "The error message indicates that pg_cron flags are enabled on the destination which is not supported during the migration.", + "This error message indicates that the specified extensions are not enabled on destination instance. For example, before you can migrate data to the destination instance, you must enable the PGAudit extension on the instance." ], "type": "string" } diff --git a/sqladmin/v1beta4/sqladmin-gen.go b/sqladmin/v1beta4/sqladmin-gen.go index 901f43fbe11..a8a3f9497c7 100644 --- a/sqladmin/v1beta4/sqladmin-gen.go +++ b/sqladmin/v1beta4/sqladmin-gen.go @@ -3581,6 +3581,10 @@ type Settings struct { // "ENTERPRISE" - The instance is an enterprise edition. // "ENTERPRISE_PLUS" - The instance is an Enterprise Plus edition. Edition string `json:"edition,omitempty"` + // EnableDataplexIntegration: Optional. By default, Cloud SQL instances have + // schema extraction disabled for Dataplex. When this parameter is set to true, + // schema extraction for Dataplex on Cloud SQL instances is activated. + EnableDataplexIntegration bool `json:"enableDataplexIntegration,omitempty"` // EnableGoogleMlIntegration: Optional. When this parameter is set to true, // Cloud SQL instances can connect to Vertex AI to pass requests for real-time // predictions and insights to the AI. The default value is false. This applies @@ -3800,6 +3804,10 @@ type SqlExternalSyncSettingError struct { // "PG_CRON_FLAG_ENABLED_IN_REPLICA" - The error message indicates that // pg_cron flags are enabled on the destination which is not supported during // the migration. + // "EXTENSIONS_NOT_ENABLED_IN_REPLICA" - This error message indicates that + // the specified extensions are not enabled on destination instance. For + // example, before you can migrate data to the destination instance, you must + // enable the PGAudit extension on the instance. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Detail") to unconditionally // include in API requests. By default, fields with empty or default values are diff --git a/walletobjects/v1/walletobjects-api.json b/walletobjects/v1/walletobjects-api.json index 3273b10b5d6..a889647771f 100644 --- a/walletobjects/v1/walletobjects-api.json +++ b/walletobjects/v1/walletobjects-api.json @@ -2681,7 +2681,7 @@ } } }, - "revision": "20240612", + "revision": "20240618", "rootUrl": "https://walletobjects.googleapis.com/", "schemas": { "ActivationOptions": { @@ -7821,72 +7821,98 @@ "id": "Resources", "properties": { "eventTicketClasses": { + "description": "A list of event ticket classes.", "items": { "$ref": "EventTicketClass" }, "type": "array" }, "eventTicketObjects": { + "description": "A list of event ticket objects.", "items": { "$ref": "EventTicketObject" }, "type": "array" }, "flightClasses": { + "description": "A list of flight classes.", "items": { "$ref": "FlightClass" }, "type": "array" }, "flightObjects": { + "description": "A list of flight objects.", "items": { "$ref": "FlightObject" }, "type": "array" }, + "genericClasses": { + "description": "A list of generic classes.", + "items": { + "$ref": "GenericClass" + }, + "type": "array" + }, + "genericObjects": { + "description": "A list of generic objects.", + "items": { + "$ref": "GenericObject" + }, + "type": "array" + }, "giftCardClasses": { + "description": "A list of gift card classes.", "items": { "$ref": "GiftCardClass" }, "type": "array" }, "giftCardObjects": { + "description": "A list of gift card objects.", "items": { "$ref": "GiftCardObject" }, "type": "array" }, "loyaltyClasses": { + "description": "A list of loyalty classes.", "items": { "$ref": "LoyaltyClass" }, "type": "array" }, "loyaltyObjects": { + "description": "A list of loyalty objects.", "items": { "$ref": "LoyaltyObject" }, "type": "array" }, "offerClasses": { + "description": "A list of offer classes.", "items": { "$ref": "OfferClass" }, "type": "array" }, "offerObjects": { + "description": "A list of offer objects.", "items": { "$ref": "OfferObject" }, "type": "array" }, "transitClasses": { + "description": "A list of transit classes.", "items": { "$ref": "TransitClass" }, "type": "array" }, "transitObjects": { + "description": "A list of transit objects.", "items": { "$ref": "TransitObject" }, diff --git a/walletobjects/v1/walletobjects-gen.go b/walletobjects/v1/walletobjects-gen.go index 132834a28a1..bf4786fc1a2 100644 --- a/walletobjects/v1/walletobjects-gen.go +++ b/walletobjects/v1/walletobjects-gen.go @@ -5873,18 +5873,34 @@ func (s *ReservationInfo) MarshalJSON() ([]byte, error) { } type Resources struct { - EventTicketClasses []*EventTicketClass `json:"eventTicketClasses,omitempty"` + // EventTicketClasses: A list of event ticket classes. + EventTicketClasses []*EventTicketClass `json:"eventTicketClasses,omitempty"` + // EventTicketObjects: A list of event ticket objects. EventTicketObjects []*EventTicketObject `json:"eventTicketObjects,omitempty"` - FlightClasses []*FlightClass `json:"flightClasses,omitempty"` - FlightObjects []*FlightObject `json:"flightObjects,omitempty"` - GiftCardClasses []*GiftCardClass `json:"giftCardClasses,omitempty"` - GiftCardObjects []*GiftCardObject `json:"giftCardObjects,omitempty"` - LoyaltyClasses []*LoyaltyClass `json:"loyaltyClasses,omitempty"` - LoyaltyObjects []*LoyaltyObject `json:"loyaltyObjects,omitempty"` - OfferClasses []*OfferClass `json:"offerClasses,omitempty"` - OfferObjects []*OfferObject `json:"offerObjects,omitempty"` - TransitClasses []*TransitClass `json:"transitClasses,omitempty"` - TransitObjects []*TransitObject `json:"transitObjects,omitempty"` + // FlightClasses: A list of flight classes. + FlightClasses []*FlightClass `json:"flightClasses,omitempty"` + // FlightObjects: A list of flight objects. + FlightObjects []*FlightObject `json:"flightObjects,omitempty"` + // GenericClasses: A list of generic classes. + GenericClasses []*GenericClass `json:"genericClasses,omitempty"` + // GenericObjects: A list of generic objects. + GenericObjects []*GenericObject `json:"genericObjects,omitempty"` + // GiftCardClasses: A list of gift card classes. + GiftCardClasses []*GiftCardClass `json:"giftCardClasses,omitempty"` + // GiftCardObjects: A list of gift card objects. + GiftCardObjects []*GiftCardObject `json:"giftCardObjects,omitempty"` + // LoyaltyClasses: A list of loyalty classes. + LoyaltyClasses []*LoyaltyClass `json:"loyaltyClasses,omitempty"` + // LoyaltyObjects: A list of loyalty objects. + LoyaltyObjects []*LoyaltyObject `json:"loyaltyObjects,omitempty"` + // OfferClasses: A list of offer classes. + OfferClasses []*OfferClass `json:"offerClasses,omitempty"` + // OfferObjects: A list of offer objects. + OfferObjects []*OfferObject `json:"offerObjects,omitempty"` + // TransitClasses: A list of transit classes. + TransitClasses []*TransitClass `json:"transitClasses,omitempty"` + // TransitObjects: A list of transit objects. + TransitObjects []*TransitObject `json:"transitObjects,omitempty"` // ForceSendFields is a list of field names (e.g. "EventTicketClasses") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See diff --git a/workflows/v1/workflows-api.json b/workflows/v1/workflows-api.json index 624996227e3..d2aae5e170e 100644 --- a/workflows/v1/workflows-api.json +++ b/workflows/v1/workflows-api.json @@ -485,7 +485,7 @@ } } }, - "revision": "20240508", + "revision": "20240605", "rootUrl": "https://workflows.googleapis.com/", "schemas": { "Empty": { @@ -726,7 +726,7 @@ "id": "Workflow", "properties": { "allKmsKeys": { - "description": "Output only. A list of all KMS crypto keys used to encrypt or decrpt the data associated with the workflow.", + "description": "Output only. A list of all KMS crypto keys used to encrypt or decrypt the data associated with the workflow.", "items": { "type": "string" }, @@ -734,7 +734,7 @@ "type": "array" }, "allKmsKeysVersions": { - "description": "Output only. A list of all KMS crypto keys versions used to encrypt or decrpt the data associated with the workflow.", + "description": "Output only. A list of all KMS crypto key versions used to encrypt or decrypt the data associated with the workflow.", "items": { "type": "string" }, diff --git a/workflows/v1/workflows-gen.go b/workflows/v1/workflows-gen.go index 17a208b562d..d822c5cae7f 100644 --- a/workflows/v1/workflows-gen.go +++ b/workflows/v1/workflows-gen.go @@ -504,10 +504,10 @@ func (s *Status) MarshalJSON() ([]byte, error) { // Workflow: Workflow program to be executed by Workflows. type Workflow struct { // AllKmsKeys: Output only. A list of all KMS crypto keys used to encrypt or - // decrpt the data associated with the workflow. + // decrypt the data associated with the workflow. AllKmsKeys []string `json:"allKmsKeys,omitempty"` - // AllKmsKeysVersions: Output only. A list of all KMS crypto keys versions used - // to encrypt or decrpt the data associated with the workflow. + // AllKmsKeysVersions: Output only. A list of all KMS crypto key versions used + // to encrypt or decrypt the data associated with the workflow. AllKmsKeysVersions []string `json:"allKmsKeysVersions,omitempty"` // CallLogLevel: Optional. Describes the level of platform logging to apply to // calls and call responses during executions of this workflow. If both the