Debian Codegraph @

docs/dyn/retail_v2.projects.locations.catalogs.models.html

raw
1 <html><body>
2 <style>
3
4 body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13 }
14
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51 }
52
53 .toc_element {
54 margin-top: 0.5em;
55 }
56
57 .firstline {
58 margin-left: 2 em;
59 }
60
61 .method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66 }
67
68 .details {
69 font-weight: bold;
70 font-size: 14px;
71 }
72
73 </style>
74
75 <h1><a href="retail_v2.html">Vertex AI Search for commerce API</a> . <a href="retail_v2.projects.html">projects</a> . <a href="retail_v2.projects.locations.html">locations</a> . <a href="retail_v2.projects.locations.catalogs.html">catalogs</a> . <a href="retail_v2.projects.locations.catalogs.models.html">models</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="#close">close()</a></code></p>
79 <p class="firstline">Close httplib2 connections.</p>
80 <p class="toc_element">
81 <code><a href="#create">create(parent, body=None, dryRun=None, x__xgafv=None)</a></code></p>
82 <p class="firstline">Creates a new model.</p>
83 <p class="toc_element">
84 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
85 <p class="firstline">Deletes an existing model.</p>
86 <p class="toc_element">
87 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
88 <p class="firstline">Gets a model.</p>
89 <p class="toc_element">
90 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
91 <p class="firstline">Lists all the models linked to this event store.</p>
92 <p class="toc_element">
93 <code><a href="#list_next">list_next()</a></code></p>
94 <p class="firstline">Retrieves the next page of results.</p>
95 <p class="toc_element">
96 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
97 <p class="firstline">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.</p>
98 <p class="toc_element">
99 <code><a href="#pause">pause(name, body=None, x__xgafv=None)</a></code></p>
100 <p class="firstline">Pauses the training of an existing model.</p>
101 <p class="toc_element">
102 <code><a href="#resume">resume(name, body=None, x__xgafv=None)</a></code></p>
103 <p class="firstline">Resumes the training of an existing model.</p>
104 <p class="toc_element">
105 <code><a href="#tune">tune(name, body=None, x__xgafv=None)</a></code></p>
106 <p class="firstline">Tunes an existing model.</p>
107 <h3>Method Details</h3>
108 <div class="method">
109 <code class="details" id="close">close()</code>
110 <pre>Close httplib2 connections.</pre>
111 </div>
112
113 <div class="method">
114 <code class="details" id="create">create(parent, body=None, dryRun=None, x__xgafv=None)</code>
115 <pre>Creates a new model.
116
117 Args:
118 parent: string, Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` (required)
119 body: object, The request body.
120 The object takes the form of:
121
122 { # 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.
123 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
124 &quot;dataState&quot;: &quot;A String&quot;, # 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.
125 &quot;displayName&quot;: &quot;A String&quot;, # 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.
126 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
127 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
128 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
129 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
130 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
131 },
132 },
133 &quot;name&quot;: &quot;A String&quot;, # 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.
134 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
135 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
136 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
137 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
138 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
139 &quot;A String&quot;,
140 ],
141 },
142 ],
143 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
144 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
145 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
146 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
147 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
148 }
149
150 dryRun: boolean, Optional. Whether to run a dry run to validate the request (without actually creating the model).
151 x__xgafv: string, V1 error format.
152 Allowed values
153 1 - v1 error format
154 2 - v2 error format
155
156 Returns:
157 An object of the form:
158
159 { # This resource represents a long-running operation that is the result of a network API call.
160 &quot;done&quot;: True or False, # 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.
161 &quot;error&quot;: { # 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). # The error result of the operation in case of failure or cancellation.
162 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
163 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
164 {
165 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
166 },
167 ],
168 &quot;message&quot;: &quot;A String&quot;, # 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.
169 },
170 &quot;metadata&quot;: { # 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.
171 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
172 },
173 &quot;name&quot;: &quot;A String&quot;, # 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}`.
174 &quot;response&quot;: { # The normal, successful response of the operation. 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`.
175 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
176 },
177 }</pre>
178 </div>
179
180 <div class="method">
181 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
182 <pre>Deletes an existing model.
183
184 Args:
185 name: string, Required. The resource name of the Model to delete. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
186 x__xgafv: string, V1 error format.
187 Allowed values
188 1 - v1 error format
189 2 - v2 error format
190
191 Returns:
192 An object of the form:
193
194 { # 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); }
195 }</pre>
196 </div>
197
198 <div class="method">
199 <code class="details" id="get">get(name, x__xgafv=None)</code>
200 <pre>Gets a model.
201
202 Args:
203 name: string, Required. The resource name of the Model to get. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` (required)
204 x__xgafv: string, V1 error format.
205 Allowed values
206 1 - v1 error format
207 2 - v2 error format
208
209 Returns:
210 An object of the form:
211
212 { # 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.
213 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
214 &quot;dataState&quot;: &quot;A String&quot;, # 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.
215 &quot;displayName&quot;: &quot;A String&quot;, # 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.
216 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
217 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
218 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
219 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
220 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
221 },
222 },
223 &quot;name&quot;: &quot;A String&quot;, # 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.
224 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
225 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
226 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
227 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
228 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
229 &quot;A String&quot;,
230 ],
231 },
232 ],
233 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
234 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
235 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
236 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
237 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
238 }</pre>
239 </div>
240
241 <div class="method">
242 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
243 <pre>Lists all the models linked to this event store.
244
245 Args:
246 parent: string, Required. The parent for which to list models. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` (required)
247 pageSize: integer, Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.
248 pageToken: string, Optional. A page token, received from a previous `ListModels` call. Provide this to retrieve the subsequent page.
249 x__xgafv: string, V1 error format.
250 Allowed values
251 1 - v1 error format
252 2 - v2 error format
253
254 Returns:
255 An object of the form:
256
257 { # Response to a ListModelRequest.
258 &quot;models&quot;: [ # List of Models.
259 { # 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.
260 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
261 &quot;dataState&quot;: &quot;A String&quot;, # 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.
262 &quot;displayName&quot;: &quot;A String&quot;, # 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.
263 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
264 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
265 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
266 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
267 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
268 },
269 },
270 &quot;name&quot;: &quot;A String&quot;, # 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.
271 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
272 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
273 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
274 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
275 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
276 &quot;A String&quot;,
277 ],
278 },
279 ],
280 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
281 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
282 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
283 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
284 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
285 },
286 ],
287 &quot;nextPageToken&quot;: &quot;A String&quot;, # Pagination token, if not returned indicates the last page.
288 }</pre>
289 </div>
290
291 <div class="method">
292 <code class="details" id="list_next">list_next()</code>
293 <pre>Retrieves the next page of results.
294
295 Args:
296 previous_request: The request for the previous page. (required)
297 previous_response: The response from the request for the previous page. (required)
298
299 Returns:
300 A request object that you can call &#x27;execute()&#x27; on to request the next
301 page. Returns None if there are no more items in the collection.
302 </pre>
303 </div>
304
305 <div class="method">
306 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
307 <pre>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.
308
309 Args:
310 name: string, 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. (required)
311 body: object, The request body.
312 The object takes the form of:
313
314 { # 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.
315 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
316 &quot;dataState&quot;: &quot;A String&quot;, # 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.
317 &quot;displayName&quot;: &quot;A String&quot;, # 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.
318 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
319 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
320 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
321 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
322 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
323 },
324 },
325 &quot;name&quot;: &quot;A String&quot;, # 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.
326 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
327 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
328 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
329 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
330 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
331 &quot;A String&quot;,
332 ],
333 },
334 ],
335 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
336 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
337 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
338 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
339 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
340 }
341
342 updateMask: string, Optional. Indicates which fields in the provided &#x27;model&#x27; to update. If not set, by default updates all fields.
343 x__xgafv: string, V1 error format.
344 Allowed values
345 1 - v1 error format
346 2 - v2 error format
347
348 Returns:
349 An object of the form:
350
351 { # 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.
352 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
353 &quot;dataState&quot;: &quot;A String&quot;, # 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.
354 &quot;displayName&quot;: &quot;A String&quot;, # 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.
355 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
356 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
357 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
358 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
359 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
360 },
361 },
362 &quot;name&quot;: &quot;A String&quot;, # 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.
363 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
364 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
365 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
366 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
367 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
368 &quot;A String&quot;,
369 ],
370 },
371 ],
372 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
373 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
374 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
375 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
376 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
377 }</pre>
378 </div>
379
380 <div class="method">
381 <code class="details" id="pause">pause(name, body=None, x__xgafv=None)</code>
382 <pre>Pauses the training of an existing model.
383
384 Args:
385 name: string, Required. The name of the model to pause. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
386 body: object, The request body.
387 The object takes the form of:
388
389 { # Request for pausing training of a model.
390 }
391
392 x__xgafv: string, V1 error format.
393 Allowed values
394 1 - v1 error format
395 2 - v2 error format
396
397 Returns:
398 An object of the form:
399
400 { # 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.
401 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
402 &quot;dataState&quot;: &quot;A String&quot;, # 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.
403 &quot;displayName&quot;: &quot;A String&quot;, # 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.
404 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
405 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
406 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
407 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
408 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
409 },
410 },
411 &quot;name&quot;: &quot;A String&quot;, # 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.
412 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
413 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
414 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
415 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
416 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
417 &quot;A String&quot;,
418 ],
419 },
420 ],
421 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
422 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
423 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
424 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
425 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
426 }</pre>
427 </div>
428
429 <div class="method">
430 <code class="details" id="resume">resume(name, body=None, x__xgafv=None)</code>
431 <pre>Resumes the training of an existing model.
432
433 Args:
434 name: string, Required. The name of the model to resume. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
435 body: object, The request body.
436 The object takes the form of:
437
438 { # Request for resuming training of a model.
439 }
440
441 x__xgafv: string, V1 error format.
442 Allowed values
443 1 - v1 error format
444 2 - v2 error format
445
446 Returns:
447 An object of the form:
448
449 { # 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.
450 &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp the Recommendation Model was created at.
451 &quot;dataState&quot;: &quot;A String&quot;, # 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.
452 &quot;displayName&quot;: &quot;A String&quot;, # 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.
453 &quot;filteringOption&quot;: &quot;A String&quot;, # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering by attributes is enabled for the model.
454 &quot;lastTuneTime&quot;: &quot;A String&quot;, # Output only. The timestamp when the latest successful tune finished.
455 &quot;modelFeaturesConfig&quot;: { # Additional model features config. # Optional. Additional model features config.
456 &quot;frequentlyBoughtTogetherConfig&quot;: { # Additional configs for the frequently-bought-together model type. # Additional configs for frequently-bought-together models.
457 &quot;contextProductsType&quot;: &quot;A String&quot;, # Optional. Specifies the context of the model when it is used in predict requests. Can only be set for the `frequently-bought-together` type. If it isn&#x27;t specified, it defaults to MULTIPLE_CONTEXT_PRODUCTS.
458 },
459 },
460 &quot;name&quot;: &quot;A String&quot;, # 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.
461 &quot;optimizationObjective&quot;: &quot;A String&quot;, # 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` =&gt; `ctr` `others-you-may-like` =&gt; `ctr` `frequently-bought-together` =&gt; `revenue_per_order` This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
462 &quot;periodicTuningState&quot;: &quot;A String&quot;, # 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`.
463 &quot;servingConfigLists&quot;: [ # Output only. The list of valid serving configs associated with the PageOptimizationConfig.
464 { # Represents an ordered combination of valid serving configs, which can be used for `PAGE_OPTIMIZATION` recommendations.
465 &quot;servingConfigIds&quot;: [ # Optional. A set of valid serving configs that may be used for `PAGE_OPTIMIZATION`.
466 &quot;A String&quot;,
467 ],
468 },
469 ],
470 &quot;servingState&quot;: &quot;A String&quot;, # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
471 &quot;trainingState&quot;: &quot;A String&quot;, # 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.
472 &quot;tuningOperation&quot;: &quot;A String&quot;, # 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.
473 &quot;type&quot;: &quot;A String&quot;, # 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`, `on-sale-items`, and `recently-viewed`(readonly value). This field together with optimization_objective describe model metadata to use to control model training and serving. See https://cloud.google.com/retail/docs/models for more details on what the model metadata control and which combination of parameters are valid. For invalid combinations of parameters (e.g. type = `frequently-bought-together` and optimization_objective = `ctr`), you receive an error 400 if you try to create/update a recommendation with this set of knobs.
474 &quot;updateTime&quot;: &quot;A String&quot;, # 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.
475 }</pre>
476 </div>
477
478 <div class="method">
479 <code class="details" id="tune">tune(name, body=None, x__xgafv=None)</code>
480 <pre>Tunes an existing model.
481
482 Args:
483 name: string, Required. The resource name of the model to tune. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` (required)
484 body: object, The request body.
485 The object takes the form of:
486
487 { # Request to manually start a tuning process now (instead of waiting for the periodically scheduled tuning to happen).
488 }
489
490 x__xgafv: string, V1 error format.
491 Allowed values
492 1 - v1 error format
493 2 - v2 error format
494
495 Returns:
496 An object of the form:
497
498 { # This resource represents a long-running operation that is the result of a network API call.
499 &quot;done&quot;: True or False, # 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.
500 &quot;error&quot;: { # 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). # The error result of the operation in case of failure or cancellation.
501 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
502 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
503 {
504 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
505 },
506 ],
507 &quot;message&quot;: &quot;A String&quot;, # 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.
508 },
509 &quot;metadata&quot;: { # 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.
510 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
511 },
512 &quot;name&quot;: &quot;A String&quot;, # 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}`.
513 &quot;response&quot;: { # The normal, successful response of the operation. 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`.
514 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
515 },
516 }</pre>
517 </div>
518
519 </body></html>