diff --git a/api-list.json b/api-list.json index ba983a933c6..c32199630ab 100644 --- a/api-list.json +++ b/api-list.json @@ -4627,6 +4627,21 @@ "documentationLink": "https://cloud.google.com/recommendations", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "run:v1alpha1", + "name": "run", + "version": "v1alpha1", + "title": "Cloud Run Admin API", + "description": "Deploy and manage user provided container images that scale automatically based on incoming requests. The Cloud Run Admin API v1 follows the Knative Serving API specification, while v2 is aligned with Google Cloud AIP-based API standards, as described in https://google.aip.dev/.", + "discoveryRestUrl": "https://run.googleapis.com/$discovery/rest?version=v1alpha1", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://cloud.google.com/run/", + "preferred": false + }, { "kind": "discovery#directoryItem", "id": "run:v1", diff --git a/baremetalsolution/v2/baremetalsolution-api.json b/baremetalsolution/v2/baremetalsolution-api.json index f5400153a48..60c6780aaf7 100644 --- a/baremetalsolution/v2/baremetalsolution-api.json +++ b/baremetalsolution/v2/baremetalsolution-api.json @@ -580,6 +580,59 @@ }, "nfsShares": { "methods": { + "create": { + "description": "Create an NFS share.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/nfsShares", + "httpMethod": "POST", + "id": "baremetalsolution.projects.locations.nfsShares.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent project and location.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/nfsShares", + "request": { + "$ref": "NfsShare" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Delete an NFS share. The underlying volume is automatically deleted.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/nfsShares/{nfsSharesId}", + "httpMethod": "DELETE", + "id": "baremetalsolution.projects.locations.nfsShares.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the NFS share to delete.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/nfsShares/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "get": { "description": "Get details of a single NFS share.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/nfsShares/{nfsSharesId}", @@ -656,14 +709,14 @@ ], "parameters": { "name": { - "description": "Output only. The name of the NFS share.", + "description": "Immutable. The name of the NFS share.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/nfsShares/[^/]+$", "required": true, "type": "string" }, "updateMask": { - "description": "The list of fields to update. The only currently supported fields are: `labels`", + "description": "The list of fields to update. The only currently supported fields are: `labels` `allowed_clients`", "format": "google-fieldmask", "location": "query", "type": "string" @@ -1084,7 +1137,7 @@ } } }, - "revision": "20220731", + "revision": "20220822", "rootUrl": "https://baremetalsolution.googleapis.com/", "schemas": { "AllowedClient": { @@ -1131,7 +1184,8 @@ "type": "boolean" }, "shareIp": { - "description": "The IP address of the share on this network.", + "description": "Output only. The IP address of the share on this network. Assigned automatically during provisioning based on the network's services_cidr.", + "readOnly": true, "type": "string" } }, @@ -1802,6 +1856,10 @@ "description": "IP address configured.", "type": "string" }, + "jumboFramesEnabled": { + "description": "Whether network uses standard frames or jumbo ones.", + "type": "boolean" + }, "labels": { "additionalProperties": { "type": "string" @@ -1816,11 +1874,23 @@ }, "type": "array" }, + "mountPoints": { + "description": "Input only. List of mount points to attach the network to.", + "items": { + "$ref": "NetworkMountPoint" + }, + "type": "array" + }, "name": { "description": "Output only. The resource name of this `Network`. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. Format: `projects/{project}/locations/{location}/networks/{network}`", "readOnly": true, "type": "string" }, + "pod": { + "description": "Output only. Pod name.", + "readOnly": true, + "type": "string" + }, "reservations": { "description": "List of IP address reservations in this network. When updating this field, an error will be generated if a reservation conflicts with an IP address already allocated to a physical server.", "items": { @@ -2004,6 +2074,29 @@ }, "type": "object" }, + "NetworkMountPoint": { + "description": "Mount point for a network.", + "id": "NetworkMountPoint", + "properties": { + "defaultGateway": { + "description": "Network should be a default gateway.", + "type": "boolean" + }, + "instance": { + "description": "Instance to attach network to.", + "type": "string" + }, + "ipAddress": { + "description": "Ip address of the server.", + "type": "string" + }, + "logicalInterface": { + "description": "Logical interface to detach from.", + "type": "string" + } + }, + "type": "object" + }, "NetworkUsage": { "description": "Network with all used IP addresses.", "id": "NetworkUsage", @@ -2091,8 +2184,7 @@ "type": "object" }, "name": { - "description": "Output only. The name of the NFS share.", - "readOnly": true, + "description": "Immutable. The name of the NFS share.", "type": "string" }, "nfsShareId": { @@ -2106,7 +2198,7 @@ "type": "string" }, "state": { - "description": "The state of the NFS share.", + "description": "Output only. The state of the NFS share.", "enum": [ "STATE_UNSPECIFIED", "PROVISIONED", @@ -2121,10 +2213,26 @@ "The NFS Share is being updated.", "The NFS Share has been requested to be deleted." ], + "readOnly": true, + "type": "string" + }, + "storageType": { + "description": "Immutable. The storage type of the underlying volume.", + "enum": [ + "STORAGE_TYPE_UNSPECIFIED", + "SSD", + "HDD" + ], + "enumDescriptions": [ + "The storage type for this volume is unknown.", + "The storage type for this volume is SSD.", + "This storage type for this volume is HDD." + ], "type": "string" }, "volume": { - "description": "The volume containing the share.", + "description": "Output only. The underlying volume of the share. Created automatically during provisioning.", + "readOnly": true, "type": "string" } }, @@ -2554,7 +2662,7 @@ }, "qosPolicy": { "$ref": "QosPolicy", - "description": "The QOS policy applied to this VRF." + "description": "The QOS policy applied to this VRF. The value is only meaningful when all the vlan attachments have the same QoS. This field should not be used for new integrations, use vlan attachment level qos instead. The field is left for backward-compatibility." }, "state": { "description": "The possible state of VRF.", @@ -2584,6 +2692,10 @@ "description": "VLAN attachment details.", "id": "VlanAttachment", "properties": { + "pairingKey": { + "description": "Input only. Pairing key.", + "type": "string" + }, "peerIp": { "description": "The peer IP of the attachment.", "type": "string" @@ -2593,6 +2705,10 @@ "format": "int64", "type": "string" }, + "qosPolicy": { + "$ref": "QosPolicy", + "description": "The QOS policy applied to this VLAN attachment. This value should be preferred to using qos at vrf level." + }, "routerIp": { "description": "The router IP of the attachment.", "type": "string" diff --git a/baremetalsolution/v2/baremetalsolution-gen.go b/baremetalsolution/v2/baremetalsolution-gen.go index df13f976236..e318fdb5b29 100644 --- a/baremetalsolution/v2/baremetalsolution-gen.go +++ b/baremetalsolution/v2/baremetalsolution-gen.go @@ -300,7 +300,9 @@ type AllowedClient struct { // when using identity authentication. NoRootSquash bool `json:"noRootSquash,omitempty"` - // ShareIp: The IP address of the share on this network. + // ShareIp: Output only. The IP address of the share on this network. + // Assigned automatically during provisioning based on the network's + // services_cidr. ShareIp string `json:"shareIp,omitempty"` // ForceSendFields is a list of field names (e.g. "AllowDev") to @@ -1259,18 +1261,29 @@ type Network struct { // IpAddress: IP address configured. IpAddress string `json:"ipAddress,omitempty"` + // JumboFramesEnabled: Whether network uses standard frames or jumbo + // ones. + JumboFramesEnabled bool `json:"jumboFramesEnabled,omitempty"` + // Labels: Labels as key value pairs. Labels map[string]string `json:"labels,omitempty"` // MacAddress: List of physical interfaces. MacAddress []string `json:"macAddress,omitempty"` + // MountPoints: Input only. List of mount points to attach the network + // to. + MountPoints []*NetworkMountPoint `json:"mountPoints,omitempty"` + // Name: Output only. The resource name of this `Network`. Resource // names are schemeless URIs that follow the conventions in // https://cloud.google.com/apis/design/resource_names. Format: // `projects/{project}/locations/{location}/networks/{network}` Name string `json:"name,omitempty"` + // Pod: Output only. Pod name. + Pod string `json:"pod,omitempty"` + // Reservations: List of IP address reservations in this network. When // updating this field, an error will be generated if a reservation // conflicts with an IP address already allocated to a physical server. @@ -1491,6 +1504,44 @@ func (s *NetworkConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// NetworkMountPoint: Mount point for a network. +type NetworkMountPoint struct { + // DefaultGateway: Network should be a default gateway. + DefaultGateway bool `json:"defaultGateway,omitempty"` + + // Instance: Instance to attach network to. + Instance string `json:"instance,omitempty"` + + // IpAddress: Ip address of the server. + IpAddress string `json:"ipAddress,omitempty"` + + // LogicalInterface: Logical interface to detach from. + LogicalInterface string `json:"logicalInterface,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultGateway") 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. "DefaultGateway") 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 *NetworkMountPoint) MarshalJSON() ([]byte, error) { + type NoMethod NetworkMountPoint + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // NetworkUsage: Network with all used IP addresses. type NetworkUsage struct { // Network: Network. @@ -1589,7 +1640,7 @@ type NfsShare struct { // Labels: Labels as key value pairs. Labels map[string]string `json:"labels,omitempty"` - // Name: Output only. The name of the NFS share. + // Name: Immutable. The name of the NFS share. Name string `json:"name,omitempty"` // NfsShareId: Output only. An identifier for the NFS share, generated @@ -1600,7 +1651,7 @@ type NfsShare struct { // RequestedSizeGib: The requested size, in GiB. RequestedSizeGib int64 `json:"requestedSizeGib,omitempty,string"` - // State: The state of the NFS share. + // State: Output only. The state of the NFS share. // // Possible values: // "STATE_UNSPECIFIED" - The share is in an unknown state. @@ -1610,7 +1661,17 @@ type NfsShare struct { // "DELETING" - The NFS Share has been requested to be deleted. State string `json:"state,omitempty"` - // Volume: The volume containing the share. + // StorageType: Immutable. The storage type of the underlying volume. + // + // Possible values: + // "STORAGE_TYPE_UNSPECIFIED" - The storage type for this volume is + // unknown. + // "SSD" - The storage type for this volume is SSD. + // "HDD" - This storage type for this volume is HDD. + StorageType string `json:"storageType,omitempty"` + + // Volume: Output only. The underlying volume of the share. Created + // automatically during provisioning. Volume string `json:"volume,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -2235,7 +2296,10 @@ type VRF struct { // Name: The name of the VRF. Name string `json:"name,omitempty"` - // QosPolicy: The QOS policy applied to this VRF. + // QosPolicy: The QOS policy applied to this VRF. The value is only + // meaningful when all the vlan attachments have the same QoS. This + // field should not be used for new integrations, use vlan attachment + // level qos instead. The field is left for backward-compatibility. QosPolicy *QosPolicy `json:"qosPolicy,omitempty"` // State: The possible state of VRF. @@ -2274,16 +2338,23 @@ func (s *VRF) MarshalJSON() ([]byte, error) { // VlanAttachment: VLAN attachment details. type VlanAttachment struct { + // PairingKey: Input only. Pairing key. + PairingKey string `json:"pairingKey,omitempty"` + // PeerIp: The peer IP of the attachment. PeerIp string `json:"peerIp,omitempty"` // PeerVlanId: The peer vlan ID of the attachment. PeerVlanId int64 `json:"peerVlanId,omitempty,string"` + // QosPolicy: The QOS policy applied to this VLAN attachment. This value + // should be preferred to using qos at vrf level. + QosPolicy *QosPolicy `json:"qosPolicy,omitempty"` + // RouterIp: The router IP of the attachment. RouterIp string `json:"routerIp,omitempty"` - // ForceSendFields is a list of field names (e.g. "PeerIp") to + // ForceSendFields is a list of field names (e.g. "PairingKey") 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 @@ -2291,8 +2362,8 @@ type VlanAttachment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PeerIp") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "PairingKey") 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. @@ -4889,6 +4960,281 @@ func (c *ProjectsLocationsNetworksPatchCall) Do(opts ...googleapi.CallOption) (* } +// method id "baremetalsolution.projects.locations.nfsShares.create": + +type ProjectsLocationsNfsSharesCreateCall struct { + s *Service + parent string + nfsshare *NfsShare + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Create an NFS share. +// +// - parent: The parent project and location. +func (r *ProjectsLocationsNfsSharesService) Create(parent string, nfsshare *NfsShare) *ProjectsLocationsNfsSharesCreateCall { + c := &ProjectsLocationsNfsSharesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.nfsshare = nfsshare + 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 *ProjectsLocationsNfsSharesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNfsSharesCreateCall { + 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 *ProjectsLocationsNfsSharesCreateCall) Context(ctx context.Context) *ProjectsLocationsNfsSharesCreateCall { + 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 *ProjectsLocationsNfsSharesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNfsSharesCreateCall) 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.nfsshare) + 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/{+parent}/nfsShares") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "baremetalsolution.projects.locations.nfsShares.create" 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 *ProjectsLocationsNfsSharesCreateCall) 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": "Create an NFS share.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/nfsShares", + // "httpMethod": "POST", + // "id": "baremetalsolution.projects.locations.nfsShares.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent project and location.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/nfsShares", + // "request": { + // "$ref": "NfsShare" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "baremetalsolution.projects.locations.nfsShares.delete": + +type ProjectsLocationsNfsSharesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Delete an NFS share. The underlying volume is automatically +// deleted. +// +// - name: The name of the NFS share to delete. +func (r *ProjectsLocationsNfsSharesService) Delete(name string) *ProjectsLocationsNfsSharesDeleteCall { + c := &ProjectsLocationsNfsSharesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsNfsSharesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNfsSharesDeleteCall { + 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 *ProjectsLocationsNfsSharesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNfsSharesDeleteCall { + 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 *ProjectsLocationsNfsSharesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsNfsSharesDeleteCall) 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, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "baremetalsolution.projects.locations.nfsShares.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 *ProjectsLocationsNfsSharesDeleteCall) 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": "Delete an NFS share. The underlying volume is automatically deleted.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/nfsShares/{nfsSharesId}", + // "httpMethod": "DELETE", + // "id": "baremetalsolution.projects.locations.nfsShares.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the NFS share to delete.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/nfsShares/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "baremetalsolution.projects.locations.nfsShares.get": type ProjectsLocationsNfsSharesGetCall struct { @@ -5252,7 +5598,7 @@ type ProjectsLocationsNfsSharesPatchCall struct { // Patch: Update details of a single NFS share. // -// - name: Output only. The name of the NFS share. +// - name: Immutable. The name of the NFS share. func (r *ProjectsLocationsNfsSharesService) Patch(name string, nfsshare *NfsShare) *ProjectsLocationsNfsSharesPatchCall { c := &ProjectsLocationsNfsSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -5262,6 +5608,7 @@ func (r *ProjectsLocationsNfsSharesService) Patch(name string, nfsshare *NfsShar // UpdateMask sets the optional parameter "updateMask": The list of // fields to update. The only currently supported fields are: `labels` +// `allowed_clients` func (c *ProjectsLocationsNfsSharesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNfsSharesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -5367,14 +5714,14 @@ func (c *ProjectsLocationsNfsSharesPatchCall) Do(opts ...googleapi.CallOption) ( // ], // "parameters": { // "name": { - // "description": "Output only. The name of the NFS share.", + // "description": "Immutable. The name of the NFS share.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/nfsShares/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "The list of fields to update. The only currently supported fields are: `labels`", + // "description": "The list of fields to update. The only currently supported fields are: `labels` `allowed_clients`", // "format": "google-fieldmask", // "location": "query", // "type": "string" diff --git a/bigqueryreservation/v1/bigqueryreservation-api.json b/bigqueryreservation/v1/bigqueryreservation-api.json index 02a07e495ec..8a92d2e742b 100644 --- a/bigqueryreservation/v1/bigqueryreservation-api.json +++ b/bigqueryreservation/v1/bigqueryreservation-api.json @@ -823,7 +823,7 @@ } } }, - "revision": "20220511", + "revision": "20220819", "rootUrl": "https://bigqueryreservation.googleapis.com/", "schemas": { "Assignment": { @@ -840,13 +840,15 @@ "JOB_TYPE_UNSPECIFIED", "PIPELINE", "QUERY", - "ML_EXTERNAL" + "ML_EXTERNAL", + "BACKGROUND" ], "enumDescriptions": [ "Invalid type. Requests with this value will be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`.", "Pipeline (load/export) jobs from the project will use the reservation.", "Query jobs from the project will use the reservation.", - "BigQuery ML jobs that use services external to BigQuery for model training. These jobs will not utilize idle slots from other reservations." + "BigQuery ML jobs that use services external to BigQuery for model training. These jobs will not utilize idle slots from other reservations.", + "Background jobs that BigQuery runs for the customers in the background. This is a preview feature." ], "type": "string" }, diff --git a/bigqueryreservation/v1/bigqueryreservation-gen.go b/bigqueryreservation/v1/bigqueryreservation-gen.go index f1c5ec3fdeb..3a803320002 100644 --- a/bigqueryreservation/v1/bigqueryreservation-gen.go +++ b/bigqueryreservation/v1/bigqueryreservation-gen.go @@ -221,6 +221,8 @@ type Assignment struct { // "ML_EXTERNAL" - BigQuery ML jobs that use services external to // BigQuery for model training. These jobs will not utilize idle slots // from other reservations. + // "BACKGROUND" - Background jobs that BigQuery runs for the customers + // in the background. This is a preview feature. JobType string `json:"jobType,omitempty"` // Name: Output only. Name of the resource. E.g.: diff --git a/civicinfo/v2/civicinfo-api.json b/civicinfo/v2/civicinfo-api.json index a00aa05d425..9be42775a7e 100644 --- a/civicinfo/v2/civicinfo-api.json +++ b/civicinfo/v2/civicinfo-api.json @@ -352,7 +352,7 @@ } } }, - "revision": "20220516", + "revision": "20220823", "rootUrl": "https://civicinfo.googleapis.com/", "schemas": { "AdministrationRegion": { @@ -1267,6 +1267,7 @@ "typeCompoundSection", "typeTerminalPoint", "typeRegulatedArea", + "typeLogicalBorder", "typeDoNotUseReservedToCatchGeneratedFiles", "typeUnknown" ], @@ -1638,6 +1639,7 @@ "e.g. suite, room, hallway, cubicle.", "A terminal point represents a good location for a user to meet a taxi, ridesharing vehicle, or general driver.", "An area controlled in some way by an authoritative source, such as a government-designated COVID containment zone. Features of this type should have one or more gcids corresponding to their specific regulation.", + "RESERVED", "DEPRECATED", "A feature of completely unknown type. This should only be used when absolutely necessary. One example in which this type is useful is in the Chinese importer, which must heuristically segment addresses into components - it often does not know what types to make those components. Please note that the Oyster address formatter does not currently support address components of TYPE_UNKNOWN well." ], diff --git a/civicinfo/v2/civicinfo-gen.go b/civicinfo/v2/civicinfo-gen.go index 8933e40f2ff..22e07777435 100644 --- a/civicinfo/v2/civicinfo-gen.go +++ b/civicinfo/v2/civicinfo-gen.go @@ -1478,6 +1478,7 @@ type GeocodingSummary struct { // authoritative source, such as a government-designated COVID // containment zone. Features of this type should have one or more gcids // corresponding to their specific regulation. + // "typeLogicalBorder" - RESERVED // "typeDoNotUseReservedToCatchGeneratedFiles" - DEPRECATED // "typeUnknown" - A feature of completely unknown type. This should // only be used when absolutely necessary. One example in which this diff --git a/cloudtasks/v2/cloudtasks-api.json b/cloudtasks/v2/cloudtasks-api.json index bde3855323f..4c8f5a70e84 100644 --- a/cloudtasks/v2/cloudtasks-api.json +++ b/cloudtasks/v2/cloudtasks-api.json @@ -685,7 +685,7 @@ } } }, - "revision": "20220803", + "revision": "20220825", "rootUrl": "https://cloudtasks.googleapis.com/", "schemas": { "AppEngineHttpRequest": { @@ -797,7 +797,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", "items": { "type": "string" }, diff --git a/cloudtasks/v2/cloudtasks-gen.go b/cloudtasks/v2/cloudtasks-gen.go index 73bb7addd98..2c56fa0a603 100644 --- a/cloudtasks/v2/cloudtasks-gen.go +++ b/cloudtasks/v2/cloudtasks-gen.go @@ -455,11 +455,12 @@ type Binding struct { // `allUsers`: A special identifier that represents anyone who is on the // internet; with or without a Google account. * // `allAuthenticatedUsers`: A special identifier that represents anyone - // who is authenticated with a Google account or a service account. * - // `user:{emailid}`: An email address that represents a specific Google - // account. For example, `alice@example.com` . * - // `serviceAccount:{emailid}`: An email address that represents a Google - // service account. For example, + // who is authenticated with a Google account or a service account. Does + // not include identities that come from external identity providers + // (IdPs) through identity federation. * `user:{emailid}`: An email + // address that represents a specific Google account. For example, + // `alice@example.com` . * `serviceAccount:{emailid}`: An email address + // that represents a Google service account. For example, // `my-other-app@appspot.gserviceaccount.com`. * // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: // An identifier for a Kubernetes service account diff --git a/cloudtasks/v2beta2/cloudtasks-api.json b/cloudtasks/v2beta2/cloudtasks-api.json index 1047f91a468..3474c1f7513 100644 --- a/cloudtasks/v2beta2/cloudtasks-api.json +++ b/cloudtasks/v2beta2/cloudtasks-api.json @@ -837,7 +837,7 @@ } } }, - "revision": "20220803", + "revision": "20220825", "rootUrl": "https://cloudtasks.googleapis.com/", "schemas": { "AcknowledgeTaskRequest": { @@ -972,7 +972,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", "items": { "type": "string" }, diff --git a/cloudtasks/v2beta2/cloudtasks-gen.go b/cloudtasks/v2beta2/cloudtasks-gen.go index c8c3f5d8173..0c41800e10a 100644 --- a/cloudtasks/v2beta2/cloudtasks-gen.go +++ b/cloudtasks/v2beta2/cloudtasks-gen.go @@ -542,11 +542,12 @@ type Binding struct { // `allUsers`: A special identifier that represents anyone who is on the // internet; with or without a Google account. * // `allAuthenticatedUsers`: A special identifier that represents anyone - // who is authenticated with a Google account or a service account. * - // `user:{emailid}`: An email address that represents a specific Google - // account. For example, `alice@example.com` . * - // `serviceAccount:{emailid}`: An email address that represents a Google - // service account. For example, + // who is authenticated with a Google account or a service account. Does + // not include identities that come from external identity providers + // (IdPs) through identity federation. * `user:{emailid}`: An email + // address that represents a specific Google account. For example, + // `alice@example.com` . * `serviceAccount:{emailid}`: An email address + // that represents a Google service account. For example, // `my-other-app@appspot.gserviceaccount.com`. * // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: // An identifier for a Kubernetes service account diff --git a/cloudtasks/v2beta3/cloudtasks-api.json b/cloudtasks/v2beta3/cloudtasks-api.json index c26fcf3814e..aac032fc347 100644 --- a/cloudtasks/v2beta3/cloudtasks-api.json +++ b/cloudtasks/v2beta3/cloudtasks-api.json @@ -697,7 +697,7 @@ } } }, - "revision": "20220803", + "revision": "20220825", "rootUrl": "https://cloudtasks.googleapis.com/", "schemas": { "AppEngineHttpQueue": { @@ -820,7 +820,7 @@ "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", "items": { "type": "string" }, diff --git a/cloudtasks/v2beta3/cloudtasks-gen.go b/cloudtasks/v2beta3/cloudtasks-gen.go index 651556cda1e..99e30ad1af5 100644 --- a/cloudtasks/v2beta3/cloudtasks-gen.go +++ b/cloudtasks/v2beta3/cloudtasks-gen.go @@ -490,11 +490,12 @@ type Binding struct { // `allUsers`: A special identifier that represents anyone who is on the // internet; with or without a Google account. * // `allAuthenticatedUsers`: A special identifier that represents anyone - // who is authenticated with a Google account or a service account. * - // `user:{emailid}`: An email address that represents a specific Google - // account. For example, `alice@example.com` . * - // `serviceAccount:{emailid}`: An email address that represents a Google - // service account. For example, + // who is authenticated with a Google account or a service account. Does + // not include identities that come from external identity providers + // (IdPs) through identity federation. * `user:{emailid}`: An email + // address that represents a specific Google account. For example, + // `alice@example.com` . * `serviceAccount:{emailid}`: An email address + // that represents a Google service account. For example, // `my-other-app@appspot.gserviceaccount.com`. * // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: // An identifier for a Kubernetes service account diff --git a/connectors/v1/connectors-api.json b/connectors/v1/connectors-api.json index f566c1eb58d..1cf091f69ff 100644 --- a/connectors/v1/connectors-api.json +++ b/connectors/v1/connectors-api.json @@ -1047,7 +1047,7 @@ } } }, - "revision": "20220808", + "revision": "20220823", "rootUrl": "https://connectors.googleapis.com/", "schemas": { "AuditConfig": { @@ -1116,14 +1116,16 @@ "USER_PASSWORD", "OAUTH2_JWT_BEARER", "OAUTH2_CLIENT_CREDENTIALS", - "SSH_PUBLIC_KEY" + "SSH_PUBLIC_KEY", + "OAUTH2_AUTH_CODE_FLOW" ], "enumDescriptions": [ "Authentication type not specified.", "Username and Password Authentication.", "JSON Web Token (JWT) Profile for Oauth 2.0 Authorization Grant based authentication", "Oauth 2.0 Client Credentials Grant Authentication", - "SSH Public Key Authentication" + "SSH Public Key Authentication", + "Oauth 2.0 Authorization Code Flow" ], "type": "string" }, @@ -1157,14 +1159,16 @@ "USER_PASSWORD", "OAUTH2_JWT_BEARER", "OAUTH2_CLIENT_CREDENTIALS", - "SSH_PUBLIC_KEY" + "SSH_PUBLIC_KEY", + "OAUTH2_AUTH_CODE_FLOW" ], "enumDescriptions": [ "Authentication type not specified.", "Username and Password Authentication.", "JSON Web Token (JWT) Profile for Oauth 2.0 Authorization Grant based authentication", "Oauth 2.0 Client Credentials Grant Authentication", - "SSH Public Key Authentication" + "SSH Public Key Authentication", + "Oauth 2.0 Authorization Code Flow" ], "type": "string" }, diff --git a/connectors/v1/connectors-gen.go b/connectors/v1/connectors-gen.go index ce66c86c4bd..fca8f2140e0 100644 --- a/connectors/v1/connectors-gen.go +++ b/connectors/v1/connectors-gen.go @@ -354,6 +354,7 @@ type AuthConfig struct { // "OAUTH2_CLIENT_CREDENTIALS" - Oauth 2.0 Client Credentials Grant // Authentication // "SSH_PUBLIC_KEY" - SSH Public Key Authentication + // "OAUTH2_AUTH_CODE_FLOW" - Oauth 2.0 Authorization Code Flow AuthType string `json:"authType,omitempty"` // Oauth2ClientCredentials: Oauth2ClientCredentials. @@ -405,6 +406,7 @@ type AuthConfigTemplate struct { // "OAUTH2_CLIENT_CREDENTIALS" - Oauth 2.0 Client Credentials Grant // Authentication // "SSH_PUBLIC_KEY" - SSH Public Key Authentication + // "OAUTH2_AUTH_CODE_FLOW" - Oauth 2.0 Authorization Code Flow AuthType string `json:"authType,omitempty"` // ConfigVariableTemplates: Config variables to describe an `AuthConfig` diff --git a/datamigration/v1/datamigration-api.json b/datamigration/v1/datamigration-api.json index b5fb9d7b332..633ddb5ca7a 100644 --- a/datamigration/v1/datamigration-api.json +++ b/datamigration/v1/datamigration-api.json @@ -1049,9 +1049,49 @@ } } }, - "revision": "20220804", + "revision": "20220822", "rootUrl": "https://datamigration.googleapis.com/", "schemas": { + "AlloyDbConnectionProfile": { + "description": "Specifies required connection parameters, and the parameters required to create an AlloyDB destination cluster.", + "id": "AlloyDbConnectionProfile", + "properties": { + "clusterId": { + "description": "Required. The AlloyDB cluster ID that this connection profile is associated with.", + "type": "string" + }, + "settings": { + "$ref": "AlloyDbSettings", + "description": "Immutable. Metadata used to create the destination AlloyDB cluster." + } + }, + "type": "object" + }, + "AlloyDbSettings": { + "description": "Settings for creating an AlloyDB cluster.", + "id": "AlloyDbSettings", + "properties": { + "initialUser": { + "$ref": "UserPassword", + "description": "Required. Input only. Initial user to setup during cluster creation. Required." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels for the AlloyDB cluster created by DMS. An object containing a list of 'key', 'value' pairs.", + "type": "object" + }, + "primaryInstanceSettings": { + "$ref": "PrimaryInstanceSettings" + }, + "vpcNetwork": { + "description": "Required. The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: \"projects/{project_number}/global/networks/{network_id}\". This is required to create a cluster.", + "type": "string" + } + }, + "type": "object" + }, "AuditConfig": { "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", "id": "AuditConfig", @@ -1282,6 +1322,10 @@ "description": "A connection profile definition.", "id": "ConnectionProfile", "properties": { + "alloydb": { + "$ref": "AlloyDbConnectionProfile", + "description": "An AlloyDB cluster connection profile." + }, "cloudsql": { "$ref": "CloudSqlConnectionProfile", "description": "A CloudSQL database connection profile." @@ -1326,13 +1370,15 @@ "DATABASE_PROVIDER_UNSPECIFIED", "CLOUDSQL", "RDS", - "AURORA" + "AURORA", + "ALLOYDB" ], "enumDescriptions": [ "The database provider is unknown.", "CloudSQL runs the database.", "RDS runs the database.", - "Amazon Aurora." + "Amazon Aurora.", + "AlloyDB." ], "type": "string" }, @@ -1393,13 +1439,15 @@ "DATABASE_PROVIDER_UNSPECIFIED", "CLOUDSQL", "RDS", - "AURORA" + "AURORA", + "ALLOYDB" ], "enumDescriptions": [ "The database provider is unknown.", "CloudSQL runs the database.", "RDS runs the database.", - "Amazon Aurora." + "Amazon Aurora.", + "AlloyDB." ], "type": "string" } @@ -1652,6 +1700,18 @@ }, "type": "object" }, + "MachineConfig": { + "description": "MachineConfig describes the configuration of a machine.", + "id": "MachineConfig", + "properties": { + "cpuCount": { + "description": "The number of CPU's in the VM instance.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "MigrationJob": { "description": "Represents a Database Migration Service migration job object.", "id": "MigrationJob", @@ -1997,6 +2057,21 @@ "description": "Required. The IP or hostname of the source PostgreSQL database.", "type": "string" }, + "networkArchitecture": { + "description": "Output only. If the source is a Cloud SQL database, this field indicates the network architecture it's associated with.", + "enum": [ + "NETWORK_ARCHITECTURE_UNSPECIFIED", + "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER", + "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER" + ], + "enumDescriptions": [ + "", + "Instance is in Cloud SQL's old producer network architecture.", + "Instance is in Cloud SQL's new producer network architecture." + ], + "readOnly": true, + "type": "string" + }, "password": { "description": "Required. Input only. The password for the user that Database Migration Service will be using to connect to the database. This field is not returned on request, and the value is encrypted when stored in Database Migration Service.", "type": "string" @@ -2022,6 +2097,40 @@ }, "type": "object" }, + "PrimaryInstanceSettings": { + "description": "Settings for the cluster's primary instance", + "id": "PrimaryInstanceSettings", + "properties": { + "databaseFlags": { + "additionalProperties": { + "type": "string" + }, + "description": "Database flags to pass to AlloyDB when DMS is creating the AlloyDB cluster and instances. See the AlloyDB documentation for how these can be used.", + "type": "object" + }, + "id": { + "description": "Required. The ID of the AlloyDB primary instance. The ID must satisfy the regex expression \"[a-z0-9-]+\".", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels for the AlloyDB primary instance created by DMS. An object containing a list of 'key', 'value' pairs.", + "type": "object" + }, + "machineConfig": { + "$ref": "MachineConfig", + "description": "Configuration for the machines that host the underlying database engine." + }, + "privateIp": { + "description": "Output only. The private IP address for the Instance. This is the connection endpoint for an end-user application.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "PromoteMigrationJobRequest": { "description": "Request message for 'PromoteMigrationJob' request.", "id": "PromoteMigrationJobRequest", @@ -2249,6 +2358,26 @@ }, "type": "object" }, + "UserPassword": { + "description": "The username/password for a database user. Used for specifying initial users at cluster creation time.", + "id": "UserPassword", + "properties": { + "password": { + "description": "The initial password for the user.", + "type": "string" + }, + "passwordSet": { + "description": "Output only. Indicates if the initial_user.password field has been set.", + "readOnly": true, + "type": "boolean" + }, + "user": { + "description": "The database username.", + "type": "string" + } + }, + "type": "object" + }, "VerifyMigrationJobRequest": { "description": "Request message for 'VerifyMigrationJob' request.", "id": "VerifyMigrationJobRequest", diff --git a/datamigration/v1/datamigration-gen.go b/datamigration/v1/datamigration-gen.go index 413ded6ddb7..518eb82c3c2 100644 --- a/datamigration/v1/datamigration-gen.go +++ b/datamigration/v1/datamigration-gen.go @@ -194,6 +194,83 @@ type ProjectsLocationsOperationsService struct { s *Service } +// AlloyDbConnectionProfile: Specifies required connection parameters, +// and the parameters required to create an AlloyDB destination cluster. +type AlloyDbConnectionProfile struct { + // ClusterId: Required. The AlloyDB cluster ID that this connection + // profile is associated with. + ClusterId string `json:"clusterId,omitempty"` + + // Settings: Immutable. Metadata used to create the destination AlloyDB + // cluster. + Settings *AlloyDbSettings `json:"settings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClusterId") 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. "ClusterId") 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 *AlloyDbConnectionProfile) MarshalJSON() ([]byte, error) { + type NoMethod AlloyDbConnectionProfile + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AlloyDbSettings: Settings for creating an AlloyDB cluster. +type AlloyDbSettings struct { + // InitialUser: Required. Input only. Initial user to setup during + // cluster creation. Required. + InitialUser *UserPassword `json:"initialUser,omitempty"` + + // Labels: Labels for the AlloyDB cluster created by DMS. An object + // containing a list of 'key', 'value' pairs. + Labels map[string]string `json:"labels,omitempty"` + + PrimaryInstanceSettings *PrimaryInstanceSettings `json:"primaryInstanceSettings,omitempty"` + + // VpcNetwork: Required. The resource link for the VPC network in which + // cluster resources are created and from which they are accessible via + // Private IP. The network must belong to the same project as the + // cluster. It is specified in the form: + // "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. + VpcNetwork string `json:"vpcNetwork,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InitialUser") 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. "InitialUser") 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 *AlloyDbSettings) MarshalJSON() ([]byte, error) { + type NoMethod AlloyDbSettings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // AuditConfig: Specifies the audit configuration for a service. The // configuration determines which permission types are logged, and what // identities, if any, are exempted from logging. An AuditConfig must @@ -540,6 +617,9 @@ func (s *CloudSqlSettings) MarshalJSON() ([]byte, error) { // ConnectionProfile: A connection profile definition. type ConnectionProfile struct { + // Alloydb: An AlloyDB cluster connection profile. + Alloydb *AlloyDbConnectionProfile `json:"alloydb,omitempty"` + // Cloudsql: A CloudSQL database connection profile. Cloudsql *CloudSqlConnectionProfile `json:"cloudsql,omitempty"` @@ -578,6 +658,7 @@ type ConnectionProfile struct { // "CLOUDSQL" - CloudSQL runs the database. // "RDS" - RDS runs the database. // "AURORA" - Amazon Aurora. + // "ALLOYDB" - AlloyDB. Provider string `json:"provider,omitempty"` // State: The current connection profile state (e.g. DRAFT, READY, or @@ -605,7 +686,7 @@ type ConnectionProfile struct { // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Cloudsql") to + // ForceSendFields is a list of field names (e.g. "Alloydb") 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 @@ -613,7 +694,7 @@ type ConnectionProfile struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cloudsql") to include in + // NullFields is a list of field names (e.g. "Alloydb") 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 @@ -646,6 +727,7 @@ type DatabaseType struct { // "CLOUDSQL" - CloudSQL runs the database. // "RDS" - RDS runs the database. // "AURORA" - Amazon Aurora. + // "ALLOYDB" - AlloyDB. Provider string `json:"provider,omitempty"` // ForceSendFields is a list of field names (e.g. "Engine") to @@ -1098,6 +1180,35 @@ func (s *Location) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MachineConfig: MachineConfig describes the configuration of a +// machine. +type MachineConfig struct { + // CpuCount: The number of CPU's in the VM instance. + CpuCount int64 `json:"cpuCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CpuCount") 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. "CpuCount") 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 *MachineConfig) MarshalJSON() ([]byte, error) { + type NoMethod MachineConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // MigrationJob: Represents a Database Migration Service migration job // object. type MigrationJob struct { @@ -1559,6 +1670,18 @@ type PostgreSqlConnectionProfile struct { // Host: Required. The IP or hostname of the source PostgreSQL database. Host string `json:"host,omitempty"` + // NetworkArchitecture: Output only. If the source is a Cloud SQL + // database, this field indicates the network architecture it's + // associated with. + // + // Possible values: + // "NETWORK_ARCHITECTURE_UNSPECIFIED" + // "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER" - Instance is in Cloud + // SQL's old producer network architecture. + // "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER" - Instance is in Cloud + // SQL's new producer network architecture. + NetworkArchitecture string `json:"networkArchitecture,omitempty"` + // Password: Required. Input only. The password for the user that // Database Migration Service will be using to connect to the database. // This field is not returned on request, and the value is encrypted @@ -1604,6 +1727,52 @@ func (s *PostgreSqlConnectionProfile) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// PrimaryInstanceSettings: Settings for the cluster's primary instance +type PrimaryInstanceSettings struct { + // DatabaseFlags: Database flags to pass to AlloyDB when DMS is creating + // the AlloyDB cluster and instances. See the AlloyDB documentation for + // how these can be used. + DatabaseFlags map[string]string `json:"databaseFlags,omitempty"` + + // Id: Required. The ID of the AlloyDB primary instance. The ID must + // satisfy the regex expression "[a-z0-9-]+". + Id string `json:"id,omitempty"` + + // Labels: Labels for the AlloyDB primary instance created by DMS. An + // object containing a list of 'key', 'value' pairs. + Labels map[string]string `json:"labels,omitempty"` + + // MachineConfig: Configuration for the machines that host the + // underlying database engine. + MachineConfig *MachineConfig `json:"machineConfig,omitempty"` + + // PrivateIp: Output only. The private IP address for the Instance. This + // is the connection endpoint for an end-user application. + PrivateIp string `json:"privateIp,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatabaseFlags") 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. "DatabaseFlags") 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 *PrimaryInstanceSettings) MarshalJSON() ([]byte, error) { + type NoMethod PrimaryInstanceSettings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // PromoteMigrationJobRequest: Request message for 'PromoteMigrationJob' // request. type PromoteMigrationJobRequest struct { @@ -1999,6 +2168,42 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UserPassword: The username/password for a database user. Used for +// specifying initial users at cluster creation time. +type UserPassword struct { + // Password: The initial password for the user. + Password string `json:"password,omitempty"` + + // PasswordSet: Output only. Indicates if the initial_user.password + // field has been set. + PasswordSet bool `json:"passwordSet,omitempty"` + + // User: The database username. + User string `json:"user,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Password") 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. "Password") 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 *UserPassword) MarshalJSON() ([]byte, error) { + type NoMethod UserPassword + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // VerifyMigrationJobRequest: Request message for 'VerifyMigrationJob' // request. type VerifyMigrationJobRequest struct { diff --git a/logging/v2/logging-api.json b/logging/v2/logging-api.json index a56a246cb78..70022f91cb4 100644 --- a/logging/v2/logging-api.json +++ b/logging/v2/logging-api.json @@ -6007,7 +6007,7 @@ } } }, - "revision": "20220805", + "revision": "20220819", "rootUrl": "https://logging.googleapis.com/", "schemas": { "BigQueryOptions": { @@ -6974,7 +6974,7 @@ "type": "string" }, "valueExtractor": { - "description": "Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the log entry field from which the value is to be extracted. 2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, \".*quantity=(\\d+).*\")", + "description": "Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The arguments are: field: The name of the log entry field from which the value is to be extracted. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, \".*quantity=(\\d+).*\")", "type": "string" }, "version": { diff --git a/logging/v2/logging-gen.go b/logging/v2/logging-gen.go index 2a49f23367f..316418fbbbc 100644 --- a/logging/v2/logging-gen.go +++ b/logging/v2/logging-gen.go @@ -2459,9 +2459,9 @@ type LogMetric struct { // ValueExtractor: Optional. A value_extractor is required when using a // distribution logs-based metric to extract the values to record from a // log entry. Two functions are supported for value extraction: - // EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. + // EXTRACT(field) or REGEXP_EXTRACT(field, regex). The arguments are: // field: The name of the log entry field from which the value is to be - // extracted. 2. regex: A regular expression using the Google RE2 syntax + // extracted. regex: A regular expression using the Google RE2 syntax // (https://github.com/google/re2/wiki/Syntax) with a single capture // group to extract data from the specified log entry field. The value // of the field is converted to a string before applying the regex. It diff --git a/retail/v2/retail-api.json b/retail/v2/retail-api.json index bfc3b484a08..6a790ee2d21 100644 --- a/retail/v2/retail-api.json +++ b/retail/v2/retail-api.json @@ -112,7 +112,7 @@ "catalogs": { "methods": { "completeQuery": { - "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:completeQuery", "httpMethod": "GET", "id": "retail.projects.locations.catalogs.completeQuery", @@ -203,7 +203,7 @@ ], "parameters": { "name": { - "description": "Required. Full CompletionConfig resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig", + "description": "Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", "required": true, @@ -468,6 +468,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "replaceCatalogAttribute": { + "description": "Replaces the specified CatalogAttribute in the AttributesConfig by updating the catalog attribute with the same CatalogAttribute.key. If the CatalogAttribute to replace does not exist, a NOT_FOUND error is returned.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig:replaceCatalogAttribute", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute", + "parameterOrder": [ + "attributesConfig" + ], + "parameters": { + "attributesConfig": { + "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+attributesConfig}:replaceCatalogAttribute", + "request": { + "$ref": "GoogleCloudRetailV2ReplaceCatalogAttributeRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2AttributesConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -505,7 +533,7 @@ "products": { "methods": { "addFulfillmentPlaces": { - "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", @@ -533,7 +561,7 @@ ] }, "addLocalInventories": { - "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addLocalInventories", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", @@ -758,7 +786,7 @@ ] }, "removeFulfillmentPlaces": { - "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", @@ -786,7 +814,7 @@ ] }, "removeLocalInventories": { - "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeLocalInventories", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", @@ -814,7 +842,7 @@ ] }, "setInventory": { - "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -848,7 +876,7 @@ "completionData": { "methods": { "import": { - "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionData:import", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.completionData.import", @@ -877,6 +905,168 @@ } } }, + "controls": { + "methods": { + "create": { + "description": "Creates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.controls.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "controlId": { + "description": "Required. The ID to use for the Control, which will become the final component of the Control's resource name. This value should be 4-63 characters, and valid characters are /a-z-_/.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Full resource name of parent catalog. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/controls", + "request": { + "$ref": "GoogleCloudRetailV2Control" + }, + "response": { + "$ref": "GoogleCloudRetailV2Control" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", + "httpMethod": "DELETE", + "id": "retail.projects.locations.catalogs.controls.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Control to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Control.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", + "httpMethod": "GET", + "id": "retail.projects.locations.catalogs.controls.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Control to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleCloudRetailV2Control" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Controls by their parent Catalog.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", + "httpMethod": "GET", + "id": "retail.projects.locations.catalogs.controls.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. A filter to apply on the list results. Supported features: * List all the products under the parent branch if filter is unset. * List controls that are used in a single ServingConfig: 'serving_config = \"boosted_home_page_cvr\"'", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListControls` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/controls", + "response": { + "$ref": "GoogleCloudRetailV2ListControlsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", + "httpMethod": "PATCH", + "id": "retail.projects.locations.catalogs.controls.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Indicates which fields in the provided Control to update. The following are NOT supported: * Control.name If not set or empty, all supported fields are updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+name}", + "request": { + "$ref": "GoogleCloudRetailV2Control" + }, + "response": { + "$ref": "GoogleCloudRetailV2Control" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "operations": { "methods": { "get": { @@ -978,7 +1168,7 @@ ] }, "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.", + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:search", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.placements.search", @@ -1009,6 +1199,187 @@ }, "servingConfigs": { "methods": { + "addControl": { + "description": "Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:addControl", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.addControl", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+servingConfig}:addControl", + "request": { + "$ref": "GoogleCloudRetailV2AddControlRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "description": "Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed in a Catalog, otherwise a FAILED_PRECONDITION error is returned.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Full resource name of parent. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + "required": true, + "type": "string" + }, + "servingConfigId": { + "description": "Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name. This value should be 4-63 characters, and valid characters are /a-z-_/.", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+parent}/servingConfigs", + "request": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "response": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}", + "httpMethod": "DELETE", + "id": "retail.projects.locations.catalogs.servingConfigs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the ServingConfig to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}", + "httpMethod": "GET", + "id": "retail.projects.locations.catalogs.servingConfigs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the ServingConfig to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all ServingConfigs linked to this catalog.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs", + "httpMethod": "GET", + "id": "retail.projects.locations.catalogs.servingConfigs.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of results to return. If unspecified, defaults to 100. If a value greater than 100 is provided, at most 100 results are returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListServingConfigs` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/servingConfigs", + "response": { + "$ref": "GoogleCloudRetailV2ListServingConfigsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a ServingConfig.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}", + "httpMethod": "PATCH", + "id": "retail.projects.locations.catalogs.servingConfigs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/servingConfig/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Indicates which fields in the provided ServingConfig to update. The following are NOT supported: * ServingConfig.name If not set, all supported fields are updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v2/{+name}", + "request": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "response": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "predict": { "description": "Makes a recommendation prediction.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", @@ -1037,8 +1408,36 @@ "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": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:removeControl", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.servingConfigs.removeControl", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+servingConfig}:removeControl", + "request": { + "$ref": "GoogleCloudRetailV2RemoveControlRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "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.", + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. 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", @@ -1167,7 +1566,7 @@ ] }, "rejoin": { - "description": "Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + "description": "Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.userEvents.rejoin", @@ -1371,7 +1770,7 @@ } } }, - "revision": "20220811", + "revision": "20220822", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1535,6 +1934,17 @@ }, "type": "object" }, + "GoogleCloudRetailV2AddControlRequest": { + "description": "Request for AddControl method.", + "id": "GoogleCloudRetailV2AddControlRequest", + "properties": { + "controlId": { + "description": "Required. The id of the control to apply. Assumed to be in the same catalog as the serving config - if id is not found a NOT_FOUND error is returned.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2AddFulfillmentPlacesMetadata": { "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesMetadata", @@ -1944,14 +2354,128 @@ "description": "Completion attribution token in CompleteQueryResponse.attribution_token.", "type": "string" }, - "selectedPosition": { - "description": "End user selected CompleteQueryResponse.CompletionResult.suggestion position, starting from 0.", - "format": "int32", - "type": "integer" + "selectedPosition": { + "description": "End user selected CompleteQueryResponse.CompletionResult.suggestion position, starting from 0.", + "format": "int32", + "type": "integer" + }, + "selectedSuggestion": { + "description": "End user selected CompleteQueryResponse.CompletionResult.suggestion.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2Condition": { + "description": "Metadata that is used to define a condition that triggers an action. A valid condition must specify at least one of 'query_terms' or 'products_filter'. If multiple fields are specified, the condition is met if all the fields are satisfied e.g. if a set of query terms and product_filter are set, then only items matching the product_filter for requests with a query matching the query terms wil get boosted.", + "id": "GoogleCloudRetailV2Condition", + "properties": { + "activeTimeRange": { + "description": "Range of time(s) specifying when Condition is active. Condition true if any time range matches.", + "items": { + "$ref": "GoogleCloudRetailV2ConditionTimeRange" + }, + "type": "array" + }, + "queryTerms": { + "description": "A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).", + "items": { + "$ref": "GoogleCloudRetailV2ConditionQueryTerm" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2ConditionQueryTerm": { + "description": "Query terms that we want to match on.", + "id": "GoogleCloudRetailV2ConditionQueryTerm", + "properties": { + "fullMatch": { + "description": "Whether this is supposed to be a full or partial match.", + "type": "boolean" + }, + "value": { + "description": "The value of the term to match on. Value cannot be empty. Value can have at most 3 terms if specified as a partial match. Each space separated string is considered as one term. For example, \"a b c\" is 3 terms and allowed, but \" a b c d\" is 4 terms and not allowed for a partial match.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2ConditionTimeRange": { + "description": "Used for time-dependent conditions. Example: Want to have rule applied for week long sale.", + "id": "GoogleCloudRetailV2ConditionTimeRange", + "properties": { + "endTime": { + "description": "End of time range. Range is inclusive.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Start of time range. Range is inclusive.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2Control": { + "description": "Configures dynamic metadata that can be linked to a ServingConfig and affect search or recommendation results at serving time.", + "id": "GoogleCloudRetailV2Control", + "properties": { + "associatedServingConfigIds": { + "description": "Output only. List of serving configuration ids that are associated with this control in the same Catalog. Note the association is managed via the ServingConfig, this is an output only denormalized view.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "displayName": { + "description": "Required. The human readable control display name. Used in Retail UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown.", + "type": "string" }, - "selectedSuggestion": { - "description": "End user selected CompleteQueryResponse.CompletionResult.suggestion.", + "name": { + "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`", "type": "string" + }, + "rule": { + "$ref": "GoogleCloudRetailV2Rule", + "description": "A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost \"gShoe\" when query full matches \"Running Shoes\"." + }, + "searchSolutionUseCase": { + "description": "Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow one search_solution_use_case per control.", + "items": { + "enum": [ + "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED", + "SEARCH_SOLUTION_USE_CASE_SEARCH", + "SEARCH_SOLUTION_USE_CASE_BROWSE" + ], + "enumDescriptions": [ + "The value when it's unspecified. In this case, server behavior defaults to SEARCH_SOLUTION_USE_CASE_SEARCH.", + "Search use case. Expects the traffic has a non-empty query.", + "Browse use case. Expects the traffic has an empty query." + ], + "type": "string" + }, + "type": "array" + }, + "solutionTypes": { + "description": "Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.", + "items": { + "enum": [ + "SOLUTION_TYPE_UNSPECIFIED", + "SOLUTION_TYPE_RECOMMENDATION", + "SOLUTION_TYPE_SEARCH" + ], + "enumDescriptions": [ + "Default value.", + "Used for Recommendations AI.", + "Used for Retail Search." + ], + "type": "string" + }, + "type": "array" } }, "type": "object" @@ -2280,6 +2804,24 @@ }, "type": "object" }, + "GoogleCloudRetailV2ListControlsResponse": { + "description": "Response for ListControls method.", + "id": "GoogleCloudRetailV2ListControlsResponse", + "properties": { + "controls": { + "description": "All the Controls for a given catalog.", + "items": { + "$ref": "GoogleCloudRetailV2Control" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pagination token, if not returned indicates the last page.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2ListProductsResponse": { "description": "Response message for ProductService.ListProducts method.", "id": "GoogleCloudRetailV2ListProductsResponse", @@ -2298,6 +2840,24 @@ }, "type": "object" }, + "GoogleCloudRetailV2ListServingConfigsResponse": { + "description": "Response for ListServingConfigs method.", + "id": "GoogleCloudRetailV2ListServingConfigsResponse", + "properties": { + "nextPageToken": { + "description": "Pagination token, if not returned indicates the last page.", + "type": "string" + }, + "servingConfigs": { + "description": "All the ServingConfigs for a given catalog.", + "items": { + "$ref": "GoogleCloudRetailV2ServingConfig" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudRetailV2LocalInventory": { "description": "The inventory information at a place (e.g. a store) identified by a place ID.", "id": "GoogleCloudRetailV2LocalInventory", @@ -2523,7 +3083,7 @@ "type": "array" }, "categories": { - "description": "Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both [\"Shoes \u0026 Accessories\" -\u003e \"Shoes\"] and [\"Sports \u0026 Fitness\" -\u003e \"Athletic Clothing\" -\u003e \"Shoes\"], it could be represented as: \"categories\": [ \"Shoes \u0026 Accessories \u003e Shoes\", \"Sports \u0026 Fitness \u003e Athletic Clothing \u003e Shoes\" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436", + "description": "Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). For example, if a shoes product belongs to both [\"Shoes \u0026 Accessories\" -\u003e \"Shoes\"] and [\"Sports \u0026 Fitness\" -\u003e \"Athletic Clothing\" -\u003e \"Shoes\"], it could be represented as: \"categories\": [ \"Shoes \u0026 Accessories \u003e Shoes\", \"Sports \u0026 Fitness \u003e Athletic Clothing \u003e Shoes\" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436", "items": { "type": "string" }, @@ -2582,6 +3142,14 @@ "description": "Language of the title/description and other string attributes. Use language tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to \"en-US\" if unset.", "type": "string" }, + "localInventories": { + "description": "Output only. A list of local inventories specific to different places. This is only available for users who have Retail Search enabled, and it can be managed by AddLocalInventories and RemoveLocalInventories APIs.", + "items": { + "$ref": "GoogleCloudRetailV2LocalInventory" + }, + "readOnly": true, + "type": "array" + }, "materials": { "description": "The material of the product. For example, \"leather\", \"wooden\". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [material](https://support.google.com/merchants/answer/6324410). Schema.org property [Product.material](https://schema.org/material).", "items": { @@ -2847,7 +3415,7 @@ "type": "object" }, "GoogleCloudRetailV2RejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2RejoinUserEventsMetadata", "properties": {}, "type": "object" @@ -2857,7 +3425,7 @@ "id": "GoogleCloudRetailV2RejoinUserEventsRequest", "properties": { "userEventRejoinScope": { - "description": "The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an invalid integer value.", + "description": "The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to an invalid integer value.", "enum": [ "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED", "JOINED_EVENTS", @@ -2874,7 +3442,7 @@ "type": "object" }, "GoogleCloudRetailV2RejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2RejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -2896,6 +3464,17 @@ }, "type": "object" }, + "GoogleCloudRetailV2RemoveControlRequest": { + "description": "Request for RemoveControl method.", + "id": "GoogleCloudRetailV2RemoveControlRequest", + "properties": { + "controlId": { + "description": "Required. The id of the control to apply. Assumed to be in the same catalog as the serving config.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata": { "description": "Metadata related to the progress of the RemoveFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.RemoveFulfillmentPlaces method.", "id": "GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata", @@ -2970,6 +3549,209 @@ "properties": {}, "type": "object" }, + "GoogleCloudRetailV2ReplaceCatalogAttributeRequest": { + "description": "Request for CatalogService.ReplaceCatalogAttribute method.", + "id": "GoogleCloudRetailV2ReplaceCatalogAttributeRequest", + "properties": { + "catalogAttribute": { + "$ref": "GoogleCloudRetailV2CatalogAttribute", + "description": "Required. The updated CatalogAttribute." + }, + "updateMask": { + "description": "Indicates which fields in the provided CatalogAttribute to update. The following are NOT supported: * CatalogAttribute.key If not set, all supported fields are updated.", + "format": "google-fieldmask", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2Rule": { + "description": "A rule is a condition-action pair * A condition defines when a rule is to be triggered. * An action specifies what occurs on that trigger. Currently rules only work for controls with SOLUTION_TYPE_SEARCH.", + "id": "GoogleCloudRetailV2Rule", + "properties": { + "boostAction": { + "$ref": "GoogleCloudRetailV2RuleBoostAction", + "description": "A boost action." + }, + "condition": { + "$ref": "GoogleCloudRetailV2Condition", + "description": "Required. The condition that triggers the rule. If the condition is empty, the rule will always apply." + }, + "doNotAssociateAction": { + "$ref": "GoogleCloudRetailV2RuleDoNotAssociateAction", + "description": "Prevents term from being associated with other terms." + }, + "filterAction": { + "$ref": "GoogleCloudRetailV2RuleFilterAction", + "description": "Filters results." + }, + "ignoreAction": { + "$ref": "GoogleCloudRetailV2RuleIgnoreAction", + "description": "Ignores specific terms from query during search." + }, + "onewaySynonymsAction": { + "$ref": "GoogleCloudRetailV2RuleOnewaySynonymsAction", + "description": "Treats specific term as a synonym with a group of terms. Group of terms will not be treated as synonyms with the specific term." + }, + "redirectAction": { + "$ref": "GoogleCloudRetailV2RuleRedirectAction", + "description": "Redirects a shopper to a specific page." + }, + "replacementAction": { + "$ref": "GoogleCloudRetailV2RuleReplacementAction", + "description": "Replaces specific terms in the query." + }, + "twowaySynonymsAction": { + "$ref": "GoogleCloudRetailV2RuleTwowaySynonymsAction", + "description": "Treats a set of terms as synonyms of one another." + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleBoostAction": { + "description": "A boost action to apply to results matching condition specified above.", + "id": "GoogleCloudRetailV2RuleBoostAction", + "properties": { + "boost": { + "description": "Strength of the condition boost, which must be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the item a big promotion. However, it does not necessarily mean that the boosted item will be the top result at all times, nor that other items will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant items. Setting to -1.0 gives the item a big demotion. However, results that are deeply relevant might still be shown. The item will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored.", + "format": "float", + "type": "number" + }, + "productsFilter": { + "description": "The filter can have a max size of 5000 characters. An expression which specifies which products to apply an action to. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost products with product ID \"product_1\" or \"product_2\", and color \"Red\" or \"Blue\": *(id: ANY(\"product_1\", \"product_2\")) * *AND * *(colorFamilies: ANY(\"Red\", \"Blue\")) *", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleDoNotAssociateAction": { + "description": "Prevents `query_term` from being associated with specified terms during search. Example: Don't associate \"gShoe\" and \"cheap\".", + "id": "GoogleCloudRetailV2RuleDoNotAssociateAction", + "properties": { + "doNotAssociateTerms": { + "description": "Cannot contain duplicates or the query term. Can specify up to 100 terms.", + "items": { + "type": "string" + }, + "type": "array" + }, + "queryTerms": { + "description": "Terms from the search query. Will not consider do_not_associate_terms for search if in search query. Can specify up to 100 terms.", + "items": { + "type": "string" + }, + "type": "array" + }, + "terms": { + "description": "Will be [deprecated = true] post migration;", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleFilterAction": { + "description": "* Rule Condition: - No Condition.query_terms provided is a global match. - 1 or more Condition.query_terms provided are combined with OR operator. * Action Input: The request query and filter that are applied to the retrieved products, in addition to any filters already provided with the SearchRequest. The AND operator is used to combine the query's existing filters with the filter rule(s). NOTE: May result in 0 results when filters conflict. * Action Result: Filters the returned objects to be ONLY those that passed the filter.", + "id": "GoogleCloudRetailV2RuleFilterAction", + "properties": { + "filter": { + "description": "A filter to apply on the matching condition results. Supported features: * filter must be set. * Filter syntax is identical to SearchRequest.filter. See more details at the Retail Search [user guide](/retail/search/docs/filter-and-order#filter). * To filter products with product ID \"product_1\" or \"product_2\", and color \"Red\" or \"Blue\": *(id: ANY(\"product_1\", \"product_2\")) * *AND * *(colorFamilies: ANY(\"Red\", \"Blue\")) *", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleIgnoreAction": { + "description": "Prevents a term in the query from being used in search. Example: Don't search for \"shoddy\".", + "id": "GoogleCloudRetailV2RuleIgnoreAction", + "properties": { + "ignoreTerms": { + "description": "Terms to ignore in the search query.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleOnewaySynonymsAction": { + "description": "Maps a set of terms to a set of synonyms. Set of synonyms will be treated as synonyms of each query term only. `query_terms` will not be treated as synonyms of each other. Example: \"sneakers\" will use a synonym of \"shoes\". \"shoes\" will not use a synonym of \"sneakers\".", + "id": "GoogleCloudRetailV2RuleOnewaySynonymsAction", + "properties": { + "onewayTerms": { + "description": "Will be [deprecated = true] post migration;", + "items": { + "type": "string" + }, + "type": "array" + }, + "queryTerms": { + "description": "Terms from the search query. Will treat synonyms as their synonyms. Not themselves synonyms of the synonyms. Can specify up to 100 terms.", + "items": { + "type": "string" + }, + "type": "array" + }, + "synonyms": { + "description": "Defines a set of synonyms. Cannot contain duplicates. Can specify up to 100 synonyms.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleRedirectAction": { + "description": "Redirects a shopper to a specific page. * Rule Condition: - Must specify Condition.query_terms. * Action Input: Request Query * Action Result: Redirects shopper to provided uri.", + "id": "GoogleCloudRetailV2RuleRedirectAction", + "properties": { + "redirectUri": { + "description": "URL must have length equal or less than 2000 characters.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleReplacementAction": { + "description": "Replaces a term in the query. Multiple replacement candidates can be specified. All `query_terms` will be replaced with the replacement term. Example: Replace \"gShoe\" with \"google shoe\".", + "id": "GoogleCloudRetailV2RuleReplacementAction", + "properties": { + "queryTerms": { + "description": "Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms.", + "items": { + "type": "string" + }, + "type": "array" + }, + "replacementTerm": { + "description": "Term that will be used for replacement.", + "type": "string" + }, + "term": { + "description": "Will be [deprecated = true] post migration;", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2RuleTwowaySynonymsAction": { + "description": "Creates a set of terms that will be treated as synonyms of each other. Example: synonyms of \"sneakers\" and \"shoes\". * \"sneakers\" will use a synonym of \"shoes\". * \"shoes\" will use a synonym of \"sneakers\".", + "id": "GoogleCloudRetailV2RuleTwowaySynonymsAction", + "properties": { + "synonyms": { + "description": "Defines a set of synonyms. Can specify up to 100 synonyms. Must specify at least 2 synonyms.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudRetailV2SearchRequest": { "description": "Request message for SearchService.Search method.", "id": "GoogleCloudRetailV2SearchRequest", @@ -3018,7 +3800,7 @@ "type": "string" }, "pageCategories": { - "description": "The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"].", + "description": "The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"].", "items": { "type": "string" }, @@ -3035,7 +3817,7 @@ }, "personalizationSpec": { "$ref": "GoogleCloudRetailV2SearchRequestPersonalizationSpec", - "description": "The specification for personalization." + "description": "The specification for personalization. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec." }, "query": { "description": "Raw search query. If this field is empty, the request is considered a category browsing request and returned results are based on filter and page_categories.", @@ -3053,9 +3835,9 @@ "FACETED_SEARCH_ONLY" ], "enumDescriptions": [ - "Default value. In this case both product search and faceted search will be performed. Both [SearchResponse.SearchResult] and [SearchResponse.Facet] will be returned.", - "Only product search will be performed. The faceted search will be disabled. Only [SearchResponse.SearchResult] will be returned. [SearchResponse.Facet] will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", - "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." + "Default value. In this case both product search and faceted search will be performed. Both SearchResponse.SearchResult and SearchResponse.Facet will be returned.", + "Only product search will be performed. The faceted search will be disabled. Only SearchResponse.SearchResult will be returned. SearchResponse.Facet will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", + "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only SearchResponse.Facet will be returned. SearchResponse.SearchResult will not be returned." ], "type": "string" }, @@ -3455,6 +4237,139 @@ }, "type": "object" }, + "GoogleCloudRetailV2ServingConfig": { + "description": "Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions).", + "id": "GoogleCloudRetailV2ServingConfig", + "properties": { + "boostControlIds": { + "description": "Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100. Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "displayName": { + "description": "Required. The human readable serving config display name. Used in Retail UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + "type": "string" + }, + "diversityLevel": { + "description": "How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "type": "string" + }, + "diversityType": { + "description": "What kind of diversity to use - data driven or rule based.", + "enum": [ + "DIVERSITY_TYPE_UNSPECIFIED", + "RULE_BASED_DIVERSITY", + "DATA_DRIVEN_DIVERSITY" + ], + "enumDescriptions": [ + "Default value.", + "Rule based diversity.", + "Data driven diversity." + ], + "type": "string" + }, + "doNotAssociateControlIds": { + "description": "Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute. - Order does not matter. - Maximum number of specifications is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "dynamicFacetSpec": { + "$ref": "GoogleCloudRetailV2SearchRequestDynamicFacetSpec", + "description": "The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated. Can only be set if solution_types is SOLUTION_TYPE_SEARCH." + }, + "enableCategoryFilterLevel": { + "description": "Whether to add additional category filters on the `similar-items` model. If not specified, we enable it by default. Allowed values are: * `no-category-match`: No additional filtering of original results from the model and the customer's filters. * `relaxed-category-match`: Only keep results with categories that match at least one item categories in the PredictRequests's context item. * If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match). Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "type": "string" + }, + "facetControlIds": { + "description": "Facet specifications for faceted search. If empty, no facets are returned. The ids refer to the ids of Control resources with only the Facet control set. These controls are assumed to be in the same Catalog as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is returned. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "filterControlIds": { + "description": "Condition filter specifications. If a product matches multiple conditions in the specifications, filters from these specifications are all applied and combined via the AND operator. Maximum number of specifications is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ignoreControlIds": { + "description": "Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute. - Order does not matter. - Maximum number of specifications is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "modelId": { + "description": "The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "type": "string" + }, + "name": { + "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/servingConfig/*`", + "type": "string" + }, + "onewaySynonymsControlIds": { + "description": "Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "personalizationSpec": { + "$ref": "GoogleCloudRetailV2SearchRequestPersonalizationSpec", + "description": "The specification for personalization spec. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec." + }, + "priceRerankingLevel": { + "description": "How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are: * `no-price-reranking` * `low-price-raranking` * `medium-price-reranking` * `high-price-reranking` If not specified, we choose default based on model type. Default value: `no-price-reranking`. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "type": "string" + }, + "redirectControlIds": { + "description": "Condition redirect specifications. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 1000. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "replacementControlIds": { + "description": "Condition replacement specifications. - Applied according to the order in the list. - A previously replaced term can not be re-replaced. - Maximum number of specifications is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + }, + "solutionTypes": { + "description": "Required. Immutable. Specifies the solution types that a serving config can be associated with. Currently we support setting only one type of solution.", + "items": { + "enum": [ + "SOLUTION_TYPE_UNSPECIFIED", + "SOLUTION_TYPE_RECOMMENDATION", + "SOLUTION_TYPE_SEARCH" + ], + "enumDescriptions": [ + "Default value.", + "Used for Recommendations AI.", + "Used for Retail Search." + ], + "type": "string" + }, + "type": "array" + }, + "twowaySynonymsControlIds": { + "description": "Condition synonyms specifications. If multiple syonyms conditions match, all matching synonyms control in the list will execute. Order of controls in the list will not matter. Maximum number of specifications is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudRetailV2SetDefaultBranchRequest": { "description": "Request message to set a specified branch as new default_branch.", "id": "GoogleCloudRetailV2SetDefaultBranchRequest", @@ -3564,7 +4479,7 @@ "type": "string" }, "pageCategories": { - "description": "The categories associated with a category page. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.", + "description": "The categories associated with a category page. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.", "items": { "type": "string" }, @@ -3729,7 +4644,7 @@ "id": "GoogleCloudRetailV2alphaCreateModelMetadata", "properties": { "model": { - "description": "The resource name of the model that this create applies to. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "The resource name of the model that this create applies to. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "type": "string" } }, @@ -3747,7 +4662,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaExportMetadata": { - "description": "Metadata related to the progress of the Export operation. This will be returned by the google.longrunning.Operation.metadata field.", + "description": "Metadata related to the progress of the Export operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudRetailV2alphaExportMetadata", "properties": { "createTime": { @@ -4207,13 +5122,13 @@ "type": "object" }, "GoogleCloudRetailV2alphaRejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2alphaRejoinUserEventsMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaRejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2alphaRejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -4282,7 +5197,7 @@ "id": "GoogleCloudRetailV2alphaTuneModelMetadata", "properties": { "model": { - "description": "The resource name of the model that this tune applies to. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "The resource name of the model that this tune applies to. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "type": "string" } }, @@ -4362,7 +5277,7 @@ "type": "object" }, "GoogleCloudRetailV2betaExportMetadata": { - "description": "Metadata related to the progress of the Export operation. This will be returned by the google.longrunning.Operation.metadata field.", + "description": "Metadata related to the progress of the Export operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudRetailV2betaExportMetadata", "properties": { "createTime": { @@ -4555,13 +5470,13 @@ "type": "object" }, "GoogleCloudRetailV2betaRejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2betaRejoinUserEventsMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaRejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2betaRejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { diff --git a/retail/v2/retail-gen.go b/retail/v2/retail-gen.go index 4694093ef57..5c432ea2073 100644 --- a/retail/v2/retail-gen.go +++ b/retail/v2/retail-gen.go @@ -172,6 +172,7 @@ func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsS rs.AttributesConfig = NewProjectsLocationsCatalogsAttributesConfigService(s) rs.Branches = NewProjectsLocationsCatalogsBranchesService(s) rs.CompletionData = NewProjectsLocationsCatalogsCompletionDataService(s) + rs.Controls = NewProjectsLocationsCatalogsControlsService(s) rs.Operations = NewProjectsLocationsCatalogsOperationsService(s) rs.Placements = NewProjectsLocationsCatalogsPlacementsService(s) rs.ServingConfigs = NewProjectsLocationsCatalogsServingConfigsService(s) @@ -188,6 +189,8 @@ type ProjectsLocationsCatalogsService struct { CompletionData *ProjectsLocationsCatalogsCompletionDataService + Controls *ProjectsLocationsCatalogsControlsService + Operations *ProjectsLocationsCatalogsOperationsService Placements *ProjectsLocationsCatalogsPlacementsService @@ -248,6 +251,15 @@ type ProjectsLocationsCatalogsCompletionDataService struct { s *Service } +func NewProjectsLocationsCatalogsControlsService(s *Service) *ProjectsLocationsCatalogsControlsService { + rs := &ProjectsLocationsCatalogsControlsService{s: s} + return rs +} + +type ProjectsLocationsCatalogsControlsService struct { + s *Service +} + func NewProjectsLocationsCatalogsOperationsService(s *Service) *ProjectsLocationsCatalogsOperationsService { rs := &ProjectsLocationsCatalogsOperationsService{s: s} return rs @@ -624,6 +636,36 @@ func (s *GoogleCloudRetailV2AddCatalogAttributeRequest) MarshalJSON() ([]byte, e return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2AddControlRequest: Request for AddControl method. +type GoogleCloudRetailV2AddControlRequest struct { + // ControlId: Required. The id of the control to apply. Assumed to be in + // the same catalog as the serving config - if id is not found a + // NOT_FOUND error is returned. + ControlId string `json:"controlId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ControlId") 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. "ControlId") 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 *GoogleCloudRetailV2AddControlRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2AddControlRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2AddFulfillmentPlacesMetadata: Metadata related to // the progress of the AddFulfillmentPlaces operation. Currently empty // because there is no meaningful metadata populated from the @@ -1408,6 +1450,198 @@ func (s *GoogleCloudRetailV2CompletionDetail) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2Condition: Metadata that is used to define a +// condition that triggers an action. A valid condition must specify at +// least one of 'query_terms' or 'products_filter'. If multiple fields +// are specified, the condition is met if all the fields are satisfied +// e.g. if a set of query terms and product_filter are set, then only +// items matching the product_filter for requests with a query matching +// the query terms wil get boosted. +type GoogleCloudRetailV2Condition struct { + // ActiveTimeRange: Range of time(s) specifying when Condition is + // active. Condition true if any time range matches. + ActiveTimeRange []*GoogleCloudRetailV2ConditionTimeRange `json:"activeTimeRange,omitempty"` + + // QueryTerms: A list (up to 10 entries) of terms to match the query on. + // If not specified, match all queries. If many query terms are + // specified, the condition is matched if any of the terms is a match + // (i.e. using the OR operator). + QueryTerms []*GoogleCloudRetailV2ConditionQueryTerm `json:"queryTerms,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveTimeRange") 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. "ActiveTimeRange") 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 *GoogleCloudRetailV2Condition) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2Condition + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2ConditionQueryTerm: Query terms that we want to +// match on. +type GoogleCloudRetailV2ConditionQueryTerm struct { + // FullMatch: Whether this is supposed to be a full or partial match. + FullMatch bool `json:"fullMatch,omitempty"` + + // Value: The value of the term to match on. Value cannot be empty. + // Value can have at most 3 terms if specified as a partial match. Each + // space separated string is considered as one term. For example, "a b + // c" is 3 terms and allowed, but " a b c d" is 4 terms and not allowed + // for a partial match. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FullMatch") 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. "FullMatch") 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 *GoogleCloudRetailV2ConditionQueryTerm) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2ConditionQueryTerm + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2ConditionTimeRange: Used for time-dependent +// conditions. Example: Want to have rule applied for week long sale. +type GoogleCloudRetailV2ConditionTimeRange struct { + // EndTime: End of time range. Range is inclusive. + EndTime string `json:"endTime,omitempty"` + + // StartTime: Start of time range. Range is inclusive. + StartTime string `json:"startTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "EndTime") 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 *GoogleCloudRetailV2ConditionTimeRange) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2ConditionTimeRange + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2Control: Configures dynamic metadata that can be +// linked to a ServingConfig and affect search or recommendation results +// at serving time. +type GoogleCloudRetailV2Control struct { + // AssociatedServingConfigIds: Output only. List of serving + // configuration ids that are associated with this control in the same + // Catalog. Note the association is managed via the ServingConfig, this + // is an output only denormalized view. + AssociatedServingConfigIds []string `json:"associatedServingConfigIds,omitempty"` + + // DisplayName: Required. The human readable control display name. Used + // in Retail UI. This field must be a UTF-8 encoded string with a length + // limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is + // thrown. + DisplayName string `json:"displayName,omitempty"` + + // Name: Immutable. Fully qualified name + // `projects/*/locations/global/catalogs/*/controls/*` + Name string `json:"name,omitempty"` + + // Rule: A rule control - a condition-action pair. Enacts a set action + // when the condition is triggered. For example: Boost "gShoe" when + // query full matches "Running Shoes". + Rule *GoogleCloudRetailV2Rule `json:"rule,omitempty"` + + // SearchSolutionUseCase: Specifies the use case for the control. + // Affects what condition fields can be set. Only settable by search + // controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not + // specified. Currently only allow one search_solution_use_case per + // control. + // + // Possible values: + // "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED" - The value when it's + // unspecified. In this case, server behavior defaults to + // SEARCH_SOLUTION_USE_CASE_SEARCH. + // "SEARCH_SOLUTION_USE_CASE_SEARCH" - Search use case. Expects the + // traffic has a non-empty query. + // "SEARCH_SOLUTION_USE_CASE_BROWSE" - Browse use case. Expects the + // traffic has an empty query. + SearchSolutionUseCase []string `json:"searchSolutionUseCase,omitempty"` + + // SolutionTypes: Required. Immutable. The solution types that the + // control is used for. Currently we support setting only one type of + // solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is + // supported at the moment. If no solution type is provided at creation + // time, will default to SOLUTION_TYPE_SEARCH. + // + // Possible values: + // "SOLUTION_TYPE_UNSPECIFIED" - Default value. + // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. + // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. + SolutionTypes []string `json:"solutionTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AssociatedServingConfigIds") 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. + // "AssociatedServingConfigIds") 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 *GoogleCloudRetailV2Control) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2Control + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2CustomAttribute: A custom attribute that is not // explicitly modeled in Product. type GoogleCloudRetailV2CustomAttribute struct { @@ -2068,6 +2302,43 @@ func (s *GoogleCloudRetailV2ListCatalogsResponse) MarshalJSON() ([]byte, error) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2ListControlsResponse: Response for ListControls +// method. +type GoogleCloudRetailV2ListControlsResponse struct { + // Controls: All the Controls for a given catalog. + Controls []*GoogleCloudRetailV2Control `json:"controls,omitempty"` + + // NextPageToken: Pagination token, if not returned indicates the last + // page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Controls") 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. "Controls") 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 *GoogleCloudRetailV2ListControlsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2ListControlsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2ListProductsResponse: Response message for // ProductService.ListProducts method. type GoogleCloudRetailV2ListProductsResponse struct { @@ -2106,6 +2377,43 @@ func (s *GoogleCloudRetailV2ListProductsResponse) MarshalJSON() ([]byte, error) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2ListServingConfigsResponse: Response for +// ListServingConfigs method. +type GoogleCloudRetailV2ListServingConfigsResponse struct { + // NextPageToken: Pagination token, if not returned indicates the last + // page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServingConfigs: All the ServingConfigs for a given catalog. + ServingConfigs []*GoogleCloudRetailV2ServingConfig `json:"servingConfigs,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "NextPageToken") 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 *GoogleCloudRetailV2ListServingConfigsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2ListServingConfigsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2LocalInventory: The inventory information at a // place (e.g. a store) identified by a place ID. type GoogleCloudRetailV2LocalInventory struct { @@ -2556,12 +2864,12 @@ type GoogleCloudRetailV2Product struct { // one product belonging to several parallel categories. Strongly // recommended using the full path for better search / recommendation // quality. To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). For example, if a shoes product - // belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & - // Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented - // as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness - // > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product + // different hierarchies. If '>' is part of the category name, replace + // it with other character(s). For example, if a shoes product belongs + // to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> + // "Athletic Clothing" -> "Shoes"], it could be represented as: + // "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > + // Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product // otherwise an INVALID_ARGUMENT error is returned. At most 250 values // are allowed per Product. Empty values are not allowed. Each value // must be a UTF-8 encoded string with a length limit of 5,000 @@ -2662,6 +2970,12 @@ type GoogleCloudRetailV2Product struct { // search this field is in use. It defaults to "en-US" if unset. LanguageCode string `json:"languageCode,omitempty"` + // LocalInventories: Output only. A list of local inventories specific + // to different places. This is only available for users who have Retail + // Search enabled, and it can be managed by AddLocalInventories and + // RemoveLocalInventories APIs. + LocalInventories []*GoogleCloudRetailV2LocalInventory `json:"localInventories,omitempty"` + // Materials: The material of the product. For example, "leather", // "wooden". A maximum of 20 values are allowed. Each value must be a // UTF-8 encoded string with a length limit of 200 characters. @@ -3248,7 +3562,7 @@ func (s *GoogleCloudRetailV2Rating) UnmarshalJSON(data []byte) error { } // GoogleCloudRetailV2RejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2RejoinUserEventsMetadata struct { } @@ -3257,7 +3571,7 @@ type GoogleCloudRetailV2RejoinUserEventsMetadata struct { type GoogleCloudRetailV2RejoinUserEventsRequest struct { // UserEventRejoinScope: The type of the user event rejoin to define the // scope and range of the user events to be rejoined with the latest - // product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if + // product catalog. Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if // this field is not set, or set to an invalid integer value. // // Possible values: @@ -3296,7 +3610,7 @@ func (s *GoogleCloudRetailV2RejoinUserEventsRequest) MarshalJSON() ([]byte, erro } // GoogleCloudRetailV2RejoinUserEventsResponse: Response message for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2RejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -3357,6 +3671,36 @@ func (s *GoogleCloudRetailV2RemoveCatalogAttributeRequest) MarshalJSON() ([]byte return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2RemoveControlRequest: Request for RemoveControl +// method. +type GoogleCloudRetailV2RemoveControlRequest struct { + // ControlId: Required. The id of the control to apply. Assumed to be in + // the same catalog as the serving config. + ControlId string `json:"controlId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ControlId") 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. "ControlId") 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 *GoogleCloudRetailV2RemoveControlRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RemoveControlRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata: Metadata related // to the progress of the RemoveFulfillmentPlaces operation. Currently // empty because there is no meaningful metadata populated from the @@ -3482,197 +3826,79 @@ func (s *GoogleCloudRetailV2RemoveLocalInventoriesRequest) MarshalJSON() ([]byte type GoogleCloudRetailV2RemoveLocalInventoriesResponse struct { } -// GoogleCloudRetailV2SearchRequest: Request message for -// SearchService.Search method. -type GoogleCloudRetailV2SearchRequest struct { - // BoostSpec: Boost specification to boost certain products. See more - // details at this user guide - // (https://cloud.google.com/retail/docs/boosting). Notice that if both - // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, - // the boost conditions from both places are evaluated. If a search - // request matches multiple boost conditions, the final boost score is - // equal to the sum of the boost scores from all matched boost - // conditions. - BoostSpec *GoogleCloudRetailV2SearchRequestBoostSpec `json:"boostSpec,omitempty"` - - // Branch: The branch resource name, such as - // `projects/*/locations/global/catalogs/default_catalog/branches/0`. - // Use "default_branch" as the branch ID or leave this field empty, to - // search products under the default branch. - Branch string `json:"branch,omitempty"` - - // CanonicalFilter: The default filter that is applied when a user - // performs a search without checking any filters on the search page. - // The filter applied to every search request when quality improvement - // such as query expansion is needed. For example, if a query does not - // have enough results, an expanded query with - // SearchRequest.canonical_filter will be returned as a supplement of - // the original query. This field is strongly recommended to achieve - // high search quality. See SearchRequest.filter for more details about - // filter syntax. - CanonicalFilter string `json:"canonicalFilter,omitempty"` +// GoogleCloudRetailV2ReplaceCatalogAttributeRequest: Request for +// CatalogService.ReplaceCatalogAttribute method. +type GoogleCloudRetailV2ReplaceCatalogAttributeRequest struct { + // CatalogAttribute: Required. The updated CatalogAttribute. + CatalogAttribute *GoogleCloudRetailV2CatalogAttribute `json:"catalogAttribute,omitempty"` - // DynamicFacetSpec: Deprecated. Refer to - // https://cloud.google.com/retail/docs/configs#dynamic to enable - // dynamic facets. Do not set this field. The specification for - // dynamically generated facets. Notice that only textual facets can be - // dynamically generated. - DynamicFacetSpec *GoogleCloudRetailV2SearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` + // UpdateMask: Indicates which fields in the provided CatalogAttribute + // to update. The following are NOT supported: * CatalogAttribute.key If + // not set, all supported fields are updated. + UpdateMask string `json:"updateMask,omitempty"` - // FacetSpecs: Facet specifications for faceted search. If empty, no - // facets are returned. A maximum of 100 values are allowed. Otherwise, - // an INVALID_ARGUMENT error is returned. - FacetSpecs []*GoogleCloudRetailV2SearchRequestFacetSpec `json:"facetSpecs,omitempty"` + // ForceSendFields is a list of field names (e.g. "CatalogAttribute") 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:"-"` - // Filter: The filter syntax consists of an expression language for - // constructing a predicate from one or more fields of the products - // being filtered. Filter expression is case-sensitive. See more details - // at this user guide - // (https://cloud.google.com/retail/docs/filter-and-order#filter). If - // this field is unrecognizable, an INVALID_ARGUMENT is returned. - Filter string `json:"filter,omitempty"` - - // Labels: The labels applied to a resource must meet the following - // requirements: * Each resource can have multiple labels, up to a - // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters - // and cannot be empty. Values can be empty and have a maximum length of - // 63 characters. * Keys and values can contain only lowercase letters, - // numeric characters, underscores, and dashes. All characters must use - // UTF-8 encoding, and international characters are allowed. * The key - // portion of a label must be unique. However, you can use the same key - // with multiple resources. * Keys must start with a lowercase letter or - // international character. See Google Cloud Document - // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - // for more details. - Labels map[string]string `json:"labels,omitempty"` - - // Offset: A 0-indexed integer that specifies the current offset (that - // is, starting result location, amongst the Products deemed by the API - // as relevant) in search results. This field is only considered if - // page_token is unset. If this field is negative, an INVALID_ARGUMENT - // is returned. - Offset int64 `json:"offset,omitempty"` - - // OrderBy: The order in which products are returned. Products can be - // ordered by a field in an Product object. Leave it unset if ordered by - // relevance. OrderBy expression is case-sensitive. See more details at - // this user guide - // (https://cloud.google.com/retail/docs/filter-and-order#order). If - // this field is unrecognizable, an INVALID_ARGUMENT is returned. - OrderBy string `json:"orderBy,omitempty"` - - // PageCategories: The categories associated with a category page. - // Required for category navigation queries to achieve good search - // quality. The format should be the same as UserEvent.page_categories; - // To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). Category pages include special - // pages such as sales or promotions. For instance, a special sale page - // may have the category hierarchy: "pageCategories" : ["Sales > 2017 - // Black Friday Deals"]. - PageCategories []string `json:"pageCategories,omitempty"` + // NullFields is a list of field names (e.g. "CatalogAttribute") 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:"-"` +} - // PageSize: Maximum number of Products to return. If unspecified, - // defaults to a reasonable value. The maximum allowed value is 120. - // Values above 120 will be coerced to 120. If this field is negative, - // an INVALID_ARGUMENT is returned. - PageSize int64 `json:"pageSize,omitempty"` +func (s *GoogleCloudRetailV2ReplaceCatalogAttributeRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2ReplaceCatalogAttributeRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // PageToken: A page token SearchResponse.next_page_token, received from - // a previous SearchService.Search call. Provide this to retrieve the - // subsequent page. When paginating, all other parameters provided to - // SearchService.Search must match the call that provided the page - // token. Otherwise, an INVALID_ARGUMENT error is returned. - PageToken string `json:"pageToken,omitempty"` +// GoogleCloudRetailV2Rule: A rule is a condition-action pair * A +// condition defines when a rule is to be triggered. * An action +// specifies what occurs on that trigger. Currently rules only work for +// controls with SOLUTION_TYPE_SEARCH. +type GoogleCloudRetailV2Rule struct { + // BoostAction: A boost action. + BoostAction *GoogleCloudRetailV2RuleBoostAction `json:"boostAction,omitempty"` - // PersonalizationSpec: The specification for personalization. - PersonalizationSpec *GoogleCloudRetailV2SearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` + // Condition: Required. The condition that triggers the rule. If the + // condition is empty, the rule will always apply. + Condition *GoogleCloudRetailV2Condition `json:"condition,omitempty"` - // Query: Raw search query. If this field is empty, the request is - // considered a category browsing request and returned results are based - // on filter and page_categories. - Query string `json:"query,omitempty"` + // DoNotAssociateAction: Prevents term from being associated with other + // terms. + DoNotAssociateAction *GoogleCloudRetailV2RuleDoNotAssociateAction `json:"doNotAssociateAction,omitempty"` - // QueryExpansionSpec: The query expansion specification that specifies - // the conditions under which query expansion will occur. See more - // details at this user guide - // (https://cloud.google.com/retail/docs/result-size#query_expansion). - QueryExpansionSpec *GoogleCloudRetailV2SearchRequestQueryExpansionSpec `json:"queryExpansionSpec,omitempty"` + // FilterAction: Filters results. + FilterAction *GoogleCloudRetailV2RuleFilterAction `json:"filterAction,omitempty"` - // SearchMode: The search mode of the search request. If not specified, - // a single search request triggers both product search and faceted - // search. - // - // Possible values: - // "SEARCH_MODE_UNSPECIFIED" - Default value. In this case both - // product search and faceted search will be performed. Both - // [SearchResponse.SearchResult] and [SearchResponse.Facet] will be - // returned. - // "PRODUCT_SEARCH_ONLY" - Only product search will be performed. The - // faceted search will be disabled. Only [SearchResponse.SearchResult] - // will be returned. [SearchResponse.Facet] will not be returned, even - // if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is - // set. - // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The - // product search will be disabled. When in this mode, one or both of - // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should - // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - // [SearchResponse.Facet] will be returned. - // [SearchResponse.SearchResult] will not be returned. - SearchMode string `json:"searchMode,omitempty"` + // IgnoreAction: Ignores specific terms from query during search. + IgnoreAction *GoogleCloudRetailV2RuleIgnoreAction `json:"ignoreAction,omitempty"` - // SpellCorrectionSpec: The spell correction specification that - // specifies the mode under which spell correction will take effect. - SpellCorrectionSpec *GoogleCloudRetailV2SearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + // OnewaySynonymsAction: Treats specific term as a synonym with a group + // of terms. Group of terms will not be treated as synonyms with the + // specific term. + OnewaySynonymsAction *GoogleCloudRetailV2RuleOnewaySynonymsAction `json:"onewaySynonymsAction,omitempty"` - // UserInfo: User information. - UserInfo *GoogleCloudRetailV2UserInfo `json:"userInfo,omitempty"` + // RedirectAction: Redirects a shopper to a specific page. + RedirectAction *GoogleCloudRetailV2RuleRedirectAction `json:"redirectAction,omitempty"` - // VariantRollupKeys: The keys to fetch and rollup the matching variant - // Products attributes, FulfillmentInfo or LocalInventorys attributes. - // The attributes from all the matching variant Products or - // LocalInventorys are merged and de-duplicated. Notice that rollup - // attributes will lead to extra query latency. Maximum number of keys - // is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID - // must be provided in the format of "fulfillmentType.fulfillmentId". - // E.g., in "pickupInStore.store123", "pickupInStore" is fulfillment - // type and "store123" is the store ID. Supported keys are: * - // colorFamilies * price * originalPrice * discount * variantId * - // inventory(place_id,price) * inventory(place_id,original_price) * - // inventory(place_id,attributes.key), where key is any key in the - // Product.local_inventories.attributes map. * attributes.key, where key - // is any key in the Product.attributes map. * pickupInStore.id, where - // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type - // "pickup-in-store". * shipToStore.id, where id is any - // FulfillmentInfo.place_ids for FulfillmentInfo.type "ship-to-store". * - // sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for - // FulfillmentInfo.type "same-day-delivery". * nextDayDelivery.id, where - // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type - // "next-day-delivery". * customFulfillment1.id, where id is any - // FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-1". * - // customFulfillment2.id, where id is any FulfillmentInfo.place_ids for - // FulfillmentInfo.type "custom-type-2". * customFulfillment3.id, where - // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type - // "custom-type-3". * customFulfillment4.id, where id is any - // FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-4". * - // customFulfillment5.id, where id is any FulfillmentInfo.place_ids for - // FulfillmentInfo.type "custom-type-5". If this field is set to an - // invalid value other than these, an INVALID_ARGUMENT error is - // returned. - VariantRollupKeys []string `json:"variantRollupKeys,omitempty"` + // ReplacementAction: Replaces specific terms in the query. + ReplacementAction *GoogleCloudRetailV2RuleReplacementAction `json:"replacementAction,omitempty"` - // VisitorId: Required. A unique identifier for tracking visitors. For - // example, this could be implemented with an HTTP cookie, which should - // be able to uniquely identify a visitor on a single device. This - // unique identifier should not change if the visitor logs in or out of - // the website. This should be the same identifier as - // UserEvent.visitor_id. The field must be a UTF-8 encoded string with a - // length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - // is returned. - VisitorId string `json:"visitorId,omitempty"` + // TwowaySynonymsAction: Treats a set of terms as synonyms of one + // another. + TwowaySynonymsAction *GoogleCloudRetailV2RuleTwowaySynonymsAction `json:"twowaySynonymsAction,omitempty"` - // ForceSendFields is a list of field names (e.g. "BoostSpec") to + // ForceSendFields is a list of field names (e.g. "BoostAction") 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 @@ -3680,64 +3906,25 @@ type GoogleCloudRetailV2SearchRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BoostSpec") 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 + // NullFields is a list of field names (e.g. "BoostAction") 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 *GoogleCloudRetailV2SearchRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequest - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudRetailV2SearchRequestBoostSpec: Boost specification to -// boost certain items. -type GoogleCloudRetailV2SearchRequestBoostSpec struct { - // ConditionBoostSpecs: Condition boost specifications. If a product - // matches multiple conditions in the specifictions, boost scores from - // these specifications are all applied and combined in a non-linear - // way. Maximum number of specifications is 20. - ConditionBoostSpecs []*GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec `json:"conditionBoostSpecs,omitempty"` - - // SkipBoostSpecValidation: Whether to skip boostspec validation. If - // this field is set to true, invalid BoostSpec.condition_boost_specs - // will be ignored and valid BoostSpec.condition_boost_specs will still - // be applied. - SkipBoostSpecValidation bool `json:"skipBoostSpecValidation,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ConditionBoostSpecs") - // 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. "ConditionBoostSpecs") 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 *GoogleCloudRetailV2SearchRequestBoostSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestBoostSpec +func (s *GoogleCloudRetailV2Rule) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2Rule raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec: Boost -// applies to products which match a condition. -type GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec struct { - // Boost: Strength of the condition boost, which should be in [-1, 1]. +// GoogleCloudRetailV2RuleBoostAction: A boost action to apply to +// results matching condition specified above. +type GoogleCloudRetailV2RuleBoostAction struct { + // Boost: Strength of the condition boost, which must be in [-1, 1]. // Negative boost means demotion. Default is 0.0. Setting to 1.0 gives // the item a big promotion. However, it does not necessarily mean that // the boosted item will be the top result at all times, nor that other @@ -3751,13 +3938,14 @@ type GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec struct { // no boost applied. The boosting condition is ignored. Boost float64 `json:"boost,omitempty"` - // Condition: An expression which specifies a boost condition. The + // ProductsFilter: The filter can have a max size of 5000 characters. An + // expression which specifies which products to apply an action to. The // syntax and supported fields are the same as a filter expression. See // SearchRequest.filter for detail syntax and limitations. Examples: * // To boost products with product ID "product_1" or "product_2", and - // color "Red" or "Blue": * (id: ANY("product_1", "product_2")) AND - // (colorFamilies: ANY("Red","Blue")) - Condition string `json:"condition,omitempty"` + // color "Red" or "Blue": *(id: ANY("product_1", "product_2")) * *AND * + // *(colorFamilies: ANY("Red", "Blue")) * + ProductsFilter string `json:"productsFilter,omitempty"` // ForceSendFields is a list of field names (e.g. "Boost") to // unconditionally include in API requests. By default, fields with @@ -3776,14 +3964,14 @@ type GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec +func (s *GoogleCloudRetailV2RuleBoostAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleBoostAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec +func (s *GoogleCloudRetailV2RuleBoostAction) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudRetailV2RuleBoostAction var s1 struct { Boost gensupport.JSONFloat64 `json:"boost"` *NoMethod @@ -3796,19 +3984,66 @@ func (s *GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec) UnmarshalJ return nil } -// GoogleCloudRetailV2SearchRequestDynamicFacetSpec: The specifications -// of dynamically generated facets. -type GoogleCloudRetailV2SearchRequestDynamicFacetSpec struct { - // Mode: Mode of the DynamicFacet feature. Defaults to Mode.DISABLED if - // it's unset. - // - // Possible values: - // "MODE_UNSPECIFIED" - Default value. - // "DISABLED" - Disable Dynamic Facet. - // "ENABLED" - Automatic mode built by Google Retail Search. - Mode string `json:"mode,omitempty"` +// GoogleCloudRetailV2RuleDoNotAssociateAction: Prevents `query_term` +// from being associated with specified terms during search. Example: +// Don't associate "gShoe" and "cheap". +type GoogleCloudRetailV2RuleDoNotAssociateAction struct { + // DoNotAssociateTerms: Cannot contain duplicates or the query term. Can + // specify up to 100 terms. + DoNotAssociateTerms []string `json:"doNotAssociateTerms,omitempty"` - // ForceSendFields is a list of field names (e.g. "Mode") to + // QueryTerms: Terms from the search query. Will not consider + // do_not_associate_terms for search if in search query. Can specify up + // to 100 terms. + QueryTerms []string `json:"queryTerms,omitempty"` + + // Terms: Will be [deprecated = true] post migration; + Terms []string `json:"terms,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DoNotAssociateTerms") + // 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. "DoNotAssociateTerms") 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 *GoogleCloudRetailV2RuleDoNotAssociateAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleDoNotAssociateAction + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2RuleFilterAction: * Rule Condition: - No +// Condition.query_terms provided is a global match. - 1 or more +// Condition.query_terms provided are combined with OR operator. * +// Action Input: The request query and filter that are applied to the +// retrieved products, in addition to any filters already provided with +// the SearchRequest. The AND operator is used to combine the query's +// existing filters with the filter rule(s). NOTE: May result in 0 +// results when filters conflict. * Action Result: Filters the returned +// objects to be ONLY those that passed the filter. +type GoogleCloudRetailV2RuleFilterAction struct { + // Filter: A filter to apply on the matching condition results. + // Supported features: * filter must be set. * Filter syntax is + // identical to SearchRequest.filter. See more details at the Retail + // Search user guide (/retail/search/docs/filter-and-order#filter). * To + // filter products with product ID "product_1" or "product_2", and color + // "Red" or "Blue": *(id: ANY("product_1", "product_2")) * *AND * + // *(colorFamilies: ANY("Red", "Blue")) * + Filter string `json:"filter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filter") 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 @@ -3816,7 +4051,7 @@ type GoogleCloudRetailV2SearchRequestDynamicFacetSpec struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Mode") to include in API + // NullFields is a list of field names (e.g. "Filter") 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 @@ -3825,175 +4060,60 @@ type GoogleCloudRetailV2SearchRequestDynamicFacetSpec struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2SearchRequestDynamicFacetSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestDynamicFacetSpec +func (s *GoogleCloudRetailV2RuleFilterAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleFilterAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchRequestFacetSpec: A facet specification to -// perform faceted search. -type GoogleCloudRetailV2SearchRequestFacetSpec struct { - // EnableDynamicPosition: Enables dynamic position for this facet. If - // set to true, the position of this facet among all facets in the - // response is determined by Google Retail Search. It will be ordered - // together with dynamic facets if dynamic facets is enabled. If set to - // false, the position of this facet in the response will be the same as - // in the request, and it will be ranked before the facets with dynamic - // position enable and all dynamic facets. For example, you may always - // want to have rating facet returned in the response, but it's not - // necessarily to always display the rating facet at the top. In that - // case, you can set enable_dynamic_position to true so that the - // position of rating facet in response will be determined by Google - // Retail Search. Another example, assuming you have the following - // facets in the request: * "rating", enable_dynamic_position = true * - // "price", enable_dynamic_position = false * "brands", - // enable_dynamic_position = false And also you have a dynamic facets - // enable, which will generate a facet 'gender'. Then the final order of - // the facets in the response can be ("price", "brands", "rating", - // "gender") or ("price", "brands", "gender", "rating") depends on how - // Google Retail Search orders "gender" and "rating" facets. However, - // notice that "price" and "brands" will always be ranked at 1st and 2nd - // position since their enable_dynamic_position are false. - EnableDynamicPosition bool `json:"enableDynamicPosition,omitempty"` - - // ExcludedFilterKeys: List of keys to exclude when faceting. By - // default, FacetKey.key is not excluded from the filter unless it is - // listed in this field. Listing a facet key in this field allows its - // values to appear as facet results, even when they are filtered out of - // search results. Using this field does not affect what search results - // are returned. For example, suppose there are 100 products with the - // color facet "Red" and 200 products with the color facet "Blue". A - // query containing the filter "colorFamilies:ANY("Red")" and having - // "colorFamilies" as FacetKey.key would by default return only "Red" - // products in the search results, and also return "Red" with count 100 - // as the only color facet. Although there are also blue products - // available, "Blue" would not be shown as an available facet value. If - // "colorFamilies" is listed in "excludedFilterKeys", then the query - // returns the facet values "Red" with count 100 and "Blue" with count - // 200, because the "colorFamilies" key is now excluded from the filter. - // Because this field doesn't affect search results, the search results - // are still correctly filtered to return only "Red" products. A maximum - // of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is - // returned. - ExcludedFilterKeys []string `json:"excludedFilterKeys,omitempty"` - - // FacetKey: Required. The facet key specification. - FacetKey *GoogleCloudRetailV2SearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` - - // Limit: Maximum of facet values that should be returned for this - // facet. If unspecified, defaults to 20. The maximum allowed value is - // 300. Values above 300 will be coerced to 300. If this field is - // negative, an INVALID_ARGUMENT is returned. - Limit int64 `json:"limit,omitempty"` +// GoogleCloudRetailV2RuleIgnoreAction: Prevents a term in the query +// from being used in search. Example: Don't search for "shoddy". +type GoogleCloudRetailV2RuleIgnoreAction struct { + // IgnoreTerms: Terms to ignore in the search query. + IgnoreTerms []string `json:"ignoreTerms,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "EnableDynamicPosition") 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 is a list of field names (e.g. "IgnoreTerms") 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. "EnableDynamicPosition") 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 is a list of field names (e.g. "IgnoreTerms") 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 *GoogleCloudRetailV2SearchRequestFacetSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestFacetSpec +func (s *GoogleCloudRetailV2RuleIgnoreAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleIgnoreAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchRequestFacetSpecFacetKey: Specifies how a -// facet is computed. -type GoogleCloudRetailV2SearchRequestFacetSpecFacetKey struct { - // 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 - // example, suppose "categories" has three values "Women > Shoe", "Women - // > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - // "categories" facet will give only "Women > Shoe" and "Men > Shoe". - // Only supported on textual fields. Maximum is 10. - Contains []string `json:"contains,omitempty"` - - // Intervals: Set only if values should be bucketized into intervals. - // Must be set for facets with numerical values. Must not be set for - // facet with text values. Maximum number of intervals is 30. - Intervals []*GoogleCloudRetailV2Interval `json:"intervals,omitempty"` - - // Key: Required. Supported textual and numerical facet keys in Product - // object, over which the facet values are computed. Facet key is - // case-sensitive. Allowed facet keys when FacetKey.query is not - // specified: * textual_field = * "brands" * "categories" * "genders" * - // "ageGroups" * "availability" * "colorFamilies" * "colors" * "sizes" * - // "materials" * "patterns" * "conditions" * "attributes.key" * - // "pickupInStore" * "shipToStore" * "sameDayDelivery" * - // "nextDayDelivery" * "customFulfillment1" * "customFulfillment2" * - // "customFulfillment3" * "customFulfillment4" * "customFulfillment5" * - // "inventory(place_id,attributes.key)" * numerical_field = * "price" * - // "discount" * "rating" * "ratingCount" * "attributes.key" * - // "inventory(place_id,price)" * "inventory(place_id,original_price)" * - // "inventory(place_id,attributes.key)" - Key string `json:"key,omitempty"` - - // OrderBy: The order in which SearchResponse.Facet.values are returned. - // Allowed values are: * "count desc", which means order by - // SearchResponse.Facet.values.count descending. * "value desc", which - // means order by SearchResponse.Facet.values.value descending. Only - // applies to textual facets. If not set, textual values are sorted in - // natural order (https://en.wikipedia.org/wiki/Natural_sort_order); - // numerical intervals are sorted in the order given by - // FacetSpec.FacetKey.intervals; FulfillmentInfo.place_ids are sorted in - // the order given by FacetSpec.FacetKey.restricted_values. - OrderBy string `json:"orderBy,omitempty"` - - // Prefixes: Only get facet values that start with the given string - // prefix. For example, suppose "categories" has three values "Women > - // Shoe", "Women > Dress" and "Men > Shoe". If set "prefixes" to - // "Women", the "categories" facet will give only "Women > Shoe" and - // "Women > Dress". Only supported on textual fields. Maximum is 10. - Prefixes []string `json:"prefixes,omitempty"` - - // Query: The query that is used to compute facet for the given facet - // key. When provided, it will override the default behavior of facet - // computation. The query syntax is the same as a filter expression. See - // SearchRequest.filter for detail syntax and limitations. Notice that - // there is no limitation on FacetKey.key when query is specified. In - // the response, SearchResponse.Facet.values.value will be always "1" - // and SearchResponse.Facet.values.count will be the number of results - // that match the query. For example, you can set a customized facet for - // "shipToStore", where FacetKey.key is "customizedShipToStore", and - // FacetKey.query is "availability: ANY(\"IN_STOCK\") AND shipToStore: - // ANY(\"123\")". Then the facet will count the products that are both - // in stock and ship to store "123". - Query string `json:"query,omitempty"` +// GoogleCloudRetailV2RuleOnewaySynonymsAction: Maps a set of terms to a +// set of synonyms. Set of synonyms will be treated as synonyms of each +// query term only. `query_terms` will not be treated as synonyms of +// each other. Example: "sneakers" will use a synonym of "shoes". +// "shoes" will not use a synonym of "sneakers". +type GoogleCloudRetailV2RuleOnewaySynonymsAction struct { + // OnewayTerms: Will be [deprecated = true] post migration; + OnewayTerms []string `json:"onewayTerms,omitempty"` - // RestrictedValues: Only get facet for the given restricted values. For - // example, when using "pickupInStore" as key and set restricted values - // to ["store123", "store456"], only facets for "store123" and - // "store456" are returned. Only supported on predefined textual fields, - // custom textual attributes and fulfillments. Maximum is 20. Must be - // set for the fulfillment facet keys: * pickupInStore * shipToStore * - // sameDayDelivery * nextDayDelivery * customFulfillment1 * - // customFulfillment2 * customFulfillment3 * customFulfillment4 * - // customFulfillment5 - RestrictedValues []string `json:"restrictedValues,omitempty"` + // QueryTerms: Terms from the search query. Will treat synonyms as their + // synonyms. Not themselves synonyms of the synonyms. Can specify up to + // 100 terms. + QueryTerms []string `json:"queryTerms,omitempty"` - // ReturnMinMax: Returns the min and max value for each numerical facet - // intervals. Ignored for textual facets. - ReturnMinMax bool `json:"returnMinMax,omitempty"` + // Synonyms: Defines a set of synonyms. Cannot contain duplicates. Can + // specify up to 100 synonyms. + Synonyms []string `json:"synonyms,omitempty"` - // ForceSendFields is a list of field names (e.g. "CaseInsensitive") to + // ForceSendFields is a list of field names (e.g. "OnewayTerms") 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 @@ -4001,36 +4121,30 @@ type GoogleCloudRetailV2SearchRequestFacetSpecFacetKey struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CaseInsensitive") 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 is a list of field names (e.g. "OnewayTerms") 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 *GoogleCloudRetailV2SearchRequestFacetSpecFacetKey) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestFacetSpecFacetKey +func (s *GoogleCloudRetailV2RuleOnewaySynonymsAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleOnewaySynonymsAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchRequestPersonalizationSpec: The -// specification for personalization. -type GoogleCloudRetailV2SearchRequestPersonalizationSpec struct { - // Mode: Defaults to Mode.AUTO. - // - // Possible values: - // "MODE_UNSPECIFIED" - Default value. In this case, server behavior - // defaults to Mode.AUTO. - // "AUTO" - Let CRS decide whether to use personalization based on - // quality of user event data. - // "DISABLED" - Disable personalization. - Mode string `json:"mode,omitempty"` +// GoogleCloudRetailV2RuleRedirectAction: Redirects a shopper to a +// specific page. * Rule Condition: - Must specify +// Condition.query_terms. * Action Input: Request Query * Action Result: +// Redirects shopper to provided uri. +type GoogleCloudRetailV2RuleRedirectAction struct { + // RedirectUri: URL must have length equal or less than 2000 characters. + RedirectUri string `json:"redirectUri,omitempty"` - // ForceSendFields is a list of field names (e.g. "Mode") to + // ForceSendFields is a list of field names (e.g. "RedirectUri") 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 @@ -4038,41 +4152,37 @@ type GoogleCloudRetailV2SearchRequestPersonalizationSpec struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Mode") 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 + // NullFields is a list of field names (e.g. "RedirectUri") 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 *GoogleCloudRetailV2SearchRequestPersonalizationSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestPersonalizationSpec +func (s *GoogleCloudRetailV2RuleRedirectAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleRedirectAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchRequestQueryExpansionSpec: Specification to -// determine under which conditions query expansion should occur. -type GoogleCloudRetailV2SearchRequestQueryExpansionSpec struct { - // Condition: The condition under which query expansion should occur. - // Default to Condition.DISABLED. - // - // Possible values: - // "CONDITION_UNSPECIFIED" - Unspecified query expansion condition. In - // this case, server behavior defaults to Condition.DISABLED. - // "DISABLED" - Disabled query expansion. Only the exact search query - // is used, even if SearchResponse.total_size is zero. - // "AUTO" - Automatic query expansion built by Google Retail Search. - Condition string `json:"condition,omitempty"` +// GoogleCloudRetailV2RuleReplacementAction: Replaces a term in the +// query. Multiple replacement candidates can be specified. All +// `query_terms` will be replaced with the replacement term. Example: +// Replace "gShoe" with "google shoe". +type GoogleCloudRetailV2RuleReplacementAction struct { + // QueryTerms: Terms from the search query. Will be replaced by + // replacement term. Can specify up to 100 terms. + QueryTerms []string `json:"queryTerms,omitempty"` - // PinUnexpandedResults: Whether to pin unexpanded results. If this - // field is set to true, unexpanded products are always at the top of - // the search results, followed by the expanded results. - PinUnexpandedResults bool `json:"pinUnexpandedResults,omitempty"` + // ReplacementTerm: Term that will be used for replacement. + ReplacementTerm string `json:"replacementTerm,omitempty"` - // ForceSendFields is a list of field names (e.g. "Condition") to + // Term: Will be [deprecated = true] post migration; + Term string `json:"term,omitempty"` + + // ForceSendFields is a list of field names (e.g. "QueryTerms") 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 @@ -4080,7 +4190,7 @@ type GoogleCloudRetailV2SearchRequestQueryExpansionSpec struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Condition") to include in + // NullFields is a list of field names (e.g. "QueryTerms") 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 @@ -4089,30 +4199,22 @@ type GoogleCloudRetailV2SearchRequestQueryExpansionSpec struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2SearchRequestQueryExpansionSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestQueryExpansionSpec +func (s *GoogleCloudRetailV2RuleReplacementAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleReplacementAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchRequestSpellCorrectionSpec: The -// specification for query spell correction. -type GoogleCloudRetailV2SearchRequestSpellCorrectionSpec struct { - // Mode: The mode under which spell correction should take effect to - // replace the original search query. Default to Mode.AUTO. - // - // Possible values: - // "MODE_UNSPECIFIED" - Unspecified spell correction mode. In this - // case, server behavior defaults to Mode.AUTO. - // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell - // suggestion if there is any and put in the - // SearchResponse.corrected_query. The spell suggestion will not be used - // as the search query. - // "AUTO" - Automatic spell correction built by Google Retail Search. - // Search will be based on the corrected query if found. - Mode string `json:"mode,omitempty"` +// GoogleCloudRetailV2RuleTwowaySynonymsAction: Creates a set of terms +// that will be treated as synonyms of each other. Example: synonyms of +// "sneakers" and "shoes". * "sneakers" will use a synonym of "shoes". * +// "shoes" will use a synonym of "sneakers". +type GoogleCloudRetailV2RuleTwowaySynonymsAction struct { + // Synonyms: Defines a set of synonyms. Can specify up to 100 synonyms. + // Must specify at least 2 synonyms. + Synonyms []string `json:"synonyms,omitempty"` - // ForceSendFields is a list of field names (e.g. "Mode") to + // ForceSendFields is a list of field names (e.g. "Synonyms") 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 @@ -4120,8 +4222,8 @@ type GoogleCloudRetailV2SearchRequestSpellCorrectionSpec struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Mode") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Synonyms") 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. @@ -4129,101 +4231,206 @@ type GoogleCloudRetailV2SearchRequestSpellCorrectionSpec struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2SearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchRequestSpellCorrectionSpec +func (s *GoogleCloudRetailV2RuleTwowaySynonymsAction) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2RuleTwowaySynonymsAction raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchResponse: Response message for +// GoogleCloudRetailV2SearchRequest: Request message for // SearchService.Search method. -type GoogleCloudRetailV2SearchResponse struct { - // AppliedControls: The fully qualified resource name of applied - // controls - // (https://cloud.google.com/retail/docs/serving-control-rules). - AppliedControls []string `json:"appliedControls,omitempty"` - - // AttributionToken: A unique search token. This should be included in - // the UserEvent logs resulting from this search, which enables accurate - // attribution of search model performance. - AttributionToken string `json:"attributionToken,omitempty"` +type GoogleCloudRetailV2SearchRequest struct { + // BoostSpec: Boost specification to boost certain products. See more + // details at this user guide + // (https://cloud.google.com/retail/docs/boosting). Notice that if both + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search + // request matches multiple boost conditions, the final boost score is + // equal to the sum of the boost scores from all matched boost + // conditions. + BoostSpec *GoogleCloudRetailV2SearchRequestBoostSpec `json:"boostSpec,omitempty"` - // CorrectedQuery: Contains the spell corrected query, if found. If the - // spell correction type is AUTOMATIC, then the search results are based - // on corrected_query. Otherwise the original query is used for search. - CorrectedQuery string `json:"correctedQuery,omitempty"` + // Branch: The branch resource name, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/0`. + // Use "default_branch" as the branch ID or leave this field empty, to + // search products under the default branch. + Branch string `json:"branch,omitempty"` - // Facets: Results of facets requested by user. - Facets []*GoogleCloudRetailV2SearchResponseFacet `json:"facets,omitempty"` + // CanonicalFilter: The default filter that is applied when a user + // performs a search without checking any filters on the search page. + // The filter applied to every search request when quality improvement + // such as query expansion is needed. For example, if a query does not + // have enough results, an expanded query with + // SearchRequest.canonical_filter will be returned as a supplement of + // the original query. This field is strongly recommended to achieve + // high search quality. See SearchRequest.filter for more details about + // filter syntax. + CanonicalFilter string `json:"canonicalFilter,omitempty"` - // InvalidConditionBoostSpecs: The invalid - // SearchRequest.BoostSpec.condition_boost_specs that are not applied - // during serving. - InvalidConditionBoostSpecs []*GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec `json:"invalidConditionBoostSpecs,omitempty"` + // DynamicFacetSpec: Deprecated. Refer to + // https://cloud.google.com/retail/docs/configs#dynamic to enable + // dynamic facets. Do not set this field. The specification for + // dynamically generated facets. Notice that only textual facets can be + // dynamically generated. + DynamicFacetSpec *GoogleCloudRetailV2SearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` - // NextPageToken: A token that can be sent as SearchRequest.page_token - // to retrieve the next page. If this field is omitted, there are no - // subsequent pages. - NextPageToken string `json:"nextPageToken,omitempty"` + // FacetSpecs: Facet specifications for faceted search. If empty, no + // facets are returned. A maximum of 100 values are allowed. Otherwise, + // an INVALID_ARGUMENT error is returned. + FacetSpecs []*GoogleCloudRetailV2SearchRequestFacetSpec `json:"facetSpecs,omitempty"` - // QueryExpansionInfo: Query expansion information for the returned - // results. - QueryExpansionInfo *GoogleCloudRetailV2SearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` + // Filter: The filter syntax consists of an expression language for + // constructing a predicate from one or more fields of the products + // being filtered. Filter expression is case-sensitive. See more details + // at this user guide + // (https://cloud.google.com/retail/docs/filter-and-order#filter). If + // this field is unrecognizable, an INVALID_ARGUMENT is returned. + Filter string `json:"filter,omitempty"` - // RedirectUri: The URI of a customer-defined redirect page. If redirect - // action is triggered, no search is performed, and only redirect_uri - // and attribution_token are set in the response. - RedirectUri string `json:"redirectUri,omitempty"` + // Labels: The labels applied to a resource must meet the following + // requirements: * Each resource can have multiple labels, up to a + // maximum of 64. * Each label must be a key-value pair. * Keys have a + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + Labels map[string]string `json:"labels,omitempty"` - // Results: A list of matched items. The order represents the ranking. - Results []*GoogleCloudRetailV2SearchResponseSearchResult `json:"results,omitempty"` + // Offset: A 0-indexed integer that specifies the current offset (that + // is, starting result location, amongst the Products deemed by the API + // as relevant) in search results. This field is only considered if + // page_token is unset. If this field is negative, an INVALID_ARGUMENT + // is returned. + Offset int64 `json:"offset,omitempty"` - // TotalSize: The estimated total count of matched items irrespective of - // pagination. The count of results returned by pagination may be less - // than the total_size that matches. - TotalSize int64 `json:"totalSize,omitempty"` + // OrderBy: The order in which products are returned. Products can be + // ordered by a field in an Product object. Leave it unset if ordered by + // relevance. OrderBy expression is case-sensitive. See more details at + // this user guide + // (https://cloud.google.com/retail/docs/filter-and-order#order). If + // this field is unrecognizable, an INVALID_ARGUMENT is returned. + OrderBy string `json:"orderBy,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // PageCategories: The categories associated with a category page. + // Required for category navigation queries to achieve good search + // quality. The format should be the same as UserEvent.page_categories; + // To represent full path of category, use '>' sign to separate + // different hierarchies. If '>' is part of the category name, replace + // it with other character(s). Category pages include special pages such + // as sales or promotions. For instance, a special sale page may have + // the category hierarchy: "pageCategories" : ["Sales > 2017 Black + // Friday Deals"]. + PageCategories []string `json:"pageCategories,omitempty"` - // ForceSendFields is a list of field names (e.g. "AppliedControls") 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:"-"` + // PageSize: Maximum number of Products to return. If unspecified, + // defaults to a reasonable value. The maximum allowed value is 120. + // Values above 120 will be coerced to 120. If this field is negative, + // an INVALID_ARGUMENT is returned. + PageSize int64 `json:"pageSize,omitempty"` - // NullFields is a list of field names (e.g. "AppliedControls") 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:"-"` -} + // PageToken: A page token SearchResponse.next_page_token, received from + // a previous SearchService.Search call. Provide this to retrieve the + // subsequent page. When paginating, all other parameters provided to + // SearchService.Search must match the call that provided the page + // token. Otherwise, an INVALID_ARGUMENT error is returned. + PageToken string `json:"pageToken,omitempty"` -func (s *GoogleCloudRetailV2SearchResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // PersonalizationSpec: The specification for personalization. Notice + // that if both ServingConfig.personalization_spec and + // SearchRequest.personalization_spec are set. + // SearchRequest.personalization_spec will override + // ServingConfig.personalization_spec. + PersonalizationSpec *GoogleCloudRetailV2SearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` -// GoogleCloudRetailV2SearchResponseFacet: A facet result. -type GoogleCloudRetailV2SearchResponseFacet struct { - // DynamicFacet: Whether the facet is dynamically generated. - DynamicFacet bool `json:"dynamicFacet,omitempty"` + // Query: Raw search query. If this field is empty, the request is + // considered a category browsing request and returned results are based + // on filter and page_categories. + Query string `json:"query,omitempty"` - // Key: The key for this facet. E.g., "colorFamilies" or "price" or - // "attributes.attr1". - Key string `json:"key,omitempty"` + // QueryExpansionSpec: The query expansion specification that specifies + // the conditions under which query expansion will occur. See more + // details at this user guide + // (https://cloud.google.com/retail/docs/result-size#query_expansion). + QueryExpansionSpec *GoogleCloudRetailV2SearchRequestQueryExpansionSpec `json:"queryExpansionSpec,omitempty"` - // Values: The facet values for this field. - Values []*GoogleCloudRetailV2SearchResponseFacetFacetValue `json:"values,omitempty"` + // SearchMode: The search mode of the search request. If not specified, + // a single search request triggers both product search and faceted + // search. + // + // Possible values: + // "SEARCH_MODE_UNSPECIFIED" - Default value. In this case both + // product search and faceted search will be performed. Both + // SearchResponse.SearchResult and SearchResponse.Facet will be + // returned. + // "PRODUCT_SEARCH_ONLY" - Only product search will be performed. The + // faceted search will be disabled. Only SearchResponse.SearchResult + // will be returned. SearchResponse.Facet will not be returned, even if + // SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set. + // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The + // product search will be disabled. When in this mode, one or both of + // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should + // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only + // SearchResponse.Facet will be returned. SearchResponse.SearchResult + // will not be returned. + SearchMode string `json:"searchMode,omitempty"` - // ForceSendFields is a list of field names (e.g. "DynamicFacet") to + // SpellCorrectionSpec: The spell correction specification that + // specifies the mode under which spell correction will take effect. + SpellCorrectionSpec *GoogleCloudRetailV2SearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + + // UserInfo: User information. + UserInfo *GoogleCloudRetailV2UserInfo `json:"userInfo,omitempty"` + + // VariantRollupKeys: The keys to fetch and rollup the matching variant + // Products attributes, FulfillmentInfo or LocalInventorys attributes. + // The attributes from all the matching variant Products or + // LocalInventorys are merged and de-duplicated. Notice that rollup + // attributes will lead to extra query latency. Maximum number of keys + // is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID + // must be provided in the format of "fulfillmentType.fulfillmentId". + // E.g., in "pickupInStore.store123", "pickupInStore" is fulfillment + // type and "store123" is the store ID. Supported keys are: * + // colorFamilies * price * originalPrice * discount * variantId * + // inventory(place_id,price) * inventory(place_id,original_price) * + // inventory(place_id,attributes.key), where key is any key in the + // Product.local_inventories.attributes map. * attributes.key, where key + // is any key in the Product.attributes map. * pickupInStore.id, where + // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type + // "pickup-in-store". * shipToStore.id, where id is any + // FulfillmentInfo.place_ids for FulfillmentInfo.type "ship-to-store". * + // sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for + // FulfillmentInfo.type "same-day-delivery". * nextDayDelivery.id, where + // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type + // "next-day-delivery". * customFulfillment1.id, where id is any + // FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-1". * + // customFulfillment2.id, where id is any FulfillmentInfo.place_ids for + // FulfillmentInfo.type "custom-type-2". * customFulfillment3.id, where + // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type + // "custom-type-3". * customFulfillment4.id, where id is any + // FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-4". * + // customFulfillment5.id, where id is any FulfillmentInfo.place_ids for + // FulfillmentInfo.type "custom-type-5". If this field is set to an + // invalid value other than these, an INVALID_ARGUMENT error is + // returned. + VariantRollupKeys []string `json:"variantRollupKeys,omitempty"` + + // VisitorId: Required. A unique identifier for tracking visitors. For + // example, this could be implemented with an HTTP cookie, which should + // be able to uniquely identify a visitor on a single device. This + // unique identifier should not change if the visitor logs in or out of + // the website. This should be the same identifier as + // UserEvent.visitor_id. The field must be a UTF-8 encoded string with a + // length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + // is returned. + VisitorId string `json:"visitorId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoostSpec") 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 @@ -4231,97 +4438,86 @@ type GoogleCloudRetailV2SearchResponseFacet struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DynamicFacet") 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 + // NullFields is a list of field names (e.g. "BoostSpec") 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 *GoogleCloudRetailV2SearchResponseFacet) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchResponseFacet +func (s *GoogleCloudRetailV2SearchRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchResponseFacetFacetValue: A facet value which -// contains value names and their count. -type GoogleCloudRetailV2SearchResponseFacetFacetValue struct { - // Count: Number of items that have this facet value. - Count int64 `json:"count,omitempty,string"` - - // Interval: Interval value for a facet, such as [10, 20) for facet - // "price". - Interval *GoogleCloudRetailV2Interval `json:"interval,omitempty"` - - // MaxValue: The maximum value in the FacetValue.interval. Only - // supported on numerical facets and returned if - // SearchRequest.FacetSpec.FacetKey.return_min_max is true. - MaxValue float64 `json:"maxValue,omitempty"` - - // MinValue: The minimum value in the FacetValue.interval. Only - // supported on numerical facets and returned if - // SearchRequest.FacetSpec.FacetKey.return_min_max is true. - MinValue float64 `json:"minValue,omitempty"` +// GoogleCloudRetailV2SearchRequestBoostSpec: Boost specification to +// boost certain items. +type GoogleCloudRetailV2SearchRequestBoostSpec struct { + // ConditionBoostSpecs: Condition boost specifications. If a product + // matches multiple conditions in the specifictions, boost scores from + // these specifications are all applied and combined in a non-linear + // way. Maximum number of specifications is 20. + ConditionBoostSpecs []*GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec `json:"conditionBoostSpecs,omitempty"` - // Value: Text value of a facet, such as "Black" for facet - // "colorFamilies". - Value string `json:"value,omitempty"` + // SkipBoostSpecValidation: Whether to skip boostspec validation. If + // this field is set to true, invalid BoostSpec.condition_boost_specs + // will be ignored and valid BoostSpec.condition_boost_specs will still + // be applied. + SkipBoostSpecValidation bool `json:"skipBoostSpecValidation,omitempty"` - // ForceSendFields is a list of field names (e.g. "Count") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ConditionBoostSpecs") + // 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 is a list of field names (e.g. "ConditionBoostSpecs") 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 *GoogleCloudRetailV2SearchResponseFacetFacetValue) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchResponseFacetFacetValue +func (s *GoogleCloudRetailV2SearchRequestBoostSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestBoostSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudRetailV2SearchResponseFacetFacetValue) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudRetailV2SearchResponseFacetFacetValue - var s1 struct { - MaxValue gensupport.JSONFloat64 `json:"maxValue"` - MinValue gensupport.JSONFloat64 `json:"minValue"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.MaxValue = float64(s1.MaxValue) - s.MinValue = float64(s1.MinValue) - return nil -} - -// GoogleCloudRetailV2SearchResponseQueryExpansionInfo: Information -// describing query expansion including whether expansion has occurred. -type GoogleCloudRetailV2SearchResponseQueryExpansionInfo struct { - // ExpandedQuery: Bool describing whether query expansion has occurred. - ExpandedQuery bool `json:"expandedQuery,omitempty"` +// GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec: Boost +// applies to products which match a condition. +type GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec struct { + // Boost: Strength of the condition boost, which should be in [-1, 1]. + // Negative boost means demotion. Default is 0.0. Setting to 1.0 gives + // the item a big promotion. However, it does not necessarily mean that + // the boosted item will be the top result at all times, nor that other + // items will be excluded. Results could still be shown even when none + // of them matches the condition. And results that are significantly + // more relevant to the search query can still trump your heavily + // favored but irrelevant items. Setting to -1.0 gives the item a big + // demotion. However, results that are deeply relevant might still be + // shown. The item will have an upstream battle to get a fairly high + // ranking, but it is not blocked out completely. Setting to 0.0 means + // no boost applied. The boosting condition is ignored. + Boost float64 `json:"boost,omitempty"` - // PinnedResultCount: Number of pinned results. This field will only be - // set when expansion happens and - // SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to - // true. - PinnedResultCount int64 `json:"pinnedResultCount,omitempty,string"` + // Condition: An expression which specifies a boost condition. The + // syntax and supported fields are the same as a filter expression. See + // SearchRequest.filter for detail syntax and limitations. Examples: * + // To boost products with product ID "product_1" or "product_2", and + // color "Red" or "Blue": * (id: ANY("product_1", "product_2")) AND + // (colorFamilies: ANY("Red","Blue")) + Condition string `json:"condition,omitempty"` - // ForceSendFields is a list of field names (e.g. "ExpandedQuery") to + // ForceSendFields is a list of field names (e.g. "Boost") 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 @@ -4329,76 +4525,48 @@ type GoogleCloudRetailV2SearchResponseQueryExpansionInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ExpandedQuery") 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 + // NullFields is a list of field names (e.g. "Boost") 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 *GoogleCloudRetailV2SearchResponseQueryExpansionInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchResponseQueryExpansionInfo +func (s *GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SearchResponseSearchResult: Represents the search -// results. -type GoogleCloudRetailV2SearchResponseSearchResult struct { - // Id: Product.id of the searched Product. - Id string `json:"id,omitempty"` - - // MatchingVariantCount: The count of matched variant Products. - MatchingVariantCount int64 `json:"matchingVariantCount,omitempty"` - - // MatchingVariantFields: If a variant Product matches the search query, - // this map indicates which Product fields are matched. The key is the - // Product.name, the value is a field mask of the matched Product - // fields. If matched attributes cannot be determined, this map will be - // empty. For example, a key "sku1" with field mask - // "products.color_info" indicates there is a match between "sku1" - // ColorInfo and the query. - MatchingVariantFields map[string]string `json:"matchingVariantFields,omitempty"` - - // PersonalLabels: Specifies previous events related to this product for - // this user based on UserEvent with same SearchRequest.visitor_id or - // UserInfo.user_id. This is set only when - // SearchRequest.PersonalizationSpec.mode is - // SearchRequest.PersonalizationSpec.Mode.AUTO. Possible values: * - // `purchased`: Indicates that this product has been purchased before. - PersonalLabels []string `json:"personalLabels,omitempty"` - - // Product: The product data snippet in the search response. Only - // Product.name is guaranteed to be populated. Product.variants contains - // the product variants that match the search query. If there are - // multiple product variants matching the query, top 5 most relevant - // product variants are returned and ordered by relevancy. If relevancy - // can be deternmined, use matching_variant_fields to look up matched - // product variants fields. If relevancy cannot be determined, e.g. when - // searching "shoe" all products in a shoe product can be a match, 5 - // product variants are returned but order is meaningless. - Product *GoogleCloudRetailV2Product `json:"product,omitempty"` +func (s *GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec + var s1 struct { + Boost gensupport.JSONFloat64 `json:"boost"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Boost = float64(s1.Boost) + return nil +} - // VariantRollupValues: The rollup matching variant Product attributes. - // The key is one of the SearchRequest.variant_rollup_keys. The values - // are the merged and de-duplicated Product attributes. Notice that the - // rollup values are respect filter. For example, when filtering by - // "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" - // is returned. For textual and numerical attributes, the rollup values - // is a list of string or double values with type - // google.protobuf.ListValue. For example, if there are two variants - // with colors "red" and "blue", the rollup values are { key: - // "colorFamilies" value { list_value { values { string_value: "red" } - // values { string_value: "blue" } } } } For FulfillmentInfo, the rollup - // values is a double value with type google.protobuf.Value. For - // example, `{key: "pickupInStore.store1" value { number_value: 10 }}` - // means a there are 10 variants in this product are available in the - // store "store1". - VariantRollupValues googleapi.RawMessage `json:"variantRollupValues,omitempty"` +// GoogleCloudRetailV2SearchRequestDynamicFacetSpec: The specifications +// of dynamically generated facets. +type GoogleCloudRetailV2SearchRequestDynamicFacetSpec struct { + // Mode: Mode of the DynamicFacet feature. Defaults to Mode.DISABLED if + // it's unset. + // + // Possible values: + // "MODE_UNSPECIFIED" - Default value. + // "DISABLED" - Disable Dynamic Facet. + // "ENABLED" - Automatic mode built by Google Retail Search. + Mode string `json:"mode,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to + // ForceSendFields is a list of field names (e.g. "Mode") 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 @@ -4406,7 +4574,7 @@ type GoogleCloudRetailV2SearchResponseSearchResult struct { // 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 + // NullFields is a list of field names (e.g. "Mode") 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 @@ -4415,116 +4583,175 @@ type GoogleCloudRetailV2SearchResponseSearchResult struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2SearchResponseSearchResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SearchResponseSearchResult +func (s *GoogleCloudRetailV2SearchRequestDynamicFacetSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestDynamicFacetSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SetDefaultBranchRequest: Request message to set a -// specified branch as new default_branch. -type GoogleCloudRetailV2SetDefaultBranchRequest struct { - // BranchId: The final component of the resource name of a branch. This - // field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - // error is returned. If there are no sufficient active products in the - // targeted branch and force is not set, a FAILED_PRECONDITION error is +// GoogleCloudRetailV2SearchRequestFacetSpec: A facet specification to +// perform faceted search. +type GoogleCloudRetailV2SearchRequestFacetSpec struct { + // EnableDynamicPosition: Enables dynamic position for this facet. If + // set to true, the position of this facet among all facets in the + // response is determined by Google Retail Search. It will be ordered + // together with dynamic facets if dynamic facets is enabled. If set to + // false, the position of this facet in the response will be the same as + // in the request, and it will be ranked before the facets with dynamic + // position enable and all dynamic facets. For example, you may always + // want to have rating facet returned in the response, but it's not + // necessarily to always display the rating facet at the top. In that + // case, you can set enable_dynamic_position to true so that the + // position of rating facet in response will be determined by Google + // Retail Search. Another example, assuming you have the following + // facets in the request: * "rating", enable_dynamic_position = true * + // "price", enable_dynamic_position = false * "brands", + // enable_dynamic_position = false And also you have a dynamic facets + // enable, which will generate a facet 'gender'. Then the final order of + // the facets in the response can be ("price", "brands", "rating", + // "gender") or ("price", "brands", "gender", "rating") depends on how + // Google Retail Search orders "gender" and "rating" facets. However, + // notice that "price" and "brands" will always be ranked at 1st and 2nd + // position since their enable_dynamic_position are false. + EnableDynamicPosition bool `json:"enableDynamicPosition,omitempty"` + + // ExcludedFilterKeys: List of keys to exclude when faceting. By + // default, FacetKey.key is not excluded from the filter unless it is + // listed in this field. Listing a facet key in this field allows its + // values to appear as facet results, even when they are filtered out of + // search results. Using this field does not affect what search results + // are returned. For example, suppose there are 100 products with the + // color facet "Red" and 200 products with the color facet "Blue". A + // query containing the filter "colorFamilies:ANY("Red")" and having + // "colorFamilies" as FacetKey.key would by default return only "Red" + // products in the search results, and also return "Red" with count 100 + // as the only color facet. Although there are also blue products + // available, "Blue" would not be shown as an available facet value. If + // "colorFamilies" is listed in "excludedFilterKeys", then the query + // returns the facet values "Red" with count 100 and "Blue" with count + // 200, because the "colorFamilies" key is now excluded from the filter. + // Because this field doesn't affect search results, the search results + // are still correctly filtered to return only "Red" products. A maximum + // of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error is // returned. - BranchId string `json:"branchId,omitempty"` + ExcludedFilterKeys []string `json:"excludedFilterKeys,omitempty"` - // Force: If set to true, it permits switching to a branch with - // branch_id even if it has no sufficient active products. - Force bool `json:"force,omitempty"` + // FacetKey: Required. The facet key specification. + FacetKey *GoogleCloudRetailV2SearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` - // Note: Some note on this request, this can be retrieved by - // CatalogService.GetDefaultBranch before next valid default branch set - // occurs. This field must be a UTF-8 encoded string with a length limit - // of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is - // returned. - Note string `json:"note,omitempty"` + // Limit: Maximum of facet values that should be returned for this + // facet. If unspecified, defaults to 20. The maximum allowed value is + // 300. Values above 300 will be coerced to 300. If this field is + // negative, an INVALID_ARGUMENT is returned. + Limit int64 `json:"limit,omitempty"` - // ForceSendFields is a list of field names (e.g. "BranchId") 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 is a list of field names (e.g. + // "EnableDynamicPosition") 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. "BranchId") 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 is a list of field names (e.g. "EnableDynamicPosition") 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 *GoogleCloudRetailV2SetDefaultBranchRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SetDefaultBranchRequest +func (s *GoogleCloudRetailV2SearchRequestFacetSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestFacetSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SetInventoryMetadata: Metadata related to the -// progress of the SetInventory operation. Currently empty because there -// is no meaningful metadata populated from the -// ProductService.SetInventory method. -type GoogleCloudRetailV2SetInventoryMetadata struct { -} +// GoogleCloudRetailV2SearchRequestFacetSpecFacetKey: Specifies how a +// facet is computed. +type GoogleCloudRetailV2SearchRequestFacetSpecFacetKey struct { + // CaseInsensitive: True to make facet keys case insensitive when + // getting faceting values with prefixes or contains; false otherwise. + CaseInsensitive bool `json:"caseInsensitive,omitempty"` -// GoogleCloudRetailV2SetInventoryRequest: Request message for -// ProductService.SetInventory method. -type GoogleCloudRetailV2SetInventoryRequest struct { - // AllowMissing: If set to true, and the Product with name Product.name - // is not found, the inventory update will still be processed and - // retained for at most 1 day until the Product is created. If set to - // false, a NOT_FOUND error is returned if the Product is not found. - AllowMissing bool `json:"allowMissing,omitempty"` + // Contains: Only get facet values that contains the given strings. For + // example, suppose "categories" has three values "Women > Shoe", "Women + // > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // Only supported on textual fields. Maximum is 10. + Contains []string `json:"contains,omitempty"` - // Inventory: Required. The inventory information to update. The - // allowable fields to update are: * Product.price_info * - // Product.availability * Product.available_quantity * - // Product.fulfillment_info The updated inventory fields must be - // specified in SetInventoryRequest.set_mask. If - // SetInventoryRequest.inventory.name is empty or invalid, an - // INVALID_ARGUMENT error is returned. If the caller does not have - // permission to update the Product named in Product.name, regardless of - // whether or not it exists, a PERMISSION_DENIED error is returned. If - // the Product to update does not have existing inventory information, - // the provided inventory information will be inserted. If the Product - // to update has existing inventory information, the provided inventory - // information will be merged while respecting the last update time for - // each inventory field, using the provided or default value for - // SetInventoryRequest.set_time. The caller can replace place IDs for a - // subset of fulfillment types in the following ways: * Adds - // "fulfillment_info" in SetInventoryRequest.set_mask * Specifies only - // the desired fulfillment types and corresponding place IDs to update - // in SetInventoryRequest.inventory.fulfillment_info The caller can - // clear all place IDs from a subset of fulfillment types in the - // following ways: * Adds "fulfillment_info" in - // SetInventoryRequest.set_mask * Specifies only the desired fulfillment - // types to clear in SetInventoryRequest.inventory.fulfillment_info * - // Checks that only the desired fulfillment info types have empty - // SetInventoryRequest.inventory.fulfillment_info.place_ids The last - // update time is recorded for the following inventory fields: * - // Product.price_info * Product.availability * - // Product.available_quantity * Product.fulfillment_info If a full - // overwrite of inventory information while ignoring timestamps is - // needed, ProductService.UpdateProduct should be invoked instead. - Inventory *GoogleCloudRetailV2Product `json:"inventory,omitempty"` + // Intervals: Set only if values should be bucketized into intervals. + // Must be set for facets with numerical values. Must not be set for + // facet with text values. Maximum number of intervals is 30. + Intervals []*GoogleCloudRetailV2Interval `json:"intervals,omitempty"` - // SetMask: Indicates which inventory fields in the provided Product to - // update. At least one field must be provided. If an unsupported or - // unknown field is provided, an INVALID_ARGUMENT error is returned and - // the entire update will be ignored. - SetMask string `json:"setMask,omitempty"` + // Key: Required. Supported textual and numerical facet keys in Product + // object, over which the facet values are computed. Facet key is + // case-sensitive. Allowed facet keys when FacetKey.query is not + // specified: * textual_field = * "brands" * "categories" * "genders" * + // "ageGroups" * "availability" * "colorFamilies" * "colors" * "sizes" * + // "materials" * "patterns" * "conditions" * "attributes.key" * + // "pickupInStore" * "shipToStore" * "sameDayDelivery" * + // "nextDayDelivery" * "customFulfillment1" * "customFulfillment2" * + // "customFulfillment3" * "customFulfillment4" * "customFulfillment5" * + // "inventory(place_id,attributes.key)" * numerical_field = * "price" * + // "discount" * "rating" * "ratingCount" * "attributes.key" * + // "inventory(place_id,price)" * "inventory(place_id,original_price)" * + // "inventory(place_id,attributes.key)" + Key string `json:"key,omitempty"` - // SetTime: The time when the request is issued, used to prevent - // out-of-order updates on inventory fields with the last update time - // recorded. If not provided, the internal system time will be used. - SetTime string `json:"setTime,omitempty"` + // OrderBy: The order in which SearchResponse.Facet.values are returned. + // Allowed values are: * "count desc", which means order by + // SearchResponse.Facet.values.count descending. * "value desc", which + // means order by SearchResponse.Facet.values.value descending. Only + // applies to textual facets. If not set, textual values are sorted in + // natural order (https://en.wikipedia.org/wiki/Natural_sort_order); + // numerical intervals are sorted in the order given by + // FacetSpec.FacetKey.intervals; FulfillmentInfo.place_ids are sorted in + // the order given by FacetSpec.FacetKey.restricted_values. + OrderBy string `json:"orderBy,omitempty"` - // ForceSendFields is a list of field names (e.g. "AllowMissing") to + // Prefixes: Only get facet values that start with the given string + // prefix. For example, suppose "categories" has three values "Women > + // Shoe", "Women > Dress" and "Men > Shoe". If set "prefixes" to + // "Women", the "categories" facet will give only "Women > Shoe" and + // "Women > Dress". Only supported on textual fields. Maximum is 10. + Prefixes []string `json:"prefixes,omitempty"` + + // Query: The query that is used to compute facet for the given facet + // key. When provided, it will override the default behavior of facet + // computation. The query syntax is the same as a filter expression. See + // SearchRequest.filter for detail syntax and limitations. Notice that + // there is no limitation on FacetKey.key when query is specified. In + // the response, SearchResponse.Facet.values.value will be always "1" + // and SearchResponse.Facet.values.count will be the number of results + // that match the query. For example, you can set a customized facet for + // "shipToStore", where FacetKey.key is "customizedShipToStore", and + // FacetKey.query is "availability: ANY(\"IN_STOCK\") AND shipToStore: + // ANY(\"123\")". Then the facet will count the products that are both + // in stock and ship to store "123". + Query string `json:"query,omitempty"` + + // RestrictedValues: Only get facet for the given restricted values. For + // example, when using "pickupInStore" as key and set restricted values + // to ["store123", "store456"], only facets for "store123" and + // "store456" are returned. Only supported on predefined textual fields, + // custom textual attributes and fulfillments. Maximum is 20. Must be + // set for the fulfillment facet keys: * pickupInStore * shipToStore * + // sameDayDelivery * nextDayDelivery * customFulfillment1 * + // customFulfillment2 * customFulfillment3 * customFulfillment4 * + // customFulfillment5 + RestrictedValues []string `json:"restrictedValues,omitempty"` + + // ReturnMinMax: Returns the min and max value for each numerical facet + // intervals. Ignored for textual facets. + ReturnMinMax bool `json:"returnMinMax,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaseInsensitive") 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 @@ -4532,208 +4759,118 @@ type GoogleCloudRetailV2SetInventoryRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowMissing") 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 is a list of field names (e.g. "CaseInsensitive") 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 *GoogleCloudRetailV2SetInventoryRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2SetInventoryRequest +func (s *GoogleCloudRetailV2SearchRequestFacetSpecFacetKey) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestFacetSpecFacetKey raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2SetInventoryResponse: Response of the -// SetInventoryRequest. Currently empty because there is no meaningful -// response populated from the ProductService.SetInventory method. -type GoogleCloudRetailV2SetInventoryResponse struct { -} +// GoogleCloudRetailV2SearchRequestPersonalizationSpec: The +// specification for personalization. +type GoogleCloudRetailV2SearchRequestPersonalizationSpec struct { + // Mode: Defaults to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Default value. In this case, server behavior + // defaults to Mode.AUTO. + // "AUTO" - Let CRS decide whether to use personalization based on + // quality of user event data. + // "DISABLED" - Disable personalization. + Mode string `json:"mode,omitempty"` -// GoogleCloudRetailV2UserEvent: UserEvent captures all metadata -// information Retail API needs to know about how end users interact -// with customers' website. -type GoogleCloudRetailV2UserEvent struct { - // Attributes: Extra user event features to include in the - // recommendation model. If you provide custom attributes for ingested - // user events, also include them in the user events that you associate - // with prediction requests. Custom attribute formatting must be - // consistent between imported events and events provided with - // prediction requests. This lets the Retail API use those custom - // attributes when training models and serving predictions, which helps - // improve recommendation quality. This field needs to pass all below - // criteria, otherwise an INVALID_ARGUMENT error is returned: * The key - // must be a UTF-8 encoded string with a length limit of 5,000 - // characters. * For text attributes, at most 400 values are allowed. - // Empty values are not allowed. Each value must be a UTF-8 encoded - // string with a length limit of 256 characters. * For number - // attributes, at most 400 values are allowed. For product - // recommendations, an example of extra user information is - // traffic_channel, which is how a user arrives at the site. Users can - // arrive at the site by coming to the site directly, coming through - // Google search, or in other ways. - Attributes map[string]GoogleCloudRetailV2CustomAttribute `json:"attributes,omitempty"` + // ForceSendFields is a list of field names (e.g. "Mode") 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:"-"` - // AttributionToken: Highly recommended for user events that are the - // result of PredictionService.Predict. This field enables accurate - // attribution of recommendation model performance. The value must be a - // valid PredictResponse.attribution_token for user events that are the - // result of PredictionService.Predict. The value must be a valid - // SearchResponse.attribution_token for user events that are the result - // of SearchService.Search. This token enables us to accurately - // attribute page view or purchase back to the event and the particular - // predict response containing this clicked/purchased product. If user - // clicks on product K in the recommendation results, pass - // PredictResponse.attribution_token as a URL parameter to product K's - // page. When recording events on product K's page, log the - // PredictResponse.attribution_token to this field. - AttributionToken string `json:"attributionToken,omitempty"` + // NullFields is a list of field names (e.g. "Mode") 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:"-"` +} - // CartId: The ID or name of the associated shopping cart. This ID is - // used to associate multiple items added or present in the cart before - // purchase. This can only be set for `add-to-cart`, - // `purchase-complete`, or `shopping-cart-page-view` events. - CartId string `json:"cartId,omitempty"` +func (s *GoogleCloudRetailV2SearchRequestPersonalizationSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestPersonalizationSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // CompletionDetail: The main auto-completion details related to the - // event. This field should be set for `search` event when autocomplete - // function is enabled and the user clicks a suggestion for search. - CompletionDetail *GoogleCloudRetailV2CompletionDetail `json:"completionDetail,omitempty"` +// GoogleCloudRetailV2SearchRequestQueryExpansionSpec: Specification to +// determine under which conditions query expansion should occur. +type GoogleCloudRetailV2SearchRequestQueryExpansionSpec struct { + // Condition: The condition under which query expansion should occur. + // Default to Condition.DISABLED. + // + // Possible values: + // "CONDITION_UNSPECIFIED" - Unspecified query expansion condition. In + // this case, server behavior defaults to Condition.DISABLED. + // "DISABLED" - Disabled query expansion. Only the exact search query + // is used, even if SearchResponse.total_size is zero. + // "AUTO" - Automatic query expansion built by Google Retail Search. + Condition string `json:"condition,omitempty"` - // EventTime: Only required for UserEventService.ImportUserEvents - // method. Timestamp of when the user event happened. - EventTime string `json:"eventTime,omitempty"` + // PinUnexpandedResults: Whether to pin unexpanded results. If this + // field is set to true, unexpanded products are always at the top of + // the search results, followed by the expanded results. + PinUnexpandedResults bool `json:"pinUnexpandedResults,omitempty"` - // EventType: Required. User event type. Allowed values are: * - // `add-to-cart`: Products being added to cart. * `category-page-view`: - // Special pages such as sale or promotion pages viewed. * - // `detail-page-view`: Products detail page viewed. * `home-page-view`: - // Homepage viewed. * `promotion-offered`: Promotion is offered to a - // user. * `promotion-not-offered`: Promotion is not offered to a user. - // * `purchase-complete`: User finishing a purchase. * `search`: Product - // search. * `shopping-cart-page-view`: User viewing a shopping cart. - EventType string `json:"eventType,omitempty"` - - // ExperimentIds: A list of identifiers for the independent experiment - // groups this user event belongs to. This is used to distinguish - // between user events associated with different experiment setups (e.g. - // using Retail API, using different recommendation models). - ExperimentIds []string `json:"experimentIds,omitempty"` - - // Filter: The filter syntax consists of an expression language for - // constructing a predicate from one or more fields of the products - // being filtered. See SearchRequest.filter for definition and syntax. - // The value must be a UTF-8 encoded string with a length limit of 1,000 - // characters. Otherwise, an INVALID_ARGUMENT error is returned. - Filter string `json:"filter,omitempty"` - - // Offset: An integer that specifies the current offset for pagination - // (the 0-indexed starting location, amongst the products deemed by the - // API as relevant). See SearchRequest.offset for definition. If this - // field is negative, an INVALID_ARGUMENT is returned. This can only be - // set for `search` events. Other event types should not set this field. - // Otherwise, an INVALID_ARGUMENT error is returned. - Offset int64 `json:"offset,omitempty"` - - // OrderBy: The order in which products are returned. See - // SearchRequest.order_by for definition and syntax. The value must be a - // UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an INVALID_ARGUMENT error is returned. This can only be - // set for `search` events. Other event types should not set this field. - // Otherwise, an INVALID_ARGUMENT error is returned. - OrderBy string `json:"orderBy,omitempty"` - - // PageCategories: The categories associated with a category page. To - // represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it - // with other character(s). Category pages include special pages such as - // sales or promotions. For instance, a special sale page may have the - // category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday - // Deals"]. Required for `category-page-view` events. At least one of - // search_query or page_categories is required for `search` events. - // Other event types should not set this field. Otherwise, an - // INVALID_ARGUMENT error is returned. - PageCategories []string `json:"pageCategories,omitempty"` - - // PageViewId: A unique ID of a web page view. This should be kept the - // same for all user events triggered from the same pageview. For - // example, an item detail page view could trigger multiple events as - // the user is browsing the page. The `pageViewId` property should be - // kept the same for all these events so that they can be grouped - // together properly. When using the client side event reporting with - // JavaScript pixel and Google Tag Manager, this value is filled in - // automatically. - PageViewId string `json:"pageViewId,omitempty"` - - // ProductDetails: The main product details related to the event. This - // field is optional except for the following event types: * - // `add-to-cart` * `detail-page-view` * `purchase-complete` In a - // `search` event, this field represents the products returned to the - // end user on the current page (the end user may have not finished - // browsing the whole page yet). When a new page is returned to the end - // user, after pagination/filtering/ordering even for the same query, a - // new `search` event with different product_details is desired. The end - // user may have not finished browsing the whole page yet. - ProductDetails []*GoogleCloudRetailV2ProductDetail `json:"productDetails,omitempty"` - - // PurchaseTransaction: A transaction represents the entire purchase - // transaction. Required for `purchase-complete` events. Other event - // types should not set this field. Otherwise, an INVALID_ARGUMENT error - // is returned. - PurchaseTransaction *GoogleCloudRetailV2PurchaseTransaction `json:"purchaseTransaction,omitempty"` - - // ReferrerUri: The referrer URL of the current page. When using the - // client side event reporting with JavaScript pixel and Google Tag - // Manager, this value is filled in automatically. - ReferrerUri string `json:"referrerUri,omitempty"` - - // SearchQuery: The user's search query. See SearchRequest.query for - // definition. The value must be a UTF-8 encoded string with a length - // limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is - // returned. At least one of search_query or page_categories is required - // for `search` events. Other event types should not set this field. - // Otherwise, an INVALID_ARGUMENT error is returned. - SearchQuery string `json:"searchQuery,omitempty"` - - // SessionId: A unique identifier for tracking a visitor session with a - // length limit of 128 bytes. A session is an aggregation of an end user - // behavior in a time span. A general guideline to populate the - // sesion_id: 1. If user has no activity for 30 min, a new session_id - // should be assigned. 2. The session_id should be unique across users, - // suggest use uuid or add visitor_id as prefix. - SessionId string `json:"sessionId,omitempty"` - - // Uri: Complete URL (window.location.href) of the user's current page. - // When using the client side event reporting with JavaScript pixel and - // Google Tag Manager, this value is filled in automatically. Maximum - // length 5,000 characters. - Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Condition") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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:"-"` - // UserInfo: User information. - UserInfo *GoogleCloudRetailV2UserInfo `json:"userInfo,omitempty"` + // NullFields is a list of field names (e.g. "Condition") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. 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:"-"` +} - // VisitorId: Required. A unique identifier for tracking visitors. For - // example, this could be implemented with an HTTP cookie, which should - // be able to uniquely identify a visitor on a single device. This - // unique identifier should not change if the visitor log in/out of the - // website. Don't set the field to the same fixed ID for different - // users. This mixes the event history of those users together, which - // results in degraded model quality. The field must be a UTF-8 encoded - // string with a length limit of 128 characters. Otherwise, an - // INVALID_ARGUMENT error is returned. The field should not contain PII - // or user-data. We recommend to use Google Analytics Client ID - // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - // for this field. - VisitorId string `json:"visitorId,omitempty"` +func (s *GoogleCloudRetailV2SearchRequestQueryExpansionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestQueryExpansionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// GoogleCloudRetailV2SearchRequestSpellCorrectionSpec: The +// specification for query spell correction. +type GoogleCloudRetailV2SearchRequestSpellCorrectionSpec struct { + // Mode: The mode under which spell correction should take effect to + // replace the original search query. Default to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Unspecified spell correction mode. In this + // case, server behavior defaults to Mode.AUTO. + // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell + // suggestion if there is any and put in the + // SearchResponse.corrected_query. The spell suggestion will not be used + // as the search query. + // "AUTO" - Automatic spell correction built by Google Retail Search. + // Search will be based on the corrected query if found. + Mode string `json:"mode,omitempty"` - // ForceSendFields is a list of field names (e.g. "Attributes") to + // ForceSendFields is a list of field names (e.g. "Mode") 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 @@ -4741,8 +4878,8 @@ type GoogleCloudRetailV2UserEvent struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Attributes") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Mode") 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. @@ -4750,33 +4887,73 @@ type GoogleCloudRetailV2UserEvent struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2UserEvent) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2UserEvent +func (s *GoogleCloudRetailV2SearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestSpellCorrectionSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2UserEventImportSummary: A summary of import -// result. The UserEventImportSummary summarizes the import status for -// user events. -type GoogleCloudRetailV2UserEventImportSummary struct { - // JoinedEventsCount: Count of user events imported with complete - // existing catalog information. - JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` +// GoogleCloudRetailV2SearchResponse: Response message for +// SearchService.Search method. +type GoogleCloudRetailV2SearchResponse struct { + // AppliedControls: The fully qualified resource name of applied + // controls + // (https://cloud.google.com/retail/docs/serving-control-rules). + AppliedControls []string `json:"appliedControls,omitempty"` - // UnjoinedEventsCount: Count of user events imported, but with catalog - // information not found in the imported catalog. - UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + // AttributionToken: A unique search token. This should be included in + // the UserEvent logs resulting from this search, which enables accurate + // attribution of search model performance. + AttributionToken string `json:"attributionToken,omitempty"` - // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") - // to unconditionally include in API requests. By default, fields with + // CorrectedQuery: Contains the spell corrected query, if found. If the + // spell correction type is AUTOMATIC, then the search results are based + // on corrected_query. Otherwise the original query is used for search. + CorrectedQuery string `json:"correctedQuery,omitempty"` + + // Facets: Results of facets requested by user. + Facets []*GoogleCloudRetailV2SearchResponseFacet `json:"facets,omitempty"` + + // InvalidConditionBoostSpecs: The invalid + // SearchRequest.BoostSpec.condition_boost_specs that are not applied + // during serving. + InvalidConditionBoostSpecs []*GoogleCloudRetailV2SearchRequestBoostSpecConditionBoostSpec `json:"invalidConditionBoostSpecs,omitempty"` + + // NextPageToken: A token that can be sent as SearchRequest.page_token + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // QueryExpansionInfo: Query expansion information for the returned + // results. + QueryExpansionInfo *GoogleCloudRetailV2SearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` + + // RedirectUri: The URI of a customer-defined redirect page. If redirect + // action is triggered, no search is performed, and only redirect_uri + // and attribution_token are set in the response. + RedirectUri string `json:"redirectUri,omitempty"` + + // Results: A list of matched items. The order represents the ranking. + Results []*GoogleCloudRetailV2SearchResponseSearchResult `json:"results,omitempty"` + + // TotalSize: The estimated total count of matched items irrespective of + // pagination. The count of results returned by pagination may be less + // than the total_size that matches. + TotalSize int64 `json:"totalSize,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AppliedControls") 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. "JoinedEventsCount") to + // NullFields is a list of field names (e.g. "AppliedControls") 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 @@ -4786,20 +4963,25 @@ type GoogleCloudRetailV2UserEventImportSummary struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2UserEventImportSummary) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2UserEventImportSummary +func (s *GoogleCloudRetailV2SearchResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2UserEventInlineSource: The inline source for the -// input config for ImportUserEvents method. -type GoogleCloudRetailV2UserEventInlineSource struct { - // UserEvents: Required. A list of user events to import. Recommended - // max of 10k items. - UserEvents []*GoogleCloudRetailV2UserEvent `json:"userEvents,omitempty"` +// GoogleCloudRetailV2SearchResponseFacet: A facet result. +type GoogleCloudRetailV2SearchResponseFacet struct { + // DynamicFacet: Whether the facet is dynamically generated. + DynamicFacet bool `json:"dynamicFacet,omitempty"` - // ForceSendFields is a list of field names (e.g. "UserEvents") to + // Key: The key for this facet. E.g., "colorFamilies" or "price" or + // "attributes.attr1". + Key string `json:"key,omitempty"` + + // Values: The facet values for this field. + Values []*GoogleCloudRetailV2SearchResponseFacetFacetValue `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DynamicFacet") 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 @@ -4807,36 +4989,46 @@ type GoogleCloudRetailV2UserEventInlineSource struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "UserEvents") 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 + // NullFields is a list of field names (e.g. "DynamicFacet") 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 *GoogleCloudRetailV2UserEventInlineSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2UserEventInlineSource +func (s *GoogleCloudRetailV2SearchResponseFacet) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchResponseFacet raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2UserEventInputConfig: The input config source for -// user events. -type GoogleCloudRetailV2UserEventInputConfig struct { - // BigQuerySource: Required. BigQuery input source. - BigQuerySource *GoogleCloudRetailV2BigQuerySource `json:"bigQuerySource,omitempty"` +// GoogleCloudRetailV2SearchResponseFacetFacetValue: A facet value which +// contains value names and their count. +type GoogleCloudRetailV2SearchResponseFacetFacetValue struct { + // Count: Number of items that have this facet value. + Count int64 `json:"count,omitempty,string"` - // GcsSource: Required. Google Cloud Storage location for the input - // content. - GcsSource *GoogleCloudRetailV2GcsSource `json:"gcsSource,omitempty"` + // Interval: Interval value for a facet, such as [10, 20) for facet + // "price". + Interval *GoogleCloudRetailV2Interval `json:"interval,omitempty"` - // UserEventInlineSource: Required. The Inline source for the input - // content for UserEvents. - UserEventInlineSource *GoogleCloudRetailV2UserEventInlineSource `json:"userEventInlineSource,omitempty"` + // MaxValue: The maximum value in the FacetValue.interval. Only + // supported on numerical facets and returned if + // SearchRequest.FacetSpec.FacetKey.return_min_max is true. + MaxValue float64 `json:"maxValue,omitempty"` - // ForceSendFields is a list of field names (e.g. "BigQuerySource") to + // MinValue: The minimum value in the FacetValue.interval. Only + // supported on numerical facets and returned if + // SearchRequest.FacetSpec.FacetKey.return_min_max is true. + MinValue float64 `json:"minValue,omitempty"` + + // Value: Text value of a facet, such as "Black" for facet + // "colorFamilies". + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4844,121 +5036,127 @@ type GoogleCloudRetailV2UserEventInputConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BigQuerySource") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. 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 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 *GoogleCloudRetailV2UserEventInputConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2UserEventInputConfig +func (s *GoogleCloudRetailV2SearchResponseFacetFacetValue) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchResponseFacetFacetValue raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2UserInfo: Information of an end user. -type GoogleCloudRetailV2UserInfo struct { - // DirectUserRequest: True if the request is made directly from the end - // user, in which case the ip_address and user_agent can be populated - // from the HTTP request. This flag should be set only if the API - // request is made directly from the end user such as a mobile app (and - // not if a gateway or a server is processing and pushing the user - // events). This should not be set when using the JavaScript tag in - // UserEventService.CollectUserEvent. - DirectUserRequest bool `json:"directUserRequest,omitempty"` - - // IpAddress: The end user's IP address. This field is used to extract - // location information for personalization. This field must be either - // an IPv4 address (e.g. "104.133.9.80") or an IPv6 address (e.g. - // "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an - // INVALID_ARGUMENT error is returned. This should not be set when: * - // setting SearchRequest.user_info. * using the JavaScript tag in - // UserEventService.CollectUserEvent or if direct_user_request is set. - IpAddress string `json:"ipAddress,omitempty"` +func (s *GoogleCloudRetailV2SearchResponseFacetFacetValue) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudRetailV2SearchResponseFacetFacetValue + var s1 struct { + MaxValue gensupport.JSONFloat64 `json:"maxValue"` + MinValue gensupport.JSONFloat64 `json:"minValue"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.MaxValue = float64(s1.MaxValue) + s.MinValue = float64(s1.MinValue) + return nil +} - // UserAgent: User agent as included in the HTTP header. Required for - // getting SearchResponse.sponsored_results. The field must be a UTF-8 - // encoded string with a length limit of 1,000 characters. Otherwise, an - // INVALID_ARGUMENT error is returned. This should not be set when using - // the client side event reporting with GTM or JavaScript tag in - // UserEventService.CollectUserEvent or if direct_user_request is set. - UserAgent string `json:"userAgent,omitempty"` +// GoogleCloudRetailV2SearchResponseQueryExpansionInfo: Information +// describing query expansion including whether expansion has occurred. +type GoogleCloudRetailV2SearchResponseQueryExpansionInfo struct { + // ExpandedQuery: Bool describing whether query expansion has occurred. + ExpandedQuery bool `json:"expandedQuery,omitempty"` - // UserId: Highly recommended for logged-in users. Unique identifier for - // logged-in user, such as a user name. Don't set for anonymous users. - // Always use a hashed value for this ID. Don't set the field to the - // same fixed ID for different users. This mixes the event history of - // those users together, which results in degraded model quality. The - // field must be a UTF-8 encoded string with a length limit of 128 - // characters. Otherwise, an INVALID_ARGUMENT error is returned. - UserId string `json:"userId,omitempty"` + // PinnedResultCount: Number of pinned results. This field will only be + // set when expansion happens and + // SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to + // true. + PinnedResultCount int64 `json:"pinnedResultCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "DirectUserRequest") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ExpandedQuery") 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. "DirectUserRequest") 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 is a list of field names (e.g. "ExpandedQuery") 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 *GoogleCloudRetailV2UserInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2UserInfo +func (s *GoogleCloudRetailV2SearchResponseQueryExpansionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchResponseQueryExpansionInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata -// related to the progress of the AddFulfillmentPlaces operation. -// Currently empty because there is no meaningful metadata populated -// from the ProductService.AddFulfillmentPlaces method. -type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { -} +// GoogleCloudRetailV2SearchResponseSearchResult: Represents the search +// results. +type GoogleCloudRetailV2SearchResponseSearchResult struct { + // Id: Product.id of the searched Product. + Id string `json:"id,omitempty"` -// GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the -// AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the -// ProductService.AddFulfillmentPlaces method. -type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { -} + // MatchingVariantCount: The count of matched variant Products. + MatchingVariantCount int64 `json:"matchingVariantCount,omitempty"` -// GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related -// to the progress of the AddLocalInventories operation. Currently empty -// because there is no meaningful metadata populated from the -// ProductService.AddLocalInventories method. -type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { -} + // MatchingVariantFields: If a variant Product matches the search query, + // this map indicates which Product fields are matched. The key is the + // Product.name, the value is a field mask of the matched Product + // fields. If matched attributes cannot be determined, this map will be + // empty. For example, a key "sku1" with field mask + // "products.color_info" indicates there is a match between "sku1" + // ColorInfo and the query. + MatchingVariantFields map[string]string `json:"matchingVariantFields,omitempty"` -// GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the -// ProductService.AddLocalInventories API. Currently empty because there -// is no meaningful response populated from the -// ProductService.AddLocalInventories method. -type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { -} + // PersonalLabels: Specifies previous events related to this product for + // this user based on UserEvent with same SearchRequest.visitor_id or + // UserInfo.user_id. This is set only when + // SearchRequest.PersonalizationSpec.mode is + // SearchRequest.PersonalizationSpec.Mode.AUTO. Possible values: * + // `purchased`: Indicates that this product has been purchased before. + PersonalLabels []string `json:"personalLabels,omitempty"` -// GoogleCloudRetailV2alphaBigQueryOutputResult: A BigQuery output -// result. -type GoogleCloudRetailV2alphaBigQueryOutputResult struct { - // DatasetId: The ID of a BigQuery Dataset. - DatasetId string `json:"datasetId,omitempty"` + // Product: The product data snippet in the search response. Only + // Product.name is guaranteed to be populated. Product.variants contains + // the product variants that match the search query. If there are + // multiple product variants matching the query, top 5 most relevant + // product variants are returned and ordered by relevancy. If relevancy + // can be deternmined, use matching_variant_fields to look up matched + // product variants fields. If relevancy cannot be determined, e.g. when + // searching "shoe" all products in a shoe product can be a match, 5 + // product variants are returned but order is meaningless. + Product *GoogleCloudRetailV2Product `json:"product,omitempty"` - // TableId: The ID of a BigQuery Table. - TableId string `json:"tableId,omitempty"` + // VariantRollupValues: The rollup matching variant Product attributes. + // The key is one of the SearchRequest.variant_rollup_keys. The values + // are the merged and de-duplicated Product attributes. Notice that the + // rollup values are respect filter. For example, when filtering by + // "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" + // is returned. For textual and numerical attributes, the rollup values + // is a list of string or double values with type + // google.protobuf.ListValue. For example, if there are two variants + // with colors "red" and "blue", the rollup values are { key: + // "colorFamilies" value { list_value { values { string_value: "red" } + // values { string_value: "blue" } } } } For FulfillmentInfo, the rollup + // values is a double value with type google.protobuf.Value. For + // example, `{key: "pickupInStore.store1" value { number_value: 10 }}` + // means a there are 10 variants in this product are available in the + // store "store1". + VariantRollupValues googleapi.RawMessage `json:"variantRollupValues,omitempty"` - // ForceSendFields is a list of field names (e.g. "DatasetId") to + // 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 @@ -4966,8 +5164,8 @@ type GoogleCloudRetailV2alphaBigQueryOutputResult struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DatasetId") to include in - // API requests with the JSON null value. By default, fields with empty + // 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. @@ -4975,54 +5173,170 @@ type GoogleCloudRetailV2alphaBigQueryOutputResult struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaBigQueryOutputResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaBigQueryOutputResult +func (s *GoogleCloudRetailV2SearchResponseSearchResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchResponseSearchResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaCreateModelMetadata: Metadata associated with -// a create operation. -type GoogleCloudRetailV2alphaCreateModelMetadata struct { - // Model: The resource name of the model that this create applies to. - // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id - // }/models/{model_id} - Model string `json:"model,omitempty"` +// GoogleCloudRetailV2ServingConfig: Configures metadata that is used to +// generate serving time results (e.g. search results or recommendation +// predictions). +type GoogleCloudRetailV2ServingConfig struct { + // BoostControlIds: Condition boost specifications. If a product matches + // multiple conditions in the specifications, boost scores from these + // specifications are all applied and combined in a non-linear way. + // Maximum number of specifications is 100. Notice that if both + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search + // request matches multiple boost conditions, the final boost score is + // equal to the sum of the boost scores from all matched boost + // conditions. Can only be set if solution_types is + // SOLUTION_TYPE_SEARCH. + BoostControlIds []string `json:"boostControlIds,omitempty"` - // ForceSendFields is a list of field names (e.g. "Model") 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:"-"` + // DisplayName: Required. The human readable serving config display + // name. Used in Retail UI. This field must be a UTF-8 encoded string + // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT + // error is returned. + DisplayName string `json:"displayName,omitempty"` - // NullFields is a list of field names (e.g. "Model") 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:"-"` -} + // DiversityLevel: How much diversity to use in recommendation model + // results e.g. `medium-diversity` or `high-diversity`. Currently + // supported values: * `no-diversity` * `low-diversity` * + // `medium-diversity` * `high-diversity` * `auto-diversity` If not + // specified, we choose default based on recommendation model type. + // Default value: `no-diversity`. Can only be set if solution_types is + // SOLUTION_TYPE_RECOMMENDATION. + DiversityLevel string `json:"diversityLevel,omitempty"` + + // DiversityType: What kind of diversity to use - data driven or rule + // based. + // + // Possible values: + // "DIVERSITY_TYPE_UNSPECIFIED" - Default value. + // "RULE_BASED_DIVERSITY" - Rule based diversity. + // "DATA_DRIVEN_DIVERSITY" - Data driven diversity. + DiversityType string `json:"diversityType,omitempty"` + + // DoNotAssociateControlIds: Condition do not associate specifications. + // If multiple do not associate conditions match, all matching do not + // associate controls in the list will execute. - Order does not matter. + // - Maximum number of specifications is 100. Can only be set if + // solution_types is SOLUTION_TYPE_SEARCH. + DoNotAssociateControlIds []string `json:"doNotAssociateControlIds,omitempty"` + + // DynamicFacetSpec: The specification for dynamically generated facets. + // Notice that only textual facets can be dynamically generated. Can + // only be set if solution_types is SOLUTION_TYPE_SEARCH. + DynamicFacetSpec *GoogleCloudRetailV2SearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` -func (s *GoogleCloudRetailV2alphaCreateModelMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaCreateModelMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // EnableCategoryFilterLevel: Whether to add additional category filters + // on the `similar-items` model. If not specified, we enable it by + // default. Allowed values are: * `no-category-match`: No additional + // filtering of original results from the model and the customer's + // filters. * `relaxed-category-match`: Only keep results with + // categories that match at least one item categories in the + // PredictRequests's context item. * If customer also sends filters in + // the PredictRequest, then the results will satisfy both conditions + // (user given and category match). Can only be set if solution_types is + // SOLUTION_TYPE_RECOMMENDATION. + EnableCategoryFilterLevel string `json:"enableCategoryFilterLevel,omitempty"` + + // FacetControlIds: Facet specifications for faceted search. If empty, + // no facets are returned. The ids refer to the ids of Control resources + // with only the Facet control set. These controls are assumed to be in + // the same Catalog as the ServingConfig. A maximum of 100 values are + // allowed. Otherwise, an INVALID_ARGUMENT error is returned. Can only + // be set if solution_types is SOLUTION_TYPE_SEARCH. + FacetControlIds []string `json:"facetControlIds,omitempty"` + + // FilterControlIds: Condition filter specifications. If a product + // matches multiple conditions in the specifications, filters from these + // specifications are all applied and combined via the AND operator. + // Maximum number of specifications is 100. Can only be set if + // solution_types is SOLUTION_TYPE_SEARCH. + FilterControlIds []string `json:"filterControlIds,omitempty"` + + // IgnoreControlIds: Condition ignore specifications. If multiple ignore + // conditions match, all matching ignore controls in the list will + // execute. - Order does not matter. - Maximum number of specifications + // is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. + IgnoreControlIds []string `json:"ignoreControlIds,omitempty"` + + // ModelId: The id of the model in the same Catalog to use at serving + // time. Currently only RecommendationModels are supported: + // https://cloud.google.com/retail/recommendations-ai/docs/create-models + // Can be changed but only to a compatible model (e.g. + // others-you-may-like CTR to others-you-may-like CVR). Required when + // solution_types is SOLUTION_TYPE_RECOMMENDATION. + ModelId string `json:"modelId,omitempty"` + + // Name: Immutable. Fully qualified name + // `projects/*/locations/global/catalogs/*/servingConfig/*` + Name string `json:"name,omitempty"` -// GoogleCloudRetailV2alphaExportErrorsConfig: Configuration of -// destination for Export related errors. -type GoogleCloudRetailV2alphaExportErrorsConfig struct { - // GcsPrefix: Google Cloud Storage path for import errors. This must be - // an empty, existing Cloud Storage bucket. Export errors will be - // written to a file in this bucket, one per line, as a JSON-encoded - // `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` + // OnewaySynonymsControlIds: Condition oneway synonyms specifications. + // If multiple oneway synonyms conditions match, all matching oneway + // synonyms controls in the list will execute. Order of controls in the + // list will not matter. Maximum number of specifications is 100. Can + // only be set if solution_types is SOLUTION_TYPE_SEARCH. + OnewaySynonymsControlIds []string `json:"onewaySynonymsControlIds,omitempty"` + + // PersonalizationSpec: The specification for personalization spec. Can + // only be set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if + // both ServingConfig.personalization_spec and + // SearchRequest.personalization_spec are set. + // SearchRequest.personalization_spec will override + // ServingConfig.personalization_spec. + PersonalizationSpec *GoogleCloudRetailV2SearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsPrefix") to + // PriceRerankingLevel: How much price ranking we want in serving + // results. Price reranking causes product items with a similar + // recommendation probability to be ordered by price, with the + // highest-priced items first. This setting could result in a decrease + // in click-through and conversion rates. Allowed values are: * + // `no-price-reranking` * `low-price-raranking` * + // `medium-price-reranking` * `high-price-reranking` If not specified, + // we choose default based on model type. Default value: + // `no-price-reranking`. Can only be set if solution_types is + // SOLUTION_TYPE_RECOMMENDATION. + PriceRerankingLevel string `json:"priceRerankingLevel,omitempty"` + + // RedirectControlIds: Condition redirect specifications. Only the first + // triggered redirect action is applied, even if multiple apply. Maximum + // number of specifications is 1000. Can only be set if solution_types + // is SOLUTION_TYPE_SEARCH. + RedirectControlIds []string `json:"redirectControlIds,omitempty"` + + // ReplacementControlIds: Condition replacement specifications. - + // Applied according to the order in the list. - A previously replaced + // term can not be re-replaced. - Maximum number of specifications is + // 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. + ReplacementControlIds []string `json:"replacementControlIds,omitempty"` + + // SolutionTypes: Required. Immutable. Specifies the solution types that + // a serving config can be associated with. Currently we support setting + // only one type of solution. + // + // Possible values: + // "SOLUTION_TYPE_UNSPECIFIED" - Default value. + // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. + // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. + SolutionTypes []string `json:"solutionTypes,omitempty"` + + // TwowaySynonymsControlIds: Condition synonyms specifications. If + // multiple syonyms conditions match, all matching synonyms control in + // the list will execute. Order of controls in the list will not matter. + // Maximum number of specifications is 100. Can only be set if + // solution_types is SOLUTION_TYPE_SEARCH. + TwowaySynonymsControlIds []string `json:"twowaySynonymsControlIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BoostControlIds") 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 @@ -5030,33 +5344,44 @@ type GoogleCloudRetailV2alphaExportErrorsConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsPrefix") 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 is a list of field names (e.g. "BoostControlIds") 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 *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaExportErrorsConfig +func (s *GoogleCloudRetailV2ServingConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2ServingConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaExportMetadata: Metadata related to the -// progress of the Export operation. This will be returned by the -// google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2alphaExportMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` +// GoogleCloudRetailV2SetDefaultBranchRequest: Request message to set a +// specified branch as new default_branch. +type GoogleCloudRetailV2SetDefaultBranchRequest struct { + // BranchId: The final component of the resource name of a branch. This + // field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + // error is returned. If there are no sufficient active products in the + // targeted branch and force is not set, a FAILED_PRECONDITION error is + // returned. + BranchId string `json:"branchId,omitempty"` - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` + // Force: If set to true, it permits switching to a branch with + // branch_id even if it has no sufficient active products. + Force bool `json:"force,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // Note: Some note on this request, this can be retrieved by + // CatalogService.GetDefaultBranch before next valid default branch set + // occurs. This field must be a UTF-8 encoded string with a length limit + // of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is + // returned. + Note string `json:"note,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BranchId") 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 @@ -5064,7 +5389,7 @@ type GoogleCloudRetailV2alphaExportMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "BranchId") 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 @@ -5073,70 +5398,72 @@ type GoogleCloudRetailV2alphaExportMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaExportMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaExportMetadata +func (s *GoogleCloudRetailV2SetDefaultBranchRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SetDefaultBranchRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaExportProductsResponse: Response of the -// ExportProductsRequest. If the long running operation is done, then -// this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2alphaExportProductsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // ErrorsConfig: This field is never set. - ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` - - // OutputResult: Output result indicating where the data were exported - // to. - OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. 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. "ErrorSamples") 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:"-"` +// GoogleCloudRetailV2SetInventoryMetadata: Metadata related to the +// progress of the SetInventory operation. Currently empty because there +// is no meaningful metadata populated from the +// ProductService.SetInventory method. +type GoogleCloudRetailV2SetInventoryMetadata struct { } -func (s *GoogleCloudRetailV2alphaExportProductsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaExportProductsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// GoogleCloudRetailV2SetInventoryRequest: Request message for +// ProductService.SetInventory method. +type GoogleCloudRetailV2SetInventoryRequest struct { + // AllowMissing: If set to true, and the Product with name Product.name + // is not found, the inventory update will still be processed and + // retained for at most 1 day until the Product is created. If set to + // false, a NOT_FOUND error is returned if the Product is not found. + AllowMissing bool `json:"allowMissing,omitempty"` -// GoogleCloudRetailV2alphaExportUserEventsResponse: Response of the -// ExportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2alphaExportUserEventsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // Inventory: Required. The inventory information to update. The + // allowable fields to update are: * Product.price_info * + // Product.availability * Product.available_quantity * + // Product.fulfillment_info The updated inventory fields must be + // specified in SetInventoryRequest.set_mask. If + // SetInventoryRequest.inventory.name is empty or invalid, an + // INVALID_ARGUMENT error is returned. If the caller does not have + // permission to update the Product named in Product.name, regardless of + // whether or not it exists, a PERMISSION_DENIED error is returned. If + // the Product to update does not have existing inventory information, + // the provided inventory information will be inserted. If the Product + // to update has existing inventory information, the provided inventory + // information will be merged while respecting the last update time for + // each inventory field, using the provided or default value for + // SetInventoryRequest.set_time. The caller can replace place IDs for a + // subset of fulfillment types in the following ways: * Adds + // "fulfillment_info" in SetInventoryRequest.set_mask * Specifies only + // the desired fulfillment types and corresponding place IDs to update + // in SetInventoryRequest.inventory.fulfillment_info The caller can + // clear all place IDs from a subset of fulfillment types in the + // following ways: * Adds "fulfillment_info" in + // SetInventoryRequest.set_mask * Specifies only the desired fulfillment + // types to clear in SetInventoryRequest.inventory.fulfillment_info * + // Checks that only the desired fulfillment info types have empty + // SetInventoryRequest.inventory.fulfillment_info.place_ids The last + // update time is recorded for the following inventory fields: * + // Product.price_info * Product.availability * + // Product.available_quantity * Product.fulfillment_info If a full + // overwrite of inventory information while ignoring timestamps is + // needed, ProductService.UpdateProduct should be invoked instead. + Inventory *GoogleCloudRetailV2Product `json:"inventory,omitempty"` - // ErrorsConfig: This field is never set. - ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` + // SetMask: Indicates which inventory fields in the provided Product to + // update. At least one field must be provided. If an unsupported or + // unknown field is provided, an INVALID_ARGUMENT error is returned and + // the entire update will be ignored. + SetMask string `json:"setMask,omitempty"` - // OutputResult: Output result indicating where the data were exported - // to. - OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` + // SetTime: The time when the request is issued, used to prevent + // out-of-order updates on inventory fields with the last update time + // recorded. If not provided, the internal system time will be used. + SetTime string `json:"setTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "AllowMissing") 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 @@ -5144,7 +5471,7 @@ type GoogleCloudRetailV2alphaExportUserEventsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include + // NullFields is a list of field names (e.g. "AllowMissing") 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 @@ -5153,63 +5480,207 @@ type GoogleCloudRetailV2alphaExportUserEventsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaExportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaExportUserEventsResponse +func (s *GoogleCloudRetailV2SetInventoryRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SetInventoryRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaImportCompletionDataResponse: Response of the -// ImportCompletionDataRequest. If the long running operation is done, -// this message is returned by the -// google.longrunning.Operations.response field if the operation is -// successful. -type GoogleCloudRetailV2alphaImportCompletionDataResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2alphaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaImportCompletionDataResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +// GoogleCloudRetailV2SetInventoryResponse: Response of the +// SetInventoryRequest. Currently empty because there is no meaningful +// response populated from the ProductService.SetInventory method. +type GoogleCloudRetailV2SetInventoryResponse struct { } -// GoogleCloudRetailV2alphaImportErrorsConfig: Configuration of -// destination for Import related errors. -type GoogleCloudRetailV2alphaImportErrorsConfig struct { - // GcsPrefix: Google Cloud Storage prefix for import errors. This must - // be an empty, existing Cloud Storage directory. Import errors are - // written to sharded files in this directory, one per line, as a - // JSON-encoded `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` +// GoogleCloudRetailV2UserEvent: UserEvent captures all metadata +// information Retail API needs to know about how end users interact +// with customers' website. +type GoogleCloudRetailV2UserEvent struct { + // Attributes: Extra user event features to include in the + // recommendation model. If you provide custom attributes for ingested + // user events, also include them in the user events that you associate + // with prediction requests. Custom attribute formatting must be + // consistent between imported events and events provided with + // prediction requests. This lets the Retail API use those custom + // attributes when training models and serving predictions, which helps + // improve recommendation quality. This field needs to pass all below + // criteria, otherwise an INVALID_ARGUMENT error is returned: * The key + // must be a UTF-8 encoded string with a length limit of 5,000 + // characters. * For text attributes, at most 400 values are allowed. + // Empty values are not allowed. Each value must be a UTF-8 encoded + // string with a length limit of 256 characters. * For number + // attributes, at most 400 values are allowed. For product + // recommendations, an example of extra user information is + // traffic_channel, which is how a user arrives at the site. Users can + // arrive at the site by coming to the site directly, coming through + // Google search, or in other ways. + Attributes map[string]GoogleCloudRetailV2CustomAttribute `json:"attributes,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsPrefix") to - // unconditionally include in API requests. By default, fields with + // AttributionToken: Highly recommended for user events that are the + // result of PredictionService.Predict. This field enables accurate + // attribution of recommendation model performance. The value must be a + // valid PredictResponse.attribution_token for user events that are the + // result of PredictionService.Predict. The value must be a valid + // SearchResponse.attribution_token for user events that are the result + // of SearchService.Search. This token enables us to accurately + // attribute page view or purchase back to the event and the particular + // predict response containing this clicked/purchased product. If user + // clicks on product K in the recommendation results, pass + // PredictResponse.attribution_token as a URL parameter to product K's + // page. When recording events on product K's page, log the + // PredictResponse.attribution_token to this field. + AttributionToken string `json:"attributionToken,omitempty"` + + // CartId: The ID or name of the associated shopping cart. This ID is + // used to associate multiple items added or present in the cart before + // purchase. This can only be set for `add-to-cart`, + // `purchase-complete`, or `shopping-cart-page-view` events. + CartId string `json:"cartId,omitempty"` + + // CompletionDetail: The main auto-completion details related to the + // event. This field should be set for `search` event when autocomplete + // function is enabled and the user clicks a suggestion for search. + CompletionDetail *GoogleCloudRetailV2CompletionDetail `json:"completionDetail,omitempty"` + + // EventTime: Only required for UserEventService.ImportUserEvents + // method. Timestamp of when the user event happened. + EventTime string `json:"eventTime,omitempty"` + + // EventType: Required. User event type. Allowed values are: * + // `add-to-cart`: Products being added to cart. * `category-page-view`: + // Special pages such as sale or promotion pages viewed. * + // `detail-page-view`: Products detail page viewed. * `home-page-view`: + // Homepage viewed. * `promotion-offered`: Promotion is offered to a + // user. * `promotion-not-offered`: Promotion is not offered to a user. + // * `purchase-complete`: User finishing a purchase. * `search`: Product + // search. * `shopping-cart-page-view`: User viewing a shopping cart. + EventType string `json:"eventType,omitempty"` + + // ExperimentIds: A list of identifiers for the independent experiment + // groups this user event belongs to. This is used to distinguish + // between user events associated with different experiment setups (e.g. + // using Retail API, using different recommendation models). + ExperimentIds []string `json:"experimentIds,omitempty"` + + // Filter: The filter syntax consists of an expression language for + // constructing a predicate from one or more fields of the products + // being filtered. See SearchRequest.filter for definition and syntax. + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + Filter string `json:"filter,omitempty"` + + // Offset: An integer that specifies the current offset for pagination + // (the 0-indexed starting location, amongst the products deemed by the + // API as relevant). See SearchRequest.offset for definition. If this + // field is negative, an INVALID_ARGUMENT is returned. This can only be + // set for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + Offset int64 `json:"offset,omitempty"` + + // OrderBy: The order in which products are returned. See + // SearchRequest.order_by for definition and syntax. The value must be a + // UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an INVALID_ARGUMENT error is returned. This can only be + // set for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + OrderBy string `json:"orderBy,omitempty"` + + // PageCategories: The categories associated with a category page. To + // represent full path of category, use '>' sign to separate different + // hierarchies. If '>' is part of the category name, replace it with + // other character(s). Category pages include special pages such as + // sales or promotions. For instance, a special sale page may have the + // category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday + // Deals"]. Required for `category-page-view` events. At least one of + // search_query or page_categories is required for `search` events. + // Other event types should not set this field. Otherwise, an + // INVALID_ARGUMENT error is returned. + PageCategories []string `json:"pageCategories,omitempty"` + + // PageViewId: A unique ID of a web page view. This should be kept the + // same for all user events triggered from the same pageview. For + // example, an item detail page view could trigger multiple events as + // the user is browsing the page. The `pageViewId` property should be + // kept the same for all these events so that they can be grouped + // together properly. When using the client side event reporting with + // JavaScript pixel and Google Tag Manager, this value is filled in + // automatically. + PageViewId string `json:"pageViewId,omitempty"` + + // ProductDetails: The main product details related to the event. This + // field is optional except for the following event types: * + // `add-to-cart` * `detail-page-view` * `purchase-complete` In a + // `search` event, this field represents the products returned to the + // end user on the current page (the end user may have not finished + // browsing the whole page yet). When a new page is returned to the end + // user, after pagination/filtering/ordering even for the same query, a + // new `search` event with different product_details is desired. The end + // user may have not finished browsing the whole page yet. + ProductDetails []*GoogleCloudRetailV2ProductDetail `json:"productDetails,omitempty"` + + // PurchaseTransaction: A transaction represents the entire purchase + // transaction. Required for `purchase-complete` events. Other event + // types should not set this field. Otherwise, an INVALID_ARGUMENT error + // is returned. + PurchaseTransaction *GoogleCloudRetailV2PurchaseTransaction `json:"purchaseTransaction,omitempty"` + + // ReferrerUri: The referrer URL of the current page. When using the + // client side event reporting with JavaScript pixel and Google Tag + // Manager, this value is filled in automatically. + ReferrerUri string `json:"referrerUri,omitempty"` + + // SearchQuery: The user's search query. See SearchRequest.query for + // definition. The value must be a UTF-8 encoded string with a length + // limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is + // returned. At least one of search_query or page_categories is required + // for `search` events. Other event types should not set this field. + // Otherwise, an INVALID_ARGUMENT error is returned. + SearchQuery string `json:"searchQuery,omitempty"` + + // SessionId: A unique identifier for tracking a visitor session with a + // length limit of 128 bytes. A session is an aggregation of an end user + // behavior in a time span. A general guideline to populate the + // sesion_id: 1. If user has no activity for 30 min, a new session_id + // should be assigned. 2. The session_id should be unique across users, + // suggest use uuid or add visitor_id as prefix. + SessionId string `json:"sessionId,omitempty"` + + // Uri: Complete URL (window.location.href) of the user's current page. + // When using the client side event reporting with JavaScript pixel and + // Google Tag Manager, this value is filled in automatically. Maximum + // length 5,000 characters. + Uri string `json:"uri,omitempty"` + + // UserInfo: User information. + UserInfo *GoogleCloudRetailV2UserInfo `json:"userInfo,omitempty"` + + // VisitorId: Required. A unique identifier for tracking visitors. For + // example, this could be implemented with an HTTP cookie, which should + // be able to uniquely identify a visitor on a single device. This + // unique identifier should not change if the visitor log in/out of the + // website. Don't set the field to the same fixed ID for different + // users. This mixes the event history of those users together, which + // results in degraded model quality. The field must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. The field should not contain PII + // or user-data. We recommend to use Google Analytics Client ID + // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attributes") 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. "GcsPrefix") to include in + // NullFields is a list of field names (e.g. "Attributes") 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 @@ -5218,82 +5689,56 @@ type GoogleCloudRetailV2alphaImportErrorsConfig struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaImportErrorsConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaImportErrorsConfig +func (s *GoogleCloudRetailV2UserEvent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2UserEvent raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaImportMetadata: Metadata related to the -// progress of the Import operation. This is returned by the -// google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2alphaImportMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` - - // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If - // this field is set, when the import is finished, a notification is - // sent to specified Pub/Sub topic. The message data is JSON string of a - // Operation. Format of the Pub/Sub topic is - // `projects/{project}/topics/{topic}`. - NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` - - // RequestId: Deprecated. This field is never set. - RequestId string `json:"requestId,omitempty"` - - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` - - // TransformedUserEventsMetadata: Metadata related to transform user - // events. - TransformedUserEventsMetadata *GoogleCloudRetailV2alphaTransformedUserEventsMetadata `json:"transformedUserEventsMetadata,omitempty"` +// GoogleCloudRetailV2UserEventImportSummary: A summary of import +// result. The UserEventImportSummary summarizes the import status for +// user events. +type GoogleCloudRetailV2UserEventImportSummary struct { + // JoinedEventsCount: Count of user events imported with complete + // existing catalog information. + JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` + // UnjoinedEventsCount: Count of user events imported, but with catalog + // information not found in the imported catalog. + UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") + // 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. "CreateTime") 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 is a list of field names (e.g. "JoinedEventsCount") 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 *GoogleCloudRetailV2alphaImportMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaImportMetadata +func (s *GoogleCloudRetailV2UserEventImportSummary) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2UserEventImportSummary raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaImportProductsResponse: Response of the -// ImportProductsRequest. If the long running operation is done, then -// this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2alphaImportProductsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. - ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` +// GoogleCloudRetailV2UserEventInlineSource: The inline source for the +// input config for ImportUserEvents method. +type GoogleCloudRetailV2UserEventInlineSource struct { + // UserEvents: Required. A list of user events to import. Recommended + // max of 10k items. + UserEvents []*GoogleCloudRetailV2UserEvent `json:"userEvents,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "UserEvents") 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 @@ -5301,39 +5746,36 @@ type GoogleCloudRetailV2alphaImportProductsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "UserEvents") 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 *GoogleCloudRetailV2alphaImportProductsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaImportProductsResponse +func (s *GoogleCloudRetailV2UserEventInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2UserEventInlineSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaImportUserEventsResponse: Response of the -// ImportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2alphaImportUserEventsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` +// GoogleCloudRetailV2UserEventInputConfig: The input config source for +// user events. +type GoogleCloudRetailV2UserEventInputConfig struct { + // BigQuerySource: Required. BigQuery input source. + BigQuerySource *GoogleCloudRetailV2BigQuerySource `json:"bigQuerySource,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. - ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` + // GcsSource: Required. Google Cloud Storage location for the input + // content. + GcsSource *GoogleCloudRetailV2GcsSource `json:"gcsSource,omitempty"` - // ImportSummary: Aggregated statistics of user event import status. - ImportSummary *GoogleCloudRetailV2alphaUserEventImportSummary `json:"importSummary,omitempty"` + // UserEventInlineSource: Required. The Inline source for the input + // content for UserEvents. + UserEventInlineSource *GoogleCloudRetailV2UserEventInlineSource `json:"userEventInlineSource,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "BigQuerySource") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5341,150 +5783,121 @@ type GoogleCloudRetailV2alphaImportUserEventsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. 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 is a list of field names (e.g. "BigQuerySource") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. 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 *GoogleCloudRetailV2alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaImportUserEventsResponse +func (s *GoogleCloudRetailV2UserEventInputConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2UserEventInputConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaModel: Metadata that describes the training -// and serving parameters of a Model. A Model can be associated with a -// ServingConfig and then queried through the Predict API. -type GoogleCloudRetailV2alphaModel struct { - // CreateTime: Output only. Timestamp the Recommendation Model was - // created at. - CreateTime string `json:"createTime,omitempty"` - - // DataState: Output only. The state of data requirements for this - // model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be - // trained if the data is in `DATA_ERROR` state. Recommendation model - // can have `DATA_ERROR` state even if serving state is `ACTIVE`: models - // were trained successfully before, but cannot be refreshed because - // model no longer has sufficient data for training. - // - // Possible values: - // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never - // be explicitly set. - // "DATA_OK" - The model has sufficient training data. - // "DATA_ERROR" - The model does not have sufficient training data. - // Error messages can be queried via Stackdriver. - DataState string `json:"dataState,omitempty"` - - // DisplayName: Required. The display name of the model. Should be human - // readable, used to display Recommendation Models in the Retail Cloud - // Console Dashboard. UTF-8 encoded string with limit of 1024 - // characters. - DisplayName string `json:"displayName,omitempty"` +// GoogleCloudRetailV2UserInfo: Information of an end user. +type GoogleCloudRetailV2UserInfo struct { + // DirectUserRequest: True if the request is made directly from the end + // user, in which case the ip_address and user_agent can be populated + // from the HTTP request. This flag should be set only if the API + // request is made directly from the end user such as a mobile app (and + // not if a gateway or a server is processing and pushing the user + // events). This should not be set when using the JavaScript tag in + // UserEventService.CollectUserEvent. + DirectUserRequest bool `json:"directUserRequest,omitempty"` - // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, - // recommendation filtering by attributes is enabled for the model. - // - // Possible values: - // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when - // unset. In this case, server behavior defaults to - // RECOMMENDATIONS_FILTERING_DISABLED. - // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is - // disabled. - // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is - // enabled. - FilteringOption string `json:"filteringOption,omitempty"` + // IpAddress: The end user's IP address. This field is used to extract + // location information for personalization. This field must be either + // an IPv4 address (e.g. "104.133.9.80") or an IPv6 address (e.g. + // "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + // INVALID_ARGUMENT error is returned. This should not be set when: * + // setting SearchRequest.user_info. * using the JavaScript tag in + // UserEventService.CollectUserEvent or if direct_user_request is set. + IpAddress string `json:"ipAddress,omitempty"` - // LastTuneTime: Output only. The timestamp when the latest successful - // tune finished. - LastTuneTime string `json:"lastTuneTime,omitempty"` + // UserAgent: User agent as included in the HTTP header. Required for + // getting SearchResponse.sponsored_results. The field must be a UTF-8 + // encoded string with a length limit of 1,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. This should not be set when using + // the client side event reporting with GTM or JavaScript tag in + // UserEventService.CollectUserEvent or if direct_user_request is set. + UserAgent string `json:"userAgent,omitempty"` - // Name: Required. The fully qualified resource name of the model. - // Format: - // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i - // d}/models/{model_id}` catalog_id has char limit of 50. - // recommendation_model_id has char limit of 40. - Name string `json:"name,omitempty"` + // UserId: Highly recommended for logged-in users. Unique identifier for + // logged-in user, such as a user name. Don't set for anonymous users. + // Always use a hashed value for this ID. Don't set the field to the + // same fixed ID for different users. This mixes the event history of + // those users together, which results in degraded model quality. The + // field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + UserId string `json:"userId,omitempty"` - // OptimizationObjective: Optional. The optimization objective e.g. - // `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. - // If not specified, we choose default based on model type. Default - // depends on type of recommendation: `recommended-for-you` => `ctr` - // `others-you-may-like` => `ctr` `frequently-bought-together` => - // `revenue_per_order` - OptimizationObjective string `json:"optimizationObjective,omitempty"` + // ForceSendFields is a list of field names (e.g. "DirectUserRequest") + // 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:"-"` - // PageOptimizationConfig: Optional. The page optimization config. - PageOptimizationConfig *GoogleCloudRetailV2alphaModelPageOptimizationConfig `json:"pageOptimizationConfig,omitempty"` + // NullFields is a list of field names (e.g. "DirectUserRequest") 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:"-"` +} - // PeriodicTuningState: Optional. The state of periodic tuning. The - // period we use is 3 months - to do a one-off tune earlier use the - // `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`. - // - // Possible values: - // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, - // should never be explicitly set. - // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning - // disabled. Tuning can be reenabled by calling the - // `EnableModelPeriodicTuning` method or by calling the `TuneModel` - // method. - // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic - // tuning OR the `TuneModel` method. Hide the options in customer UI and - // reject any requests through the backend self serve API. - // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. - // Tuning can be disabled by calling the `DisableModelPeriodicTuning` - // method. - PeriodicTuningState string `json:"periodicTuningState,omitempty"` +func (s *GoogleCloudRetailV2UserInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2UserInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ServingConfigLists: Output only. The list of valid serving configs - // associated with the PageOptimizationConfig. - ServingConfigLists []*GoogleCloudRetailV2alphaModelServingConfigList `json:"servingConfigLists,omitempty"` +// GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata +// related to the progress of the AddFulfillmentPlaces operation. +// Currently empty because there is no meaningful metadata populated +// from the ProductService.AddFulfillmentPlaces method. +type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { +} - // ServingState: Output only. The serving state of the model: `ACTIVE`, - // `NOT_ACTIVE`. - // - // Possible values: - // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. - // "INACTIVE" - The model is not serving. - // "ACTIVE" - The model is serving and can be queried. - // "TUNED" - The model is trained on tuned hyperparameters and can be - // queried. - ServingState string `json:"servingState,omitempty"` +// GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the +// AddFulfillmentPlacesRequest. Currently empty because there is no +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. +type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { +} - // TrainingState: Optional. The training state that the model is in - // (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the - // service is frequency of training - this can be used to determine when - // to train model in order to control cost. If not specified: the - // default value for `CreateModel` method is `TRAINING`. The default - // value for `UpdateModel` method is to keep the state the same as - // before. - // - // Possible values: - // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. - // "PAUSED" - The model training is paused. - // "TRAINING" - The model is training. - TrainingState string `json:"trainingState,omitempty"` +// GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related +// to the progress of the AddLocalInventories operation. Currently empty +// because there is no meaningful metadata populated from the +// ProductService.AddLocalInventories method. +type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { +} - // TuningOperation: Output only. The tune operation associated with the - // model. Can be used to determine if there is an ongoing tune for this - // recommendation. Empty field implies no tune is goig on. - TuningOperation string `json:"tuningOperation,omitempty"` +// GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. +type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { +} - // Type: Required. The type of model e.g. `home-page`. Currently - // supported values: `recommended-for-you`, `others-you-may-like`, - // `frequently-bought-together`, `page-optimization`, `similar-items`, - // `buy-it-again`, and `recently-viewed`(readonly value). - Type string `json:"type,omitempty"` +// GoogleCloudRetailV2alphaBigQueryOutputResult: A BigQuery output +// result. +type GoogleCloudRetailV2alphaBigQueryOutputResult struct { + // DatasetId: The ID of a BigQuery Dataset. + DatasetId string `json:"datasetId,omitempty"` - // UpdateTime: Output only. Timestamp the Recommendation Model was last - // updated. E.g. if a Recommendation Model was paused - this would be - // the time the pause was initiated. - UpdateTime string `json:"updateTime,omitempty"` + // TableId: The ID of a BigQuery Table. + TableId string `json:"tableId,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "DatasetId") 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 @@ -5492,7 +5905,7 @@ type GoogleCloudRetailV2alphaModel struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "DatasetId") 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 @@ -5501,132 +5914,54 @@ type GoogleCloudRetailV2alphaModel struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaModel) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaModel +func (s *GoogleCloudRetailV2alphaBigQueryOutputResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaBigQueryOutputResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaModelPageOptimizationConfig: The -// PageOptimizationConfig for model training. This determines how many -// panels to optimize for, and which serving configurations to consider -// for each panel. The purpose of this model is to optimize which -// ServingConfig to show on which panels in way that optimizes the -// visitors shopping journey. -type GoogleCloudRetailV2alphaModelPageOptimizationConfig struct { - // PageOptimizationEventType: Required. The type of UserEvent this page - // optimization is shown for. Each page has an associated event type - - // this will be the corresponding event type for the page that the page - // optimization model is used on. Supported types: * `add-to-cart`: - // Products being added to cart. * `detail-page-view`: Products detail - // page viewed. * `home-page-view`: Homepage viewed * - // `category-page-view`: Homepage viewed * `shopping-cart-page-view`: - // User viewing a shopping cart. `home-page-view` only allows models - // with type `recommended-for-you`. All other - // page_optimization_event_type allow all Model.types. - PageOptimizationEventType string `json:"pageOptimizationEventType,omitempty"` - - // Panels: Required. A list of panel configurations. Limit = 5. - Panels []*GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel `json:"panels,omitempty"` - - // Restriction: Optional. How to restrict results across panels e.g. can - // the same ServingConfig be shown on multiple panels at once. If - // unspecified, default to `UNIQUE_MODEL_RESTRICTION`. - // - // Possible values: - // "RESTRICTION_UNSPECIFIED" - Unspecified value for restriction. - // "NO_RESTRICTION" - Allow any ServingConfig to be show on any number - // of panels. Example: `Panel1 candidates`: pdp_ctr, pdp_cvr, - // home_page_ctr_no_diversity `Panel2 candidates`: - // home_page_ctr_no_diversity, home_page_ctr_diversity, - // pdp_cvr_no_diversity `Restriction` = NO_RESTRICTION `Valid - // combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, - // home_page_ctr_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * - // (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, - // home_page_ctr_diversity) * (pdp_cvr, pdp_cvr_no_diversity) * - // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * - // (home_page_ctr_no_diversity, home_page_ctr_diversity) * - // (home_page_ctr_no_diversity, pdp_cvr_no_diversity) * `Invalid - // combinations`: [] - // "UNIQUE_SERVING_CONFIG_RESTRICTION" - Do not allow the same - // ServingConfig.name to be shown on multiple panels. Example: `Panel1 - // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 - // candidates`: * home_page_ctr_no_diversity, - // home_page_ctr_diversity_low, pdp_cvr_no_diversity * `Restriction` = - // `UNIQUE_SERVING_CONFIG_RESTRICTION` `Valid combinations`: * * - // (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, - // home_page_ctr_diversity_low) * (pdp_ctr, pdp_cvr_no_diversity) * - // (pdp_ctr, pdp_cvr_no_diversity) * (pdp_cvr, - // home_page_ctr_no_diversity) * (pdp_cvr, home_page_ctr_diversity_low) - // * (pdp_cvr, pdp_cvr_no_diversity) * (home_page_ctr_no_diversity, - // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, - // pdp_cvr_no_diversity) * `Invalid combinations`: * * - // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * - // "UNIQUE_MODEL_RESTRICTION" - Do not allow multiple ServingConfigs - // with same Model.name to be show on on different panels. Example: - // `Panel1 candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * - // `Panel2 candidates`: * home_page_ctr_no_diversity, - // home_page_ctr_diversity_low, pdp_cvr_no_diversity * `Restriction` = - // `UNIQUE_MODEL_RESTRICTION` `Valid combinations`: * * (pdp_ctr, - // home_page_ctr_no_diversity) * (pdp_ctr, home_page_ctr_diversity) * - // (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * - // (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, - // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, - // pdp_cvr_no_diversity) * `Invalid combinations`: * * - // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * (pdp_cvr, - // pdp_cvr_no_diversity) * - // "UNIQUE_MODEL_TYPE_RESTRICTION" - Do not allow multiple - // ServingConfigs with same Model.type to be shown on different panels. - // Example: `Panel1 candidates`: * pdp_ctr, pdp_cvr, - // home_page_ctr_no_diversity * `Panel2 candidates`: * - // home_page_ctr_no_diversity, home_page_ctr_diversity_low, - // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_MODEL_RESTRICTION` - // `Valid combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * - // (pdp_ctr, home_page_ctr_diversity) * (pdp_cvr, - // home_page_ctr_no_diversity) * (pdp_cvr, home_page_ctr_diversity_low) - // * (home_page_ctr_no_diversity, pdp_cvr_no_diversity) * `Invalid - // combinations`: * * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, - // pdp_cvr_no_diversity) * (pdp_cvr, pdp_cvr_no_diversity) * - // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * - // (home_page_ctr_no_diversity, home_page_ctr_diversity) * - Restriction string `json:"restriction,omitempty"` +// GoogleCloudRetailV2alphaCreateModelMetadata: Metadata associated with +// a create operation. +type GoogleCloudRetailV2alphaCreateModelMetadata struct { + // Model: The resource name of the model that this create applies to. + // Format: + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` + Model string `json:"model,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "PageOptimizationEventType") 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 is a list of field names (e.g. "Model") 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. - // "PageOptimizationEventType") 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 is a list of field names (e.g. "Model") 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 *GoogleCloudRetailV2alphaModelPageOptimizationConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfig +func (s *GoogleCloudRetailV2alphaCreateModelMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaCreateModelMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate: A -// candidate to consider for a given panel. Currently only ServingConfig -// are valid candidates. -type GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate struct { - // ServingConfigId: This has to be a valid ServingConfig identifier. For - // example, for a ServingConfig with full name: - // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/m - // y_candidate_config`, this would be `my_candidate_config`. - ServingConfigId string `json:"servingConfigId,omitempty"` +// GoogleCloudRetailV2alphaExportErrorsConfig: Configuration of +// destination for Export related errors. +type GoogleCloudRetailV2alphaExportErrorsConfig struct { + // GcsPrefix: Google Cloud Storage path for import errors. This must be + // an empty, existing Cloud Storage bucket. Export errors will be + // written to a file in this bucket, one per line, as a JSON-encoded + // `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` - // ForceSendFields is a list of field names (e.g. "ServingConfigId") to + // ForceSendFields is a list of field names (e.g. "GcsPrefix") 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 @@ -5634,37 +5969,33 @@ type GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ServingConfigId") 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 is a list of field names (e.g. "GcsPrefix") 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 *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate +func (s *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaExportErrorsConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel: An -// individual panel with a list of ServingConfigs to consider for it. -type GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel struct { - // Candidates: Required. The candidates to consider on the panel. Limit - // = 10. - Candidates []*GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"candidates,omitempty"` - - // DefaultCandidate: Required. The default candidate. If the model fails - // at serving time, we fall back to the default. - DefaultCandidate *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"defaultCandidate,omitempty"` +// GoogleCloudRetailV2alphaExportMetadata: Metadata related to the +// progress of the Export operation. This is returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2alphaExportMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // DisplayName: Optional. The name to display for the panel. - DisplayName string `json:"displayName,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Candidates") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5672,7 +6003,7 @@ type GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Candidates") to include in + // NullFields is a list of field names (e.g. "CreateTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5681,21 +6012,30 @@ type GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel +func (s *GoogleCloudRetailV2alphaExportMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaExportMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaModelServingConfigList: Represents an ordered -// combination of valid serving configs, which can be used for -// `PAGE_OPTIMIZATION` recommendations. -type GoogleCloudRetailV2alphaModelServingConfigList struct { - // ServingConfigIds: Optional. A set of valid serving configs that may - // be used for `PAGE_OPTIMIZATION`. - ServingConfigIds []string `json:"servingConfigIds,omitempty"` +// GoogleCloudRetailV2alphaExportProductsResponse: Response of the +// ExportProductsRequest. If the long running operation is done, then +// this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2alphaExportProductsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to + // ErrorsConfig: This field is never set. + ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` + + // OutputResult: Output result indicating where the data were exported + // to. + OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5703,28 +6043,39 @@ type GoogleCloudRetailV2alphaModelServingConfigList struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ServingConfigIds") 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 is a list of field names (e.g. "ErrorSamples") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. 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 *GoogleCloudRetailV2alphaModelServingConfigList) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaModelServingConfigList +func (s *GoogleCloudRetailV2alphaExportProductsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaExportProductsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaOutputResult: Output result. -type GoogleCloudRetailV2alphaOutputResult struct { - // BigqueryResult: Export result in BigQuery. - BigqueryResult []*GoogleCloudRetailV2alphaBigQueryOutputResult `json:"bigqueryResult,omitempty"` +// GoogleCloudRetailV2alphaExportUserEventsResponse: Response of the +// ExportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2alphaExportUserEventsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ForceSendFields is a list of field names (e.g. "BigqueryResult") to + // ErrorsConfig: This field is never set. + ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` + + // OutputResult: Output result indicating where the data were exported + // to. + OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5732,47 +6083,64 @@ type GoogleCloudRetailV2alphaOutputResult struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BigqueryResult") 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 *GoogleCloudRetailV2alphaOutputResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaOutputResult + // NullFields is a list of field names (e.g. "ErrorSamples") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. 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 *GoogleCloudRetailV2alphaExportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaExportUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaPurgeMetadata: Metadata related to the -// progress of the Purge operation. This will be returned by the -// google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2alphaPurgeMetadata struct { -} +// GoogleCloudRetailV2alphaImportCompletionDataResponse: Response of the +// ImportCompletionDataRequest. If the long running operation is done, +// this message is returned by the +// google.longrunning.Operations.response field if the operation is +// successful. +type GoogleCloudRetailV2alphaImportCompletionDataResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` -// GoogleCloudRetailV2alphaPurgeProductsMetadata: Metadata related to -// the progress of the PurgeProducts operation. This will be returned by -// the google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2alphaPurgeProductsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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:"-"` - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` + // NullFields is a list of field names (e.g. "ErrorSamples") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. 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:"-"` +} - // SuccessCount: Count of entries that were deleted successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` +func (s *GoogleCloudRetailV2alphaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaImportCompletionDataResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudRetailV2alphaImportErrorsConfig: Configuration of +// destination for Import related errors. +type GoogleCloudRetailV2alphaImportErrorsConfig struct { + // GcsPrefix: Google Cloud Storage prefix for import errors. This must + // be an empty, existing Cloud Storage directory. Import errors are + // written to sharded files in this directory, one per line, as a + // JSON-encoded `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "GcsPrefix") 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 @@ -5780,7 +6148,7 @@ type GoogleCloudRetailV2alphaPurgeProductsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "GcsPrefix") 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 @@ -5789,27 +6157,45 @@ type GoogleCloudRetailV2alphaPurgeProductsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaPurgeProductsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaPurgeProductsMetadata +func (s *GoogleCloudRetailV2alphaImportErrorsConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaImportErrorsConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaPurgeProductsResponse: Response of the -// PurgeProductsRequest. If the long running operation is successfully -// done, then this message is returned by the -// google.longrunning.Operations.response field. -type GoogleCloudRetailV2alphaPurgeProductsResponse struct { - // PurgeCount: The total count of products purged as a result of the - // operation. - PurgeCount int64 `json:"purgeCount,omitempty,string"` +// GoogleCloudRetailV2alphaImportMetadata: Metadata related to the +// progress of the Import operation. This is returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2alphaImportMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // PurgeSample: A sample of the product names that will be deleted. Only - // populated if `force` is set to false. A max of 100 names will be - // returned and the names are chosen at random. - PurgeSample []string `json:"purgeSample,omitempty"` + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "PurgeCount") to + // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If + // this field is set, when the import is finished, a notification is + // sent to specified Pub/Sub topic. The message data is JSON string of a + // Operation. Format of the Pub/Sub topic is + // `projects/{project}/topics/{topic}`. + NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` + + // RequestId: Deprecated. This field is never set. + RequestId string `json:"requestId,omitempty"` + + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // TransformedUserEventsMetadata: Metadata related to transform user + // events. + TransformedUserEventsMetadata *GoogleCloudRetailV2alphaTransformedUserEventsMetadata `json:"transformedUserEventsMetadata,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -5817,7 +6203,7 @@ type GoogleCloudRetailV2alphaPurgeProductsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PurgeCount") to include in + // NullFields is a list of field names (e.g. "CreateTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -5826,270 +6212,218 @@ type GoogleCloudRetailV2alphaPurgeProductsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2alphaPurgeProductsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaPurgeProductsResponse +func (s *GoogleCloudRetailV2alphaImportMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaImportMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaPurgeUserEventsResponse: Response of the -// PurgeUserEventsRequest. If the long running operation is successfully -// done, then this message is returned by the -// google.longrunning.Operations.response field. -type GoogleCloudRetailV2alphaPurgeUserEventsResponse struct { - // PurgedEventsCount: The total count of events purged as a result of - // the operation. - PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` +// GoogleCloudRetailV2alphaImportProductsResponse: Response of the +// ImportProductsRequest. If the long running operation is done, then +// this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2alphaImportProductsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") - // to unconditionally include in API requests. By default, fields with + // ErrorsConfig: Echoes the destination for the complete errors in the + // request if set. + ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. 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. "PurgedEventsCount") 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 is a list of field names (e.g. "ErrorSamples") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. 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 *GoogleCloudRetailV2alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsResponse +func (s *GoogleCloudRetailV2alphaImportProductsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaImportProductsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. -type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { -} +// GoogleCloudRetailV2alphaImportUserEventsResponse: Response of the +// ImportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2alphaImportUserEventsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` -// GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message -// for RejoinUserEvents method. -type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { - // RejoinedUserEventsCount: Number of user events that were joined with - // latest product catalog. - RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` + // ErrorsConfig: Echoes the destination for the complete errors if this + // field was set in the request. + ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "RejoinedUserEventsCount") 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. + // ImportSummary: Aggregated statistics of user event import status. + ImportSummary *GoogleCloudRetailV2alphaUserEventImportSummary `json:"importSummary,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "RejoinedUserEventsCount") - // 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 is a list of field names (e.g. "ErrorSamples") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. 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 *GoogleCloudRetailV2alphaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsResponse +func (s *GoogleCloudRetailV2alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaImportUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata: Metadata -// related to the progress of the RemoveFulfillmentPlaces operation. -// Currently empty because there is no meaningful metadata populated -// from the ProductService.RemoveFulfillmentPlaces method. -type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata struct { -} +// GoogleCloudRetailV2alphaModel: Metadata that describes the training +// and serving parameters of a Model. A Model can be associated with a +// ServingConfig and then queried through the Predict API. +type GoogleCloudRetailV2alphaModel struct { + // CreateTime: Output only. Timestamp the Recommendation Model was + // created at. + CreateTime string `json:"createTime,omitempty"` -// GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse: Response of -// the RemoveFulfillmentPlacesRequest. Currently empty because there is -// no meaningful response populated from the -// ProductService.RemoveFulfillmentPlaces method. -type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse struct { -} + // DataState: Output only. The state of data requirements for this + // model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be + // trained if the data is in `DATA_ERROR` state. Recommendation model + // can have `DATA_ERROR` state even if serving state is `ACTIVE`: models + // were trained successfully before, but cannot be refreshed because + // model no longer has sufficient data for training. + // + // Possible values: + // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never + // be explicitly set. + // "DATA_OK" - The model has sufficient training data. + // "DATA_ERROR" - The model does not have sufficient training data. + // Error messages can be queried via Stackdriver. + DataState string `json:"dataState,omitempty"` -// GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata: Metadata -// related to the progress of the RemoveLocalInventories operation. -// Currently empty because there is no meaningful metadata populated -// from the ProductService.RemoveLocalInventories method. -type GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata struct { -} - -// GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse: Response of -// the ProductService.RemoveLocalInventories API. Currently empty -// because there is no meaningful response populated from the -// ProductService.RemoveLocalInventories method. -type GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse struct { -} - -// GoogleCloudRetailV2alphaSetInventoryMetadata: Metadata related to the -// progress of the SetInventory operation. Currently empty because there -// is no meaningful metadata populated from the -// ProductService.SetInventory method. -type GoogleCloudRetailV2alphaSetInventoryMetadata struct { -} - -// GoogleCloudRetailV2alphaSetInventoryResponse: Response of the -// SetInventoryRequest. Currently empty because there is no meaningful -// response populated from the ProductService.SetInventory method. -type GoogleCloudRetailV2alphaSetInventoryResponse struct { -} - -// GoogleCloudRetailV2alphaTransformedUserEventsMetadata: Metadata -// related to transform user events operation. -type GoogleCloudRetailV2alphaTransformedUserEventsMetadata struct { - // SourceEventsCount: Count of entries in the source user events - // BigQuery table. - SourceEventsCount int64 `json:"sourceEventsCount,omitempty,string"` - - // TransformedEventsCount: Count of entries in the transformed user - // events BigQuery table, which could be different from the actually - // imported number of user events. - TransformedEventsCount int64 `json:"transformedEventsCount,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. "SourceEventsCount") - // 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:"-"` + // DisplayName: Required. The display name of the model. Should be human + // readable, used to display Recommendation Models in the Retail Cloud + // Console Dashboard. UTF-8 encoded string with limit of 1024 + // characters. + DisplayName string `json:"displayName,omitempty"` - // NullFields is a list of field names (e.g. "SourceEventsCount") 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:"-"` -} + // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, + // recommendation filtering by attributes is enabled for the model. + // + // Possible values: + // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when + // unset. In this case, server behavior defaults to + // RECOMMENDATIONS_FILTERING_DISABLED. + // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is + // disabled. + // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is + // enabled. + FilteringOption string `json:"filteringOption,omitempty"` -func (s *GoogleCloudRetailV2alphaTransformedUserEventsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaTransformedUserEventsMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // LastTuneTime: Output only. The timestamp when the latest successful + // tune finished. + LastTuneTime string `json:"lastTuneTime,omitempty"` -// GoogleCloudRetailV2alphaTuneModelMetadata: Metadata associated with a -// tune operation. -type GoogleCloudRetailV2alphaTuneModelMetadata struct { - // Model: The resource name of the model that this tune applies to. + // Name: Required. The fully qualified resource name of the model. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id - // }/models/{model_id} - Model string `json:"model,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Model") 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. "Model") 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 *GoogleCloudRetailV2alphaTuneModelMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaTuneModelMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudRetailV2alphaTuneModelResponse: Response associated with a -// tune operation. -type GoogleCloudRetailV2alphaTuneModelResponse struct { -} - -// GoogleCloudRetailV2alphaUserEventImportSummary: A summary of import -// result. The UserEventImportSummary summarizes the import status for -// user events. -type GoogleCloudRetailV2alphaUserEventImportSummary struct { - // JoinedEventsCount: Count of user events imported with complete - // existing catalog information. - JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` - - // UnjoinedEventsCount: Count of user events imported, but with catalog - // information not found in the imported catalog. - UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` catalog_id has char limit of 50. + // recommendation_model_id has char limit of 40. + Name string `json:"name,omitempty"` - // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") - // 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:"-"` + // OptimizationObjective: Optional. The optimization objective e.g. + // `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. + // If not specified, we choose default based on model type. Default + // depends on type of recommendation: `recommended-for-you` => `ctr` + // `others-you-may-like` => `ctr` `frequently-bought-together` => + // `revenue_per_order` + OptimizationObjective string `json:"optimizationObjective,omitempty"` - // NullFields is a list of field names (e.g. "JoinedEventsCount") 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:"-"` -} + // PageOptimizationConfig: Optional. The page optimization config. + PageOptimizationConfig *GoogleCloudRetailV2alphaModelPageOptimizationConfig `json:"pageOptimizationConfig,omitempty"` -func (s *GoogleCloudRetailV2alphaUserEventImportSummary) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2alphaUserEventImportSummary - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // PeriodicTuningState: Optional. The state of periodic tuning. The + // period we use is 3 months - to do a one-off tune earlier use the + // `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`. + // + // Possible values: + // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, + // should never be explicitly set. + // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning + // disabled. Tuning can be reenabled by calling the + // `EnableModelPeriodicTuning` method or by calling the `TuneModel` + // method. + // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic + // tuning OR the `TuneModel` method. Hide the options in customer UI and + // reject any requests through the backend self serve API. + // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. + // Tuning can be disabled by calling the `DisableModelPeriodicTuning` + // method. + PeriodicTuningState string `json:"periodicTuningState,omitempty"` -// GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related -// to the progress of the AddFulfillmentPlaces operation. Currently -// empty because there is no meaningful metadata populated from the -// ProductService.AddFulfillmentPlaces method. -type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { -} + // ServingConfigLists: Output only. The list of valid serving configs + // associated with the PageOptimizationConfig. + ServingConfigLists []*GoogleCloudRetailV2alphaModelServingConfigList `json:"servingConfigLists,omitempty"` -// GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the -// AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the -// ProductService.AddFulfillmentPlaces method. -type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { -} + // ServingState: Output only. The serving state of the model: `ACTIVE`, + // `NOT_ACTIVE`. + // + // Possible values: + // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. + // "INACTIVE" - The model is not serving. + // "ACTIVE" - The model is serving and can be queried. + // "TUNED" - The model is trained on tuned hyperparameters and can be + // queried. + ServingState string `json:"servingState,omitempty"` -// GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related -// to the progress of the AddLocalInventories operation. Currently empty -// because there is no meaningful metadata populated from the -// ProductService.AddLocalInventories method. -type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { -} + // TrainingState: Optional. The training state that the model is in + // (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the + // service is frequency of training - this can be used to determine when + // to train model in order to control cost. If not specified: the + // default value for `CreateModel` method is `TRAINING`. The default + // value for `UpdateModel` method is to keep the state the same as + // before. + // + // Possible values: + // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. + // "PAUSED" - The model training is paused. + // "TRAINING" - The model is training. + TrainingState string `json:"trainingState,omitempty"` -// GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the -// ProductService.AddLocalInventories API. Currently empty because there -// is no meaningful response populated from the -// ProductService.AddLocalInventories method. -type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { -} + // TuningOperation: Output only. The tune operation associated with the + // model. Can be used to determine if there is an ongoing tune for this + // recommendation. Empty field implies no tune is goig on. + TuningOperation string `json:"tuningOperation,omitempty"` -// GoogleCloudRetailV2betaBigQueryOutputResult: A BigQuery output -// result. -type GoogleCloudRetailV2betaBigQueryOutputResult struct { - // DatasetId: The ID of a BigQuery Dataset. - DatasetId string `json:"datasetId,omitempty"` + // Type: Required. The type of model e.g. `home-page`. Currently + // supported values: `recommended-for-you`, `others-you-may-like`, + // `frequently-bought-together`, `page-optimization`, `similar-items`, + // `buy-it-again`, and `recently-viewed`(readonly value). + Type string `json:"type,omitempty"` - // TableId: The ID of a BigQuery Table. - TableId string `json:"tableId,omitempty"` + // UpdateTime: Output only. Timestamp the Recommendation Model was last + // updated. E.g. if a Recommendation Model was paused - this would be + // the time the pause was initiated. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "DatasetId") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6097,7 +6431,7 @@ type GoogleCloudRetailV2betaBigQueryOutputResult struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DatasetId") to include in + // NullFields is a list of field names (e.g. "CreateTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -6106,56 +6440,132 @@ type GoogleCloudRetailV2betaBigQueryOutputResult struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2betaBigQueryOutputResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaBigQueryOutputResult +func (s *GoogleCloudRetailV2alphaModel) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaModel raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaExportErrorsConfig: Configuration of -// destination for Export related errors. -type GoogleCloudRetailV2betaExportErrorsConfig struct { - // GcsPrefix: Google Cloud Storage path for import errors. This must be - // an empty, existing Cloud Storage bucket. Export errors will be - // written to a file in this bucket, one per line, as a JSON-encoded - // `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` +// GoogleCloudRetailV2alphaModelPageOptimizationConfig: The +// PageOptimizationConfig for model training. This determines how many +// panels to optimize for, and which serving configurations to consider +// for each panel. The purpose of this model is to optimize which +// ServingConfig to show on which panels in way that optimizes the +// visitors shopping journey. +type GoogleCloudRetailV2alphaModelPageOptimizationConfig struct { + // PageOptimizationEventType: Required. The type of UserEvent this page + // optimization is shown for. Each page has an associated event type - + // this will be the corresponding event type for the page that the page + // optimization model is used on. Supported types: * `add-to-cart`: + // Products being added to cart. * `detail-page-view`: Products detail + // page viewed. * `home-page-view`: Homepage viewed * + // `category-page-view`: Homepage viewed * `shopping-cart-page-view`: + // User viewing a shopping cart. `home-page-view` only allows models + // with type `recommended-for-you`. All other + // page_optimization_event_type allow all Model.types. + PageOptimizationEventType string `json:"pageOptimizationEventType,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsPrefix") 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. + // Panels: Required. A list of panel configurations. Limit = 5. + Panels []*GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel `json:"panels,omitempty"` + + // Restriction: Optional. How to restrict results across panels e.g. can + // the same ServingConfig be shown on multiple panels at once. If + // unspecified, default to `UNIQUE_MODEL_RESTRICTION`. + // + // Possible values: + // "RESTRICTION_UNSPECIFIED" - Unspecified value for restriction. + // "NO_RESTRICTION" - Allow any ServingConfig to be show on any number + // of panels. Example: `Panel1 candidates`: pdp_ctr, pdp_cvr, + // home_page_ctr_no_diversity `Panel2 candidates`: + // home_page_ctr_no_diversity, home_page_ctr_diversity, + // pdp_cvr_no_diversity `Restriction` = NO_RESTRICTION `Valid + // combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, + // home_page_ctr_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * + // (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, + // home_page_ctr_diversity) * (pdp_cvr, pdp_cvr_no_diversity) * + // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * + // (home_page_ctr_no_diversity, home_page_ctr_diversity) * + // (home_page_ctr_no_diversity, pdp_cvr_no_diversity) * `Invalid + // combinations`: [] + // "UNIQUE_SERVING_CONFIG_RESTRICTION" - Do not allow the same + // ServingConfig.name to be shown on multiple panels. Example: `Panel1 + // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 + // candidates`: * home_page_ctr_no_diversity, + // home_page_ctr_diversity_low, pdp_cvr_no_diversity * `Restriction` = + // `UNIQUE_SERVING_CONFIG_RESTRICTION` `Valid combinations`: * * + // (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, + // home_page_ctr_diversity_low) * (pdp_ctr, pdp_cvr_no_diversity) * + // (pdp_ctr, pdp_cvr_no_diversity) * (pdp_cvr, + // home_page_ctr_no_diversity) * (pdp_cvr, home_page_ctr_diversity_low) + // * (pdp_cvr, pdp_cvr_no_diversity) * (home_page_ctr_no_diversity, + // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, + // pdp_cvr_no_diversity) * `Invalid combinations`: * * + // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * + // "UNIQUE_MODEL_RESTRICTION" - Do not allow multiple ServingConfigs + // with same Model.name to be show on on different panels. Example: + // `Panel1 candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * + // `Panel2 candidates`: * home_page_ctr_no_diversity, + // home_page_ctr_diversity_low, pdp_cvr_no_diversity * `Restriction` = + // `UNIQUE_MODEL_RESTRICTION` `Valid combinations`: * * (pdp_ctr, + // home_page_ctr_no_diversity) * (pdp_ctr, home_page_ctr_diversity) * + // (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * + // (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, + // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, + // pdp_cvr_no_diversity) * `Invalid combinations`: * * + // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * (pdp_cvr, + // pdp_cvr_no_diversity) * + // "UNIQUE_MODEL_TYPE_RESTRICTION" - Do not allow multiple + // ServingConfigs with same Model.type to be shown on different panels. + // Example: `Panel1 candidates`: * pdp_ctr, pdp_cvr, + // home_page_ctr_no_diversity * `Panel2 candidates`: * + // home_page_ctr_no_diversity, home_page_ctr_diversity_low, + // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_MODEL_RESTRICTION` + // `Valid combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * + // (pdp_ctr, home_page_ctr_diversity) * (pdp_cvr, + // home_page_ctr_no_diversity) * (pdp_cvr, home_page_ctr_diversity_low) + // * (home_page_ctr_no_diversity, pdp_cvr_no_diversity) * `Invalid + // combinations`: * * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, + // pdp_cvr_no_diversity) * (pdp_cvr, pdp_cvr_no_diversity) * + // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * + // (home_page_ctr_no_diversity, home_page_ctr_diversity) * + Restriction string `json:"restriction,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "PageOptimizationEventType") 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. "GcsPrefix") 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 is a list of field names (e.g. + // "PageOptimizationEventType") 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 *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaExportErrorsConfig +func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaExportMetadata: Metadata related to the -// progress of the Export operation. This will be returned by the -// google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2betaExportMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate: A +// candidate to consider for a given panel. Currently only ServingConfig +// are valid candidates. +type GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate struct { + // ServingConfigId: This has to be a valid ServingConfig identifier. For + // example, for a ServingConfig with full name: + // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/m + // y_candidate_config`, this would be `my_candidate_config`. + ServingConfigId string `json:"servingConfigId,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "ServingConfigId") 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 @@ -6163,39 +6573,37 @@ type GoogleCloudRetailV2betaExportMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. 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 is a list of field names (e.g. "ServingConfigId") 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 *GoogleCloudRetailV2betaExportMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaExportMetadata +func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaExportProductsResponse: Response of the -// ExportProductsRequest. If the long running operation is done, then -// this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2betaExportProductsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` +// GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel: An +// individual panel with a list of ServingConfigs to consider for it. +type GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel struct { + // Candidates: Required. The candidates to consider on the panel. Limit + // = 10. + Candidates []*GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"candidates,omitempty"` - // ErrorsConfig: This field is never set. - ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` + // DefaultCandidate: Required. The default candidate. If the model fails + // at serving time, we fall back to the default. + DefaultCandidate *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"defaultCandidate,omitempty"` - // OutputResult: Output result indicating where the data were exported - // to. - OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` + // DisplayName: Optional. The name to display for the panel. + DisplayName string `json:"displayName,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "Candidates") 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 @@ -6203,39 +6611,30 @@ type GoogleCloudRetailV2betaExportProductsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Candidates") 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 *GoogleCloudRetailV2betaExportProductsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaExportProductsResponse +func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaExportUserEventsResponse: Response of the -// ExportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2betaExportUserEventsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // ErrorsConfig: This field is never set. - ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` - - // OutputResult: Output result indicating where the data were exported - // to. - OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` +// GoogleCloudRetailV2alphaModelServingConfigList: Represents an ordered +// combination of valid serving configs, which can be used for +// `PAGE_OPTIMIZATION` recommendations. +type GoogleCloudRetailV2alphaModelServingConfigList struct { + // ServingConfigIds: Optional. A set of valid serving configs that may + // be used for `PAGE_OPTIMIZATION`. + ServingConfigIds []string `json:"servingConfigIds,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "ServingConfigIds") 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 @@ -6243,32 +6642,28 @@ type GoogleCloudRetailV2betaExportUserEventsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. 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 is a list of field names (e.g. "ServingConfigIds") 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 *GoogleCloudRetailV2betaExportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaExportUserEventsResponse +func (s *GoogleCloudRetailV2alphaModelServingConfigList) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaModelServingConfigList raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaImportCompletionDataResponse: Response of the -// ImportCompletionDataRequest. If the long running operation is done, -// this message is returned by the -// google.longrunning.Operations.response field if the operation is -// successful. -type GoogleCloudRetailV2betaImportCompletionDataResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` +// GoogleCloudRetailV2alphaOutputResult: Output result. +type GoogleCloudRetailV2alphaOutputResult struct { + // BigqueryResult: Export result in BigQuery. + BigqueryResult []*GoogleCloudRetailV2alphaBigQueryOutputResult `json:"bigqueryResult,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "BigqueryResult") 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 @@ -6276,57 +6671,32 @@ type GoogleCloudRetailV2betaImportCompletionDataResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. 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 is a list of field names (e.g. "BigqueryResult") 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 *GoogleCloudRetailV2betaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaImportCompletionDataResponse +func (s *GoogleCloudRetailV2alphaOutputResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaOutputResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaImportErrorsConfig: Configuration of -// destination for Import related errors. -type GoogleCloudRetailV2betaImportErrorsConfig struct { - // GcsPrefix: Google Cloud Storage prefix for import errors. This must - // be an empty, existing Cloud Storage directory. Import errors are - // written to sharded files in this directory, one per line, as a - // JSON-encoded `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` - - // ForceSendFields is a list of field names (e.g. "GcsPrefix") 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. "GcsPrefix") 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 *GoogleCloudRetailV2betaImportErrorsConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaImportErrorsConfig - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +// GoogleCloudRetailV2alphaPurgeMetadata: Metadata related to the +// progress of the Purge operation. This will be returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2alphaPurgeMetadata struct { } -// GoogleCloudRetailV2betaImportMetadata: Metadata related to the -// progress of the Import operation. This is returned by the -// google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2betaImportMetadata struct { +// GoogleCloudRetailV2alphaPurgeProductsMetadata: Metadata related to +// the progress of the PurgeProducts operation. This will be returned by +// the google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2alphaPurgeProductsMetadata struct { // CreateTime: Operation create time. CreateTime string `json:"createTime,omitempty"` @@ -6334,17 +6704,7 @@ type GoogleCloudRetailV2betaImportMetadata struct { // processing. FailureCount int64 `json:"failureCount,omitempty,string"` - // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If - // this field is set, when the import is finished, a notification is - // sent to specified Pub/Sub topic. The message data is JSON string of a - // Operation. Format of the Pub/Sub topic is - // `projects/{project}/topics/{topic}`. - NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` - - // RequestId: Deprecated. This field is never set. - RequestId string `json:"requestId,omitempty"` - - // SuccessCount: Count of entries that were processed successfully. + // SuccessCount: Count of entries that were deleted successfully. SuccessCount int64 `json:"successCount,omitempty,string"` // UpdateTime: Operation last update time. If the operation is done, @@ -6368,67 +6728,27 @@ type GoogleCloudRetailV2betaImportMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2betaImportMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaImportMetadata - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudRetailV2betaImportProductsResponse: Response of the -// ImportProductsRequest. If the long running operation is done, then -// this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2betaImportProductsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. - ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` - - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2betaImportProductsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaImportProductsResponse +func (s *GoogleCloudRetailV2alphaPurgeProductsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaPurgeProductsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaImportUserEventsResponse: Response of the -// ImportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudRetailV2betaImportUserEventsResponse struct { - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. - ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` +// GoogleCloudRetailV2alphaPurgeProductsResponse: Response of the +// PurgeProductsRequest. If the long running operation is successfully +// done, then this message is returned by the +// google.longrunning.Operations.response field. +type GoogleCloudRetailV2alphaPurgeProductsResponse struct { + // PurgeCount: The total count of products purged as a result of the + // operation. + PurgeCount int64 `json:"purgeCount,omitempty,string"` - // ImportSummary: Aggregated statistics of user event import status. - ImportSummary *GoogleCloudRetailV2betaUserEventImportSummary `json:"importSummary,omitempty"` + // PurgeSample: A sample of the product names that will be deleted. Only + // populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + PurgeSample []string `json:"purgeSample,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // ForceSendFields is a list of field names (e.g. "PurgeCount") 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 @@ -6436,61 +6756,26 @@ type GoogleCloudRetailV2betaImportUserEventsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorSamples") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "PurgeCount") 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 *GoogleCloudRetailV2betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaImportUserEventsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudRetailV2betaOutputResult: Output result. -type GoogleCloudRetailV2betaOutputResult struct { - // BigqueryResult: Export result in BigQuery. - BigqueryResult []*GoogleCloudRetailV2betaBigQueryOutputResult `json:"bigqueryResult,omitempty"` - - // ForceSendFields is a list of field names (e.g. "BigqueryResult") 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. "BigqueryResult") 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 *GoogleCloudRetailV2betaOutputResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaOutputResult +func (s *GoogleCloudRetailV2alphaPurgeProductsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaPurgeProductsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaPurgeMetadata: Metadata related to the -// progress of the Purge operation. This will be returned by the -// google.longrunning.Operation.metadata field. -type GoogleCloudRetailV2betaPurgeMetadata struct { -} - -// GoogleCloudRetailV2betaPurgeUserEventsResponse: Response of the +// GoogleCloudRetailV2alphaPurgeUserEventsResponse: Response of the // PurgeUserEventsRequest. If the long running operation is successfully // done, then this message is returned by the // google.longrunning.Operations.response field. -type GoogleCloudRetailV2betaPurgeUserEventsResponse struct { +type GoogleCloudRetailV2alphaPurgeUserEventsResponse struct { // PurgedEventsCount: The total count of events purged as a result of // the operation. PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` @@ -6513,20 +6798,20 @@ type GoogleCloudRetailV2betaPurgeUserEventsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2betaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaPurgeUserEventsResponse +func (s *GoogleCloudRetailV2alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. -type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { +// GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for +// `RejoinUserEvents` method. +type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { } -// GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for -// RejoinUserEvents method. -type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { +// GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message +// for `RejoinUserEvents` method. +type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` @@ -6550,66 +6835,66 @@ type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2betaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaRejoinUserEventsResponse +func (s *GoogleCloudRetailV2alphaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata: Metadata +// GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata: Metadata // related to the progress of the RemoveFulfillmentPlaces operation. // Currently empty because there is no meaningful metadata populated // from the ProductService.RemoveFulfillmentPlaces method. -type GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata struct { +type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata struct { } -// GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse: Response of +// GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse: Response of // the RemoveFulfillmentPlacesRequest. Currently empty because there is // no meaningful response populated from the // ProductService.RemoveFulfillmentPlaces method. -type GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse struct { +type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse struct { } -// GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata: Metadata +// GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata: Metadata // related to the progress of the RemoveLocalInventories operation. // Currently empty because there is no meaningful metadata populated // from the ProductService.RemoveLocalInventories method. -type GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata struct { +type GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata struct { } -// GoogleCloudRetailV2betaRemoveLocalInventoriesResponse: Response of +// GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse: Response of // the ProductService.RemoveLocalInventories API. Currently empty // because there is no meaningful response populated from the // ProductService.RemoveLocalInventories method. -type GoogleCloudRetailV2betaRemoveLocalInventoriesResponse struct { +type GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse struct { } -// GoogleCloudRetailV2betaSetInventoryMetadata: Metadata related to the +// GoogleCloudRetailV2alphaSetInventoryMetadata: Metadata related to the // progress of the SetInventory operation. Currently empty because there // is no meaningful metadata populated from the // ProductService.SetInventory method. -type GoogleCloudRetailV2betaSetInventoryMetadata struct { +type GoogleCloudRetailV2alphaSetInventoryMetadata struct { } -// GoogleCloudRetailV2betaSetInventoryResponse: Response of the +// GoogleCloudRetailV2alphaSetInventoryResponse: Response of the // SetInventoryRequest. Currently empty because there is no meaningful // response populated from the ProductService.SetInventory method. -type GoogleCloudRetailV2betaSetInventoryResponse struct { +type GoogleCloudRetailV2alphaSetInventoryResponse struct { } -// GoogleCloudRetailV2betaUserEventImportSummary: A summary of import -// result. The UserEventImportSummary summarizes the import status for -// user events. -type GoogleCloudRetailV2betaUserEventImportSummary struct { - // JoinedEventsCount: Count of user events imported with complete - // existing catalog information. - JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` +// GoogleCloudRetailV2alphaTransformedUserEventsMetadata: Metadata +// related to transform user events operation. +type GoogleCloudRetailV2alphaTransformedUserEventsMetadata struct { + // SourceEventsCount: Count of entries in the source user events + // BigQuery table. + SourceEventsCount int64 `json:"sourceEventsCount,omitempty,string"` - // UnjoinedEventsCount: Count of user events imported, but with catalog - // information not found in the imported catalog. - UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + // TransformedEventsCount: Count of entries in the transformed user + // events BigQuery table, which could be different from the actually + // imported number of user events. + TransformedEventsCount int64 `json:"transformedEventsCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") + // ForceSendFields is a list of field names (e.g. "SourceEventsCount") // 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 @@ -6617,7 +6902,7 @@ type GoogleCloudRetailV2betaUserEventImportSummary struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "JoinedEventsCount") to + // NullFields is a list of field names (e.g. "SourceEventsCount") 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 @@ -6627,27 +6912,22 @@ type GoogleCloudRetailV2betaUserEventImportSummary struct { NullFields []string `json:"-"` } -func (s *GoogleCloudRetailV2betaUserEventImportSummary) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudRetailV2betaUserEventImportSummary +func (s *GoogleCloudRetailV2alphaTransformedUserEventsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaTransformedUserEventsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleLongrunningListOperationsResponse: The response message for -// Operations.ListOperations. -type GoogleLongrunningListOperationsResponse struct { - // NextPageToken: The standard List next-page token. - NextPageToken string `json:"nextPageToken,omitempty"` - - // Operations: A list of operations that matches the specified filter in - // the request. - Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// GoogleCloudRetailV2alphaTuneModelMetadata: Metadata associated with a +// tune operation. +type GoogleCloudRetailV2alphaTuneModelMetadata struct { + // Model: The resource name of the model that this tune applies to. + // Format: + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` + Model string `json:"model,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // ForceSendFields is a list of field names (e.g. "Model") 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 @@ -6655,61 +6935,100 @@ type GoogleLongrunningListOperationsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Model") 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 *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleLongrunningListOperationsResponse +func (s *GoogleCloudRetailV2alphaTuneModelMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaTuneModelMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleLongrunningOperation: This resource represents a long-running -// operation that is the result of a network API call. -type GoogleLongrunningOperation struct { - // Done: If the value is `false`, it means the operation is still in - // progress. If `true`, the operation is completed, and either `error` - // or `response` is available. - Done bool `json:"done,omitempty"` +// GoogleCloudRetailV2alphaTuneModelResponse: Response associated with a +// tune operation. +type GoogleCloudRetailV2alphaTuneModelResponse struct { +} - // Error: The error result of the operation in case of failure or - // cancellation. - Error *GoogleRpcStatus `json:"error,omitempty"` +// GoogleCloudRetailV2alphaUserEventImportSummary: A summary of import +// result. The UserEventImportSummary summarizes the import status for +// user events. +type GoogleCloudRetailV2alphaUserEventImportSummary struct { + // JoinedEventsCount: Count of user events imported with complete + // existing catalog information. + JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` - // Metadata: Service-specific metadata associated with the operation. It - // typically contains progress information and common metadata such as - // create time. Some services might not provide such metadata. Any - // method that returns a long-running operation should document the - // metadata type, if any. - Metadata googleapi.RawMessage `json:"metadata,omitempty"` + // UnjoinedEventsCount: Count of user events imported, but with catalog + // information not found in the imported catalog. + UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` - // Name: The server-assigned name, which is only unique within the same - // service that originally returns it. If you use the default HTTP - // mapping, the `name` should be a resource name ending with - // `operations/{unique_id}`. - Name string `json:"name,omitempty"` + // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") + // 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:"-"` - // Response: The normal response of the operation in case of success. If - // the original method returns no data on success, such as `Delete`, the - // response is `google.protobuf.Empty`. If the original method is - // standard `Get`/`Create`/`Update`, the response should be the - // resource. For other methods, the response should have the type - // `XxxResponse`, where `Xxx` is the original method name. For example, - // if the original method name is `TakeSnapshot()`, the inferred - // response type is `TakeSnapshotResponse`. - Response googleapi.RawMessage `json:"response,omitempty"` + // NullFields is a list of field names (e.g. "JoinedEventsCount") 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:"-"` +} - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +func (s *GoogleCloudRetailV2alphaUserEventImportSummary) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaUserEventImportSummary + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ForceSendFields is a list of field names (e.g. "Done") to +// GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related +// to the progress of the AddFulfillmentPlaces operation. Currently +// empty because there is no meaningful metadata populated from the +// ProductService.AddFulfillmentPlaces method. +type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { +} + +// GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the +// AddFulfillmentPlacesRequest. Currently empty because there is no +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. +type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { +} + +// GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related +// to the progress of the AddLocalInventories operation. Currently empty +// because there is no meaningful metadata populated from the +// ProductService.AddLocalInventories method. +type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { +} + +// GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. +type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { +} + +// GoogleCloudRetailV2betaBigQueryOutputResult: A BigQuery output +// result. +type GoogleCloudRetailV2betaBigQueryOutputResult struct { + // DatasetId: The ID of a BigQuery Dataset. + DatasetId string `json:"datasetId,omitempty"` + + // TableId: The ID of a BigQuery Table. + TableId string `json:"tableId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") 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 @@ -6717,8 +7036,8 @@ type GoogleLongrunningOperation struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Done") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "DatasetId") 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. @@ -6726,45 +7045,22 @@ type GoogleLongrunningOperation struct { NullFields []string `json:"-"` } -func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { - type NoMethod GoogleLongrunningOperation +func (s *GoogleCloudRetailV2betaBigQueryOutputResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaBigQueryOutputResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleProtobufEmpty: A generic empty message that you can re-use to -// avoid defining duplicated empty messages in your APIs. A typical -// example is to use it as the request or the response type of an API -// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) -// returns (google.protobuf.Empty); } -type GoogleProtobufEmpty struct { - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` -} - -// GoogleRpcStatus: The `Status` type defines a logical error model that -// is suitable for different programming environments, including REST -// APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each -// `Status` message contains three pieces of data: error code, error -// message, and error details. You can find out more about this error -// model and how to work with it in the API Design Guide -// (https://cloud.google.com/apis/design/errors). -type GoogleRpcStatus struct { - // Code: The status code, which should be an enum value of - // google.rpc.Code. - Code int64 `json:"code,omitempty"` - - // Details: A list of messages that carry the error details. There is a - // common set of message types for APIs to use. - Details []googleapi.RawMessage `json:"details,omitempty"` - - // Message: A developer-facing error message, which should be in - // English. Any user-facing error message should be localized and sent - // in the google.rpc.Status.details field, or localized by the client. - Message string `json:"message,omitempty"` +// GoogleCloudRetailV2betaExportErrorsConfig: Configuration of +// destination for Export related errors. +type GoogleCloudRetailV2betaExportErrorsConfig struct { + // GcsPrefix: Google Cloud Storage path for import errors. This must be + // an empty, existing Cloud Storage bucket. Export errors will be + // written to a file in this bucket, one per line, as a JSON-encoded + // `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` - // ForceSendFields is a list of field names (e.g. "Code") to + // ForceSendFields is a list of field names (e.g. "GcsPrefix") 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 @@ -6772,8 +7068,8 @@ type GoogleRpcStatus struct { // 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 + // NullFields is a list of field names (e.g. "GcsPrefix") 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. @@ -6781,37 +7077,24 @@ type GoogleRpcStatus struct { NullFields []string `json:"-"` } -func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { - type NoMethod GoogleRpcStatus +func (s *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaExportErrorsConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleTypeDate: Represents a whole or partial calendar date, such as -// a birthday. The time of day and time zone are either specified -// elsewhere or are insignificant. The date is relative to the Gregorian -// Calendar. This can represent one of the following: * A full date, -// with non-zero year, month, and day values. * A month and day, with a -// zero year (for example, an anniversary). * A year on its own, with a -// zero month and a zero day. * A year and month, with a zero day (for -// example, a credit card expiration date). Related types: * -// google.type.TimeOfDay * google.type.DateTime * -// google.protobuf.Timestamp -type GoogleTypeDate struct { - // Day: Day of a month. Must be from 1 to 31 and valid for the year and - // month, or 0 to specify a year by itself or a year and month where the - // day isn't significant. - Day int64 `json:"day,omitempty"` - - // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year - // without a month and day. - Month int64 `json:"month,omitempty"` +// GoogleCloudRetailV2betaExportMetadata: Metadata related to the +// progress of the Export operation. This is returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2betaExportMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a - // date without a year. - Year int64 `json:"year,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Day") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -6819,8 +7102,8 @@ type GoogleTypeDate struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Day") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. 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. @@ -6828,110 +7111,2688 @@ type GoogleTypeDate struct { NullFields []string `json:"-"` } -func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { - type NoMethod GoogleTypeDate +func (s *GoogleCloudRetailV2betaExportMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaExportMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// method id "retail.projects.locations.catalogs.completeQuery": +// GoogleCloudRetailV2betaExportProductsResponse: Response of the +// ExportProductsRequest. If the long running operation is done, then +// this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2betaExportProductsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` -type ProjectsLocationsCatalogsCompleteQueryCall struct { - s *Service - catalog string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context + // ErrorsConfig: This field is never set. + ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` + + // OutputResult: Output result indicating where the data were exported + // to. + OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2betaExportProductsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaExportProductsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaExportUserEventsResponse: Response of the +// ExportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2betaExportUserEventsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + + // ErrorsConfig: This field is never set. + ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` + + // OutputResult: Output result indicating where the data were exported + // to. + OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2betaExportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaExportUserEventsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaImportCompletionDataResponse: Response of the +// ImportCompletionDataRequest. If the long running operation is done, +// this message is returned by the +// google.longrunning.Operations.response field if the operation is +// successful. +type GoogleCloudRetailV2betaImportCompletionDataResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2betaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaImportCompletionDataResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaImportErrorsConfig: Configuration of +// destination for Import related errors. +type GoogleCloudRetailV2betaImportErrorsConfig struct { + // GcsPrefix: Google Cloud Storage prefix for import errors. This must + // be an empty, existing Cloud Storage directory. Import errors are + // written to sharded files in this directory, one per line, as a + // JSON-encoded `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GcsPrefix") 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. "GcsPrefix") 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 *GoogleCloudRetailV2betaImportErrorsConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaImportErrorsConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaImportMetadata: Metadata related to the +// progress of the Import operation. This is returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2betaImportMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If + // this field is set, when the import is finished, a notification is + // sent to specified Pub/Sub topic. The message data is JSON string of a + // Operation. Format of the Pub/Sub topic is + // `projects/{project}/topics/{topic}`. + NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` + + // RequestId: Deprecated. This field is never set. + RequestId string `json:"requestId,omitempty"` + + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "CreateTime") 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 *GoogleCloudRetailV2betaImportMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaImportMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaImportProductsResponse: Response of the +// ImportProductsRequest. If the long running operation is done, then +// this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2betaImportProductsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + + // ErrorsConfig: Echoes the destination for the complete errors in the + // request if set. + ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2betaImportProductsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaImportProductsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaImportUserEventsResponse: Response of the +// ImportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudRetailV2betaImportUserEventsResponse struct { + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + + // ErrorsConfig: Echoes the destination for the complete errors if this + // field was set in the request. + ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` + + // ImportSummary: Aggregated statistics of user event import status. + ImportSummary *GoogleCloudRetailV2betaUserEventImportSummary `json:"importSummary,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorSamples") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "ErrorSamples") 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 *GoogleCloudRetailV2betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaImportUserEventsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaOutputResult: Output result. +type GoogleCloudRetailV2betaOutputResult struct { + // BigqueryResult: Export result in BigQuery. + BigqueryResult []*GoogleCloudRetailV2betaBigQueryOutputResult `json:"bigqueryResult,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BigqueryResult") 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. "BigqueryResult") 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 *GoogleCloudRetailV2betaOutputResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaOutputResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaPurgeMetadata: Metadata related to the +// progress of the Purge operation. This will be returned by the +// google.longrunning.Operation.metadata field. +type GoogleCloudRetailV2betaPurgeMetadata struct { +} + +// GoogleCloudRetailV2betaPurgeUserEventsResponse: Response of the +// PurgeUserEventsRequest. If the long running operation is successfully +// done, then this message is returned by the +// google.longrunning.Operations.response field. +type GoogleCloudRetailV2betaPurgeUserEventsResponse struct { + // PurgedEventsCount: The total count of events purged as a result of + // the operation. + PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") + // 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. "PurgedEventsCount") 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 *GoogleCloudRetailV2betaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaPurgeUserEventsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for +// `RejoinUserEvents` method. +type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { +} + +// GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for +// `RejoinUserEvents` method. +type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { + // RejoinedUserEventsCount: Number of user events that were joined with + // latest product catalog. + RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "RejoinedUserEventsCount") 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. "RejoinedUserEventsCount") + // 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 *GoogleCloudRetailV2betaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaRejoinUserEventsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata: Metadata +// related to the progress of the RemoveFulfillmentPlaces operation. +// Currently empty because there is no meaningful metadata populated +// from the ProductService.RemoveFulfillmentPlaces method. +type GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata struct { +} + +// GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse: Response of +// the RemoveFulfillmentPlacesRequest. Currently empty because there is +// no meaningful response populated from the +// ProductService.RemoveFulfillmentPlaces method. +type GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse struct { +} + +// GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata: Metadata +// related to the progress of the RemoveLocalInventories operation. +// Currently empty because there is no meaningful metadata populated +// from the ProductService.RemoveLocalInventories method. +type GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata struct { +} + +// GoogleCloudRetailV2betaRemoveLocalInventoriesResponse: Response of +// the ProductService.RemoveLocalInventories API. Currently empty +// because there is no meaningful response populated from the +// ProductService.RemoveLocalInventories method. +type GoogleCloudRetailV2betaRemoveLocalInventoriesResponse struct { +} + +// GoogleCloudRetailV2betaSetInventoryMetadata: Metadata related to the +// progress of the SetInventory operation. Currently empty because there +// is no meaningful metadata populated from the +// ProductService.SetInventory method. +type GoogleCloudRetailV2betaSetInventoryMetadata struct { +} + +// GoogleCloudRetailV2betaSetInventoryResponse: Response of the +// SetInventoryRequest. Currently empty because there is no meaningful +// response populated from the ProductService.SetInventory method. +type GoogleCloudRetailV2betaSetInventoryResponse struct { +} + +// GoogleCloudRetailV2betaUserEventImportSummary: A summary of import +// result. The UserEventImportSummary summarizes the import status for +// user events. +type GoogleCloudRetailV2betaUserEventImportSummary struct { + // JoinedEventsCount: Count of user events imported with complete + // existing catalog information. + JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` + + // UnjoinedEventsCount: Count of user events imported, but with catalog + // information not found in the imported catalog. + UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") + // 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. "JoinedEventsCount") 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 *GoogleCloudRetailV2betaUserEventImportSummary) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaUserEventImportSummary + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleLongrunningListOperationsResponse: The response message for +// Operations.ListOperations. +type GoogleLongrunningListOperationsResponse struct { + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: A list of operations that matches the specified filter in + // the request. + Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "NextPageToken") 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 *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleLongrunningListOperationsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleLongrunningOperation: This resource represents a long-running +// operation that is the result of a network API call. +type GoogleLongrunningOperation struct { + // Done: If the value is `false`, it means the operation is still in + // progress. If `true`, the operation is completed, and either `error` + // or `response` is available. + Done bool `json:"done,omitempty"` + + // Error: The error result of the operation in case of failure or + // cancellation. + Error *GoogleRpcStatus `json:"error,omitempty"` + + // Metadata: Service-specific metadata associated with the operation. It + // typically contains progress information and common metadata such as + // create time. Some services might not provide such metadata. Any + // method that returns a long-running operation should document the + // metadata type, if any. + Metadata googleapi.RawMessage `json:"metadata,omitempty"` + + // Name: The server-assigned name, which is only unique within the same + // service that originally returns it. If you use the default HTTP + // mapping, the `name` should be a resource name ending with + // `operations/{unique_id}`. + Name string `json:"name,omitempty"` + + // Response: The normal response of the operation in case of success. If + // the original method returns no data on success, such as `Delete`, the + // response is `google.protobuf.Empty`. If the original method is + // standard `Get`/`Create`/`Update`, the response should be the + // resource. For other methods, the response should have the type + // `XxxResponse`, where `Xxx` is the original method name. For example, + // if the original method name is `TakeSnapshot()`, the inferred + // response type is `TakeSnapshotResponse`. + Response googleapi.RawMessage `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "Done") 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 *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleLongrunningOperation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleProtobufEmpty: A generic empty message that you can re-use to +// avoid defining duplicated empty messages in your APIs. A typical +// example is to use it as the request or the response type of an API +// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) +// returns (google.protobuf.Empty); } +type GoogleProtobufEmpty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GoogleRpcStatus: The `Status` type defines a logical error model that +// is suitable for different programming environments, including REST +// APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each +// `Status` message contains three pieces of data: error code, error +// message, and error details. You can find out more about this error +// model and how to work with it in the API Design Guide +// (https://cloud.google.com/apis/design/errors). +type GoogleRpcStatus struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There is a + // common set of message types for APIs to use. + Details []googleapi.RawMessage `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the google.rpc.Status.details field, or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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 *GoogleRpcStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleRpcStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleTypeDate: Represents a whole or partial calendar date, such as +// a birthday. The time of day and time zone are either specified +// elsewhere or are insignificant. The date is relative to the Gregorian +// Calendar. This can represent one of the following: * A full date, +// with non-zero year, month, and day values. * A month and day, with a +// zero year (for example, an anniversary). * A year on its own, with a +// zero month and a zero day. * A year and month, with a zero day (for +// example, a credit card expiration date). Related types: * +// google.type.TimeOfDay * google.type.DateTime * +// google.protobuf.Timestamp +type GoogleTypeDate struct { + // Day: Day of a month. Must be from 1 to 31 and valid for the year and + // month, or 0 to specify a year by itself or a year and month where the + // day isn't significant. + Day int64 `json:"day,omitempty"` + + // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year + // without a month and day. + Month int64 `json:"month,omitempty"` + + // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a + // date without a year. + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") 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. "Day") 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 *GoogleTypeDate) MarshalJSON() ([]byte, error) { + type NoMethod GoogleTypeDate + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "retail.projects.locations.catalogs.completeQuery": + +type ProjectsLocationsCatalogsCompleteQueryCall struct { + s *Service + catalog string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// CompleteQuery: Completes the specified prefix with keyword +// suggestions. This feature is only available for users who have Retail +// Search enabled. Enable Retail Search on Cloud Console before using +// this feature. +// +// - catalog: Catalog for which the completion is performed. Full +// resource name of catalog, such as +// `projects/*/locations/global/catalogs/default_catalog`. +func (r *ProjectsLocationsCatalogsService) CompleteQuery(catalog string) *ProjectsLocationsCatalogsCompleteQueryCall { + c := &ProjectsLocationsCatalogsCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.catalog = catalog + return c +} + +// Dataset sets the optional parameter "dataset": Determines which +// dataset to use for fetching completion. "user-data" will use the +// imported dataset through CompletionService.ImportCompletionData. +// "cloud-retail" will use the dataset generated by cloud retail based +// on user events. If leave empty, it will use the "user-data". Current +// supported values: * user-data * cloud-retail: This option requires +// enabling auto-learning function first. See guidelines +// (https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). +func (c *ProjectsLocationsCatalogsCompleteQueryCall) Dataset(dataset string) *ProjectsLocationsCatalogsCompleteQueryCall { + c.urlParams_.Set("dataset", dataset) + return c +} + +// DeviceType sets the optional parameter "deviceType": The device type +// context for completion suggestions. It is useful to apply different +// suggestions on different device types, e.g. `DESKTOP`, `MOBILE`. If +// it is empty, the suggestions are across all device types. Supported +// formats: * `UNKNOWN_DEVICE_TYPE` * `DESKTOP` * `MOBILE` * A +// customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. +func (c *ProjectsLocationsCatalogsCompleteQueryCall) DeviceType(deviceType string) *ProjectsLocationsCatalogsCompleteQueryCall { + c.urlParams_.Set("deviceType", deviceType) + return c +} + +// LanguageCodes sets the optional parameter "languageCodes": Note that +// this field applies for `user-data` dataset only. For requests with +// `cloud-retail` dataset, setting this field has no effect. The +// language filters applied to the output suggestions. If set, it should +// contain the language of the query. If not set, suggestions are +// returned without considering language restrictions. This is the +// BCP-47 language code, such as "en-US" or "sr-Latn". For more +// information, see Tags for Identifying Languages +// (https://tools.ietf.org/html/bcp47). The maximum number of language +// codes is 3. +func (c *ProjectsLocationsCatalogsCompleteQueryCall) LanguageCodes(languageCodes ...string) *ProjectsLocationsCatalogsCompleteQueryCall { + c.urlParams_.SetMulti("languageCodes", append([]string{}, languageCodes...)) + return c +} + +// MaxSuggestions sets the optional parameter "maxSuggestions": +// Completion max suggestions. If left unset or set to 0, then will +// fallback to the configured value CompletionConfig.max_suggestions. +// The maximum allowed max suggestions is 20. If it is set higher, it +// will be capped by 20. +func (c *ProjectsLocationsCatalogsCompleteQueryCall) MaxSuggestions(maxSuggestions int64) *ProjectsLocationsCatalogsCompleteQueryCall { + c.urlParams_.Set("maxSuggestions", fmt.Sprint(maxSuggestions)) + return c +} + +// Query sets the optional parameter "query": Required. The query used +// to generate suggestions. The maximum number of allowed characters is +// 255. +func (c *ProjectsLocationsCatalogsCompleteQueryCall) Query(query string) *ProjectsLocationsCatalogsCompleteQueryCall { + c.urlParams_.Set("query", query) + return c +} + +// VisitorId sets the optional parameter "visitorId": Required field. A +// unique identifier for tracking visitors. For example, this could be +// implemented with an HTTP cookie, which should be able to uniquely +// identify a visitor on a single device. This unique identifier should +// not change if the visitor logs in or out of the website. The field +// must be a UTF-8 encoded string with a length limit of 128 characters. +// Otherwise, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCatalogsCompleteQueryCall) VisitorId(visitorId string) *ProjectsLocationsCatalogsCompleteQueryCall { + c.urlParams_.Set("visitorId", visitorId) + 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 *ProjectsLocationsCatalogsCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompleteQueryCall { + 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 *ProjectsLocationsCatalogsCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsCompleteQueryCall { + 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 *ProjectsLocationsCatalogsCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompleteQueryCall { + 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 *ProjectsLocationsCatalogsCompleteQueryCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsCompleteQueryCall) 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, "v2/{+catalog}:completeQuery") + 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{ + "catalog": c.catalog, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.completeQuery" call. +// Exactly one of *GoogleCloudRetailV2CompleteQueryResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRetailV2CompleteQueryResponse.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 *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2CompleteQueryResponse, 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 := &GoogleCloudRetailV2CompleteQueryResponse{ + 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": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:completeQuery", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.completeQuery", + // "parameterOrder": [ + // "catalog" + // ], + // "parameters": { + // "catalog": { + // "description": "Required. Catalog for which the completion is performed. Full resource name of catalog, such as `projects/*/locations/global/catalogs/default_catalog`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "dataset": { + // "description": "Determines which dataset to use for fetching completion. \"user-data\" will use the imported dataset through CompletionService.ImportCompletionData. \"cloud-retail\" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the \"user-data\". Current supported values: * user-data * cloud-retail: This option requires enabling auto-learning function first. See [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).", + // "location": "query", + // "type": "string" + // }, + // "deviceType": { + // "description": "The device type context for completion suggestions. It is useful to apply different suggestions on different device types, e.g. `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device types. Supported formats: * `UNKNOWN_DEVICE_TYPE` * `DESKTOP` * `MOBILE` * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.", + // "location": "query", + // "type": "string" + // }, + // "languageCodes": { + // "description": "Note that this field applies for `user-data` dataset only. For requests with `cloud-retail` dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum number of language codes is 3.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxSuggestions": { + // "description": "Completion max suggestions. If left unset or set to 0, then will fallback to the configured value CompletionConfig.max_suggestions. The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "query": { + // "description": "Required. The query used to generate suggestions. The maximum number of allowed characters is 255.", + // "location": "query", + // "type": "string" + // }, + // "visitorId": { + // "description": "Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+catalog}:completeQuery", + // "response": { + // "$ref": "GoogleCloudRetailV2CompleteQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.getAttributesConfig": + +type ProjectsLocationsCatalogsGetAttributesConfigCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetAttributesConfig: Gets an AttributesConfig. +// +// - name: Full AttributesConfig resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/attributesConfig`. +func (r *ProjectsLocationsCatalogsService) GetAttributesConfig(name string) *ProjectsLocationsCatalogsGetAttributesConfigCall { + c := &ProjectsLocationsCatalogsGetAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetAttributesConfigCall { + 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetAttributesConfigCall { + 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetAttributesConfigCall { + 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) 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, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.getAttributesConfig" call. +// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, 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 := &GoogleCloudRetailV2AttributesConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an AttributesConfig.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.getAttributesConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "GoogleCloudRetailV2AttributesConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.getCompletionConfig": + +type ProjectsLocationsCatalogsGetCompletionConfigCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetCompletionConfig: Gets a CompletionConfig. +// +// - name: Full CompletionConfig resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/completionConfig`. +func (r *ProjectsLocationsCatalogsService) GetCompletionConfig(name string) *ProjectsLocationsCatalogsGetCompletionConfigCall { + c := &ProjectsLocationsCatalogsGetCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetCompletionConfigCall { + 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetCompletionConfigCall { + 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetCompletionConfigCall { + 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) 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, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.getCompletionConfig" call. +// Exactly one of *GoogleCloudRetailV2CompletionConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2CompletionConfig.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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2CompletionConfig, 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 := &GoogleCloudRetailV2CompletionConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a CompletionConfig.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionConfig", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.getCompletionConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "GoogleCloudRetailV2CompletionConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.getDefaultBranch": + +type ProjectsLocationsCatalogsGetDefaultBranchCall struct { + s *Service + catalog string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetDefaultBranch: Get which branch is currently default branch set by +// CatalogService.SetDefaultBranch method under a specified parent +// catalog. +// +// - catalog: The parent catalog resource name, such as +// `projects/*/locations/global/catalogs/default_catalog`. +func (r *ProjectsLocationsCatalogsService) GetDefaultBranch(catalog string) *ProjectsLocationsCatalogsGetDefaultBranchCall { + c := &ProjectsLocationsCatalogsGetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.catalog = catalog + 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetDefaultBranchCall { + 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetDefaultBranchCall { + 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetDefaultBranchCall { + 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) 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, "v2/{+catalog}:getDefaultBranch") + 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{ + "catalog": c.catalog, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.getDefaultBranch" call. +// Exactly one of *GoogleCloudRetailV2GetDefaultBranchResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRetailV2GetDefaultBranchResponse.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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2GetDefaultBranchResponse, 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 := &GoogleCloudRetailV2GetDefaultBranchResponse{ + 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": "Get which branch is currently default branch set by CatalogService.SetDefaultBranch method under a specified parent catalog.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:getDefaultBranch", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.getDefaultBranch", + // "parameterOrder": [ + // "catalog" + // ], + // "parameters": { + // "catalog": { + // "description": "The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+catalog}:getDefaultBranch", + // "response": { + // "$ref": "GoogleCloudRetailV2GetDefaultBranchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.list": + +type ProjectsLocationsCatalogsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context header_ http.Header } -// CompleteQuery: Completes the specified prefix with keyword -// suggestions. This feature is only available for users who have Retail -// Search enabled. Please enable Retail Search on Cloud Console before -// using this feature. -// -// - catalog: Catalog for which the completion is performed. Full -// resource name of catalog, such as -// `projects/*/locations/global/catalogs/default_catalog`. -func (r *ProjectsLocationsCatalogsService) CompleteQuery(catalog string) *ProjectsLocationsCatalogsCompleteQueryCall { - c := &ProjectsLocationsCatalogsCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.catalog = catalog +// List: Lists all the Catalogs associated with the project. +// +// - parent: The account resource name with an associated location. If +// the caller does not have permission to list Catalogs under this +// location, regardless of whether or not this location exists, a +// PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCatalogsService) List(parent string) *ProjectsLocationsCatalogsListCall { + c := &ProjectsLocationsCatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Catalogs to return. If unspecified, defaults to 50. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an INVALID_ARGUMENT is returned. +func (c *ProjectsLocationsCatalogsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// ListCatalogsResponse.next_page_token, received from a previous +// CatalogService.ListCatalogs call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// CatalogService.ListCatalogs must match the call that provided the +// page token. Otherwise, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCatalogsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsListCall { + 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 *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsListCall { + 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 *ProjectsLocationsCatalogsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsListCall { + 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 *ProjectsLocationsCatalogsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsListCall) 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, "v2/{+parent}/catalogs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.list" call. +// Exactly one of *GoogleCloudRetailV2ListCatalogsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2ListCatalogsResponse.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 *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ListCatalogsResponse, 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 := &GoogleCloudRetailV2ListCatalogsResponse{ + 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": "Lists all the Catalogs associated with the project.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of Catalogs to return. If unspecified, defaults to 50. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListCatalogsResponse.next_page_token, received from a previous CatalogService.ListCatalogs call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to CatalogService.ListCatalogs must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The account resource name with an associated location. If the caller does not have permission to list Catalogs under this location, regardless of whether or not this location exists, a PERMISSION_DENIED error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/catalogs", + // "response": { + // "$ref": "GoogleCloudRetailV2ListCatalogsResponse" + // }, + // "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 *ProjectsLocationsCatalogsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2ListCatalogsResponse) 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 "retail.projects.locations.catalogs.patch": + +type ProjectsLocationsCatalogsPatchCall struct { + s *Service + name string + googlecloudretailv2catalog *GoogleCloudRetailV2Catalog + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the Catalogs. +// +// - name: Immutable. The fully qualified resource name of the catalog. +func (r *ProjectsLocationsCatalogsService) Patch(name string, googlecloudretailv2catalog *GoogleCloudRetailV2Catalog) *ProjectsLocationsCatalogsPatchCall { + c := &ProjectsLocationsCatalogsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2catalog = googlecloudretailv2catalog + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided Catalog to update. If an unsupported or +// unknown field is provided, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCatalogsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPatchCall { + 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 *ProjectsLocationsCatalogsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPatchCall { + 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 *ProjectsLocationsCatalogsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsPatchCall) 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.googlecloudretailv2catalog) + 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/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.patch" call. +// Exactly one of *GoogleCloudRetailV2Catalog or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudRetailV2Catalog.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 *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Catalog, 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 := &GoogleCloudRetailV2Catalog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the Catalogs.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}", + // "httpMethod": "PATCH", + // "id": "retail.projects.locations.catalogs.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Immutable. The fully qualified resource name of the catalog.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided Catalog to update. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "GoogleCloudRetailV2Catalog" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2Catalog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.setDefaultBranch": + +type ProjectsLocationsCatalogsSetDefaultBranchCall struct { + s *Service + catalog string + googlecloudretailv2setdefaultbranchrequest *GoogleCloudRetailV2SetDefaultBranchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetDefaultBranch: Set a specified branch id as default branch. API +// methods such as SearchService.Search, ProductService.GetProduct, +// ProductService.ListProducts will treat requests using +// "default_branch" to the actual branch id set as default. For example, +// if `projects/*/locations/*/catalogs/*/branches/1` is set as default, +// setting SearchRequest.branch to +// `projects/*/locations/*/catalogs/*/branches/default_branch` is +// equivalent to setting SearchRequest.branch to +// `projects/*/locations/*/catalogs/*/branches/1`. Using multiple +// branches can be useful when developers would like to have a staging +// branch to test and verify for future usage. When it becomes ready, +// developers switch on the staging branch using this API while keeping +// using `projects/*/locations/*/catalogs/*/branches/default_branch` as +// SearchRequest.branch to route the traffic to this staging branch. +// CAUTION: If you have live predict/search traffic, switching the +// default branch could potentially cause outages if the ID space of the +// new branch is very different from the old one. More specifically: * +// PredictionService will only return product IDs from branch +// {newBranch}. * SearchService will only return product IDs from branch +// {newBranch} (if branch is not explicitly set). * UserEventService +// will only join events with products from branch {newBranch}. +// +// - catalog: Full resource name of the catalog, such as +// `projects/*/locations/global/catalogs/default_catalog`. +func (r *ProjectsLocationsCatalogsService) SetDefaultBranch(catalog string, googlecloudretailv2setdefaultbranchrequest *GoogleCloudRetailV2SetDefaultBranchRequest) *ProjectsLocationsCatalogsSetDefaultBranchCall { + c := &ProjectsLocationsCatalogsSetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.catalog = catalog + c.googlecloudretailv2setdefaultbranchrequest = googlecloudretailv2setdefaultbranchrequest + 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 *ProjectsLocationsCatalogsSetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsSetDefaultBranchCall { + 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 *ProjectsLocationsCatalogsSetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsSetDefaultBranchCall { + 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 *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) 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.googlecloudretailv2setdefaultbranchrequest) + 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/{+catalog}:setDefaultBranch") + 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{ + "catalog": c.catalog, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.setDefaultBranch" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Set a specified branch id as default branch. API methods such as SearchService.Search, ProductService.GetProduct, ProductService.ListProducts will treat requests using \"default_branch\" to the actual branch id set as default. For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting SearchRequest.branch to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting SearchRequest.branch to `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as SearchRequest.branch to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:setDefaultBranch", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.setDefaultBranch", + // "parameterOrder": [ + // "catalog" + // ], + // "parameters": { + // "catalog": { + // "description": "Full resource name of the catalog, such as `projects/*/locations/global/catalogs/default_catalog`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+catalog}:setDefaultBranch", + // "request": { + // "$ref": "GoogleCloudRetailV2SetDefaultBranchRequest" + // }, + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.updateAttributesConfig": + +type ProjectsLocationsCatalogsUpdateAttributesConfigCall struct { + s *Service + name string + googlecloudretailv2attributesconfig *GoogleCloudRetailV2AttributesConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateAttributesConfig: Updates the AttributesConfig. The catalog +// attributes in the request will be updated in the catalog, or inserted +// if they do not exist. Existing catalog attributes not included in the +// request will remain unchanged. Attributes that are assigned to +// products, but do not exist at the catalog level, are always included +// in the response. The product attribute is assigned default values for +// missing catalog attribute fields, e.g., searchable and dynamic +// facetable options. +// +// - name: Immutable. The fully qualified resource name of the attribute +// config. Format: +// `projects/*/locations/*/catalogs/*/attributesConfig`. +func (r *ProjectsLocationsCatalogsService) UpdateAttributesConfig(name string, googlecloudretailv2attributesconfig *GoogleCloudRetailV2AttributesConfig) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { + c := &ProjectsLocationsCatalogsUpdateAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2attributesconfig = googlecloudretailv2attributesconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided AttributesConfig to update. The following is +// the only supported field: * AttributesConfig.catalog_attributes If +// not set, all supported fields are updated. +func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { + 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 *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { + 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 *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) 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.googlecloudretailv2attributesconfig) + 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/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.updateAttributesConfig" call. +// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, 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 := &GoogleCloudRetailV2AttributesConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the AttributesConfig. The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig", + // "httpMethod": "PATCH", + // "id": "retail.projects.locations.catalogs.updateAttributesConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Immutable. The fully qualified resource name of the attribute config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided AttributesConfig to update. The following is the only supported field: * AttributesConfig.catalog_attributes If not set, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "GoogleCloudRetailV2AttributesConfig" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2AttributesConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.updateCompletionConfig": + +type ProjectsLocationsCatalogsUpdateCompletionConfigCall struct { + s *Service + name string + googlecloudretailv2completionconfig *GoogleCloudRetailV2CompletionConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateCompletionConfig: Updates the CompletionConfigs. +// +// - name: Immutable. Fully qualified name +// `projects/*/locations/*/catalogs/*/completionConfig`. +func (r *ProjectsLocationsCatalogsService) UpdateCompletionConfig(name string, googlecloudretailv2completionconfig *GoogleCloudRetailV2CompletionConfig) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { + c := &ProjectsLocationsCatalogsUpdateCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2completionconfig = googlecloudretailv2completionconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided CompletionConfig to update. The following are +// the only supported fields: * CompletionConfig.matching_order * +// CompletionConfig.max_suggestions * CompletionConfig.min_prefix_length +// * CompletionConfig.auto_learning If not set, all supported fields are +// updated. +func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { + 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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { + 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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) 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.googlecloudretailv2completionconfig) + 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/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.updateCompletionConfig" call. +// Exactly one of *GoogleCloudRetailV2CompletionConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2CompletionConfig.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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2CompletionConfig, 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 := &GoogleCloudRetailV2CompletionConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the CompletionConfigs.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionConfig", + // "httpMethod": "PATCH", + // "id": "retail.projects.locations.catalogs.updateCompletionConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Immutable. Fully qualified name `projects/*/locations/*/catalogs/*/completionConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided CompletionConfig to update. The following are the only supported fields: * CompletionConfig.matching_order * CompletionConfig.max_suggestions * CompletionConfig.min_prefix_length * CompletionConfig.auto_learning If not set, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "GoogleCloudRetailV2CompletionConfig" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2CompletionConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute": + +type ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall struct { + s *Service + attributesConfig string + googlecloudretailv2addcatalogattributerequest *GoogleCloudRetailV2AddCatalogAttributeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AddCatalogAttribute: Adds the specified CatalogAttribute to the +// AttributesConfig. If the CatalogAttribute to add already exists, an +// ALREADY_EXISTS error is returned. +// +// - attributesConfig: Full AttributesConfig resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/attributesConfig`. +func (r *ProjectsLocationsCatalogsAttributesConfigService) AddCatalogAttribute(attributesConfig string, googlecloudretailv2addcatalogattributerequest *GoogleCloudRetailV2AddCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { + c := &ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.attributesConfig = attributesConfig + c.googlecloudretailv2addcatalogattributerequest = googlecloudretailv2addcatalogattributerequest + 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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { + 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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { + 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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) 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.googlecloudretailv2addcatalogattributerequest) + 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/{+attributesConfig}:addCatalogAttribute") + 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{ + "attributesConfig": c.attributesConfig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute" call. +// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, 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 := &GoogleCloudRetailV2AttributesConfig{ + 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": "Adds the specified CatalogAttribute to the AttributesConfig. If the CatalogAttribute to add already exists, an ALREADY_EXISTS error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig:addCatalogAttribute", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute", + // "parameterOrder": [ + // "attributesConfig" + // ], + // "parameters": { + // "attributesConfig": { + // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+attributesConfig}:addCatalogAttribute", + // "request": { + // "$ref": "GoogleCloudRetailV2AddCatalogAttributeRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2AttributesConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute": + +type ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall struct { + s *Service + attributesConfig string + googlecloudretailv2removecatalogattributerequest *GoogleCloudRetailV2RemoveCatalogAttributeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RemoveCatalogAttribute: Removes the specified CatalogAttribute from +// the AttributesConfig. If the CatalogAttribute to remove does not +// exist, a NOT_FOUND error is returned. +// +// - attributesConfig: Full AttributesConfig resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/attributesConfig`. +func (r *ProjectsLocationsCatalogsAttributesConfigService) RemoveCatalogAttribute(attributesConfig string, googlecloudretailv2removecatalogattributerequest *GoogleCloudRetailV2RemoveCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { + c := &ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.attributesConfig = attributesConfig + c.googlecloudretailv2removecatalogattributerequest = googlecloudretailv2removecatalogattributerequest + 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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { + 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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { + c.ctx_ = ctx return c } -// Dataset sets the optional parameter "dataset": Determines which -// dataset to use for fetching completion. "user-data" will use the -// imported dataset through CompletionService.ImportCompletionData. -// "cloud-retail" will use the dataset generated by cloud retail based -// on user events. If leave empty, it will use the "user-data". Current -// supported values: * user-data * cloud-retail: This option requires -// enabling auto-learning function first. See guidelines -// (https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). -func (c *ProjectsLocationsCatalogsCompleteQueryCall) Dataset(dataset string) *ProjectsLocationsCatalogsCompleteQueryCall { - c.urlParams_.Set("dataset", dataset) +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) 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.googlecloudretailv2removecatalogattributerequest) + 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/{+attributesConfig}:removeCatalogAttribute") + 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{ + "attributesConfig": c.attributesConfig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute" call. +// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, 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 := &GoogleCloudRetailV2AttributesConfig{ + 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": "Removes the specified CatalogAttribute from the AttributesConfig. If the CatalogAttribute to remove does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig:removeCatalogAttribute", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute", + // "parameterOrder": [ + // "attributesConfig" + // ], + // "parameters": { + // "attributesConfig": { + // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+attributesConfig}:removeCatalogAttribute", + // "request": { + // "$ref": "GoogleCloudRetailV2RemoveCatalogAttributeRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2AttributesConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute": + +type ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall struct { + s *Service + attributesConfig string + googlecloudretailv2replacecatalogattributerequest *GoogleCloudRetailV2ReplaceCatalogAttributeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ReplaceCatalogAttribute: Replaces the specified CatalogAttribute in +// the AttributesConfig by updating the catalog attribute with the same +// CatalogAttribute.key. If the CatalogAttribute to replace does not +// exist, a NOT_FOUND error is returned. +// +// - attributesConfig: Full AttributesConfig resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/attributesConfig`. +func (r *ProjectsLocationsCatalogsAttributesConfigService) ReplaceCatalogAttribute(attributesConfig string, googlecloudretailv2replacecatalogattributerequest *GoogleCloudRetailV2ReplaceCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { + c := &ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.attributesConfig = attributesConfig + c.googlecloudretailv2replacecatalogattributerequest = googlecloudretailv2replacecatalogattributerequest return c } -// DeviceType sets the optional parameter "deviceType": The device type -// context for completion suggestions. It is useful to apply different -// suggestions on different device types, e.g. `DESKTOP`, `MOBILE`. If -// it is empty, the suggestions are across all device types. Supported -// formats: * `UNKNOWN_DEVICE_TYPE` * `DESKTOP` * `MOBILE` * A -// customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. -func (c *ProjectsLocationsCatalogsCompleteQueryCall) DeviceType(deviceType string) *ProjectsLocationsCatalogsCompleteQueryCall { - c.urlParams_.Set("deviceType", deviceType) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// LanguageCodes sets the optional parameter "languageCodes": Note that -// this field applies for `user-data` dataset only. For requests with -// `cloud-retail` dataset, setting this field has no effect. The -// language filters applied to the output suggestions. If set, it should -// contain the language of the query. If not set, suggestions are -// returned without considering language restrictions. This is the -// BCP-47 language code, such as "en-US" or "sr-Latn". For more -// information, see Tags for Identifying Languages -// (https://tools.ietf.org/html/bcp47). The maximum number of language -// codes is 3. -func (c *ProjectsLocationsCatalogsCompleteQueryCall) LanguageCodes(languageCodes ...string) *ProjectsLocationsCatalogsCompleteQueryCall { - c.urlParams_.SetMulti("languageCodes", append([]string{}, languageCodes...)) +// 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 *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { + c.ctx_ = ctx return c } -// MaxSuggestions sets the optional parameter "maxSuggestions": -// Completion max suggestions. If left unset or set to 0, then will -// fallback to the configured value CompletionConfig.max_suggestions. -// The maximum allowed max suggestions is 20. If it is set higher, it -// will be capped by 20. -func (c *ProjectsLocationsCatalogsCompleteQueryCall) MaxSuggestions(maxSuggestions int64) *ProjectsLocationsCatalogsCompleteQueryCall { - c.urlParams_.Set("maxSuggestions", fmt.Sprint(maxSuggestions)) - return c +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) 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.googlecloudretailv2replacecatalogattributerequest) + 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/{+attributesConfig}:replaceCatalogAttribute") + 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{ + "attributesConfig": c.attributesConfig, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute" call. +// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, 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 := &GoogleCloudRetailV2AttributesConfig{ + 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": "Replaces the specified CatalogAttribute in the AttributesConfig by updating the catalog attribute with the same CatalogAttribute.key. If the CatalogAttribute to replace does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig:replaceCatalogAttribute", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute", + // "parameterOrder": [ + // "attributesConfig" + // ], + // "parameters": { + // "attributesConfig": { + // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+attributesConfig}:replaceCatalogAttribute", + // "request": { + // "$ref": "GoogleCloudRetailV2ReplaceCatalogAttributeRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2AttributesConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + } -// Query sets the optional parameter "query": Required. The query used -// to generate suggestions. The maximum number of allowed characters is -// 255. -func (c *ProjectsLocationsCatalogsCompleteQueryCall) Query(query string) *ProjectsLocationsCatalogsCompleteQueryCall { - c.urlParams_.Set("query", query) - return c +// method id "retail.projects.locations.catalogs.branches.operations.get": + +type ProjectsLocationsCatalogsBranchesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// VisitorId sets the optional parameter "visitorId": Required field. A -// unique identifier for tracking visitors. For example, this could be -// implemented with an HTTP cookie, which should be able to uniquely -// identify a visitor on a single device. This unique identifier should -// not change if the visitor logs in or out of the website. The field -// must be a UTF-8 encoded string with a length limit of 128 characters. -// Otherwise, an INVALID_ARGUMENT error is returned. -func (c *ProjectsLocationsCatalogsCompleteQueryCall) VisitorId(visitorId string) *ProjectsLocationsCatalogsCompleteQueryCall { - c.urlParams_.Set("visitorId", visitorId) +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCatalogsBranchesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { + c := &ProjectsLocationsCatalogsBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompleteQueryCall { +func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6941,7 +9802,7 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) Fields(s ...googleapi.Field // 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 *ProjectsLocationsCatalogsCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsCompleteQueryCall { +func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -6949,21 +9810,21 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) IfNoneMatch(entityTag strin // 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 *ProjectsLocationsCatalogsCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompleteQueryCall { +func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 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 *ProjectsLocationsCatalogsCompleteQueryCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) 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_ { @@ -6976,7 +9837,7 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*htt var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+catalog}:completeQuery") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6984,21 +9845,19 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*htt } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "catalog": c.catalog, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.completeQuery" call. -// Exactly one of *GoogleCloudRetailV2CompleteQueryResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudRetailV2CompleteQueryResponse.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 *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2CompleteQueryResponse, error) { +// Do executes the "retail.projects.locations.catalogs.branches.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7017,7 +9876,7 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2CompleteQueryResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7029,57 +9888,183 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Completes the specified prefix with keyword suggestions. 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}:completeQuery", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.completeQuery", + // "id": "retail.projects.locations.catalogs.branches.operations.get", // "parameterOrder": [ - // "catalog" + // "name" // ], // "parameters": { - // "catalog": { - // "description": "Required. Catalog for which the completion is performed. Full resource name of catalog, such as `projects/*/locations/global/catalogs/default_catalog`.", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" - // }, - // "dataset": { - // "description": "Determines which dataset to use for fetching completion. \"user-data\" will use the imported dataset through CompletionService.ImportCompletionData. \"cloud-retail\" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the \"user-data\". Current supported values: * user-data * cloud-retail: This option requires enabling auto-learning function first. See [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).", - // "location": "query", - // "type": "string" - // }, - // "deviceType": { - // "description": "The device type context for completion suggestions. It is useful to apply different suggestions on different device types, e.g. `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device types. Supported formats: * `UNKNOWN_DEVICE_TYPE` * `DESKTOP` * `MOBILE` * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.", - // "location": "query", - // "type": "string" - // }, - // "languageCodes": { - // "description": "Note that this field applies for `user-data` dataset only. For requests with `cloud-retail` dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum number of language codes is 3.", - // "location": "query", - // "repeated": true, - // "type": "string" - // }, - // "maxSuggestions": { - // "description": "Completion max suggestions. If left unset or set to 0, then will fallback to the configured value CompletionConfig.max_suggestions. The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "query": { - // "description": "Required. The query used to generate suggestions. The maximum number of allowed characters is 255.", - // "location": "query", - // "type": "string" - // }, - // "visitorId": { - // "description": "Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.", - // "location": "query", + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces": + +type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { + s *Service + product string + googlecloudretailv2addfulfillmentplacesrequest *GoogleCloudRetailV2AddFulfillmentPlacesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AddFulfillmentPlaces: Incrementally adds place IDs to +// Product.fulfillment_info.place_ids. This process is asynchronous and +// does not require the Product to exist before updating fulfillment +// information. If the request is valid, the update will be enqueued and +// processed downstream. As a consequence, when a response is returned, +// the added place IDs are not immediately manifested in the Product +// queried by ProductService.GetProduct or ProductService.ListProducts. +// The returned Operations will be obsolete after 1 day, and +// GetOperation API will return NOT_FOUND afterwards. If conflicting +// updates are issued, the Operations associated with the stale updates +// will not be marked as done until being obsolete. This feature is only +// available for users who have Retail Search enabled. Enable Retail +// Search on Cloud Console before using this feature. +// +// - product: Full resource name of Product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/some_product_id`. If the caller does not have +// permission to access the Product, regardless of whether or not it +// exists, a PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCatalogsBranchesProductsService) AddFulfillmentPlaces(product string, googlecloudretailv2addfulfillmentplacesrequest *GoogleCloudRetailV2AddFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { + c := &ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.product = product + c.googlecloudretailv2addfulfillmentplacesrequest = googlecloudretailv2addfulfillmentplacesrequest + 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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { + 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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { + 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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) 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.googlecloudretailv2addfulfillmentplacesrequest) + 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/{+product}:addFulfillmentPlaces") + 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{ + "product": c.product, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", + // "parameterOrder": [ + // "product" + // ], + // "parameters": { + // "product": { + // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "required": true, // "type": "string" // } // }, - // "path": "v2/{+catalog}:completeQuery", + // "path": "v2/{+product}:addFulfillmentPlaces", + // "request": { + // "$ref": "GoogleCloudRetailV2AddFulfillmentPlacesRequest" + // }, // "response": { - // "$ref": "GoogleCloudRetailV2CompleteQueryResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7088,98 +10073,107 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOp } -// method id "retail.projects.locations.catalogs.getAttributesConfig": +// method id "retail.projects.locations.catalogs.branches.products.addLocalInventories": -type ProjectsLocationsCatalogsGetAttributesConfigCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall struct { + s *Service + product string + googlecloudretailv2addlocalinventoriesrequest *GoogleCloudRetailV2AddLocalInventoriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetAttributesConfig: Gets an AttributesConfig. +// AddLocalInventories: Updates local inventory information for a +// Product at a list of places, while respecting the last update +// timestamps of each inventory field. This process is asynchronous and +// does not require the Product to exist before updating inventory +// information. If the request is valid, the update will be enqueued and +// processed downstream. As a consequence, when a response is returned, +// updates are not immediately manifested in the Product queried by +// ProductService.GetProduct or ProductService.ListProducts. Local +// inventory information can only be modified using this method. +// ProductService.CreateProduct and ProductService.UpdateProduct has no +// effect on local inventories. The returned Operations will be obsolete +// after 1 day, and GetOperation API will return NOT_FOUND afterwards. +// If conflicting updates are issued, the Operations associated with the +// stale updates will not be marked as done until being obsolete. This +// feature is only available for users who have Retail Search enabled. +// Enable Retail Search on Cloud Console before using this feature. // -// - name: Full AttributesConfig resource name. Format: -// `projects/{project_number}/locations/{location_id}/catalogs/{catalog -// _id}/attributesConfig`. -func (r *ProjectsLocationsCatalogsService) GetAttributesConfig(name string) *ProjectsLocationsCatalogsGetAttributesConfigCall { - c := &ProjectsLocationsCatalogsGetAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - product: Full resource name of Product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/some_product_id`. If the caller does not have +// permission to access the Product, regardless of whether or not it +// exists, a PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCatalogsBranchesProductsService) AddLocalInventories(product string, googlecloudretailv2addlocalinventoriesrequest *GoogleCloudRetailV2AddLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { + c := &ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.product = product + c.googlecloudretailv2addlocalinventoriesrequest = googlecloudretailv2addlocalinventoriesrequest 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetAttributesConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetAttributesConfigCall { - 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetAttributesConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) 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 + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addlocalinventoriesrequest) + 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+product}:addLocalInventories") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "product": c.product, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.getAttributesConfig" call. -// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.addLocalInventories" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7198,7 +10192,7 @@ func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2AttributesConfig{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7210,25 +10204,28 @@ func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi. } return ret, nil // { - // "description": "Gets an AttributesConfig.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig", - // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.getAttributesConfig", + // "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addLocalInventories", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", // "parameterOrder": [ - // "name" + // "product" // ], // "parameters": { - // "name": { - // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "product": { + // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+product}:addLocalInventories", + // "request": { + // "$ref": "GoogleCloudRetailV2AddLocalInventoriesRequest" + // }, // "response": { - // "$ref": "GoogleCloudRetailV2AttributesConfig" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7237,98 +10234,103 @@ func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi. } -// method id "retail.projects.locations.catalogs.getCompletionConfig": +// method id "retail.projects.locations.catalogs.branches.products.create": -type ProjectsLocationsCatalogsGetCompletionConfigCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsCreateCall struct { + s *Service + parent string + googlecloudretailv2product *GoogleCloudRetailV2Product + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetCompletionConfig: Gets a CompletionConfig. +// Create: Creates a Product. // -// - name: Full CompletionConfig resource name. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/completionConfig. -func (r *ProjectsLocationsCatalogsService) GetCompletionConfig(name string) *ProjectsLocationsCatalogsGetCompletionConfigCall { - c := &ProjectsLocationsCatalogsGetCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent catalog resource name, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch`. +func (r *ProjectsLocationsCatalogsBranchesProductsService) Create(parent string, googlecloudretailv2product *GoogleCloudRetailV2Product) *ProjectsLocationsCatalogsBranchesProductsCreateCall { + c := &ProjectsLocationsCatalogsBranchesProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudretailv2product = googlecloudretailv2product + return c +} + +// ProductId sets the optional parameter "productId": Required. The ID +// to use for the Product, which will become the final component of the +// Product.name. If the caller does not have permission to create the +// Product, regardless of whether or not it exists, a PERMISSION_DENIED +// error is returned. This field must be unique among all Products with +// the same parent. Otherwise, an ALREADY_EXISTS error is returned. This +// field must be a UTF-8 encoded string with a length limit of 128 +// characters. Otherwise, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) ProductId(productId string) *ProjectsLocationsCatalogsBranchesProductsCreateCall { + c.urlParams_.Set("productId", productId) 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetCompletionConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetCompletionConfigCall { - 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetCompletionConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) 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 + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2product) + 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.getCompletionConfig" call. -// Exactly one of *GoogleCloudRetailV2CompletionConfig or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudRetailV2CompletionConfig.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 *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2CompletionConfig, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.create" call. +// Exactly one of *GoogleCloudRetailV2Product or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudRetailV2Product.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 *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Product, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7347,7 +10349,7 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2CompletionConfig{ + ret := &GoogleCloudRetailV2Product{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7359,25 +10361,33 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi. } return ret, nil // { - // "description": "Gets a CompletionConfig.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionConfig", - // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.getCompletionConfig", + // "description": "Creates a Product.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.branches.products.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Full CompletionConfig resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig", + // "parent": { + // "description": "Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" + // }, + // "productId": { + // "description": "Required. The ID to use for the Product, which will become the final component of the Product.name. If the caller does not have permission to create the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Products with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/products", + // "request": { + // "$ref": "GoogleCloudRetailV2Product" + // }, // "response": { - // "$ref": "GoogleCloudRetailV2CompletionConfig" + // "$ref": "GoogleCloudRetailV2Product" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7386,100 +10396,90 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi. } -// method id "retail.projects.locations.catalogs.getDefaultBranch": +// method id "retail.projects.locations.catalogs.branches.products.delete": -type ProjectsLocationsCatalogsGetDefaultBranchCall struct { - s *Service - catalog string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetDefaultBranch: Get which branch is currently default branch set by -// CatalogService.SetDefaultBranch method under a specified parent -// catalog. +// Delete: Deletes a Product. // -// - catalog: The parent catalog resource name, such as -// `projects/*/locations/global/catalogs/default_catalog`. -func (r *ProjectsLocationsCatalogsService) GetDefaultBranch(catalog string) *ProjectsLocationsCatalogsGetDefaultBranchCall { - c := &ProjectsLocationsCatalogsGetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.catalog = catalog +// - name: Full resource name of Product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/some_product_id`. If the caller does not have +// permission to delete the Product, regardless of whether or not it +// exists, a PERMISSION_DENIED error is returned. If the Product to +// delete does not exist, a NOT_FOUND error is returned. The Product +// to delete can neither be a Product.Type.COLLECTION Product member +// nor a Product.Type.PRIMARY Product with more than one variants. +// Otherwise, an INVALID_ARGUMENT error is returned. All inventory +// information for the named Product will be deleted. +func (r *ProjectsLocationsCatalogsBranchesProductsService) Delete(name string) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { + c := &ProjectsLocationsCatalogsBranchesProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetDefaultBranchCall { +func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetDefaultBranchCall { - 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetDefaultBranchCall { +func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) 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, "v2/{+catalog}:getDefaultBranch") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "catalog": c.catalog, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.getDefaultBranch" call. -// Exactly one of *GoogleCloudRetailV2GetDefaultBranchResponse or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudRetailV2GetDefaultBranchResponse.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 *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2GetDefaultBranchResponse, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7498,7 +10498,7 @@ func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2GetDefaultBranchResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7510,25 +10510,25 @@ func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Get which branch is currently default branch set by CatalogService.SetDefaultBranch method under a specified parent catalog.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:getDefaultBranch", - // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.getDefaultBranch", + // "description": "Deletes a Product.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", + // "httpMethod": "DELETE", + // "id": "retail.projects.locations.catalogs.branches.products.delete", // "parameterOrder": [ - // "catalog" + // "name" // ], // "parameters": { - // "catalog": { - // "description": "The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog`.", + // "name": { + // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to delete the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Product to delete does not exist, a NOT_FOUND error is returned. The Product to delete can neither be a Product.Type.COLLECTION Product member nor a Product.Type.PRIMARY Product with more than one variants. Otherwise, an INVALID_ARGUMENT error is returned. All inventory information for the named Product will be deleted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+catalog}:getDefaultBranch", + // "path": "v2/{+name}", // "response": { - // "$ref": "GoogleCloudRetailV2GetDefaultBranchResponse" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7537,53 +10537,35 @@ func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.Cal } -// method id "retail.projects.locations.catalogs.list": +// method id "retail.projects.locations.catalogs.branches.products.get": -type ProjectsLocationsCatalogsListCall struct { +type ProjectsLocationsCatalogsBranchesProductsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists all the Catalogs associated with the project. +// Get: Gets a Product. // -// - parent: The account resource name with an associated location. If -// the caller does not have permission to list Catalogs under this -// location, regardless of whether or not this location exists, a -// PERMISSION_DENIED error is returned. -func (r *ProjectsLocationsCatalogsService) List(parent string) *ProjectsLocationsCatalogsListCall { - c := &ProjectsLocationsCatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": Maximum number of -// Catalogs to return. If unspecified, defaults to 50. The maximum -// allowed value is 1000. Values above 1000 will be coerced to 1000. If -// this field is negative, an INVALID_ARGUMENT is returned. -func (c *ProjectsLocationsCatalogsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token -// ListCatalogsResponse.next_page_token, received from a previous -// CatalogService.ListCatalogs call. Provide this to retrieve the -// subsequent page. When paginating, all other parameters provided to -// CatalogService.ListCatalogs must match the call that provided the -// page token. Otherwise, an INVALID_ARGUMENT error is returned. -func (c *ProjectsLocationsCatalogsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: Full resource name of Product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/some_product_id`. If the caller does not have +// permission to access the Product, regardless of whether or not it +// exists, a PERMISSION_DENIED error is returned. If the requested +// Product does not exist, a NOT_FOUND error is returned. +func (r *ProjectsLocationsCatalogsBranchesProductsService) Get(name string) *ProjectsLocationsCatalogsBranchesProductsGetCall { + c := &ProjectsLocationsCatalogsBranchesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsListCall { +func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7593,7 +10575,7 @@ func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *Projec // 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 *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsListCall { +func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -7601,21 +10583,21 @@ func (c *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *Proje // 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 *ProjectsLocationsCatalogsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsListCall { +func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsGetCall { 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 *ProjectsLocationsCatalogsListCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) 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_ { @@ -7628,7 +10610,7 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/catalogs") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -7636,20 +10618,19 @@ func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Respons } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.list" call. -// Exactly one of *GoogleCloudRetailV2ListCatalogsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleCloudRetailV2ListCatalogsResponse.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 +// Do executes the "retail.projects.locations.catalogs.branches.products.get" call. +// Exactly one of *GoogleCloudRetailV2Product or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudRetailV2Product.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 *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ListCatalogsResponse, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Product, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7668,7 +10649,7 @@ func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*G if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2ListCatalogsResponse{ + ret := &GoogleCloudRetailV2Product{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7680,36 +10661,25 @@ func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*G } return ret, nil // { - // "description": "Lists all the Catalogs associated with the project.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs", + // "description": "Gets a Product.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.list", + // "id": "retail.projects.locations.catalogs.branches.products.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "pageSize": { - // "description": "Maximum number of Catalogs to return. If unspecified, defaults to 50. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT is returned.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token ListCatalogsResponse.next_page_token, received from a previous CatalogService.ListCatalogs call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to CatalogService.ListCatalogs must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The account resource name with an associated location. If the caller does not have permission to list Catalogs under this location, regardless of whether or not this location exists, a PERMISSION_DENIED error is returned.", + // "name": { + // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Product does not exist, a NOT_FOUND error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/catalogs", + // "path": "v2/{+name}", // "response": { - // "$ref": "GoogleCloudRetailV2ListCatalogsResponse" + // "$ref": "GoogleCloudRetailV2Product" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7718,60 +10688,37 @@ func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*G } -// 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 *ProjectsLocationsCatalogsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2ListCatalogsResponse) 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 "retail.projects.locations.catalogs.patch": +// method id "retail.projects.locations.catalogs.branches.products.import": -type ProjectsLocationsCatalogsPatchCall struct { - s *Service - name string - googlecloudretailv2catalog *GoogleCloudRetailV2Catalog - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsImportCall struct { + s *Service + parent string + googlecloudretailv2importproductsrequest *GoogleCloudRetailV2ImportProductsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates the Catalogs. +// Import: Bulk import of multiple Products. Request processing may be +// synchronous. Non-existing items are created. Note that it is possible +// for a subset of the Products to be successfully updated. // -// - name: Immutable. The fully qualified resource name of the catalog. -func (r *ProjectsLocationsCatalogsService) Patch(name string, googlecloudretailv2catalog *GoogleCloudRetailV2Catalog) *ProjectsLocationsCatalogsPatchCall { - c := &ProjectsLocationsCatalogsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudretailv2catalog = googlecloudretailv2catalog - return c -} - -// UpdateMask sets the optional parameter "updateMask": Indicates which -// fields in the provided Catalog to update. If an unsupported or -// unknown field is provided, an INVALID_ARGUMENT error is returned. -func (c *ProjectsLocationsCatalogsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - parent: +// `projects/1234/locations/global/catalogs/default_catalog/branches/de +// fault_branch` If no updateMask is specified, requires +// products.create permission. If updateMask is specified, requires +// products.update permission. +func (r *ProjectsLocationsCatalogsBranchesProductsService) Import(parent string, googlecloudretailv2importproductsrequest *GoogleCloudRetailV2ImportProductsRequest) *ProjectsLocationsCatalogsBranchesProductsImportCall { + c := &ProjectsLocationsCatalogsBranchesProductsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudretailv2importproductsrequest = googlecloudretailv2importproductsrequest 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 *ProjectsLocationsCatalogsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPatchCall { +func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsImportCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7779,21 +10726,21 @@ func (c *ProjectsLocationsCatalogsPatchCall) Fields(s ...googleapi.Field) *Proje // 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 *ProjectsLocationsCatalogsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPatchCall { +func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsImportCall { 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 *ProjectsLocationsCatalogsPatchCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) 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_ { @@ -7801,34 +10748,34 @@ func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Respon } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2catalog) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2importproductsrequest) 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products:import") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.patch" call. -// Exactly one of *GoogleCloudRetailV2Catalog or error will be non-nil. +// Do executes the "retail.projects.locations.catalogs.branches.products.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudRetailV2Catalog.ServerResponse.Header or (if a response +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Catalog, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7847,7 +10794,7 @@ func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2Catalog{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7859,34 +10806,28 @@ func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Updates the Catalogs.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}", - // "httpMethod": "PATCH", - // "id": "retail.projects.locations.catalogs.patch", + // "description": "Bulk import of multiple Products. Request processing may be synchronous. Non-existing items are created. Note that it is possible for a subset of the Products to be successfully updated.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products:import", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.branches.products.import", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Immutable. The fully qualified resource name of the catalog.", + // "parent": { + // "description": "Required. `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` If no updateMask is specified, requires products.create permission. If updateMask is specified, requires products.update permission.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Indicates which fields in the provided Catalog to update. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/products:import", // "request": { - // "$ref": "GoogleCloudRetailV2Catalog" + // "$ref": "GoogleCloudRetailV2ImportProductsRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2Catalog" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7895,109 +10836,151 @@ func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (* } -// method id "retail.projects.locations.catalogs.setDefaultBranch": +// method id "retail.projects.locations.catalogs.branches.products.list": -type ProjectsLocationsCatalogsSetDefaultBranchCall struct { - s *Service - catalog string - googlecloudretailv2setdefaultbranchrequest *GoogleCloudRetailV2SetDefaultBranchRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetDefaultBranch: Set a specified branch id as default branch. API -// methods such as SearchService.Search, ProductService.GetProduct, -// ProductService.ListProducts will treat requests using -// "default_branch" to the actual branch id set as default. For example, -// if `projects/*/locations/*/catalogs/*/branches/1` is set as default, -// setting SearchRequest.branch to -// `projects/*/locations/*/catalogs/*/branches/default_branch` is -// equivalent to setting SearchRequest.branch to -// `projects/*/locations/*/catalogs/*/branches/1`. Using multiple -// branches can be useful when developers would like to have a staging -// branch to test and verify for future usage. When it becomes ready, -// developers switch on the staging branch using this API while keeping -// using `projects/*/locations/*/catalogs/*/branches/default_branch` as -// SearchRequest.branch to route the traffic to this staging branch. -// CAUTION: If you have live predict/search traffic, switching the -// default branch could potentially cause outages if the ID space of the -// new branch is very different from the old one. More specifically: * -// PredictionService will only return product IDs from branch -// {newBranch}. * SearchService will only return product IDs from branch -// {newBranch} (if branch is not explicitly set). * UserEventService -// will only join events with products from branch {newBranch}. +// List: Gets a list of Products. // -// - catalog: Full resource name of the catalog, such as -// `projects/*/locations/global/catalogs/default_catalog`. -func (r *ProjectsLocationsCatalogsService) SetDefaultBranch(catalog string, googlecloudretailv2setdefaultbranchrequest *GoogleCloudRetailV2SetDefaultBranchRequest) *ProjectsLocationsCatalogsSetDefaultBranchCall { - c := &ProjectsLocationsCatalogsSetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.catalog = catalog - c.googlecloudretailv2setdefaultbranchrequest = googlecloudretailv2setdefaultbranchrequest +// - parent: The parent branch resource name, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/0`. +// Use `default_branch` as the branch ID, to list products under the +// default branch. If the caller does not have permission to list +// Products under this branch, regardless of whether or not this +// branch exists, a PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCatalogsBranchesProductsService) List(parent string) *ProjectsLocationsCatalogsBranchesProductsListCall { + c := &ProjectsLocationsCatalogsBranchesProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter to apply on the +// list results. Supported features: * List all the products under the +// parent branch if filter is unset. * List Product.Type.VARIANT +// Products sharing the same Product.Type.PRIMARY Product. For example: +// `primary_product_id = "some_product_id" * List Products bundled in a +// Product.Type.COLLECTION Product. For example: `collection_product_id +// = "some_product_id" * List Products with a partibular type. For +// example: `type = "PRIMARY" `type = "VARIANT" `type = "COLLECTION" +// If the field is unrecognizable, an INVALID_ARGUMENT error is +// returned. If the specified Product.Type.PRIMARY Product or +// Product.Type.COLLECTION Product does not exist, a NOT_FOUND error is +// returned. +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Filter(filter string) *ProjectsLocationsCatalogsBranchesProductsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Products to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsBranchesProductsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// ListProductsResponse.next_page_token, received from a previous +// ProductService.ListProducts call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// ProductService.ListProducts must match the call that provided the +// page token. Otherwise, an INVALID_ARGUMENT error is returned. +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsBranchesProductsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReadMask sets the optional parameter "readMask": The fields of +// Product to return in the responses. If not set or empty, the +// following fields are returned: * Product.name * Product.id * +// Product.title * Product.uri * Product.images * Product.price_info * +// Product.brands If "*" is provided, all fields are returned. +// Product.name is always returned no matter what mask is set. If an +// unsupported or unknown field is provided, an INVALID_ARGUMENT error +// is returned. +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) ReadMask(readMask string) *ProjectsLocationsCatalogsBranchesProductsListCall { + c.urlParams_.Set("readMask", readMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsSetDefaultBranchCall { +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsListCall { 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 *ProjectsLocationsCatalogsBranchesProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsListCall { + 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 *ProjectsLocationsCatalogsSetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsSetDefaultBranchCall { +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsListCall { 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 *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) 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.googlecloudretailv2setdefaultbranchrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+catalog}:setDefaultBranch") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "catalog": c.catalog, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.setDefaultBranch" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "retail.projects.locations.catalogs.branches.products.list" call. +// Exactly one of *GoogleCloudRetailV2ListProductsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2ListProductsResponse.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 *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ListProductsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8016,7 +10999,7 @@ func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleProtobufEmpty{ + ret := &GoogleCloudRetailV2ListProductsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8028,28 +11011,47 @@ func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Set a specified branch id as default branch. API methods such as SearchService.Search, ProductService.GetProduct, ProductService.ListProducts will treat requests using \"default_branch\" to the actual branch id set as default. For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting SearchRequest.branch to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting SearchRequest.branch to `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as SearchRequest.branch to route the traffic to this staging branch. CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one. More specifically: * PredictionService will only return product IDs from branch {newBranch}. * SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set). * UserEventService will only join events with products from branch {newBranch}.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:setDefaultBranch", - // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.setDefaultBranch", + // "description": "Gets a list of Products.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.branches.products.list", // "parameterOrder": [ - // "catalog" + // "parent" // ], // "parameters": { - // "catalog": { - // "description": "Full resource name of the catalog, such as `projects/*/locations/global/catalogs/default_catalog`.", + // "filter": { + // "description": "A filter to apply on the list results. Supported features: * List all the products under the parent branch if filter is unset. * List Product.Type.VARIANT Products sharing the same Product.Type.PRIMARY Product. For example: `primary_product_id = \"some_product_id\"` * List Products bundled in a Product.Type.COLLECTION Product. For example: `collection_product_id = \"some_product_id\"` * List Products with a partibular type. For example: `type = \"PRIMARY\"` `type = \"VARIANT\"` `type = \"COLLECTION\"` If the field is unrecognizable, an INVALID_ARGUMENT error is returned. If the specified Product.Type.PRIMARY Product or Product.Type.COLLECTION Product does not exist, a NOT_FOUND error is returned.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of Products to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListProductsResponse.next_page_token, received from a previous ProductService.ListProducts call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ProductService.ListProducts must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` as the branch ID, to list products under the default branch. If the caller does not have permission to list Products under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" + // }, + // "readMask": { + // "description": "The fields of Product to return in the responses. If not set or empty, the following fields are returned: * Product.name * Product.id * Product.title * Product.uri * Product.images * Product.price_info * Product.brands If \"*\" is provided, all fields are returned. Product.name is always returned no matter what mask is set. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+catalog}:setDefaultBranch", - // "request": { - // "$ref": "GoogleCloudRetailV2SetDefaultBranchRequest" - // }, + // "path": "v2/{+parent}/products", // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleCloudRetailV2ListProductsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8058,41 +11060,68 @@ func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.Cal } -// method id "retail.projects.locations.catalogs.updateAttributesConfig": +// 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 *ProjectsLocationsCatalogsBranchesProductsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2ListProductsResponse) 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) + } +} -type ProjectsLocationsCatalogsUpdateAttributesConfigCall struct { - s *Service - name string - googlecloudretailv2attributesconfig *GoogleCloudRetailV2AttributesConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "retail.projects.locations.catalogs.branches.products.patch": + +type ProjectsLocationsCatalogsBranchesProductsPatchCall struct { + s *Service + name string + googlecloudretailv2product *GoogleCloudRetailV2Product + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateAttributesConfig: Updates the AttributesConfig. The catalog -// attributes in the request will be updated in the catalog, or inserted -// if they do not exist. Existing catalog attributes not included in the -// request will remain unchanged. Attributes that are assigned to -// products, but do not exist at the catalog level, are always included -// in the response. The product attribute is assigned default values for -// missing catalog attribute fields, e.g., searchable and dynamic -// facetable options. +// Patch: Updates a Product. // -// - name: Immutable. The fully qualified resource name of the attribute -// config. Format: -// `projects/*/locations/*/catalogs/*/attributesConfig`. -func (r *ProjectsLocationsCatalogsService) UpdateAttributesConfig(name string, googlecloudretailv2attributesconfig *GoogleCloudRetailV2AttributesConfig) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { - c := &ProjectsLocationsCatalogsUpdateAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. Full resource name of the product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/product_id`. +func (r *ProjectsLocationsCatalogsBranchesProductsService) Patch(name string, googlecloudretailv2product *GoogleCloudRetailV2Product) *ProjectsLocationsCatalogsBranchesProductsPatchCall { + c := &ProjectsLocationsCatalogsBranchesProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googlecloudretailv2attributesconfig = googlecloudretailv2attributesconfig + c.googlecloudretailv2product = googlecloudretailv2product + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Product is not found, a new Product will be created. In +// this situation, `update_mask` is ignored. +func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCatalogsBranchesProductsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // UpdateMask sets the optional parameter "updateMask": Indicates which -// fields in the provided AttributesConfig to update. The following is -// the only supported field: * AttributesConfig.catalog_attributes If -// not set, all supported fields are updated. -func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { +// fields in the provided Product to update. The immutable and output +// only fields are NOT supported. If not set, all supported fields (the +// fields that are neither immutable nor output only) are updated. If an +// unsupported or unknown field is provided, an INVALID_ARGUMENT error +// is returned. The attribute key can be updated by setting the mask +// path as "attributes.${key_name}". If a key name is present in the +// mask but not in the patching product from the request, this key will +// be deleted after the update. +func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsBranchesProductsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } @@ -8100,7 +11129,7 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) UpdateMask(updateM // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8108,21 +11137,21 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Fields(s ...google // 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 *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 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 *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) 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_ { @@ -8130,7 +11159,7 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt stri } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2attributesconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2product) if err != nil { return nil, err } @@ -8150,15 +11179,14 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.updateAttributesConfig" call. -// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.patch" call. +// Exactly one of *GoogleCloudRetailV2Product or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudRetailV2Product.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 *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Product, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8177,7 +11205,7 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2AttributesConfig{ + ret := &GoogleCloudRetailV2Product{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8189,23 +11217,28 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googlea } return ret, nil // { - // "description": "Updates the AttributesConfig. The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig", + // "description": "Updates a Product.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", // "httpMethod": "PATCH", - // "id": "retail.projects.locations.catalogs.updateAttributesConfig", + // "id": "retail.projects.locations.catalogs.branches.products.patch", // "parameterOrder": [ // "name" // ], // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Product is not found, a new Product will be created. In this situation, `update_mask` is ignored.", + // "location": "query", + // "type": "boolean" + // }, // "name": { - // "description": "Required. Immutable. The fully qualified resource name of the attribute config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`", + // "description": "Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" // }, // "updateMask": { - // "description": "Indicates which fields in the provided AttributesConfig to update. The following is the only supported field: * AttributesConfig.catalog_attributes If not set, all supported fields are updated.", + // "description": "Indicates which fields in the provided Product to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. The attribute key can be updated by setting the mask path as \"attributes.${key_name}\". If a key name is present in the mask but not in the patching product from the request, this key will be deleted after the update.", // "format": "google-fieldmask", // "location": "query", // "type": "string" @@ -8213,10 +11246,10 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googlea // }, // "path": "v2/{+name}", // "request": { - // "$ref": "GoogleCloudRetailV2AttributesConfig" + // "$ref": "GoogleCloudRetailV2Product" // }, // "response": { - // "$ref": "GoogleCloudRetailV2AttributesConfig" + // "$ref": "GoogleCloudRetailV2Product" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8225,43 +11258,47 @@ func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googlea } -// method id "retail.projects.locations.catalogs.updateCompletionConfig": +// method id "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces": -type ProjectsLocationsCatalogsUpdateCompletionConfigCall struct { - s *Service - name string - googlecloudretailv2completionconfig *GoogleCloudRetailV2CompletionConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall struct { + s *Service + product string + googlecloudretailv2removefulfillmentplacesrequest *GoogleCloudRetailV2RemoveFulfillmentPlacesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateCompletionConfig: Updates the CompletionConfigs. +// RemoveFulfillmentPlaces: Incrementally removes place IDs from a +// Product.fulfillment_info.place_ids. This process is asynchronous and +// does not require the Product to exist before updating fulfillment +// information. If the request is valid, the update will be enqueued and +// processed downstream. As a consequence, when a response is returned, +// the removed place IDs are not immediately manifested in the Product +// queried by ProductService.GetProduct or ProductService.ListProducts. +// The returned Operations will be obsolete after 1 day, and +// GetOperation API will return NOT_FOUND afterwards. If conflicting +// updates are issued, the Operations associated with the stale updates +// will not be marked as done until being obsolete. This feature is only +// available for users who have Retail Search enabled. Enable Retail +// Search on Cloud Console before using this feature. // -// - name: Immutable. Fully qualified name -// `projects/*/locations/*/catalogs/*/completionConfig`. -func (r *ProjectsLocationsCatalogsService) UpdateCompletionConfig(name string, googlecloudretailv2completionconfig *GoogleCloudRetailV2CompletionConfig) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { - c := &ProjectsLocationsCatalogsUpdateCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudretailv2completionconfig = googlecloudretailv2completionconfig - return c -} - -// UpdateMask sets the optional parameter "updateMask": Indicates which -// fields in the provided CompletionConfig to update. The following are -// the only supported fields: * CompletionConfig.matching_order * -// CompletionConfig.max_suggestions * CompletionConfig.min_prefix_length -// * CompletionConfig.auto_learning If not set, all supported fields are -// updated. -func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { - c.urlParams_.Set("updateMask", updateMask) +// - product: Full resource name of Product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/some_product_id`. If the caller does not have +// permission to access the Product, regardless of whether or not it +// exists, a PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveFulfillmentPlaces(product string, googlecloudretailv2removefulfillmentplacesrequest *GoogleCloudRetailV2RemoveFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { + c := &ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.product = product + c.googlecloudretailv2removefulfillmentplacesrequest = googlecloudretailv2removefulfillmentplacesrequest 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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8269,21 +11306,21 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Fields(s ...google // 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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) 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_ { @@ -8291,35 +11328,34 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt stri } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2completionconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removefulfillmentplacesrequest) 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+product}:removeFulfillmentPlaces") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "product": c.product, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.updateCompletionConfig" call. -// Exactly one of *GoogleCloudRetailV2CompletionConfig or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudRetailV2CompletionConfig.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 *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2CompletionConfig, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8338,7 +11374,7 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2CompletionConfig{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8350,34 +11386,28 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googlea } return ret, nil // { - // "description": "Updates the CompletionConfigs.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionConfig", - // "httpMethod": "PATCH", - // "id": "retail.projects.locations.catalogs.updateCompletionConfig", + // "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", // "parameterOrder": [ - // "name" + // "product" // ], // "parameters": { - // "name": { - // "description": "Required. Immutable. Fully qualified name `projects/*/locations/*/catalogs/*/completionConfig`", + // "product": { + // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Indicates which fields in the provided CompletionConfig to update. The following are the only supported fields: * CompletionConfig.matching_order * CompletionConfig.max_suggestions * CompletionConfig.min_prefix_length * CompletionConfig.auto_learning If not set, all supported fields are updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+product}:removeFulfillmentPlaces", // "request": { - // "$ref": "GoogleCloudRetailV2CompletionConfig" + // "$ref": "GoogleCloudRetailV2RemoveFulfillmentPlacesRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2CompletionConfig" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8386,35 +11416,48 @@ func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googlea } -// method id "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute": +// method id "retail.projects.locations.catalogs.branches.products.removeLocalInventories": -type ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall struct { - s *Service - attributesConfig string - googlecloudretailv2addcatalogattributerequest *GoogleCloudRetailV2AddCatalogAttributeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall struct { + s *Service + product string + googlecloudretailv2removelocalinventoriesrequest *GoogleCloudRetailV2RemoveLocalInventoriesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddCatalogAttribute: Adds the specified CatalogAttribute to the -// AttributesConfig. If the CatalogAttribute to add already exists, an -// ALREADY_EXISTS error is returned. +// RemoveLocalInventories: Remove local inventory information for a +// Product at a list of places at a removal timestamp. This process is +// asynchronous. If the request is valid, the removal will be enqueued +// and processed downstream. As a consequence, when a response is +// returned, removals are not immediately manifested in the Product +// queried by ProductService.GetProduct or ProductService.ListProducts. +// Local inventory information can only be removed using this method. +// ProductService.CreateProduct and ProductService.UpdateProduct has no +// effect on local inventories. The returned Operations will be obsolete +// after 1 day, and GetOperation API will return NOT_FOUND afterwards. +// If conflicting updates are issued, the Operations associated with the +// stale updates will not be marked as done until being obsolete. This +// feature is only available for users who have Retail Search enabled. +// Enable Retail Search on Cloud Console before using this feature. // -// - attributesConfig: Full AttributesConfig resource name. Format: -// `projects/{project_number}/locations/{location_id}/catalogs/{catalog -// _id}/attributesConfig`. -func (r *ProjectsLocationsCatalogsAttributesConfigService) AddCatalogAttribute(attributesConfig string, googlecloudretailv2addcatalogattributerequest *GoogleCloudRetailV2AddCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { - c := &ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.attributesConfig = attributesConfig - c.googlecloudretailv2addcatalogattributerequest = googlecloudretailv2addcatalogattributerequest +// - product: Full resource name of Product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/some_product_id`. If the caller does not have +// permission to access the Product, regardless of whether or not it +// exists, a PERMISSION_DENIED error is returned. +func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveLocalInventories(product string, googlecloudretailv2removelocalinventoriesrequest *GoogleCloudRetailV2RemoveLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { + c := &ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.product = product + c.googlecloudretailv2removelocalinventoriesrequest = googlecloudretailv2removelocalinventoriesrequest 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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8422,21 +11465,21 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Field // 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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) 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_ { @@ -8444,14 +11487,14 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doReq } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addcatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removelocalinventoriesrequest) 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/{+attributesConfig}:addCatalogAttribute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+product}:removeLocalInventories") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8459,20 +11502,19 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doReq } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "attributesConfig": c.attributesConfig, + "product": c.product, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute" call. -// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.removeLocalInventories" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8491,7 +11533,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2AttributesConfig{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8503,28 +11545,28 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(op } return ret, nil // { - // "description": "Adds the specified CatalogAttribute to the AttributesConfig. If the CatalogAttribute to add already exists, an ALREADY_EXISTS error is returned.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig:addCatalogAttribute", + // "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeLocalInventories", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute", + // "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", // "parameterOrder": [ - // "attributesConfig" + // "product" // ], // "parameters": { - // "attributesConfig": { - // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "product": { + // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+attributesConfig}:addCatalogAttribute", + // "path": "v2/{+product}:removeLocalInventories", // "request": { - // "$ref": "GoogleCloudRetailV2AddCatalogAttributeRequest" + // "$ref": "GoogleCloudRetailV2RemoveLocalInventoriesRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2AttributesConfig" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8533,35 +11575,59 @@ func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(op } -// method id "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute": +// method id "retail.projects.locations.catalogs.branches.products.setInventory": -type ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall struct { - s *Service - attributesConfig string - googlecloudretailv2removecatalogattributerequest *GoogleCloudRetailV2RemoveCatalogAttributeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { + s *Service + name string + googlecloudretailv2setinventoryrequest *GoogleCloudRetailV2SetInventoryRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RemoveCatalogAttribute: Removes the specified CatalogAttribute from -// the AttributesConfig. If the CatalogAttribute to remove does not -// exist, a NOT_FOUND error is returned. +// SetInventory: Updates inventory information for a Product while +// respecting the last update timestamps of each inventory field. This +// process is asynchronous and does not require the Product to exist +// before updating fulfillment information. If the request is valid, the +// update is enqueued and processed downstream. As a consequence, when a +// response is returned, updates are not immediately manifested in the +// Product queried by ProductService.GetProduct or +// ProductService.ListProducts. When inventory is updated with +// ProductService.CreateProduct and ProductService.UpdateProduct, the +// specified inventory field value(s) overwrite any existing value(s) +// while ignoring the last update time for this field. Furthermore, the +// last update times for the specified inventory fields are overwritten +// by the times of the ProductService.CreateProduct or +// ProductService.UpdateProduct request. If no inventory fields are set +// in CreateProductRequest.product, then any pre-existing inventory +// information for this product is used. If no inventory fields are set +// in SetInventoryRequest.set_mask, then any existing inventory +// information is preserved. Pre-existing inventory information can only +// be updated with ProductService.SetInventory, +// ProductService.AddFulfillmentPlaces, and +// ProductService.RemoveFulfillmentPlaces. The returned Operations is +// obsolete after one day, and the GetOperation API returns `NOT_FOUND` +// afterwards. If conflicting updates are issued, the Operations +// associated with the stale updates are not marked as done until they +// are obsolete. This feature is only available for users who have +// Retail Search enabled. Enable Retail Search on Cloud Console before +// using this feature. // -// - attributesConfig: Full AttributesConfig resource name. Format: -// `projects/{project_number}/locations/{location_id}/catalogs/{catalog -// _id}/attributesConfig`. -func (r *ProjectsLocationsCatalogsAttributesConfigService) RemoveCatalogAttribute(attributesConfig string, googlecloudretailv2removecatalogattributerequest *GoogleCloudRetailV2RemoveCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { - c := &ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.attributesConfig = attributesConfig - c.googlecloudretailv2removecatalogattributerequest = googlecloudretailv2removecatalogattributerequest +// - name: Immutable. Full resource name of the product, such as +// `projects/*/locations/global/catalogs/default_catalog/branches/defau +// lt_branch/products/product_id`. +func (r *ProjectsLocationsCatalogsBranchesProductsService) SetInventory(name string, googlecloudretailv2setinventoryrequest *GoogleCloudRetailV2SetInventoryRequest) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { + c := &ProjectsLocationsCatalogsBranchesProductsSetInventoryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2setinventoryrequest = googlecloudretailv2setinventoryrequest 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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { +func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8569,21 +11635,21 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Fi // 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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { +func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) 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_ { @@ -8591,14 +11657,14 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) do } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removecatalogattributerequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2setinventoryrequest) 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/{+attributesConfig}:removeCatalogAttribute") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:setInventory") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8606,20 +11672,19 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) do } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "attributesConfig": c.attributesConfig, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute" call. -// Exactly one of *GoogleCloudRetailV2AttributesConfig or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *GoogleCloudRetailV2AttributesConfig.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 *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2AttributesConfig, error) { +// Do executes the "retail.projects.locations.catalogs.branches.products.setInventory" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8638,7 +11703,7 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2AttributesConfig{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8650,28 +11715,28 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do } return ret, nil // { - // "description": "Removes the specified CatalogAttribute from the AttributesConfig. If the CatalogAttribute to remove does not exist, a NOT_FOUND error is returned.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/attributesConfig:removeCatalogAttribute", + // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute", + // "id": "retail.projects.locations.catalogs.branches.products.setInventory", // "parameterOrder": [ - // "attributesConfig" + // "name" // ], // "parameters": { - // "attributesConfig": { - // "description": "Required. Full AttributesConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`", + // "name": { + // "description": "Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+attributesConfig}:removeCatalogAttribute", + // "path": "v2/{+name}:setInventory", // "request": { - // "$ref": "GoogleCloudRetailV2RemoveCatalogAttributeRequest" + // "$ref": "GoogleCloudRetailV2SetInventoryRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2AttributesConfig" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8680,97 +11745,95 @@ func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do } -// method id "retail.projects.locations.catalogs.branches.operations.get": +// method id "retail.projects.locations.catalogs.completionData.import": -type ProjectsLocationsCatalogsBranchesOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsCompletionDataImportCall struct { + s *Service + parent string + googlecloudretailv2importcompletiondatarequest *GoogleCloudRetailV2ImportCompletionDataRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// Import: Bulk import of processed completion dataset. Request +// processing is asynchronous. Partial updating is not supported. The +// operation is successfully finished only after the imported +// suggestions are indexed successfully and ready for serving. The +// process takes hours. This feature is only available for users who +// have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCatalogsBranchesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { - c := &ProjectsLocationsCatalogsBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The catalog which the suggestions dataset belongs to. +// Format: `projects/1234/locations/global/catalogs/default_catalog`. +func (r *ProjectsLocationsCatalogsCompletionDataService) Import(parent string, googlecloudretailv2importcompletiondatarequest *GoogleCloudRetailV2ImportCompletionDataRequest) *ProjectsLocationsCatalogsCompletionDataImportCall { + c := &ProjectsLocationsCatalogsCompletionDataImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudretailv2importcompletiondatarequest = googlecloudretailv2importcompletiondatarequest 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 *ProjectsLocationsCatalogsBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesOperationsGetCall { - 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 *ProjectsLocationsCatalogsBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { - c.ifNoneMatch_ = entityTag +// for more information. +func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompletionDataImportCall { + 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 *ProjectsLocationsCatalogsBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesOperationsGetCall { +func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompletionDataImportCall { 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 *ProjectsLocationsCatalogsBranchesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsCompletionDataImportCall) 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 + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2importcompletiondatarequest) + 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/completionData:import") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.operations.get" call. +// Do executes the "retail.projects.locations.catalogs.completionData.import" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8801,23 +11864,26 @@ func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleap } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.branches.operations.get", + // "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionData:import", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.completionData.import", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. The catalog which the suggestions dataset belongs to. Format: `projects/1234/locations/global/catalogs/default_catalog`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/completionData:import", + // "request": { + // "$ref": "GoogleCloudRetailV2ImportCompletionDataRequest" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -8828,47 +11894,43 @@ func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleap } -// method id "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces": +// method id "retail.projects.locations.catalogs.controls.create": -type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { - s *Service - product string - googlecloudretailv2addfulfillmentplacesrequest *GoogleCloudRetailV2AddFulfillmentPlacesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsControlsCreateCall struct { + s *Service + parent string + googlecloudretailv2control *GoogleCloudRetailV2Control + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddFulfillmentPlaces: Incrementally adds place IDs to -// Product.fulfillment_info.place_ids. This process is asynchronous and -// does not require the Product to exist before updating fulfillment -// information. If the request is valid, the update will be enqueued and -// processed downstream. As a consequence, when a response is returned, -// the added place IDs are not immediately manifested in the Product -// queried by ProductService.GetProduct or ProductService.ListProducts. -// The returned Operations will be obsolete after 1 day, and -// GetOperation API will return NOT_FOUND afterwards. If conflicting -// updates are issued, the Operations associated with the stale updates -// will not be marked as done until being obsolete. This feature is only -// available for users who have Retail Search enabled. Please enable -// Retail Search on Cloud Console before using this feature. +// Create: Creates a Control. If the Control to create already exists, +// an ALREADY_EXISTS error is returned. // -// - product: Full resource name of Product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/some_product_id`. If the caller does not have -// permission to access the Product, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. -func (r *ProjectsLocationsCatalogsBranchesProductsService) AddFulfillmentPlaces(product string, googlecloudretailv2addfulfillmentplacesrequest *GoogleCloudRetailV2AddFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { - c := &ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.product = product - c.googlecloudretailv2addfulfillmentplacesrequest = googlecloudretailv2addfulfillmentplacesrequest +// - parent: Full resource name of parent catalog. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. +func (r *ProjectsLocationsCatalogsControlsService) Create(parent string, googlecloudretailv2control *GoogleCloudRetailV2Control) *ProjectsLocationsCatalogsControlsCreateCall { + c := &ProjectsLocationsCatalogsControlsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudretailv2control = googlecloudretailv2control + return c +} + +// ControlId sets the optional parameter "controlId": Required. The ID +// to use for the Control, which will become the final component of the +// Control's resource name. This value should be 4-63 characters, and +// valid characters are /a-z-_/. +func (c *ProjectsLocationsCatalogsControlsCreateCall) ControlId(controlId string) *ProjectsLocationsCatalogsControlsCreateCall { + c.urlParams_.Set("controlId", controlId) 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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { +func (c *ProjectsLocationsCatalogsControlsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8876,21 +11938,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Fiel // 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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { +func (c *ProjectsLocationsCatalogsControlsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsCreateCall { 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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsControlsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsControlsCreateCall) 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_ { @@ -8898,14 +11960,14 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRe } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addfulfillmentplacesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2control) 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/{+product}:addFulfillmentPlaces") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/controls") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8913,19 +11975,19 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRe } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "product": c.product, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Do executes the "retail.projects.locations.catalogs.controls.create" call. +// Exactly one of *GoogleCloudRetailV2Control or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// *GoogleCloudRetailV2Control.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 *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsControlsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Control, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8944,7 +12006,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudRetailV2Control{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8956,28 +12018,33 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(o } return ret, nil // { - // "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. 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}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", + // "description": "Creates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", + // "id": "retail.projects.locations.catalogs.controls.create", // "parameterOrder": [ - // "product" + // "parent" // ], // "parameters": { - // "product": { - // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", + // "controlId": { + // "description": "Required. The ID to use for the Control, which will become the final component of the Control's resource name. This value should be 4-63 characters, and valid characters are /a-z-_/.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. Full resource name of parent catalog. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+product}:addFulfillmentPlaces", + // "path": "v2/{+parent}/controls", // "request": { - // "$ref": "GoogleCloudRetailV2AddFulfillmentPlacesRequest" + // "$ref": "GoogleCloudRetailV2Control" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudRetailV2Control" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8986,51 +12053,32 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(o } -// method id "retail.projects.locations.catalogs.branches.products.addLocalInventories": +// method id "retail.projects.locations.catalogs.controls.delete": -type ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall struct { - s *Service - product string - googlecloudretailv2addlocalinventoriesrequest *GoogleCloudRetailV2AddLocalInventoriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsControlsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddLocalInventories: Updates local inventory information for a -// Product at a list of places, while respecting the last update -// timestamps of each inventory field. This process is asynchronous and -// does not require the Product to exist before updating inventory -// information. If the request is valid, the update will be enqueued and -// processed downstream. As a consequence, when a response is returned, -// updates are not immediately manifested in the Product queried by -// ProductService.GetProduct or ProductService.ListProducts. Local -// inventory information can only be modified using this method. -// ProductService.CreateProduct and ProductService.UpdateProduct has no -// effect on local inventories. The returned Operations will be obsolete -// after 1 day, and GetOperation API will return NOT_FOUND afterwards. -// If conflicting updates are issued, the Operations associated with the -// stale updates will not be marked as done until being obsolete. This -// feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this -// feature. +// Delete: Deletes a Control. If the Control to delete does not exist, a +// NOT_FOUND error is returned. // -// - product: Full resource name of Product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/some_product_id`. If the caller does not have -// permission to access the Product, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. -func (r *ProjectsLocationsCatalogsBranchesProductsService) AddLocalInventories(product string, googlecloudretailv2addlocalinventoriesrequest *GoogleCloudRetailV2AddLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { - c := &ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.product = product - c.googlecloudretailv2addlocalinventoriesrequest = googlecloudretailv2addlocalinventoriesrequest +// - name: The resource name of the Control to delete. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/controls/{control_id}`. +func (r *ProjectsLocationsCatalogsControlsService) Delete(name string) *ProjectsLocationsCatalogsControlsDeleteCall { + c := &ProjectsLocationsCatalogsControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { +func (c *ProjectsLocationsCatalogsControlsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9038,21 +12086,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Field // 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 *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { +func (c *ProjectsLocationsCatalogsControlsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsDeleteCall { 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 *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsControlsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsControlsDeleteCall) 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_ { @@ -9060,34 +12108,29 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doReq } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addlocalinventoriesrequest) - 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/{+product}:addLocalInventories") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "product": c.product, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.addLocalInventories" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "retail.projects.locations.catalogs.controls.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsControlsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9106,7 +12149,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9118,28 +12161,25 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(op } return ret, nil // { - // "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. 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}/branches/{branchesId}/products/{productsId}:addLocalInventories", - // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", + // "description": "Deletes a Control. If the Control to delete does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", + // "httpMethod": "DELETE", + // "id": "retail.projects.locations.catalogs.controls.delete", // "parameterOrder": [ - // "product" + // "name" // ], // "parameters": { - // "product": { - // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", + // "name": { + // "description": "Required. The resource name of the Control to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+product}:addLocalInventories", - // "request": { - // "$ref": "GoogleCloudRetailV2AddLocalInventoriesRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9148,103 +12188,97 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(op } -// method id "retail.projects.locations.catalogs.branches.products.create": +// method id "retail.projects.locations.catalogs.controls.get": -type ProjectsLocationsCatalogsBranchesProductsCreateCall struct { - s *Service - parent string - googlecloudretailv2product *GoogleCloudRetailV2Product - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsControlsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a Product. +// Get: Gets a Control. // -// - parent: The parent catalog resource name, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch`. -func (r *ProjectsLocationsCatalogsBranchesProductsService) Create(parent string, googlecloudretailv2product *GoogleCloudRetailV2Product) *ProjectsLocationsCatalogsBranchesProductsCreateCall { - c := &ProjectsLocationsCatalogsBranchesProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudretailv2product = googlecloudretailv2product - return c -} - -// ProductId sets the optional parameter "productId": Required. The ID -// to use for the Product, which will become the final component of the -// Product.name. If the caller does not have permission to create the -// Product, regardless of whether or not it exists, a PERMISSION_DENIED -// error is returned. This field must be unique among all Products with -// the same parent. Otherwise, an ALREADY_EXISTS error is returned. This -// field must be a UTF-8 encoded string with a length limit of 128 -// characters. Otherwise, an INVALID_ARGUMENT error is returned. -func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) ProductId(productId string) *ProjectsLocationsCatalogsBranchesProductsCreateCall { - c.urlParams_.Set("productId", productId) +// - name: The resource name of the Control to get. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/controls/{control_id}`. +func (r *ProjectsLocationsCatalogsControlsService) Get(name string) *ProjectsLocationsCatalogsControlsGetCall { + c := &ProjectsLocationsCatalogsControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsCreateCall { +func (c *ProjectsLocationsCatalogsControlsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsGetCall { 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 *ProjectsLocationsCatalogsControlsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsControlsGetCall { + 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 *ProjectsLocationsCatalogsBranchesProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsCreateCall { +func (c *ProjectsLocationsCatalogsControlsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsGetCall { 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 *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsControlsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsControlsGetCall) 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.googlecloudretailv2product) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.create" call. -// Exactly one of *GoogleCloudRetailV2Product or error will be non-nil. +// Do executes the "retail.projects.locations.catalogs.controls.get" call. +// Exactly one of *GoogleCloudRetailV2Control or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudRetailV2Product.ServerResponse.Header or (if a response +// *GoogleCloudRetailV2Control.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 *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Product, error) { +func (c *ProjectsLocationsCatalogsControlsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Control, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9263,7 +12297,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2Product{ + ret := &GoogleCloudRetailV2Control{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9275,33 +12309,25 @@ func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googlea } return ret, nil // { - // "description": "Creates a Product.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products", - // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.create", + // "description": "Gets a Control.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.controls.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.", + // "name": { + // "description": "Required. The resource name of the Control to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", // "required": true, // "type": "string" - // }, - // "productId": { - // "description": "Required. The ID to use for the Product, which will become the final component of the Product.name. If the caller does not have permission to create the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Products with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+parent}/products", - // "request": { - // "$ref": "GoogleCloudRetailV2Product" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "GoogleCloudRetailV2Product" + // "$ref": "GoogleCloudRetailV2Control" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9310,90 +12336,123 @@ func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googlea } -// method id "retail.projects.locations.catalogs.branches.products.delete": +// method id "retail.projects.locations.catalogs.controls.list": -type ProjectsLocationsCatalogsBranchesProductsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsControlsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a Product. +// List: Lists all Controls by their parent Catalog. // -// - name: Full resource name of Product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/some_product_id`. If the caller does not have -// permission to delete the Product, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. If the Product to -// delete does not exist, a NOT_FOUND error is returned. The Product -// to delete can neither be a Product.Type.COLLECTION Product member -// nor a Product.Type.PRIMARY Product with more than one variants. -// Otherwise, an INVALID_ARGUMENT error is returned. All inventory -// information for the named Product will be deleted. -func (r *ProjectsLocationsCatalogsBranchesProductsService) Delete(name string) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { - c := &ProjectsLocationsCatalogsBranchesProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The catalog resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. +func (r *ProjectsLocationsCatalogsControlsService) List(parent string) *ProjectsLocationsCatalogsControlsListCall { + c := &ProjectsLocationsCatalogsControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter to apply on the +// list results. Supported features: * List all the products under the +// parent branch if filter is unset. * List controls that are used in a +// single ServingConfig: 'serving_config = "boosted_home_page_cvr"' +func (c *ProjectsLocationsCatalogsControlsListCall) Filter(filter string) *ProjectsLocationsCatalogsControlsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 50. Max allowed value +// is 1000. +func (c *ProjectsLocationsCatalogsControlsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsControlsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListControls` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsCatalogsControlsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsControlsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { +func (c *ProjectsLocationsCatalogsControlsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsListCall { 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 *ProjectsLocationsCatalogsControlsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsControlsListCall { + 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 *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { +func (c *ProjectsLocationsCatalogsControlsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsListCall { 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 *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsControlsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsControlsListCall) 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, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/controls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.delete" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "retail.projects.locations.catalogs.controls.list" call. +// Exactly one of *GoogleCloudRetailV2ListControlsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudRetailV2ListControlsResponse.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 *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsLocationsCatalogsControlsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ListControlsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9412,7 +12471,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleProtobufEmpty{ + ret := &GoogleCloudRetailV2ListControlsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9424,25 +12483,41 @@ func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googlea } return ret, nil // { - // "description": "Deletes a Product.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", - // "httpMethod": "DELETE", - // "id": "retail.projects.locations.catalogs.branches.products.delete", + // "description": "Lists all Controls by their parent Catalog.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.controls.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to delete the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Product to delete does not exist, a NOT_FOUND error is returned. The Product to delete can neither be a Product.Type.COLLECTION Product member nor a Product.Type.PRIMARY Product with more than one variants. Otherwise, an INVALID_ARGUMENT error is returned. All inventory information for the named Product will be deleted.", + // "filter": { + // "description": "Optional. A filter to apply on the list results. Supported features: * List all the products under the parent branch if filter is unset. * List controls that are used in a single ServingConfig: 'serving_config = \"boosted_home_page_cvr\"'", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A page token, received from a previous `ListControls` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+parent}/controls", // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleCloudRetailV2ListControlsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9451,82 +12526,103 @@ func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googlea } -// method id "retail.projects.locations.catalogs.branches.products.get": +// 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 *ProjectsLocationsCatalogsControlsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2ListControlsResponse) 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) + } +} -type ProjectsLocationsCatalogsBranchesProductsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "retail.projects.locations.catalogs.controls.patch": + +type ProjectsLocationsCatalogsControlsPatchCall struct { + s *Service + name string + googlecloudretailv2control *GoogleCloudRetailV2Control + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a Product. +// Patch: Updates a Control. Control cannot be set to a different oneof +// field, if so an INVALID_ARGUMENT is returned. If the Control to +// update does not exist, a NOT_FOUND error is returned. // -// - name: Full resource name of Product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/some_product_id`. If the caller does not have -// permission to access the Product, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. If the requested -// Product does not exist, a NOT_FOUND error is returned. -func (r *ProjectsLocationsCatalogsBranchesProductsService) Get(name string) *ProjectsLocationsCatalogsBranchesProductsGetCall { - c := &ProjectsLocationsCatalogsBranchesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. Fully qualified name +// `projects/*/locations/global/catalogs/*/controls/*`. +func (r *ProjectsLocationsCatalogsControlsService) Patch(name string, googlecloudretailv2control *GoogleCloudRetailV2Control) *ProjectsLocationsCatalogsControlsPatchCall { + c := &ProjectsLocationsCatalogsControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googlecloudretailv2control = googlecloudretailv2control + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided Control to update. The following are NOT +// supported: * Control.name If not set or empty, all supported fields +// are updated. +func (c *ProjectsLocationsCatalogsControlsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsControlsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsGetCall { +func (c *ProjectsLocationsCatalogsControlsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsPatchCall { 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 *ProjectsLocationsCatalogsBranchesProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsGetCall { - 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 *ProjectsLocationsCatalogsBranchesProductsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsGetCall { +func (c *ProjectsLocationsCatalogsControlsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsPatchCall { 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 *ProjectsLocationsCatalogsBranchesProductsGetCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsControlsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsControlsPatchCall) 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 + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2control) + 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/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -9537,14 +12633,14 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.get" call. -// Exactly one of *GoogleCloudRetailV2Product or error will be non-nil. +// Do executes the "retail.projects.locations.catalogs.controls.patch" call. +// Exactly one of *GoogleCloudRetailV2Control or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudRetailV2Product.ServerResponse.Header or (if a response +// *GoogleCloudRetailV2Control.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 *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Product, error) { +func (c *ProjectsLocationsCatalogsControlsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Control, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9563,7 +12659,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi. if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2Product{ + ret := &GoogleCloudRetailV2Control{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9575,25 +12671,34 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi. } return ret, nil // { - // "description": "Gets a Product.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", - // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.branches.products.get", + // "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", + // "httpMethod": "PATCH", + // "id": "retail.projects.locations.catalogs.controls.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Product does not exist, a NOT_FOUND error is returned.", + // "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided Control to update. The following are NOT supported: * Control.name If not set or empty, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v2/{+name}", + // "request": { + // "$ref": "GoogleCloudRetailV2Control" + // }, // "response": { - // "$ref": "GoogleCloudRetailV2Product" + // "$ref": "GoogleCloudRetailV2Control" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9602,94 +12707,97 @@ func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi. } -// method id "retail.projects.locations.catalogs.branches.products.import": - -type ProjectsLocationsCatalogsBranchesProductsImportCall struct { - s *Service - parent string - googlecloudretailv2importproductsrequest *GoogleCloudRetailV2ImportProductsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} +// method id "retail.projects.locations.catalogs.operations.get": -// Import: Bulk import of multiple Products. Request processing may be -// synchronous. Non-existing items are created. Note that it is possible -// for a subset of the Products to be successfully updated. -// -// - parent: -// `projects/1234/locations/global/catalogs/default_catalog/branches/de -// fault_branch` If no updateMask is specified, requires -// products.create permission. If updateMask is specified, requires -// products.update permission. -func (r *ProjectsLocationsCatalogsBranchesProductsService) Import(parent string, googlecloudretailv2importproductsrequest *GoogleCloudRetailV2ImportProductsRequest) *ProjectsLocationsCatalogsBranchesProductsImportCall { - c := &ProjectsLocationsCatalogsBranchesProductsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudretailv2importproductsrequest = googlecloudretailv2importproductsrequest +type ProjectsLocationsCatalogsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { + c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsImportCall { +func (c *ProjectsLocationsCatalogsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsGetCall { 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 *ProjectsLocationsCatalogsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsGetCall { + 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 *ProjectsLocationsCatalogsBranchesProductsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsImportCall { +func (c *ProjectsLocationsCatalogsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsGetCall { 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 *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsOperationsGetCall) 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.googlecloudretailv2importproductsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.import" call. +// Do executes the "retail.projects.locations.catalogs.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9720,26 +12828,23 @@ func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googlea } return ret, nil // { - // "description": "Bulk import of multiple Products. Request processing may be synchronous. Non-existing items are created. Note that it is possible for a subset of the Products to be successfully updated.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products:import", - // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.import", + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.operations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` If no updateMask is specified, requires products.create permission. If updateMask is specified, requires products.update permission.", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/products:import", - // "request": { - // "$ref": "GoogleCloudRetailV2ImportProductsRequest" - // }, + // "path": "v2/{+name}", // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -9750,85 +12855,60 @@ func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googlea } -// method id "retail.projects.locations.catalogs.branches.products.list": +// method id "retail.projects.locations.catalogs.operations.list": -type ProjectsLocationsCatalogsBranchesProductsListCall struct { +type ProjectsLocationsCatalogsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Gets a list of Products. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to +// override the binding to use different resource name schemes, such as +// `users/*/operations`. To override the binding, API services can add a +// binding such as "/v1/{name=users/*}/operations" to their service +// configuration. For backwards compatibility, the default name includes +// the operations collection id, however overriding users must ensure +// the name binding is the parent resource, without the operations +// collection id. // -// - parent: The parent branch resource name, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/0`. -// Use `default_branch` as the branch ID, to list products under the -// default branch. If the caller does not have permission to list -// Products under this branch, regardless of whether or not this -// branch exists, a PERMISSION_DENIED error is returned. -func (r *ProjectsLocationsCatalogsBranchesProductsService) List(parent string) *ProjectsLocationsCatalogsBranchesProductsListCall { - c := &ProjectsLocationsCatalogsBranchesProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCatalogsOperationsService) List(name string) *ProjectsLocationsCatalogsOperationsListCall { + c := &ProjectsLocationsCatalogsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// Filter sets the optional parameter "filter": A filter to apply on the -// list results. Supported features: * List all the products under the -// parent branch if filter is unset. * List Product.Type.VARIANT -// Products sharing the same Product.Type.PRIMARY Product. For example: -// `primary_product_id = "some_product_id" * List Products bundled in a -// Product.Type.COLLECTION Product. For example: `collection_product_id -// = "some_product_id" * List Products with a partibular type. For -// example: `type = "PRIMARY" `type = "VARIANT" `type = "COLLECTION" -// If the field is unrecognizable, an INVALID_ARGUMENT error is -// returned. If the specified Product.Type.PRIMARY Product or -// Product.Type.COLLECTION Product does not exist, a NOT_FOUND error is -// returned. -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Filter(filter string) *ProjectsLocationsCatalogsBranchesProductsListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCatalogsOperationsListCall) Filter(filter string) *ProjectsLocationsCatalogsOperationsListCall { c.urlParams_.Set("filter", filter) return c } -// PageSize sets the optional parameter "pageSize": Maximum number of -// Products to return. If unspecified, defaults to 100. The maximum -// allowed value is 1000. Values above 1000 will be coerced to 1000. If -// this field is negative, an INVALID_ARGUMENT error is returned. -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsBranchesProductsListCall { +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCatalogsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// ListProductsResponse.next_page_token, received from a previous -// ProductService.ListProducts call. Provide this to retrieve the -// subsequent page. When paginating, all other parameters provided to -// ProductService.ListProducts must match the call that provided the -// page token. Otherwise, an INVALID_ARGUMENT error is returned. -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsBranchesProductsListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCatalogsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// ReadMask sets the optional parameter "readMask": The fields of -// Product to return in the responses. If not set or empty, the -// following fields are returned: * Product.name * Product.id * -// Product.title * Product.uri * Product.images * Product.price_info * -// Product.brands If "*" is provided, all fields are returned. -// Product.name is always returned no matter what mask is set. If an -// unsupported or unknown field is provided, an INVALID_ARGUMENT error -// is returned. -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) ReadMask(readMask string) *ProjectsLocationsCatalogsBranchesProductsListCall { - c.urlParams_.Set("readMask", readMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsListCall { +func (c *ProjectsLocationsCatalogsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9838,7 +12918,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Fields(s ...googleap // 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 *ProjectsLocationsCatalogsBranchesProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsListCall { +func (c *ProjectsLocationsCatalogsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -9846,21 +12926,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) IfNoneMatch(entityTa // 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 *ProjectsLocationsCatalogsBranchesProductsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsListCall { +func (c *ProjectsLocationsCatalogsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsListCall { 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 *ProjectsLocationsCatalogsBranchesProductsListCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsOperationsListCall) 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_ { @@ -9873,7 +12953,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/products") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9881,20 +12961,20 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.list" call. -// Exactly one of *GoogleCloudRetailV2ListProductsResponse or error will +// Do executes the "retail.projects.locations.catalogs.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either -// *GoogleCloudRetailV2ListProductsResponse.ServerResponse.Header or (if +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ListProductsResponse, error) { +func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9913,7 +12993,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2ListProductsResponse{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9925,47 +13005,41 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Gets a list of Products.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/operations", // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.branches.products.list", + // "id": "retail.projects.locations.catalogs.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { // "filter": { - // "description": "A filter to apply on the list results. Supported features: * List all the products under the parent branch if filter is unset. * List Product.Type.VARIANT Products sharing the same Product.Type.PRIMARY Product. For example: `primary_product_id = \"some_product_id\"` * List Products bundled in a Product.Type.COLLECTION Product. For example: `collection_product_id = \"some_product_id\"` * List Products with a partibular type. For example: `type = \"PRIMARY\"` `type = \"VARIANT\"` `type = \"COLLECTION\"` If the field is unrecognizable, an INVALID_ARGUMENT error is returned. If the specified Product.Type.PRIMARY Product or Product.Type.COLLECTION Product does not exist, a NOT_FOUND error is returned.", + // "description": "The standard list filter.", // "location": "query", // "type": "string" // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Maximum number of Products to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token ListProductsResponse.next_page_token, received from a previous ProductService.ListProducts call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ProductService.ListProducts must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` as the branch ID, to list products under the default branch. If the caller does not have permission to list Products under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", - // "required": true, - // "type": "string" - // }, - // "readMask": { - // "description": "The fields of Product to return in the responses. If not set or empty, the following fields are returned: * Product.name * Product.id * Product.title * Product.uri * Product.images * Product.price_info * Product.brands If \"*\" is provided, all fields are returned. Product.name is always returned no matter what mask is set. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.", - // "format": "google-fieldmask", + // "description": "The standard list page token.", // "location": "query", // "type": "string" // } // }, - // "path": "v2/{+parent}/products", + // "path": "v2/{+name}/operations", // "response": { - // "$ref": "GoogleCloudRetailV2ListProductsResponse" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9977,7 +13051,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi // 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 *ProjectsLocationsCatalogsBranchesProductsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2ListProductsResponse) error) error { +func (c *ProjectsLocationsCatalogsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -9995,55 +13069,43 @@ func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Pages(ctx context.Co } } -// method id "retail.projects.locations.catalogs.branches.products.patch": +// method id "retail.projects.locations.catalogs.placements.predict": -type ProjectsLocationsCatalogsBranchesProductsPatchCall struct { - s *Service - name string - googlecloudretailv2product *GoogleCloudRetailV2Product - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsPlacementsPredictCall struct { + s *Service + placement string + googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a Product. +// Predict: Makes a recommendation prediction. // -// - name: Immutable. Full resource name of the product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/product_id`. -func (r *ProjectsLocationsCatalogsBranchesProductsService) Patch(name string, googlecloudretailv2product *GoogleCloudRetailV2Product) *ProjectsLocationsCatalogsBranchesProductsPatchCall { - c := &ProjectsLocationsCatalogsBranchesProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudretailv2product = googlecloudretailv2product - return c -} - -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the Product is not found, a new Product will be created. In -// this situation, `update_mask` is ignored. -func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCatalogsBranchesProductsPatchCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) - return c -} - -// UpdateMask sets the optional parameter "updateMask": Indicates which -// fields in the provided Product to update. The immutable and output -// only fields are NOT supported. If not set, all supported fields (the -// fields that are neither immutable nor output only) are updated. If an -// unsupported or unknown field is provided, an INVALID_ARGUMENT error -// is returned. The attribute key can be updated by setting the mask -// path as "attributes.${key_name}". If a key name is present in the -// mask but not in the patching product from the request, this key will -// be deleted after the update. -func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsBranchesProductsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - placement: Full resource name of the format: +// `{placement=projects/*/locations/global/catalogs/default_catalog/ser +// vingConfigs/*}` or +// `{placement=projects/*/locations/global/catalogs/default_catalog/pla +// cements/*}`. 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 + 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 *ProjectsLocationsCatalogsBranchesProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPatchCall { +func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsPredictCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10051,21 +13113,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Fields(s ...googlea // 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 *ProjectsLocationsCatalogsBranchesProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPatchCall { +func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsPredictCall { 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 *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsPlacementsPredictCall) 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_ { @@ -10073,34 +13135,35 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt strin } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2product) + 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/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+placement}:predict") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "placement": c.placement, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.patch" call. -// Exactly one of *GoogleCloudRetailV2Product or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleCloudRetailV2Product.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 *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2Product, error) { +// Do executes the "retail.projects.locations.catalogs.placements.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 *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2PredictResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10119,7 +13182,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleap if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2Product{ + ret := &GoogleCloudRetailV2PredictResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10131,39 +13194,28 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleap } return ret, nil // { - // "description": "Updates a Product.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", - // "httpMethod": "PATCH", - // "id": "retail.projects.locations.catalogs.branches.products.patch", + // "description": "Makes a recommendation prediction.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:predict", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.placements.predict", // "parameterOrder": [ - // "name" + // "placement" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the Product is not found, a new Product will be created. In this situation, `update_mask` is ignored.", - // "location": "query", - // "type": "boolean" - // }, - // "name": { - // "description": "Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.", + // "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/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "Indicates which fields in the provided Product to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. The attribute key can be updated by setting the mask path as \"attributes.${key_name}\". If a key name is present in the mask but not in the patching product from the request, this key will be deleted after the update.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+placement}:predict", // "request": { - // "$ref": "GoogleCloudRetailV2Product" + // "$ref": "GoogleCloudRetailV2PredictRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2Product" + // "$ref": "GoogleCloudRetailV2PredictResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10172,47 +13224,41 @@ func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleap } -// method id "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces": +// method id "retail.projects.locations.catalogs.placements.search": -type ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall struct { - s *Service - product string - googlecloudretailv2removefulfillmentplacesrequest *GoogleCloudRetailV2RemoveFulfillmentPlacesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsPlacementsSearchCall struct { + s *Service + placement string + googlecloudretailv2searchrequest *GoogleCloudRetailV2SearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RemoveFulfillmentPlaces: Incrementally removes place IDs from a -// Product.fulfillment_info.place_ids. This process is asynchronous and -// does not require the Product to exist before updating fulfillment -// information. If the request is valid, the update will be enqueued and -// processed downstream. As a consequence, when a response is returned, -// the removed place IDs are not immediately manifested in the Product -// queried by ProductService.GetProduct or ProductService.ListProducts. -// The returned Operations will be obsolete after 1 day, and -// GetOperation API will return NOT_FOUND afterwards. If conflicting -// updates are issued, the Operations associated with the stale updates -// will not be marked as done until being obsolete. This feature is only -// available for users who have Retail Search enabled. Please enable -// Retail Search on Cloud Console before using this feature. +// Search: Performs a search. This feature is only available for users +// who have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // -// - product: Full resource name of Product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/some_product_id`. If the caller does not have -// permission to access the Product, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. -func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveFulfillmentPlaces(product string, googlecloudretailv2removefulfillmentplacesrequest *GoogleCloudRetailV2RemoveFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { - c := &ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.product = product - c.googlecloudretailv2removefulfillmentplacesrequest = googlecloudretailv2removefulfillmentplacesrequest +// - 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 *ProjectsLocationsCatalogsPlacementsService) Search(placement string, googlecloudretailv2searchrequest *GoogleCloudRetailV2SearchRequest) *ProjectsLocationsCatalogsPlacementsSearchCall { + c := &ProjectsLocationsCatalogsPlacementsSearchCall{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 *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { +func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsSearchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10220,21 +13266,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) F // 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 *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { +func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsSearchCall { 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 *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsPlacementsSearchCall) 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_ { @@ -10242,14 +13288,14 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) d } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removefulfillmentplacesrequest) + 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/{+product}:removeFulfillmentPlaces") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+placement}:search") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -10257,19 +13303,20 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) d } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "product": c.product, + "placement": c.placement, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "retail.projects.locations.catalogs.placements.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 *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2SearchResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10288,7 +13335,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) D if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudRetailV2SearchResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10300,28 +13347,28 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) D } return ret, nil // { - // "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. 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}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", + // "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:search", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", + // "id": "retail.projects.locations.catalogs.placements.search", // "parameterOrder": [ - // "product" + // "placement" // ], // "parameters": { - // "product": { - // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", + // "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/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+product}:removeFulfillmentPlaces", + // "path": "v2/{+placement}:search", // "request": { - // "$ref": "GoogleCloudRetailV2RemoveFulfillmentPlacesRequest" + // "$ref": "GoogleCloudRetailV2SearchRequest" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudRetailV2SearchResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10330,49 +13377,60 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) D } -// method id "retail.projects.locations.catalogs.branches.products.removeLocalInventories": +// 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 *ProjectsLocationsCatalogsPlacementsSearchCall) 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 + } +} -type ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall struct { - s *Service - product string - googlecloudretailv2removelocalinventoriesrequest *GoogleCloudRetailV2RemoveLocalInventoriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "retail.projects.locations.catalogs.servingConfigs.addControl": + +type ProjectsLocationsCatalogsServingConfigsAddControlCall struct { + s *Service + servingConfig string + googlecloudretailv2addcontrolrequest *GoogleCloudRetailV2AddControlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RemoveLocalInventories: Remove local inventory information for a -// Product at a list of places at a removal timestamp. This process is -// asynchronous. If the request is valid, the removal will be enqueued -// and processed downstream. As a consequence, when a response is -// returned, removals are not immediately manifested in the Product -// queried by ProductService.GetProduct or ProductService.ListProducts. -// Local inventory information can only be removed using this method. -// ProductService.CreateProduct and ProductService.UpdateProduct has no -// effect on local inventories. The returned Operations will be obsolete -// after 1 day, and GetOperation API will return NOT_FOUND afterwards. -// If conflicting updates are issued, the Operations associated with the -// stale updates will not be marked as done until being obsolete. This -// feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this -// feature. +// AddControl: Enables a Control on the specified ServingConfig. The +// control is added in the last position of the list of controls it +// belongs to (e.g. if it's a facet spec control it will be applied in +// the last position of servingConfig.facetSpecIds) Returns a +// ALREADY_EXISTS error if the control has already been applied. Returns +// a FAILED_PRECONDITION error if the addition could exceed maximum +// number of control allowed for that type of control. // -// - product: Full resource name of Product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/some_product_id`. If the caller does not have -// permission to access the Product, regardless of whether or not it -// exists, a PERMISSION_DENIED error is returned. -func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveLocalInventories(product string, googlecloudretailv2removelocalinventoriesrequest *GoogleCloudRetailV2RemoveLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { - c := &ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.product = product - c.googlecloudretailv2removelocalinventoriesrequest = googlecloudretailv2removelocalinventoriesrequest +// - servingConfig: The source ServingConfig resource name . Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. +func (r *ProjectsLocationsCatalogsServingConfigsService) AddControl(servingConfig string, googlecloudretailv2addcontrolrequest *GoogleCloudRetailV2AddControlRequest) *ProjectsLocationsCatalogsServingConfigsAddControlCall { + c := &ProjectsLocationsCatalogsServingConfigsAddControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googlecloudretailv2addcontrolrequest = googlecloudretailv2addcontrolrequest 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 *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { +func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsAddControlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10380,21 +13438,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Fi // 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 *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { +func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 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 *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) 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_ { @@ -10402,14 +13460,14 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) do } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removelocalinventoriesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2addcontrolrequest) 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/{+product}:removeLocalInventories") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+servingConfig}:addControl") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -10417,19 +13475,19 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) do } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "product": c.product, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.removeLocalInventories" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "retail.projects.locations.catalogs.servingConfigs.addControl" call. +// Exactly one of *GoogleCloudRetailV2ServingConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2ServingConfig.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 *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ServingConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10448,7 +13506,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudRetailV2ServingConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10460,28 +13518,28 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do } return ret, nil // { - // "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. 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}/branches/{branchesId}/products/{productsId}:removeLocalInventories", + // "description": "Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:addControl", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", + // "id": "retail.projects.locations.catalogs.servingConfigs.addControl", // "parameterOrder": [ - // "product" + // "servingConfig" // ], // "parameters": { - // "product": { - // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.", + // "servingConfig": { + // "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+product}:removeLocalInventories", + // "path": "v2/{+servingConfig}:addControl", // "request": { - // "$ref": "GoogleCloudRetailV2RemoveLocalInventoriesRequest" + // "$ref": "GoogleCloudRetailV2AddControlRequest" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10490,59 +13548,44 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do } -// method id "retail.projects.locations.catalogs.branches.products.setInventory": +// method id "retail.projects.locations.catalogs.servingConfigs.create": -type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { - s *Service - name string - googlecloudretailv2setinventoryrequest *GoogleCloudRetailV2SetInventoryRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsServingConfigsCreateCall struct { + s *Service + parent string + googlecloudretailv2servingconfig *GoogleCloudRetailV2ServingConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetInventory: Updates inventory information for a Product while -// respecting the last update timestamps of each inventory field. This -// process is asynchronous and does not require the Product to exist -// before updating fulfillment information. If the request is valid, the -// update will be enqueued and processed downstream. As a consequence, -// when a response is returned, updates are not immediately manifested -// in the Product queried by ProductService.GetProduct or -// ProductService.ListProducts. When inventory is updated with -// ProductService.CreateProduct and ProductService.UpdateProduct, the -// specified inventory field value(s) will overwrite any existing -// value(s) while ignoring the last update time for this field. -// Furthermore, the last update time for the specified inventory fields -// will be overwritten to the time of the ProductService.CreateProduct -// or ProductService.UpdateProduct request. If no inventory fields are -// set in CreateProductRequest.product, then any pre-existing inventory -// information for this product will be used. If no inventory fields are -// set in SetInventoryRequest.set_mask, then any existing inventory -// information will be preserved. Pre-existing inventory information can -// only be updated with ProductService.SetInventory, -// ProductService.AddFulfillmentPlaces, and -// ProductService.RemoveFulfillmentPlaces. The returned Operations will -// be obsolete after 1 day, and GetOperation API will return NOT_FOUND -// afterwards. If conflicting updates are issued, the Operations -// associated with the stale updates will not be marked as done until -// being obsolete. This feature is only available for users who have -// Retail Search enabled. Please enable Retail Search on Cloud Console -// before using this feature. +// Create: Creates a ServingConfig. A maximum of 100 ServingConfigs are +// allowed in a Catalog, otherwise a FAILED_PRECONDITION error is +// returned. // -// - name: Immutable. Full resource name of the product, such as -// `projects/*/locations/global/catalogs/default_catalog/branches/defau -// lt_branch/products/product_id`. -func (r *ProjectsLocationsCatalogsBranchesProductsService) SetInventory(name string, googlecloudretailv2setinventoryrequest *GoogleCloudRetailV2SetInventoryRequest) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { - c := &ProjectsLocationsCatalogsBranchesProductsSetInventoryCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.googlecloudretailv2setinventoryrequest = googlecloudretailv2setinventoryrequest +// - parent: Full resource name of parent. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. +func (r *ProjectsLocationsCatalogsServingConfigsService) Create(parent string, googlecloudretailv2servingconfig *GoogleCloudRetailV2ServingConfig) *ProjectsLocationsCatalogsServingConfigsCreateCall { + c := &ProjectsLocationsCatalogsServingConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudretailv2servingconfig = googlecloudretailv2servingconfig + return c +} + +// ServingConfigId sets the optional parameter "servingConfigId": +// Required. The ID to use for the ServingConfig, which will become the +// final component of the ServingConfig's resource name. This value +// should be 4-63 characters, and valid characters are /a-z-_/. +func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) ServingConfigId(servingConfigId string) *ProjectsLocationsCatalogsServingConfigsCreateCall { + c.urlParams_.Set("servingConfigId", servingConfigId) 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 *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { +func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10550,21 +13593,21 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Fields(s ... // 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 *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { +func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsCreateCall { 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 *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) 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_ { @@ -10572,14 +13615,14 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(al } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2setinventoryrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2servingconfig) 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/{+name}:setInventory") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -10587,19 +13630,19 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(al } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.branches.products.setInventory" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "retail.projects.locations.catalogs.servingConfigs.create" call. +// Exactly one of *GoogleCloudRetailV2ServingConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2ServingConfig.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 *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ServingConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10618,7 +13661,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudRetailV2ServingConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10630,28 +13673,33 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } return ret, nil // { - // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. 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}/branches/{branchesId}/products/{productsId}:setInventory", + // "description": "Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed in a Catalog, otherwise a FAILED_PRECONDITION error is returned.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.branches.products.setInventory", + // "id": "retail.projects.locations.catalogs.servingConfigs.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`.", + // "parent": { + // "description": "Required. Full resource name of parent. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, // "type": "string" + // }, + // "servingConfigId": { + // "description": "Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name. This value should be 4-63 characters, and valid characters are /a-z-_/.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+name}:setInventory", + // "path": "v2/{+parent}/servingConfigs", // "request": { - // "$ref": "GoogleCloudRetailV2SetInventoryRequest" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10660,38 +13708,32 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } -// method id "retail.projects.locations.catalogs.completionData.import": +// method id "retail.projects.locations.catalogs.servingConfigs.delete": -type ProjectsLocationsCatalogsCompletionDataImportCall struct { - s *Service - parent string - googlecloudretailv2importcompletiondatarequest *GoogleCloudRetailV2ImportCompletionDataRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsServingConfigsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Import: Bulk import of processed completion dataset. Request -// processing is asynchronous. Partial updating is not supported. The -// operation is successfully finished only after the imported -// suggestions are indexed successfully and ready for serving. The -// process takes hours. This feature is only available for users who -// have Retail Search enabled. Please enable Retail Search on Cloud -// Console before using this feature. +// Delete: Deletes a ServingConfig. Returns a NotFound error if the +// ServingConfig does not exist. // -// - parent: The catalog which the suggestions dataset belongs to. -// Format: `projects/1234/locations/global/catalogs/default_catalog`. -func (r *ProjectsLocationsCatalogsCompletionDataService) Import(parent string, googlecloudretailv2importcompletiondatarequest *GoogleCloudRetailV2ImportCompletionDataRequest) *ProjectsLocationsCatalogsCompletionDataImportCall { - c := &ProjectsLocationsCatalogsCompletionDataImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googlecloudretailv2importcompletiondatarequest = googlecloudretailv2importcompletiondatarequest +// - name: The resource name of the ServingConfig to delete. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. +func (r *ProjectsLocationsCatalogsServingConfigsService) Delete(name string) *ProjectsLocationsCatalogsServingConfigsDeleteCall { + c := &ProjectsLocationsCatalogsServingConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompletionDataImportCall { +func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10699,21 +13741,21 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Fields(s ...googleap // 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 *ProjectsLocationsCatalogsCompletionDataImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompletionDataImportCall { +func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 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 *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) 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_ { @@ -10721,34 +13763,29 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2importcompletiondatarequest) - 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/{+parent}/completionData:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.completionData.import" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "retail.projects.locations.catalogs.servingConfigs.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10767,7 +13804,7 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10779,28 +13816,25 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. 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}/completionData:import", - // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.completionData.import", + // "description": "Deletes a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}", + // "httpMethod": "DELETE", + // "id": "retail.projects.locations.catalogs.servingConfigs.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The catalog which the suggestions dataset belongs to. Format: `projects/1234/locations/global/catalogs/default_catalog`.", + // "name": { + // "description": "Required. The resource name of the ServingConfig to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/completionData:import", - // "request": { - // "$ref": "GoogleCloudRetailV2ImportCompletionDataRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10809,9 +13843,9 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi } -// method id "retail.projects.locations.catalogs.operations.get": +// method id "retail.projects.locations.catalogs.servingConfigs.get": -type ProjectsLocationsCatalogsOperationsGetCall struct { +type ProjectsLocationsCatalogsServingConfigsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -10820,13 +13854,14 @@ type ProjectsLocationsCatalogsOperationsGetCall struct { header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// Get: Gets a ServingConfig. Returns a NotFound error if the +// ServingConfig does not exist. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { - c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the ServingConfig to get. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. +func (r *ProjectsLocationsCatalogsServingConfigsService) Get(name string) *ProjectsLocationsCatalogsServingConfigsGetCall { + c := &ProjectsLocationsCatalogsServingConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -10834,7 +13869,7 @@ func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsL // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsGetCall { +func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10844,7 +13879,7 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) Fields(s ...googleapi.Field // 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 *ProjectsLocationsCatalogsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsGetCall { +func (c *ProjectsLocationsCatalogsServingConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsServingConfigsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -10852,21 +13887,21 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) IfNoneMatch(entityTag strin // 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 *ProjectsLocationsCatalogsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsGetCall { +func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsGetCall { 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 *ProjectsLocationsCatalogsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsGetCall) 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_ { @@ -10892,14 +13927,14 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*htt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "retail.projects.locations.catalogs.servingConfigs.get" call. +// Exactly one of *GoogleCloudRetailV2ServingConfig or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2ServingConfig.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 *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ServingConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10918,7 +13953,7 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudRetailV2ServingConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10930,25 +13965,25 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/operations/{operationsId}", + // "description": "Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}", // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.operations.get", + // "id": "retail.projects.locations.catalogs.servingConfigs.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The resource name of the ServingConfig to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v2/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10957,52 +13992,40 @@ func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOp } -// method id "retail.projects.locations.catalogs.operations.list": +// method id "retail.projects.locations.catalogs.servingConfigs.list": -type ProjectsLocationsCatalogsOperationsListCall struct { +type ProjectsLocationsCatalogsServingConfigsListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to -// override the binding to use different resource name schemes, such as -// `users/*/operations`. To override the binding, API services can add a -// binding such as "/v1/{name=users/*}/operations" to their service -// configuration. For backwards compatibility, the default name includes -// the operations collection id, however overriding users must ensure -// the name binding is the parent resource, without the operations -// collection id. +// List: Lists all ServingConfigs linked to this catalog. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCatalogsOperationsService) List(name string) *ProjectsLocationsCatalogsOperationsListCall { - c := &ProjectsLocationsCatalogsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCatalogsOperationsListCall) Filter(filter string) *ProjectsLocationsCatalogsOperationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The catalog resource name. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. +func (r *ProjectsLocationsCatalogsServingConfigsService) List(parent string) *ProjectsLocationsCatalogsServingConfigsListCall { + c := &ProjectsLocationsCatalogsServingConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCatalogsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsOperationsListCall { +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 100. If a value +// greater than 100 is provided, at most 100 results are returned. +func (c *ProjectsLocationsCatalogsServingConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsServingConfigsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCatalogsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsOperationsListCall { +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListServingConfigs` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsCatalogsServingConfigsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsServingConfigsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -11010,7 +14033,7 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) PageToken(pageToken string // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsListCall { +func (c *ProjectsLocationsCatalogsServingConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11020,7 +14043,7 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) Fields(s ...googleapi.Fiel // 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 *ProjectsLocationsCatalogsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsListCall { +func (c *ProjectsLocationsCatalogsServingConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsServingConfigsListCall { c.ifNoneMatch_ = entityTag return c } @@ -11028,21 +14051,21 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) IfNoneMatch(entityTag stri // 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 *ProjectsLocationsCatalogsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsListCall { +func (c *ProjectsLocationsCatalogsServingConfigsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsListCall { 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 *ProjectsLocationsCatalogsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsListCall) 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_ { @@ -11055,7 +14078,7 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*ht var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/servingConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11063,20 +14086,21 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*ht } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "retail.projects.locations.catalogs.servingConfigs.list" call. +// Exactly one of *GoogleCloudRetailV2ListServingConfigsResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRetailV2ListServingConfigsResponse.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 *ProjectsLocationsCatalogsServingConfigsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ListServingConfigsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11095,7 +14119,7 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudRetailV2ListServingConfigsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11107,41 +14131,36 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/operations", + // "description": "Lists all ServingConfigs linked to this catalog.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs", // "httpMethod": "GET", - // "id": "retail.projects.locations.catalogs.operations.list", + // "id": "retail.projects.locations.catalogs.servingConfigs.list", // "parameterOrder": [ - // "name" - // ], - // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", - // "required": true, - // "type": "string" - // }, + // "parent" + // ], + // "parameters": { // "pageSize": { - // "description": "The standard list page size.", + // "description": "Optional. Maximum number of results to return. If unspecified, defaults to 100. If a value greater than 100 is provided, at most 100 results are returned.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The standard list page token.", + // "description": "Optional. A page token, received from a previous `ListServingConfigs` call. Provide this to retrieve the subsequent page.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v2/{+name}/operations", + // "path": "v2/{+parent}/servingConfigs", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudRetailV2ListServingConfigsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11153,7 +14172,7 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallO // 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 *ProjectsLocationsCatalogsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsCatalogsServingConfigsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2ListServingConfigsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -11171,43 +14190,41 @@ func (c *ProjectsLocationsCatalogsOperationsListCall) Pages(ctx context.Context, } } -// method id "retail.projects.locations.catalogs.placements.predict": +// method id "retail.projects.locations.catalogs.servingConfigs.patch": -type ProjectsLocationsCatalogsPlacementsPredictCall struct { - s *Service - placement string - googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsServingConfigsPatchCall struct { + s *Service + name string + googlecloudretailv2servingconfig *GoogleCloudRetailV2ServingConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Predict: Makes a recommendation prediction. +// Patch: Updates a ServingConfig. // -// - placement: Full resource name of the format: -// `{placement=projects/*/locations/global/catalogs/default_catalog/ser -// vingConfigs/*}` or -// `{placement=projects/*/locations/global/catalogs/default_catalog/pla -// cements/*}`. 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 - c.googlecloudretailv2predictrequest = googlecloudretailv2predictrequest +// - name: Immutable. Fully qualified name +// `projects/*/locations/global/catalogs/*/servingConfig/*`. +func (r *ProjectsLocationsCatalogsServingConfigsService) Patch(name string, googlecloudretailv2servingconfig *GoogleCloudRetailV2ServingConfig) *ProjectsLocationsCatalogsServingConfigsPatchCall { + c := &ProjectsLocationsCatalogsServingConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2servingconfig = googlecloudretailv2servingconfig + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided ServingConfig to update. The following are NOT +// supported: * ServingConfig.name If not set, all supported fields are +// updated. +func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsServingConfigsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsPredictCall { +func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11215,21 +14232,21 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Fields(s ...googleapi.F // 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 *ProjectsLocationsCatalogsPlacementsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsPredictCall { +func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPatchCall { 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 *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) 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_ { @@ -11237,35 +14254,34 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) ( } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2servingconfig) 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 := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "placement": c.placement, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.placements.predict" call. -// Exactly one of *GoogleCloudRetailV2PredictResponse or error will be +// Do executes the "retail.projects.locations.catalogs.servingConfigs.patch" call. +// Exactly one of *GoogleCloudRetailV2ServingConfig 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 *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2PredictResponse, error) { +// either *GoogleCloudRetailV2ServingConfig.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 *ProjectsLocationsCatalogsServingConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ServingConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11284,7 +14300,7 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2PredictResponse{ + ret := &GoogleCloudRetailV2ServingConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11296,28 +14312,34 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Makes a recommendation prediction.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:predict", - // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.placements.predict", + // "description": "Updates a ServingConfig.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}", + // "httpMethod": "PATCH", + // "id": "retail.projects.locations.catalogs.servingConfigs.patch", // "parameterOrder": [ - // "placement" + // "name" // ], // "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", + // "name": { + // "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/servingConfig/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided ServingConfig to update. The following are NOT supported: * ServingConfig.name If not set, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "v2/{+placement}:predict", + // "path": "v2/{+name}", // "request": { - // "$ref": "GoogleCloudRetailV2PredictRequest" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "response": { - // "$ref": "GoogleCloudRetailV2PredictResponse" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11326,41 +14348,43 @@ func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.Ca } -// method id "retail.projects.locations.catalogs.placements.search": +// method id "retail.projects.locations.catalogs.servingConfigs.predict": -type ProjectsLocationsCatalogsPlacementsSearchCall struct { - s *Service - placement string - googlecloudretailv2searchrequest *GoogleCloudRetailV2SearchRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsServingConfigsPredictCall struct { + s *Service + placement string + googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest + 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. +// Predict: Makes a recommendation prediction. // -// - 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 *ProjectsLocationsCatalogsPlacementsService) Search(placement string, googlecloudretailv2searchrequest *GoogleCloudRetailV2SearchRequest) *ProjectsLocationsCatalogsPlacementsSearchCall { - c := &ProjectsLocationsCatalogsPlacementsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - placement: Full resource name of the format: +// `{placement=projects/*/locations/global/catalogs/default_catalog/ser +// vingConfigs/*}` or +// `{placement=projects/*/locations/global/catalogs/default_catalog/pla +// cements/*}`. 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.googlecloudretailv2searchrequest = googlecloudretailv2searchrequest + 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 *ProjectsLocationsCatalogsPlacementsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsSearchCall { +func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPredictCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11368,21 +14392,21 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Fields(s ...googleapi.Fi // 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 *ProjectsLocationsCatalogsPlacementsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsSearchCall { +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 *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { +func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (*http.Response, error) { +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_ { @@ -11390,14 +14414,14 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (* } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2searchrequest) + 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}:search") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+placement}:predict") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -11410,15 +14434,15 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "retail.projects.locations.catalogs.placements.search" call. -// Exactly one of *GoogleCloudRetailV2SearchResponse or error will be +// 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 *GoogleCloudRetailV2SearchResponse.ServerResponse.Header or +// 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 *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2SearchResponse, error) { +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 { @@ -11437,7 +14461,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2SearchResponse{ + ret := &GoogleCloudRetailV2PredictResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11449,28 +14473,28 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal } 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}/placements/{placementsId}:search", + // "description": "Makes a recommendation prediction.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.placements.search", + // "id": "retail.projects.locations.catalogs.servingConfigs.predict", // "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.", + // "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/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+placement}:search", + // "path": "v2/{+placement}:predict", // "request": { - // "$ref": "GoogleCloudRetailV2SearchRequest" + // "$ref": "GoogleCloudRetailV2PredictRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2SearchResponse" + // "$ref": "GoogleCloudRetailV2PredictResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11479,64 +14503,35 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal } -// 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 *ProjectsLocationsCatalogsPlacementsSearchCall) 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.servingConfigs.predict": +// method id "retail.projects.locations.catalogs.servingConfigs.removeControl": -type ProjectsLocationsCatalogsServingConfigsPredictCall struct { - s *Service - placement string - googlecloudretailv2predictrequest *GoogleCloudRetailV2PredictRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { + s *Service + servingConfig string + googlecloudretailv2removecontrolrequest *GoogleCloudRetailV2RemoveControlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Predict: Makes a recommendation prediction. +// RemoveControl: 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. // -// - placement: Full resource name of the format: -// `{placement=projects/*/locations/global/catalogs/default_catalog/ser -// vingConfigs/*}` or -// `{placement=projects/*/locations/global/catalogs/default_catalog/pla -// cements/*}`. 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 +// - servingConfig: The source ServingConfig resource name . Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. +func (r *ProjectsLocationsCatalogsServingConfigsService) RemoveControl(servingConfig string, googlecloudretailv2removecontrolrequest *GoogleCloudRetailV2RemoveControlRequest) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { + c := &ProjectsLocationsCatalogsServingConfigsRemoveControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googlecloudretailv2removecontrolrequest = googlecloudretailv2removecontrolrequest 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 { +func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11544,21 +14539,21 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googlea // 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 { +func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 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 { +func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) 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_ { @@ -11566,14 +14561,14 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt strin } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2predictrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2removecontrolrequest) 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 := googleapi.ResolveRelative(c.s.BasePath, "v2/{+servingConfig}:removeControl") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -11581,20 +14576,19 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt strin } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "placement": c.placement, + "servingConfig": c.servingConfig, }) 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 +// Do executes the "retail.projects.locations.catalogs.servingConfigs.removeControl" call. +// Exactly one of *GoogleCloudRetailV2ServingConfig 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) { +// either *GoogleCloudRetailV2ServingConfig.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 *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2ServingConfig, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11613,7 +14607,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleap if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GoogleCloudRetailV2PredictResponse{ + ret := &GoogleCloudRetailV2ServingConfig{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11625,28 +14619,28 @@ func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleap } return ret, nil // { - // "description": "Makes a recommendation prediction.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:predict", + // "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": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/servingConfigs/{servingConfigsId}:removeControl", // "httpMethod": "POST", - // "id": "retail.projects.locations.catalogs.servingConfigs.predict", + // "id": "retail.projects.locations.catalogs.servingConfigs.removeControl", // "parameterOrder": [ - // "placement" + // "servingConfig" // ], // "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", + // "servingConfig": { + // "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+placement}:predict", + // "path": "v2/{+servingConfig}:removeControl", // "request": { - // "$ref": "GoogleCloudRetailV2PredictRequest" + // "$ref": "GoogleCloudRetailV2RemoveControlRequest" // }, // "response": { - // "$ref": "GoogleCloudRetailV2PredictResponse" + // "$ref": "GoogleCloudRetailV2ServingConfig" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -11667,8 +14661,8 @@ type ProjectsLocationsCatalogsServingConfigsSearchCall struct { } // 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. +// who have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - placement: The resource name of the Retail Search serving config, // such as @@ -11778,7 +14772,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi } 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.", + // "description": "Performs a search. This feature is only available for users who have Retail Search enabled. 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", @@ -12324,15 +15318,15 @@ type ProjectsLocationsCatalogsUserEventsRejoinCall struct { header_ http.Header } -// Rejoin: Starts a user event rejoin operation with latest product -// catalog. Events will not be annotated with detailed product -// information if product is missing from the catalog at the time the -// user event is ingested, and these events are stored as unjoined -// events with a limited usage on training and serving. This method can -// be used to start a join operation on specified events with latest -// version of product catalog. It can also be used to correct events -// joined with the wrong product catalog. A rejoin operation can take -// hours or days to complete. +// Rejoin: Starts a user-event rejoin operation with latest product +// catalog. Events are not annotated with detailed product information +// for products that are missing from the catalog when the user event is +// ingested. These events are stored as unjoined events with limited +// usage on training and serving. You can use this method to start a +// join operation on specified events with the latest version of product +// catalog. You can also use this method to correct events joined with +// the wrong product catalog. A rejoin operation can take hours or days +// to complete. // // - parent: The parent catalog resource name, such as // `projects/1234/locations/global/catalogs/default_catalog`. @@ -12434,7 +15428,7 @@ func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + // "description": "Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.userEvents.rejoin", diff --git a/retail/v2alpha/retail-api.json b/retail/v2alpha/retail-api.json index 9c90b683b2c..806f4d56c2b 100644 --- a/retail/v2alpha/retail-api.json +++ b/retail/v2alpha/retail-api.json @@ -112,7 +112,7 @@ "catalogs": { "methods": { "completeQuery": { - "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:completeQuery", "httpMethod": "GET", "id": "retail.projects.locations.catalogs.completeQuery", @@ -203,7 +203,7 @@ ], "parameters": { "name": { - "description": "Required. Full CompletionConfig resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig", + "description": "Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", "required": true, @@ -558,10 +558,43 @@ } } }, + "places": { + "resources": { + "operations": { + "methods": { + "get": { + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/places/{placesId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "retail.projects.locations.catalogs.branches.places.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/places/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, "products": { "methods": { "addFulfillmentPlaces": { - "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", @@ -589,7 +622,7 @@ ] }, "addLocalInventories": { - "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addLocalInventories", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", @@ -847,7 +880,7 @@ ] }, "removeFulfillmentPlaces": { - "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", @@ -875,7 +908,7 @@ ] }, "removeLocalInventories": { - "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeLocalInventories", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", @@ -903,7 +936,7 @@ ] }, "setInventory": { - "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -937,7 +970,7 @@ "completionData": { "methods": { "import": { - "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionData:import", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.completionData.import", @@ -1036,7 +1069,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the Control to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", + "description": "Required. The resource name of the Control to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", "required": true, @@ -1052,7 +1085,7 @@ ] }, "list": { - "description": "Lists all Controls linked to this catalog.", + "description": "Lists all Controls by their parent Catalog.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", "httpMethod": "GET", "id": "retail.projects.locations.catalogs.controls.list", @@ -1093,7 +1126,7 @@ ] }, "patch": { - "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to delete does not exist, a NOT_FOUND error is returned.", + "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", "httpMethod": "PATCH", "id": "retail.projects.locations.catalogs.controls.patch", @@ -1145,7 +1178,7 @@ "type": "boolean" }, "parent": { - "description": "Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + "description": "Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", "required": true, @@ -1173,7 +1206,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the Model to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "Required. The resource name of the Model to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", "required": true, @@ -1209,7 +1242,7 @@ "type": "string" }, "parent": { - "description": "Required. The parent for which to list models. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + "description": "Required. The parent for which to list models. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", "required": true, @@ -1268,7 +1301,7 @@ ], "parameters": { "name": { - "description": "Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "Required. The name of the model to pause. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", "required": true, @@ -1296,7 +1329,7 @@ ], "parameters": { "name": { - "description": "Required. The name of the model to resume. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "Required. The name of the model to resume. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", "required": true, @@ -1324,7 +1357,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "Required. The resource name of the model to tune. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", "required": true, @@ -1445,7 +1478,7 @@ ] }, "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.", + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:search", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.placements.search", @@ -1486,7 +1519,7 @@ ], "parameters": { "servingConfig": { - "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1547,7 +1580,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The resource name of the ServingConfig to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1572,7 +1605,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The resource name of the ServingConfig to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1608,7 +1641,7 @@ "type": "string" }, "parent": { - "description": "Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", "required": true, @@ -1695,7 +1728,7 @@ ], "parameters": { "servingConfig": { - "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1714,7 +1747,7 @@ ] }, "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.", + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. 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", @@ -1843,7 +1876,7 @@ ] }, "rejoin": { - "description": "Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + "description": "Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.userEvents.rejoin", @@ -2047,7 +2080,7 @@ } } }, - "revision": "20220811", + "revision": "20220822", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2343,13 +2376,13 @@ "type": "object" }, "GoogleCloudRetailV2RejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2RejoinUserEventsMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2RejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2RejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -2968,7 +3001,7 @@ "type": "boolean" }, "value": { - "description": "The value of the term to match on. Value cannot be empty. Value can have at most 3 terms if specified as a partial match. Each space separated string is considered as one term. Example) \"a b c\" is 3 terms and allowed, \" a b c d\" is 4 terms and not allowed for partial match.", + "description": "The value of the term to match on. Value cannot be empty. Value can have at most 3 terms if specified as a partial match. Each space separated string is considered as one term. For example, \"a b c\" is 3 terms and allowed, but \" a b c d\" is 4 terms and not allowed for a partial match.", "type": "string" } }, @@ -2992,11 +3025,11 @@ "type": "object" }, "GoogleCloudRetailV2alphaControl": { - "description": "Configures dynamic serving time metadata that is used to pre and post process search/recommendation model results.", + "description": "Configures dynamic metadata that can be linked to a ServingConfig and affect search or recommendation results at serving time.", "id": "GoogleCloudRetailV2alphaControl", "properties": { "associatedServingConfigIds": { - "description": "Output only. List of serving configuration ids that that are associated with this control. Note the association is managed via the ServingConfig, this is an output only denormalizeed view. Assumed to be in the same catalog.", + "description": "Output only. List of serving configuration ids that are associated with this control in the same Catalog. Note the association is managed via the ServingConfig, this is an output only denormalized view.", "items": { "type": "string" }, @@ -3009,7 +3042,7 @@ }, "facetSpec": { "$ref": "GoogleCloudRetailV2alphaSearchRequestFacetSpec", - "description": "A facet specification to perform faceted search." + "description": "A facet specification to perform faceted search. Note that this field is deprecated and will throw NOT_IMPLEMENTED if used for creating a control." }, "name": { "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`", @@ -3019,8 +3052,25 @@ "$ref": "GoogleCloudRetailV2alphaRule", "description": "A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost \"gShoe\" when query full matches \"Running Shoes\"." }, + "searchSolutionUseCase": { + "description": "Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow one search_solution_use_case per control.", + "items": { + "enum": [ + "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED", + "SEARCH_SOLUTION_USE_CASE_SEARCH", + "SEARCH_SOLUTION_USE_CASE_BROWSE" + ], + "enumDescriptions": [ + "The value when it's unspecified. In this case, server behavior defaults to SEARCH_SOLUTION_USE_CASE_SEARCH.", + "Search use case. Expects the traffic has a non-empty query.", + "Browse use case. Expects the traffic has an empty query." + ], + "type": "string" + }, + "type": "array" + }, "solutionTypes": { - "description": "Required. Immutable. The solution types that the serving config is used for. Currently we support setting only one type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.", + "description": "Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.", "items": { "enum": [ "SOLUTION_TYPE_UNSPECIFIED", @@ -3044,7 +3094,7 @@ "id": "GoogleCloudRetailV2alphaCreateModelMetadata", "properties": { "model": { - "description": "The resource name of the model that this create applies to. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "The resource name of the model that this create applies to. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "type": "string" } }, @@ -3092,7 +3142,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaExportMetadata": { - "description": "Metadata related to the progress of the Export operation. This will be returned by the google.longrunning.Operation.metadata field.", + "description": "Metadata related to the progress of the Export operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudRetailV2alphaExportMetadata", "properties": { "createTime": { @@ -4038,7 +4088,7 @@ "type": "array" }, "categories": { - "description": "Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both [\"Shoes \u0026 Accessories\" -\u003e \"Shoes\"] and [\"Sports \u0026 Fitness\" -\u003e \"Athletic Clothing\" -\u003e \"Shoes\"], it could be represented as: \"categories\": [ \"Shoes \u0026 Accessories \u003e Shoes\", \"Sports \u0026 Fitness \u003e Athletic Clothing \u003e Shoes\" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436", + "description": "Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). For example, if a shoes product belongs to both [\"Shoes \u0026 Accessories\" -\u003e \"Shoes\"] and [\"Sports \u0026 Fitness\" -\u003e \"Athletic Clothing\" -\u003e \"Shoes\"], it could be represented as: \"categories\": [ \"Shoes \u0026 Accessories \u003e Shoes\", \"Sports \u0026 Fitness \u003e Athletic Clothing \u003e Shoes\" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436", "items": { "type": "string" }, @@ -4097,6 +4147,14 @@ "description": "Language of the title/description and other string attributes. Use language tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to \"en-US\" if unset.", "type": "string" }, + "localInventories": { + "description": "Output only. A list of local inventories specific to different places. This is only available for users who have Retail Search enabled, and it can be managed by AddLocalInventories and RemoveLocalInventories APIs.", + "items": { + "$ref": "GoogleCloudRetailV2alphaLocalInventory" + }, + "readOnly": true, + "type": "array" + }, "materials": { "description": "The material of the product. For example, \"leather\", \"wooden\". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [material](https://support.google.com/merchants/answer/6324410). Schema.org property [Product.material](https://schema.org/material).", "items": { @@ -4423,7 +4481,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaRejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2alphaRejoinUserEventsMetadata", "properties": {}, "type": "object" @@ -4433,7 +4491,7 @@ "id": "GoogleCloudRetailV2alphaRejoinUserEventsRequest", "properties": { "userEventRejoinScope": { - "description": "The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an invalid integer value.", + "description": "The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to an invalid integer value.", "enum": [ "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED", "JOINED_EVENTS", @@ -4450,7 +4508,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaRejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2alphaRejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -4580,7 +4638,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaRule": { - "description": "A rule is a condition-action pair * A condition defines when a rule is to be triggered. * An action specifies what occurs on that trigger. Currently only boost rules are supported. Currently only supported by the search endpoint.", + "description": "A rule is a condition-action pair * A condition defines when a rule is to be triggered. * An action specifies what occurs on that trigger. Currently rules only work for controls with SOLUTION_TYPE_SEARCH.", "id": "GoogleCloudRetailV2alphaRule", "properties": { "boostAction": { @@ -4814,7 +4872,7 @@ "type": "string" }, "pageCategories": { - "description": "The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"].", + "description": "The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"].", "items": { "type": "string" }, @@ -4831,7 +4889,7 @@ }, "personalizationSpec": { "$ref": "GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec", - "description": "The specification for personalization." + "description": "The specification for personalization. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec." }, "query": { "description": "Raw search query. If this field is empty, the request is considered a category browsing request and returned results are based on filter and page_categories.", @@ -4867,9 +4925,9 @@ "FACETED_SEARCH_ONLY" ], "enumDescriptions": [ - "Default value. In this case both product search and faceted search will be performed. Both [SearchResponse.SearchResult] and [SearchResponse.Facet] will be returned.", - "Only product search will be performed. The faceted search will be disabled. Only [SearchResponse.SearchResult] will be returned. [SearchResponse.Facet] will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", - "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." + "Default value. In this case both product search and faceted search will be performed. Both SearchResponse.SearchResult and SearchResponse.Facet will be returned.", + "Only product search will be performed. The faceted search will be disabled. Only SearchResponse.SearchResult will be returned. SearchResponse.Facet will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", + "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only SearchResponse.Facet will be returned. SearchResponse.SearchResult will not be returned." ], "type": "string" }, @@ -5270,7 +5328,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaServingConfig": { - "description": "Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions). The ServingConfig is passed in the search and predict request and together with the Catalog.default_branch, generates results.", + "description": "Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions).", "id": "GoogleCloudRetailV2alphaServingConfig", "properties": { "boostControlIds": { @@ -5285,7 +5343,21 @@ "type": "string" }, "diversityLevel": { - "description": "How much diversity to use in recommendation model results e.g. 'medium-diversity' or 'high-diversity'. Currently supported values: * 'no-diversity' * 'low-diversity' * 'medium-diversity' * 'high-diversity' * 'auto-diversity' If not specified, we choose default based on recommendation model type. Default value: 'no-diversity'. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "type": "string" + }, + "diversityType": { + "description": "What kind of diversity to use - data driven or rule based.", + "enum": [ + "DIVERSITY_TYPE_UNSPECIFIED", + "RULE_BASED_DIVERSITY", + "DATA_DRIVEN_DIVERSITY" + ], + "enumDescriptions": [ + "Default value.", + "Rule based diversity.", + "Data driven diversity." + ], "type": "string" }, "doNotAssociateControlIds": { @@ -5300,7 +5372,7 @@ "description": "The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated. Can only be set if solution_types is SOLUTION_TYPE_SEARCH." }, "enableCategoryFilterLevel": { - "description": "Whether to add additional category filters on the 'similar-items' model. If not specified, we enable it by default. Allowed values are: * 'no-category-match': No additional filtering of original results from the model and the customer's filters. * 'relaxed-category-match': Only keep results with categories that match at least one item categories in the PredictRequests's context item. * If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match). Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "Whether to add additional category filters on the `similar-items` model. If not specified, we enable it by default. Allowed values are: * `no-category-match`: No additional filtering of original results from the model and the customer's filters. * `relaxed-category-match`: Only keep results with categories that match at least one item categories in the PredictRequests's context item. * If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match). Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", "type": "string" }, "facetControlIds": { @@ -5325,7 +5397,7 @@ "type": "array" }, "modelId": { - "description": "The id of the model to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.", "type": "string" }, "name": { @@ -5339,8 +5411,12 @@ }, "type": "array" }, + "personalizationSpec": { + "$ref": "GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec", + "description": "The specification for personalization spec. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec." + }, "priceRerankingLevel": { - "description": "How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are: * 'no-price-reranking' * 'low-price-raranking' * 'medium-price-reranking' * 'high-price-reranking' If not specified, we choose default based on model type. Default value: 'no-price-reranking'. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are: * `no-price-reranking` * `low-price-raranking` * `medium-price-reranking` * `high-price-reranking` If not specified, we choose default based on model type. Default value: `no-price-reranking`. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", "type": "string" }, "redirectControlIds": { @@ -5462,7 +5538,7 @@ "id": "GoogleCloudRetailV2alphaTuneModelMetadata", "properties": { "model": { - "description": "The resource name of the model that this tune applies to. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "The resource name of the model that this tune applies to. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "type": "string" } }, @@ -5533,7 +5609,7 @@ "type": "string" }, "pageCategories": { - "description": "The categories associated with a category page. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.", + "description": "The categories associated with a category page. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.", "items": { "type": "string" }, @@ -5705,7 +5781,7 @@ "type": "object" }, "GoogleCloudRetailV2betaExportMetadata": { - "description": "Metadata related to the progress of the Export operation. This will be returned by the google.longrunning.Operation.metadata field.", + "description": "Metadata related to the progress of the Export operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudRetailV2betaExportMetadata", "properties": { "createTime": { @@ -5898,13 +5974,13 @@ "type": "object" }, "GoogleCloudRetailV2betaRejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2betaRejoinUserEventsMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaRejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2betaRejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 7bf91d811a9..e599033ec07 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -215,6 +215,7 @@ type ProjectsLocationsCatalogsAttributesConfigService struct { func NewProjectsLocationsCatalogsBranchesService(s *Service) *ProjectsLocationsCatalogsBranchesService { rs := &ProjectsLocationsCatalogsBranchesService{s: s} rs.Operations = NewProjectsLocationsCatalogsBranchesOperationsService(s) + rs.Places = NewProjectsLocationsCatalogsBranchesPlacesService(s) rs.Products = NewProjectsLocationsCatalogsBranchesProductsService(s) return rs } @@ -224,6 +225,8 @@ type ProjectsLocationsCatalogsBranchesService struct { Operations *ProjectsLocationsCatalogsBranchesOperationsService + Places *ProjectsLocationsCatalogsBranchesPlacesService + Products *ProjectsLocationsCatalogsBranchesProductsService } @@ -236,6 +239,27 @@ type ProjectsLocationsCatalogsBranchesOperationsService struct { s *Service } +func NewProjectsLocationsCatalogsBranchesPlacesService(s *Service) *ProjectsLocationsCatalogsBranchesPlacesService { + rs := &ProjectsLocationsCatalogsBranchesPlacesService{s: s} + rs.Operations = NewProjectsLocationsCatalogsBranchesPlacesOperationsService(s) + return rs +} + +type ProjectsLocationsCatalogsBranchesPlacesService struct { + s *Service + + Operations *ProjectsLocationsCatalogsBranchesPlacesOperationsService +} + +func NewProjectsLocationsCatalogsBranchesPlacesOperationsService(s *Service) *ProjectsLocationsCatalogsBranchesPlacesOperationsService { + rs := &ProjectsLocationsCatalogsBranchesPlacesOperationsService{s: s} + return rs +} + +type ProjectsLocationsCatalogsBranchesPlacesOperationsService struct { + s *Service +} + func NewProjectsLocationsCatalogsBranchesProductsService(s *Service) *ProjectsLocationsCatalogsBranchesProductsService { rs := &ProjectsLocationsCatalogsBranchesProductsService{s: s} return rs @@ -879,12 +903,12 @@ func (s *GoogleCloudRetailV2PurgeUserEventsResponse) MarshalJSON() ([]byte, erro } // GoogleCloudRetailV2RejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2RejoinUserEventsMetadata struct { } // GoogleCloudRetailV2RejoinUserEventsResponse: Response message for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2RejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -2034,9 +2058,9 @@ type GoogleCloudRetailV2alphaConditionQueryTerm struct { // Value: The value of the term to match on. Value cannot be empty. // Value can have at most 3 terms if specified as a partial match. Each - // space separated string is considered as one term. Example) "a b c" is - // 3 terms and allowed, " a b c d" is 4 terms and not allowed for - // partial match. + // space separated string is considered as one term. For example, "a b + // c" is 3 terms and allowed, but " a b c d" is 4 terms and not allowed + // for a partial match. Value string `json:"value,omitempty"` // ForceSendFields is a list of field names (e.g. "FullMatch") to @@ -2094,14 +2118,14 @@ func (s *GoogleCloudRetailV2alphaConditionTimeRange) MarshalJSON() ([]byte, erro return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2alphaControl: Configures dynamic serving time -// metadata that is used to pre and post process search/recommendation -// model results. +// GoogleCloudRetailV2alphaControl: Configures dynamic metadata that can +// be linked to a ServingConfig and affect search or recommendation +// results at serving time. type GoogleCloudRetailV2alphaControl struct { // AssociatedServingConfigIds: Output only. List of serving - // configuration ids that that are associated with this control. Note - // the association is managed via the ServingConfig, this is an output - // only denormalizeed view. Assumed to be in the same catalog. + // configuration ids that are associated with this control in the same + // Catalog. Note the association is managed via the ServingConfig, this + // is an output only denormalized view. AssociatedServingConfigIds []string `json:"associatedServingConfigIds,omitempty"` // DisplayName: Required. The human readable control display name. Used @@ -2110,7 +2134,9 @@ type GoogleCloudRetailV2alphaControl struct { // thrown. DisplayName string `json:"displayName,omitempty"` - // FacetSpec: A facet specification to perform faceted search. + // FacetSpec: A facet specification to perform faceted search. Note that + // this field is deprecated and will throw NOT_IMPLEMENTED if used for + // creating a control. FacetSpec *GoogleCloudRetailV2alphaSearchRequestFacetSpec `json:"facetSpec,omitempty"` // Name: Immutable. Fully qualified name @@ -2122,11 +2148,27 @@ type GoogleCloudRetailV2alphaControl struct { // query full matches "Running Shoes". Rule *GoogleCloudRetailV2alphaRule `json:"rule,omitempty"` + // SearchSolutionUseCase: Specifies the use case for the control. + // Affects what condition fields can be set. Only settable by search + // controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not + // specified. Currently only allow one search_solution_use_case per + // control. + // + // Possible values: + // "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED" - The value when it's + // unspecified. In this case, server behavior defaults to + // SEARCH_SOLUTION_USE_CASE_SEARCH. + // "SEARCH_SOLUTION_USE_CASE_SEARCH" - Search use case. Expects the + // traffic has a non-empty query. + // "SEARCH_SOLUTION_USE_CASE_BROWSE" - Browse use case. Expects the + // traffic has an empty query. + SearchSolutionUseCase []string `json:"searchSolutionUseCase,omitempty"` + // SolutionTypes: Required. Immutable. The solution types that the - // serving config is used for. Currently we support setting only one - // type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value - // is supported at the moment. If no solution type is provided at - // creation time, will default to SOLUTION_TYPE_SEARCH. + // control is used for. Currently we support setting only one type of + // solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is + // supported at the moment. If no solution type is provided at creation + // time, will default to SOLUTION_TYPE_SEARCH. // // Possible values: // "SOLUTION_TYPE_UNSPECIFIED" - Default value. @@ -2168,8 +2210,8 @@ func (s *GoogleCloudRetailV2alphaControl) MarshalJSON() ([]byte, error) { type GoogleCloudRetailV2alphaCreateModelMetadata struct { // Model: The resource name of the model that this create applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id - // }/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` Model string `json:"model,omitempty"` // ForceSendFields is a list of field names (e.g. "Model") to @@ -2289,7 +2331,7 @@ func (s *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, erro } // GoogleCloudRetailV2alphaExportMetadata: Metadata related to the -// progress of the Export operation. This will be returned by the +// progress of the Export operation. This is returned by the // google.longrunning.Operation.metadata field. type GoogleCloudRetailV2alphaExportMetadata struct { // CreateTime: Operation create time. @@ -4116,12 +4158,12 @@ type GoogleCloudRetailV2alphaProduct struct { // one product belonging to several parallel categories. Strongly // recommended using the full path for better search / recommendation // quality. To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). For example, if a shoes product - // belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & - // Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented - // as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness - // > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product + // different hierarchies. If '>' is part of the category name, replace + // it with other character(s). For example, if a shoes product belongs + // to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> + // "Athletic Clothing" -> "Shoes"], it could be represented as: + // "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > + // Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product // otherwise an INVALID_ARGUMENT error is returned. At most 250 values // are allowed per Product. Empty values are not allowed. Each value // must be a UTF-8 encoded string with a length limit of 5,000 @@ -4222,6 +4264,12 @@ type GoogleCloudRetailV2alphaProduct struct { // search this field is in use. It defaults to "en-US" if unset. LanguageCode string `json:"languageCode,omitempty"` + // LocalInventories: Output only. A list of local inventories specific + // to different places. This is only available for users who have Retail + // Search enabled, and it can be managed by AddLocalInventories and + // RemoveLocalInventories APIs. + LocalInventories []*GoogleCloudRetailV2alphaLocalInventory `json:"localInventories,omitempty"` + // Materials: The material of the product. For example, "leather", // "wooden". A maximum of 20 values are allowed. Each value must be a // UTF-8 encoded string with a length limit of 200 characters. @@ -4936,7 +4984,7 @@ func (s *GoogleCloudRetailV2alphaRating) UnmarshalJSON(data []byte) error { } // GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { } @@ -4945,7 +4993,7 @@ type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { type GoogleCloudRetailV2alphaRejoinUserEventsRequest struct { // UserEventRejoinScope: The type of the user event rejoin to define the // scope and range of the user events to be rejoined with the latest - // product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if + // product catalog. Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if // this field is not set, or set to an invalid integer value. // // Possible values: @@ -4984,7 +5032,7 @@ func (s *GoogleCloudRetailV2alphaRejoinUserEventsRequest) MarshalJSON() ([]byte, } // GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message -// for RejoinUserEvents method. +// for `RejoinUserEvents` method. type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -5242,8 +5290,8 @@ type GoogleCloudRetailV2alphaResumeModelRequest struct { // GoogleCloudRetailV2alphaRule: A rule is a condition-action pair * A // condition defines when a rule is to be triggered. * An action -// specifies what occurs on that trigger. Currently only boost rules are -// supported. Currently only supported by the search endpoint. +// specifies what occurs on that trigger. Currently rules only work for +// controls with SOLUTION_TYPE_SEARCH. type GoogleCloudRetailV2alphaRule struct { // BoostAction: A boost action. BoostAction *GoogleCloudRetailV2alphaRuleBoostAction `json:"boostAction,omitempty"` @@ -5700,11 +5748,11 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // Required for category navigation queries to achieve good search // quality. The format should be the same as UserEvent.page_categories; // To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). Category pages include special - // pages such as sales or promotions. For instance, a special sale page - // may have the category hierarchy: "pageCategories" : ["Sales > 2017 - // Black Friday Deals"]. + // different hierarchies. If '>' is part of the category name, replace + // it with other character(s). Category pages include special pages such + // as sales or promotions. For instance, a special sale page may have + // the category hierarchy: "pageCategories" : ["Sales > 2017 Black + // Friday Deals"]. PageCategories []string `json:"pageCategories,omitempty"` // PageSize: Maximum number of Products to return. If unspecified, @@ -5720,7 +5768,11 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // token. Otherwise, an INVALID_ARGUMENT error is returned. PageToken string `json:"pageToken,omitempty"` - // PersonalizationSpec: The specification for personalization. + // PersonalizationSpec: The specification for personalization. Notice + // that if both ServingConfig.personalization_spec and + // SearchRequest.personalization_spec are set. + // SearchRequest.personalization_spec will override + // ServingConfig.personalization_spec. PersonalizationSpec *GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` // Query: Raw search query. If this field is empty, the request is @@ -5756,19 +5808,18 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // Possible values: // "SEARCH_MODE_UNSPECIFIED" - Default value. In this case both // product search and faceted search will be performed. Both - // [SearchResponse.SearchResult] and [SearchResponse.Facet] will be + // SearchResponse.SearchResult and SearchResponse.Facet will be // returned. // "PRODUCT_SEARCH_ONLY" - Only product search will be performed. The - // faceted search will be disabled. Only [SearchResponse.SearchResult] - // will be returned. [SearchResponse.Facet] will not be returned, even - // if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is - // set. + // faceted search will be disabled. Only SearchResponse.SearchResult + // will be returned. SearchResponse.Facet will not be returned, even if + // SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set. // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The // product search will be disabled. When in this mode, one or both of // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - // [SearchResponse.Facet] will be returned. - // [SearchResponse.SearchResult] will not be returned. + // SearchResponse.Facet will be returned. SearchResponse.SearchResult + // will not be returned. SearchMode string `json:"searchMode,omitempty"` // SpellCorrectionSpec: The spell correction specification that @@ -6573,9 +6624,7 @@ func (s *GoogleCloudRetailV2alphaSearchResponseSearchResult) MarshalJSON() ([]by // GoogleCloudRetailV2alphaServingConfig: Configures metadata that is // used to generate serving time results (e.g. search results or -// recommendation predictions). The ServingConfig is passed in the -// search and predict request and together with the -// Catalog.default_branch, generates results. +// recommendation predictions). type GoogleCloudRetailV2alphaServingConfig struct { // BoostControlIds: Condition boost specifications. If a product matches // multiple conditions in the specifications, boost scores from these @@ -6596,14 +6645,23 @@ type GoogleCloudRetailV2alphaServingConfig struct { DisplayName string `json:"displayName,omitempty"` // DiversityLevel: How much diversity to use in recommendation model - // results e.g. 'medium-diversity' or 'high-diversity'. Currently - // supported values: * 'no-diversity' * 'low-diversity' * - // 'medium-diversity' * 'high-diversity' * 'auto-diversity' If not + // results e.g. `medium-diversity` or `high-diversity`. Currently + // supported values: * `no-diversity` * `low-diversity` * + // `medium-diversity` * `high-diversity` * `auto-diversity` If not // specified, we choose default based on recommendation model type. - // Default value: 'no-diversity'. Can only be set if solution_types is + // Default value: `no-diversity`. Can only be set if solution_types is // SOLUTION_TYPE_RECOMMENDATION. DiversityLevel string `json:"diversityLevel,omitempty"` + // DiversityType: What kind of diversity to use - data driven or rule + // based. + // + // Possible values: + // "DIVERSITY_TYPE_UNSPECIFIED" - Default value. + // "RULE_BASED_DIVERSITY" - Rule based diversity. + // "DATA_DRIVEN_DIVERSITY" - Data driven diversity. + DiversityType string `json:"diversityType,omitempty"` + // DoNotAssociateControlIds: Condition do not associate specifications. // If multiple do not associate conditions match, all matching do not // associate controls in the list will execute. - Order does not matter. @@ -6617,10 +6675,10 @@ type GoogleCloudRetailV2alphaServingConfig struct { DynamicFacetSpec *GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` // EnableCategoryFilterLevel: Whether to add additional category filters - // on the 'similar-items' model. If not specified, we enable it by - // default. Allowed values are: * 'no-category-match': No additional + // on the `similar-items` model. If not specified, we enable it by + // default. Allowed values are: * `no-category-match`: No additional // filtering of original results from the model and the customer's - // filters. * 'relaxed-category-match': Only keep results with + // filters. * `relaxed-category-match`: Only keep results with // categories that match at least one item categories in the // PredictRequests's context item. * If customer also sends filters in // the PredictRequest, then the results will satisfy both conditions @@ -6649,8 +6707,8 @@ type GoogleCloudRetailV2alphaServingConfig struct { // is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. IgnoreControlIds []string `json:"ignoreControlIds,omitempty"` - // ModelId: The id of the model to use at serving time. Currently only - // RecommendationModels are supported: + // ModelId: The id of the model in the same Catalog to use at serving + // time. Currently only RecommendationModels are supported: // https://cloud.google.com/retail/recommendations-ai/docs/create-models // Can be changed but only to a compatible model (e.g. // others-you-may-like CTR to others-you-may-like CVR). Required when @@ -6668,15 +6726,23 @@ type GoogleCloudRetailV2alphaServingConfig struct { // only be set if solution_types is SOLUTION_TYPE_SEARCH. OnewaySynonymsControlIds []string `json:"onewaySynonymsControlIds,omitempty"` + // PersonalizationSpec: The specification for personalization spec. Can + // only be set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if + // both ServingConfig.personalization_spec and + // SearchRequest.personalization_spec are set. + // SearchRequest.personalization_spec will override + // ServingConfig.personalization_spec. + PersonalizationSpec *GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` + // PriceRerankingLevel: How much price ranking we want in serving // results. Price reranking causes product items with a similar // recommendation probability to be ordered by price, with the // highest-priced items first. This setting could result in a decrease // in click-through and conversion rates. Allowed values are: * - // 'no-price-reranking' * 'low-price-raranking' * - // 'medium-price-reranking' * 'high-price-reranking' If not specified, + // `no-price-reranking` * `low-price-raranking` * + // `medium-price-reranking` * `high-price-reranking` If not specified, // we choose default based on model type. Default value: - // 'no-price-reranking'. Can only be set if solution_types is + // `no-price-reranking`. Can only be set if solution_types is // SOLUTION_TYPE_RECOMMENDATION. PriceRerankingLevel string `json:"priceRerankingLevel,omitempty"` @@ -6910,8 +6976,8 @@ func (s *GoogleCloudRetailV2alphaTransformedUserEventsMetadata) MarshalJSON() ([ type GoogleCloudRetailV2alphaTuneModelMetadata struct { // Model: The resource name of the model that this tune applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id - // }/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` Model string `json:"model,omitempty"` // ForceSendFields is a list of field names (e.g. "Model") to @@ -7043,8 +7109,8 @@ type GoogleCloudRetailV2alphaUserEvent struct { // PageCategories: The categories associated with a category page. To // represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it - // with other character(s). Category pages include special pages such as + // hierarchies. If '>' is part of the category name, replace it with + // other character(s). Category pages include special pages such as // sales or promotions. For instance, a special sale page may have the // category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday // Deals"]. Required for `category-page-view` events. At least one of @@ -7409,7 +7475,7 @@ func (s *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error } // GoogleCloudRetailV2betaExportMetadata: Metadata related to the -// progress of the Export operation. This will be returned by the +// progress of the Export operation. This is returned by the // google.longrunning.Operation.metadata field. type GoogleCloudRetailV2betaExportMetadata struct { // CreateTime: Operation create time. @@ -7784,12 +7850,12 @@ func (s *GoogleCloudRetailV2betaPurgeUserEventsResponse) MarshalJSON() ([]byte, } // GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { } // GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -8111,8 +8177,8 @@ type ProjectsLocationsCatalogsCompleteQueryCall struct { // CompleteQuery: Completes the specified prefix with keyword // suggestions. This feature is only available for users who have Retail -// Search enabled. Please enable Retail Search on Cloud Console before -// using this feature. +// Search enabled. Enable Retail Search on Cloud Console before using +// this feature. // // - catalog: Catalog for which the completion is performed. Full // resource name of catalog, such as @@ -8293,7 +8359,7 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:completeQuery", // "httpMethod": "GET", // "id": "retail.projects.locations.catalogs.completeQuery", @@ -8516,8 +8582,8 @@ type ProjectsLocationsCatalogsGetCompletionConfigCall struct { // GetCompletionConfig: Gets a CompletionConfig. // // - name: Full CompletionConfig resource name. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/completionConfig. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/completionConfig`. func (r *ProjectsLocationsCatalogsService) GetCompletionConfig(name string) *ProjectsLocationsCatalogsGetCompletionConfigCall { c := &ProjectsLocationsCatalogsGetCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -8634,7 +8700,7 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi. // ], // "parameters": { // "name": { - // "description": "Required. Full CompletionConfig resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig", + // "description": "Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", // "required": true, @@ -10397,6 +10463,154 @@ func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleap } +// method id "retail.projects.locations.catalogs.branches.places.operations.get": + +type ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCatalogsBranchesPlacesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { + c := &ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { + 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 *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { + 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 *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { + 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 *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) 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, "v2alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.branches.places.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/places/{placesId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.branches.places.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/places/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces": type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { @@ -10419,8 +10633,8 @@ type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { // GetOperation API will return NOT_FOUND afterwards. If conflicting // updates are issued, the Operations associated with the stale updates // will not be marked as done until being obsolete. This feature is only -// available for users who have Retail Search enabled. Please enable -// Retail Search on Cloud Console before using this feature. +// available for users who have Retail Search enabled. Enable Retail +// Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -10525,7 +10739,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(o } return ret, nil // { - // "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", @@ -10581,8 +10795,7 @@ type ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall struct { // If conflicting updates are issued, the Operations associated with the // stale updates will not be marked as done until being obsolete. This // feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this -// feature. +// Enable Retail Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -10687,7 +10900,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(op } return ret, nil // { - // "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addLocalInventories", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", @@ -11931,8 +12144,8 @@ type ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall struct // GetOperation API will return NOT_FOUND afterwards. If conflicting // updates are issued, the Operations associated with the stale updates // will not be marked as done until being obsolete. This feature is only -// available for users who have Retail Search enabled. Please enable -// Retail Search on Cloud Console before using this feature. +// available for users who have Retail Search enabled. Enable Retail +// Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -12037,7 +12250,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) D } return ret, nil // { - // "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", @@ -12091,8 +12304,7 @@ type ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall struct // If conflicting updates are issued, the Operations associated with the // stale updates will not be marked as done until being obsolete. This // feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this -// feature. +// Enable Retail Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -12197,7 +12409,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do } return ret, nil // { - // "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeLocalInventories", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", @@ -12242,29 +12454,29 @@ type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { // respecting the last update timestamps of each inventory field. This // process is asynchronous and does not require the Product to exist // before updating fulfillment information. If the request is valid, the -// update will be enqueued and processed downstream. As a consequence, -// when a response is returned, updates are not immediately manifested -// in the Product queried by ProductService.GetProduct or +// update is enqueued and processed downstream. As a consequence, when a +// response is returned, updates are not immediately manifested in the +// Product queried by ProductService.GetProduct or // ProductService.ListProducts. When inventory is updated with // ProductService.CreateProduct and ProductService.UpdateProduct, the -// specified inventory field value(s) will overwrite any existing -// value(s) while ignoring the last update time for this field. -// Furthermore, the last update time for the specified inventory fields -// will be overwritten to the time of the ProductService.CreateProduct -// or ProductService.UpdateProduct request. If no inventory fields are -// set in CreateProductRequest.product, then any pre-existing inventory -// information for this product will be used. If no inventory fields are -// set in SetInventoryRequest.set_mask, then any existing inventory -// information will be preserved. Pre-existing inventory information can -// only be updated with ProductService.SetInventory, +// specified inventory field value(s) overwrite any existing value(s) +// while ignoring the last update time for this field. Furthermore, the +// last update times for the specified inventory fields are overwritten +// by the times of the ProductService.CreateProduct or +// ProductService.UpdateProduct request. If no inventory fields are set +// in CreateProductRequest.product, then any pre-existing inventory +// information for this product is used. If no inventory fields are set +// in SetInventoryRequest.set_mask, then any existing inventory +// information is preserved. Pre-existing inventory information can only +// be updated with ProductService.SetInventory, // ProductService.AddFulfillmentPlaces, and -// ProductService.RemoveFulfillmentPlaces. The returned Operations will -// be obsolete after 1 day, and GetOperation API will return NOT_FOUND +// ProductService.RemoveFulfillmentPlaces. The returned Operations is +// obsolete after one day, and the GetOperation API returns `NOT_FOUND` // afterwards. If conflicting updates are issued, the Operations -// associated with the stale updates will not be marked as done until -// being obsolete. This feature is only available for users who have -// Retail Search enabled. Please enable Retail Search on Cloud Console -// before using this feature. +// associated with the stale updates are not marked as done until they +// are obsolete. This feature is only available for users who have +// Retail Search enabled. Enable Retail Search on Cloud Console before +// using this feature. // // - name: Immutable. Full resource name of the product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -12367,7 +12579,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } return ret, nil // { - // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -12413,8 +12625,8 @@ type ProjectsLocationsCatalogsCompletionDataImportCall struct { // operation is successfully finished only after the imported // suggestions are indexed successfully and ready for serving. The // process takes hours. This feature is only available for users who -// have Retail Search enabled. Please enable Retail Search on Cloud -// Console before using this feature. +// have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - parent: The catalog which the suggestions dataset belongs to. // Format: `projects/1234/locations/global/catalogs/default_catalog`. @@ -12516,7 +12728,7 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionData:import", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.completionData.import", @@ -12853,7 +13065,7 @@ type ProjectsLocationsCatalogsControlsGetCall struct { // Get: Gets a Control. // -// - name: The resource name of the Control to delete. Format: +// - name: The resource name of the Control to get. Format: // `projects/{project_number}/locations/{location_id}/catalogs/{catalog // _id}/controls/{control_id}`. func (r *ProjectsLocationsCatalogsControlsService) Get(name string) *ProjectsLocationsCatalogsControlsGetCall { @@ -12970,7 +13182,7 @@ func (c *ProjectsLocationsCatalogsControlsGetCall) Do(opts ...googleapi.CallOpti // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the Control to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", + // "description": "Required. The resource name of the Control to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", // "required": true, @@ -12999,7 +13211,7 @@ type ProjectsLocationsCatalogsControlsListCall struct { header_ http.Header } -// List: Lists all Controls linked to this catalog. +// List: Lists all Controls by their parent Catalog. // // - parent: The catalog resource name. Format: // `projects/{project_number}/locations/{location_id}/catalogs/{catalog @@ -13136,7 +13348,7 @@ func (c *ProjectsLocationsCatalogsControlsListCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Lists all Controls linked to this catalog.", + // "description": "Lists all Controls by their parent Catalog.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", // "httpMethod": "GET", // "id": "retail.projects.locations.catalogs.controls.list", @@ -13213,7 +13425,7 @@ type ProjectsLocationsCatalogsControlsPatchCall struct { // Patch: Updates a Control. Control cannot be set to a different oneof // field, if so an INVALID_ARGUMENT is returned. If the Control to -// delete does not exist, a NOT_FOUND error is returned. +// update does not exist, a NOT_FOUND error is returned. // // - name: Immutable. Fully qualified name // `projects/*/locations/global/catalogs/*/controls/*`. @@ -13324,7 +13536,7 @@ func (c *ProjectsLocationsCatalogsControlsPatchCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to delete does not exist, a NOT_FOUND error is returned.", + // "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", // "httpMethod": "PATCH", // "id": "retail.projects.locations.catalogs.controls.patch", @@ -13375,8 +13587,8 @@ type ProjectsLocationsCatalogsModelsCreateCall struct { // // - parent: The parent resource under which to create the model. // Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. func (r *ProjectsLocationsCatalogsModelsService) Create(parent string, googlecloudretailv2alphamodel *GoogleCloudRetailV2alphaModel) *ProjectsLocationsCatalogsModelsCreateCall { c := &ProjectsLocationsCatalogsModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -13496,7 +13708,7 @@ func (c *ProjectsLocationsCatalogsModelsCreateCall) Do(opts ...googleapi.CallOpt // "type": "boolean" // }, // "parent": { - // "description": "Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + // "description": "Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, @@ -13530,8 +13742,8 @@ type ProjectsLocationsCatalogsModelsDeleteCall struct { // Delete: Deletes an existing model. // // - name: The resource name of the Model to delete. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/models/{model_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. func (r *ProjectsLocationsCatalogsModelsService) Delete(name string) *ProjectsLocationsCatalogsModelsDeleteCall { c := &ProjectsLocationsCatalogsModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -13633,7 +13845,7 @@ func (c *ProjectsLocationsCatalogsModelsDeleteCall) Do(opts ...googleapi.CallOpt // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the Model to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + // "description": "Required. The resource name of the Model to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", // "required": true, @@ -13665,8 +13877,8 @@ type ProjectsLocationsCatalogsModelsListCall struct { // List: Lists all the models linked to this event store. // // - parent: The parent for which to list models. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. func (r *ProjectsLocationsCatalogsModelsService) List(parent string) *ProjectsLocationsCatalogsModelsListCall { c := &ProjectsLocationsCatalogsModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -13810,7 +14022,7 @@ func (c *ProjectsLocationsCatalogsModelsListCall) Do(opts ...googleapi.CallOptio // "type": "string" // }, // "parent": { - // "description": "Required. The parent for which to list models. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + // "description": "Required. The parent for which to list models. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, @@ -14024,8 +14236,8 @@ type ProjectsLocationsCatalogsModelsPauseCall struct { // Pause: Pauses the training of an existing model. // // - name: The name of the model to pause. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/models/{model_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. func (r *ProjectsLocationsCatalogsModelsService) Pause(name string, googlecloudretailv2alphapausemodelrequest *GoogleCloudRetailV2alphaPauseModelRequest) *ProjectsLocationsCatalogsModelsPauseCall { c := &ProjectsLocationsCatalogsModelsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -14133,7 +14345,7 @@ func (c *ProjectsLocationsCatalogsModelsPauseCall) Do(opts ...googleapi.CallOpti // ], // "parameters": { // "name": { - // "description": "Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + // "description": "Required. The name of the model to pause. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", // "required": true, @@ -14168,8 +14380,8 @@ type ProjectsLocationsCatalogsModelsResumeCall struct { // Resume: Resumes the training of an existing model. // // - name: The name of the model to resume. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/models/{model_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. func (r *ProjectsLocationsCatalogsModelsService) Resume(name string, googlecloudretailv2alpharesumemodelrequest *GoogleCloudRetailV2alphaResumeModelRequest) *ProjectsLocationsCatalogsModelsResumeCall { c := &ProjectsLocationsCatalogsModelsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -14277,7 +14489,7 @@ func (c *ProjectsLocationsCatalogsModelsResumeCall) Do(opts ...googleapi.CallOpt // ], // "parameters": { // "name": { - // "description": "Required. The name of the model to resume. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + // "description": "Required. The name of the model to resume. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", // "required": true, @@ -14312,8 +14524,8 @@ type ProjectsLocationsCatalogsModelsTuneCall struct { // Tune: Tunes an existing model. // // - name: The resource name of the model to tune. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/models/{model_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. func (r *ProjectsLocationsCatalogsModelsService) Tune(name string, googlecloudretailv2alphatunemodelrequest *GoogleCloudRetailV2alphaTuneModelRequest) *ProjectsLocationsCatalogsModelsTuneCall { c := &ProjectsLocationsCatalogsModelsTuneCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -14421,7 +14633,7 @@ func (c *ProjectsLocationsCatalogsModelsTuneCall) Do(opts ...googleapi.CallOptio // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + // "description": "Required. The resource name of the model to tune. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", // "required": true, @@ -14971,8 +15183,8 @@ type ProjectsLocationsCatalogsPlacementsSearchCall struct { } // 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. +// who have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - placement: The resource name of the Retail Search serving config, // such as @@ -15082,7 +15294,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal } 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.", + // "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:search", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.placements.search", @@ -15153,8 +15365,8 @@ type ProjectsLocationsCatalogsServingConfigsAddControlCall struct { // number of control allowed for that type of control. // // - servingConfig: The source ServingConfig resource name . Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) AddControl(servingConfig string, googlecloudretailv2alphaaddcontrolrequest *GoogleCloudRetailV2alphaAddControlRequest) *ProjectsLocationsCatalogsServingConfigsAddControlCall { c := &ProjectsLocationsCatalogsServingConfigsAddControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig @@ -15263,7 +15475,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Do(opts ...googl // ], // "parameters": { // "servingConfig": { - // "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -15459,8 +15671,8 @@ type ProjectsLocationsCatalogsServingConfigsDeleteCall struct { // ServingConfig does not exist. // // - name: The resource name of the ServingConfig to delete. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) Delete(name string) *ProjectsLocationsCatalogsServingConfigsDeleteCall { c := &ProjectsLocationsCatalogsServingConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -15562,7 +15774,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Do(opts ...googleapi // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The resource name of the ServingConfig to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -15595,8 +15807,8 @@ type ProjectsLocationsCatalogsServingConfigsGetCall struct { // ServingConfig does not exist. // // - name: The resource name of the ServingConfig to get. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) Get(name string) *ProjectsLocationsCatalogsServingConfigsGetCall { c := &ProjectsLocationsCatalogsServingConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -15712,7 +15924,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The resource name of the ServingConfig to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -15744,8 +15956,8 @@ type ProjectsLocationsCatalogsServingConfigsListCall struct { // List: Lists all ServingConfigs linked to this catalog. // // - parent: The catalog resource name. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) List(parent string) *ProjectsLocationsCatalogsServingConfigsListCall { c := &ProjectsLocationsCatalogsServingConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -15889,7 +16101,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsListCall) Do(opts ...googleapi.C // "type": "string" // }, // "parent": { - // "description": "Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + // "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, @@ -16258,8 +16470,8 @@ type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { // if the Control is not enabled for the ServingConfig. // // - servingConfig: The source ServingConfig resource name . Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) RemoveControl(servingConfig string, googlecloudretailv2alpharemovecontrolrequest *GoogleCloudRetailV2alphaRemoveControlRequest) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { c := &ProjectsLocationsCatalogsServingConfigsRemoveControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig @@ -16368,7 +16580,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...go // ], // "parameters": { // "servingConfig": { - // "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -16401,8 +16613,8 @@ type ProjectsLocationsCatalogsServingConfigsSearchCall struct { } // 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. +// who have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - placement: The resource name of the Retail Search serving config, // such as @@ -16512,7 +16724,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi } 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.", + // "description": "Performs a search. This feature is only available for users who have Retail Search enabled. 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", @@ -17058,15 +17270,15 @@ type ProjectsLocationsCatalogsUserEventsRejoinCall struct { header_ http.Header } -// Rejoin: Starts a user event rejoin operation with latest product -// catalog. Events will not be annotated with detailed product -// information if product is missing from the catalog at the time the -// user event is ingested, and these events are stored as unjoined -// events with a limited usage on training and serving. This method can -// be used to start a join operation on specified events with latest -// version of product catalog. It can also be used to correct events -// joined with the wrong product catalog. A rejoin operation can take -// hours or days to complete. +// Rejoin: Starts a user-event rejoin operation with latest product +// catalog. Events are not annotated with detailed product information +// for products that are missing from the catalog when the user event is +// ingested. These events are stored as unjoined events with limited +// usage on training and serving. You can use this method to start a +// join operation on specified events with the latest version of product +// catalog. You can also use this method to correct events joined with +// the wrong product catalog. A rejoin operation can take hours or days +// to complete. // // - parent: The parent catalog resource name, such as // `projects/1234/locations/global/catalogs/default_catalog`. @@ -17168,7 +17380,7 @@ func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + // "description": "Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.userEvents.rejoin", diff --git a/retail/v2beta/retail-api.json b/retail/v2beta/retail-api.json index 94fd3424619..c5e58d8a01d 100644 --- a/retail/v2beta/retail-api.json +++ b/retail/v2beta/retail-api.json @@ -112,7 +112,7 @@ "catalogs": { "methods": { "completeQuery": { - "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:completeQuery", "httpMethod": "GET", "id": "retail.projects.locations.catalogs.completeQuery", @@ -203,7 +203,7 @@ ], "parameters": { "name": { - "description": "Required. Full CompletionConfig resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig", + "description": "Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", "required": true, @@ -561,7 +561,7 @@ "products": { "methods": { "addFulfillmentPlaces": { - "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", @@ -589,7 +589,7 @@ ] }, "addLocalInventories": { - "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addLocalInventories", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", @@ -814,7 +814,7 @@ ] }, "removeFulfillmentPlaces": { - "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", @@ -842,7 +842,7 @@ ] }, "removeLocalInventories": { - "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeLocalInventories", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", @@ -870,7 +870,7 @@ ] }, "setInventory": { - "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -904,7 +904,7 @@ "completionData": { "methods": { "import": { - "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionData:import", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.completionData.import", @@ -1003,7 +1003,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the Control to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", + "description": "Required. The resource name of the Control to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", "required": true, @@ -1019,7 +1019,7 @@ ] }, "list": { - "description": "Lists all Controls linked to this catalog.", + "description": "Lists all Controls by their parent Catalog.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", "httpMethod": "GET", "id": "retail.projects.locations.catalogs.controls.list", @@ -1060,7 +1060,7 @@ ] }, "patch": { - "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to delete does not exist, a NOT_FOUND error is returned.", + "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", "httpMethod": "PATCH", "id": "retail.projects.locations.catalogs.controls.patch", @@ -1095,6 +1095,222 @@ } } }, + "models": { + "methods": { + "create": { + "description": "Creates a new model.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.models.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "dryRun": { + "description": "Optional. Whether to run a dry run to validate the request (without actually creating the model).", + "location": "query", + "type": "boolean" + }, + "parent": { + "description": "Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+parent}/models", + "request": { + "$ref": "GoogleCloudRetailV2betaModel" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes an existing model.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}", + "httpMethod": "DELETE", + "id": "retail.projects.locations.catalogs.models.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Model to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all the models linked to this event store.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models", + "httpMethod": "GET", + "id": "retail.projects.locations.catalogs.models.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListModels` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent for which to list models. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+parent}/models", + "response": { + "$ref": "GoogleCloudRetailV2betaListModelsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}", + "httpMethod": "PATCH", + "id": "retail.projects.locations.catalogs.models.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. Indicates which fields in the provided 'model' to update. If not set, by default updates all fields.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v2beta/{+name}", + "request": { + "$ref": "GoogleCloudRetailV2betaModel" + }, + "response": { + "$ref": "GoogleCloudRetailV2betaModel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "pause": { + "description": "Pauses the training of an existing model.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}:pause", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.models.pause", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the model to pause. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:pause", + "request": { + "$ref": "GoogleCloudRetailV2betaPauseModelRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2betaModel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "resume": { + "description": "Resumes the training of an existing model.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}:resume", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.models.resume", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the model to resume. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:resume", + "request": { + "$ref": "GoogleCloudRetailV2betaResumeModelRequest" + }, + "response": { + "$ref": "GoogleCloudRetailV2betaModel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "tune": { + "description": "Tunes an existing model.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}:tune", + "httpMethod": "POST", + "id": "retail.projects.locations.catalogs.models.tune", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the model to tune. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:tune", + "request": { + "$ref": "GoogleCloudRetailV2betaTuneModelRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "operations": { "methods": { "get": { @@ -1196,7 +1412,7 @@ ] }, "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.", + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:search", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.placements.search", @@ -1237,7 +1453,7 @@ ], "parameters": { "servingConfig": { - "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1298,7 +1514,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The resource name of the ServingConfig to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1323,7 +1539,7 @@ ], "parameters": { "name": { - "description": "Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The resource name of the ServingConfig to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1359,7 +1575,7 @@ "type": "string" }, "parent": { - "description": "Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", "required": true, @@ -1446,7 +1662,7 @@ ], "parameters": { "servingConfig": { - "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", "required": true, @@ -1465,7 +1681,7 @@ ] }, "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.", + "description": "Performs a search. This feature is only available for users who have Retail Search enabled. 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", @@ -1594,7 +1810,7 @@ ] }, "rejoin": { - "description": "Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + "description": "Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.userEvents.rejoin", @@ -1798,7 +2014,7 @@ } } }, - "revision": "20220811", + "revision": "20220822", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2094,13 +2310,13 @@ "type": "object" }, "GoogleCloudRetailV2RejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2RejoinUserEventsMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2RejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2RejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -2208,7 +2424,7 @@ "id": "GoogleCloudRetailV2alphaCreateModelMetadata", "properties": { "model": { - "description": "The resource name of the model that this create applies to. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "The resource name of the model that this create applies to. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "type": "string" } }, @@ -2226,7 +2442,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaExportMetadata": { - "description": "Metadata related to the progress of the Export operation. This will be returned by the google.longrunning.Operation.metadata field.", + "description": "Metadata related to the progress of the Export operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudRetailV2alphaExportMetadata", "properties": { "createTime": { @@ -2686,13 +2902,13 @@ "type": "object" }, "GoogleCloudRetailV2alphaRejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2alphaRejoinUserEventsMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaRejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2alphaRejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -2761,7 +2977,7 @@ "id": "GoogleCloudRetailV2alphaTuneModelMetadata", "properties": { "model": { - "description": "The resource name of the model that this tune applies to. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}", + "description": "The resource name of the model that this tune applies to. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", "type": "string" } }, @@ -3345,7 +3561,7 @@ "type": "boolean" }, "value": { - "description": "The value of the term to match on. Value cannot be empty. Value can have at most 3 terms if specified as a partial match. Each space separated string is considered as one term. Example) \"a b c\" is 3 terms and allowed, \" a b c d\" is 4 terms and not allowed for partial match.", + "description": "The value of the term to match on. Value cannot be empty. Value can have at most 3 terms if specified as a partial match. Each space separated string is considered as one term. For example, \"a b c\" is 3 terms and allowed, but \" a b c d\" is 4 terms and not allowed for a partial match.", "type": "string" } }, @@ -3369,11 +3585,11 @@ "type": "object" }, "GoogleCloudRetailV2betaControl": { - "description": "Configures dynamic serving time metadata that is used to pre and post process search/recommendation model results.", + "description": "Configures dynamic metadata that can be linked to a ServingConfig and affect search or recommendation results at serving time.", "id": "GoogleCloudRetailV2betaControl", "properties": { "associatedServingConfigIds": { - "description": "Output only. List of serving configuration ids that that are associated with this control. Note the association is managed via the ServingConfig, this is an output only denormalizeed view. Assumed to be in the same catalog.", + "description": "Output only. List of serving configuration ids that are associated with this control in the same Catalog. Note the association is managed via the ServingConfig, this is an output only denormalized view.", "items": { "type": "string" }, @@ -3386,7 +3602,7 @@ }, "facetSpec": { "$ref": "GoogleCloudRetailV2betaSearchRequestFacetSpec", - "description": "A facet specification to perform faceted search." + "description": "A facet specification to perform faceted search. Note that this field is deprecated and will throw NOT_IMPLEMENTED if used for creating a control." }, "name": { "description": "Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`", @@ -3396,8 +3612,25 @@ "$ref": "GoogleCloudRetailV2betaRule", "description": "A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost \"gShoe\" when query full matches \"Running Shoes\"." }, + "searchSolutionUseCase": { + "description": "Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow one search_solution_use_case per control.", + "items": { + "enum": [ + "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED", + "SEARCH_SOLUTION_USE_CASE_SEARCH", + "SEARCH_SOLUTION_USE_CASE_BROWSE" + ], + "enumDescriptions": [ + "The value when it's unspecified. In this case, server behavior defaults to SEARCH_SOLUTION_USE_CASE_SEARCH.", + "Search use case. Expects the traffic has a non-empty query.", + "Browse use case. Expects the traffic has an empty query." + ], + "type": "string" + }, + "type": "array" + }, "solutionTypes": { - "description": "Required. Immutable. The solution types that the serving config is used for. Currently we support setting only one type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.", + "description": "Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.", "items": { "enum": [ "SOLUTION_TYPE_UNSPECIFIED", @@ -3458,7 +3691,7 @@ "type": "object" }, "GoogleCloudRetailV2betaExportMetadata": { - "description": "Metadata related to the progress of the Export operation. This will be returned by the google.longrunning.Operation.metadata field.", + "description": "Metadata related to the progress of the Export operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudRetailV2betaExportMetadata", "properties": { "createTime": { @@ -3830,6 +4063,24 @@ }, "type": "object" }, + "GoogleCloudRetailV2betaListModelsResponse": { + "description": "Response to a ListModelRequest.", + "id": "GoogleCloudRetailV2betaListModelsResponse", + "properties": { + "models": { + "description": "List of Models.", + "items": { + "$ref": "GoogleCloudRetailV2betaModel" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pagination token, if not returned indicates the last page.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2betaListProductsResponse": { "description": "Response message for ProductService.ListProducts method.", "id": "GoogleCloudRetailV2betaListProductsResponse", @@ -3940,6 +4191,150 @@ }, "type": "object" }, + "GoogleCloudRetailV2betaModel": { + "description": "Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict API.", + "id": "GoogleCloudRetailV2betaModel", + "properties": { + "createTime": { + "description": "Output only. Timestamp the Recommendation Model was created at.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "dataState": { + "description": "Output only. The state of data requirements for this model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even if serving state is `ACTIVE`: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training.", + "enum": [ + "DATA_STATE_UNSPECIFIED", + "DATA_OK", + "DATA_ERROR" + ], + "enumDescriptions": [ + "Unspecified default value, should never be explicitly set.", + "The model has sufficient training data.", + "The model does not have sufficient training data. Error messages can be queried via Stackdriver." + ], + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 characters.", + "type": "string" + }, + "filteringOption": { + "description": "Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.", + "enum": [ + "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED", + "RECOMMENDATIONS_FILTERING_DISABLED", + "RECOMMENDATIONS_FILTERING_ENABLED" + ], + "enumDescriptions": [ + "Value used when unset. In this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED.", + "Recommendation filtering is disabled.", + "Recommendation filtering is enabled." + ], + "type": "string" + }, + "lastTuneTime": { + "description": "Output only. The timestamp when the latest successful tune finished.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.", + "type": "string" + }, + "optimizationObjective": { + "description": "Optional. The optimization objective e.g. `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not specified, we choose default based on model type. Default depends on type of recommendation: `recommended-for-you` =\u003e `ctr` `others-you-may-like` =\u003e `ctr` `frequently-bought-together` =\u003e `revenue_per_order`", + "type": "string" + }, + "periodicTuningState": { + "description": "Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`.", + "enum": [ + "PERIODIC_TUNING_STATE_UNSPECIFIED", + "PERIODIC_TUNING_DISABLED", + "ALL_TUNING_DISABLED", + "PERIODIC_TUNING_ENABLED" + ], + "enumDescriptions": [ + "Unspecified default value, should never be explicitly set.", + "The model has periodic tuning disabled. Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or by calling the `TuneModel` method.", + "The model cannot be tuned with periodic tuning OR the `TuneModel` method. Hide the options in customer UI and reject any requests through the backend self serve API.", + "The model has periodic tuning enabled. Tuning can be disabled by calling the `DisableModelPeriodicTuning` method." + ], + "type": "string" + }, + "servingConfigLists": { + "description": "Output only. The list of valid serving configs associated with the PageOptimizationConfig.", + "items": { + "$ref": "GoogleCloudRetailV2betaModelServingConfigList" + }, + "readOnly": true, + "type": "array" + }, + "servingState": { + "description": "Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.", + "enum": [ + "SERVING_STATE_UNSPECIFIED", + "INACTIVE", + "ACTIVE", + "TUNED" + ], + "enumDescriptions": [ + "Unspecified serving state.", + "The model is not serving.", + "The model is serving and can be queried.", + "The model is trained on tuned hyperparameters and can be queried." + ], + "readOnly": true, + "type": "string" + }, + "trainingState": { + "description": "Optional. The training state that the model is in (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for `CreateModel` method is `TRAINING`. The default value for `UpdateModel` method is to keep the state the same as before.", + "enum": [ + "TRAINING_STATE_UNSPECIFIED", + "PAUSED", + "TRAINING" + ], + "enumDescriptions": [ + "Unspecified training state.", + "The model training is paused.", + "The model is training." + ], + "type": "string" + }, + "tuningOperation": { + "description": "Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on.", + "readOnly": true, + "type": "string" + }, + "type": { + "description": "Required. The type of model e.g. `home-page`. Currently supported values: `recommended-for-you`, `others-you-may-like`, `frequently-bought-together`, `page-optimization`, `similar-items`, `buy-it-again`, and `recently-viewed`(readonly value).", + "type": "string" + }, + "updateTime": { + "description": "Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudRetailV2betaModelServingConfigList": { + "description": "Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.", + "id": "GoogleCloudRetailV2betaModelServingConfigList", + "properties": { + "servingConfigIds": { + "description": "Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudRetailV2betaOutputResult": { "description": "Output result.", "id": "GoogleCloudRetailV2betaOutputResult", @@ -3954,6 +4349,12 @@ }, "type": "object" }, + "GoogleCloudRetailV2betaPauseModelRequest": { + "description": "Request for pausing training of a model.", + "id": "GoogleCloudRetailV2betaPauseModelRequest", + "properties": {}, + "type": "object" + }, "GoogleCloudRetailV2betaPredictRequest": { "description": "Request message for Predict method.", "id": "GoogleCloudRetailV2betaPredictRequest", @@ -4150,7 +4551,7 @@ "type": "array" }, "categories": { - "description": "Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). For example, if a shoes product belongs to both [\"Shoes \u0026 Accessories\" -\u003e \"Shoes\"] and [\"Sports \u0026 Fitness\" -\u003e \"Athletic Clothing\" -\u003e \"Shoes\"], it could be represented as: \"categories\": [ \"Shoes \u0026 Accessories \u003e Shoes\", \"Sports \u0026 Fitness \u003e Athletic Clothing \u003e Shoes\" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436", + "description": "Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). For example, if a shoes product belongs to both [\"Shoes \u0026 Accessories\" -\u003e \"Shoes\"] and [\"Sports \u0026 Fitness\" -\u003e \"Athletic Clothing\" -\u003e \"Shoes\"], it could be represented as: \"categories\": [ \"Shoes \u0026 Accessories \u003e Shoes\", \"Sports \u0026 Fitness \u003e Athletic Clothing \u003e Shoes\" ] Must be set for Type.PRIMARY Product otherwise an INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property google_product_category. Schema.org property [Product.category] (https://schema.org/category). [mc_google_product_category]: https://support.google.com/merchants/answer/6324436", "items": { "type": "string" }, @@ -4209,6 +4610,14 @@ "description": "Language of the title/description and other string attributes. Use language tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this field is ignored and the model automatically detects the text language. The Product can include text in different languages, but duplicating Products to provide text in multiple languages can result in degraded model performance. For product search this field is in use. It defaults to \"en-US\" if unset.", "type": "string" }, + "localInventories": { + "description": "Output only. A list of local inventories specific to different places. This is only available for users who have Retail Search enabled, and it can be managed by AddLocalInventories and RemoveLocalInventories APIs.", + "items": { + "$ref": "GoogleCloudRetailV2betaLocalInventory" + }, + "readOnly": true, + "type": "array" + }, "materials": { "description": "The material of the product. For example, \"leather\", \"wooden\". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property [material](https://support.google.com/merchants/answer/6324410). Schema.org property [Product.material](https://schema.org/material).", "items": { @@ -4474,7 +4883,7 @@ "type": "object" }, "GoogleCloudRetailV2betaRejoinUserEventsMetadata": { - "description": "Metadata for RejoinUserEvents method.", + "description": "Metadata for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2betaRejoinUserEventsMetadata", "properties": {}, "type": "object" @@ -4484,7 +4893,7 @@ "id": "GoogleCloudRetailV2betaRejoinUserEventsRequest", "properties": { "userEventRejoinScope": { - "description": "The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an invalid integer value.", + "description": "The type of the user event rejoin to define the scope and range of the user events to be rejoined with the latest product catalog. Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to an invalid integer value.", "enum": [ "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED", "JOINED_EVENTS", @@ -4501,7 +4910,7 @@ "type": "object" }, "GoogleCloudRetailV2betaRejoinUserEventsResponse": { - "description": "Response message for RejoinUserEvents method.", + "description": "Response message for `RejoinUserEvents` method.", "id": "GoogleCloudRetailV2betaRejoinUserEventsResponse", "properties": { "rejoinedUserEventsCount": { @@ -4624,8 +5033,14 @@ }, "type": "object" }, + "GoogleCloudRetailV2betaResumeModelRequest": { + "description": "Request for resuming training of a model.", + "id": "GoogleCloudRetailV2betaResumeModelRequest", + "properties": {}, + "type": "object" + }, "GoogleCloudRetailV2betaRule": { - "description": "A rule is a condition-action pair * A condition defines when a rule is to be triggered. * An action specifies what occurs on that trigger. Currently only boost rules are supported. Currently only supported by the search endpoint.", + "description": "A rule is a condition-action pair * A condition defines when a rule is to be triggered. * An action specifies what occurs on that trigger. Currently rules only work for controls with SOLUTION_TYPE_SEARCH.", "id": "GoogleCloudRetailV2betaRule", "properties": { "boostAction": { @@ -4859,7 +5274,7 @@ "type": "string" }, "pageCategories": { - "description": "The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"].", + "description": "The categories associated with a category page. Required for category navigation queries to achieve good search quality. The format should be the same as UserEvent.page_categories; To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"].", "items": { "type": "string" }, @@ -4876,7 +5291,7 @@ }, "personalizationSpec": { "$ref": "GoogleCloudRetailV2betaSearchRequestPersonalizationSpec", - "description": "The specification for personalization." + "description": "The specification for personalization. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec." }, "query": { "description": "Raw search query. If this field is empty, the request is considered a category browsing request and returned results are based on filter and page_categories.", @@ -4894,9 +5309,9 @@ "FACETED_SEARCH_ONLY" ], "enumDescriptions": [ - "Default value. In this case both product search and faceted search will be performed. Both [SearchResponse.SearchResult] and [SearchResponse.Facet] will be returned.", - "Only product search will be performed. The faceted search will be disabled. Only [SearchResponse.SearchResult] will be returned. [SearchResponse.Facet] will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", - "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." + "Default value. In this case both product search and faceted search will be performed. Both SearchResponse.SearchResult and SearchResponse.Facet will be returned.", + "Only product search will be performed. The faceted search will be disabled. Only SearchResponse.SearchResult will be returned. SearchResponse.Facet will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", + "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only SearchResponse.Facet will be returned. SearchResponse.SearchResult will not be returned." ], "type": "string" }, @@ -5297,7 +5712,7 @@ "type": "object" }, "GoogleCloudRetailV2betaServingConfig": { - "description": "Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions). The ServingConfig is passed in the search and predict request and together with the Catalog.default_branch, generates results.", + "description": "Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions).", "id": "GoogleCloudRetailV2betaServingConfig", "properties": { "boostControlIds": { @@ -5312,7 +5727,21 @@ "type": "string" }, "diversityLevel": { - "description": "How much diversity to use in recommendation model results e.g. 'medium-diversity' or 'high-diversity'. Currently supported values: * 'no-diversity' * 'low-diversity' * 'medium-diversity' * 'high-diversity' * 'auto-diversity' If not specified, we choose default based on recommendation model type. Default value: 'no-diversity'. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "type": "string" + }, + "diversityType": { + "description": "What kind of diversity to use - data driven or rule based.", + "enum": [ + "DIVERSITY_TYPE_UNSPECIFIED", + "RULE_BASED_DIVERSITY", + "DATA_DRIVEN_DIVERSITY" + ], + "enumDescriptions": [ + "Default value.", + "Rule based diversity.", + "Data driven diversity." + ], "type": "string" }, "doNotAssociateControlIds": { @@ -5327,7 +5756,7 @@ "description": "The specification for dynamically generated facets. Notice that only textual facets can be dynamically generated. Can only be set if solution_types is SOLUTION_TYPE_SEARCH." }, "enableCategoryFilterLevel": { - "description": "Whether to add additional category filters on the 'similar-items' model. If not specified, we enable it by default. Allowed values are: * 'no-category-match': No additional filtering of original results from the model and the customer's filters. * 'relaxed-category-match': Only keep results with categories that match at least one item categories in the PredictRequests's context item. * If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match). Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "Whether to add additional category filters on the `similar-items` model. If not specified, we enable it by default. Allowed values are: * `no-category-match`: No additional filtering of original results from the model and the customer's filters. * `relaxed-category-match`: Only keep results with categories that match at least one item categories in the PredictRequests's context item. * If customer also sends filters in the PredictRequest, then the results will satisfy both conditions (user given and category match). Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", "type": "string" }, "facetControlIds": { @@ -5352,7 +5781,7 @@ "type": "array" }, "modelId": { - "description": "The id of the model to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "The id of the model in the same Catalog to use at serving time. Currently only RecommendationModels are supported: https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when solution_types is SOLUTION_TYPE_RECOMMENDATION.", "type": "string" }, "name": { @@ -5366,8 +5795,12 @@ }, "type": "array" }, + "personalizationSpec": { + "$ref": "GoogleCloudRetailV2betaSearchRequestPersonalizationSpec", + "description": "The specification for personalization spec. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set. SearchRequest.personalization_spec will override ServingConfig.personalization_spec." + }, "priceRerankingLevel": { - "description": "How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are: * 'no-price-reranking' * 'low-price-raranking' * 'medium-price-reranking' * 'high-price-reranking' If not specified, we choose default based on model type. Default value: 'no-price-reranking'. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", + "description": "How much price ranking we want in serving results. Price reranking causes product items with a similar recommendation probability to be ordered by price, with the highest-priced items first. This setting could result in a decrease in click-through and conversion rates. Allowed values are: * `no-price-reranking` * `low-price-raranking` * `medium-price-reranking` * `high-price-reranking` If not specified, we choose default based on model type. Default value: `no-price-reranking`. Can only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION.", "type": "string" }, "redirectControlIds": { @@ -5467,6 +5900,12 @@ "properties": {}, "type": "object" }, + "GoogleCloudRetailV2betaTuneModelRequest": { + "description": "Request to manually start a tuning process now (instead of waiting for the periodically scheduled tuning to happen).", + "id": "GoogleCloudRetailV2betaTuneModelRequest", + "properties": {}, + "type": "object" + }, "GoogleCloudRetailV2betaUserEvent": { "description": "UserEvent captures all metadata information Retail API needs to know about how end users interact with customers' website.", "id": "GoogleCloudRetailV2betaUserEvent", @@ -5520,7 +5959,7 @@ "type": "string" }, "pageCategories": { - "description": "The categories associated with a category page. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, please replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.", + "description": "The categories associated with a category page. To represent full path of category, use '\u003e' sign to separate different hierarchies. If '\u003e' is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: \"pageCategories\" : [\"Sales \u003e 2017 Black Friday Deals\"]. Required for `category-page-view` events. At least one of search_query or page_categories is required for `search` events. Other event types should not set this field. Otherwise, an INVALID_ARGUMENT error is returned.", "items": { "type": "string" }, diff --git a/retail/v2beta/retail-gen.go b/retail/v2beta/retail-gen.go index 9169317a0a6..1544421a66e 100644 --- a/retail/v2beta/retail-gen.go +++ b/retail/v2beta/retail-gen.go @@ -173,6 +173,7 @@ func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsS rs.Branches = NewProjectsLocationsCatalogsBranchesService(s) rs.CompletionData = NewProjectsLocationsCatalogsCompletionDataService(s) rs.Controls = NewProjectsLocationsCatalogsControlsService(s) + rs.Models = NewProjectsLocationsCatalogsModelsService(s) rs.Operations = NewProjectsLocationsCatalogsOperationsService(s) rs.Placements = NewProjectsLocationsCatalogsPlacementsService(s) rs.ServingConfigs = NewProjectsLocationsCatalogsServingConfigsService(s) @@ -191,6 +192,8 @@ type ProjectsLocationsCatalogsService struct { Controls *ProjectsLocationsCatalogsControlsService + Models *ProjectsLocationsCatalogsModelsService + Operations *ProjectsLocationsCatalogsOperationsService Placements *ProjectsLocationsCatalogsPlacementsService @@ -260,6 +263,15 @@ type ProjectsLocationsCatalogsControlsService struct { s *Service } +func NewProjectsLocationsCatalogsModelsService(s *Service) *ProjectsLocationsCatalogsModelsService { + rs := &ProjectsLocationsCatalogsModelsService{s: s} + return rs +} + +type ProjectsLocationsCatalogsModelsService struct { + s *Service +} + func NewProjectsLocationsCatalogsOperationsService(s *Service) *ProjectsLocationsCatalogsOperationsService { rs := &ProjectsLocationsCatalogsOperationsService{s: s} return rs @@ -867,12 +879,12 @@ func (s *GoogleCloudRetailV2PurgeUserEventsResponse) MarshalJSON() ([]byte, erro } // GoogleCloudRetailV2RejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2RejoinUserEventsMetadata struct { } // GoogleCloudRetailV2RejoinUserEventsResponse: Response message for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2RejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -1045,8 +1057,8 @@ func (s *GoogleCloudRetailV2alphaBigQueryOutputResult) MarshalJSON() ([]byte, er type GoogleCloudRetailV2alphaCreateModelMetadata struct { // Model: The resource name of the model that this create applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id - // }/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` Model string `json:"model,omitempty"` // ForceSendFields is a list of field names (e.g. "Model") to @@ -1105,7 +1117,7 @@ func (s *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, erro } // GoogleCloudRetailV2alphaExportMetadata: Metadata related to the -// progress of the Export operation. This will be returned by the +// progress of the Export operation. This is returned by the // google.longrunning.Operation.metadata field. type GoogleCloudRetailV2alphaExportMetadata struct { // CreateTime: Operation create time. @@ -1925,12 +1937,12 @@ func (s *GoogleCloudRetailV2alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, } // GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { } // GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message -// for RejoinUserEvents method. +// for `RejoinUserEvents` method. type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -2043,8 +2055,8 @@ func (s *GoogleCloudRetailV2alphaTransformedUserEventsMetadata) MarshalJSON() ([ type GoogleCloudRetailV2alphaTuneModelMetadata struct { // Model: The resource name of the model that this tune applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id - // }/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` Model string `json:"model,omitempty"` // ForceSendFields is a list of field names (e.g. "Model") to @@ -3152,9 +3164,9 @@ type GoogleCloudRetailV2betaConditionQueryTerm struct { // Value: The value of the term to match on. Value cannot be empty. // Value can have at most 3 terms if specified as a partial match. Each - // space separated string is considered as one term. Example) "a b c" is - // 3 terms and allowed, " a b c d" is 4 terms and not allowed for - // partial match. + // space separated string is considered as one term. For example, "a b + // c" is 3 terms and allowed, but " a b c d" is 4 terms and not allowed + // for a partial match. Value string `json:"value,omitempty"` // ForceSendFields is a list of field names (e.g. "FullMatch") to @@ -3212,14 +3224,14 @@ func (s *GoogleCloudRetailV2betaConditionTimeRange) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudRetailV2betaControl: Configures dynamic serving time -// metadata that is used to pre and post process search/recommendation -// model results. +// GoogleCloudRetailV2betaControl: Configures dynamic metadata that can +// be linked to a ServingConfig and affect search or recommendation +// results at serving time. type GoogleCloudRetailV2betaControl struct { // AssociatedServingConfigIds: Output only. List of serving - // configuration ids that that are associated with this control. Note - // the association is managed via the ServingConfig, this is an output - // only denormalizeed view. Assumed to be in the same catalog. + // configuration ids that are associated with this control in the same + // Catalog. Note the association is managed via the ServingConfig, this + // is an output only denormalized view. AssociatedServingConfigIds []string `json:"associatedServingConfigIds,omitempty"` // DisplayName: Required. The human readable control display name. Used @@ -3228,7 +3240,9 @@ type GoogleCloudRetailV2betaControl struct { // thrown. DisplayName string `json:"displayName,omitempty"` - // FacetSpec: A facet specification to perform faceted search. + // FacetSpec: A facet specification to perform faceted search. Note that + // this field is deprecated and will throw NOT_IMPLEMENTED if used for + // creating a control. FacetSpec *GoogleCloudRetailV2betaSearchRequestFacetSpec `json:"facetSpec,omitempty"` // Name: Immutable. Fully qualified name @@ -3240,11 +3254,27 @@ type GoogleCloudRetailV2betaControl struct { // query full matches "Running Shoes". Rule *GoogleCloudRetailV2betaRule `json:"rule,omitempty"` + // SearchSolutionUseCase: Specifies the use case for the control. + // Affects what condition fields can be set. Only settable by search + // controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not + // specified. Currently only allow one search_solution_use_case per + // control. + // + // Possible values: + // "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED" - The value when it's + // unspecified. In this case, server behavior defaults to + // SEARCH_SOLUTION_USE_CASE_SEARCH. + // "SEARCH_SOLUTION_USE_CASE_SEARCH" - Search use case. Expects the + // traffic has a non-empty query. + // "SEARCH_SOLUTION_USE_CASE_BROWSE" - Browse use case. Expects the + // traffic has an empty query. + SearchSolutionUseCase []string `json:"searchSolutionUseCase,omitempty"` + // SolutionTypes: Required. Immutable. The solution types that the - // serving config is used for. Currently we support setting only one - // type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value - // is supported at the moment. If no solution type is provided at - // creation time, will default to SOLUTION_TYPE_SEARCH. + // control is used for. Currently we support setting only one type of + // solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is + // supported at the moment. If no solution type is provided at creation + // time, will default to SOLUTION_TYPE_SEARCH. // // Possible values: // "SOLUTION_TYPE_UNSPECIFIED" - Default value. @@ -3375,7 +3405,7 @@ func (s *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error } // GoogleCloudRetailV2betaExportMetadata: Metadata related to the -// progress of the Export operation. This will be returned by the +// progress of the Export operation. This is returned by the // google.longrunning.Operation.metadata field. type GoogleCloudRetailV2betaExportMetadata struct { // CreateTime: Operation create time. @@ -4124,6 +4154,43 @@ func (s *GoogleCloudRetailV2betaListControlsResponse) MarshalJSON() ([]byte, err return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2betaListModelsResponse: Response to a +// ListModelRequest. +type GoogleCloudRetailV2betaListModelsResponse struct { + // Models: List of Models. + Models []*GoogleCloudRetailV2betaModel `json:"models,omitempty"` + + // NextPageToken: Pagination token, if not returned indicates the last + // page. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Models") 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. "Models") 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 *GoogleCloudRetailV2betaListModelsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaListModelsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2betaListProductsResponse: Response message for // ProductService.ListProducts method. type GoogleCloudRetailV2betaListProductsResponse struct { @@ -4354,6 +4421,190 @@ func (s *GoogleCloudRetailV2betaMerchantCenterLinkingConfig) MarshalJSON() ([]by return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2betaModel: Metadata that describes the training +// and serving parameters of a Model. A Model can be associated with a +// ServingConfig and then queried through the Predict API. +type GoogleCloudRetailV2betaModel struct { + // CreateTime: Output only. Timestamp the Recommendation Model was + // created at. + CreateTime string `json:"createTime,omitempty"` + + // DataState: Output only. The state of data requirements for this + // model: `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be + // trained if the data is in `DATA_ERROR` state. Recommendation model + // can have `DATA_ERROR` state even if serving state is `ACTIVE`: models + // were trained successfully before, but cannot be refreshed because + // model no longer has sufficient data for training. + // + // Possible values: + // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never + // be explicitly set. + // "DATA_OK" - The model has sufficient training data. + // "DATA_ERROR" - The model does not have sufficient training data. + // Error messages can be queried via Stackdriver. + DataState string `json:"dataState,omitempty"` + + // DisplayName: Required. The display name of the model. Should be human + // readable, used to display Recommendation Models in the Retail Cloud + // Console Dashboard. UTF-8 encoded string with limit of 1024 + // characters. + DisplayName string `json:"displayName,omitempty"` + + // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, + // recommendation filtering by attributes is enabled for the model. + // + // Possible values: + // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when + // unset. In this case, server behavior defaults to + // RECOMMENDATIONS_FILTERING_DISABLED. + // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is + // disabled. + // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is + // enabled. + FilteringOption string `json:"filteringOption,omitempty"` + + // LastTuneTime: Output only. The timestamp when the latest successful + // tune finished. + LastTuneTime string `json:"lastTuneTime,omitempty"` + + // Name: Required. The fully qualified resource name of the model. + // Format: + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_i + // d}/models/{model_id}` catalog_id has char limit of 50. + // recommendation_model_id has char limit of 40. + Name string `json:"name,omitempty"` + + // OptimizationObjective: Optional. The optimization objective e.g. + // `cvr`. Currently supported values: `ctr`, `cvr`, `revenue-per-order`. + // If not specified, we choose default based on model type. Default + // depends on type of recommendation: `recommended-for-you` => `ctr` + // `others-you-may-like` => `ctr` `frequently-bought-together` => + // `revenue_per_order` + OptimizationObjective string `json:"optimizationObjective,omitempty"` + + // PeriodicTuningState: Optional. The state of periodic tuning. The + // period we use is 3 months - to do a one-off tune earlier use the + // `TuneModel` method. Default value is `PERIODIC_TUNING_ENABLED`. + // + // Possible values: + // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, + // should never be explicitly set. + // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning + // disabled. Tuning can be reenabled by calling the + // `EnableModelPeriodicTuning` method or by calling the `TuneModel` + // method. + // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic + // tuning OR the `TuneModel` method. Hide the options in customer UI and + // reject any requests through the backend self serve API. + // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. + // Tuning can be disabled by calling the `DisableModelPeriodicTuning` + // method. + PeriodicTuningState string `json:"periodicTuningState,omitempty"` + + // ServingConfigLists: Output only. The list of valid serving configs + // associated with the PageOptimizationConfig. + ServingConfigLists []*GoogleCloudRetailV2betaModelServingConfigList `json:"servingConfigLists,omitempty"` + + // ServingState: Output only. The serving state of the model: `ACTIVE`, + // `NOT_ACTIVE`. + // + // Possible values: + // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. + // "INACTIVE" - The model is not serving. + // "ACTIVE" - The model is serving and can be queried. + // "TUNED" - The model is trained on tuned hyperparameters and can be + // queried. + ServingState string `json:"servingState,omitempty"` + + // TrainingState: Optional. The training state that the model is in + // (e.g. `TRAINING` or `PAUSED`). Since part of the cost of running the + // service is frequency of training - this can be used to determine when + // to train model in order to control cost. If not specified: the + // default value for `CreateModel` method is `TRAINING`. The default + // value for `UpdateModel` method is to keep the state the same as + // before. + // + // Possible values: + // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. + // "PAUSED" - The model training is paused. + // "TRAINING" - The model is training. + TrainingState string `json:"trainingState,omitempty"` + + // TuningOperation: Output only. The tune operation associated with the + // model. Can be used to determine if there is an ongoing tune for this + // recommendation. Empty field implies no tune is goig on. + TuningOperation string `json:"tuningOperation,omitempty"` + + // Type: Required. The type of model e.g. `home-page`. Currently + // supported values: `recommended-for-you`, `others-you-may-like`, + // `frequently-bought-together`, `page-optimization`, `similar-items`, + // `buy-it-again`, and `recently-viewed`(readonly value). + Type string `json:"type,omitempty"` + + // UpdateTime: Output only. Timestamp the Recommendation Model was last + // updated. E.g. if a Recommendation Model was paused - this would be + // the time the pause was initiated. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. 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. "CreateTime") 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 *GoogleCloudRetailV2betaModel) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaModel + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudRetailV2betaModelServingConfigList: Represents an ordered +// combination of valid serving configs, which can be used for +// `PAGE_OPTIMIZATION` recommendations. +type GoogleCloudRetailV2betaModelServingConfigList struct { + // ServingConfigIds: Optional. A set of valid serving configs that may + // be used for `PAGE_OPTIMIZATION`. + ServingConfigIds []string `json:"servingConfigIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ServingConfigIds") 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. "ServingConfigIds") 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 *GoogleCloudRetailV2betaModelServingConfigList) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaModelServingConfigList + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2betaOutputResult: Output result. type GoogleCloudRetailV2betaOutputResult struct { // BigqueryResult: Export result in BigQuery. @@ -4383,6 +4634,11 @@ func (s *GoogleCloudRetailV2betaOutputResult) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2betaPauseModelRequest: Request for pausing +// training of a model. +type GoogleCloudRetailV2betaPauseModelRequest struct { +} + // GoogleCloudRetailV2betaPredictRequest: Request message for Predict // method. type GoogleCloudRetailV2betaPredictRequest struct { @@ -4774,12 +5030,12 @@ type GoogleCloudRetailV2betaProduct struct { // one product belonging to several parallel categories. Strongly // recommended using the full path for better search / recommendation // quality. To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). For example, if a shoes product - // belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & - // Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented - // as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness - // > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product + // different hierarchies. If '>' is part of the category name, replace + // it with other character(s). For example, if a shoes product belongs + // to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> + // "Athletic Clothing" -> "Shoes"], it could be represented as: + // "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness > + // Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product // otherwise an INVALID_ARGUMENT error is returned. At most 250 values // are allowed per Product. Empty values are not allowed. Each value // must be a UTF-8 encoded string with a length limit of 5,000 @@ -4880,6 +5136,12 @@ type GoogleCloudRetailV2betaProduct struct { // search this field is in use. It defaults to "en-US" if unset. LanguageCode string `json:"languageCode,omitempty"` + // LocalInventories: Output only. A list of local inventories specific + // to different places. This is only available for users who have Retail + // Search enabled, and it can be managed by AddLocalInventories and + // RemoveLocalInventories APIs. + LocalInventories []*GoogleCloudRetailV2betaLocalInventory `json:"localInventories,omitempty"` + // Materials: The material of the product. For example, "leather", // "wooden". A maximum of 20 values are allowed. Each value must be a // UTF-8 encoded string with a length limit of 200 characters. @@ -5466,7 +5728,7 @@ func (s *GoogleCloudRetailV2betaRating) UnmarshalJSON(data []byte) error { } // GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { } @@ -5475,7 +5737,7 @@ type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { type GoogleCloudRetailV2betaRejoinUserEventsRequest struct { // UserEventRejoinScope: The type of the user event rejoin to define the // scope and range of the user events to be rejoined with the latest - // product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if + // product catalog. Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if // this field is not set, or set to an invalid integer value. // // Possible values: @@ -5514,7 +5776,7 @@ func (s *GoogleCloudRetailV2betaRejoinUserEventsRequest) MarshalJSON() ([]byte, } // GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for -// RejoinUserEvents method. +// `RejoinUserEvents` method. type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { // RejoinedUserEventsCount: Number of user events that were joined with // latest product catalog. @@ -5765,10 +6027,15 @@ func (s *GoogleCloudRetailV2betaReplaceCatalogAttributeRequest) MarshalJSON() ([ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2betaResumeModelRequest: Request for resuming +// training of a model. +type GoogleCloudRetailV2betaResumeModelRequest struct { +} + // GoogleCloudRetailV2betaRule: A rule is a condition-action pair * A // condition defines when a rule is to be triggered. * An action -// specifies what occurs on that trigger. Currently only boost rules are -// supported. Currently only supported by the search endpoint. +// specifies what occurs on that trigger. Currently rules only work for +// controls with SOLUTION_TYPE_SEARCH. type GoogleCloudRetailV2betaRule struct { // BoostAction: A boost action. BoostAction *GoogleCloudRetailV2betaRuleBoostAction `json:"boostAction,omitempty"` @@ -6225,11 +6492,11 @@ type GoogleCloudRetailV2betaSearchRequest struct { // Required for category navigation queries to achieve good search // quality. The format should be the same as UserEvent.page_categories; // To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). Category pages include special - // pages such as sales or promotions. For instance, a special sale page - // may have the category hierarchy: "pageCategories" : ["Sales > 2017 - // Black Friday Deals"]. + // different hierarchies. If '>' is part of the category name, replace + // it with other character(s). Category pages include special pages such + // as sales or promotions. For instance, a special sale page may have + // the category hierarchy: "pageCategories" : ["Sales > 2017 Black + // Friday Deals"]. PageCategories []string `json:"pageCategories,omitempty"` // PageSize: Maximum number of Products to return. If unspecified, @@ -6245,7 +6512,11 @@ type GoogleCloudRetailV2betaSearchRequest struct { // token. Otherwise, an INVALID_ARGUMENT error is returned. PageToken string `json:"pageToken,omitempty"` - // PersonalizationSpec: The specification for personalization. + // PersonalizationSpec: The specification for personalization. Notice + // that if both ServingConfig.personalization_spec and + // SearchRequest.personalization_spec are set. + // SearchRequest.personalization_spec will override + // ServingConfig.personalization_spec. PersonalizationSpec *GoogleCloudRetailV2betaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` // Query: Raw search query. If this field is empty, the request is @@ -6266,19 +6537,18 @@ type GoogleCloudRetailV2betaSearchRequest struct { // Possible values: // "SEARCH_MODE_UNSPECIFIED" - Default value. In this case both // product search and faceted search will be performed. Both - // [SearchResponse.SearchResult] and [SearchResponse.Facet] will be + // SearchResponse.SearchResult and SearchResponse.Facet will be // returned. // "PRODUCT_SEARCH_ONLY" - Only product search will be performed. The - // faceted search will be disabled. Only [SearchResponse.SearchResult] - // will be returned. [SearchResponse.Facet] will not be returned, even - // if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is - // set. + // faceted search will be disabled. Only SearchResponse.SearchResult + // will be returned. SearchResponse.Facet will not be returned, even if + // SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set. // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The // product search will be disabled. When in this mode, one or both of // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - // [SearchResponse.Facet] will be returned. - // [SearchResponse.SearchResult] will not be returned. + // SearchResponse.Facet will be returned. SearchResponse.SearchResult + // will not be returned. SearchMode string `json:"searchMode,omitempty"` // SpellCorrectionSpec: The spell correction specification that @@ -7082,9 +7352,7 @@ func (s *GoogleCloudRetailV2betaSearchResponseSearchResult) MarshalJSON() ([]byt // GoogleCloudRetailV2betaServingConfig: Configures metadata that is // used to generate serving time results (e.g. search results or -// recommendation predictions). The ServingConfig is passed in the -// search and predict request and together with the -// Catalog.default_branch, generates results. +// recommendation predictions). type GoogleCloudRetailV2betaServingConfig struct { // BoostControlIds: Condition boost specifications. If a product matches // multiple conditions in the specifications, boost scores from these @@ -7105,14 +7373,23 @@ type GoogleCloudRetailV2betaServingConfig struct { DisplayName string `json:"displayName,omitempty"` // DiversityLevel: How much diversity to use in recommendation model - // results e.g. 'medium-diversity' or 'high-diversity'. Currently - // supported values: * 'no-diversity' * 'low-diversity' * - // 'medium-diversity' * 'high-diversity' * 'auto-diversity' If not + // results e.g. `medium-diversity` or `high-diversity`. Currently + // supported values: * `no-diversity` * `low-diversity` * + // `medium-diversity` * `high-diversity` * `auto-diversity` If not // specified, we choose default based on recommendation model type. - // Default value: 'no-diversity'. Can only be set if solution_types is + // Default value: `no-diversity`. Can only be set if solution_types is // SOLUTION_TYPE_RECOMMENDATION. DiversityLevel string `json:"diversityLevel,omitempty"` + // DiversityType: What kind of diversity to use - data driven or rule + // based. + // + // Possible values: + // "DIVERSITY_TYPE_UNSPECIFIED" - Default value. + // "RULE_BASED_DIVERSITY" - Rule based diversity. + // "DATA_DRIVEN_DIVERSITY" - Data driven diversity. + DiversityType string `json:"diversityType,omitempty"` + // DoNotAssociateControlIds: Condition do not associate specifications. // If multiple do not associate conditions match, all matching do not // associate controls in the list will execute. - Order does not matter. @@ -7126,10 +7403,10 @@ type GoogleCloudRetailV2betaServingConfig struct { DynamicFacetSpec *GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` // EnableCategoryFilterLevel: Whether to add additional category filters - // on the 'similar-items' model. If not specified, we enable it by - // default. Allowed values are: * 'no-category-match': No additional + // on the `similar-items` model. If not specified, we enable it by + // default. Allowed values are: * `no-category-match`: No additional // filtering of original results from the model and the customer's - // filters. * 'relaxed-category-match': Only keep results with + // filters. * `relaxed-category-match`: Only keep results with // categories that match at least one item categories in the // PredictRequests's context item. * If customer also sends filters in // the PredictRequest, then the results will satisfy both conditions @@ -7158,8 +7435,8 @@ type GoogleCloudRetailV2betaServingConfig struct { // is 100. Can only be set if solution_types is SOLUTION_TYPE_SEARCH. IgnoreControlIds []string `json:"ignoreControlIds,omitempty"` - // ModelId: The id of the model to use at serving time. Currently only - // RecommendationModels are supported: + // ModelId: The id of the model in the same Catalog to use at serving + // time. Currently only RecommendationModels are supported: // https://cloud.google.com/retail/recommendations-ai/docs/create-models // Can be changed but only to a compatible model (e.g. // others-you-may-like CTR to others-you-may-like CVR). Required when @@ -7177,15 +7454,23 @@ type GoogleCloudRetailV2betaServingConfig struct { // only be set if solution_types is SOLUTION_TYPE_SEARCH. OnewaySynonymsControlIds []string `json:"onewaySynonymsControlIds,omitempty"` + // PersonalizationSpec: The specification for personalization spec. Can + // only be set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if + // both ServingConfig.personalization_spec and + // SearchRequest.personalization_spec are set. + // SearchRequest.personalization_spec will override + // ServingConfig.personalization_spec. + PersonalizationSpec *GoogleCloudRetailV2betaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` + // PriceRerankingLevel: How much price ranking we want in serving // results. Price reranking causes product items with a similar // recommendation probability to be ordered by price, with the // highest-priced items first. This setting could result in a decrease // in click-through and conversion rates. Allowed values are: * - // 'no-price-reranking' * 'low-price-raranking' * - // 'medium-price-reranking' * 'high-price-reranking' If not specified, + // `no-price-reranking` * `low-price-raranking` * + // `medium-price-reranking` * `high-price-reranking` If not specified, // we choose default based on model type. Default value: - // 'no-price-reranking'. Can only be set if solution_types is + // `no-price-reranking`. Can only be set if solution_types is // SOLUTION_TYPE_RECOMMENDATION. PriceRerankingLevel string `json:"priceRerankingLevel,omitempty"` @@ -7378,6 +7663,12 @@ func (s *GoogleCloudRetailV2betaSetInventoryRequest) MarshalJSON() ([]byte, erro type GoogleCloudRetailV2betaSetInventoryResponse struct { } +// GoogleCloudRetailV2betaTuneModelRequest: Request to manually start a +// tuning process now (instead of waiting for the periodically scheduled +// tuning to happen). +type GoogleCloudRetailV2betaTuneModelRequest struct { +} + // GoogleCloudRetailV2betaUserEvent: UserEvent captures all metadata // information Retail API needs to know about how end users interact // with customers' website. @@ -7473,8 +7764,8 @@ type GoogleCloudRetailV2betaUserEvent struct { // PageCategories: The categories associated with a category page. To // represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it - // with other character(s). Category pages include special pages such as + // hierarchies. If '>' is part of the category name, replace it with + // other character(s). Category pages include special pages such as // sales or promotions. For instance, a special sale page may have the // category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday // Deals"]. Required for `category-page-view` events. At least one of @@ -7960,8 +8251,8 @@ type ProjectsLocationsCatalogsCompleteQueryCall struct { // CompleteQuery: Completes the specified prefix with keyword // suggestions. This feature is only available for users who have Retail -// Search enabled. Please enable Retail Search on Cloud Console before -// using this feature. +// Search enabled. Enable Retail Search on Cloud Console before using +// this feature. // // - catalog: Catalog for which the completion is performed. Full // resource name of catalog, such as @@ -8142,7 +8433,7 @@ func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}:completeQuery", // "httpMethod": "GET", // "id": "retail.projects.locations.catalogs.completeQuery", @@ -8364,8 +8655,8 @@ type ProjectsLocationsCatalogsGetCompletionConfigCall struct { // GetCompletionConfig: Gets a CompletionConfig. // // - name: Full CompletionConfig resource name. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/completionConfig. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/completionConfig`. func (r *ProjectsLocationsCatalogsService) GetCompletionConfig(name string) *ProjectsLocationsCatalogsGetCompletionConfigCall { c := &ProjectsLocationsCatalogsGetCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -8481,7 +8772,7 @@ func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi. // ], // "parameters": { // "name": { - // "description": "Required. Full CompletionConfig resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig", + // "description": "Required. Full CompletionConfig resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig$", // "required": true, @@ -10263,8 +10554,8 @@ type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { // GetOperation API will return NOT_FOUND afterwards. If conflicting // updates are issued, the Operations associated with the stale updates // will not be marked as done until being obsolete. This feature is only -// available for users who have Retail Search enabled. Please enable -// Retail Search on Cloud Console before using this feature. +// available for users who have Retail Search enabled. Enable Retail +// Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -10369,7 +10660,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(o } return ret, nil // { - // "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addFulfillmentPlaces", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces", @@ -10425,8 +10716,7 @@ type ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall struct { // If conflicting updates are issued, the Operations associated with the // stale updates will not be marked as done until being obsolete. This // feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this -// feature. +// Enable Retail Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -10531,7 +10821,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(op } return ret, nil // { - // "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:addLocalInventories", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.addLocalInventories", @@ -11608,8 +11898,8 @@ type ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall struct // GetOperation API will return NOT_FOUND afterwards. If conflicting // updates are issued, the Operations associated with the stale updates // will not be marked as done until being obsolete. This feature is only -// available for users who have Retail Search enabled. Please enable -// Retail Search on Cloud Console before using this feature. +// available for users who have Retail Search enabled. Enable Retail +// Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -11714,7 +12004,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) D } return ret, nil // { - // "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeFulfillmentPlaces", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces", @@ -11768,8 +12058,7 @@ type ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall struct // If conflicting updates are issued, the Operations associated with the // stale updates will not be marked as done until being obsolete. This // feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this -// feature. +// Enable Retail Search on Cloud Console before using this feature. // // - product: Full resource name of Product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -11874,7 +12163,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do } return ret, nil // { - // "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:removeLocalInventories", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.removeLocalInventories", @@ -11919,29 +12208,29 @@ type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { // respecting the last update timestamps of each inventory field. This // process is asynchronous and does not require the Product to exist // before updating fulfillment information. If the request is valid, the -// update will be enqueued and processed downstream. As a consequence, -// when a response is returned, updates are not immediately manifested -// in the Product queried by ProductService.GetProduct or +// update is enqueued and processed downstream. As a consequence, when a +// response is returned, updates are not immediately manifested in the +// Product queried by ProductService.GetProduct or // ProductService.ListProducts. When inventory is updated with // ProductService.CreateProduct and ProductService.UpdateProduct, the -// specified inventory field value(s) will overwrite any existing -// value(s) while ignoring the last update time for this field. -// Furthermore, the last update time for the specified inventory fields -// will be overwritten to the time of the ProductService.CreateProduct -// or ProductService.UpdateProduct request. If no inventory fields are -// set in CreateProductRequest.product, then any pre-existing inventory -// information for this product will be used. If no inventory fields are -// set in SetInventoryRequest.set_mask, then any existing inventory -// information will be preserved. Pre-existing inventory information can -// only be updated with ProductService.SetInventory, +// specified inventory field value(s) overwrite any existing value(s) +// while ignoring the last update time for this field. Furthermore, the +// last update times for the specified inventory fields are overwritten +// by the times of the ProductService.CreateProduct or +// ProductService.UpdateProduct request. If no inventory fields are set +// in CreateProductRequest.product, then any pre-existing inventory +// information for this product is used. If no inventory fields are set +// in SetInventoryRequest.set_mask, then any existing inventory +// information is preserved. Pre-existing inventory information can only +// be updated with ProductService.SetInventory, // ProductService.AddFulfillmentPlaces, and -// ProductService.RemoveFulfillmentPlaces. The returned Operations will -// be obsolete after 1 day, and GetOperation API will return NOT_FOUND +// ProductService.RemoveFulfillmentPlaces. The returned Operations is +// obsolete after one day, and the GetOperation API returns `NOT_FOUND` // afterwards. If conflicting updates are issued, the Operations -// associated with the stale updates will not be marked as done until -// being obsolete. This feature is only available for users who have -// Retail Search enabled. Please enable Retail Search on Cloud Console -// before using this feature. +// associated with the stale updates are not marked as done until they +// are obsolete. This feature is only available for users who have +// Retail Search enabled. Enable Retail Search on Cloud Console before +// using this feature. // // - name: Immutable. Full resource name of the product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -12044,7 +12333,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } return ret, nil // { - // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -12090,8 +12379,8 @@ type ProjectsLocationsCatalogsCompletionDataImportCall struct { // operation is successfully finished only after the imported // suggestions are indexed successfully and ready for serving. The // process takes hours. This feature is only available for users who -// have Retail Search enabled. Please enable Retail Search on Cloud -// Console before using this feature. +// have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - parent: The catalog which the suggestions dataset belongs to. // Format: `projects/1234/locations/global/catalogs/default_catalog`. @@ -12193,7 +12482,7 @@ func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi } return ret, nil // { - // "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/completionData:import", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.completionData.import", @@ -12530,7 +12819,7 @@ type ProjectsLocationsCatalogsControlsGetCall struct { // Get: Gets a Control. // -// - name: The resource name of the Control to delete. Format: +// - name: The resource name of the Control to get. Format: // `projects/{project_number}/locations/{location_id}/catalogs/{catalog // _id}/controls/{control_id}`. func (r *ProjectsLocationsCatalogsControlsService) Get(name string) *ProjectsLocationsCatalogsControlsGetCall { @@ -12647,7 +12936,7 @@ func (c *ProjectsLocationsCatalogsControlsGetCall) Do(opts ...googleapi.CallOpti // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the Control to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", + // "description": "Required. The resource name of the Control to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+$", // "required": true, @@ -12676,7 +12965,7 @@ type ProjectsLocationsCatalogsControlsListCall struct { header_ http.Header } -// List: Lists all Controls linked to this catalog. +// List: Lists all Controls by their parent Catalog. // // - parent: The catalog resource name. Format: // `projects/{project_number}/locations/{location_id}/catalogs/{catalog @@ -12813,7 +13102,7 @@ func (c *ProjectsLocationsCatalogsControlsListCall) Do(opts ...googleapi.CallOpt } return ret, nil // { - // "description": "Lists all Controls linked to this catalog.", + // "description": "Lists all Controls by their parent Catalog.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls", // "httpMethod": "GET", // "id": "retail.projects.locations.catalogs.controls.list", @@ -12890,7 +13179,7 @@ type ProjectsLocationsCatalogsControlsPatchCall struct { // Patch: Updates a Control. Control cannot be set to a different oneof // field, if so an INVALID_ARGUMENT is returned. If the Control to -// delete does not exist, a NOT_FOUND error is returned. +// update does not exist, a NOT_FOUND error is returned. // // - name: Immutable. Fully qualified name // `projects/*/locations/global/catalogs/*/controls/*`. @@ -13001,7 +13290,7 @@ func (c *ProjectsLocationsCatalogsControlsPatchCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to delete does not exist, a NOT_FOUND error is returned.", + // "description": "Updates a Control. Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/controls/{controlsId}", // "httpMethod": "PATCH", // "id": "retail.projects.locations.catalogs.controls.patch", @@ -13037,26 +13326,1108 @@ func (c *ProjectsLocationsCatalogsControlsPatchCall) Do(opts ...googleapi.CallOp } -// method id "retail.projects.locations.catalogs.operations.get": +// method id "retail.projects.locations.catalogs.models.create": -type ProjectsLocationsCatalogsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCatalogsModelsCreateCall struct { + s *Service + parent string + googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets the latest state of a long-running operation. Clients can -// use this method to poll the operation result at intervals as -// recommended by the API service. +// Create: Creates a new model. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { - c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c +// - parent: The parent resource under which to create the model. +// Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. +func (r *ProjectsLocationsCatalogsModelsService) Create(parent string, googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel) *ProjectsLocationsCatalogsModelsCreateCall { + c := &ProjectsLocationsCatalogsModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudretailv2betamodel = googlecloudretailv2betamodel + return c +} + +// DryRun sets the optional parameter "dryRun": Whether to run a dry run +// to validate the request (without actually creating the model). +func (c *ProjectsLocationsCatalogsModelsCreateCall) DryRun(dryRun bool) *ProjectsLocationsCatalogsModelsCreateCall { + c.urlParams_.Set("dryRun", fmt.Sprint(dryRun)) + 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 *ProjectsLocationsCatalogsModelsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsCreateCall { + 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 *ProjectsLocationsCatalogsModelsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsCreateCall { + 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 *ProjectsLocationsCatalogsModelsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsCreateCall) 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.googlecloudretailv2betamodel) + 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/{+parent}/models") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.create" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsModelsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new model.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.models.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "dryRun": { + // "description": "Optional. Whether to run a dry run to validate the request (without actually creating the model).", + // "location": "query", + // "type": "boolean" + // }, + // "parent": { + // "description": "Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+parent}/models", + // "request": { + // "$ref": "GoogleCloudRetailV2betaModel" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.models.delete": + +type ProjectsLocationsCatalogsModelsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an existing model. +// +// - name: The resource name of the Model to delete. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. +func (r *ProjectsLocationsCatalogsModelsService) Delete(name string) *ProjectsLocationsCatalogsModelsDeleteCall { + c := &ProjectsLocationsCatalogsModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsModelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsDeleteCall { + 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 *ProjectsLocationsCatalogsModelsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsDeleteCall { + 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 *ProjectsLocationsCatalogsModelsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsDeleteCall) 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, "v2beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsModelsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing model.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}", + // "httpMethod": "DELETE", + // "id": "retail.projects.locations.catalogs.models.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Model to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.models.list": + +type ProjectsLocationsCatalogsModelsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all the models linked to this event store. +// +// - parent: The parent for which to list models. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. +func (r *ProjectsLocationsCatalogsModelsService) List(parent string) *ProjectsLocationsCatalogsModelsListCall { + c := &ProjectsLocationsCatalogsModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 50. Max allowed value +// is 1000. +func (c *ProjectsLocationsCatalogsModelsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsModelsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListModels` call. Provide this to retrieve +// the subsequent page. +func (c *ProjectsLocationsCatalogsModelsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsModelsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsModelsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsListCall { + 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 *ProjectsLocationsCatalogsModelsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsModelsListCall { + 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 *ProjectsLocationsCatalogsModelsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsListCall { + 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 *ProjectsLocationsCatalogsModelsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsListCall) 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, "v2beta/{+parent}/models") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.list" call. +// Exactly one of *GoogleCloudRetailV2betaListModelsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudRetailV2betaListModelsResponse.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 *ProjectsLocationsCatalogsModelsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaListModelsResponse, 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 := &GoogleCloudRetailV2betaListModelsResponse{ + 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": "Lists all the models linked to this event store.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models", + // "httpMethod": "GET", + // "id": "retail.projects.locations.catalogs.models.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A page token, received from a previous `ListModels` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent for which to list models. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+parent}/models", + // "response": { + // "$ref": "GoogleCloudRetailV2betaListModelsResponse" + // }, + // "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 *ProjectsLocationsCatalogsModelsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaListModelsResponse) 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 "retail.projects.locations.catalogs.models.patch": + +type ProjectsLocationsCatalogsModelsPatchCall struct { + s *Service + name string + googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Update of model metadata. Only fields that currently can be +// updated are: `filtering_option` and `periodic_tuning_state`. If other +// values are provided, this API method ignores them. +// +// - name: The fully qualified resource name of the model. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}` catalog_id has char limit of 50. +// recommendation_model_id has char limit of 40. +func (r *ProjectsLocationsCatalogsModelsService) Patch(name string, googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel) *ProjectsLocationsCatalogsModelsPatchCall { + c := &ProjectsLocationsCatalogsModelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2betamodel = googlecloudretailv2betamodel + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided 'model' to update. If not set, by default +// updates all fields. +func (c *ProjectsLocationsCatalogsModelsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsModelsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCatalogsModelsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsPatchCall { + 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 *ProjectsLocationsCatalogsModelsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsPatchCall { + 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 *ProjectsLocationsCatalogsModelsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsPatchCall) 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.googlecloudretailv2betamodel) + 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/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.patch" call. +// Exactly one of *GoogleCloudRetailV2betaModel or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2betaModel.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 *ProjectsLocationsCatalogsModelsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, 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 := &GoogleCloudRetailV2betaModel{ + 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": "Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}", + // "httpMethod": "PATCH", + // "id": "retail.projects.locations.catalogs.models.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The fully qualified resource name of the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` catalog_id has char limit of 50. recommendation_model_id has char limit of 40.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Optional. Indicates which fields in the provided 'model' to update. If not set, by default updates all fields.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}", + // "request": { + // "$ref": "GoogleCloudRetailV2betaModel" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2betaModel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.models.pause": + +type ProjectsLocationsCatalogsModelsPauseCall struct { + s *Service + name string + googlecloudretailv2betapausemodelrequest *GoogleCloudRetailV2betaPauseModelRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Pause: Pauses the training of an existing model. +// +// - name: The name of the model to pause. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. +func (r *ProjectsLocationsCatalogsModelsService) Pause(name string, googlecloudretailv2betapausemodelrequest *GoogleCloudRetailV2betaPauseModelRequest) *ProjectsLocationsCatalogsModelsPauseCall { + c := &ProjectsLocationsCatalogsModelsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2betapausemodelrequest = googlecloudretailv2betapausemodelrequest + 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 *ProjectsLocationsCatalogsModelsPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsPauseCall { + 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 *ProjectsLocationsCatalogsModelsPauseCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsPauseCall { + 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 *ProjectsLocationsCatalogsModelsPauseCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsPauseCall) 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.googlecloudretailv2betapausemodelrequest) + 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/{+name}:pause") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.pause" call. +// Exactly one of *GoogleCloudRetailV2betaModel or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2betaModel.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 *ProjectsLocationsCatalogsModelsPauseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, 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 := &GoogleCloudRetailV2betaModel{ + 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": "Pauses the training of an existing model.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}:pause", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.models.pause", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the model to pause. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}:pause", + // "request": { + // "$ref": "GoogleCloudRetailV2betaPauseModelRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2betaModel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.models.resume": + +type ProjectsLocationsCatalogsModelsResumeCall struct { + s *Service + name string + googlecloudretailv2betaresumemodelrequest *GoogleCloudRetailV2betaResumeModelRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Resume: Resumes the training of an existing model. +// +// - name: The name of the model to resume. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. +func (r *ProjectsLocationsCatalogsModelsService) Resume(name string, googlecloudretailv2betaresumemodelrequest *GoogleCloudRetailV2betaResumeModelRequest) *ProjectsLocationsCatalogsModelsResumeCall { + c := &ProjectsLocationsCatalogsModelsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2betaresumemodelrequest = googlecloudretailv2betaresumemodelrequest + 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 *ProjectsLocationsCatalogsModelsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsResumeCall { + 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 *ProjectsLocationsCatalogsModelsResumeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsResumeCall { + 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 *ProjectsLocationsCatalogsModelsResumeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsResumeCall) 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.googlecloudretailv2betaresumemodelrequest) + 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/{+name}:resume") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.resume" call. +// Exactly one of *GoogleCloudRetailV2betaModel or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GoogleCloudRetailV2betaModel.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 *ProjectsLocationsCatalogsModelsResumeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, 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 := &GoogleCloudRetailV2betaModel{ + 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": "Resumes the training of an existing model.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}:resume", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.models.resume", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the model to resume. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}:resume", + // "request": { + // "$ref": "GoogleCloudRetailV2betaResumeModelRequest" + // }, + // "response": { + // "$ref": "GoogleCloudRetailV2betaModel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.models.tune": + +type ProjectsLocationsCatalogsModelsTuneCall struct { + s *Service + name string + googlecloudretailv2betatunemodelrequest *GoogleCloudRetailV2betaTuneModelRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Tune: Tunes an existing model. +// +// - name: The resource name of the model to tune. Format: +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/models/{model_id}`. +func (r *ProjectsLocationsCatalogsModelsService) Tune(name string, googlecloudretailv2betatunemodelrequest *GoogleCloudRetailV2betaTuneModelRequest) *ProjectsLocationsCatalogsModelsTuneCall { + c := &ProjectsLocationsCatalogsModelsTuneCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudretailv2betatunemodelrequest = googlecloudretailv2betatunemodelrequest + 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 *ProjectsLocationsCatalogsModelsTuneCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsTuneCall { + 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 *ProjectsLocationsCatalogsModelsTuneCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsTuneCall { + 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 *ProjectsLocationsCatalogsModelsTuneCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCatalogsModelsTuneCall) 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.googlecloudretailv2betatunemodelrequest) + 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/{+name}:tune") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "retail.projects.locations.catalogs.models.tune" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCatalogsModelsTuneCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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 := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Tunes an existing model.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/models/{modelsId}:tune", + // "httpMethod": "POST", + // "id": "retail.projects.locations.catalogs.models.tune", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the model to tune. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}:tune", + // "request": { + // "$ref": "GoogleCloudRetailV2betaTuneModelRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "retail.projects.locations.catalogs.operations.get": + +type ProjectsLocationsCatalogsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { + c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c } // Fields allows partial responses to be retrieved. See @@ -13566,8 +14937,8 @@ type ProjectsLocationsCatalogsPlacementsSearchCall struct { } // 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. +// who have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - placement: The resource name of the Retail Search serving config, // such as @@ -13677,7 +15048,7 @@ func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.Cal } 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.", + // "description": "Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:search", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.placements.search", @@ -13748,8 +15119,8 @@ type ProjectsLocationsCatalogsServingConfigsAddControlCall struct { // number of control allowed for that type of control. // // - servingConfig: The source ServingConfig resource name . Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) AddControl(servingConfig string, googlecloudretailv2betaaddcontrolrequest *GoogleCloudRetailV2betaAddControlRequest) *ProjectsLocationsCatalogsServingConfigsAddControlCall { c := &ProjectsLocationsCatalogsServingConfigsAddControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig @@ -13858,7 +15229,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Do(opts ...googl // ], // "parameters": { // "servingConfig": { - // "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -14054,8 +15425,8 @@ type ProjectsLocationsCatalogsServingConfigsDeleteCall struct { // ServingConfig does not exist. // // - name: The resource name of the ServingConfig to delete. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) Delete(name string) *ProjectsLocationsCatalogsServingConfigsDeleteCall { c := &ProjectsLocationsCatalogsServingConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -14157,7 +15528,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Do(opts ...googleapi // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The resource name of the ServingConfig to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -14190,8 +15561,8 @@ type ProjectsLocationsCatalogsServingConfigsGetCall struct { // ServingConfig does not exist. // // - name: The resource name of the ServingConfig to get. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) Get(name string) *ProjectsLocationsCatalogsServingConfigsGetCall { c := &ProjectsLocationsCatalogsServingConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -14307,7 +15678,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Do(opts ...googleapi.Ca // ], // "parameters": { // "name": { - // "description": "Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The resource name of the ServingConfig to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -14339,8 +15710,8 @@ type ProjectsLocationsCatalogsServingConfigsListCall struct { // List: Lists all ServingConfigs linked to this catalog. // // - parent: The catalog resource name. Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) List(parent string) *ProjectsLocationsCatalogsServingConfigsListCall { c := &ProjectsLocationsCatalogsServingConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -14484,7 +15855,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsListCall) Do(opts ...googleapi.C // "type": "string" // }, // "parent": { - // "description": "Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}", + // "description": "Required. The catalog resource name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", // "required": true, @@ -14853,8 +16224,8 @@ type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { // if the Control is not enabled for the ServingConfig. // // - servingConfig: The source ServingConfig resource name . Format: -// projects/{project_number}/locations/{location_id}/catalogs/{catalog_ -// id}/servingConfigs/{serving_config_id}. +// `projects/{project_number}/locations/{location_id}/catalogs/{catalog +// _id}/servingConfigs/{serving_config_id}`. func (r *ProjectsLocationsCatalogsServingConfigsService) RemoveControl(servingConfig string, googlecloudretailv2betaremovecontrolrequest *GoogleCloudRetailV2betaRemoveControlRequest) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { c := &ProjectsLocationsCatalogsServingConfigsRemoveControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig @@ -14963,7 +16334,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...go // ], // "parameters": { // "servingConfig": { - // "description": "Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}", + // "description": "Required. The source ServingConfig resource name . Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+$", // "required": true, @@ -14996,8 +16367,8 @@ type ProjectsLocationsCatalogsServingConfigsSearchCall struct { } // 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. +// who have Retail Search enabled. Enable Retail Search on Cloud Console +// before using this feature. // // - placement: The resource name of the Retail Search serving config, // such as @@ -15107,7 +16478,7 @@ func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi } 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.", + // "description": "Performs a search. This feature is only available for users who have Retail Search enabled. 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", @@ -15653,15 +17024,15 @@ type ProjectsLocationsCatalogsUserEventsRejoinCall struct { header_ http.Header } -// Rejoin: Starts a user event rejoin operation with latest product -// catalog. Events will not be annotated with detailed product -// information if product is missing from the catalog at the time the -// user event is ingested, and these events are stored as unjoined -// events with a limited usage on training and serving. This method can -// be used to start a join operation on specified events with latest -// version of product catalog. It can also be used to correct events -// joined with the wrong product catalog. A rejoin operation can take -// hours or days to complete. +// Rejoin: Starts a user-event rejoin operation with latest product +// catalog. Events are not annotated with detailed product information +// for products that are missing from the catalog when the user event is +// ingested. These events are stored as unjoined events with limited +// usage on training and serving. You can use this method to start a +// join operation on specified events with the latest version of product +// catalog. You can also use this method to correct events joined with +// the wrong product catalog. A rejoin operation can take hours or days +// to complete. // // - parent: The parent catalog resource name, such as // `projects/1234/locations/global/catalogs/default_catalog`. @@ -15763,7 +17134,7 @@ func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + // "description": "Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.userEvents.rejoin", diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json index 6e1377ed476..ce52ae66516 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json @@ -542,7 +542,7 @@ } } }, - "revision": "20220816", + "revision": "20220823", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "AddTenantProjectRequest": { @@ -1789,10 +1789,6 @@ "description": "OAuth scopes are a way to define data and permissions on data. For example, there are scopes defined for \"Read-only access to Google Calendar\" and \"Access to Cloud Platform\". Users can consent to a scope for an application, giving it permission to access that data on their behalf. OAuth scope specifications should be fairly coarse grained; a user will need to see and understand the text description of what your scope means. In most cases: use one or at most two OAuth scopes for an entire family of products. If your product has multiple APIs, you should probably be sharing the OAuth scope across all of those APIs. When you need finer grained OAuth consent screens: talk with your product management about how developers will use them in practice. Please note that even though each of the canonical scopes is enough for a request to be accepted and passed to the backend, a request can still fail due to the backend requiring additional scopes or permissions.", "id": "OAuthRequirements", "properties": { - "allowAnyScope": { - "description": "UNIMPLEMENTED: If enabled, ESF will allow OAuth credentials with any scope, more details in http://go/esf-oauth-any-scope. WARNING: Enabling this option will bring security risks. Customers enabling this feature accidentally may have the risk of losing authentication enforcement. Please reach out to api-auth@ and esf-team@ for approval and allowlisting before you enable this option. ", - "type": "boolean" - }, "canonicalScopes": { "description": "The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted. Example: canonical_scopes: https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.read", "type": "string" diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go index 0ee228f90e8..9d259150582 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go @@ -2699,15 +2699,6 @@ func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { // accepted and passed to the backend, a request can still fail due to // the backend requiring additional scopes or permissions. type OAuthRequirements struct { - // AllowAnyScope: UNIMPLEMENTED: If enabled, ESF will allow OAuth - // credentials with any scope, more details in - // http://go/esf-oauth-any-scope. WARNING: Enabling this option will - // bring security risks. Customers enabling this feature accidentally - // may have the risk of losing authentication enforcement. Please reach - // out to api-auth@ and esf-team@ for approval and allowlisting before - // you enable this option. - AllowAnyScope bool `json:"allowAnyScope,omitempty"` - // CanonicalScopes: The list of publicly documented OAuth scopes that // are allowed access. An OAuth token containing any of these scopes // will be accepted. Example: canonical_scopes: @@ -2715,7 +2706,7 @@ type OAuthRequirements struct { // https://www.googleapis.com/auth/calendar.read CanonicalScopes string `json:"canonicalScopes,omitempty"` - // ForceSendFields is a list of field names (e.g. "AllowAnyScope") to + // ForceSendFields is a list of field names (e.g. "CanonicalScopes") 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 @@ -2723,12 +2714,13 @@ type OAuthRequirements struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowAnyScope") 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 is a list of field names (e.g. "CanonicalScopes") 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:"-"` } diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json index 3361d98a9a4..7707f5255c7 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json @@ -500,7 +500,7 @@ } } }, - "revision": "20220816", + "revision": "20220823", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "Api": { @@ -1623,10 +1623,6 @@ "description": "OAuth scopes are a way to define data and permissions on data. For example, there are scopes defined for \"Read-only access to Google Calendar\" and \"Access to Cloud Platform\". Users can consent to a scope for an application, giving it permission to access that data on their behalf. OAuth scope specifications should be fairly coarse grained; a user will need to see and understand the text description of what your scope means. In most cases: use one or at most two OAuth scopes for an entire family of products. If your product has multiple APIs, you should probably be sharing the OAuth scope across all of those APIs. When you need finer grained OAuth consent screens: talk with your product management about how developers will use them in practice. Please note that even though each of the canonical scopes is enough for a request to be accepted and passed to the backend, a request can still fail due to the backend requiring additional scopes or permissions.", "id": "OAuthRequirements", "properties": { - "allowAnyScope": { - "description": "UNIMPLEMENTED: If enabled, ESF will allow OAuth credentials with any scope, more details in http://go/esf-oauth-any-scope. WARNING: Enabling this option will bring security risks. Customers enabling this feature accidentally may have the risk of losing authentication enforcement. Please reach out to api-auth@ and esf-team@ for approval and allowlisting before you enable this option. ", - "type": "boolean" - }, "canonicalScopes": { "description": "The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted. Example: canonical_scopes: https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.read", "type": "string" diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go index dadf0271e41..0bd58298e37 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go @@ -2438,15 +2438,6 @@ func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { // accepted and passed to the backend, a request can still fail due to // the backend requiring additional scopes or permissions. type OAuthRequirements struct { - // AllowAnyScope: UNIMPLEMENTED: If enabled, ESF will allow OAuth - // credentials with any scope, more details in - // http://go/esf-oauth-any-scope. WARNING: Enabling this option will - // bring security risks. Customers enabling this feature accidentally - // may have the risk of losing authentication enforcement. Please reach - // out to api-auth@ and esf-team@ for approval and allowlisting before - // you enable this option. - AllowAnyScope bool `json:"allowAnyScope,omitempty"` - // CanonicalScopes: The list of publicly documented OAuth scopes that // are allowed access. An OAuth token containing any of these scopes // will be accepted. Example: canonical_scopes: @@ -2454,7 +2445,7 @@ type OAuthRequirements struct { // https://www.googleapis.com/auth/calendar.read CanonicalScopes string `json:"canonicalScopes,omitempty"` - // ForceSendFields is a list of field names (e.g. "AllowAnyScope") to + // ForceSendFields is a list of field names (e.g. "CanonicalScopes") 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 @@ -2462,12 +2453,13 @@ type OAuthRequirements struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowAnyScope") 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 is a list of field names (e.g. "CanonicalScopes") 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:"-"` } diff --git a/serviceusage/v1/serviceusage-api.json b/serviceusage/v1/serviceusage-api.json index f3a7f1db500..618d5b599a8 100644 --- a/serviceusage/v1/serviceusage-api.json +++ b/serviceusage/v1/serviceusage-api.json @@ -426,7 +426,7 @@ } } }, - "revision": "20220816", + "revision": "20220823", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AdminQuotaPolicy": { @@ -2153,10 +2153,6 @@ "description": "OAuth scopes are a way to define data and permissions on data. For example, there are scopes defined for \"Read-only access to Google Calendar\" and \"Access to Cloud Platform\". Users can consent to a scope for an application, giving it permission to access that data on their behalf. OAuth scope specifications should be fairly coarse grained; a user will need to see and understand the text description of what your scope means. In most cases: use one or at most two OAuth scopes for an entire family of products. If your product has multiple APIs, you should probably be sharing the OAuth scope across all of those APIs. When you need finer grained OAuth consent screens: talk with your product management about how developers will use them in practice. Please note that even though each of the canonical scopes is enough for a request to be accepted and passed to the backend, a request can still fail due to the backend requiring additional scopes or permissions.", "id": "OAuthRequirements", "properties": { - "allowAnyScope": { - "description": "UNIMPLEMENTED: If enabled, ESF will allow OAuth credentials with any scope, more details in http://go/esf-oauth-any-scope. WARNING: Enabling this option will bring security risks. Customers enabling this feature accidentally may have the risk of losing authentication enforcement. Please reach out to api-auth@ and esf-team@ for approval and allowlisting before you enable this option. ", - "type": "boolean" - }, "canonicalScopes": { "description": "The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted. Example: canonical_scopes: https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.read", "type": "string" diff --git a/serviceusage/v1/serviceusage-gen.go b/serviceusage/v1/serviceusage-gen.go index 9cdfbd8be24..5b7c24d8c33 100644 --- a/serviceusage/v1/serviceusage-gen.go +++ b/serviceusage/v1/serviceusage-gen.go @@ -3406,15 +3406,6 @@ func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { // accepted and passed to the backend, a request can still fail due to // the backend requiring additional scopes or permissions. type OAuthRequirements struct { - // AllowAnyScope: UNIMPLEMENTED: If enabled, ESF will allow OAuth - // credentials with any scope, more details in - // http://go/esf-oauth-any-scope. WARNING: Enabling this option will - // bring security risks. Customers enabling this feature accidentally - // may have the risk of losing authentication enforcement. Please reach - // out to api-auth@ and esf-team@ for approval and allowlisting before - // you enable this option. - AllowAnyScope bool `json:"allowAnyScope,omitempty"` - // CanonicalScopes: The list of publicly documented OAuth scopes that // are allowed access. An OAuth token containing any of these scopes // will be accepted. Example: canonical_scopes: @@ -3422,7 +3413,7 @@ type OAuthRequirements struct { // https://www.googleapis.com/auth/calendar.read CanonicalScopes string `json:"canonicalScopes,omitempty"` - // ForceSendFields is a list of field names (e.g. "AllowAnyScope") to + // ForceSendFields is a list of field names (e.g. "CanonicalScopes") 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 @@ -3430,12 +3421,13 @@ type OAuthRequirements struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowAnyScope") 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 is a list of field names (e.g. "CanonicalScopes") 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:"-"` } diff --git a/serviceusage/v1beta1/serviceusage-api.json b/serviceusage/v1beta1/serviceusage-api.json index a264c332fd5..35dea0a3275 100644 --- a/serviceusage/v1beta1/serviceusage-api.json +++ b/serviceusage/v1beta1/serviceusage-api.json @@ -959,7 +959,7 @@ } } }, - "revision": "20220816", + "revision": "20220823", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AdminQuotaPolicy": { @@ -2843,10 +2843,6 @@ "description": "OAuth scopes are a way to define data and permissions on data. For example, there are scopes defined for \"Read-only access to Google Calendar\" and \"Access to Cloud Platform\". Users can consent to a scope for an application, giving it permission to access that data on their behalf. OAuth scope specifications should be fairly coarse grained; a user will need to see and understand the text description of what your scope means. In most cases: use one or at most two OAuth scopes for an entire family of products. If your product has multiple APIs, you should probably be sharing the OAuth scope across all of those APIs. When you need finer grained OAuth consent screens: talk with your product management about how developers will use them in practice. Please note that even though each of the canonical scopes is enough for a request to be accepted and passed to the backend, a request can still fail due to the backend requiring additional scopes or permissions.", "id": "OAuthRequirements", "properties": { - "allowAnyScope": { - "description": "UNIMPLEMENTED: If enabled, ESF will allow OAuth credentials with any scope, more details in http://go/esf-oauth-any-scope. WARNING: Enabling this option will bring security risks. Customers enabling this feature accidentally may have the risk of losing authentication enforcement. Please reach out to api-auth@ and esf-team@ for approval and allowlisting before you enable this option. ", - "type": "boolean" - }, "canonicalScopes": { "description": "The list of publicly documented OAuth scopes that are allowed access. An OAuth token containing any of these scopes will be accepted. Example: canonical_scopes: https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.read", "type": "string" diff --git a/serviceusage/v1beta1/serviceusage-gen.go b/serviceusage/v1beta1/serviceusage-gen.go index 148c33d7139..ae33f868ad9 100644 --- a/serviceusage/v1beta1/serviceusage-gen.go +++ b/serviceusage/v1beta1/serviceusage-gen.go @@ -3705,15 +3705,6 @@ func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { // accepted and passed to the backend, a request can still fail due to // the backend requiring additional scopes or permissions. type OAuthRequirements struct { - // AllowAnyScope: UNIMPLEMENTED: If enabled, ESF will allow OAuth - // credentials with any scope, more details in - // http://go/esf-oauth-any-scope. WARNING: Enabling this option will - // bring security risks. Customers enabling this feature accidentally - // may have the risk of losing authentication enforcement. Please reach - // out to api-auth@ and esf-team@ for approval and allowlisting before - // you enable this option. - AllowAnyScope bool `json:"allowAnyScope,omitempty"` - // CanonicalScopes: The list of publicly documented OAuth scopes that // are allowed access. An OAuth token containing any of these scopes // will be accepted. Example: canonical_scopes: @@ -3721,7 +3712,7 @@ type OAuthRequirements struct { // https://www.googleapis.com/auth/calendar.read CanonicalScopes string `json:"canonicalScopes,omitempty"` - // ForceSendFields is a list of field names (e.g. "AllowAnyScope") to + // ForceSendFields is a list of field names (e.g. "CanonicalScopes") 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 @@ -3729,12 +3720,13 @@ type OAuthRequirements struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AllowAnyScope") 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 is a list of field names (e.g. "CanonicalScopes") 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:"-"` }