Skip to content

Commit 5bcaac1

Browse files
feat: release Model Services to v2beta version (#333)
- [ ] Regenerate this pull request now. feat: release BatchRemoveCatalogAttributes API to v2beta version feat: release ExactSearchableOption for attribute config to v2beta version feat: release diversity_type for ServingConfig in v2beta version feat: add local inventories info to the Product resource feat: deprecate unused page_token field of PredictionRequest in v2beta version feat: deprecate unused facet_spec field of Control in v2beta version docs: improve documentation of SearchRequest for Search Personalization docs: improve documentation for Fullfillment and Inventory API in ProductService docs: minor documentation fixes and improvements PiperOrigin-RevId: 471846764 Source-Link: googleapis/googleapis@1513294 Source-Link: googleapis/googleapis-gen@c371ea8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzM3MWVhOGRmMmUzNDk0MDg3NWQ1MTIwMGNkNTdlMzAwYTJiYzBhOCJ9
1 parent 66b9999 commit 5bcaac1

File tree

78 files changed

+11000
-393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+11000
-393
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ModelService
2+
------------------------------
3+
4+
.. automodule:: google.cloud.retail_v2beta.services.model_service
5+
:members:
6+
:inherited-members:
7+
8+
.. automodule:: google.cloud.retail_v2beta.services.model_service.pagers
9+
:members:
10+
:inherited-members:

packages/google-cloud-retail/docs/retail_v2beta/services.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Services for Google Cloud Retail v2beta API
66
catalog_service
77
completion_service
88
control_service
9+
model_service
910
prediction_service
1011
product_service
1112
search_service

packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
CompletionServiceClient,
2121
)
2222
from .services.control_service import ControlServiceAsyncClient, ControlServiceClient
23+
from .services.model_service import ModelServiceAsyncClient, ModelServiceClient
2324
from .services.prediction_service import (
2425
PredictionServiceAsyncClient,
2526
PredictionServiceClient,
@@ -45,6 +46,8 @@
4546
)
4647
from .types.catalog_service import (
4748
AddCatalogAttributeRequest,
49+
BatchRemoveCatalogAttributesRequest,
50+
BatchRemoveCatalogAttributesResponse,
4851
GetAttributesConfigRequest,
4952
GetCompletionConfigRequest,
5053
GetDefaultBranchRequest,
@@ -112,6 +115,20 @@
112115
UserEventInlineSource,
113116
UserEventInputConfig,
114117
)
118+
from .types.model import Model
119+
from .types.model_service import (
120+
CreateModelMetadata,
121+
CreateModelRequest,
122+
DeleteModelRequest,
123+
ListModelsRequest,
124+
ListModelsResponse,
125+
PauseModelRequest,
126+
ResumeModelRequest,
127+
TuneModelMetadata,
128+
TuneModelRequest,
129+
TuneModelResponse,
130+
UpdateModelRequest,
131+
)
115132
from .types.prediction_service import PredictRequest, PredictResponse
116133
from .types.product import Product
117134
from .types.product_service import (
@@ -173,6 +190,7 @@
173190
"CatalogServiceAsyncClient",
174191
"CompletionServiceAsyncClient",
175192
"ControlServiceAsyncClient",
193+
"ModelServiceAsyncClient",
176194
"PredictionServiceAsyncClient",
177195
"ProductServiceAsyncClient",
178196
"SearchServiceAsyncClient",
@@ -189,6 +207,8 @@
189207
"AttributeConfigLevel",
190208
"AttributesConfig",
191209
"Audience",
210+
"BatchRemoveCatalogAttributesRequest",
211+
"BatchRemoveCatalogAttributesResponse",
192212
"BigQueryOutputResult",
193213
"BigQuerySource",
194214
"Catalog",
@@ -206,10 +226,13 @@
206226
"Control",
207227
"ControlServiceClient",
208228
"CreateControlRequest",
229+
"CreateModelMetadata",
230+
"CreateModelRequest",
209231
"CreateProductRequest",
210232
"CreateServingConfigRequest",
211233
"CustomAttribute",
212234
"DeleteControlRequest",
235+
"DeleteModelRequest",
213236
"DeleteProductRequest",
214237
"DeleteServingConfigRequest",
215238
"ExportErrorsConfig",
@@ -239,14 +262,19 @@
239262
"ListCatalogsResponse",
240263
"ListControlsRequest",
241264
"ListControlsResponse",
265+
"ListModelsRequest",
266+
"ListModelsResponse",
242267
"ListProductsRequest",
243268
"ListProductsResponse",
244269
"ListServingConfigsRequest",
245270
"ListServingConfigsResponse",
246271
"LocalInventory",
247272
"MerchantCenterLink",
248273
"MerchantCenterLinkingConfig",
274+
"Model",
275+
"ModelServiceClient",
249276
"OutputResult",
277+
"PauseModelRequest",
250278
"PredictRequest",
251279
"PredictResponse",
252280
"PredictionServiceClient",
@@ -276,6 +304,7 @@
276304
"RemoveLocalInventoriesRequest",
277305
"RemoveLocalInventoriesResponse",
278306
"ReplaceCatalogAttributeRequest",
307+
"ResumeModelRequest",
279308
"Rule",
280309
"SearchRequest",
281310
"SearchResponse",
@@ -288,10 +317,14 @@
288317
"SetInventoryRequest",
289318
"SetInventoryResponse",
290319
"SolutionType",
320+
"TuneModelMetadata",
321+
"TuneModelRequest",
322+
"TuneModelResponse",
291323
"UpdateAttributesConfigRequest",
292324
"UpdateCatalogRequest",
293325
"UpdateCompletionConfigRequest",
294326
"UpdateControlRequest",
327+
"UpdateModelRequest",
295328
"UpdateProductRequest",
296329
"UpdateServingConfigRequest",
297330
"UserEvent",

packages/google-cloud-retail/google/cloud/retail_v2beta/gapic_metadata.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"add_catalog_attribute"
1616
]
1717
},
18+
"BatchRemoveCatalogAttributes": {
19+
"methods": [
20+
"batch_remove_catalog_attributes"
21+
]
22+
},
1823
"GetAttributesConfig": {
1924
"methods": [
2025
"get_attributes_config"
@@ -75,6 +80,11 @@
7580
"add_catalog_attribute"
7681
]
7782
},
83+
"BatchRemoveCatalogAttributes": {
84+
"methods": [
85+
"batch_remove_catalog_attributes"
86+
]
87+
},
7888
"GetAttributesConfig": {
7989
"methods": [
8090
"get_attributes_config"
@@ -227,6 +237,90 @@
227237
}
228238
}
229239
},
240+
"ModelService": {
241+
"clients": {
242+
"grpc": {
243+
"libraryClient": "ModelServiceClient",
244+
"rpcs": {
245+
"CreateModel": {
246+
"methods": [
247+
"create_model"
248+
]
249+
},
250+
"DeleteModel": {
251+
"methods": [
252+
"delete_model"
253+
]
254+
},
255+
"ListModels": {
256+
"methods": [
257+
"list_models"
258+
]
259+
},
260+
"PauseModel": {
261+
"methods": [
262+
"pause_model"
263+
]
264+
},
265+
"ResumeModel": {
266+
"methods": [
267+
"resume_model"
268+
]
269+
},
270+
"TuneModel": {
271+
"methods": [
272+
"tune_model"
273+
]
274+
},
275+
"UpdateModel": {
276+
"methods": [
277+
"update_model"
278+
]
279+
}
280+
}
281+
},
282+
"grpc-async": {
283+
"libraryClient": "ModelServiceAsyncClient",
284+
"rpcs": {
285+
"CreateModel": {
286+
"methods": [
287+
"create_model"
288+
]
289+
},
290+
"DeleteModel": {
291+
"methods": [
292+
"delete_model"
293+
]
294+
},
295+
"ListModels": {
296+
"methods": [
297+
"list_models"
298+
]
299+
},
300+
"PauseModel": {
301+
"methods": [
302+
"pause_model"
303+
]
304+
},
305+
"ResumeModel": {
306+
"methods": [
307+
"resume_model"
308+
]
309+
},
310+
"TuneModel": {
311+
"methods": [
312+
"tune_model"
313+
]
314+
},
315+
"UpdateModel": {
316+
"methods": [
317+
"update_model"
318+
]
319+
}
320+
}
321+
}
322+
}
323+
},
230324
"PredictionService": {
231325
"clients": {
232326
"grpc": {

packages/google-cloud-retail/google/cloud/retail_v2beta/services/catalog_service/async_client.py

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ async def sample_get_completion_config():
705705
method.
706706
name (:class:`str`):
707707
Required. Full CompletionConfig resource name. Format:
708-
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
708+
``projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig``
709709
710710
This corresponds to the ``name`` field
711711
on the ``request`` instance; if ``request`` is provided, this
@@ -1282,6 +1282,88 @@ async def sample_remove_catalog_attribute():
12821282
# Done; return the response.
12831283
return response
12841284

1285+
async def batch_remove_catalog_attributes(
1286+
self,
1287+
request: Union[
1288+
catalog_service.BatchRemoveCatalogAttributesRequest, dict
1289+
] = None,
1290+
*,
1291+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1292+
timeout: float = None,
1293+
metadata: Sequence[Tuple[str, str]] = (),
1294+
) -> catalog_service.BatchRemoveCatalogAttributesResponse:
1295+
r"""Removes all specified
1296+
[CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s
1297+
from the
1298+
[AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
1299+
1300+
.. code-block:: python
1301+
1302+
from google.cloud import retail_v2beta
1303+
1304+
async def sample_batch_remove_catalog_attributes():
1305+
# Create a client
1306+
client = retail_v2beta.CatalogServiceAsyncClient()
1307+
1308+
# Initialize request argument(s)
1309+
request = retail_v2beta.BatchRemoveCatalogAttributesRequest(
1310+
attributes_config="attributes_config_value",
1311+
attribute_keys=['attribute_keys_value_1', 'attribute_keys_value_2'],
1312+
)
1313+
1314+
# Make the request
1315+
response = await client.batch_remove_catalog_attributes(request=request)
1316+
1317+
# Handle the response
1318+
print(response)
1319+
1320+
Args:
1321+
request (Union[google.cloud.retail_v2beta.types.BatchRemoveCatalogAttributesRequest, dict]):
1322+
The request object. Request for
1323+
[CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes]
1324+
method.
1325+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1326+
should be retried.
1327+
timeout (float): The timeout for this request.
1328+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1329+
sent along with the request as metadata.
1330+
1331+
Returns:
1332+
google.cloud.retail_v2beta.types.BatchRemoveCatalogAttributesResponse:
1333+
Response of the
1334+
[CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes].
1335+
1336+
"""
1337+
# Create or coerce a protobuf request object.
1338+
request = catalog_service.BatchRemoveCatalogAttributesRequest(request)
1339+
1340+
# Wrap the RPC method; this adds retry and timeout information,
1341+
# and friendly error handling.
1342+
rpc = gapic_v1.method_async.wrap_method(
1343+
self._client._transport.batch_remove_catalog_attributes,
1344+
default_timeout=None,
1345+
client_info=DEFAULT_CLIENT_INFO,
1346+
)
1347+
1348+
# Certain fields should be provided within the metadata header;
1349+
# add these here.
1350+
metadata = tuple(metadata) + (
1351+
gapic_v1.routing_header.to_grpc_metadata(
1352+
(("attributes_config", request.attributes_config),)
1353+
),
1354+
)
1355+
1356+
# Send the request.
1357+
response = await rpc(
1358+
request,
1359+
retry=retry,
1360+
timeout=timeout,
1361+
metadata=metadata,
1362+
)
1363+
1364+
# Done; return the response.
1365+
return response
1366+
12851367
async def replace_catalog_attribute(
12861368
self,
12871369
request: Union[catalog_service.ReplaceCatalogAttributeRequest, dict] = None,

0 commit comments

Comments
 (0)