From 59d5b9537b6b517b998339f538d198593533dbf8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 16 Jun 2022 06:24:23 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#1589) --- .../v2beta1/adexchangebuyer2-api.json | 4 +- .../v2beta1/adexchangebuyer2-gen.go | 19 +- admin/directory/v1/admin-api.json | 4 +- admin/directory/v1/admin-gen.go | 5 +- .../v1/authorizedbuyersmarketplace-api.json | 4 +- .../v1/authorizedbuyersmarketplace-gen.go | 18 +- cloudasset/v1/cloudasset-api.json | 4 +- cloudasset/v1/cloudasset-gen.go | 12 +- compute/v0.alpha/compute-api.json | 451 +++++- compute/v0.alpha/compute-gen.go | 1238 +++++++++++++++++ compute/v0.beta/compute-api.json | 47 +- compute/v0.beta/compute-gen.go | 58 + compute/v1/compute-api.json | 105 +- compute/v1/compute-gen.go | 136 +- ondemandscanning/v1/ondemandscanning-api.json | 22 +- ondemandscanning/v1/ondemandscanning-gen.go | 36 + .../v1beta1/ondemandscanning-api.json | 22 +- .../v1beta1/ondemandscanning-gen.go | 36 + retail/v2/retail-api.json | 68 +- retail/v2/retail-gen.go | 375 ++++- retail/v2alpha/retail-api.json | 64 +- retail/v2alpha/retail-gen.go | 363 ++++- retail/v2beta/retail-api.json | 64 +- retail/v2beta/retail-gen.go | 363 ++++- 24 files changed, 3431 insertions(+), 87 deletions(-) diff --git a/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json b/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json index 6638f357f2b..626668bc6af 100644 --- a/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json +++ b/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json @@ -1151,7 +1151,7 @@ ] }, "completeSetup": { - "description": "Update the given proposal to indicate that setup has been completed. This method is called by the buyer when the line items have been created on their end for a finalized proposal and all the required creatives have been uploaded using the creatives API. This call updates the `is_setup_completed` bit on the proposal and also notifies the seller. The server will advance the revision number of the most recent proposal.", + "description": "You can opt-in to manually update proposals to indicate that setup is complete. By default, proposal setup is automatically completed after their deals are finalized. Contact your Technical Account Manager to opt in. Buyers can call this method when the proposal has been finalized, and all the required creatives have been uploaded using the Creatives API. This call updates the `is_setup_completed` field on the deals in the proposal, and notifies the seller. The server then advances the revision number of the most recent proposal. To mark an individual deal as ready to serve, call `buyers.finalizedDeals.setReadyToServe` in the Marketplace API.", "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:completeSetup", "httpMethod": "POST", "id": "adexchangebuyer2.accounts.proposals.completeSetup", @@ -2568,7 +2568,7 @@ } } }, - "revision": "20220322", + "revision": "20220615", "rootUrl": "https://adexchangebuyer.googleapis.com/", "schemas": { "AbsoluteDateRange": { diff --git a/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go b/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go index af4f8b42028..c8cc35553d7 100644 --- a/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go +++ b/adexchangebuyer2/v2beta1/adexchangebuyer2-gen.go @@ -10473,13 +10473,16 @@ type AccountsProposalsCompleteSetupCall struct { header_ http.Header } -// CompleteSetup: Update the given proposal to indicate that setup has -// been completed. This method is called by the buyer when the line -// items have been created on their end for a finalized proposal and all -// the required creatives have been uploaded using the creatives API. -// This call updates the `is_setup_completed` bit on the proposal and -// also notifies the seller. The server will advance the revision number -// of the most recent proposal. +// CompleteSetup: You can opt-in to manually update proposals to +// indicate that setup is complete. By default, proposal setup is +// automatically completed after their deals are finalized. Contact your +// Technical Account Manager to opt in. Buyers can call this method when +// the proposal has been finalized, and all the required creatives have +// been uploaded using the Creatives API. This call updates the +// `is_setup_completed` field on the deals in the proposal, and notifies +// the seller. The server then advances the revision number of the most +// recent proposal. To mark an individual deal as ready to serve, call +// `buyers.finalizedDeals.setReadyToServe` in the Marketplace API. // // - accountId: Account ID of the buyer. // - proposalId: The ID of the proposal to mark as setup completed. @@ -10583,7 +10586,7 @@ func (c *AccountsProposalsCompleteSetupCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Update the given proposal to indicate that setup has been completed. This method is called by the buyer when the line items have been created on their end for a finalized proposal and all the required creatives have been uploaded using the creatives API. This call updates the `is_setup_completed` bit on the proposal and also notifies the seller. The server will advance the revision number of the most recent proposal.", + // "description": "You can opt-in to manually update proposals to indicate that setup is complete. By default, proposal setup is automatically completed after their deals are finalized. Contact your Technical Account Manager to opt in. Buyers can call this method when the proposal has been finalized, and all the required creatives have been uploaded using the Creatives API. This call updates the `is_setup_completed` field on the deals in the proposal, and notifies the seller. The server then advances the revision number of the most recent proposal. To mark an individual deal as ready to serve, call `buyers.finalizedDeals.setReadyToServe` in the Marketplace API.", // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:completeSetup", // "httpMethod": "POST", // "id": "adexchangebuyer2.accounts.proposals.completeSetup", diff --git a/admin/directory/v1/admin-api.json b/admin/directory/v1/admin-api.json index d0c339a3e82..78c8774fcd9 100644 --- a/admin/directory/v1/admin-api.json +++ b/admin/directory/v1/admin-api.json @@ -4407,7 +4407,7 @@ } } }, - "revision": "20220606", + "revision": "20220614", "rootUrl": "https://admin.googleapis.com/", "schemas": { "Alias": { @@ -6626,7 +6626,7 @@ "id": "RoleAssignment", "properties": { "assignedTo": { - "description": "The unique ID of the user this role is assigned to.", + "description": "The unique ID of the entity this role is assigned to—either the `user_id` of a user or the `uniqueId` of a service account, as defined in [Identity and Access Management (IAM)](https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts).", "type": "string" }, "etag": { diff --git a/admin/directory/v1/admin-gen.go b/admin/directory/v1/admin-gen.go index 622a3f63d10..8e62af3e049 100644 --- a/admin/directory/v1/admin-gen.go +++ b/admin/directory/v1/admin-gen.go @@ -4045,7 +4045,10 @@ func (s *RoleRolePrivileges) MarshalJSON() ([]byte, error) { // RoleAssignment: Defines an assignment of a role. type RoleAssignment struct { - // AssignedTo: The unique ID of the user this role is assigned to. + // AssignedTo: The unique ID of the entity this role is assigned + // to—either the `user_id` of a user or the `uniqueId` of a service + // account, as defined in Identity and Access Management (IAM) + // (https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts). AssignedTo string `json:"assignedTo,omitempty"` // Etag: ETag of the resource. diff --git a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json index 35e63641e23..aa28a7eeac7 100644 --- a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json +++ b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-api.json @@ -860,7 +860,7 @@ ] }, "setReadyToServe": { - "description": "Sets the given finalized deal as ready to serve. By default, deals are ready to serve as soon as they're finalized. A bidder can opt out of this feature by asking to be included in an allowlist. Once opted out, finalized deals belonging to the bidder and its child seats will not start serving until this method is called. This method is useful to the bidders who prefer to not receive bid requests before the creative is ready. This method only applies to programmatic guaranteed deals.", + "description": "Sets the given finalized deal as ready to serve. By default, deals are set as ready to serve as soon as they're finalized. If you want to opt out of the default behavior, and manually indicate that deals are ready to serve, ask your Technical Account Manager to add you to the allowlist. If you choose to use this method, finalized deals belonging to the bidder and its child seats don't start serving until after you call `setReadyToServe`, and after the deals become active. For example, you can use this method to delay receiving bid requests until your creative is ready. This method only applies to programmatic guaranteed deals.", "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}:setReadyToServe", "httpMethod": "POST", "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe", @@ -1307,7 +1307,7 @@ } } }, - "revision": "20220322", + "revision": "20220615", "rootUrl": "https://authorizedbuyersmarketplace.googleapis.com/", "schemas": { "AcceptProposalRequest": { diff --git a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go index d9b051b8197..9fd0fec18fe 100644 --- a/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go +++ b/authorizedbuyersmarketplace/v1/authorizedbuyersmarketplace-gen.go @@ -6759,13 +6759,15 @@ type BuyersFinalizedDealsSetReadyToServeCall struct { } // SetReadyToServe: Sets the given finalized deal as ready to serve. By -// default, deals are ready to serve as soon as they're finalized. A -// bidder can opt out of this feature by asking to be included in an -// allowlist. Once opted out, finalized deals belonging to the bidder -// and its child seats will not start serving until this method is -// called. This method is useful to the bidders who prefer to not -// receive bid requests before the creative is ready. This method only -// applies to programmatic guaranteed deals. +// default, deals are set as ready to serve as soon as they're +// finalized. If you want to opt out of the default behavior, and +// manually indicate that deals are ready to serve, ask your Technical +// Account Manager to add you to the allowlist. If you choose to use +// this method, finalized deals belonging to the bidder and its child +// seats don't start serving until after you call `setReadyToServe`, and +// after the deals become active. For example, you can use this method +// to delay receiving bid requests until your creative is ready. This +// method only applies to programmatic guaranteed deals. // // - deal: Format: `buyers/{accountId}/finalizedDeals/{dealId}`. func (r *BuyersFinalizedDealsService) SetReadyToServe(deal string, setreadytoserverequest *SetReadyToServeRequest) *BuyersFinalizedDealsSetReadyToServeCall { @@ -6866,7 +6868,7 @@ func (c *BuyersFinalizedDealsSetReadyToServeCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Sets the given finalized deal as ready to serve. By default, deals are ready to serve as soon as they're finalized. A bidder can opt out of this feature by asking to be included in an allowlist. Once opted out, finalized deals belonging to the bidder and its child seats will not start serving until this method is called. This method is useful to the bidders who prefer to not receive bid requests before the creative is ready. This method only applies to programmatic guaranteed deals.", + // "description": "Sets the given finalized deal as ready to serve. By default, deals are set as ready to serve as soon as they're finalized. If you want to opt out of the default behavior, and manually indicate that deals are ready to serve, ask your Technical Account Manager to add you to the allowlist. If you choose to use this method, finalized deals belonging to the bidder and its child seats don't start serving until after you call `setReadyToServe`, and after the deals become active. For example, you can use this method to delay receiving bid requests until your creative is ready. This method only applies to programmatic guaranteed deals.", // "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}:setReadyToServe", // "httpMethod": "POST", // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe", diff --git a/cloudasset/v1/cloudasset-api.json b/cloudasset/v1/cloudasset-api.json index 753da5fb210..f04180ea174 100644 --- a/cloudasset/v1/cloudasset-api.json +++ b/cloudasset/v1/cloudasset-api.json @@ -900,7 +900,7 @@ "type": "string" }, "query": { - "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Cloud resources that have a label \"env\". * `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key whose name contains the word \"key\". * `state:ACTIVE` to find Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", + "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Cloud resources that have a label \"env\". * `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key whose name contains the word \"key\". * `relationships:instance-group-1` to find Cloud resources that have relationships with \"instance-group-1\" in the related resource name. * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that have relationships of type \"INSTANCE_TO_INSTANCEGROUP\". * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find compute instances that have relationships with \"instance-group-1\" in the compute instance group resource name, for relationship type \"INSTANCE_TO_INSTANCEGROUP\". * `state:ACTIVE` to find Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", "location": "query", "type": "string" }, @@ -929,7 +929,7 @@ } } }, - "revision": "20220604", + "revision": "20220610", "rootUrl": "https://cloudasset.googleapis.com/", "schemas": { "AccessSelector": { diff --git a/cloudasset/v1/cloudasset-gen.go b/cloudasset/v1/cloudasset-gen.go index 3210e9b0cf9..a8514754031 100644 --- a/cloudasset/v1/cloudasset-gen.go +++ b/cloudasset/v1/cloudasset-gen.go @@ -9542,7 +9542,15 @@ func (c *V1SearchAllResourcesCall) PageToken(pageToken string) *V1SearchAllResou // a label "env" and its value is "prod". * `labels.env:*` to find Cloud // resources that have a label "env". * `kmsKey:key` to find Cloud // resources encrypted with a customer-managed encryption key whose name -// contains the word "key". * `state:ACTIVE` to find Cloud resources +// contains the word "key". * `relationships:instance-group-1` to find +// Cloud resources that have relationships with "instance-group-1" in +// the related resource name. * +// `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances +// that have relationships of type "INSTANCE_TO_INSTANCEGROUP". * +// `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find +// compute instances that have relationships with "instance-group-1" in +// the compute instance group resource name, for relationship type +// "INSTANCE_TO_INSTANCEGROUP". * `state:ACTIVE` to find Cloud resources // whose state contains "ACTIVE" as a word. * `NOT state:ACTIVE` to find // Cloud resources whose state doesn't contain "ACTIVE" as a word. * // `createTime<1609459200` to find Cloud resources that were created @@ -9711,7 +9719,7 @@ func (c *V1SearchAllResourcesCall) Do(opts ...googleapi.CallOption) (*SearchAllR // "type": "string" // }, // "query": { - // "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Cloud resources that have a label \"env\". * `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key whose name contains the word \"key\". * `state:ACTIVE` to find Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", + // "description": "Optional. The query statement. See [how to construct a query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for more information. If not specified or empty, it will search all the resources within the specified `scope`. Examples: * `name:Important` to find Cloud resources whose name contains \"Important\" as a word. * `name=Important` to find the Cloud resource whose name is exactly \"Important\". * `displayName:Impor*` to find Cloud resources whose display name contains \"Impor\" as a prefix of any word in the field. * `location:us-west*` to find Cloud resources whose location contains both \"us\" and \"west\" as prefixes. * `labels:prod` to find Cloud resources whose labels contain \"prod\" as a key or value. * `labels.env:prod` to find Cloud resources that have a label \"env\" and its value is \"prod\". * `labels.env:*` to find Cloud resources that have a label \"env\". * `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key whose name contains the word \"key\". * `relationships:instance-group-1` to find Cloud resources that have relationships with \"instance-group-1\" in the related resource name. * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that have relationships of type \"INSTANCE_TO_INSTANCEGROUP\". * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find compute instances that have relationships with \"instance-group-1\" in the compute instance group resource name, for relationship type \"INSTANCE_TO_INSTANCEGROUP\". * `state:ACTIVE` to find Cloud resources whose state contains \"ACTIVE\" as a word. * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain \"ACTIVE\" as a word. * `createTime\u003c1609459200` to find Cloud resources that were created before \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `updateTime\u003e1609459200` to find Cloud resources that were updated after \"2021-01-01 00:00:00 UTC\". 1609459200 is the epoch timestamp of \"2021-01-01 00:00:00 UTC\" in seconds. * `Important` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields. * `Impor*` to find Cloud resources that contain \"Impor\" as a prefix of any word in any of the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain \"Important\" as a word in any of the searchable fields and are also located in the \"us-west1\" region or the \"global\" location.", // "location": "query", // "type": "string" // }, diff --git a/compute/v0.alpha/compute-api.json b/compute/v0.alpha/compute-api.json index db68508408e..4f7c8d3b44d 100644 --- a/compute/v0.alpha/compute-api.json +++ b/compute/v0.alpha/compute-api.json @@ -8040,6 +8040,227 @@ } } }, + "instanceGroupManagerResizeRequests": { + "methods": { + "delete": { + "description": "Deletes the specified resize request.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + "httpMethod": "DELETE", + "id": "compute.instanceGroupManagerResizeRequests.delete", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "resizeRequest" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group. The name should conform to RFC1035 or be a resource ID.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "resizeRequest": { + "description": "The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID.", + "location": "path", + "required": true, + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "description": "Returns all of the details about the specified resize request.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + "httpMethod": "GET", + "id": "compute.instanceGroupManagerResizeRequests.get", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "resizeRequest" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group. Name should conform to RFC1035 or be a resource ID.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "resizeRequest": { + "description": "The name of the resize request. Name should conform to RFC1035 or be a resource ID.", + "location": "path", + "required": true, + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group and the resize request are located. Name should conform to RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + "response": { + "$ref": "InstanceGroupManagerResizeRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "description": "Creates a new resize request that starts provisioning VMs immediately or queues VM creation.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + "httpMethod": "POST", + "id": "compute.instanceGroupManagerResizeRequests.insert", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + "request": { + "$ref": "InstanceGroupManagerResizeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "description": "Retrieves a list of resize requests that are contained in the managed instance group.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + "httpMethod": "GET", + "id": "compute.instanceGroupManagerResizeRequests.list", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "parameters": { + "filter": { + "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`.", + "location": "query", + "type": "string" + }, + "instanceGroupManager": { + "description": "The name of the managed instance group. The name should conform to RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "maxResults": { + "default": "500", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "orderBy": { + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + "location": "query", + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "returnPartialSuccess": { + "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + "location": "query", + "type": "boolean" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + "response": { + "$ref": "InstanceGroupManagerResizeRequestsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "instanceGroupManagers": { "methods": { "abandonInstances": { @@ -38709,7 +38930,7 @@ } } }, - "revision": "20220531", + "revision": "20220607", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -50912,6 +51133,11 @@ "format": "int32", "type": "integer" }, + "creatingAtomically": { + "description": "[Output Only] The number of instances that the managed instance group will attempt to create atomically, in a batch mode. If the desired count of instances can not be created, entire batch will be deleted and the group will decrease its targetSize value accordingly.", + "format": "int32", + "type": "integer" + }, "creatingWithoutRetries": { "description": "[Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly.", "format": "int32", @@ -51297,6 +51523,214 @@ }, "type": "object" }, + "InstanceGroupManagerResizeRequest": { + "description": "InstanceGroupManagerResizeRequest represents a request to create a number of VMs: either immediately or by queuing the request for the specified time. This resize request is nested under InstanceGroupManager and the VMs created by this request are added to the owning InstanceGroupManager.", + "id": "InstanceGroupManagerResizeRequest", + "properties": { + "count": { + "description": "The count of instances to create as part of this resize request.", + "format": "int32", + "type": "integer" + }, + "creationTimestamp": { + "description": "[Output Only] The creation timestamp for this resize request in RFC3339 text format.", + "type": "string" + }, + "description": { + "description": "An optional description of this resource.", + "type": "string" + }, + "id": { + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64", + "type": "string" + }, + "kind": { + "default": "compute#instanceGroupManagerResizeRequest", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests.", + "type": "string" + }, + "name": { + "annotations": { + "required": [ + "compute.instanceGroupManagerResizeRequests.insert" + ] + }, + "description": "The name of this resize request. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "type": "string" + }, + "queuingPolicy": { + "$ref": "QueuingPolicy", + "description": "When set, defines queing parameters for the requested deferred capacity. When unset, the request starts provisioning immediately, or fails if immediate provisioning is not possible." + }, + "selfLink": { + "description": "[Output Only] The URL for this resize request. The server defines this URL.", + "type": "string" + }, + "selfLinkWithId": { + "description": "[Output Only] Server-defined URL for this resource with the resource id.", + "type": "string" + }, + "state": { + "description": "[Output only] Current state of the request.", + "enum": [ + "ACCEPTED", + "CREATING", + "DELETING", + "FAILED", + "PROVISIONING", + "SUCCEEDED" + ], + "enumDescriptions": [ + "The request was created successfully and was accepted for provisioning when the capacity becomes available.", + "resize request is being created and may still fail creation.", + "The request is being deleted.", + "The request failed before or during provisioning. If the request fails during provisioning, any VMs that were created during provisioning are rolled back and removed from the MIG.", + "The target resource(s) are being provisioned.", + "The request succeeded." + ], + "type": "string" + }, + "status": { + "$ref": "InstanceGroupManagerResizeRequestStatus", + "description": "[Output only] Status of the request. The Status message is aligned with QueuedResource.status. ResizeRequest.queuing_policy contains the queuing policy as provided by the user; it could have either valid_until_time or valid_until_duration. ResizeRequest.status.queuing_policy always contains absolute time as calculated by the server when the request is queued." + }, + "zone": { + "description": "[Output Only] The URL of a zone where the resize request is located.", + "type": "string" + } + }, + "type": "object" + }, + "InstanceGroupManagerResizeRequestStatus": { + "id": "InstanceGroupManagerResizeRequestStatus", + "properties": { + "queuingPolicy": { + "$ref": "QueuingPolicy", + "description": "Constraints for the time when the instances start provisioning. Always exposed as absolute time." + } + }, + "type": "object" + }, + "InstanceGroupManagerResizeRequestsListResponse": { + "description": "[Output Only] A list of resize requests.", + "id": "InstanceGroupManagerResizeRequestsListResponse", + "properties": { + "id": { + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { + "description": "A list of resize request resources.", + "items": { + "$ref": "InstanceGroupManagerResizeRequest" + }, + "type": "array" + }, + "kind": { + "default": "compute#instanceGroupManagerResizeRequestList", + "description": "[Output Only] Type of the resource. Always compute#instanceGroupManagerResizeRequestList for a list of resize requests.", + "type": "string" + }, + "nextPageToken": { + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] Server-defined URL for this resource.", + "type": "string" + }, + "warning": { + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "LARGE_DEPLOYMENT_WARNING", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "When deploying a deployment with a exceedingly large number of resources", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, "InstanceGroupManagerStandbyPolicy": { "id": "InstanceGroupManagerStandbyPolicy", "properties": { @@ -63704,6 +64138,21 @@ }, "type": "object" }, + "QueuingPolicy": { + "description": "Queuing parameters for the requested deferred capacity.", + "id": "QueuingPolicy", + "properties": { + "validUntilDuration": { + "$ref": "Duration", + "description": "Relative deadline for waiting for capacity." + }, + "validUntilTime": { + "description": "Absolute deadline for waiting for capacity in RFC3339 text format.", + "type": "string" + } + }, + "type": "object" + }, "Quota": { "description": "A quotas entry.", "id": "Quota", diff --git a/compute/v0.alpha/compute-gen.go b/compute/v0.alpha/compute-gen.go index 18623618ca7..7673c824225 100644 --- a/compute/v0.alpha/compute-gen.go +++ b/compute/v0.alpha/compute-gen.go @@ -167,6 +167,7 @@ func New(client *http.Client) (*Service, error) { s.HttpsHealthChecks = NewHttpsHealthChecksService(s) s.ImageFamilyViews = NewImageFamilyViewsService(s) s.Images = NewImagesService(s) + s.InstanceGroupManagerResizeRequests = NewInstanceGroupManagerResizeRequestsService(s) s.InstanceGroupManagers = NewInstanceGroupManagersService(s) s.InstanceGroups = NewInstanceGroupsService(s) s.InstanceTemplates = NewInstanceTemplatesService(s) @@ -292,6 +293,8 @@ type Service struct { Images *ImagesService + InstanceGroupManagerResizeRequests *InstanceGroupManagerResizeRequestsService + InstanceGroupManagers *InstanceGroupManagersService InstanceGroups *InstanceGroupsService @@ -649,6 +652,15 @@ type ImagesService struct { s *Service } +func NewInstanceGroupManagerResizeRequestsService(s *Service) *InstanceGroupManagerResizeRequestsService { + rs := &InstanceGroupManagerResizeRequestsService{s: s} + return rs +} + +type InstanceGroupManagerResizeRequestsService struct { + s *Service +} + func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService { rs := &InstanceGroupManagersService{s: s} return rs @@ -20450,6 +20462,13 @@ type InstanceGroupManagerActionsSummary struct { // instead, the creatingWithoutRetries field will be populated. Creating int64 `json:"creating,omitempty"` + // CreatingAtomically: [Output Only] The number of instances that the + // managed instance group will attempt to create atomically, in a batch + // mode. If the desired count of instances can not be created, entire + // batch will be deleted and the group will decrease its targetSize + // value accordingly. + CreatingAtomically int64 `json:"creatingAtomically,omitempty"` + // CreatingWithoutRetries: [Output Only] The number of instances that // the managed instance group will attempt to create. The group attempts // to create each instance only once. If the group fails to create any @@ -21121,6 +21140,319 @@ func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// InstanceGroupManagerResizeRequest: InstanceGroupManagerResizeRequest +// represents a request to create a number of VMs: either immediately or +// by queuing the request for the specified time. This resize request is +// nested under InstanceGroupManager and the VMs created by this request +// are added to the owning InstanceGroupManager. +type InstanceGroupManagerResizeRequest struct { + // Count: The count of instances to create as part of this resize + // request. + Count int64 `json:"count,omitempty"` + + // CreationTimestamp: [Output Only] The creation timestamp for this + // resize request in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional description of this resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerResizeRequest for resize requests. + Kind string `json:"kind,omitempty"` + + // Name: The name of this resize request. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // QueuingPolicy: When set, defines queing parameters for the requested + // deferred capacity. When unset, the request starts provisioning + // immediately, or fails if immediate provisioning is not possible. + QueuingPolicy *QueuingPolicy `json:"queuingPolicy,omitempty"` + + // SelfLink: [Output Only] The URL for this resize request. The server + // defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // SelfLinkWithId: [Output Only] Server-defined URL for this resource + // with the resource id. + SelfLinkWithId string `json:"selfLinkWithId,omitempty"` + + // State: [Output only] Current state of the request. + // + // Possible values: + // "ACCEPTED" - The request was created successfully and was accepted + // for provisioning when the capacity becomes available. + // "CREATING" - resize request is being created and may still fail + // creation. + // "DELETING" - The request is being deleted. + // "FAILED" - The request failed before or during provisioning. If the + // request fails during provisioning, any VMs that were created during + // provisioning are rolled back and removed from the MIG. + // "PROVISIONING" - The target resource(s) are being provisioned. + // "SUCCEEDED" - The request succeeded. + State string `json:"state,omitempty"` + + // Status: [Output only] Status of the request. The Status message is + // aligned with QueuedResource.status. ResizeRequest.queuing_policy + // contains the queuing policy as provided by the user; it could have + // either valid_until_time or valid_until_duration. + // ResizeRequest.status.queuing_policy always contains absolute time as + // calculated by the server when the request is queued. + Status *InstanceGroupManagerResizeRequestStatus `json:"status,omitempty"` + + // Zone: [Output Only] The URL of a zone where the resize request is + // located. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "Count") 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 *InstanceGroupManagerResizeRequest) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagerResizeRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type InstanceGroupManagerResizeRequestStatus struct { + // QueuingPolicy: Constraints for the time when the instances start + // provisioning. Always exposed as absolute time. + QueuingPolicy *QueuingPolicy `json:"queuingPolicy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "QueuingPolicy") 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. "QueuingPolicy") 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 *InstanceGroupManagerResizeRequestStatus) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagerResizeRequestStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// InstanceGroupManagerResizeRequestsListResponse: [Output Only] A list +// of resize requests. +type InstanceGroupManagerResizeRequestsListResponse struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of resize request resources. + Items []*InstanceGroupManagerResizeRequest `json:"items,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // compute#instanceGroupManagerResizeRequestList for a list of resize + // requests. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] This token allows you to get the next + // page of results for list requests. If the number of results is larger + // than maxResults, use the nextPageToken as a value for the query + // parameter pageToken in the next list request. Subsequent list + // requests will have their own nextPageToken to continue paging through + // the results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Warning: [Output Only] Informational warning message. + Warning *InstanceGroupManagerResizeRequestsListResponseWarning `json:"warning,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *InstanceGroupManagerResizeRequestsListResponse) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagerResizeRequestsListResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// InstanceGroupManagerResizeRequestsListResponseWarning: [Output Only] +// Informational warning message. +type InstanceGroupManagerResizeRequestsListResponseWarning struct { + // Code: [Output Only] A warning code, if applicable. For example, + // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in + // the response. + // + // Possible values: + // "CLEANUP_FAILED" - Warning about failed cleanup of transient + // changes made by a failed operation. + // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was + // created. + // "DEPRECATED_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as deprecated + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk + // that is larger than image size. + // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as experimental + // "EXTERNAL_API_WARNING" - Warning that is present in an external api + // call + // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been + // overridden. Deprecated unused field. + // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an + // injected kernel, which is deprecated. + // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a + // exceedingly large number of resources + // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is + // not assigned to an instance on the network. + // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot + // ip forward. + // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's + // nextHopInstance URL refers to an instance that does not have an ipv6 + // interface on the same network as the route. + // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL + // refers to an instance that does not exist. + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance + // URL refers to an instance that is not on the same network as the + // route. + // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not + // have a status of RUNNING. + // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to + // continue the process despite the mentioned error. + // "NO_RESULTS_ON_PAGE" - No results are present on a particular list + // page. + // "PARTIAL_SUCCESS" - Success is reported, but some results may be + // missing due to errors + // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource + // that requires a TOS they have not accepted. + // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a + // resource is in use. + // "RESOURCE_NOT_DELETED" - One or more of the resources set to + // auto-delete could not be deleted because they were in use. + // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is + // ignored. + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in + // instance group manager is valid as such, but its application does not + // make a lot of sense, because it allows only single instance in + // instance group. + // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema + // are present + // "UNREACHABLE" - A given scope cannot be reached. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata about this warning in key: value format. + // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" + // } + Data []*InstanceGroupManagerResizeRequestsListResponseWarningData `json:"data,omitempty"` + + // Message: [Output Only] A human-readable description of the warning + // code. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "Code") 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 *InstanceGroupManagerResizeRequestsListResponseWarning) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagerResizeRequestsListResponseWarning + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type InstanceGroupManagerResizeRequestsListResponseWarningData struct { + // Key: [Output Only] A key that provides more detail on the warning + // being returned. For example, for warnings where there are no results + // in a list request for a particular zone, this key might be scope and + // the key value might be the zone name. Other examples might be a key + // indicating a deprecated resource and a suggested replacement, or a + // warning about invalid network settings (for example, if an instance + // attempts to perform IP forwarding but is not enabled for IP + // forwarding). + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *InstanceGroupManagerResizeRequestsListResponseWarningData) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagerResizeRequestsListResponseWarningData + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + type InstanceGroupManagerStandbyPolicy struct { InitialDelaySec int64 `json:"initialDelaySec,omitempty"` @@ -40758,6 +41090,40 @@ func (s *PublicDelegatedPrefixesScopedListWarningData) MarshalJSON() ([]byte, er return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// QueuingPolicy: Queuing parameters for the requested deferred +// capacity. +type QueuingPolicy struct { + // ValidUntilDuration: Relative deadline for waiting for capacity. + ValidUntilDuration *Duration `json:"validUntilDuration,omitempty"` + + // ValidUntilTime: Absolute deadline for waiting for capacity in RFC3339 + // text format. + ValidUntilTime string `json:"validUntilTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ValidUntilDuration") + // 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. "ValidUntilDuration") 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 *QueuingPolicy) MarshalJSON() ([]byte, error) { + type NoMethod QueuingPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Quota: A quotas entry. type Quota struct { // Limit: [Output Only] Quota limit for this metric. @@ -98964,6 +99330,878 @@ func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPe } +// method id "compute.instanceGroupManagerResizeRequests.delete": + +type InstanceGroupManagerResizeRequestsDeleteCall struct { + s *Service + project string + zone string + instanceGroupManager string + resizeRequest string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified resize request. +// +// - instanceGroupManager: The name of the managed instance group. The +// name should conform to RFC1035 or be a resource ID. +// - project: Project ID for this request. +// - resizeRequest: The name of the resize request to delete. The name +// should conform to RFC1035 or be a resource ID. +// - zone: The name of the zone where the managed instance group is +// located. The name should conform to RFC1035. +func (r *InstanceGroupManagerResizeRequestsService) Delete(project string, zone string, instanceGroupManager string, resizeRequest string) *InstanceGroupManagerResizeRequestsDeleteCall { + c := &InstanceGroupManagerResizeRequestsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.resizeRequest = resizeRequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupManagerResizeRequestsDeleteCall) RequestId(requestId string) *InstanceGroupManagerResizeRequestsDeleteCall { + c.urlParams_.Set("requestId", requestId) + 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 *InstanceGroupManagerResizeRequestsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsDeleteCall { + 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 *InstanceGroupManagerResizeRequestsDeleteCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsDeleteCall { + 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 *InstanceGroupManagerResizeRequestsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstanceGroupManagerResizeRequestsDeleteCall) 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") + 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{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + "resizeRequest": c.resizeRequest, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instanceGroupManagerResizeRequests.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagerResizeRequestsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified resize request.", + // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroupManagerResizeRequests.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager", + // "resizeRequest" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group. The name should conform to RFC1035 or be a resource ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // }, + // "resizeRequest": { + // "description": "The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagerResizeRequests.get": + +type InstanceGroupManagerResizeRequestsGetCall struct { + s *Service + project string + zone string + instanceGroupManager string + resizeRequest string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns all of the details about the specified resize request. +// +// - instanceGroupManager: The name of the managed instance group. Name +// should conform to RFC1035 or be a resource ID. +// - project: Project ID for this request. +// - resizeRequest: The name of the resize request. Name should conform +// to RFC1035 or be a resource ID. +// - zone: The name of the zone where the managed instance group and the +// resize request are located. Name should conform to RFC1035. +func (r *InstanceGroupManagerResizeRequestsService) Get(project string, zone string, instanceGroupManager string, resizeRequest string) *InstanceGroupManagerResizeRequestsGetCall { + c := &InstanceGroupManagerResizeRequestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.resizeRequest = resizeRequest + 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 *InstanceGroupManagerResizeRequestsGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsGetCall { + 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 *InstanceGroupManagerResizeRequestsGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagerResizeRequestsGetCall { + 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 *InstanceGroupManagerResizeRequestsGetCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsGetCall { + 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 *InstanceGroupManagerResizeRequestsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstanceGroupManagerResizeRequestsGetCall) 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}") + 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{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + "resizeRequest": c.resizeRequest, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instanceGroupManagerResizeRequests.get" call. +// Exactly one of *InstanceGroupManagerResizeRequest or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstanceGroupManagerResizeRequest.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 *InstanceGroupManagerResizeRequestsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerResizeRequest, 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, &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, err + } + ret := &InstanceGroupManagerResizeRequest{ + 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 all of the details about the specified resize request.", + // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagerResizeRequests.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager", + // "resizeRequest" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group. Name should conform to RFC1035 or be a resource ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resizeRequest": { + // "description": "The name of the resize request. Name should conform to RFC1035 or be a resource ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group and the resize request are located. Name should conform to RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}", + // "response": { + // "$ref": "InstanceGroupManagerResizeRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagerResizeRequests.insert": + +type InstanceGroupManagerResizeRequestsInsertCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerresizerequest *InstanceGroupManagerResizeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates a new resize request that starts provisioning VMs +// immediately or queues VM creation. +// +// - instanceGroupManager: The name of the managed instance group to +// which the resize request will be added. Name should conform to +// RFC1035 or be a resource ID. +// - project: Project ID for this request. +// - zone: The name of the zone where the managed instance group is +// located and where the resize request will be created. Name should +// conform to RFC1035. +func (r *InstanceGroupManagerResizeRequestsService) Insert(project string, zone string, instanceGroupManager string, instancegroupmanagerresizerequest *InstanceGroupManagerResizeRequest) *InstanceGroupManagerResizeRequestsInsertCall { + c := &InstanceGroupManagerResizeRequestsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerresizerequest = instancegroupmanagerresizerequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupManagerResizeRequestsInsertCall) RequestId(requestId string) *InstanceGroupManagerResizeRequestsInsertCall { + c.urlParams_.Set("requestId", requestId) + 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 *InstanceGroupManagerResizeRequestsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsInsertCall { + 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 *InstanceGroupManagerResizeRequestsInsertCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsInsertCall { + 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 *InstanceGroupManagerResizeRequestsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstanceGroupManagerResizeRequestsInsertCall) 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.instancegroupmanagerresizerequest) + 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") + 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{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instanceGroupManagerResizeRequests.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagerResizeRequestsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new resize request that starts provisioning VMs immediately or queues VM creation.", + // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagerResizeRequests.insert", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + // "request": { + // "$ref": "InstanceGroupManagerResizeRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagerResizeRequests.list": + +type InstanceGroupManagerResizeRequestsListCall struct { + s *Service + project string + zone string + instanceGroupManager string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves a list of resize requests that are contained in the +// managed instance group. +// +// - instanceGroupManager: The name of the managed instance group. The +// name should conform to RFC1035. +// - project: Project ID for this request. +// - zone: The name of the zone where the managed instance group is +// located. The name should conform to RFC1035. +func (r *InstanceGroupManagerResizeRequestsService) List(project string, zone string, instanceGroupManager string) *InstanceGroupManagerResizeRequestsListCall { + c := &InstanceGroupManagerResizeRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources +// support two types of filter expressions: expressions that support +// regular expressions and expressions that follow API improvement +// proposal AIP-160. If you want to use AIP-160, your expression must +// specify the field name, an operator, and the value that you want to +// use for filtering. The value must be a string, a number, or a +// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` +// or `:`. For example, if you are filtering Compute Engine instances, +// you can exclude instances named `example-instance` by specifying +// `name != example-instance`. The `:` operator can be used with string +// fields to match substrings. For non-string fields it is equivalent to +// the `=` operator. The `:*` comparison can be used to test whether a +// key has been defined. For example, to find all objects with `owner` +// label use: ``` labels.owner:* ``` You can also filter nested fields. +// For example, you could specify `scheduling.automaticRestart = false` +// to include instances only if they are not scheduled for automatic +// restarts. You can use filtering on nested fields to filter based on +// resource labels. To filter on multiple expressions, provide each +// separate expression within parentheses. For example: ``` +// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") +// ``` By default, each expression is an `AND` expression. However, you +// can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") +// AND (scheduling.automaticRestart = true) ``` If you want to use a +// regular expression, use the `eq` (equal) or `ne` (not equal) operator +// against a single un-parenthesized expression with or without quotes +// or against multiple parenthesized expressions. Examples: `fieldname +// eq unquoted literal` `fieldname eq 'single quoted literal'` +// `fieldname eq "double quoted literal" `(fieldname1 eq literal) +// (fieldname2 ne "literal")` The literal value is interpreted as a +// regular expression using Google RE2 library syntax. The literal value +// must match the entire field. For example, to filter for instances +// that do not end with name "instance", you would use `name ne +// .*instance`. +func (c *InstanceGroupManagerResizeRequestsListCall) Filter(filter string) *InstanceGroupManagerResizeRequestsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results per page that should be returned. If the number of +// available results is larger than `maxResults`, Compute Engine returns +// a `nextPageToken` that can be used to get the next page of results in +// subsequent list requests. Acceptable values are `0` to `500`, +// inclusive. (Default: `500`) +func (c *InstanceGroupManagerResizeRequestsListCall) MaxResults(maxResults int64) *InstanceGroupManagerResizeRequestsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. You can also sort results in +// descending order based on the creation timestamp using +// `orderBy="creationTimestamp desc". This sorts results based on the +// `creationTimestamp` field in reverse chronological order (newest +// result first). Use this to sort resources like operations so that the +// newest operation is returned first. Currently, only sorting by `name` +// or `creationTimestamp desc` is supported. +func (c *InstanceGroupManagerResizeRequestsListCall) OrderBy(orderBy string) *InstanceGroupManagerResizeRequestsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Set `pageToken` to the `nextPageToken` returned by a +// previous list request to get the next page of results. +func (c *InstanceGroupManagerResizeRequestsListCall) PageToken(pageToken string) *InstanceGroupManagerResizeRequestsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter +// "returnPartialSuccess": Opt-in for partial success behavior which +// provides partial results in case of failure. The default value is +// false. +func (c *InstanceGroupManagerResizeRequestsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagerResizeRequestsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + 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 *InstanceGroupManagerResizeRequestsListCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsListCall { + 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 *InstanceGroupManagerResizeRequestsListCall) IfNoneMatch(entityTag string) *InstanceGroupManagerResizeRequestsListCall { + 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 *InstanceGroupManagerResizeRequestsListCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsListCall { + 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 *InstanceGroupManagerResizeRequestsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstanceGroupManagerResizeRequestsListCall) 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests") + 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{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instanceGroupManagerResizeRequests.list" call. +// Exactly one of *InstanceGroupManagerResizeRequestsListResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *InstanceGroupManagerResizeRequestsListResponse.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 *InstanceGroupManagerResizeRequestsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerResizeRequestsListResponse, 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, &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, err + } + ret := &InstanceGroupManagerResizeRequestsListResponse{ + 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": "Retrieves a list of resize requests that are contained in the managed instance group.", + // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagerResizeRequests.list", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "filter": { + // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`.", + // "location": "query", + // "type": "string" + // }, + // "instanceGroupManager": { + // "description": "The name of the managed instance group. The name should conform to RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "returnPartialSuccess": { + // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + // "location": "query", + // "type": "boolean" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests", + // "response": { + // "$ref": "InstanceGroupManagerResizeRequestsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// 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 *InstanceGroupManagerResizeRequestsListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerResizeRequestsListResponse) 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 "compute.instanceGroupManagers.abandonInstances": type InstanceGroupManagersAbandonInstancesCall struct { diff --git a/compute/v0.beta/compute-api.json b/compute/v0.beta/compute-api.json index 6cefd00b569..fe65f94dfd7 100644 --- a/compute/v0.beta/compute-api.json +++ b/compute/v0.beta/compute-api.json @@ -35452,7 +35452,7 @@ } } }, - "revision": "20220531", + "revision": "20220607", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -39374,6 +39374,7 @@ "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", "enum": [ "ACTIVE", + "CANCELLED", "CREATING", "EXPIRED", "NOT_YET_ACTIVE" @@ -39382,6 +39383,7 @@ "", "", "", + "", "" ], "type": "string" @@ -69711,6 +69713,13 @@ "format": "int32", "type": "integer" }, + "ruleMappings": { + "description": "Information about mappings provided by rules in this NAT.", + "items": { + "$ref": "VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings" + }, + "type": "array" + }, "sourceAliasIpRange": { "description": "Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: \"10.33.4.55/32\", or \"192.168.5.0/24\".", "type": "string" @@ -69722,6 +69731,42 @@ }, "type": "object" }, + "VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings": { + "description": "Contains information of NAT Mappings provided by a NAT Rule.", + "id": "VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings", + "properties": { + "drainNatIpPortRanges": { + "description": "List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: [\"2.2.2.2:12345-12355\", \"1.1.1.1:2234-2234\"].", + "items": { + "type": "string" + }, + "type": "array" + }, + "natIpPortRanges": { + "description": "A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: [\"2.2.2.2:12345-12355\", \"1.1.1.1:2234-2234\"].", + "items": { + "type": "string" + }, + "type": "array" + }, + "numTotalDrainNatPorts": { + "description": "Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges.", + "format": "int32", + "type": "integer" + }, + "numTotalNatPorts": { + "description": "Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges.", + "format": "int32", + "type": "integer" + }, + "ruleNumber": { + "description": "Rule number of the NAT Rule.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "VmEndpointNatMappingsList": { "description": "Contains a list of VmEndpointNatMappings.", "id": "VmEndpointNatMappingsList", diff --git a/compute/v0.beta/compute-gen.go b/compute/v0.beta/compute-gen.go index e85beea46d5..ed3c8820ed0 100644 --- a/compute/v0.beta/compute-gen.go +++ b/compute/v0.beta/compute-gen.go @@ -7600,6 +7600,7 @@ type Commitment struct { // // Possible values: // "ACTIVE" + // "CANCELLED" // "CREATING" // "EXPIRED" // "NOT_YET_ACTIVE" @@ -55315,6 +55316,10 @@ type VmEndpointNatMappingsInterfaceNatMappings struct { // field nat_ip_port_ranges. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"` + // RuleMappings: Information about mappings provided by rules in this + // NAT. + RuleMappings []*VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings `json:"ruleMappings,omitempty"` + // SourceAliasIpRange: Alias IP range for this interface endpoint. It // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or // "192.168.5.0/24". @@ -55348,6 +55353,59 @@ func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings: Contains +// information of NAT Mappings provided by a NAT Rule. +type VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings struct { + // DrainNatIpPortRanges: List of all drain IP:port-range mappings + // assigned to this interface by this rule. These ranges are inclusive, + // that is, both the first and the last ports can be used for NAT. + // Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + DrainNatIpPortRanges []string `json:"drainNatIpPortRanges,omitempty"` + + // NatIpPortRanges: A list of all IP:port-range mappings assigned to + // this interface by this rule. These ranges are inclusive, that is, + // both the first and the last ports can be used for NAT. Example: + // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + NatIpPortRanges []string `json:"natIpPortRanges,omitempty"` + + // NumTotalDrainNatPorts: Total number of drain ports across all NAT IPs + // allocated to this interface by this rule. It equals the aggregated + // port number in the field drain_nat_ip_port_ranges. + NumTotalDrainNatPorts int64 `json:"numTotalDrainNatPorts,omitempty"` + + // NumTotalNatPorts: Total number of ports across all NAT IPs allocated + // to this interface by this rule. It equals the aggregated port number + // in the field nat_ip_port_ranges. + NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"` + + // RuleNumber: Rule number of the NAT Rule. + RuleNumber int64 `json:"ruleNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DrainNatIpPortRanges") 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. "DrainNatIpPortRanges") 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 *VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings) MarshalJSON() ([]byte, error) { + type NoMethod VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings. type VmEndpointNatMappingsList struct { // Id: [Output Only] The unique identifier for the resource. This diff --git a/compute/v1/compute-api.json b/compute/v1/compute-api.json index d791f7d12c1..4620a30f9ed 100644 --- a/compute/v1/compute-api.json +++ b/compute/v1/compute-api.json @@ -31172,7 +31172,7 @@ } } }, - "revision": "20220526", + "revision": "20220607", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -34987,6 +34987,7 @@ "description": "[Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.", "enum": [ "ACTIVE", + "CANCELLED", "CREATING", "EXPIRED", "NOT_YET_ACTIVE" @@ -34995,6 +34996,7 @@ "", "", "", + "", "" ], "type": "string" @@ -40776,6 +40778,20 @@ "format": "uint64", "type": "string" }, + "keyRevocationActionType": { + "description": "KeyRevocationActionType of the instance. Supported options are \"STOP\" and \"NONE\". The default value is \"NONE\" if it is not specified.", + "enum": [ + "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED", + "NONE", + "STOP" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Indicates user chose no operation.", + "Indicates user chose to opt for VM shutdown on key revocation." + ], + "type": "string" + }, "kind": { "default": "compute#instance", "description": "[Output Only] Type of the resource. Always compute#instance for instances.", @@ -43077,6 +43093,20 @@ }, "type": "array" }, + "keyRevocationActionType": { + "description": "KeyRevocationActionType of the instance. Supported options are \"STOP\" and \"NONE\". The default value is \"NONE\" if it is not specified.", + "enum": [ + "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED", + "NONE", + "STOP" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Indicates user chose no operation.", + "Indicates user chose to opt for VM shutdown on key revocation." + ], + "type": "string" + }, "labels": { "additionalProperties": { "type": "string" @@ -45399,6 +45429,10 @@ "LocationPolicyLocation": { "id": "LocationPolicyLocation", "properties": { + "constraints": { + "$ref": "LocationPolicyLocationConstraints", + "description": "Constraints that the caller requires on the result distribution in this zone." + }, "preference": { "description": "Preference for a given location.", "enum": [ @@ -45416,6 +45450,18 @@ }, "type": "object" }, + "LocationPolicyLocationConstraints": { + "description": "Per-zone constraints on location policy for this zone.", + "id": "LocationPolicyLocationConstraints", + "properties": { + "maxCount": { + "description": "Maximum number of items that are allowed to be placed in this zone. The value must be non-negative.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "LogConfig": { "description": "This is deprecated and has no effect. Do not use.", "id": "LogConfig", @@ -58596,6 +58642,20 @@ }, "type": "array" }, + "keyRevocationActionType": { + "description": "KeyRevocationActionType of the instance. Supported options are \"STOP\" and \"NONE\". The default value is \"NONE\" if it is not specified.", + "enum": [ + "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED", + "NONE", + "STOP" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Indicates user chose no operation.", + "Indicates user chose to opt for VM shutdown on key revocation." + ], + "type": "string" + }, "labels": { "additionalProperties": { "type": "string" @@ -63829,6 +63889,13 @@ "format": "int32", "type": "integer" }, + "ruleMappings": { + "description": "Information about mappings provided by rules in this NAT.", + "items": { + "$ref": "VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings" + }, + "type": "array" + }, "sourceAliasIpRange": { "description": "Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: \"10.33.4.55/32\", or \"192.168.5.0/24\".", "type": "string" @@ -63840,6 +63907,42 @@ }, "type": "object" }, + "VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings": { + "description": "Contains information of NAT Mappings provided by a NAT Rule.", + "id": "VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings", + "properties": { + "drainNatIpPortRanges": { + "description": "List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: [\"2.2.2.2:12345-12355\", \"1.1.1.1:2234-2234\"].", + "items": { + "type": "string" + }, + "type": "array" + }, + "natIpPortRanges": { + "description": "A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: [\"2.2.2.2:12345-12355\", \"1.1.1.1:2234-2234\"].", + "items": { + "type": "string" + }, + "type": "array" + }, + "numTotalDrainNatPorts": { + "description": "Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges.", + "format": "int32", + "type": "integer" + }, + "numTotalNatPorts": { + "description": "Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges.", + "format": "int32", + "type": "integer" + }, + "ruleNumber": { + "description": "Rule number of the NAT Rule.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "VmEndpointNatMappingsList": { "description": "Contains a list of VmEndpointNatMappings.", "id": "VmEndpointNatMappingsList", diff --git a/compute/v1/compute-gen.go b/compute/v1/compute-gen.go index 95e7fef5427..00d1dd1e1af 100644 --- a/compute/v1/compute-gen.go +++ b/compute/v1/compute-gen.go @@ -7411,6 +7411,7 @@ type Commitment struct { // // Possible values: // "ACTIVE" + // "CANCELLED" // "CREATING" // "EXPIRED" // "NOT_YET_ACTIVE" @@ -16698,6 +16699,18 @@ type Instance struct { // identifier is defined by the server. Id uint64 `json:"id,omitempty,string"` + // KeyRevocationActionType: KeyRevocationActionType of the instance. + // Supported options are "STOP" and "NONE". The default value is "NONE" + // if it is not specified. + // + // Possible values: + // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This + // value is unused. + // "NONE" - Indicates user chose no operation. + // "STOP" - Indicates user chose to opt for VM shutdown on key + // revocation. + KeyRevocationActionType string `json:"keyRevocationActionType,omitempty"` + // Kind: [Output Only] Type of the resource. Always compute#instance for // instances. Kind string `json:"kind,omitempty"` @@ -20422,6 +20435,18 @@ type InstanceProperties struct { // to use for instances created from these properties. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"` + // KeyRevocationActionType: KeyRevocationActionType of the instance. + // Supported options are "STOP" and "NONE". The default value is "NONE" + // if it is not specified. + // + // Possible values: + // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This + // value is unused. + // "NONE" - Indicates user chose no operation. + // "STOP" - Indicates user chose to opt for VM shutdown on key + // revocation. + KeyRevocationActionType string `json:"keyRevocationActionType,omitempty"` + // Labels: Labels to apply to instances that are created from these // properties. Labels map[string]string `json:"labels,omitempty"` @@ -23985,6 +24010,10 @@ func (s *LocationPolicy) MarshalJSON() ([]byte, error) { } type LocationPolicyLocation struct { + // Constraints: Constraints that the caller requires on the result + // distribution in this zone. + Constraints *LocationPolicyLocationConstraints `json:"constraints,omitempty"` + // Preference: Preference for a given location. // // Possible values: @@ -23993,7 +24022,37 @@ type LocationPolicyLocation struct { // "PREFERENCE_UNSPECIFIED" - Default value, unused. Preference string `json:"preference,omitempty"` - // ForceSendFields is a list of field names (e.g. "Preference") to + // ForceSendFields is a list of field names (e.g. "Constraints") 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. "Constraints") 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 *LocationPolicyLocation) MarshalJSON() ([]byte, error) { + type NoMethod LocationPolicyLocation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LocationPolicyLocationConstraints: Per-zone constraints on location +// policy for this zone. +type LocationPolicyLocationConstraints struct { + // MaxCount: Maximum number of items that are allowed to be placed in + // this zone. The value must be non-negative. + MaxCount int64 `json:"maxCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxCount") 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 @@ -24001,7 +24060,7 @@ type LocationPolicyLocation struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Preference") to include in + // NullFields is a list of field names (e.g. "MaxCount") 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 @@ -24010,8 +24069,8 @@ type LocationPolicyLocation struct { NullFields []string `json:"-"` } -func (s *LocationPolicyLocation) MarshalJSON() ([]byte, error) { - type NoMethod LocationPolicyLocation +func (s *LocationPolicyLocationConstraints) MarshalJSON() ([]byte, error) { + type NoMethod LocationPolicyLocationConstraints raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } @@ -44337,6 +44396,18 @@ type SourceInstanceProperties struct { // to use for instances created from this machine image. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"` + // KeyRevocationActionType: KeyRevocationActionType of the instance. + // Supported options are "STOP" and "NONE". The default value is "NONE" + // if it is not specified. + // + // Possible values: + // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This + // value is unused. + // "NONE" - Indicates user chose no operation. + // "STOP" - Indicates user chose to opt for VM shutdown on key + // revocation. + KeyRevocationActionType string `json:"keyRevocationActionType,omitempty"` + // Labels: Labels to apply to instances that are created from this // machine image. Labels map[string]string `json:"labels,omitempty"` @@ -52796,6 +52867,10 @@ type VmEndpointNatMappingsInterfaceNatMappings struct { // field nat_ip_port_ranges. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"` + // RuleMappings: Information about mappings provided by rules in this + // NAT. + RuleMappings []*VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings `json:"ruleMappings,omitempty"` + // SourceAliasIpRange: Alias IP range for this interface endpoint. It // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or // "192.168.5.0/24". @@ -52829,6 +52904,59 @@ func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings: Contains +// information of NAT Mappings provided by a NAT Rule. +type VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings struct { + // DrainNatIpPortRanges: List of all drain IP:port-range mappings + // assigned to this interface by this rule. These ranges are inclusive, + // that is, both the first and the last ports can be used for NAT. + // Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + DrainNatIpPortRanges []string `json:"drainNatIpPortRanges,omitempty"` + + // NatIpPortRanges: A list of all IP:port-range mappings assigned to + // this interface by this rule. These ranges are inclusive, that is, + // both the first and the last ports can be used for NAT. Example: + // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + NatIpPortRanges []string `json:"natIpPortRanges,omitempty"` + + // NumTotalDrainNatPorts: Total number of drain ports across all NAT IPs + // allocated to this interface by this rule. It equals the aggregated + // port number in the field drain_nat_ip_port_ranges. + NumTotalDrainNatPorts int64 `json:"numTotalDrainNatPorts,omitempty"` + + // NumTotalNatPorts: Total number of ports across all NAT IPs allocated + // to this interface by this rule. It equals the aggregated port number + // in the field nat_ip_port_ranges. + NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"` + + // RuleNumber: Rule number of the NAT Rule. + RuleNumber int64 `json:"ruleNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DrainNatIpPortRanges") 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. "DrainNatIpPortRanges") 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 *VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings) MarshalJSON() ([]byte, error) { + type NoMethod VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings. type VmEndpointNatMappingsList struct { // Id: [Output Only] The unique identifier for the resource. This diff --git a/ondemandscanning/v1/ondemandscanning-api.json b/ondemandscanning/v1/ondemandscanning-api.json index 6330d326377..c0802a7da75 100644 --- a/ondemandscanning/v1/ondemandscanning-api.json +++ b/ondemandscanning/v1/ondemandscanning-api.json @@ -339,7 +339,7 @@ } } }, - "revision": "20220530", + "revision": "20220612", "rootUrl": "https://ondemandscanning.googleapis.com/", "schemas": { "AliasContext": { @@ -1350,6 +1350,19 @@ }, "type": "object" }, + "LanguagePackageDependency": { + "description": "Indicates a language package available between this package and the customer's resource artifact.", + "id": "LanguagePackageDependency", + "properties": { + "package": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, "Layer": { "description": "Layer holds metadata specific to a layer of a Docker image.", "id": "Layer", @@ -1647,6 +1660,13 @@ "description": "The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in which the vulnerability may manifest. Examples include distro or storage location for vulnerable jar.", "type": "string" }, + "dependencyChain": { + "description": "The dependency chain between this package and the user's artifact. List in order from the customer's package under review first, to the current package last. Inclusive of the original package and the current package.", + "items": { + "$ref": "LanguagePackageDependency" + }, + "type": "array" + }, "fileLocation": { "description": "The path to the jar file / go binary file.", "items": { diff --git a/ondemandscanning/v1/ondemandscanning-gen.go b/ondemandscanning/v1/ondemandscanning-gen.go index cd36f9e4e55..99042b0d664 100644 --- a/ondemandscanning/v1/ondemandscanning-gen.go +++ b/ondemandscanning/v1/ondemandscanning-gen.go @@ -1778,6 +1778,36 @@ func (s *Jwt) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// LanguagePackageDependency: Indicates a language package available +// between this package and the customer's resource artifact. +type LanguagePackageDependency struct { + Package string `json:"package,omitempty"` + + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Package") 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. "Package") 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 *LanguagePackageDependency) MarshalJSON() ([]byte, error) { + type NoMethod LanguagePackageDependency + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Layer: Layer holds metadata specific to a layer of a Docker image. type Layer struct { // Arguments: The recovered arguments to the Dockerfile directive. @@ -2248,6 +2278,12 @@ type PackageData struct { // jar. CpeUri string `json:"cpeUri,omitempty"` + // DependencyChain: The dependency chain between this package and the + // user's artifact. List in order from the customer's package under + // review first, to the current package last. Inclusive of the original + // package and the current package. + DependencyChain []*LanguagePackageDependency `json:"dependencyChain,omitempty"` + // FileLocation: The path to the jar file / go binary file. FileLocation []*FileLocation `json:"fileLocation,omitempty"` diff --git a/ondemandscanning/v1beta1/ondemandscanning-api.json b/ondemandscanning/v1beta1/ondemandscanning-api.json index ea015b6c721..4f1a0f39f7d 100644 --- a/ondemandscanning/v1beta1/ondemandscanning-api.json +++ b/ondemandscanning/v1beta1/ondemandscanning-api.json @@ -339,7 +339,7 @@ } } }, - "revision": "20220530", + "revision": "20220612", "rootUrl": "https://ondemandscanning.googleapis.com/", "schemas": { "AliasContext": { @@ -1346,6 +1346,19 @@ }, "type": "object" }, + "LanguagePackageDependency": { + "description": "Indicates a language package available between this package and the customer's resource artifact.", + "id": "LanguagePackageDependency", + "properties": { + "package": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, "Layer": { "description": "Layer holds metadata specific to a layer of a Docker image.", "id": "Layer", @@ -1643,6 +1656,13 @@ "description": "The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in which the vulnerability may manifest. Examples include distro or storage location for vulnerable jar.", "type": "string" }, + "dependencyChain": { + "description": "The dependency chain between this package and the user's artifact. List in order from the customer's package under review first, to the current package last. Inclusive of the original package and the current package.", + "items": { + "$ref": "LanguagePackageDependency" + }, + "type": "array" + }, "fileLocation": { "description": "The path to the jar file / go binary file.", "items": { diff --git a/ondemandscanning/v1beta1/ondemandscanning-gen.go b/ondemandscanning/v1beta1/ondemandscanning-gen.go index f7a10edb9c9..384d55ca72d 100644 --- a/ondemandscanning/v1beta1/ondemandscanning-gen.go +++ b/ondemandscanning/v1beta1/ondemandscanning-gen.go @@ -1772,6 +1772,36 @@ func (s *Jwt) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// LanguagePackageDependency: Indicates a language package available +// between this package and the customer's resource artifact. +type LanguagePackageDependency struct { + Package string `json:"package,omitempty"` + + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Package") 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. "Package") 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 *LanguagePackageDependency) MarshalJSON() ([]byte, error) { + type NoMethod LanguagePackageDependency + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Layer: Layer holds metadata specific to a layer of a Docker image. type Layer struct { // Arguments: The recovered arguments to the Dockerfile directive. @@ -2242,6 +2272,12 @@ type PackageData struct { // jar. CpeUri string `json:"cpeUri,omitempty"` + // DependencyChain: The dependency chain between this package and the + // user's artifact. List in order from the customer's package under + // review first, to the current package last. Inclusive of the original + // package and the current package. + DependencyChain []*LanguagePackageDependency `json:"dependencyChain,omitempty"` + // FileLocation: The path to the jar file / go binary file. FileLocation []*FileLocation `json:"fileLocation,omitempty"` diff --git a/retail/v2/retail-api.json b/retail/v2/retail-api.json index 6be5a25e4c0..55cbd9ebdd0 100644 --- a/retail/v2/retail-api.json +++ b/retail/v2/retail-api.json @@ -781,7 +781,7 @@ ], "parameters": { "placement": { - "description": "Required. Full resource name of the format: `{name=projects/*/locations/global/catalogs/default_catalog/placements/*}` The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", + "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", "required": true, @@ -809,7 +809,7 @@ ], "parameters": { "placement": { - "description": "Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", "required": true, @@ -829,6 +829,66 @@ } } }, + "servingConfigs": { + "methods": { + "predict": { + "description": "Makes a recommendation prediction.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.predict", + "parameterOrder": [ + "placement" + ], + "parameters": { + "placement": { + "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+placement}:predict", + "request": { + "$ref": "GoogleCloudRetailV2PredictRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2PredictResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "search": { + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.search", + "parameterOrder": [ + "placement" + ], + "parameters": { + "placement": { + "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+placement}:search", + "request": { + "$ref": "GoogleCloudRetailV2SearchRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2SearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "userEvents": { "methods": { "collect": { @@ -1133,7 +1193,7 @@ } } }, - "revision": "20220602", + "revision": "20220609", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2743,7 +2803,7 @@ "id": "GoogleCloudRetailV2SearchRequestFacetSpecFacetKey", "properties": { "caseInsensitive": { - "description": "Whether to make facet keys case insensitive when getting faceting values with prefixes or contains.", + "description": "True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.", "type": "boolean" }, "contains": { diff --git a/retail/v2/retail-gen.go b/retail/v2/retail-gen.go index bce90fcc2cc..ba497730d8b 100644 --- a/retail/v2/retail-gen.go +++ b/retail/v2/retail-gen.go @@ -173,6 +173,7 @@ func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsS rs.CompletionData = NewProjectsLocationsCatalogsCompletionDataService(s) rs.Operations = NewProjectsLocationsCatalogsOperationsService(s) rs.Placements = NewProjectsLocationsCatalogsPlacementsService(s) + rs.ServingConfigs = NewProjectsLocationsCatalogsServingConfigsService(s) rs.UserEvents = NewProjectsLocationsCatalogsUserEventsService(s) return rs } @@ -188,6 +189,8 @@ type ProjectsLocationsCatalogsService struct { Placements *ProjectsLocationsCatalogsPlacementsService + ServingConfigs *ProjectsLocationsCatalogsServingConfigsService + UserEvents *ProjectsLocationsCatalogsUserEventsService } @@ -251,6 +254,15 @@ type ProjectsLocationsCatalogsPlacementsService struct { s *Service } +func NewProjectsLocationsCatalogsServingConfigsService(s *Service) *ProjectsLocationsCatalogsServingConfigsService { + rs := &ProjectsLocationsCatalogsServingConfigsService{s: s} + return rs +} + +type ProjectsLocationsCatalogsServingConfigsService struct { + s *Service +} + func NewProjectsLocationsCatalogsUserEventsService(s *Service) *ProjectsLocationsCatalogsUserEventsService { rs := &ProjectsLocationsCatalogsUserEventsService{s: s} return rs @@ -3585,8 +3597,8 @@ func (s *GoogleCloudRetailV2SearchRequestFacetSpec) MarshalJSON() ([]byte, error // GoogleCloudRetailV2SearchRequestFacetSpecFacetKey: Specifies how a // facet is computed. type GoogleCloudRetailV2SearchRequestFacetSpecFacetKey struct { - // CaseInsensitive: Whether to make facet keys case insensitive when - // getting faceting values with prefixes or contains. + // CaseInsensitive: True to make facet keys case insensitive when + // getting faceting values with prefixes or contains; false otherwise. CaseInsensitive bool `json:"caseInsensitive,omitempty"` // Contains: Only get facet values that contains the given strings. For @@ -9255,13 +9267,18 @@ type ProjectsLocationsCatalogsPlacementsPredictCall struct { // Predict: Makes a recommendation prediction. // // - placement: Full resource name of the format: -// `{name=projects/*/locations/global/catalogs/default_catalog/placemen -// ts/*}` The ID of the Recommendations AI placement. Before you can -// request predictions from your model, you must create at least one -// placement for it. For more information, see Managing placements -// (https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). -// The full list of available placements can be seen at -// https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements. +// {placement=projects/*/locations/global/catalogs/default_catalog/serv +// ingConfigs/*} or +// {placement=projects/*/locations/global/catalogs/default_catalog/plac +// ements/*}. We recommend using the `servingConfigs` resource. +// `placements` is a legacy resource. The ID of the Recommendations AI +// serving config or placement. Before you can request predictions +// from your model, you must create at least one serving config or +// placement for it. For more information, see [Managing serving +// configurations] +// (https://cloud.google.com/retail/docs/manage-configs). The full +// list of available serving configs can be seen at +// https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. func (r *ProjectsLocationsCatalogsPlacementsService) Predict(placement string, googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest) *ProjectsLocationsCatalogsPlacementsPredictCall { c := &ProjectsLocationsCatalogsPlacementsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.placement = placement @@ -9370,7 +9387,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "placement": { - // "description": "Required. Full resource name of the format: `{name=projects/*/locations/global/catalogs/default_catalog/placements/*}` The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", + // "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, @@ -9406,8 +9423,11 @@ type ProjectsLocationsCatalogsPlacementsSearchCall struct { // who have Retail Search enabled. Please enable Retail Search on Cloud // Console before using this feature. // -// - placement: The resource name of the search engine placement, such -// as +// - placement: The resource name of the Retail Search serving config, +// such as +// `projects/*/locations/global/catalogs/default_catalog/servingConfigs +// /default_serving_config` or the name of the legacy placement +// resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/def // ault_search`. This field is used to identify the serving // configuration name and the set of models that will be used to make @@ -9520,7 +9540,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal // ], // "parameters": { // "placement": { - // "description": "Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + // "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, @@ -9562,6 +9582,335 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Pages(ctx context.Contex } } +// method id "retail.projects.locations.catalogs.servingConfigs.predict": + +type ProjectsLocationsCatalogsServingConfigsPredictCall struct { + s *Service + placement string + googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Predict: Makes a recommendation prediction. +// +// - placement: Full resource name of the format: +// {placement=projects/*/locations/global/catalogs/default_catalog/serv +// ingConfigs/*} or +// {placement=projects/*/locations/global/catalogs/default_catalog/plac +// ements/*}. We recommend using the `servingConfigs` resource. +// `placements` is a legacy resource. The ID of the Recommendations AI +// serving config or placement. Before you can request predictions +// from your model, you must create at least one serving config or +// placement for it. For more information, see [Managing serving +// configurations] +// (https://cloud.google.com/retail/docs/manage-configs). The full +// list of available serving configs can be seen at +// https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. +func (r *ProjectsLocationsCatalogsServingConfigsService) Predict(placement string, googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest) *ProjectsLocationsCatalogsServingConfigsPredictCall { + c := &ProjectsLocationsCatalogsServingConfigsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.placement = placement + c.googlecloudretailv2predictrequest = googlecloudretailv2predictrequest + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPredictCall { + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPredictCall { + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) 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.googlecloudretailv2predictrequest) + 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, "v2/{+placement}:predict") + 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{ + "placement": c.placement, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.servingConfigs.predict" call. +// Exactly one of *GoogleCloudRetailV2PredictResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2PredictResponse.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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2PredictResponse, 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, &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, err + } + ret := &GoogleCloudRetailV2PredictResponse{ + 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 prediction.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.servingConfigs.predict", + // "parameterOrder": [ + // "placement" + // ], + // "parameters": { + // "placement": { + // "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+placement}:predict", + // "request": { + // "$ref": "GoogleCloudRetailV2PredictRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2PredictResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.servingConfigs.search": + +type ProjectsLocationsCatalogsServingConfigsSearchCall struct { + s *Service + placement string + googlecloudretailv2searchrequest *GoogleCloudRetailV2SearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Search: Performs a search. This feature is only available for users +// who have Retail Search enabled. Please enable Retail Search on Cloud +// Console before using this feature. +// +// - placement: The resource name of the Retail Search serving config, +// such as +// `projects/*/locations/global/catalogs/default_catalog/servingConfigs +// /default_serving_config` or the name of the legacy placement +// resource, such as +// `projects/*/locations/global/catalogs/default_catalog/placements/def +// ault_search`. This field is used to identify the serving +// configuration name and the set of models that will be used to make +// the search. +func (r *ProjectsLocationsCatalogsServingConfigsService) Search(placement string, googlecloudretailv2searchrequest *GoogleCloudRetailV2SearchRequest) *ProjectsLocationsCatalogsServingConfigsSearchCall { + c := &ProjectsLocationsCatalogsServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.placement = placement + c.googlecloudretailv2searchrequest = googlecloudretailv2searchrequest + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsSearchCall { + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsSearchCall { + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) 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.googlecloudretailv2searchrequest) + 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, "v2/{+placement}:search") + 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{ + "placement": c.placement, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.servingConfigs.search" call. +// Exactly one of *GoogleCloudRetailV2SearchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2SearchResponse.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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2SearchResponse, 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, &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, err + } + ret := &GoogleCloudRetailV2SearchResponse{ + 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": "Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:search", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.servingConfigs.search", + // "parameterOrder": [ + // "placement" + // ], + // "parameters": { + // "placement": { + // "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+placement}:search", + // "request": { + // "$ref": "GoogleCloudRetailV2SearchRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2SearchResponse" + // }, + // "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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2SearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.googlecloudretailv2searchrequest.PageToken = pt }(c.googlecloudretailv2searchrequest.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.googlecloudretailv2searchrequest.PageToken = x.NextPageToken + } +} + // method id "retail.projects.locations.catalogs.userEvents.collect": type ProjectsLocationsCatalogsUserEventsCollectCall struct { diff --git a/retail/v2alpha/retail-api.json b/retail/v2alpha/retail-api.json index 2d39a3428d3..2332a0345dc 100644 --- a/retail/v2alpha/retail-api.json +++ b/retail/v2alpha/retail-api.json @@ -1182,7 +1182,7 @@ ], "parameters": { "placement": { - "description": "Required. Full resource name of the format: `{name=projects/*/locations/global/catalogs/default_catalog/placements/*}` The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", + "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", "required": true, @@ -1210,7 +1210,7 @@ ], "parameters": { "placement": { - "description": "Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", "required": true, @@ -1413,6 +1413,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "predict": { + "description": "Makes a recommendation prediction.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.predict", + "parameterOrder": [ + "placement" + ], + "parameters": { + "placement": { + "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+placement}:predict", + "request": { + "$ref": "GoogleCloudRetailV2alphaPredictRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2alphaPredictResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "removeControl": { "description": "Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:removeControl", @@ -1440,6 +1468,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "search": { + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.search", + "parameterOrder": [ + "placement" + ], + "parameters": { + "placement": { + "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+placement}:search", + "request": { + "$ref": "GoogleCloudRetailV2alphaSearchRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2alphaSearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -1747,7 +1803,7 @@ } } }, - "revision": "20220602", + "revision": "20220609", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -4320,7 +4376,7 @@ "id": "GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey", "properties": { "caseInsensitive": { - "description": "Whether to make facet keys case insensitive when getting faceting values with prefixes or contains.", + "description": "True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.", "type": "boolean" }, "contains": { diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 247ad3b5051..cf35a60bd17 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -5426,8 +5426,8 @@ func (s *GoogleCloudRetailV2alphaSearchRequestFacetSpec) MarshalJSON() ([]byte, // GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey: Specifies how // a facet is computed. type GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey struct { - // CaseInsensitive: Whether to make facet keys case insensitive when - // getting faceting values with prefixes or contains. + // CaseInsensitive: True to make facet keys case insensitive when + // getting faceting values with prefixes or contains; false otherwise. CaseInsensitive bool `json:"caseInsensitive,omitempty"` // Contains: Only get facet values that contains the given strings. For @@ -12732,13 +12732,18 @@ type ProjectsLocationsCatalogsPlacementsPredictCall struct { // Predict: Makes a recommendation prediction. // // - placement: Full resource name of the format: -// `{name=projects/*/locations/global/catalogs/default_catalog/placemen -// ts/*}` The ID of the Recommendations AI placement. Before you can -// request predictions from your model, you must create at least one -// placement for it. For more information, see Managing placements -// (https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). -// The full list of available placements can be seen at -// https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements. +// {placement=projects/*/locations/global/catalogs/default_catalog/serv +// ingConfigs/*} or +// {placement=projects/*/locations/global/catalogs/default_catalog/plac +// ements/*}. We recommend using the `servingConfigs` resource. +// `placements` is a legacy resource. The ID of the Recommendations AI +// serving config or placement. Before you can request predictions +// from your model, you must create at least one serving config or +// placement for it. For more information, see [Managing serving +// configurations] +// (https://cloud.google.com/retail/docs/manage-configs). The full +// list of available serving configs can be seen at +// https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. func (r *ProjectsLocationsCatalogsPlacementsService) Predict(placement string, googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest) *ProjectsLocationsCatalogsPlacementsPredictCall { c := &ProjectsLocationsCatalogsPlacementsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.placement = placement @@ -12847,7 +12852,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "placement": { - // "description": "Required. Full resource name of the format: `{name=projects/*/locations/global/catalogs/default_catalog/placements/*}` The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", + // "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, @@ -12883,8 +12888,11 @@ type ProjectsLocationsCatalogsPlacementsSearchCall struct { // who have Retail Search enabled. Please enable Retail Search on Cloud // Console before using this feature. // -// - placement: The resource name of the search engine placement, such -// as +// - placement: The resource name of the Retail Search serving config, +// such as +// `projects/*/locations/global/catalogs/default_catalog/servingConfigs +// /default_serving_config` or the name of the legacy placement +// resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/def // ault_search`. This field is used to identify the serving // configuration name and the set of models that will be used to make @@ -12997,7 +13005,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal // ], // "parameters": { // "placement": { - // "description": "Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + // "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, @@ -13993,6 +14001,161 @@ func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Do(opts ...googleapi. } +// method id "retail.projects.locations.catalogs.servingConfigs.predict": + +type ProjectsLocationsCatalogsServingConfigsPredictCall struct { + s *Service + placement string + googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Predict: Makes a recommendation prediction. +// +// - placement: Full resource name of the format: +// {placement=projects/*/locations/global/catalogs/default_catalog/serv +// ingConfigs/*} or +// {placement=projects/*/locations/global/catalogs/default_catalog/plac +// ements/*}. We recommend using the `servingConfigs` resource. +// `placements` is a legacy resource. The ID of the Recommendations AI +// serving config or placement. Before you can request predictions +// from your model, you must create at least one serving config or +// placement for it. For more information, see [Managing serving +// configurations] +// (https://cloud.google.com/retail/docs/manage-configs). The full +// list of available serving configs can be seen at +// https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. +func (r *ProjectsLocationsCatalogsServingConfigsService) Predict(placement string, googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest) *ProjectsLocationsCatalogsServingConfigsPredictCall { + c := &ProjectsLocationsCatalogsServingConfigsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.placement = placement + c.googlecloudretailv2alphapredictrequest = googlecloudretailv2alphapredictrequest + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPredictCall { + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPredictCall { + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) 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.googlecloudretailv2alphapredictrequest) + 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, "v2alpha/{+placement}:predict") + 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{ + "placement": c.placement, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.servingConfigs.predict" call. +// Exactly one of *GoogleCloudRetailV2alphaPredictResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2alphaPredictResponse.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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaPredictResponse, 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, &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, err + } + ret := &GoogleCloudRetailV2alphaPredictResponse{ + 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 prediction.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.servingConfigs.predict", + // "parameterOrder": [ + // "placement" + // ], + // "parameters": { + // "placement": { + // "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+placement}:predict", + // "request": { + // "$ref": "GoogleCloudRetailV2alphaPredictRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2alphaPredictResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "retail.projects.locations.catalogs.servingConfigs.removeControl": type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { @@ -14140,6 +14303,180 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...go } +// method id "retail.projects.locations.catalogs.servingConfigs.search": + +type ProjectsLocationsCatalogsServingConfigsSearchCall struct { + s *Service + placement string + googlecloudretailv2alphasearchrequest *GoogleCloudRetailV2alphaSearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Search: Performs a search. This feature is only available for users +// who have Retail Search enabled. Please enable Retail Search on Cloud +// Console before using this feature. +// +// - placement: The resource name of the Retail Search serving config, +// such as +// `projects/*/locations/global/catalogs/default_catalog/servingConfigs +// /default_serving_config` or the name of the legacy placement +// resource, such as +// `projects/*/locations/global/catalogs/default_catalog/placements/def +// ault_search`. This field is used to identify the serving +// configuration name and the set of models that will be used to make +// the search. +func (r *ProjectsLocationsCatalogsServingConfigsService) Search(placement string, googlecloudretailv2alphasearchrequest *GoogleCloudRetailV2alphaSearchRequest) *ProjectsLocationsCatalogsServingConfigsSearchCall { + c := &ProjectsLocationsCatalogsServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.placement = placement + c.googlecloudretailv2alphasearchrequest = googlecloudretailv2alphasearchrequest + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsSearchCall { + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsSearchCall { + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) 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.googlecloudretailv2alphasearchrequest) + 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, "v2alpha/{+placement}:search") + 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{ + "placement": c.placement, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.servingConfigs.search" call. +// Exactly one of *GoogleCloudRetailV2alphaSearchResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2alphaSearchResponse.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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaSearchResponse, 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, &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, err + } + ret := &GoogleCloudRetailV2alphaSearchResponse{ + 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": "Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:search", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.servingConfigs.search", + // "parameterOrder": [ + // "placement" + // ], + // "parameters": { + // "placement": { + // "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+placement}:search", + // "request": { + // "$ref": "GoogleCloudRetailV2alphaSearchRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2alphaSearchResponse" + // }, + // "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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaSearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.googlecloudretailv2alphasearchrequest.PageToken = pt }(c.googlecloudretailv2alphasearchrequest.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.googlecloudretailv2alphasearchrequest.PageToken = x.NextPageToken + } +} + // method id "retail.projects.locations.catalogs.userEvents.collect": type ProjectsLocationsCatalogsUserEventsCollectCall struct { diff --git a/retail/v2beta/retail-api.json b/retail/v2beta/retail-api.json index cedc84928d1..51db86aa3f6 100644 --- a/retail/v2beta/retail-api.json +++ b/retail/v2beta/retail-api.json @@ -1149,7 +1149,7 @@ ], "parameters": { "placement": { - "description": "Required. Full resource name of the format: `{name=projects/*/locations/global/catalogs/default_catalog/placements/*}` The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", + "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", "required": true, @@ -1177,7 +1177,7 @@ ], "parameters": { "placement": { - "description": "Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", "required": true, @@ -1380,6 +1380,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "predict": { + "description": "Makes a recommendation prediction.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.predict", + "parameterOrder": [ + "placement" + ], + "parameters": { + "placement": { + "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+placement}:predict", + "request": { + "$ref": "GoogleCloudRetailV2betaPredictRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2betaPredictResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "removeControl": { "description": "Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:removeControl", @@ -1407,6 +1435,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "search": { + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.search", + "parameterOrder": [ + "placement" + ], + "parameters": { + "placement": { + "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+placement}:search", + "request": { + "$ref": "GoogleCloudRetailV2betaSearchRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2betaSearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -1714,7 +1770,7 @@ } } }, - "revision": "20220602", + "revision": "20220609", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -4522,7 +4578,7 @@ "id": "GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey", "properties": { "caseInsensitive": { - "description": "Whether to make facet keys case insensitive when getting faceting values with prefixes or contains.", + "description": "True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.", "type": "boolean" }, "contains": { diff --git a/retail/v2beta/retail-gen.go b/retail/v2beta/retail-gen.go index 0cc23a8e00b..c9f42f83819 100644 --- a/retail/v2beta/retail-gen.go +++ b/retail/v2beta/retail-gen.go @@ -5855,8 +5855,8 @@ func (s *GoogleCloudRetailV2betaSearchRequestFacetSpec) MarshalJSON() ([]byte, e // GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey: Specifies how // a facet is computed. type GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey struct { - // CaseInsensitive: Whether to make facet keys case insensitive when - // getting faceting values with prefixes or contains. + // CaseInsensitive: True to make facet keys case insensitive when + // getting faceting values with prefixes or contains; false otherwise. CaseInsensitive bool `json:"caseInsensitive,omitempty"` // Contains: Only get facet values that contains the given strings. For @@ -12477,13 +12477,18 @@ type ProjectsLocationsCatalogsPlacementsPredictCall struct { // Predict: Makes a recommendation prediction. // // - placement: Full resource name of the format: -// `{name=projects/*/locations/global/catalogs/default_catalog/placemen -// ts/*}` The ID of the Recommendations AI placement. Before you can -// request predictions from your model, you must create at least one -// placement for it. For more information, see Managing placements -// (https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). -// The full list of available placements can be seen at -// https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements. +// {placement=projects/*/locations/global/catalogs/default_catalog/serv +// ingConfigs/*} or +// {placement=projects/*/locations/global/catalogs/default_catalog/plac +// ements/*}. We recommend using the `servingConfigs` resource. +// `placements` is a legacy resource. The ID of the Recommendations AI +// serving config or placement. Before you can request predictions +// from your model, you must create at least one serving config or +// placement for it. For more information, see [Managing serving +// configurations] +// (https://cloud.google.com/retail/docs/manage-configs). The full +// list of available serving configs can be seen at +// https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. func (r *ProjectsLocationsCatalogsPlacementsService) Predict(placement string, googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest) *ProjectsLocationsCatalogsPlacementsPredictCall { c := &ProjectsLocationsCatalogsPlacementsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.placement = placement @@ -12592,7 +12597,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "placement": { - // "description": "Required. Full resource name of the format: `{name=projects/*/locations/global/catalogs/default_catalog/placements/*}` The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", + // "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, @@ -12628,8 +12633,11 @@ type ProjectsLocationsCatalogsPlacementsSearchCall struct { // who have Retail Search enabled. Please enable Retail Search on Cloud // Console before using this feature. // -// - placement: The resource name of the search engine placement, such -// as +// - placement: The resource name of the Retail Search serving config, +// such as +// `projects/*/locations/global/catalogs/default_catalog/servingConfigs +// /default_serving_config` or the name of the legacy placement +// resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/def // ault_search`. This field is used to identify the serving // configuration name and the set of models that will be used to make @@ -12742,7 +12750,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal // ], // "parameters": { // "placement": { - // "description": "Required. The resource name of the search engine placement, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + // "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, @@ -13738,6 +13746,161 @@ func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Do(opts ...googleapi. } +// method id "retail.projects.locations.catalogs.servingConfigs.predict": + +type ProjectsLocationsCatalogsServingConfigsPredictCall struct { + s *Service + placement string + googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Predict: Makes a recommendation prediction. +// +// - placement: Full resource name of the format: +// {placement=projects/*/locations/global/catalogs/default_catalog/serv +// ingConfigs/*} or +// {placement=projects/*/locations/global/catalogs/default_catalog/plac +// ements/*}. We recommend using the `servingConfigs` resource. +// `placements` is a legacy resource. The ID of the Recommendations AI +// serving config or placement. Before you can request predictions +// from your model, you must create at least one serving config or +// placement for it. For more information, see [Managing serving +// configurations] +// (https://cloud.google.com/retail/docs/manage-configs). The full +// list of available serving configs can be seen at +// https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. +func (r *ProjectsLocationsCatalogsServingConfigsService) Predict(placement string, googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest) *ProjectsLocationsCatalogsServingConfigsPredictCall { + c := &ProjectsLocationsCatalogsServingConfigsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.placement = placement + c.googlecloudretailv2betapredictrequest = googlecloudretailv2betapredictrequest + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPredictCall { + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPredictCall { + 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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) 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.googlecloudretailv2betapredictrequest) + 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, "v2beta/{+placement}:predict") + 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{ + "placement": c.placement, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.servingConfigs.predict" call. +// Exactly one of *GoogleCloudRetailV2betaPredictResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2betaPredictResponse.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 *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaPredictResponse, 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, &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, err + } + ret := &GoogleCloudRetailV2betaPredictResponse{ + 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 prediction.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.servingConfigs.predict", + // "parameterOrder": [ + // "placement" + // ], + // "parameters": { + // "placement": { + // "description": "Required. Full resource name of the format: {placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*} or {placement=projects/*/locations/global/catalogs/default_catalog/placements/*}. We recommend using the `servingConfigs` resource. `placements` is a legacy resource. The ID of the Recommendations AI serving config or placement. Before you can request predictions from your model, you must create at least one serving config or placement for it. For more information, see [Managing serving configurations] (https://cloud.google.com/retail/docs/manage-configs). The full list of available serving configs can be seen at https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+placement}:predict", + // "request": { + // "$ref": "GoogleCloudRetailV2betaPredictRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2betaPredictResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "retail.projects.locations.catalogs.servingConfigs.removeControl": type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { @@ -13885,6 +14048,180 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...go } +// method id "retail.projects.locations.catalogs.servingConfigs.search": + +type ProjectsLocationsCatalogsServingConfigsSearchCall struct { + s *Service + placement string + googlecloudretailv2betasearchrequest *GoogleCloudRetailV2betaSearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Search: Performs a search. This feature is only available for users +// who have Retail Search enabled. Please enable Retail Search on Cloud +// Console before using this feature. +// +// - placement: The resource name of the Retail Search serving config, +// such as +// `projects/*/locations/global/catalogs/default_catalog/servingConfigs +// /default_serving_config` or the name of the legacy placement +// resource, such as +// `projects/*/locations/global/catalogs/default_catalog/placements/def +// ault_search`. This field is used to identify the serving +// configuration name and the set of models that will be used to make +// the search. +func (r *ProjectsLocationsCatalogsServingConfigsService) Search(placement string, googlecloudretailv2betasearchrequest *GoogleCloudRetailV2betaSearchRequest) *ProjectsLocationsCatalogsServingConfigsSearchCall { + c := &ProjectsLocationsCatalogsServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.placement = placement + c.googlecloudretailv2betasearchrequest = googlecloudretailv2betasearchrequest + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsSearchCall { + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsSearchCall { + 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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) 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.googlecloudretailv2betasearchrequest) + 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, "v2beta/{+placement}:search") + 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{ + "placement": c.placement, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.servingConfigs.search" call. +// Exactly one of *GoogleCloudRetailV2betaSearchResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2betaSearchResponse.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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaSearchResponse, 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, &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, err + } + ret := &GoogleCloudRetailV2betaSearchResponse{ + 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": "Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:search", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.servingConfigs.search", + // "parameterOrder": [ + // "placement" + // ], + // "parameters": { + // "placement": { + // "description": "Required. The resource name of the Retail Search serving config, such as `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` or the name of the legacy placement resource, such as `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. This field is used to identify the serving configuration name and the set of models that will be used to make the search.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+placement}:search", + // "request": { + // "$ref": "GoogleCloudRetailV2betaSearchRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2betaSearchResponse" + // }, + // "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 *ProjectsLocationsCatalogsServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaSearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.googlecloudretailv2betasearchrequest.PageToken = pt }(c.googlecloudretailv2betasearchrequest.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.googlecloudretailv2betasearchrequest.PageToken = x.NextPageToken + } +} + // method id "retail.projects.locations.catalogs.userEvents.collect": type ProjectsLocationsCatalogsUserEventsCollectCall struct {