google-cloud-recommendation_engine-v1beta1 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.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-recommendation_engine-v1beta1.rb +21 -0
  7. data/lib/google/cloud/recommendation_engine/v1beta1.rb +38 -0
  8. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb +50 -0
  9. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +831 -0
  10. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb +51 -0
  11. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +570 -0
  12. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb +73 -0
  13. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb +53 -0
  14. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +554 -0
  15. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb +51 -0
  16. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb +77 -0
  17. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb +49 -0
  18. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +468 -0
  19. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb +51 -0
  20. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb +56 -0
  21. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb +50 -0
  22. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +820 -0
  23. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb +51 -0
  24. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +570 -0
  25. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb +54 -0
  26. data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +28 -0
  27. data/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +77 -0
  28. data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +59 -0
  29. data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb +61 -0
  30. data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +32 -0
  31. data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +91 -0
  32. data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +48 -0
  33. data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb +53 -0
  34. data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +49 -0
  35. data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb +48 -0
  36. data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +19 -0
  37. data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +84 -0
  38. data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +68 -0
  39. data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb +66 -0
  40. data/proto_docs/README.md +4 -0
  41. data/proto_docs/google/api/field_behavior.rb +59 -0
  42. data/proto_docs/google/api/httpbody.rb +75 -0
  43. data/proto_docs/google/api/resource.rb +283 -0
  44. data/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb +214 -0
  45. data/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb +110 -0
  46. data/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb +89 -0
  47. data/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb +206 -0
  48. data/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb +88 -0
  49. data/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb +212 -0
  50. data/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb +367 -0
  51. data/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb +191 -0
  52. data/proto_docs/google/longrunning/operations.rb +150 -0
  53. data/proto_docs/google/protobuf/any.rb +138 -0
  54. data/proto_docs/google/protobuf/empty.rb +36 -0
  55. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  56. data/proto_docs/google/protobuf/struct.rb +96 -0
  57. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  58. data/proto_docs/google/rpc/status.rb +46 -0
  59. data/proto_docs/google/type/date.rb +50 -0
  60. metadata +242 -0
