google-cloud-retail-v2 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-retail-v2.rb +21 -0
- data/lib/google/cloud/retail/v2.rb +41 -0
- data/lib/google/cloud/retail/v2/catalog_pb.rb +32 -0
- data/lib/google/cloud/retail/v2/catalog_service.rb +49 -0
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +490 -0
- data/lib/google/cloud/retail/v2/catalog_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/catalog_service/paths.rb +69 -0
- data/lib/google/cloud/retail/v2/catalog_service_pb.rb +42 -0
- data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +48 -0
- data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
- data/lib/google/cloud/retail/v2/import_config_pb.rb +104 -0
- data/lib/google/cloud/retail/v2/prediction_service.rb +49 -0
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +472 -0
- data/lib/google/cloud/retail/v2/prediction_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/prediction_service/paths.rb +56 -0
- data/lib/google/cloud/retail/v2/prediction_service_pb.rb +46 -0
- data/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +45 -0
- data/lib/google/cloud/retail/v2/product_pb.rb +58 -0
- data/lib/google/cloud/retail/v2/product_service.rb +51 -0
- data/lib/google/cloud/retail/v2/product_service/client.rb +752 -0
- data/lib/google/cloud/retail/v2/product_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/product_service/operations.rb +570 -0
- data/lib/google/cloud/retail/v2/product_service/paths.rb +77 -0
- data/lib/google/cloud/retail/v2/product_service_pb.rb +47 -0
- data/lib/google/cloud/retail/v2/product_service_services_pb.rb +60 -0
- data/lib/google/cloud/retail/v2/purge_config_pb.rb +33 -0
- data/lib/google/cloud/retail/v2/user_event_pb.rb +55 -0
- data/lib/google/cloud/retail/v2/user_event_service.rb +50 -0
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +760 -0
- data/lib/google/cloud/retail/v2/user_event_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +570 -0
- data/lib/google/cloud/retail/v2/user_event_service/paths.rb +56 -0
- data/lib/google/cloud/retail/v2/user_event_service_pb.rb +56 -0
- data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +72 -0
- data/lib/google/cloud/retail/v2/version.rb +28 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/httpbody.rb +75 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/retail/v2/catalog.rb +101 -0
- data/proto_docs/google/cloud/retail/v2/catalog_service.rb +106 -0
- data/proto_docs/google/cloud/retail/v2/common.rb +169 -0
- data/proto_docs/google/cloud/retail/v2/import_config.rb +270 -0
- data/proto_docs/google/cloud/retail/v2/prediction_service.rb +205 -0
- data/proto_docs/google/cloud/retail/v2/product.rb +278 -0
- data/proto_docs/google/cloud/retail/v2/product_service.rb +117 -0
- data/proto_docs/google/cloud/retail/v2/purge_config.rb +85 -0
- data/proto_docs/google/cloud/retail/v2/user_event.rb +238 -0
- data/proto_docs/google/cloud/retail/v2/user_event_service.rb +114 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +245 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2021 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
module Google
|
|
21
|
+
module Cloud
|
|
22
|
+
module Retail
|
|
23
|
+
module V2
|
|
24
|
+
# Request message for Predict method.
|
|
25
|
+
# @!attribute [rw] placement
|
|
26
|
+
# @return [::String]
|
|
27
|
+
# Required. Full resource name of the format:
|
|
28
|
+
# \\{name=projects/*/locations/global/catalogs/default_catalog/placements/*}
|
|
29
|
+
# The id of the recommendation engine placement. This id is used to identify
|
|
30
|
+
# the set of models that will be used to make the prediction.
|
|
31
|
+
#
|
|
32
|
+
# We currently support three placements with the following IDs by default:
|
|
33
|
+
#
|
|
34
|
+
# * `shopping_cart`: Predicts products frequently bought together with one or
|
|
35
|
+
# more products in the same shopping session. Commonly displayed after
|
|
36
|
+
# `add-to-cart` events, on product detail pages, or on the shopping cart
|
|
37
|
+
# page.
|
|
38
|
+
#
|
|
39
|
+
# * `home_page`: Predicts the next product that a user will most likely
|
|
40
|
+
# engage with or purchase based on the shopping or viewing history of the
|
|
41
|
+
# specified `userId` or `visitorId`. For example - Recommendations for you.
|
|
42
|
+
#
|
|
43
|
+
# * `product_detail`: Predicts the next product that a user will most likely
|
|
44
|
+
# engage with or purchase. The prediction is based on the shopping or
|
|
45
|
+
# viewing history of the specified `userId` or `visitorId` and its
|
|
46
|
+
# relevance to a specified `CatalogItem`. Typically used on product detail
|
|
47
|
+
# pages. For example - More products like this.
|
|
48
|
+
#
|
|
49
|
+
# * `recently_viewed_default`: Returns up to 75 products recently viewed by
|
|
50
|
+
# the specified `userId` or `visitorId`, most recent ones first. Returns
|
|
51
|
+
# nothing if neither of them has viewed any products yet. For example -
|
|
52
|
+
# Recently viewed.
|
|
53
|
+
#
|
|
54
|
+
# The full list of available placements can be seen at
|
|
55
|
+
# https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
|
|
56
|
+
# @!attribute [rw] user_event
|
|
57
|
+
# @return [::Google::Cloud::Retail::V2::UserEvent]
|
|
58
|
+
# Required. Context about the user, what they are looking at and what action
|
|
59
|
+
# they took to trigger the predict request. Note that this user event detail
|
|
60
|
+
# won't be ingested to userEvent logs. Thus, a separate userEvent write
|
|
61
|
+
# request is required for event logging.
|
|
62
|
+
# @!attribute [rw] page_size
|
|
63
|
+
# @return [::Integer]
|
|
64
|
+
# Maximum number of results to return per page. Set this property
|
|
65
|
+
# to the number of prediction results needed. If zero, the service will
|
|
66
|
+
# choose a reasonable default. The maximum allowed value is 100. Values
|
|
67
|
+
# above 100 will be coerced to 100.
|
|
68
|
+
# @!attribute [rw] page_token
|
|
69
|
+
# @return [::String]
|
|
70
|
+
# The previous PredictResponse.next_page_token.
|
|
71
|
+
# @!attribute [rw] filter
|
|
72
|
+
# @return [::String]
|
|
73
|
+
# Filter for restricting prediction results with a length limit of 5,000
|
|
74
|
+
# characters. Accepts values for tags and the `filterOutOfStockItems` flag.
|
|
75
|
+
#
|
|
76
|
+
# * Tag expressions. Restricts predictions to products that match all of the
|
|
77
|
+
# specified tags. Boolean operators `OR` and `NOT` are supported if the
|
|
78
|
+
# expression is enclosed in parentheses, and must be separated from the
|
|
79
|
+
# tag values by a space. `-"tagA"` is also supported and is equivalent to
|
|
80
|
+
# `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
|
|
81
|
+
# with a size limit of 1,000 characters.
|
|
82
|
+
#
|
|
83
|
+
# * filterOutOfStockItems. Restricts predictions to products that do not
|
|
84
|
+
# have a
|
|
85
|
+
# stockState value of OUT_OF_STOCK.
|
|
86
|
+
#
|
|
87
|
+
# Examples:
|
|
88
|
+
#
|
|
89
|
+
# * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
|
|
90
|
+
# * filterOutOfStockItems tag=(-"promotional")
|
|
91
|
+
# * filterOutOfStockItems
|
|
92
|
+
#
|
|
93
|
+
# If your filter blocks all prediction results, nothing will be returned. If
|
|
94
|
+
# you want generic (unfiltered) popular products to be returned instead, set
|
|
95
|
+
# `strictFiltering` to false in `PredictRequest.params`.
|
|
96
|
+
# @!attribute [rw] validate_only
|
|
97
|
+
# @return [::Boolean]
|
|
98
|
+
# Use validate only mode for this prediction query. If set to true, a
|
|
99
|
+
# dummy model will be used that returns arbitrary products.
|
|
100
|
+
# Note that the validate only mode should only be used for testing the API,
|
|
101
|
+
# or if the model is not ready.
|
|
102
|
+
# @!attribute [rw] params
|
|
103
|
+
# @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
|
|
104
|
+
# Additional domain specific parameters for the predictions.
|
|
105
|
+
#
|
|
106
|
+
# Allowed values:
|
|
107
|
+
#
|
|
108
|
+
# * `returnProduct`: Boolean. If set to true, the associated product
|
|
109
|
+
# object will be returned in the `results.metadata` field in the
|
|
110
|
+
# prediction response.
|
|
111
|
+
# * `returnScore`: Boolean. If set to true, the prediction 'score'
|
|
112
|
+
# corresponding to each returned product will be set in the
|
|
113
|
+
# `results.metadata` field in the prediction response. The given
|
|
114
|
+
# 'score' indicates the probability of an product being clicked/purchased
|
|
115
|
+
# given the user's context and history.
|
|
116
|
+
# * `strictFiltering`: Boolean. True by default. If set to false, the service
|
|
117
|
+
# will return generic (unfiltered) popular products instead of empty if
|
|
118
|
+
# your filter blocks all prediction results.
|
|
119
|
+
# @!attribute [rw] labels
|
|
120
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
|
121
|
+
# The labels for the predict request.
|
|
122
|
+
#
|
|
123
|
+
# * Label keys can contain lowercase letters, digits and hyphens, must start
|
|
124
|
+
# with a letter, and must end with a letter or digit.
|
|
125
|
+
# * Non-zero label values can contain lowercase letters, digits and hyphens,
|
|
126
|
+
# must start with a letter, and must end with a letter or digit.
|
|
127
|
+
# * No more than 64 labels can be associated with a given request.
|
|
128
|
+
#
|
|
129
|
+
# See https://goo.gl/xmQnxf for more information on and examples of labels.
|
|
130
|
+
class PredictRequest
|
|
131
|
+
include ::Google::Protobuf::MessageExts
|
|
132
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
133
|
+
|
|
134
|
+
# @!attribute [rw] key
|
|
135
|
+
# @return [::String]
|
|
136
|
+
# @!attribute [rw] value
|
|
137
|
+
# @return [::Google::Protobuf::Value]
|
|
138
|
+
class ParamsEntry
|
|
139
|
+
include ::Google::Protobuf::MessageExts
|
|
140
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# @!attribute [rw] key
|
|
144
|
+
# @return [::String]
|
|
145
|
+
# @!attribute [rw] value
|
|
146
|
+
# @return [::String]
|
|
147
|
+
class LabelsEntry
|
|
148
|
+
include ::Google::Protobuf::MessageExts
|
|
149
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Response message for predict method.
|
|
154
|
+
# @!attribute [rw] results
|
|
155
|
+
# @return [::Array<::Google::Cloud::Retail::V2::PredictResponse::PredictionResult>]
|
|
156
|
+
# A list of recommended products. The order represents the ranking (from the
|
|
157
|
+
# most relevant product to the least).
|
|
158
|
+
# @!attribute [rw] attribution_token
|
|
159
|
+
# @return [::String]
|
|
160
|
+
# A unique attribution token. This should be included in the
|
|
161
|
+
# {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this
|
|
162
|
+
# recommendation, which enables accurate attribution of recommendation model
|
|
163
|
+
# performance.
|
|
164
|
+
# @!attribute [rw] missing_ids
|
|
165
|
+
# @return [::Array<::String>]
|
|
166
|
+
# IDs of products in the request that were missing from the inventory.
|
|
167
|
+
# @!attribute [rw] validate_only
|
|
168
|
+
# @return [::Boolean]
|
|
169
|
+
# True if the validateOnly property was set in the request.
|
|
170
|
+
class PredictResponse
|
|
171
|
+
include ::Google::Protobuf::MessageExts
|
|
172
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
173
|
+
|
|
174
|
+
# PredictionResult represents the recommendation prediction results.
|
|
175
|
+
# @!attribute [rw] id
|
|
176
|
+
# @return [::String]
|
|
177
|
+
# ID of the recommended product
|
|
178
|
+
# @!attribute [rw] metadata
|
|
179
|
+
# @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
|
|
180
|
+
# Additional product metadata / annotations.
|
|
181
|
+
#
|
|
182
|
+
# Possible values:
|
|
183
|
+
#
|
|
184
|
+
# * `product`: JSON representation of the product. Will be set if
|
|
185
|
+
# `returnProduct` is set to true in `PredictRequest.params`.
|
|
186
|
+
# * `score`: Prediction score in double value. Will be set if
|
|
187
|
+
# `returnScore` is set to true in `PredictRequest.params`.
|
|
188
|
+
class PredictionResult
|
|
189
|
+
include ::Google::Protobuf::MessageExts
|
|
190
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
191
|
+
|
|
192
|
+
# @!attribute [rw] key
|
|
193
|
+
# @return [::String]
|
|
194
|
+
# @!attribute [rw] value
|
|
195
|
+
# @return [::Google::Protobuf::Value]
|
|
196
|
+
class MetadataEntry
|
|
197
|
+
include ::Google::Protobuf::MessageExts
|
|
198
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2021 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
module Google
|
|
21
|
+
module Cloud
|
|
22
|
+
module Retail
|
|
23
|
+
module V2
|
|
24
|
+
# Product captures all metadata information of items to be recommended or
|
|
25
|
+
# searched.
|
|
26
|
+
# @!attribute [rw] name
|
|
27
|
+
# @return [::String]
|
|
28
|
+
# Immutable. Full resource name of the product, such as
|
|
29
|
+
# "projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id".
|
|
30
|
+
#
|
|
31
|
+
# The branch ID must be "default_branch".
|
|
32
|
+
# @!attribute [rw] id
|
|
33
|
+
# @return [::String]
|
|
34
|
+
# Immutable. {::Google::Cloud::Retail::V2::Product Product} identifier, which is
|
|
35
|
+
# the final component of {::Google::Cloud::Retail::V2::Product#name name}. For
|
|
36
|
+
# example, this field is "id_1", if
|
|
37
|
+
# {::Google::Cloud::Retail::V2::Product#name name} is
|
|
38
|
+
# "projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1".
|
|
39
|
+
#
|
|
40
|
+
# This field must be a UTF-8 encoded string with a length limit of 128
|
|
41
|
+
# characters. Otherwise, an INVALID_ARGUMENT error is returned.
|
|
42
|
+
#
|
|
43
|
+
# Google Merchant Center property
|
|
44
|
+
# [id](https://support.google.com/merchants/answer/6324405). Schema.org
|
|
45
|
+
# Property [Product.sku](https://schema.org/sku).
|
|
46
|
+
# @!attribute [rw] type
|
|
47
|
+
# @return [::Google::Cloud::Retail::V2::Product::Type]
|
|
48
|
+
# Immutable. The type of the product. This field is output-only.
|
|
49
|
+
# @!attribute [rw] primary_product_id
|
|
50
|
+
# @return [::String]
|
|
51
|
+
# Variant group identifier. Must be an
|
|
52
|
+
# {::Google::Cloud::Retail::V2::Product#id id}, with the same parent branch with
|
|
53
|
+
# this product. Otherwise, an error is thrown.
|
|
54
|
+
#
|
|
55
|
+
# For {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
|
|
56
|
+
# {::Google::Cloud::Retail::V2::Product Product}s, this field can only be empty or
|
|
57
|
+
# set to the same value as {::Google::Cloud::Retail::V2::Product#id id}.
|
|
58
|
+
#
|
|
59
|
+
# For VARIANT {::Google::Cloud::Retail::V2::Product Product}s, this field cannot
|
|
60
|
+
# be empty. A maximum of 2,000 products are allowed to share the same
|
|
61
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
|
|
62
|
+
# {::Google::Cloud::Retail::V2::Product Product}. Otherwise, an INVALID_ARGUMENT
|
|
63
|
+
# error is returned.
|
|
64
|
+
#
|
|
65
|
+
# Google Merchant Center Property
|
|
66
|
+
# [item_group_id](https://support.google.com/merchants/answer/6324507).
|
|
67
|
+
# Schema.org Property
|
|
68
|
+
# [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID).
|
|
69
|
+
#
|
|
70
|
+
# This field must be enabled before it can be used. [Learn
|
|
71
|
+
# more](/recommendations-ai/docs/catalog#item-group-id).
|
|
72
|
+
# @!attribute [rw] categories
|
|
73
|
+
# @return [::Array<::String>]
|
|
74
|
+
# Product categories. This field is repeated for supporting one product
|
|
75
|
+
# belonging to several parallel categories. Strongly recommended using the
|
|
76
|
+
# full path for better search / recommendation quality.
|
|
77
|
+
#
|
|
78
|
+
#
|
|
79
|
+
# To represent full path of category, use '>' sign to separate different
|
|
80
|
+
# hierarchies. If '>' is part of the category name, please replace it with
|
|
81
|
+
# other character(s).
|
|
82
|
+
#
|
|
83
|
+
# For example, if a shoes product belongs to both
|
|
84
|
+
# ["Shoes & Accessories" -> "Shoes"] and
|
|
85
|
+
# ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be
|
|
86
|
+
# represented as:
|
|
87
|
+
#
|
|
88
|
+
# "categories": [
|
|
89
|
+
# "Shoes & Accessories > Shoes",
|
|
90
|
+
# "Sports & Fitness > Athletic Clothing > Shoes"
|
|
91
|
+
# ]
|
|
92
|
+
#
|
|
93
|
+
# Must be set for {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
|
|
94
|
+
# {::Google::Cloud::Retail::V2::Product Product} otherwise an INVALID_ARGUMENT
|
|
95
|
+
# error is returned.
|
|
96
|
+
#
|
|
97
|
+
# At most 250 values are allowed per
|
|
98
|
+
# {::Google::Cloud::Retail::V2::Product Product}. Empty values are not allowed.
|
|
99
|
+
# Each value must be a UTF-8 encoded string with a length limit of 5,000
|
|
100
|
+
# characters. Otherwise, an INVALID_ARGUMENT error is returned.
|
|
101
|
+
#
|
|
102
|
+
# Google Merchant Center property
|
|
103
|
+
# [google_product_category][mc_google_product_category]. Schema.org property
|
|
104
|
+
# [Product.category] (https://schema.org/category).
|
|
105
|
+
#
|
|
106
|
+
# [mc_google_product_category]:
|
|
107
|
+
# https://support.google.com/merchants/answer/6324436
|
|
108
|
+
# @!attribute [rw] title
|
|
109
|
+
# @return [::String]
|
|
110
|
+
# Required. Product title.
|
|
111
|
+
#
|
|
112
|
+
# This field must be a UTF-8 encoded string with a length limit of 128
|
|
113
|
+
# characters. Otherwise, an INVALID_ARGUMENT error is returned.
|
|
114
|
+
#
|
|
115
|
+
# Google Merchant Center property
|
|
116
|
+
# [title](https://support.google.com/merchants/answer/6324415). Schema.org
|
|
117
|
+
# property [Product.name](https://schema.org/name).
|
|
118
|
+
# @!attribute [rw] description
|
|
119
|
+
# @return [::String]
|
|
120
|
+
# Product description.
|
|
121
|
+
#
|
|
122
|
+
# This field must be a UTF-8 encoded string with a length limit of 5,000
|
|
123
|
+
# characters. Otherwise, an INVALID_ARGUMENT error is returned.
|
|
124
|
+
#
|
|
125
|
+
# Google Merchant Center property
|
|
126
|
+
# [description](https://support.google.com/merchants/answer/6324468).
|
|
127
|
+
# schema.org property [Product.description](https://schema.org/description).
|
|
128
|
+
# @!attribute [rw] attributes
|
|
129
|
+
# @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}]
|
|
130
|
+
# Highly encouraged. Extra product attributes to be included. For example,
|
|
131
|
+
# for products, this could include the store name, vendor, style, color, etc.
|
|
132
|
+
# These are very strong signals for recommendation model, thus we highly
|
|
133
|
+
# recommend providing the attributes here.
|
|
134
|
+
#
|
|
135
|
+
# Features that can take on one of a limited number of possible values. Two
|
|
136
|
+
# types of features can be set are:
|
|
137
|
+
#
|
|
138
|
+
# Textual features. some examples would be the brand/maker of a product, or
|
|
139
|
+
# country of a customer. Numerical features. Some examples would be the
|
|
140
|
+
# height/weight of a product, or age of a customer.
|
|
141
|
+
#
|
|
142
|
+
# For example: `{ "vendor": {"text": ["vendor123", "vendor456"]},
|
|
143
|
+
# "lengths_cm": \\{"numbers":[2.3, 15.4]}, "heights_cm": \\{"numbers":[8.1, 6.4]}
|
|
144
|
+
# }`.
|
|
145
|
+
#
|
|
146
|
+
# A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
|
|
147
|
+
# error is returned.
|
|
148
|
+
#
|
|
149
|
+
# The key must be a UTF-8 encoded string with a length limit of 5,000
|
|
150
|
+
# characters. Otherwise, an INVALID_ARGUMENT error is returned.
|
|
151
|
+
# @!attribute [rw] tags
|
|
152
|
+
# @return [::Array<::String>]
|
|
153
|
+
# Custom tags associated with the product.
|
|
154
|
+
#
|
|
155
|
+
# At most 250 values are allowed per
|
|
156
|
+
# {::Google::Cloud::Retail::V2::Product Product}. This value must be a UTF-8
|
|
157
|
+
# encoded string with a length limit of 1,000 characters. Otherwise, an
|
|
158
|
+
# INVALID_ARGUMENT error is returned.
|
|
159
|
+
#
|
|
160
|
+
# This tag can be used for filtering recommendation results by passing the
|
|
161
|
+
# tag as part of the
|
|
162
|
+
# {::Google::Cloud::Retail::V2::PredictRequest#filter PredictRequest.filter}.
|
|
163
|
+
#
|
|
164
|
+
# Google Merchant Center property
|
|
165
|
+
# [custom_label_0–4](https://support.google.com/merchants/answer/6324473).
|
|
166
|
+
# @!attribute [rw] price_info
|
|
167
|
+
# @return [::Google::Cloud::Retail::V2::PriceInfo]
|
|
168
|
+
# Product price and cost information.
|
|
169
|
+
#
|
|
170
|
+
# Google Merchant Center property
|
|
171
|
+
# [price](https://support.google.com/merchants/answer/6324371).
|
|
172
|
+
# @!attribute [rw] available_time
|
|
173
|
+
# @return [::Google::Protobuf::Timestamp]
|
|
174
|
+
# The timestamp when this {::Google::Cloud::Retail::V2::Product Product} becomes
|
|
175
|
+
# available recommendation and search.
|
|
176
|
+
# @!attribute [rw] availability
|
|
177
|
+
# @return [::Google::Cloud::Retail::V2::Product::Availability]
|
|
178
|
+
# The online availability of the {::Google::Cloud::Retail::V2::Product Product}.
|
|
179
|
+
# Default to
|
|
180
|
+
# {::Google::Cloud::Retail::V2::Product::Availability::IN_STOCK Availability.IN_STOCK}.
|
|
181
|
+
#
|
|
182
|
+
# Google Merchant Center Property
|
|
183
|
+
# [availability](https://support.google.com/merchants/answer/6324448).
|
|
184
|
+
# Schema.org Property [Offer.availability](https://schema.org/availability).
|
|
185
|
+
# @!attribute [rw] available_quantity
|
|
186
|
+
# @return [::Google::Protobuf::Int32Value]
|
|
187
|
+
# The available quantity of the item.
|
|
188
|
+
# @!attribute [rw] uri
|
|
189
|
+
# @return [::String]
|
|
190
|
+
# Canonical URL directly linking to the product detail page.
|
|
191
|
+
#
|
|
192
|
+
# This field must be a UTF-8 encoded string with a length limit of 5,000
|
|
193
|
+
# characters. Otherwise, an INVALID_ARGUMENT error is returned.
|
|
194
|
+
#
|
|
195
|
+
# Google Merchant Center property
|
|
196
|
+
# [link](https://support.google.com/merchants/answer/6324416). Schema.org
|
|
197
|
+
# property [Offer.url](https://schema.org/url).
|
|
198
|
+
# @!attribute [rw] images
|
|
199
|
+
# @return [::Array<::Google::Cloud::Retail::V2::Image>]
|
|
200
|
+
# Product images for the product.
|
|
201
|
+
#
|
|
202
|
+
# A maximum of 300 images are allowed.
|
|
203
|
+
#
|
|
204
|
+
# Google Merchant Center property
|
|
205
|
+
# [image_link](https://support.google.com/merchants/answer/6324350).
|
|
206
|
+
# Schema.org property [Product.image](https://schema.org/image).
|
|
207
|
+
class Product
|
|
208
|
+
include ::Google::Protobuf::MessageExts
|
|
209
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
210
|
+
|
|
211
|
+
# @!attribute [rw] key
|
|
212
|
+
# @return [::String]
|
|
213
|
+
# @!attribute [rw] value
|
|
214
|
+
# @return [::Google::Cloud::Retail::V2::CustomAttribute]
|
|
215
|
+
class AttributesEntry
|
|
216
|
+
include ::Google::Protobuf::MessageExts
|
|
217
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# The type of this product.
|
|
221
|
+
module Type
|
|
222
|
+
# Default value. Default to
|
|
223
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} if unset.
|
|
224
|
+
TYPE_UNSPECIFIED = 0
|
|
225
|
+
|
|
226
|
+
# The primary type.
|
|
227
|
+
#
|
|
228
|
+
# As the primary unit for predicting, indexing and search serving, a
|
|
229
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
|
|
230
|
+
# {::Google::Cloud::Retail::V2::Product Product} is grouped with multiple
|
|
231
|
+
# {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}
|
|
232
|
+
# {::Google::Cloud::Retail::V2::Product Product}s.
|
|
233
|
+
PRIMARY = 1
|
|
234
|
+
|
|
235
|
+
# The variant type.
|
|
236
|
+
#
|
|
237
|
+
# {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}
|
|
238
|
+
# {::Google::Cloud::Retail::V2::Product Product}s usually share some common
|
|
239
|
+
# attributes on the same
|
|
240
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
|
|
241
|
+
# {::Google::Cloud::Retail::V2::Product Product}s, but they have variant
|
|
242
|
+
# attributes like different colors, sizes and prices, etc.
|
|
243
|
+
VARIANT = 2
|
|
244
|
+
|
|
245
|
+
# The collection type. Collection products are bundled
|
|
246
|
+
# {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
|
|
247
|
+
# {::Google::Cloud::Retail::V2::Product Product}s or
|
|
248
|
+
# {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}
|
|
249
|
+
# {::Google::Cloud::Retail::V2::Product Product}s that are sold together, such
|
|
250
|
+
# as a jewelry set with necklaces, earrings and rings, etc.
|
|
251
|
+
COLLECTION = 3
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Product availability. If this field is unspecified, the product is
|
|
255
|
+
# assumed to be in stock.
|
|
256
|
+
module Availability
|
|
257
|
+
# Default product availability. Default to
|
|
258
|
+
# {::Google::Cloud::Retail::V2::Product::Availability::IN_STOCK Availability.IN_STOCK}
|
|
259
|
+
# if unset.
|
|
260
|
+
AVAILABILITY_UNSPECIFIED = 0
|
|
261
|
+
|
|
262
|
+
# Product in stock.
|
|
263
|
+
IN_STOCK = 1
|
|
264
|
+
|
|
265
|
+
# Product out of stock.
|
|
266
|
+
OUT_OF_STOCK = 2
|
|
267
|
+
|
|
268
|
+
# Product that is in pre-order state.
|
|
269
|
+
PREORDER = 3
|
|
270
|
+
|
|
271
|
+
# Product that is back-ordered (i.e. temporarily out of stock).
|
|
272
|
+
BACKORDER = 4
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
end
|