From 1aee5cd1cb55192a4675682444d9e0a22dab55a0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 2 Mar 2023 10:26:52 -0800 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#1884) --- .../v1alpha/analyticsadmin-api.json | 6 +- analyticsadmin/v1alpha/analyticsadmin-gen.go | 4 + api-list.json | 30 + connectors/v1/connectors-api.json | 6 +- connectors/v1/connectors-gen.go | 4 + datastream/v1/datastream-api.json | 6 +- datastream/v1/datastream-gen.go | 8 +- .../v1alpha/discoveryengine-api.json | 377 ++- .../v1alpha/discoveryengine-gen.go | 1818 ++++++++++++- .../v1beta/discoveryengine-api.json | 377 ++- discoveryengine/v1beta/discoveryengine-gen.go | 1817 ++++++++++++- .../v1/managedidentities-api.json | 11 +- managedidentities/v1/managedidentities-gen.go | 58 +- ml/v1/ml-api.json | 14 +- ml/v1/ml-gen.go | 2 + networkservices/v1/networkservices-api.json | 457 +++- networkservices/v1/networkservices-gen.go | 2420 +++++++++++++++++ privateca/v1/privateca-api.json | 4 +- privateca/v1/privateca-gen.go | 6 +- publicca/v1alpha1/publicca-api.json | 180 ++ publicca/v1alpha1/publicca-gen.go | 360 +++ publicca/v1beta1/publicca-api.json | 180 ++ publicca/v1beta1/publicca-gen.go | 360 +++ .../v1/serviceconsumermanagement-api.json | 6 +- .../v1/serviceconsumermanagement-gen.go | 5 + .../serviceconsumermanagement-api.json | 6 +- .../v1beta1/serviceconsumermanagement-gen.go | 5 + serviceusage/v1/serviceusage-api.json | 6 +- serviceusage/v1/serviceusage-gen.go | 5 + serviceusage/v1beta1/serviceusage-api.json | 6 +- serviceusage/v1beta1/serviceusage-gen.go | 5 + spanner/v1/spanner-api.json | 4 +- spanner/v1/spanner-gen.go | 8 +- sqladmin/v1/sqladmin-api.json | 48 +- sqladmin/v1/sqladmin-gen.go | 54 +- sqladmin/v1beta4/sqladmin-api.json | 48 +- sqladmin/v1beta4/sqladmin-gen.go | 54 +- 37 files changed, 8495 insertions(+), 270 deletions(-) create mode 100644 publicca/v1alpha1/publicca-api.json create mode 100644 publicca/v1alpha1/publicca-gen.go create mode 100644 publicca/v1beta1/publicca-api.json create mode 100644 publicca/v1beta1/publicca-gen.go diff --git a/analyticsadmin/v1alpha/analyticsadmin-api.json b/analyticsadmin/v1alpha/analyticsadmin-api.json index 881695f5e9b..9b0c52088de 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-api.json +++ b/analyticsadmin/v1alpha/analyticsadmin-api.json @@ -3801,7 +3801,7 @@ } } }, - "revision": "20230228", + "revision": "20230301", "rootUrl": "https://analyticsadmin.googleapis.com/", "schemas": { "GoogleAnalyticsAdminV1alphaAccessBetweenFilter": { @@ -5054,6 +5054,10 @@ "description": "If set true, exported data will include advertising identifiers for mobile app streams.", "type": "boolean" }, + "intradayExportEnabled": { + "description": "If set true, enables intraday export to the linked Google Cloud project.", + "type": "boolean" + }, "name": { "description": "Output only. Resource name of this BigQuery link. Format: 'properties/{property_id}/bigQueryLinks/{bigquery_link_id}' Format: 'properties/1234/bigQueryLinks/abc567'", "readOnly": true, diff --git a/analyticsadmin/v1alpha/analyticsadmin-gen.go b/analyticsadmin/v1alpha/analyticsadmin-gen.go index e9416edae0b..bdedbf684e7 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-gen.go +++ b/analyticsadmin/v1alpha/analyticsadmin-gen.go @@ -2686,6 +2686,10 @@ type GoogleAnalyticsAdminV1alphaBigQueryLink struct { // advertising identifiers for mobile app streams. IncludeAdvertisingId bool `json:"includeAdvertisingId,omitempty"` + // IntradayExportEnabled: If set true, enables intraday export to the + // linked Google Cloud project. + IntradayExportEnabled bool `json:"intradayExportEnabled,omitempty"` + // Name: Output only. Resource name of this BigQuery link. Format: // 'properties/{property_id}/bigQueryLinks/{bigquery_link_id}' Format: // 'properties/1234/bigQueryLinks/abc567' diff --git a/api-list.json b/api-list.json index 1e36e93af3a..2ecaf4f2e04 100644 --- a/api-list.json +++ b/api-list.json @@ -4507,6 +4507,36 @@ "documentationLink": "https://developers.google.com/spectrum-access-system/", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "publicca:v1alpha1", + "name": "publicca", + "version": "v1alpha1", + "title": "Public Certificate Authority API", + "description": "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority.", + "discoveryRestUrl": "https://publicca.googleapis.com/$discovery/rest?version=v1alpha1", + "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/public-certificate-authority/docs", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "publicca:v1beta1", + "name": "publicca", + "version": "v1beta1", + "title": "Public Certificate Authority API", + "description": "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority.", + "discoveryRestUrl": "https://publicca.googleapis.com/$discovery/rest?version=v1beta1", + "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/public-certificate-authority/docs", + "preferred": true + }, { "kind": "discovery#directoryItem", "id": "pubsub:v1beta1a", diff --git a/connectors/v1/connectors-api.json b/connectors/v1/connectors-api.json index fc9c28900be..d2984d08391 100644 --- a/connectors/v1/connectors-api.json +++ b/connectors/v1/connectors-api.json @@ -1079,7 +1079,7 @@ } } }, - "revision": "20230220", + "revision": "20230222", "rootUrl": "https://connectors.googleapis.com/", "schemas": { "AuditConfig": { @@ -1327,6 +1327,10 @@ }, "type": "array" }, + "isAdvanced": { + "description": "Indicates if current template is part of advanced settings", + "type": "boolean" + }, "key": { "description": "Key of the config variable.", "type": "string" diff --git a/connectors/v1/connectors-gen.go b/connectors/v1/connectors-gen.go index 63d3ece792c..adc77c6736a 100644 --- a/connectors/v1/connectors-gen.go +++ b/connectors/v1/connectors-gen.go @@ -637,6 +637,10 @@ type ConfigVariableTemplate struct { // EnumOptions: Enum options. To be populated if `ValueType` is `ENUM` EnumOptions []*EnumOption `json:"enumOptions,omitempty"` + // IsAdvanced: Indicates if current template is part of advanced + // settings + IsAdvanced bool `json:"isAdvanced,omitempty"` + // Key: Key of the config variable. Key string `json:"key,omitempty"` diff --git a/datastream/v1/datastream-api.json b/datastream/v1/datastream-api.json index 9c287a53c94..37aae474b8d 100644 --- a/datastream/v1/datastream-api.json +++ b/datastream/v1/datastream-api.json @@ -1222,7 +1222,7 @@ } } }, - "revision": "20230201", + "revision": "20230222", "rootUrl": "https://datastream.googleapis.com/", "schemas": { "AvroFileFormat": { @@ -2298,12 +2298,12 @@ "description": "Oracle objects to include in the stream." }, "maxConcurrentBackfillTasks": { - "description": "Maximum number of concurrent backfill tasks. The number should be non negative. If not set (or set to 0), the system's default value will be used.", + "description": "Maximum number of concurrent backfill tasks. The number should be non-negative. If not set (or set to 0), the system's default value is used.", "format": "int32", "type": "integer" }, "maxConcurrentCdcTasks": { - "description": "Maximum number of concurrent CDC tasks. The number should be non negative. If not set (or set to 0), the system's default value will be used.", + "description": "Maximum number of concurrent CDC tasks. The number should be non-negative. If not set (or set to 0), the system's default value is used.", "format": "int32", "type": "integer" }, diff --git a/datastream/v1/datastream-gen.go b/datastream/v1/datastream-gen.go index b08ffa94ba9..1569064b840 100644 --- a/datastream/v1/datastream-gen.go +++ b/datastream/v1/datastream-gen.go @@ -1857,13 +1857,13 @@ type OracleSourceConfig struct { IncludeObjects *OracleRdbms `json:"includeObjects,omitempty"` // MaxConcurrentBackfillTasks: Maximum number of concurrent backfill - // tasks. The number should be non negative. If not set (or set to 0), - // the system's default value will be used. + // tasks. The number should be non-negative. If not set (or set to 0), + // the system's default value is used. MaxConcurrentBackfillTasks int64 `json:"maxConcurrentBackfillTasks,omitempty"` // MaxConcurrentCdcTasks: Maximum number of concurrent CDC tasks. The - // number should be non negative. If not set (or set to 0), the system's - // default value will be used. + // number should be non-negative. If not set (or set to 0), the system's + // default value is used. MaxConcurrentCdcTasks int64 `json:"maxConcurrentCdcTasks,omitempty"` // StreamLargeObjects: Stream large object values. NOTE: This feature is diff --git a/discoveryengine/v1alpha/discoveryengine-api.json b/discoveryengine/v1alpha/discoveryengine-api.json index 39ed3354d54..6cbe5bed152 100644 --- a/discoveryengine/v1alpha/discoveryengine-api.json +++ b/discoveryengine/v1alpha/discoveryengine-api.json @@ -109,6 +109,335 @@ "resources": { "locations": { "resources": { + "collections": { + "resources": { + "dataStores": { + "resources": { + "branches": { + "resources": { + "documents": { + "methods": { + "create": { + "description": "Creates a Document.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "documentId": { + "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Documents with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/documents", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Document.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Document.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "import": { + "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/documents:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Gets a list of Documents.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/documents", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Document.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "allowMissing": { + "description": "If set to true, and the Document is not found, a new Document will be created.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "servingConfigs": { + "methods": { + "recommend": { + "description": "Makes a recommendation, which requires a contextual user event.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+servingConfig}:recommend", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "userEvents": { + "methods": { + "collect": { + "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + "parameterOrder": [ + "parent" + ], + "parameters": { + "ets": { + "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + "format": "int64", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "uri": { + "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.", + "location": "query", + "type": "string" + }, + "userEvent": { + "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:collect", + "response": { + "$ref": "GoogleApiHttpBody" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "import": { + "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "write": { + "description": "Writes a single user event.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:write", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + }, "dataStores": { "resources": { "branches": { @@ -130,7 +459,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.", + "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", "required": true, @@ -158,7 +487,7 @@ ], "parameters": { "name": { - "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", "required": true, @@ -183,7 +512,7 @@ ], "parameters": { "name": { - "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", "required": true, @@ -208,7 +537,7 @@ ], "parameters": { "parent": { - "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", "required": true, @@ -247,7 +576,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", "required": true, @@ -277,7 +606,7 @@ "type": "boolean" }, "name": { - "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", "required": true, @@ -525,7 +854,7 @@ ], "parameters": { "servingConfig": { - "description": "Required. Full resource name of the format: projects/*/locations/global/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -563,7 +892,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, @@ -598,7 +927,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/dataStores/{data_store}`", + "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, @@ -626,7 +955,7 @@ ], "parameters": { "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, @@ -793,7 +1122,7 @@ } } }, - "revision": "20230209", + "revision": "20230227", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -854,22 +1183,6 @@ "description": "A message describing the error.", "type": "string" }, - "requestPayload": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The API request payload, represented as a protocol buffer. Most API request types are supported. For example: \"type.googleapis.com/google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocumentRequest\" \"type.googleapis.com/google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEventRequest\"", - "type": "object" - }, - "responsePayload": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The API response payload, represented as a protocol buffer. This is used to log some \"soft errors\", where the response is valid but we consider there are some quality issues like unjoined events. The following API responses are supported and no PII is included: \"google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend\" \"google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEvent\" \"google.cloud.discoveryengine.v1alpha.UserEventService.CollectUserEvent\"", - "type": "object" - }, "serviceContext": { "$ref": "GoogleCloudDiscoveryengineLoggingServiceContext", "description": "The service context in which this error has occurred." @@ -894,7 +1207,7 @@ "type": "object" }, "GoogleCloudDiscoveryengineLoggingImportErrorContext": { - "description": "The error payload that is populated on LRO import APIs. Including: \"google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments\" \"google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents\"", + "description": "The error payload that is populated on LRO import APIs, including the following: * `google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments` * `google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents`", "id": "GoogleCloudDiscoveryengineLoggingImportErrorContext", "properties": { "document": { @@ -925,7 +1238,7 @@ "id": "GoogleCloudDiscoveryengineLoggingServiceContext", "properties": { "service": { - "description": "An identifier of the service. For example, \"discoveryengine.googleapis.com\".", + "description": "An identifier of the service—for example, `discoveryengine.googleapis.com`.", "type": "string" } }, @@ -936,7 +1249,7 @@ "id": "GoogleCloudDiscoveryengineLoggingSourceLocation", "properties": { "functionName": { - "description": "Human-readable name of a function or method. For example, \" google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend\".", + "description": "Human-readable name of a function or method—for example, `google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend`.", "type": "string" } }, @@ -1024,7 +1337,7 @@ "type": "string" }, "name": { - "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" }, "parentDocumentId": { @@ -1055,7 +1368,7 @@ "type": "string" }, "name": { - "description": "Required. The Document resource full name, of the form: projects/{project\\_id}/locations/{location}/dataStores/{data\\_store\\_id}/branches/{branch\\_id}/documents/{document\\_id}", + "description": "Required. The Document resource full name, of the form: projects/{project\\_id}/locations/{location}/collections/{collection\\_id}/dataStores/{data\\_store\\_id}/branches/{branch\\_id}/documents/{document\\_id}", "type": "string" }, "promotionIds": { diff --git a/discoveryengine/v1alpha/discoveryengine-gen.go b/discoveryengine/v1alpha/discoveryengine-gen.go index 93bc33635e1..39b26b65dca 100644 --- a/discoveryengine/v1alpha/discoveryengine-gen.go +++ b/discoveryengine/v1alpha/discoveryengine-gen.go @@ -154,6 +154,7 @@ type ProjectsService struct { func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs := &ProjectsLocationsService{s: s} + rs.Collections = NewProjectsLocationsCollectionsService(s) rs.DataStores = NewProjectsLocationsDataStoresService(s) rs.Operations = NewProjectsLocationsOperationsService(s) return rs @@ -162,11 +163,82 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { type ProjectsLocationsService struct { s *Service + Collections *ProjectsLocationsCollectionsService + DataStores *ProjectsLocationsDataStoresService Operations *ProjectsLocationsOperationsService } +func NewProjectsLocationsCollectionsService(s *Service) *ProjectsLocationsCollectionsService { + rs := &ProjectsLocationsCollectionsService{s: s} + rs.DataStores = NewProjectsLocationsCollectionsDataStoresService(s) + return rs +} + +type ProjectsLocationsCollectionsService struct { + s *Service + + DataStores *ProjectsLocationsCollectionsDataStoresService +} + +func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { + rs := &ProjectsLocationsCollectionsDataStoresService{s: s} + rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.ServingConfigs = NewProjectsLocationsCollectionsDataStoresServingConfigsService(s) + rs.UserEvents = NewProjectsLocationsCollectionsDataStoresUserEventsService(s) + return rs +} + +type ProjectsLocationsCollectionsDataStoresService struct { + s *Service + + Branches *ProjectsLocationsCollectionsDataStoresBranchesService + + ServingConfigs *ProjectsLocationsCollectionsDataStoresServingConfigsService + + UserEvents *ProjectsLocationsCollectionsDataStoresUserEventsService +} + +func NewProjectsLocationsCollectionsDataStoresBranchesService(s *Service) *ProjectsLocationsCollectionsDataStoresBranchesService { + rs := &ProjectsLocationsCollectionsDataStoresBranchesService{s: s} + rs.Documents = NewProjectsLocationsCollectionsDataStoresBranchesDocumentsService(s) + return rs +} + +type ProjectsLocationsCollectionsDataStoresBranchesService struct { + s *Service + + Documents *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService +} + +func NewProjectsLocationsCollectionsDataStoresBranchesDocumentsService(s *Service) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService { + rs := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsService struct { + s *Service +} + +func NewProjectsLocationsCollectionsDataStoresServingConfigsService(s *Service) *ProjectsLocationsCollectionsDataStoresServingConfigsService { + rs := &ProjectsLocationsCollectionsDataStoresServingConfigsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresServingConfigsService struct { + s *Service +} + +func NewProjectsLocationsCollectionsDataStoresUserEventsService(s *Service) *ProjectsLocationsCollectionsDataStoresUserEventsService { + rs := &ProjectsLocationsCollectionsDataStoresUserEventsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresUserEventsService struct { + s *Service +} + func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) @@ -394,27 +466,6 @@ type GoogleCloudDiscoveryengineLoggingErrorLog struct { // Message: A message describing the error. Message string `json:"message,omitempty"` - // RequestPayload: The API request payload, represented as a protocol - // buffer. Most API request types are supported. For example: - // "type.googleapis.com/google.cloud.discoveryengine.v1alpha.DocumentServ - // ice.CreateDocumentRequest" - // "type.googleapis.com/google.cloud.discoveryengine.v1alpha.UserEventSer - // vice.WriteUserEventRequest" - RequestPayload googleapi.RawMessage `json:"requestPayload,omitempty"` - - // ResponsePayload: The API response payload, represented as a protocol - // buffer. This is used to log some "soft errors", where the response is - // valid but we consider there are some quality issues like unjoined - // events. The following API responses are supported and no PII is - // included: - // "google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend" - // - // "google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEvent" - // - // "google.cloud.discoveryengine.v1alpha.UserEventService.CollectUserEven - // t" - ResponsePayload googleapi.RawMessage `json:"responsePayload,omitempty"` - // ServiceContext: The service context in which this error has occurred. ServiceContext *GoogleCloudDiscoveryengineLoggingServiceContext `json:"serviceContext,omitempty"` @@ -475,11 +526,14 @@ func (s *GoogleCloudDiscoveryengineLoggingHttpRequestContext) MarshalJSON() ([]b } // GoogleCloudDiscoveryengineLoggingImportErrorContext: The error -// payload that is populated on LRO import APIs. Including: -// "google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments" +// payload that is populated on LRO import APIs, including the +// following: * +// `google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments` +// +// * // -// "google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvent -// s" +// `google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvent +// s` type GoogleCloudDiscoveryengineLoggingImportErrorContext struct { // Document: The detailed content which caused the error on importing a // document. @@ -526,8 +580,8 @@ func (s *GoogleCloudDiscoveryengineLoggingImportErrorContext) MarshalJSON() ([]b // GoogleCloudDiscoveryengineLoggingServiceContext: Describes a running // service that sends errors. type GoogleCloudDiscoveryengineLoggingServiceContext struct { - // Service: An identifier of the service. For example, - // "discoveryengine.googleapis.com". + // Service: An identifier of the service—for example, + // `discoveryengine.googleapis.com`. Service string `json:"service,omitempty"` // ForceSendFields is a list of field names (e.g. "Service") to @@ -556,9 +610,10 @@ func (s *GoogleCloudDiscoveryengineLoggingServiceContext) MarshalJSON() ([]byte, // GoogleCloudDiscoveryengineLoggingSourceLocation: Indicates a location // in the source code of the service for which errors are reported. type GoogleCloudDiscoveryengineLoggingSourceLocation struct { - // FunctionName: Human-readable name of a function or method. For - // example, " - // google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend". + // FunctionName: Human-readable name of a function or method—for + // example, + // `google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend` + // . FunctionName string `json:"functionName,omitempty"` // ForceSendFields is a list of field names (e.g. "FunctionName") to @@ -729,9 +784,10 @@ type GoogleCloudDiscoveryengineV1alphaDocument struct { JsonData string `json:"jsonData,omitempty"` // Name: Immutable. The full resource name of the document. Format: - // `projects/{project}/locations/{location}/dataStores/{data_store}/branc - // hes/{branch}/documents/{document_id}`. This field must be a UTF-8 - // encoded string with a length limit of 1024 characters. + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/branches/{branch}/documents/{document_id}`. This + // field must be a UTF-8 encoded string with a length limit of 1024 + // characters. Name string `json:"name,omitempty"` // ParentDocumentId: The identifier of the parent document. Currently @@ -783,8 +839,9 @@ type GoogleCloudDiscoveryengineV1alphaDocumentInfo struct { Id string `json:"id,omitempty"` // Name: Required. The Document resource full name, of the form: - // projects/{project\_id}/locations/{location}/dataStores/{data\_store\_i - // d}/branches/{branch\_id}/documents/{document\_id} + // projects/{project\_id}/locations/{location}/collections/{collection\_i + // d}/dataStores/{data\_store\_id}/branches/{branch\_id}/documents/{docum + // ent\_id} Name string `json:"name,omitempty"` // PromotionIds: The promotion IDs associated with this Document. @@ -2325,6 +2382,1612 @@ func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.create": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Document. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument + return c +} + +// DocumentId sets the optional parameter "documentId": Required. The ID +// to use for the Document, which will become the final component of the +// Document.name. If the caller does not have permission to create the +// Document, regardless of whether or not it exists, a PERMISSION_DENIED +// error is returned. This field must be unique among all Documents with +// the same parent. Otherwise, an ALREADY_EXISTS error is returned. This +// field must conform to RFC-1034 (https://tools.ietf.org/html/rfc1034) +// standard with a length limit of 63 characters. Otherwise, an +// INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("documentId", documentId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + 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.branches.documents.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, 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 := &GoogleCloudDiscoveryengineV1alphaDocument{ + 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 + // { + // "description": "Creates a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "documentId": { + // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Documents with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the Document to delete does not exist, a NOT_FOUND +// error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall{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 information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+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 "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. 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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) 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 + // { + // "description": "Deletes a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.get": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the requested Document does not exist, a NOT_FOUND +// error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall{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 information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}") + 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.documents.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, 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 := &GoogleCloudDiscoveryengineV1alphaDocument{ + 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 + // { + // "description": "Gets a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.import": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of multiple Documents. Request processing may be +// synchronous. Non-existing items will be created. Note: It is possible +// for a subset of the Documents to be successfully updated. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaimportdocumentsrequest = googleclouddiscoveryenginev1alphaimportdocumentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents: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.branches.documents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// 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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) 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 + // { + // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.list": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Documents. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documentss under this +// branch, regardless of whether or not this branch exists, a +// PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Documents to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// ListDocumentsResponse.next_page_token, received from a previous +// DocumentService.ListDocuments call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// DocumentService.ListDocuments must match the call that provided the +// page token. Otherwise, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + 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 information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+parent}/documents") + 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 "discoveryengine.projects.locations.collections.dataStores.branches.documents.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse, 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 := &GoogleCloudDiscoveryengineV1alphaListDocumentsResponse{ + 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 + // { + // "description": "Gets a list of Documents.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// 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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + 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) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Document. +// +// - name: Immutable. The full resource name of the document. Format: +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Document is not found, a new Document will be created. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+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 "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, 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 := &GoogleCloudDiscoveryengineV1alphaDocument{ + 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 + // { + // "description": "Updates a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Document is not found, a new Document will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend": + +type ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Recommend: Makes a recommendation, which requires a contextual user +// event. +// +// - servingConfig: Full resource name of the format: +// projects/*/locations/global/collections/*/dataStores/*/servingConfig +// s/* Before you can request recommendations from your model, you +// must create at least one serving config for it. +func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c := &ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1alpharecommendrequest = googleclouddiscoveryenginev1alpharecommendrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:recommend") + 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{ + "servingConfig": c.servingConfig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaRecommendResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaRecommendResponse.ServerResponse.Hea +// der 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 *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaRecommendResponse, 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 := &GoogleCloudDiscoveryengineV1alphaRecommendResponse{ + 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 + // { + // "description": "Makes a recommendation, which requires a contextual user event.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + // "parameterOrder": [ + // "servingConfig" + // ], + // "parameters": { + // "servingConfig": { + // "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+servingConfig}:recommend", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.collect": + +type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Collect: Writes a single user event from the browser. This uses a GET +// request to due to browser restriction of POST-ing to a 3rd party +// domain. This method is used only by the Discovery Engine API +// JavaScript pixel and Google Tag Manager. Users should not call this +// method directly. +// +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Ets sets the optional parameter "ets": The event timestamp in +// milliseconds. This prevents browser caching of otherwise identical +// get requests. The name is abbreviated to reduce the payload bytes. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("ets", fmt.Sprint(ets)) + return c +} + +// Uri sets the optional parameter "uri": The URL including +// cgi-parameters but excluding the hash fragment with a length limit of +// 5,000 characters. This is often more useful than the referer URL, +// because many browsers only send the domain for 3rd party requests. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("uri", uri) + return c +} + +// UserEvent sets the optional parameter "userEvent": Required. URL +// encoded UserEvent proto with a length limit of 2,000,000 characters. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("userEvent", userEvent) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+parent}/userEvents:collect") + 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 "discoveryengine.projects.locations.collections.dataStores.userEvents.collect" call. +// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleApiHttpBody.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 *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, 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 := &GoogleApiHttpBody{ + 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 + // { + // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "ets": { + // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uri": { + // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.", + // "location": "query", + // "type": "string" + // }, + // "userEvent": { + // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/userEvents:collect", + // "response": { + // "$ref": "GoogleApiHttpBody" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.import": + +type ProjectsLocationsCollectionsDataStoresUserEventsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of User events. Request processing might be +// synchronous. Events that already exist are skipped. Use this method +// for backfilling historical user events. Operation.response is of type +// ImportResponse. Note that it is possible for a subset of the items to +// be successfully inserted. Operation.metadata is of type +// ImportMetadata. +// +// - parent: Parent DataStore resource name, of the form +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaimportusereventsrequest = googleclouddiscoveryenginev1alphaimportusereventsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents: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.userEvents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// 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 *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) 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 + // { + // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/userEvents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.write": + +type ProjectsLocationsCollectionsDataStoresUserEventsWriteCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Write: Writes a single user event. +// +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphauserevent = googleclouddiscoveryenginev1alphauserevent + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphauserevent) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:write") + 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.userEvents.write" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaUserEvent or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaUserEvent.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 *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaUserEvent, 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 := &GoogleCloudDiscoveryengineV1alphaUserEvent{ + 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 + // { + // "description": "Writes a single user event.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/userEvents:write", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "discoveryengine.projects.locations.dataStores.branches.documents.create": type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { @@ -2339,8 +4002,8 @@ type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { // Create: Creates a Document. // // - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { c := &ProjectsLocationsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -2469,7 +4132,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.", + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, @@ -2503,11 +4166,12 @@ type ProjectsLocationsDataStoresBranchesDocumentsDeleteCall struct { // Delete: Deletes a Document. // // - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}/documents/{document}`. If the caller does not have -// permission to delete the Document, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. If the Document to -// delete does not exist, a NOT_FOUND error is returned. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the Document to delete does not exist, a NOT_FOUND +// error is returned. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { c := &ProjectsLocationsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -2609,7 +4273,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, @@ -2641,11 +4305,12 @@ type ProjectsLocationsDataStoresBranchesDocumentsGetCall struct { // Get: Gets a Document. // // - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}/documents/{document}`. If the caller does not have -// permission to access the Document, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. If the requested -// Document does not exist, a NOT_FOUND error is returned. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the requested Document does not exist, a NOT_FOUND +// error is returned. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c := &ProjectsLocationsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -2762,7 +4427,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, @@ -2796,8 +4461,9 @@ type ProjectsLocationsDataStoresBranchesDocumentsImportCall struct { // for a subset of the Documents to be successfully updated. // // - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}`. Requires create/update permission. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { c := &ProjectsLocationsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -2905,7 +4571,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...goog // ], // "parameters": { // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, @@ -2940,12 +4606,12 @@ type ProjectsLocationsDataStoresBranchesDocumentsListCall struct { // List: Gets a list of Documents. // // - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}`. Use `default_branch` as the branch ID, to list -// documents under the default branch. If the caller does not have -// permission to list Documentss under this branch, regardless of -// whether or not this branch exists, a PERMISSION_DENIED error is -// returned. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documentss under this +// branch, regardless of whether or not this branch exists, a +// PERMISSION_DENIED error is returned. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c := &ProjectsLocationsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -3094,7 +4760,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google // "type": "string" // }, // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, @@ -3147,9 +4813,10 @@ type ProjectsLocationsDataStoresBranchesDocumentsPatchCall struct { // Patch: Updates a Document. // // - name: Immutable. The full resource name of the document. Format: -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}/documents/{document_id}`. This field must be a UTF-8 -// encoded string with a length limit of 1024 characters. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { c := &ProjectsLocationsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -3271,7 +4938,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl // "type": "boolean" // }, // "name": { - // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, @@ -4393,9 +6060,9 @@ type ProjectsLocationsDataStoresServingConfigsRecommendCall struct { // event. // // - servingConfig: Full resource name of the format: -// projects/*/locations/global/dataStores/*/servingConfigs/* Before -// you can request recommendations from your model, you must create at -// least one serving config for it. +// projects/*/locations/global/collections/*/dataStores/*/servingConfig +// s/* Before you can request recommendations from your model, you +// must create at least one serving config for it. func (r *ProjectsLocationsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest) *ProjectsLocationsDataStoresServingConfigsRecommendCall { c := &ProjectsLocationsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig @@ -4505,7 +6172,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog // ], // "parameters": { // "servingConfig": { - // "description": "Required. Full resource name of the format: projects/*/locations/global/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + // "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -4544,7 +6211,8 @@ type ProjectsLocationsDataStoresUserEventsCollectCall struct { // method directly. // // - parent: The parent DataStore resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. func (r *ProjectsLocationsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsDataStoresUserEventsCollectCall { c := &ProjectsLocationsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -4689,7 +6357,7 @@ func (c *ProjectsLocationsDataStoresUserEventsCollectCall) Do(opts ...googleapi. // "type": "string" // }, // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, @@ -4736,7 +6404,8 @@ type ProjectsLocationsDataStoresUserEventsImportCall struct { // ImportMetadata. // // - parent: Parent DataStore resource name, of the form -// `projects/{project}/locations/{location}/dataStores/{data_store}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. func (r *ProjectsLocationsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest) *ProjectsLocationsDataStoresUserEventsImportCall { c := &ProjectsLocationsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -4844,7 +6513,7 @@ func (c *ProjectsLocationsDataStoresUserEventsImportCall) Do(opts ...googleapi.C // ], // "parameters": { // "parent": { - // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/dataStores/{data_store}`", + // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, @@ -4879,7 +6548,8 @@ type ProjectsLocationsDataStoresUserEventsWriteCall struct { // Write: Writes a single user event. // // - parent: The parent DataStore resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. func (r *ProjectsLocationsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent) *ProjectsLocationsDataStoresUserEventsWriteCall { c := &ProjectsLocationsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -4989,7 +6659,7 @@ func (c *ProjectsLocationsDataStoresUserEventsWriteCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, diff --git a/discoveryengine/v1beta/discoveryengine-api.json b/discoveryengine/v1beta/discoveryengine-api.json index bdb156c42bc..d8dd5dc889b 100644 --- a/discoveryengine/v1beta/discoveryengine-api.json +++ b/discoveryengine/v1beta/discoveryengine-api.json @@ -109,6 +109,335 @@ "resources": { "locations": { "resources": { + "collections": { + "resources": { + "dataStores": { + "resources": { + "branches": { + "resources": { + "documents": { + "methods": { + "create": { + "description": "Creates a Document.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "documentId": { + "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Documents with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/documents", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Document.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Document.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "import": { + "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/documents:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportDocumentsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Gets a list of Documents.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/documents", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Document.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "allowMissing": { + "description": "If set to true, and the Document is not found, a new Document will be created.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "servingConfigs": { + "methods": { + "recommend": { + "description": "Makes a recommendation, which requires a contextual user event.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+servingConfig}:recommend", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "userEvents": { + "methods": { + "collect": { + "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + "parameterOrder": [ + "parent" + ], + "parameters": { + "ets": { + "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + "format": "int64", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "uri": { + "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.", + "location": "query", + "type": "string" + }, + "userEvent": { + "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+parent}/userEvents:collect", + "response": { + "$ref": "GoogleApiHttpBody" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "import": { + "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/userEvents:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportUserEventsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "write": { + "description": "Writes a single user event.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/userEvents:write", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + }, "dataStores": { "resources": { "branches": { @@ -130,7 +459,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.", + "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", "required": true, @@ -158,7 +487,7 @@ ], "parameters": { "name": { - "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", "required": true, @@ -183,7 +512,7 @@ ], "parameters": { "name": { - "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", "required": true, @@ -208,7 +537,7 @@ ], "parameters": { "parent": { - "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", "required": true, @@ -247,7 +576,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", "required": true, @@ -277,7 +606,7 @@ "type": "boolean" }, "name": { - "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", "required": true, @@ -525,7 +854,7 @@ ], "parameters": { "servingConfig": { - "description": "Required. Full resource name of the format: projects/*/locations/global/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -563,7 +892,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, @@ -598,7 +927,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/dataStores/{data_store}`", + "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, @@ -626,7 +955,7 @@ ], "parameters": { "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, @@ -793,7 +1122,7 @@ } } }, - "revision": "20230209", + "revision": "20230227", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -854,22 +1183,6 @@ "description": "A message describing the error.", "type": "string" }, - "requestPayload": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The API request payload, represented as a protocol buffer. Most API request types are supported. For example: \"type.googleapis.com/google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocumentRequest\" \"type.googleapis.com/google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEventRequest\"", - "type": "object" - }, - "responsePayload": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The API response payload, represented as a protocol buffer. This is used to log some \"soft errors\", where the response is valid but we consider there are some quality issues like unjoined events. The following API responses are supported and no PII is included: \"google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend\" \"google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEvent\" \"google.cloud.discoveryengine.v1alpha.UserEventService.CollectUserEvent\"", - "type": "object" - }, "serviceContext": { "$ref": "GoogleCloudDiscoveryengineLoggingServiceContext", "description": "The service context in which this error has occurred." @@ -894,7 +1207,7 @@ "type": "object" }, "GoogleCloudDiscoveryengineLoggingImportErrorContext": { - "description": "The error payload that is populated on LRO import APIs. Including: \"google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments\" \"google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents\"", + "description": "The error payload that is populated on LRO import APIs, including the following: * `google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments` * `google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents`", "id": "GoogleCloudDiscoveryengineLoggingImportErrorContext", "properties": { "document": { @@ -925,7 +1238,7 @@ "id": "GoogleCloudDiscoveryengineLoggingServiceContext", "properties": { "service": { - "description": "An identifier of the service. For example, \"discoveryengine.googleapis.com\".", + "description": "An identifier of the service—for example, `discoveryengine.googleapis.com`.", "type": "string" } }, @@ -936,7 +1249,7 @@ "id": "GoogleCloudDiscoveryengineLoggingSourceLocation", "properties": { "functionName": { - "description": "Human-readable name of a function or method. For example, \" google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend\".", + "description": "Human-readable name of a function or method—for example, `google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend`.", "type": "string" } }, @@ -1135,7 +1448,7 @@ "type": "string" }, "name": { - "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" }, "parentDocumentId": { @@ -1166,7 +1479,7 @@ "type": "string" }, "name": { - "description": "Required. The Document resource full name, of the form: projects/{project\\_id}/locations/{location}/dataStores/{data\\_store\\_id}/branches/{branch\\_id}/documents/{document\\_id}", + "description": "Required. The Document resource full name, of the form: projects/{project\\_id}/locations/{location}/collections/{collection\\_id}/dataStores/{data\\_store\\_id}/branches/{branch\\_id}/documents/{document\\_id}", "type": "string" }, "promotionIds": { diff --git a/discoveryengine/v1beta/discoveryengine-gen.go b/discoveryengine/v1beta/discoveryengine-gen.go index 6a1cbc238ab..538a5436c1d 100644 --- a/discoveryengine/v1beta/discoveryengine-gen.go +++ b/discoveryengine/v1beta/discoveryengine-gen.go @@ -154,6 +154,7 @@ type ProjectsService struct { func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs := &ProjectsLocationsService{s: s} + rs.Collections = NewProjectsLocationsCollectionsService(s) rs.DataStores = NewProjectsLocationsDataStoresService(s) rs.Operations = NewProjectsLocationsOperationsService(s) return rs @@ -162,11 +163,82 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { type ProjectsLocationsService struct { s *Service + Collections *ProjectsLocationsCollectionsService + DataStores *ProjectsLocationsDataStoresService Operations *ProjectsLocationsOperationsService } +func NewProjectsLocationsCollectionsService(s *Service) *ProjectsLocationsCollectionsService { + rs := &ProjectsLocationsCollectionsService{s: s} + rs.DataStores = NewProjectsLocationsCollectionsDataStoresService(s) + return rs +} + +type ProjectsLocationsCollectionsService struct { + s *Service + + DataStores *ProjectsLocationsCollectionsDataStoresService +} + +func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { + rs := &ProjectsLocationsCollectionsDataStoresService{s: s} + rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.ServingConfigs = NewProjectsLocationsCollectionsDataStoresServingConfigsService(s) + rs.UserEvents = NewProjectsLocationsCollectionsDataStoresUserEventsService(s) + return rs +} + +type ProjectsLocationsCollectionsDataStoresService struct { + s *Service + + Branches *ProjectsLocationsCollectionsDataStoresBranchesService + + ServingConfigs *ProjectsLocationsCollectionsDataStoresServingConfigsService + + UserEvents *ProjectsLocationsCollectionsDataStoresUserEventsService +} + +func NewProjectsLocationsCollectionsDataStoresBranchesService(s *Service) *ProjectsLocationsCollectionsDataStoresBranchesService { + rs := &ProjectsLocationsCollectionsDataStoresBranchesService{s: s} + rs.Documents = NewProjectsLocationsCollectionsDataStoresBranchesDocumentsService(s) + return rs +} + +type ProjectsLocationsCollectionsDataStoresBranchesService struct { + s *Service + + Documents *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService +} + +func NewProjectsLocationsCollectionsDataStoresBranchesDocumentsService(s *Service) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService { + rs := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsService struct { + s *Service +} + +func NewProjectsLocationsCollectionsDataStoresServingConfigsService(s *Service) *ProjectsLocationsCollectionsDataStoresServingConfigsService { + rs := &ProjectsLocationsCollectionsDataStoresServingConfigsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresServingConfigsService struct { + s *Service +} + +func NewProjectsLocationsCollectionsDataStoresUserEventsService(s *Service) *ProjectsLocationsCollectionsDataStoresUserEventsService { + rs := &ProjectsLocationsCollectionsDataStoresUserEventsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresUserEventsService struct { + s *Service +} + func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) @@ -394,27 +466,6 @@ type GoogleCloudDiscoveryengineLoggingErrorLog struct { // Message: A message describing the error. Message string `json:"message,omitempty"` - // RequestPayload: The API request payload, represented as a protocol - // buffer. Most API request types are supported. For example: - // "type.googleapis.com/google.cloud.discoveryengine.v1alpha.DocumentServ - // ice.CreateDocumentRequest" - // "type.googleapis.com/google.cloud.discoveryengine.v1alpha.UserEventSer - // vice.WriteUserEventRequest" - RequestPayload googleapi.RawMessage `json:"requestPayload,omitempty"` - - // ResponsePayload: The API response payload, represented as a protocol - // buffer. This is used to log some "soft errors", where the response is - // valid but we consider there are some quality issues like unjoined - // events. The following API responses are supported and no PII is - // included: - // "google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend" - // - // "google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEvent" - // - // "google.cloud.discoveryengine.v1alpha.UserEventService.CollectUserEven - // t" - ResponsePayload googleapi.RawMessage `json:"responsePayload,omitempty"` - // ServiceContext: The service context in which this error has occurred. ServiceContext *GoogleCloudDiscoveryengineLoggingServiceContext `json:"serviceContext,omitempty"` @@ -475,11 +526,14 @@ func (s *GoogleCloudDiscoveryengineLoggingHttpRequestContext) MarshalJSON() ([]b } // GoogleCloudDiscoveryengineLoggingImportErrorContext: The error -// payload that is populated on LRO import APIs. Including: -// "google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments" +// payload that is populated on LRO import APIs, including the +// following: * +// `google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments` +// +// * // -// "google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvent -// s" +// `google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvent +// s` type GoogleCloudDiscoveryengineLoggingImportErrorContext struct { // Document: The detailed content which caused the error on importing a // document. @@ -526,8 +580,8 @@ func (s *GoogleCloudDiscoveryengineLoggingImportErrorContext) MarshalJSON() ([]b // GoogleCloudDiscoveryengineLoggingServiceContext: Describes a running // service that sends errors. type GoogleCloudDiscoveryengineLoggingServiceContext struct { - // Service: An identifier of the service. For example, - // "discoveryengine.googleapis.com". + // Service: An identifier of the service—for example, + // `discoveryengine.googleapis.com`. Service string `json:"service,omitempty"` // ForceSendFields is a list of field names (e.g. "Service") to @@ -556,9 +610,10 @@ func (s *GoogleCloudDiscoveryengineLoggingServiceContext) MarshalJSON() ([]byte, // GoogleCloudDiscoveryengineLoggingSourceLocation: Indicates a location // in the source code of the service for which errors are reported. type GoogleCloudDiscoveryengineLoggingSourceLocation struct { - // FunctionName: Human-readable name of a function or method. For - // example, " - // google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend". + // FunctionName: Human-readable name of a function or method—for + // example, + // `google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend` + // . FunctionName string `json:"functionName,omitempty"` // ForceSendFields is a list of field names (e.g. "FunctionName") to @@ -925,9 +980,10 @@ type GoogleCloudDiscoveryengineV1betaDocument struct { JsonData string `json:"jsonData,omitempty"` // Name: Immutable. The full resource name of the document. Format: - // `projects/{project}/locations/{location}/dataStores/{data_store}/branc - // hes/{branch}/documents/{document_id}`. This field must be a UTF-8 - // encoded string with a length limit of 1024 characters. + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/branches/{branch}/documents/{document_id}`. This + // field must be a UTF-8 encoded string with a length limit of 1024 + // characters. Name string `json:"name,omitempty"` // ParentDocumentId: The identifier of the parent document. Currently @@ -979,8 +1035,9 @@ type GoogleCloudDiscoveryengineV1betaDocumentInfo struct { Id string `json:"id,omitempty"` // Name: Required. The Document resource full name, of the form: - // projects/{project\_id}/locations/{location}/dataStores/{data\_store\_i - // d}/branches/{branch\_id}/documents/{document\_id} + // projects/{project\_id}/locations/{location}/collections/{collection\_i + // d}/dataStores/{data\_store\_id}/branches/{branch\_id}/documents/{docum + // ent\_id} Name string `json:"name,omitempty"` // PromotionIds: The promotion IDs associated with this Document. @@ -2326,6 +2383,1611 @@ func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.create": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Document. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument + return c +} + +// DocumentId sets the optional parameter "documentId": Required. The ID +// to use for the Document, which will become the final component of the +// Document.name. If the caller does not have permission to create the +// Document, regardless of whether or not it exists, a PERMISSION_DENIED +// error is returned. This field must be unique among all Documents with +// the same parent. Otherwise, an ALREADY_EXISTS error is returned. This +// field must conform to RFC-1034 (https://tools.ietf.org/html/rfc1034) +// standard with a length limit of 63 characters. Otherwise, an +// INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("documentId", documentId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + 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.branches.documents.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, 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 := &GoogleCloudDiscoveryengineV1betaDocument{ + 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 + // { + // "description": "Creates a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "documentId": { + // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Documents with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the Document to delete does not exist, a NOT_FOUND +// error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall{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 information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+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 "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. 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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) 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 + // { + // "description": "Deletes a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.get": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the requested Document does not exist, a NOT_FOUND +// error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall{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 information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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}") + 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.documents.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, 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 := &GoogleCloudDiscoveryengineV1betaDocument{ + 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 + // { + // "description": "Gets a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.import": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of multiple Documents. Request processing may be +// synchronous. Non-existing items will be created. Note: It is possible +// for a subset of the Documents to be successfully updated. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportdocumentsrequest = googleclouddiscoveryenginev1betaimportdocumentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents: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.branches.documents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// 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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) 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 + // { + // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaImportDocumentsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.list": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Documents. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documentss under this +// branch, regardless of whether or not this branch exists, a +// PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Documents to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// ListDocumentsResponse.next_page_token, received from a previous +// DocumentService.ListDocuments call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// DocumentService.ListDocuments must match the call that provided the +// page token. Otherwise, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + 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 information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+parent}/documents") + 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 "discoveryengine.projects.locations.collections.dataStores.branches.documents.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaListDocumentsResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaListDocumentsResponse.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListDocumentsResponse, 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 := &GoogleCloudDiscoveryengineV1betaListDocumentsResponse{ + 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 + // { + // "description": "Gets a list of Documents.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// 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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListDocumentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + 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) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Document. +// +// - name: Immutable. The full resource name of the document. Format: +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Document is not found, a new Document will be created. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+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 "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.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 *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, 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 := &GoogleCloudDiscoveryengineV1betaDocument{ + 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 + // { + // "description": "Updates a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Document is not found, a new Document will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend": + +type ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Recommend: Makes a recommendation, which requires a contextual user +// event. +// +// - servingConfig: Full resource name of the format: +// projects/*/locations/global/collections/*/dataStores/*/servingConfig +// s/* Before you can request recommendations from your model, you +// must create at least one serving config for it. +func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c := &ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1betarecommendrequest = googleclouddiscoveryenginev1betarecommendrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:recommend") + 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{ + "servingConfig": c.servingConfig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaRecommendResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaRecommendResponse.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 *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaRecommendResponse, 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 := &GoogleCloudDiscoveryengineV1betaRecommendResponse{ + 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 + // { + // "description": "Makes a recommendation, which requires a contextual user event.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + // "parameterOrder": [ + // "servingConfig" + // ], + // "parameters": { + // "servingConfig": { + // "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+servingConfig}:recommend", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.collect": + +type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Collect: Writes a single user event from the browser. This uses a GET +// request to due to browser restriction of POST-ing to a 3rd party +// domain. This method is used only by the Discovery Engine API +// JavaScript pixel and Google Tag Manager. Users should not call this +// method directly. +// +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Ets sets the optional parameter "ets": The event timestamp in +// milliseconds. This prevents browser caching of otherwise identical +// get requests. The name is abbreviated to reduce the payload bytes. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("ets", fmt.Sprint(ets)) + return c +} + +// Uri sets the optional parameter "uri": The URL including +// cgi-parameters but excluding the hash fragment with a length limit of +// 5,000 characters. This is often more useful than the referer URL, +// because many browsers only send the domain for 3rd party requests. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("uri", uri) + return c +} + +// UserEvent sets the optional parameter "userEvent": Required. URL +// encoded UserEvent proto with a length limit of 2,000,000 characters. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("userEvent", userEvent) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+parent}/userEvents:collect") + 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 "discoveryengine.projects.locations.collections.dataStores.userEvents.collect" call. +// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleApiHttpBody.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 *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, 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 := &GoogleApiHttpBody{ + 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 + // { + // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "ets": { + // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uri": { + // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.", + // "location": "query", + // "type": "string" + // }, + // "userEvent": { + // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/userEvents:collect", + // "response": { + // "$ref": "GoogleApiHttpBody" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.import": + +type ProjectsLocationsCollectionsDataStoresUserEventsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of User events. Request processing might be +// synchronous. Events that already exist are skipped. Use this method +// for backfilling historical user events. Operation.response is of type +// ImportResponse. Note that it is possible for a subset of the items to +// be successfully inserted. Operation.metadata is of type +// ImportMetadata. +// +// - parent: Parent DataStore resource name, of the form +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportusereventsrequest = googleclouddiscoveryenginev1betaimportusereventsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportusereventsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents: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.userEvents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// 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 *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) 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 + // { + // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/userEvents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaImportUserEventsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.write": + +type ProjectsLocationsCollectionsDataStoresUserEventsWriteCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Write: Writes a single user event. +// +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betauserevent = googleclouddiscoveryenginev1betauserevent + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betauserevent) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:write") + 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.userEvents.write" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaUserEvent or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaUserEvent.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 *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaUserEvent, 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 := &GoogleCloudDiscoveryengineV1betaUserEvent{ + 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 + // { + // "description": "Writes a single user event.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/userEvents:write", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "discoveryengine.projects.locations.dataStores.branches.documents.create": type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { @@ -2340,8 +4002,8 @@ type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { // Create: Creates a Document. // // - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { c := &ProjectsLocationsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -2470,7 +4132,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog // "type": "string" // }, // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.", + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, @@ -2504,11 +4166,12 @@ type ProjectsLocationsDataStoresBranchesDocumentsDeleteCall struct { // Delete: Deletes a Document. // // - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}/documents/{document}`. If the caller does not have -// permission to delete the Document, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. If the Document to -// delete does not exist, a NOT_FOUND error is returned. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the Document to delete does not exist, a NOT_FOUND +// error is returned. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { c := &ProjectsLocationsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -2610,7 +4273,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, @@ -2642,11 +4305,12 @@ type ProjectsLocationsDataStoresBranchesDocumentsGetCall struct { // Get: Gets a Document. // // - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}/documents/{document}`. If the caller does not have -// permission to access the Document, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. If the requested -// Document does not exist, a NOT_FOUND error is returned. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a PERMISSION_DENIED error +// is returned. If the requested Document does not exist, a NOT_FOUND +// error is returned. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c := &ProjectsLocationsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -2763,7 +4427,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, @@ -2797,8 +4461,9 @@ type ProjectsLocationsDataStoresBranchesDocumentsImportCall struct { // for a subset of the Documents to be successfully updated. // // - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}`. Requires create/update permission. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { c := &ProjectsLocationsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -2906,7 +4571,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...goog // ], // "parameters": { // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, @@ -2941,12 +4606,12 @@ type ProjectsLocationsDataStoresBranchesDocumentsListCall struct { // List: Gets a list of Documents. // // - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}`. Use `default_branch` as the branch ID, to list -// documents under the default branch. If the caller does not have -// permission to list Documentss under this branch, regardless of -// whether or not this branch exists, a PERMISSION_DENIED error is -// returned. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documentss under this +// branch, regardless of whether or not this branch exists, a +// PERMISSION_DENIED error is returned. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c := &ProjectsLocationsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -3094,7 +4759,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google // "type": "string" // }, // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, @@ -3147,9 +4812,10 @@ type ProjectsLocationsDataStoresBranchesDocumentsPatchCall struct { // Patch: Updates a Document. // // - name: Immutable. The full resource name of the document. Format: -// `projects/{project}/locations/{location}/dataStores/{data_store}/bra -// nches/{branch}/documents/{document_id}`. This field must be a UTF-8 -// encoded string with a length limit of 1024 characters. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { c := &ProjectsLocationsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -3271,7 +4937,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl // "type": "boolean" // }, // "name": { - // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, @@ -4393,9 +6059,9 @@ type ProjectsLocationsDataStoresServingConfigsRecommendCall struct { // event. // // - servingConfig: Full resource name of the format: -// projects/*/locations/global/dataStores/*/servingConfigs/* Before -// you can request recommendations from your model, you must create at -// least one serving config for it. +// projects/*/locations/global/collections/*/dataStores/*/servingConfig +// s/* Before you can request recommendations from your model, you +// must create at least one serving config for it. func (r *ProjectsLocationsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest) *ProjectsLocationsDataStoresServingConfigsRecommendCall { c := &ProjectsLocationsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig @@ -4505,7 +6171,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog // ], // "parameters": { // "servingConfig": { - // "description": "Required. Full resource name of the format: projects/*/locations/global/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", + // "description": "Required. Full resource name of the format: projects/*/locations/global/collections/*/dataStores/*/servingConfigs/* Before you can request recommendations from your model, you must create at least one serving config for it.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -4544,7 +6210,8 @@ type ProjectsLocationsDataStoresUserEventsCollectCall struct { // method directly. // // - parent: The parent DataStore resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. func (r *ProjectsLocationsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsDataStoresUserEventsCollectCall { c := &ProjectsLocationsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -4689,7 +6356,7 @@ func (c *ProjectsLocationsDataStoresUserEventsCollectCall) Do(opts ...googleapi. // "type": "string" // }, // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, @@ -4736,7 +6403,8 @@ type ProjectsLocationsDataStoresUserEventsImportCall struct { // ImportMetadata. // // - parent: Parent DataStore resource name, of the form -// `projects/{project}/locations/{location}/dataStores/{data_store}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. func (r *ProjectsLocationsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest) *ProjectsLocationsDataStoresUserEventsImportCall { c := &ProjectsLocationsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -4844,7 +6512,7 @@ func (c *ProjectsLocationsDataStoresUserEventsImportCall) Do(opts ...googleapi.C // ], // "parameters": { // "parent": { - // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/dataStores/{data_store}`", + // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, @@ -4879,7 +6547,8 @@ type ProjectsLocationsDataStoresUserEventsWriteCall struct { // Write: Writes a single user event. // // - parent: The parent DataStore resource name, such as -// `projects/{project}/locations/{location}/dataStores/{data_store}`. +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. func (r *ProjectsLocationsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent) *ProjectsLocationsDataStoresUserEventsWriteCall { c := &ProjectsLocationsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -4989,7 +6658,7 @@ func (c *ProjectsLocationsDataStoresUserEventsWriteCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}`.", + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, diff --git a/managedidentities/v1/managedidentities-api.json b/managedidentities/v1/managedidentities-api.json index 6e2fc2641c5..417ee608100 100644 --- a/managedidentities/v1/managedidentities-api.json +++ b/managedidentities/v1/managedidentities-api.json @@ -1403,7 +1403,7 @@ } } }, - "revision": "20221227", + "revision": "20230227", "rootUrl": "https://managedidentities.googleapis.com/", "schemas": { "AttachTrustRequest": { @@ -1496,7 +1496,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", "items": { "type": "string" }, @@ -1880,10 +1880,11 @@ "type": "object" }, "GoogleCloudSaasacceleratorManagementProvidersV1Instance": { + "description": "Instance represents the interface for SLM services to actuate the state of control plane resources. Example Instance in JSON, where consumer-project-number=123456, producer-project-id=cloud-sql: ```json Instance: { \"name\": \"projects/123456/locations/us-east1/instances/prod-instance\", \"create_time\": { \"seconds\": 1526406431, }, \"labels\": { \"env\": \"prod\", \"foo\": \"bar\" }, \"state\": READY, \"software_versions\": { \"software_update\": \"cloud-sql-09-28-2018\", }, \"maintenance_policy_names\": { \"UpdatePolicy\": \"projects/123456/locations/us-east1/maintenancePolicies/prod-update-policy\", } \"tenant_project_id\": \"cloud-sql-test-tenant\", \"producer_metadata\": { \"cloud-sql-tier\": \"basic\", \"cloud-sql-instance-size\": \"1G\", }, \"provisioned_resources\": [ { \"resource-type\": \"compute-instance\", \"resource-url\": \"https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-east1-b/instances/vm-1\", } ], \"maintenance_schedules\": { \"csa_rollout\": { \"start_time\": { \"seconds\": 1526406431, }, \"end_time\": { \"seconds\": 1535406431, }, }, \"ncsa_rollout\": { \"start_time\": { \"seconds\": 1526406431, }, \"end_time\": { \"seconds\": 1535406431, }, } }, \"consumer_defined_name\": \"my-sql-instance1\", } ``` LINT.IfChange", "id": "GoogleCloudSaasacceleratorManagementProvidersV1Instance", "properties": { "consumerDefinedName": { - "description": "consumer_defined_name is the name that is set by the consumer. On the other hand Name field represents system-assigned id of an instance so consumers are not necessarily aware of it. consumer_defined_name is used for notification/UI purposes for consumer to recognize their instances.", + "description": "consumer_defined_name is the name of the instance set by the service consumers. Generally this is different from the `name` field which reperesents the system-assigned id of the instance which the service consumers do not recognize. This is a required field for tenants onboarding to Maintenance Window notifications (go/slm-rollout-maintenance-policies#prerequisites).", "type": "string" }, "createTime": { @@ -1907,7 +1908,7 @@ "additionalProperties": { "type": "string" }, - "description": "Optional. Deprecated. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the referenced policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug.", + "description": "Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the referenced policy must define the same policy type. For details, please refer to go/cloud-saas-mw-ug. Should not be set if maintenance_settings.maintenance_policies is set.", "type": "object" }, "maintenanceSchedules": { @@ -2047,7 +2048,7 @@ "additionalProperties": { "$ref": "MaintenancePolicy" }, - "description": "Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the embedded policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug. If only the name is needed, then only populate MaintenancePolicy.name.", + "description": "Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the embedded policy must define the same policy type. For details, please refer to go/cloud-saas-mw-ug. Should not be set if maintenance_policy_names is set. If only the name is needed, then only populate MaintenancePolicy.name.", "type": "object" } }, diff --git a/managedidentities/v1/managedidentities-gen.go b/managedidentities/v1/managedidentities-gen.go index 68eee32681e..71466413aaf 100644 --- a/managedidentities/v1/managedidentities-gen.go +++ b/managedidentities/v1/managedidentities-gen.go @@ -354,7 +354,9 @@ type Binding struct { // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. * + // For example, `admins@example.com`. * `domain:{domain}`: The G Suite + // domain (primary) that represents all the users of that domain. For + // example, `google.com` or `example.com`. * // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus // unique identifier) representing a user that has been recently // deleted. For example, `alice@example.com?uid=123456789012345678901`. @@ -371,9 +373,7 @@ type Binding struct { // that has been recently deleted. For example, // `admins@example.com?uid=123456789012345678901`. If the group is // recovered, this value reverts to `group:{emailid}` and the recovered - // group retains the role in the binding. * `domain:{domain}`: The G - // Suite domain (primary) that represents all the users of that domain. - // For example, `google.com` or `example.com`. + // group retains the role in the binding. Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. @@ -954,12 +954,34 @@ func (s *GoogleCloudManagedidentitiesV1beta1OpMetadata) MarshalJSON() ([]byte, e return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudSaasacceleratorManagementProvidersV1Instance: Instance +// represents the interface for SLM services to actuate the state of +// control plane resources. Example Instance in JSON, where +// consumer-project-number=123456, producer-project-id=cloud-sql: +// ```json Instance: { "name": +// "projects/123456/locations/us-east1/instances/prod-instance", +// "create_time": { "seconds": 1526406431, }, "labels": { "env": "prod", +// "foo": "bar" }, "state": READY, "software_versions": { +// "software_update": "cloud-sql-09-28-2018", }, +// "maintenance_policy_names": { "UpdatePolicy": +// "projects/123456/locations/us-east1/maintenancePolicies/prod-update-po +// licy", } "tenant_project_id": "cloud-sql-test-tenant", +// "producer_metadata": { "cloud-sql-tier": "basic", +// "cloud-sql-instance-size": "1G", }, "provisioned_resources": [ { +// "resource-type": "compute-instance", "resource-url": +// "https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-eas +// t1-b/instances/vm-1", } ], "maintenance_schedules": { "csa_rollout": +// { "start_time": { "seconds": 1526406431, }, "end_time": { "seconds": +// 1535406431, }, }, "ncsa_rollout": { "start_time": { "seconds": +// 1526406431, }, "end_time": { "seconds": 1535406431, }, } }, +// "consumer_defined_name": "my-sql-instance1", } ``` LINT.IfChange type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct { - // ConsumerDefinedName: consumer_defined_name is the name that is set by - // the consumer. On the other hand Name field represents system-assigned - // id of an instance so consumers are not necessarily aware of it. - // consumer_defined_name is used for notification/UI purposes for - // consumer to recognize their instances. + // ConsumerDefinedName: consumer_defined_name is the name of the + // instance set by the service consumers. Generally this is different + // from the `name` field which reperesents the system-assigned id of the + // instance which the service consumers do not recognize. This is a + // required field for tenants onboarding to Maintenance Window + // notifications (go/slm-rollout-maintenance-policies#prerequisites). ConsumerDefinedName string `json:"consumerDefinedName,omitempty"` // CreateTime: Output only. Timestamp when the resource was created. @@ -979,11 +1001,12 @@ type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct { // value are arbitrary strings provided by the user. Labels map[string]string `json:"labels,omitempty"` - // MaintenancePolicyNames: Optional. Deprecated. The MaintenancePolicies - // that have been attached to the instance. The key must be of the type - // name of the oneof policy name defined in MaintenancePolicy, and the - // referenced policy must define the same policy type. For complete - // details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug. + // MaintenancePolicyNames: Optional. The MaintenancePolicies that have + // been attached to the instance. The key must be of the type name of + // the oneof policy name defined in MaintenancePolicy, and the + // referenced policy must define the same policy type. For details, + // please refer to go/cloud-saas-mw-ug. Should not be set if + // maintenance_settings.maintenance_policies is set. MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"` // MaintenanceSchedules: The MaintenanceSchedule contains the scheduling @@ -1150,9 +1173,10 @@ type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings struct { // MaintenancePolicies: Optional. The MaintenancePolicies that have been // attached to the instance. The key must be of the type name of the // oneof policy name defined in MaintenancePolicy, and the embedded - // policy must define the same policy type. For complete details of - // MaintenancePolicy, please refer to go/cloud-saas-mw-ug. If only the - // name is needed, then only populate MaintenancePolicy.name. + // policy must define the same policy type. For details, please refer to + // go/cloud-saas-mw-ug. Should not be set if maintenance_policy_names is + // set. If only the name is needed, then only populate + // MaintenancePolicy.name. MaintenancePolicies map[string]MaintenancePolicy `json:"maintenancePolicies,omitempty"` // ForceSendFields is a list of field names (e.g. "Exclude") to diff --git a/ml/v1/ml-api.json b/ml/v1/ml-api.json index 5d14126d231..4fa081f40a5 100644 --- a/ml/v1/ml-api.json +++ b/ml/v1/ml-api.json @@ -1486,7 +1486,7 @@ } } }, - "revision": "20230128", + "revision": "20230228", "rootUrl": "https://ml.googleapis.com/", "schemas": { "GoogleApi__HttpBody": { @@ -1822,7 +1822,8 @@ "TPU_V2", "TPU_V3", "TPU_V2_POD", - "TPU_V3_POD" + "TPU_V3_POD", + "TPU_V4_POD" ], "enumDescriptions": [ "Unspecified accelerator type. Default to no GPU.", @@ -1835,7 +1836,8 @@ "TPU v2.", "TPU v3.", "TPU v2 POD.", - "TPU v3 POD." + "TPU v3 POD.", + "TPU v4 POD." ], "type": "string" } @@ -1936,7 +1938,8 @@ "TPU_V2", "TPU_V3", "TPU_V2_POD", - "TPU_V3_POD" + "TPU_V3_POD", + "TPU_V4_POD" ], "enumDescriptions": [ "Unspecified accelerator type. Default to no GPU.", @@ -1949,7 +1952,8 @@ "TPU v2.", "TPU v3.", "TPU v2 POD.", - "TPU v3 POD." + "TPU v3 POD.", + "TPU v4 POD." ], "type": "string" }, diff --git a/ml/v1/ml-gen.go b/ml/v1/ml-gen.go index 50edeb74d88..2bbb466df99 100644 --- a/ml/v1/ml-gen.go +++ b/ml/v1/ml-gen.go @@ -897,6 +897,7 @@ type GoogleCloudMlV1__AcceleratorConfig struct { // "TPU_V3" - TPU v3. // "TPU_V2_POD" - TPU v2 POD. // "TPU_V3_POD" - TPU v3 POD. + // "TPU_V4_POD" - TPU v4 POD. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Count") to @@ -1109,6 +1110,7 @@ type GoogleCloudMlV1__Capability struct { // "TPU_V3" - TPU v3. // "TPU_V2_POD" - TPU v2 POD. // "TPU_V3_POD" - TPU v3 POD. + // "TPU_V4_POD" - TPU v4 POD. AvailableAccelerators []string `json:"availableAccelerators,omitempty"` // Possible values: diff --git a/networkservices/v1/networkservices-api.json b/networkservices/v1/networkservices-api.json index 78f32b790a5..50aae6ec635 100644 --- a/networkservices/v1/networkservices-api.json +++ b/networkservices/v1/networkservices-api.json @@ -1496,6 +1496,461 @@ } } }, + "multicastConsumerAssociations": { + "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastConsumerAssociations/{multicastConsumerAssociationsId}:getIamPolicy", + "httpMethod": "GET", + "id": "networkservices.projects.locations.multicastConsumerAssociations.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/[^/]+/multicastConsumerAssociations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+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": "v1/projects/{projectsId}/locations/{locationsId}/multicastConsumerAssociations/{multicastConsumerAssociationsId}:setIamPolicy", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastConsumerAssociations.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/[^/]+/multicastConsumerAssociations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastConsumerAssociations/{multicastConsumerAssociationsId}:testIamPermissions", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastConsumerAssociations.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastConsumerAssociations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "multicastDomainActivations": { + "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomainActivations/{multicastDomainActivationsId}:getIamPolicy", + "httpMethod": "GET", + "id": "networkservices.projects.locations.multicastDomainActivations.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/[^/]+/multicastDomainActivations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomainActivations/{multicastDomainActivationsId}:setIamPolicy", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastDomainActivations.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/[^/]+/multicastDomainActivations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomainActivations/{multicastDomainActivationsId}:testIamPermissions", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastDomainActivations.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastDomainActivations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "multicastDomains": { + "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomains/{multicastDomainsId}:getIamPolicy", + "httpMethod": "GET", + "id": "networkservices.projects.locations.multicastDomains.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/[^/]+/multicastDomains/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomains/{multicastDomainsId}:setIamPolicy", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastDomains.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/[^/]+/multicastDomains/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomains/{multicastDomainsId}:testIamPermissions", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastDomains.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastDomains/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "multicastGroupDefinitions": { + "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroupDefinitions/{multicastGroupDefinitionsId}:getIamPolicy", + "httpMethod": "GET", + "id": "networkservices.projects.locations.multicastGroupDefinitions.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/[^/]+/multicastGroupDefinitions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroupDefinitions/{multicastGroupDefinitionsId}:setIamPolicy", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastGroupDefinitions.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/[^/]+/multicastGroupDefinitions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroupDefinitions/{multicastGroupDefinitionsId}:testIamPermissions", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastGroupDefinitions.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastGroupDefinitions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "multicastGroups": { + "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroups/{multicastGroupsId}:getIamPolicy", + "httpMethod": "GET", + "id": "networkservices.projects.locations.multicastGroups.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/[^/]+/multicastGroups/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroups/{multicastGroupsId}:setIamPolicy", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastGroups.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/[^/]+/multicastGroups/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:setIamPolicy", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroups/{multicastGroupsId}:testIamPermissions", + "httpMethod": "POST", + "id": "networkservices.projects.locations.multicastGroups.testIamPermissions", + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastGroups/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "operations": { "methods": { "cancel": { @@ -2148,7 +2603,7 @@ } } }, - "revision": "20230213", + "revision": "20230227", "rootUrl": "https://networkservices.googleapis.com/", "schemas": { "AuditConfig": { diff --git a/networkservices/v1/networkservices-gen.go b/networkservices/v1/networkservices-gen.go index 71cdb2023b0..a41b36a59af 100644 --- a/networkservices/v1/networkservices-gen.go +++ b/networkservices/v1/networkservices-gen.go @@ -159,6 +159,11 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs.GrpcRoutes = NewProjectsLocationsGrpcRoutesService(s) rs.HttpRoutes = NewProjectsLocationsHttpRoutesService(s) rs.Meshes = NewProjectsLocationsMeshesService(s) + rs.MulticastConsumerAssociations = NewProjectsLocationsMulticastConsumerAssociationsService(s) + rs.MulticastDomainActivations = NewProjectsLocationsMulticastDomainActivationsService(s) + rs.MulticastDomains = NewProjectsLocationsMulticastDomainsService(s) + rs.MulticastGroupDefinitions = NewProjectsLocationsMulticastGroupDefinitionsService(s) + rs.MulticastGroups = NewProjectsLocationsMulticastGroupsService(s) rs.Operations = NewProjectsLocationsOperationsService(s) rs.ServiceBindings = NewProjectsLocationsServiceBindingsService(s) rs.TcpRoutes = NewProjectsLocationsTcpRoutesService(s) @@ -185,6 +190,16 @@ type ProjectsLocationsService struct { Meshes *ProjectsLocationsMeshesService + MulticastConsumerAssociations *ProjectsLocationsMulticastConsumerAssociationsService + + MulticastDomainActivations *ProjectsLocationsMulticastDomainActivationsService + + MulticastDomains *ProjectsLocationsMulticastDomainsService + + MulticastGroupDefinitions *ProjectsLocationsMulticastGroupDefinitionsService + + MulticastGroups *ProjectsLocationsMulticastGroupsService + Operations *ProjectsLocationsOperationsService ServiceBindings *ProjectsLocationsServiceBindingsService @@ -266,6 +281,51 @@ type ProjectsLocationsMeshesService struct { s *Service } +func NewProjectsLocationsMulticastConsumerAssociationsService(s *Service) *ProjectsLocationsMulticastConsumerAssociationsService { + rs := &ProjectsLocationsMulticastConsumerAssociationsService{s: s} + return rs +} + +type ProjectsLocationsMulticastConsumerAssociationsService struct { + s *Service +} + +func NewProjectsLocationsMulticastDomainActivationsService(s *Service) *ProjectsLocationsMulticastDomainActivationsService { + rs := &ProjectsLocationsMulticastDomainActivationsService{s: s} + return rs +} + +type ProjectsLocationsMulticastDomainActivationsService struct { + s *Service +} + +func NewProjectsLocationsMulticastDomainsService(s *Service) *ProjectsLocationsMulticastDomainsService { + rs := &ProjectsLocationsMulticastDomainsService{s: s} + return rs +} + +type ProjectsLocationsMulticastDomainsService struct { + s *Service +} + +func NewProjectsLocationsMulticastGroupDefinitionsService(s *Service) *ProjectsLocationsMulticastGroupDefinitionsService { + rs := &ProjectsLocationsMulticastGroupDefinitionsService{s: s} + return rs +} + +type ProjectsLocationsMulticastGroupDefinitionsService struct { + s *Service +} + +func NewProjectsLocationsMulticastGroupsService(s *Service) *ProjectsLocationsMulticastGroupsService { + rs := &ProjectsLocationsMulticastGroupsService{s: s} + return rs +} + +type ProjectsLocationsMulticastGroupsService struct { + s *Service +} + func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { rs := &ProjectsLocationsOperationsService{s: s} return rs @@ -10702,6 +10762,2366 @@ func (c *ProjectsLocationsMeshesTestIamPermissionsCall) Do(opts ...googleapi.Cal } +// method id "networkservices.projects.locations.multicastConsumerAssociations.getIamPolicy": + +type ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall 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 *ProjectsLocationsMulticastConsumerAssociationsService) GetIamPolicy(resource string) *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall { + c := &ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall{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 *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall { + 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 information. +func (c *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+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 "networkservices.projects.locations.multicastConsumerAssociations.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastConsumerAssociationsGetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastConsumerAssociations/{multicastConsumerAssociationsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "networkservices.projects.locations.multicastConsumerAssociations.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/[^/]+/multicastConsumerAssociations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastConsumerAssociations.setIamPolicy": + +type ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall 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 *ProjectsLocationsMulticastConsumerAssociationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall { + c := &ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall{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 information. +func (c *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "networkservices.projects.locations.multicastConsumerAssociations.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastConsumerAssociationsSetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastConsumerAssociations/{multicastConsumerAssociationsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastConsumerAssociations.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/[^/]+/multicastConsumerAssociations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastConsumerAssociations.testIamPermissions": + +type ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. If the resource does not exist, this will return +// an empty set of permissions, not a `NOT_FOUND` error. Note: This +// operation is designed to be used for building permission-aware UIs +// and command-line tools, not for authorization checking. This +// operation may "fail open" without warning. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsMulticastConsumerAssociationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall { + c := &ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + 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 "networkservices.projects.locations.multicastConsumerAssociations.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsMulticastConsumerAssociationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 + // { + // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastConsumerAssociations/{multicastConsumerAssociationsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastConsumerAssociations.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastConsumerAssociations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastDomainActivations.getIamPolicy": + +type ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall 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 *ProjectsLocationsMulticastDomainActivationsService) GetIamPolicy(resource string) *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall { + c := &ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall{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 *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall { + 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 information. +func (c *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+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 "networkservices.projects.locations.multicastDomainActivations.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastDomainActivationsGetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomainActivations/{multicastDomainActivationsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "networkservices.projects.locations.multicastDomainActivations.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/[^/]+/multicastDomainActivations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastDomainActivations.setIamPolicy": + +type ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall 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 *ProjectsLocationsMulticastDomainActivationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall { + c := &ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall{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 information. +func (c *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "networkservices.projects.locations.multicastDomainActivations.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastDomainActivationsSetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomainActivations/{multicastDomainActivationsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastDomainActivations.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/[^/]+/multicastDomainActivations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastDomainActivations.testIamPermissions": + +type ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. If the resource does not exist, this will return +// an empty set of permissions, not a `NOT_FOUND` error. Note: This +// operation is designed to be used for building permission-aware UIs +// and command-line tools, not for authorization checking. This +// operation may "fail open" without warning. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsMulticastDomainActivationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall { + c := &ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + 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 "networkservices.projects.locations.multicastDomainActivations.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsMulticastDomainActivationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 + // { + // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomainActivations/{multicastDomainActivationsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastDomainActivations.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastDomainActivations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastDomains.getIamPolicy": + +type ProjectsLocationsMulticastDomainsGetIamPolicyCall 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 *ProjectsLocationsMulticastDomainsService) GetIamPolicy(resource string) *ProjectsLocationsMulticastDomainsGetIamPolicyCall { + c := &ProjectsLocationsMulticastDomainsGetIamPolicyCall{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 *ProjectsLocationsMulticastDomainsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMulticastDomainsGetIamPolicyCall { + 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 information. +func (c *ProjectsLocationsMulticastDomainsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastDomainsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsMulticastDomainsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMulticastDomainsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastDomainsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastDomainsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastDomainsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastDomainsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+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 "networkservices.projects.locations.multicastDomains.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastDomainsGetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomains/{multicastDomainsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "networkservices.projects.locations.multicastDomains.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/[^/]+/multicastDomains/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastDomains.setIamPolicy": + +type ProjectsLocationsMulticastDomainsSetIamPolicyCall 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 *ProjectsLocationsMulticastDomainsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMulticastDomainsSetIamPolicyCall { + c := &ProjectsLocationsMulticastDomainsSetIamPolicyCall{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 information. +func (c *ProjectsLocationsMulticastDomainsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastDomainsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastDomainsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastDomainsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastDomainsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastDomainsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "networkservices.projects.locations.multicastDomains.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastDomainsSetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomains/{multicastDomainsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastDomains.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/[^/]+/multicastDomains/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastDomains.testIamPermissions": + +type ProjectsLocationsMulticastDomainsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. If the resource does not exist, this will return +// an empty set of permissions, not a `NOT_FOUND` error. Note: This +// operation is designed to be used for building permission-aware UIs +// and command-line tools, not for authorization checking. This +// operation may "fail open" without warning. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsMulticastDomainsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMulticastDomainsTestIamPermissionsCall { + c := &ProjectsLocationsMulticastDomainsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsMulticastDomainsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastDomainsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastDomainsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMulticastDomainsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastDomainsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastDomainsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + 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 "networkservices.projects.locations.multicastDomains.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsMulticastDomainsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 + // { + // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastDomains/{multicastDomainsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastDomains.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastDomains/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastGroupDefinitions.getIamPolicy": + +type ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall 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 *ProjectsLocationsMulticastGroupDefinitionsService) GetIamPolicy(resource string) *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall { + c := &ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall{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 *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall { + 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 information. +func (c *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+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 "networkservices.projects.locations.multicastGroupDefinitions.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastGroupDefinitionsGetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroupDefinitions/{multicastGroupDefinitionsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "networkservices.projects.locations.multicastGroupDefinitions.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/[^/]+/multicastGroupDefinitions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastGroupDefinitions.setIamPolicy": + +type ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall 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 *ProjectsLocationsMulticastGroupDefinitionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall { + c := &ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall{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 information. +func (c *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "networkservices.projects.locations.multicastGroupDefinitions.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastGroupDefinitionsSetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroupDefinitions/{multicastGroupDefinitionsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastGroupDefinitions.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/[^/]+/multicastGroupDefinitions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastGroupDefinitions.testIamPermissions": + +type ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. If the resource does not exist, this will return +// an empty set of permissions, not a `NOT_FOUND` error. Note: This +// operation is designed to be used for building permission-aware UIs +// and command-line tools, not for authorization checking. This +// operation may "fail open" without warning. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsMulticastGroupDefinitionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall { + c := &ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + 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 "networkservices.projects.locations.multicastGroupDefinitions.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsMulticastGroupDefinitionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 + // { + // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroupDefinitions/{multicastGroupDefinitionsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastGroupDefinitions.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastGroupDefinitions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastGroups.getIamPolicy": + +type ProjectsLocationsMulticastGroupsGetIamPolicyCall 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 *ProjectsLocationsMulticastGroupsService) GetIamPolicy(resource string) *ProjectsLocationsMulticastGroupsGetIamPolicyCall { + c := &ProjectsLocationsMulticastGroupsGetIamPolicyCall{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 *ProjectsLocationsMulticastGroupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMulticastGroupsGetIamPolicyCall { + 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 information. +func (c *ProjectsLocationsMulticastGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastGroupsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsMulticastGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMulticastGroupsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastGroupsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastGroupsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastGroupsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + 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/{+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 "networkservices.projects.locations.multicastGroups.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastGroupsGetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroups/{multicastGroupsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "networkservices.projects.locations.multicastGroups.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/[^/]+/multicastGroups/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastGroups.setIamPolicy": + +type ProjectsLocationsMulticastGroupsSetIamPolicyCall 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 *ProjectsLocationsMulticastGroupsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMulticastGroupsSetIamPolicyCall { + c := &ProjectsLocationsMulticastGroupsSetIamPolicyCall{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 information. +func (c *ProjectsLocationsMulticastGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastGroupsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastGroupsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMulticastGroupsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastGroupsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "networkservices.projects.locations.multicastGroups.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. 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 *ProjectsLocationsMulticastGroupsSetIamPolicyCall) 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 + // { + // "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": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroups/{multicastGroupsId}:setIamPolicy", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastGroups.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/[^/]+/multicastGroups/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "networkservices.projects.locations.multicastGroups.testIamPermissions": + +type ProjectsLocationsMulticastGroupsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. If the resource does not exist, this will return +// an empty set of permissions, not a `NOT_FOUND` error. Note: This +// operation is designed to be used for building permission-aware UIs +// and command-line tools, not for authorization checking. This +// operation may "fail open" without warning. +// +// - resource: REQUIRED: The resource for which the policy detail is +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. +func (r *ProjectsLocationsMulticastGroupsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMulticastGroupsTestIamPermissionsCall { + c := &ProjectsLocationsMulticastGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsMulticastGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMulticastGroupsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsMulticastGroupsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMulticastGroupsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsMulticastGroupsTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsMulticastGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + 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 "networkservices.projects.locations.multicastGroups.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.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 *ProjectsLocationsMulticastGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ + 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 + // { + // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/multicastGroups/{multicastGroupsId}:testIamPermissions", + // "httpMethod": "POST", + // "id": "networkservices.projects.locations.multicastGroups.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which the policy detail 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/[^/]+/multicastGroups/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "networkservices.projects.locations.operations.cancel": type ProjectsLocationsOperationsCancelCall struct { diff --git a/privateca/v1/privateca-api.json b/privateca/v1/privateca-api.json index 7ea555c2069..7b8eb76caaa 100644 --- a/privateca/v1/privateca-api.json +++ b/privateca/v1/privateca-api.json @@ -1595,7 +1595,7 @@ } } }, - "revision": "20230208", + "revision": "20230222", "rootUrl": "https://privateca.googleapis.com/", "schemas": { "AccessUrls": { @@ -1873,7 +1873,7 @@ "enumDescriptions": [ "Not specified.", "The default mode used in most cases. Indicates that the certificate's Subject and/or SubjectAltNames are specified in the certificate request. This mode requires the caller to have the `privateca.certificates.create` permission.", - "A mode reserved for special cases. Indicates that the certificate should have one or more SPIFFE SubjectAltNames set by the service based on the caller's identity. This mode will ignore any explicitly specified Subject and/or SubjectAltNames in the certificate request. This mode requires the caller to have the `privateca.certificates.createForSelf` permission." + "A mode reserved for special cases. Indicates that the certificate should have one SPIFFE SubjectAltNames set by the service based on the caller's identity. This mode will ignore any explicitly specified Subject and/or SubjectAltNames in the certificate request. This mode requires the caller to have the `privateca.certificates.createForSelf` permission." ], "type": "string" }, diff --git a/privateca/v1/privateca-gen.go b/privateca/v1/privateca-gen.go index b43534d000f..ee07e62e277 100644 --- a/privateca/v1/privateca-gen.go +++ b/privateca/v1/privateca-gen.go @@ -722,9 +722,9 @@ type Certificate struct { // certificate request. This mode requires the caller to have the // `privateca.certificates.create` permission. // "REFLECTED_SPIFFE" - A mode reserved for special cases. Indicates - // that the certificate should have one or more SPIFFE SubjectAltNames - // set by the service based on the caller's identity. This mode will - // ignore any explicitly specified Subject and/or SubjectAltNames in the + // that the certificate should have one SPIFFE SubjectAltNames set by + // the service based on the caller's identity. This mode will ignore any + // explicitly specified Subject and/or SubjectAltNames in the // certificate request. This mode requires the caller to have the // `privateca.certificates.createForSelf` permission. SubjectMode string `json:"subjectMode,omitempty"` diff --git a/publicca/v1alpha1/publicca-api.json b/publicca/v1alpha1/publicca-api.json new file mode 100644 index 00000000000..1d349465b50 --- /dev/null +++ b/publicca/v1alpha1/publicca-api.json @@ -0,0 +1,180 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "basePath": "", + "baseUrl": "https://publicca.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Public Certificate Authority", + "description": "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. ", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/public-certificate-authority/docs", + "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": "publicca:v1alpha1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://publicca.mtls.googleapis.com/", + "name": "publicca", + "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": { + "projects": { + "resources": { + "locations": { + "resources": { + "externalAccountKeys": { + "methods": { + "create": { + "description": "Creates a new ExternalAccountKey bound to the project.", + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/externalAccountKeys", + "httpMethod": "POST", + "id": "publicca.projects.locations.externalAccountKeys.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the \"global\" location is supported.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha1/{+parent}/externalAccountKeys", + "request": { + "$ref": "ExternalAccountKey" + }, + "response": { + "$ref": "ExternalAccountKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + }, + "revision": "20230227", + "rootUrl": "https://publicca.googleapis.com/", + "schemas": { + "ExternalAccountKey": { + "description": "A representation of an ExternalAccountKey used for [external account binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME.", + "id": "ExternalAccountKey", + "properties": { + "b64MacKey": { + "description": "Output only. Base64-URL-encoded HS256 key. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created", + "format": "byte", + "readOnly": true, + "type": "string" + }, + "keyId": { + "description": "Output only. Key ID. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Resource name. projects/{project}/locations/{location}/externalAccountKeys/{key_id}", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Public Certificate Authority API", + "version": "v1alpha1", + "version_module": true +} \ No newline at end of file diff --git a/publicca/v1alpha1/publicca-gen.go b/publicca/v1alpha1/publicca-gen.go new file mode 100644 index 00000000000..9ba89f53b5b --- /dev/null +++ b/publicca/v1alpha1/publicca-gen.go @@ -0,0 +1,360 @@ +// Copyright 2023 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 publicca provides access to the Public Certificate Authority API. +// +// For product documentation, see: https://cloud.google.com/public-certificate-authority/docs +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/publicca/v1alpha1" +// ... +// ctx := context.Background() +// publiccaService, err := publicca.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 +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// publiccaService, err := publicca.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// publiccaService, err := publicca.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package publicca // import "google.golang.org/api/publicca/v1alpha1" + +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 + +const apiId = "publicca:v1alpha1" +const apiName = "publicca" +const apiVersion = "v1alpha1" +const basePath = "https://publicca.googleapis.com/" +const mtlsBasePath = "https://publicca.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // See, edit, configure, and delete your Google Cloud data and see the + // email address for your Google Account. + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/cloud-platform", + ) + // 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.WithDefaultMTLSEndpoint(mtlsBasePath)) + 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.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Locations = NewProjectsLocationsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Locations *ProjectsLocationsService +} + +func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { + rs := &ProjectsLocationsService{s: s} + rs.ExternalAccountKeys = NewProjectsLocationsExternalAccountKeysService(s) + return rs +} + +type ProjectsLocationsService struct { + s *Service + + ExternalAccountKeys *ProjectsLocationsExternalAccountKeysService +} + +func NewProjectsLocationsExternalAccountKeysService(s *Service) *ProjectsLocationsExternalAccountKeysService { + rs := &ProjectsLocationsExternalAccountKeysService{s: s} + return rs +} + +type ProjectsLocationsExternalAccountKeysService struct { + s *Service +} + +// ExternalAccountKey: A representation of an ExternalAccountKey used +// for external account binding +// (https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME. +type ExternalAccountKey struct { + // B64MacKey: Output only. Base64-URL-encoded HS256 key. It is generated + // by the PublicCertificateAuthorityService when the ExternalAccountKey + // is created + B64MacKey string `json:"b64MacKey,omitempty"` + + // KeyId: Output only. Key ID. It is generated by the + // PublicCertificateAuthorityService when the ExternalAccountKey is + // created + KeyId string `json:"keyId,omitempty"` + + // Name: Output only. Resource name. + // projects/{project}/locations/{location}/externalAccountKeys/{key_id} + 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. "B64MacKey") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "B64MacKey") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ExternalAccountKey) MarshalJSON() ([]byte, error) { + type NoMethod ExternalAccountKey + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "publicca.projects.locations.externalAccountKeys.create": + +type ProjectsLocationsExternalAccountKeysCreateCall struct { + s *Service + parent string + externalaccountkey *ExternalAccountKey + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new ExternalAccountKey bound to the project. +// +// - parent: The parent resource where this external_account_key will be +// created. Format: projects/[project_id]/locations/[location]. At +// present only the "global" location is supported. +func (r *ProjectsLocationsExternalAccountKeysService) Create(parent string, externalaccountkey *ExternalAccountKey) *ProjectsLocationsExternalAccountKeysCreateCall { + c := &ProjectsLocationsExternalAccountKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.externalaccountkey = externalaccountkey + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsExternalAccountKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsExternalAccountKeysCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsExternalAccountKeysCreateCall) Context(ctx context.Context) *ProjectsLocationsExternalAccountKeysCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsExternalAccountKeysCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsExternalAccountKeysCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccountkey) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/externalAccountKeys") + 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 "publicca.projects.locations.externalAccountKeys.create" call. +// Exactly one of *ExternalAccountKey or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ExternalAccountKey.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 *ProjectsLocationsExternalAccountKeysCreateCall) Do(opts ...googleapi.CallOption) (*ExternalAccountKey, 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 := &ExternalAccountKey{ + 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 + // { + // "description": "Creates a new ExternalAccountKey bound to the project.", + // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/externalAccountKeys", + // "httpMethod": "POST", + // "id": "publicca.projects.locations.externalAccountKeys.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the \"global\" location is supported.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha1/{+parent}/externalAccountKeys", + // "request": { + // "$ref": "ExternalAccountKey" + // }, + // "response": { + // "$ref": "ExternalAccountKey" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/publicca/v1beta1/publicca-api.json b/publicca/v1beta1/publicca-api.json new file mode 100644 index 00000000000..87be06dd690 --- /dev/null +++ b/publicca/v1beta1/publicca-api.json @@ -0,0 +1,180 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "basePath": "", + "baseUrl": "https://publicca.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Public Certificate Authority", + "description": "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. ", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/public-certificate-authority/docs", + "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": "publicca:v1beta1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://publicca.mtls.googleapis.com/", + "name": "publicca", + "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": { + "projects": { + "resources": { + "locations": { + "resources": { + "externalAccountKeys": { + "methods": { + "create": { + "description": "Creates a new ExternalAccountKey bound to the project.", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/externalAccountKeys", + "httpMethod": "POST", + "id": "publicca.projects.locations.externalAccountKeys.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the \"global\" location is supported.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+parent}/externalAccountKeys", + "request": { + "$ref": "ExternalAccountKey" + }, + "response": { + "$ref": "ExternalAccountKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + }, + "revision": "20230227", + "rootUrl": "https://publicca.googleapis.com/", + "schemas": { + "ExternalAccountKey": { + "description": "A representation of an ExternalAccountKey used for [external account binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME.", + "id": "ExternalAccountKey", + "properties": { + "b64MacKey": { + "description": "Output only. Base64-URL-encoded HS256 key. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created", + "format": "byte", + "readOnly": true, + "type": "string" + }, + "keyId": { + "description": "Output only. Key ID. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Resource name. projects/{project}/locations/{location}/externalAccountKeys/{key_id}", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Public Certificate Authority API", + "version": "v1beta1", + "version_module": true +} \ No newline at end of file diff --git a/publicca/v1beta1/publicca-gen.go b/publicca/v1beta1/publicca-gen.go new file mode 100644 index 00000000000..0532750f2d7 --- /dev/null +++ b/publicca/v1beta1/publicca-gen.go @@ -0,0 +1,360 @@ +// Copyright 2023 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 publicca provides access to the Public Certificate Authority API. +// +// For product documentation, see: https://cloud.google.com/public-certificate-authority/docs +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/publicca/v1beta1" +// ... +// ctx := context.Background() +// publiccaService, err := publicca.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 +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// publiccaService, err := publicca.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// publiccaService, err := publicca.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package publicca // import "google.golang.org/api/publicca/v1beta1" + +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 + +const apiId = "publicca:v1beta1" +const apiName = "publicca" +const apiVersion = "v1beta1" +const basePath = "https://publicca.googleapis.com/" +const mtlsBasePath = "https://publicca.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // See, edit, configure, and delete your Google Cloud data and see the + // email address for your Google Account. + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/cloud-platform", + ) + // 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.WithDefaultMTLSEndpoint(mtlsBasePath)) + 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.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Locations = NewProjectsLocationsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Locations *ProjectsLocationsService +} + +func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { + rs := &ProjectsLocationsService{s: s} + rs.ExternalAccountKeys = NewProjectsLocationsExternalAccountKeysService(s) + return rs +} + +type ProjectsLocationsService struct { + s *Service + + ExternalAccountKeys *ProjectsLocationsExternalAccountKeysService +} + +func NewProjectsLocationsExternalAccountKeysService(s *Service) *ProjectsLocationsExternalAccountKeysService { + rs := &ProjectsLocationsExternalAccountKeysService{s: s} + return rs +} + +type ProjectsLocationsExternalAccountKeysService struct { + s *Service +} + +// ExternalAccountKey: A representation of an ExternalAccountKey used +// for external account binding +// (https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME. +type ExternalAccountKey struct { + // B64MacKey: Output only. Base64-URL-encoded HS256 key. It is generated + // by the PublicCertificateAuthorityService when the ExternalAccountKey + // is created + B64MacKey string `json:"b64MacKey,omitempty"` + + // KeyId: Output only. Key ID. It is generated by the + // PublicCertificateAuthorityService when the ExternalAccountKey is + // created + KeyId string `json:"keyId,omitempty"` + + // Name: Output only. Resource name. + // projects/{project}/locations/{location}/externalAccountKeys/{key_id} + 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. "B64MacKey") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "B64MacKey") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ExternalAccountKey) MarshalJSON() ([]byte, error) { + type NoMethod ExternalAccountKey + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "publicca.projects.locations.externalAccountKeys.create": + +type ProjectsLocationsExternalAccountKeysCreateCall struct { + s *Service + parent string + externalaccountkey *ExternalAccountKey + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new ExternalAccountKey bound to the project. +// +// - parent: The parent resource where this external_account_key will be +// created. Format: projects/[project_id]/locations/[location]. At +// present only the "global" location is supported. +func (r *ProjectsLocationsExternalAccountKeysService) Create(parent string, externalaccountkey *ExternalAccountKey) *ProjectsLocationsExternalAccountKeysCreateCall { + c := &ProjectsLocationsExternalAccountKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.externalaccountkey = externalaccountkey + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsExternalAccountKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsExternalAccountKeysCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsExternalAccountKeysCreateCall) Context(ctx context.Context) *ProjectsLocationsExternalAccountKeysCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsExternalAccountKeysCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsExternalAccountKeysCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalaccountkey) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/externalAccountKeys") + 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 "publicca.projects.locations.externalAccountKeys.create" call. +// Exactly one of *ExternalAccountKey or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ExternalAccountKey.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 *ProjectsLocationsExternalAccountKeysCreateCall) Do(opts ...googleapi.CallOption) (*ExternalAccountKey, 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 := &ExternalAccountKey{ + 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 + // { + // "description": "Creates a new ExternalAccountKey bound to the project.", + // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/externalAccountKeys", + // "httpMethod": "POST", + // "id": "publicca.projects.locations.externalAccountKeys.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the \"global\" location is supported.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+parent}/externalAccountKeys", + // "request": { + // "$ref": "ExternalAccountKey" + // }, + // "response": { + // "$ref": "ExternalAccountKey" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json index f8d47ed1455..40eda707ac8 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json @@ -542,7 +542,7 @@ } } }, - "revision": "20230215", + "revision": "20230301", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "AddTenantProjectRequest": { @@ -2189,6 +2189,10 @@ "Street View Org." ], "type": "string" + }, + "protoReferenceDocumentationUri": { + "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", + "type": "string" } }, "type": "object" diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go index e262d1ce381..94b95d1c8e2 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go @@ -3390,6 +3390,11 @@ type Publishing struct { // "STREET_VIEW" - Street View Org. Organization string `json:"organization,omitempty"` + // ProtoReferenceDocumentationUri: Optional link to proto reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rpc + ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json index 65cb01398d2..b26829e1fbb 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json @@ -500,7 +500,7 @@ } } }, - "revision": "20230215", + "revision": "20230301", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "Api": { @@ -2005,6 +2005,10 @@ "Street View Org." ], "type": "string" + }, + "protoReferenceDocumentationUri": { + "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", + "type": "string" } }, "type": "object" diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go index cc8229bd80c..a87857d37d1 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go @@ -3094,6 +3094,11 @@ type Publishing struct { // "STREET_VIEW" - Street View Org. Organization string `json:"organization,omitempty"` + // ProtoReferenceDocumentationUri: Optional link to proto reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rpc + ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceusage/v1/serviceusage-api.json b/serviceusage/v1/serviceusage-api.json index 34a419fa81f..a216486def9 100644 --- a/serviceusage/v1/serviceusage-api.json +++ b/serviceusage/v1/serviceusage-api.json @@ -426,7 +426,7 @@ } } }, - "revision": "20230215", + "revision": "20230301", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AdminQuotaPolicy": { @@ -2553,6 +2553,10 @@ "Street View Org." ], "type": "string" + }, + "protoReferenceDocumentationUri": { + "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", + "type": "string" } }, "type": "object" diff --git a/serviceusage/v1/serviceusage-gen.go b/serviceusage/v1/serviceusage-gen.go index 601f0fb6acd..0f1de576619 100644 --- a/serviceusage/v1/serviceusage-gen.go +++ b/serviceusage/v1/serviceusage-gen.go @@ -4097,6 +4097,11 @@ type Publishing struct { // "STREET_VIEW" - Street View Org. Organization string `json:"organization,omitempty"` + // ProtoReferenceDocumentationUri: Optional link to proto reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rpc + ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceusage/v1beta1/serviceusage-api.json b/serviceusage/v1beta1/serviceusage-api.json index c9525c8fc11..3cd270b3fa2 100644 --- a/serviceusage/v1beta1/serviceusage-api.json +++ b/serviceusage/v1beta1/serviceusage-api.json @@ -959,7 +959,7 @@ } } }, - "revision": "20230215", + "revision": "20230301", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AdminQuotaPolicy": { @@ -3257,6 +3257,10 @@ "Street View Org." ], "type": "string" + }, + "protoReferenceDocumentationUri": { + "description": "Optional link to proto reference documentation. Example: https://cloud.google.com/pubsub/lite/docs/reference/rpc", + "type": "string" } }, "type": "object" diff --git a/serviceusage/v1beta1/serviceusage-gen.go b/serviceusage/v1beta1/serviceusage-gen.go index bf849f76ba3..fac1ad65212 100644 --- a/serviceusage/v1beta1/serviceusage-gen.go +++ b/serviceusage/v1beta1/serviceusage-gen.go @@ -4427,6 +4427,11 @@ type Publishing struct { // "STREET_VIEW" - Street View Org. Organization string `json:"organization,omitempty"` + // ProtoReferenceDocumentationUri: Optional link to proto reference + // documentation. Example: + // https://cloud.google.com/pubsub/lite/docs/reference/rpc + ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApiShortName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/spanner/v1/spanner-api.json b/spanner/v1/spanner-api.json index e8024501bd6..f39fbe83fb9 100644 --- a/spanner/v1/spanner-api.json +++ b/spanner/v1/spanner-api.json @@ -2402,7 +2402,7 @@ } } }, - "revision": "20230216", + "revision": "20230301", "rootUrl": "https://spanner.googleapis.com/", "schemas": { "Backup": { @@ -2578,7 +2578,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.", "items": { "type": "string" }, diff --git a/spanner/v1/spanner-gen.go b/spanner/v1/spanner-gen.go index 6d3ecbd688f..bfd0c1d01ea 100644 --- a/spanner/v1/spanner-gen.go +++ b/spanner/v1/spanner-gen.go @@ -613,7 +613,9 @@ type Binding struct { // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. // * `group:{emailid}`: An email address that represents a Google group. - // For example, `admins@example.com`. * + // For example, `admins@example.com`. * `domain:{domain}`: The G Suite + // domain (primary) that represents all the users of that domain. For + // example, `google.com` or `example.com`. * // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus // unique identifier) representing a user that has been recently // deleted. For example, `alice@example.com?uid=123456789012345678901`. @@ -630,9 +632,7 @@ type Binding struct { // that has been recently deleted. For example, // `admins@example.com?uid=123456789012345678901`. If the group is // recovered, this value reverts to `group:{emailid}` and the recovered - // group retains the role in the binding. * `domain:{domain}`: The G - // Suite domain (primary) that represents all the users of that domain. - // For example, `google.com` or `example.com`. + // group retains the role in the binding. Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. diff --git a/sqladmin/v1/sqladmin-api.json b/sqladmin/v1/sqladmin-api.json index 45ce13d9209..008e9cb3f59 100644 --- a/sqladmin/v1/sqladmin-api.json +++ b/sqladmin/v1/sqladmin-api.json @@ -1921,7 +1921,7 @@ } } }, - "revision": "20230119", + "revision": "20230226", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -3907,6 +3907,50 @@ }, "type": "object" }, + "OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "OperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "cancelRequested": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "statusDetail": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "OperationsListResponse": { "description": "Operations list response.", "id": "OperationsListResponse", @@ -4908,6 +4952,6 @@ } }, "servicePath": "", - "title": "Cloud SQL Admin API", + "title": "sqladmin API (prod)", "version": "v1" } \ No newline at end of file diff --git a/sqladmin/v1/sqladmin-gen.go b/sqladmin/v1/sqladmin-gen.go index eb2f676b53b..8df2aff0d6f 100644 --- a/sqladmin/v1/sqladmin-gen.go +++ b/sqladmin/v1/sqladmin-gen.go @@ -4,7 +4,7 @@ // Code generated file. DO NOT EDIT. -// Package sqladmin provides access to the Cloud SQL Admin API. +// Package sqladmin provides access to the sqladmin API (prod). // // For product documentation, see: https://developers.google.com/cloud-sql/ // @@ -3199,6 +3199,58 @@ func (s *OperationErrors) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OperationMetadata: Represents the metadata of the long-running +// operation. +type OperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CancelRequested: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have been + // cancelled successfully have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + CancelRequested bool `json:"cancelRequested,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // StatusDetail: Output only. Human-readable status of the operation, if + // any. + StatusDetail string `json:"statusDetail,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ApiVersion") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod OperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // OperationsListResponse: Operations list response. type OperationsListResponse struct { // Items: List of operation resources. diff --git a/sqladmin/v1beta4/sqladmin-api.json b/sqladmin/v1beta4/sqladmin-api.json index 2d20abb9b82..9035902d710 100644 --- a/sqladmin/v1beta4/sqladmin-api.json +++ b/sqladmin/v1beta4/sqladmin-api.json @@ -1921,7 +1921,7 @@ } } }, - "revision": "20230119", + "revision": "20230226", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -3907,6 +3907,50 @@ }, "type": "object" }, + "OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "OperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "cancelRequested": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "statusDetail": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "OperationsListResponse": { "description": "Operations list response.", "id": "OperationsListResponse", @@ -4906,6 +4950,6 @@ } }, "servicePath": "", - "title": "Cloud SQL Admin API", + "title": "sqladmin API (prod)", "version": "v1beta4" } \ No newline at end of file diff --git a/sqladmin/v1beta4/sqladmin-gen.go b/sqladmin/v1beta4/sqladmin-gen.go index 76ef69bfd69..d5534b76543 100644 --- a/sqladmin/v1beta4/sqladmin-gen.go +++ b/sqladmin/v1beta4/sqladmin-gen.go @@ -4,7 +4,7 @@ // Code generated file. DO NOT EDIT. -// Package sqladmin provides access to the Cloud SQL Admin API. +// Package sqladmin provides access to the sqladmin API (prod). // // For product documentation, see: https://developers.google.com/cloud-sql/ // @@ -3199,6 +3199,58 @@ func (s *OperationErrors) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OperationMetadata: Represents the metadata of the long-running +// operation. +type OperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CancelRequested: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have been + // cancelled successfully have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + CancelRequested bool `json:"cancelRequested,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // StatusDetail: Output only. Human-readable status of the operation, if + // any. + StatusDetail string `json:"statusDetail,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ApiVersion") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod OperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // OperationsListResponse: Operations list response. type OperationsListResponse struct { // Items: List of operation resources.