@@ -0,0 +1,212 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 RecommendationEngine
23
+ module V1beta1
24
+ # Request message for Predict method.
25
+ # @!attribute [rw] name
26
+ # @return [::String]
27
+ # Required. Full resource name of the format:
28
+ # \\{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/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 items frequently bought together with one or
35
+ # more catalog items 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 items like this.
48
+ #
49
+ # * `recently_viewed_default`: Returns up to 75 items recently viewed by the
50
+ # specified `userId` or `visitorId`, most recent ones first. Returns
51
+ # nothing if neither of them has viewed any items 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/datafeeds/default_catalog/dashboard
56
+ # @!attribute [rw] user_event
57
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::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
+ # Optional. Maximum number of results to return per page. Set this property
65
+ # to the number of prediction results required. If zero, the service will
66
+ # choose a reasonable default.
67
+ # @!attribute [rw] page_token
68
+ # @return [::String]
69
+ # Optional. The previous PredictResponse.next_page_token.
70
+ # @!attribute [rw] filter
71
+ # @return [::String]
72
+ # Optional. Filter for restricting prediction results. Accepts values for
73
+ # tags and the `filterOutOfStockItems` flag.
74
+ #
75
+ # * Tag expressions. Restricts predictions to items that match all of the
76
+ # specified tags. Boolean operators `OR` and `NOT` are supported if the
77
+ # expression is enclosed in parentheses, and must be separated from the
78
+ # tag values by a space. `-"tagA"` is also supported and is equivalent to
79
+ # `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
80
+ # with a size limit of 1 KiB.
81
+ #
82
+ # * filterOutOfStockItems. Restricts predictions to items that do not have a
83
+ # stockState value of OUT_OF_STOCK.
84
+ #
85
+ # Examples:
86
+ #
87
+ # * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional")
88
+ # * filterOutOfStockItems tag=(-"promotional")
89
+ # * filterOutOfStockItems
90
+ # @!attribute [rw] dry_run
91
+ # @return [::Boolean]
92
+ # Optional. Use dryRun mode for this prediction query. If set to true, a
93
+ # dummy model will be used that returns arbitrary catalog items.
94
+ # Note that the dryRun mode should only be used for testing the API, or if
95
+ # the model is not ready.
96
+ # @!attribute [rw] params
97
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
98
+ # Optional. Additional domain specific parameters for the predictions.
99
+ #
100
+ # Allowed values:
101
+ #
102
+ # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem
103
+ # object will be returned in the
104
+ # `PredictResponse.PredictionResult.itemMetadata` object in the method
105
+ # response.
106
+ # * `returnItemScore`: Boolean. If set to true, the prediction 'score'
107
+ # corresponding to each returned item will be set in the `metadata`
108
+ # field in the prediction response. The given 'score' indicates the
109
+ # probability of an item being clicked/purchased given the user's context
110
+ # and history.
111
+ # @!attribute [rw] labels
112
+ # @return [::Google::Protobuf::Map{::String => ::String}]
113
+ # Optional. The labels for the predict request.
114
+ #
115
+ # * Label keys can contain lowercase letters, digits and hyphens, must start
116
+ # with a letter, and must end with a letter or digit.
117
+ # * Non-zero label values can contain lowercase letters, digits and hyphens,
118
+ # must start with a letter, and must end with a letter or digit.
119
+ # * No more than 64 labels can be associated with a given request.
120
+ #
121
+ # See https://goo.gl/xmQnxf for more information on and examples of labels.
122
+ class PredictRequest
123
+ include ::Google::Protobuf::MessageExts
124
+ extend ::Google::Protobuf::MessageExts::ClassMethods
125
+
126
+ # @!attribute [rw] key
127
+ # @return [::String]
128
+ # @!attribute [rw] value
129
+ # @return [::Google::Protobuf::Value]
130
+ class ParamsEntry
131
+ include ::Google::Protobuf::MessageExts
132
+ extend ::Google::Protobuf::MessageExts::ClassMethods
133
+ end
134
+
135
+ # @!attribute [rw] key
136
+ # @return [::String]
137
+ # @!attribute [rw] value
138
+ # @return [::String]
139
+ class LabelsEntry
140
+ include ::Google::Protobuf::MessageExts
141
+ extend ::Google::Protobuf::MessageExts::ClassMethods
142
+ end
143
+ end
144
+
145
+ # Response message for predict method.
146
+ # @!attribute [rw] results
147
+ # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>]
148
+ # A list of recommended items. The order represents the ranking (from the
149
+ # most relevant item to the least).
150
+ # @!attribute [rw] recommendation_token
151
+ # @return [::String]
152
+ # A unique recommendation token. This should be included in the user event
153
+ # logs resulting from this recommendation, which enables accurate attribution
154
+ # of recommendation model performance.
155
+ # @!attribute [rw] items_missing_in_catalog
156
+ # @return [::Array<::String>]
157
+ # IDs of items in the request that were missing from the catalog.
158
+ # @!attribute [rw] dry_run
159
+ # @return [::Boolean]
160
+ # True if the dryRun property was set in the request.
161
+ # @!attribute [rw] metadata
162
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
163
+ # Additional domain specific prediction response metadata.
164
+ # @!attribute [rw] next_page_token
165
+ # @return [::String]
166
+ # If empty, the list is complete. If nonempty, the token to pass to the next
167
+ # request's PredictRequest.page_token.
168
+ class PredictResponse
169
+ include ::Google::Protobuf::MessageExts
170
+ extend ::Google::Protobuf::MessageExts::ClassMethods
171
+
172
+ # PredictionResult represents the recommendation prediction results.
173
+ # @!attribute [rw] id
174
+ # @return [::String]
175
+ # ID of the recommended catalog item
176
+ # @!attribute [rw] item_metadata
177
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
178
+ # Additional item metadata / annotations.
179
+ #
180
+ # Possible values:
181
+ #
182
+ # * `catalogItem`: JSON representation of the catalogItem. Will be set if
183
+ # `returnCatalogItem` is set to true in `PredictRequest.params`.
184
+ # * `score`: Prediction score in double value. Will be set if
185
+ # `returnItemScore` is set to true in `PredictRequest.params`.
186
+ class PredictionResult
187
+ include ::Google::Protobuf::MessageExts
188
+ extend ::Google::Protobuf::MessageExts::ClassMethods
189
+
190
+ # @!attribute [rw] key
191
+ # @return [::String]
192
+ # @!attribute [rw] value
193
+ # @return [::Google::Protobuf::Value]
194
+ class ItemMetadataEntry
195
+ include ::Google::Protobuf::MessageExts
196
+ extend ::Google::Protobuf::MessageExts::ClassMethods
197
+ end
198
+ end
199
+
200
+ # @!attribute [rw] key
201
+ # @return [::String]
202
+ # @!attribute [rw] value
203
+ # @return [::Google::Protobuf::Value]
204
+ class MetadataEntry
205
+ include ::Google::Protobuf::MessageExts
206
+ extend ::Google::Protobuf::MessageExts::ClassMethods
207
+ end
208
+ end
209
+ end
210
+ end
211
+ end
212
+ end
@@ -0,0 +1,367 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 RecommendationEngine
23
+ module V1beta1
24
+ # UserEvent captures all metadata information recommendation engine needs to
25
+ # know about how end users interact with customers' website.
26
+ # @!attribute [rw] event_type
27
+ # @return [::String]
28
+ # Required. User event type. Allowed values are:
29
+ #
30
+ # * `add-to-cart` Products being added to cart.
31
+ # * `add-to-list` Items being added to a list (shopping list, favorites
32
+ # etc).
33
+ # * `category-page-view` Special pages such as sale or promotion pages
34
+ # viewed.
35
+ # * `checkout-start` User starting a checkout process.
36
+ # * `detail-page-view` Products detail page viewed.
37
+ # * `home-page-view` Homepage viewed.
38
+ # * `page-visit` Generic page visits not included in the event types above.
39
+ # * `purchase-complete` User finishing a purchase.
40
+ # * `refund` Purchased items being refunded or returned.
41
+ # * `remove-from-cart` Products being removed from cart.
42
+ # * `remove-from-list` Items being removed from a list.
43
+ # * `search` Product search.
44
+ # * `shopping-cart-page-view` User viewing a shopping cart.
45
+ # * `impression` List of items displayed. Used by Google Tag Manager.
46
+ # @!attribute [rw] user_info
47
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserInfo]
48
+ # Required. User information.
49
+ # @!attribute [rw] event_detail
50
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::EventDetail]
51
+ # Optional. User event detailed information common across different
52
+ # recommendation types.
53
+ # @!attribute [rw] product_event_detail
54
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail]
55
+ # Optional. Retail product specific user event metadata.
56
+ #
57
+ # This field is required for the following event types:
58
+ #
59
+ # * `add-to-cart`
60
+ # * `add-to-list`
61
+ # * `category-page-view`
62
+ # * `checkout-start`
63
+ # * `detail-page-view`
64
+ # * `purchase-complete`
65
+ # * `refund`
66
+ # * `remove-from-cart`
67
+ # * `remove-from-list`
68
+ # * `search`
69
+ #
70
+ # This field is optional for the following event types:
71
+ #
72
+ # * `page-visit`
73
+ # * `shopping-cart-page-view` - note that 'product_event_detail' should be
74
+ # set for this unless the shopping cart is empty.
75
+ #
76
+ # This field is not allowed for the following event types:
77
+ #
78
+ # * `home-page-view`
79
+ # @!attribute [rw] event_time
80
+ # @return [::Google::Protobuf::Timestamp]
81
+ # Optional. Only required for ImportUserEvents method. Timestamp of user
82
+ # event created.
83
+ # @!attribute [rw] event_source
84
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource]
85
+ # Optional. This field should *not* be set when using JavaScript pixel
86
+ # or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
87
+ class UserEvent
88
+ include ::Google::Protobuf::MessageExts
89
+ extend ::Google::Protobuf::MessageExts::ClassMethods
90
+
91
+ # User event source.
92
+ module EventSource
93
+ # Unspecified event source.
94
+ EVENT_SOURCE_UNSPECIFIED = 0
95
+
96
+ # The event is ingested via a javascript pixel or Recommendations AI Tag
97
+ # through automl datalayer or JS Macros.
98
+ AUTOML = 1
99
+
100
+ # The event is ingested via Recommendations AI Tag through Enhanced
101
+ # Ecommerce datalayer.
102
+ ECOMMERCE = 2
103
+
104
+ # The event is ingested via Import user events API.
105
+ BATCH_UPLOAD = 3
106
+ end
107
+ end
108
+
109
+ # Information of end users.
110
+ # @!attribute [rw] visitor_id
111
+ # @return [::String]
112
+ # Required. A unique identifier for tracking visitors with a length limit of
113
+ # 128 bytes.
114
+ #
115
+ # For example, this could be implemented with a http cookie, which should be
116
+ # able to uniquely identify a visitor on a single device. This unique
117
+ # identifier should not change if the visitor log in/out of the website.
118
+ # Maximum length 128 bytes. Cannot be empty.
119
+ # @!attribute [rw] user_id
120
+ # @return [::String]
121
+ # Optional. Unique identifier for logged-in user with a length limit of 128
122
+ # bytes. Required only for logged-in users.
123
+ # @!attribute [rw] ip_address
124
+ # @return [::String]
125
+ # Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
126
+ # IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
127
+ # set when using the javascript pixel or if `direct_user_request` is set.
128
+ # Used to extract location information for personalization.
129
+ # @!attribute [rw] user_agent
130
+ # @return [::String]
131
+ # Optional. User agent as included in the HTTP header. UTF-8 encoded string
132
+ # with a length limit of 1 KiB.
133
+ #
134
+ # This should *not* be set when using the JavaScript pixel or if
135
+ # `directUserRequest` is set.
136
+ # @!attribute [rw] direct_user_request
137
+ # @return [::Boolean]
138
+ # Optional. Indicates if the request is made directly from the end user
139
+ # in which case the user_agent and ip_address fields can be populated
140
+ # from the HTTP request. This should *not* be set when using the javascript
141
+ # pixel. This flag should be set only if the API request is made directly
142
+ # from the end user such as a mobile app (and not if a gateway or a server is
143
+ # processing and pushing the user events).
144
+ class UserInfo
145
+ include ::Google::Protobuf::MessageExts
146
+ extend ::Google::Protobuf::MessageExts::ClassMethods
147
+ end
148
+
149
+ # User event details shared by all recommendation types.
150
+ # @!attribute [rw] uri
151
+ # @return [::String]
152
+ # Optional. Complete url (window.location.href) of the user's current page.
153
+ # When using the JavaScript pixel, this value is filled in automatically.
154
+ # Maximum length 5KB.
155
+ # @!attribute [rw] referrer_uri
156
+ # @return [::String]
157
+ # Optional. The referrer url of the current page. When using
158
+ # the JavaScript pixel, this value is filled in automatically.
159
+ # @!attribute [rw] page_view_id
160
+ # @return [::String]
161
+ # Optional. A unique id of a web page view.
162
+ # This should be kept the same for all user events triggered from the same
163
+ # pageview. For example, an item detail page view could trigger multiple
164
+ # events as the user is browsing the page.
165
+ # The `pageViewId` property should be kept the same for all these events so
166
+ # that they can be grouped together properly. This `pageViewId` will be
167
+ # automatically generated if using the JavaScript pixel.
168
+ # @!attribute [rw] experiment_ids
169
+ # @return [::Array<::String>]
170
+ # Optional. A list of identifiers for the independent experiment groups
171
+ # this user event belongs to. This is used to distinguish between user events
172
+ # associated with different experiment setups (e.g. using Recommendation
173
+ # Engine system, using different recommendation models).
174
+ # @!attribute [rw] recommendation_token
175
+ # @return [::String]
176
+ # Optional. Recommendation token included in the recommendation prediction
177
+ # response.
178
+ #
179
+ # This field enables accurate attribution of recommendation model
180
+ # performance.
181
+ #
182
+ # This token enables us to accurately attribute page view or purchase back to
183
+ # the event and the particular predict response containing this
184
+ # clicked/purchased item. If user clicks on product K in the recommendation
185
+ # results, pass the `PredictResponse.recommendationToken` property as a url
186
+ # parameter to product K's page. When recording events on product K's page,
187
+ # log the PredictResponse.recommendation_token to this field.
188
+ #
189
+ # Optional, but highly encouraged for user events that are the result of a
190
+ # recommendation prediction query.
191
+ # @!attribute [rw] event_attributes
192
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap]
193
+ # Optional. Extra user event features to include in the recommendation
194
+ # model.
195
+ #
196
+ # For product recommendation, an example of extra user information is
197
+ # traffic_channel, i.e. how user arrives at the site. Users can arrive
198
+ # at the site by coming to the site directly, or coming through Google
199
+ # search, and etc.
200
+ class EventDetail
201
+ include ::Google::Protobuf::MessageExts
202
+ extend ::Google::Protobuf::MessageExts::ClassMethods
203
+ end
204
+
205
+ # ProductEventDetail captures user event information specific to retail
206
+ # products.
207
+ # @!attribute [rw] search_query
208
+ # @return [::String]
209
+ # Required for `search` events. Other event types should not set this field.
210
+ # The user's search query as UTF-8 encoded text with a length limit of 5 KiB.
211
+ # @!attribute [rw] page_categories
212
+ # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem::CategoryHierarchy>]
213
+ # Required for `category-page-view` events. Other event types should not set
214
+ # this field.
215
+ # The categories associated with a category page.
216
+ # Category pages include special pages such as sales or promotions. For
217
+ # instance, a special sale page may have the category hierarchy:
218
+ # categories : ["Sales", "2017 Black Friday Deals"].
219
+ # @!attribute [rw] product_details
220
+ # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::ProductDetail>]
221
+ # The main product details related to the event.
222
+ #
223
+ # This field is required for the following event types:
224
+ #
225
+ # * `add-to-cart`
226
+ # * `add-to-list`
227
+ # * `checkout-start`
228
+ # * `detail-page-view`
229
+ # * `purchase-complete`
230
+ # * `refund`
231
+ # * `remove-from-cart`
232
+ # * `remove-from-list`
233
+ #
234
+ # This field is optional for the following event types:
235
+ #
236
+ # * `page-visit`
237
+ # * `shopping-cart-page-view` - note that 'product_details' should be set for
238
+ # this unless the shopping cart is empty.
239
+ #
240
+ # This field is not allowed for the following event types:
241
+ #
242
+ # * `category-page-view`
243
+ # * `home-page-view`
244
+ # * `search`
245
+ # @!attribute [rw] list_id
246
+ # @return [::String]
247
+ # Required for `add-to-list` and `remove-from-list` events. The id or name of
248
+ # the list that the item is being added to or removed from. Other event types
249
+ # should not set this field.
250
+ # @!attribute [rw] cart_id
251
+ # @return [::String]
252
+ # Optional. The id or name of the associated shopping cart. This id is used
253
+ # to associate multiple items added or present in the cart before purchase.
254
+ #
255
+ # This can only be set for `add-to-cart`, `remove-from-cart`,
256
+ # `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events.
257
+ # @!attribute [rw] purchase_transaction
258
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::PurchaseTransaction]
259
+ # Optional. A transaction represents the entire purchase transaction.
260
+ # Required for `purchase-complete` events. Optional for `checkout-start`
261
+ # events. Other event types should not set this field.
262
+ class ProductEventDetail
263
+ include ::Google::Protobuf::MessageExts
264
+ extend ::Google::Protobuf::MessageExts::ClassMethods
265
+ end
266
+
267
+ # A transaction represents the entire purchase transaction.
268
+ # @!attribute [rw] id
269
+ # @return [::String]
270
+ # Optional. The transaction ID with a length limit of 128 bytes.
271
+ # @!attribute [rw] revenue
272
+ # @return [::Float]
273
+ # Required. Total revenue or grand total associated with the transaction.
274
+ # This value include shipping, tax, or other adjustments to total revenue
275
+ # that you want to include as part of your revenue calculations. This field
276
+ # is not required if the event type is `refund`.
277
+ # @!attribute [rw] taxes
278
+ # @return [::Google::Protobuf::Map{::String => ::Float}]
279
+ # Optional. All the taxes associated with the transaction.
280
+ # @!attribute [rw] costs
281
+ # @return [::Google::Protobuf::Map{::String => ::Float}]
282
+ # Optional. All the costs associated with the product. These can be
283
+ # manufacturing costs, shipping expenses not borne by the end user, or any
284
+ # other costs.
285
+ #
286
+ # Total product cost such that
287
+ # profit = revenue - (sum(taxes) + sum(costs))
288
+ # If product_cost is not set, then
289
+ # profit = revenue - tax - shipping - sum(CatalogItem.costs).
290
+ #
291
+ # If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
292
+ # based profit *cannot* be calculated for this Transaction.
293
+ # @!attribute [rw] currency_code
294
+ # @return [::String]
295
+ # Required. Currency code. Use three-character ISO-4217 code. This field
296
+ # is not required if the event type is `refund`.
297
+ class PurchaseTransaction
298
+ include ::Google::Protobuf::MessageExts
299
+ extend ::Google::Protobuf::MessageExts::ClassMethods
300
+
301
+ # @!attribute [rw] key
302
+ # @return [::String]
303
+ # @!attribute [rw] value
304
+ # @return [::Float]
305
+ class TaxesEntry
306
+ include ::Google::Protobuf::MessageExts
307
+ extend ::Google::Protobuf::MessageExts::ClassMethods
308
+ end
309
+
310
+ # @!attribute [rw] key
311
+ # @return [::String]
312
+ # @!attribute [rw] value
313
+ # @return [::Float]
314
+ class CostsEntry
315
+ include ::Google::Protobuf::MessageExts
316
+ extend ::Google::Protobuf::MessageExts::ClassMethods
317
+ end
318
+ end
319
+
320
+ # Detailed product information associated with a user event.
321
+ # @!attribute [rw] id
322
+ # @return [::String]
323
+ # Required. Catalog item ID. UTF-8 encoded string with a length limit of 128
324
+ # characters.
325
+ # @!attribute [rw] currency_code
326
+ # @return [::String]
327
+ # Optional. Currency code for price/costs. Use three-character ISO-4217
328
+ # code. Required only if originalPrice or displayPrice is set.
329
+ # @!attribute [rw] original_price
330
+ # @return [::Float]
331
+ # Optional. Original price of the product. If provided, this will override
332
+ # the original price in Catalog for this product.
333
+ # @!attribute [rw] display_price
334
+ # @return [::Float]
335
+ # Optional. Display price of the product (e.g. discounted price). If
336
+ # provided, this will override the display price in Catalog for this product.
337
+ # @!attribute [rw] stock_state
338
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState]
339
+ # Optional. Item stock state. If provided, this overrides the stock state
340
+ # in Catalog for items in this event.
341
+ # @!attribute [rw] quantity
342
+ # @return [::Integer]
343
+ # Optional. Quantity of the product associated with the user event. For
344
+ # example, this field will be 2 if two products are added to the shopping
345
+ # cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`,
346
+ # `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event
347
+ # types.
348
+ # @!attribute [rw] available_quantity
349
+ # @return [::Integer]
350
+ # Optional. Quantity of the products in stock when a user event happens.
351
+ # Optional. If provided, this overrides the available quantity in Catalog for
352
+ # this event. and can only be set if `stock_status` is set to `IN_STOCK`.
353
+ #
354
+ # Note that if an item is out of stock, you must set the `stock_state` field
355
+ # to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not
356
+ # sufficient to mark the item out of stock.
357
+ # @!attribute [rw] item_attributes
358
+ # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap]
359
+ # Optional. Extra features associated with a product in the user event.
360
+ class ProductDetail
361
+ include ::Google::Protobuf::MessageExts
362
+ extend ::Google::Protobuf::MessageExts::ClassMethods
363
+ end
364
+ end
365
+ end
366
+ end
367
+ end