-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
b2c14e7
commit 7b28642
Showing
17 changed files
with
2,048 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
..._samples/retail_v2beta_generated_catalog_service_batch_remove_catalog_attributes_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for BatchRemoveCatalogAttributes | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_async] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
async def sample_batch_remove_catalog_attributes(): | ||
# Create a client | ||
client = retail_v2beta.CatalogServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
request = retail_v2beta.BatchRemoveCatalogAttributesRequest( | ||
attributes_config="attributes_config_value", | ||
attribute_keys=['attribute_keys_value_1', 'attribute_keys_value_2'], | ||
) | ||
|
||
# Make the request | ||
response = await client.batch_remove_catalog_attributes(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_async] |
46 changes: 46 additions & 0 deletions
46
...d_samples/retail_v2beta_generated_catalog_service_batch_remove_catalog_attributes_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for BatchRemoveCatalogAttributes | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_sync] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
def sample_batch_remove_catalog_attributes(): | ||
# Create a client | ||
client = retail_v2beta.CatalogServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = retail_v2beta.BatchRemoveCatalogAttributesRequest( | ||
attributes_config="attributes_config_value", | ||
attribute_keys=['attribute_keys_value_1', 'attribute_keys_value_2'], | ||
) | ||
|
||
# Make the request | ||
response = client.batch_remove_catalog_attributes(request=request) | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_sync] |
55 changes: 55 additions & 0 deletions
55
...ted_samples/generated_samples/retail_v2beta_generated_model_service_create_model_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for CreateModel | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_ModelService_CreateModel_async] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
async def sample_create_model(): | ||
# Create a client | ||
client = retail_v2beta.ModelServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
model = retail_v2beta.Model() | ||
model.name = "name_value" | ||
model.display_name = "display_name_value" | ||
model.type_ = "type__value" | ||
|
||
request = retail_v2beta.CreateModelRequest( | ||
parent="parent_value", | ||
model=model, | ||
) | ||
|
||
# Make the request | ||
operation = client.create_model(request=request) | ||
|
||
print("Waiting for operation to complete...") | ||
|
||
response = await operation.result() | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END retail_v2beta_generated_ModelService_CreateModel_async] |
55 changes: 55 additions & 0 deletions
55
...ated_samples/generated_samples/retail_v2beta_generated_model_service_create_model_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for CreateModel | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_ModelService_CreateModel_sync] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
def sample_create_model(): | ||
# Create a client | ||
client = retail_v2beta.ModelServiceClient() | ||
|
||
# Initialize request argument(s) | ||
model = retail_v2beta.Model() | ||
model.name = "name_value" | ||
model.display_name = "display_name_value" | ||
model.type_ = "type__value" | ||
|
||
request = retail_v2beta.CreateModelRequest( | ||
parent="parent_value", | ||
model=model, | ||
) | ||
|
||
# Make the request | ||
operation = client.create_model(request=request) | ||
|
||
print("Waiting for operation to complete...") | ||
|
||
response = operation.result() | ||
|
||
# Handle the response | ||
print(response) | ||
|
||
# [END retail_v2beta_generated_ModelService_CreateModel_sync] |
43 changes: 43 additions & 0 deletions
43
...ted_samples/generated_samples/retail_v2beta_generated_model_service_delete_model_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for DeleteModel | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_ModelService_DeleteModel_async] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
async def sample_delete_model(): | ||
# Create a client | ||
client = retail_v2beta.ModelServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
request = retail_v2beta.DeleteModelRequest( | ||
name="name_value", | ||
) | ||
|
||
# Make the request | ||
await client.delete_model(request=request) | ||
|
||
|
||
# [END retail_v2beta_generated_ModelService_DeleteModel_async] |
43 changes: 43 additions & 0 deletions
43
...ated_samples/generated_samples/retail_v2beta_generated_model_service_delete_model_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for DeleteModel | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_ModelService_DeleteModel_sync] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
def sample_delete_model(): | ||
# Create a client | ||
client = retail_v2beta.ModelServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = retail_v2beta.DeleteModelRequest( | ||
name="name_value", | ||
) | ||
|
||
# Make the request | ||
client.delete_model(request=request) | ||
|
||
|
||
# [END retail_v2beta_generated_ModelService_DeleteModel_sync] |
46 changes: 46 additions & 0 deletions
46
...ated_samples/generated_samples/retail_v2beta_generated_model_service_list_models_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for ListModels | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_ModelService_ListModels_async] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
async def sample_list_models(): | ||
# Create a client | ||
client = retail_v2beta.ModelServiceAsyncClient() | ||
|
||
# Initialize request argument(s) | ||
request = retail_v2beta.ListModelsRequest( | ||
parent="parent_value", | ||
) | ||
|
||
# Make the request | ||
page_result = client.list_models(request=request) | ||
|
||
# Handle the response | ||
async for response in page_result: | ||
print(response) | ||
|
||
# [END retail_v2beta_generated_ModelService_ListModels_async] |
46 changes: 46 additions & 0 deletions
46
...rated_samples/generated_samples/retail_v2beta_generated_model_service_list_models_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Generated code. DO NOT EDIT! | ||
# | ||
# Snippet for ListModels | ||
# NOTE: This snippet has been automatically generated for illustrative purposes only. | ||
# It may require modifications to work in your environment. | ||
|
||
# To install the latest published package dependency, execute the following: | ||
# python3 -m pip install google-cloud-retail | ||
|
||
|
||
# [START retail_v2beta_generated_ModelService_ListModels_sync] | ||
from google.cloud import retail_v2beta | ||
|
||
|
||
def sample_list_models(): | ||
# Create a client | ||
client = retail_v2beta.ModelServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = retail_v2beta.ListModelsRequest( | ||
parent="parent_value", | ||
) | ||
|
||
# Make the request | ||
page_result = client.list_models(request=request) | ||
|
||
# Handle the response | ||
for response in page_result: | ||
print(response) | ||
|
||
# [END retail_v2beta_generated_ModelService_ListModels_sync] |
Oops, something went wrong.