From ece59bddf984c214a66ee3c2e1c19b3c845bbda8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 12:32:12 +0000 Subject: [PATCH] feat: new model service to manage recommendation models (#304) - [ ] Regenerate this pull request now. feat: support case insensitive match on search facets feat: allow disabling spell check in search requests feat: allow adding labels in search requests feat: allow returning min/max values on search numeric facets feat: allow using serving configs as an alias of placements feat: allow enabling recommendation filtering on custom attributes feat: return output BigQuery table on product / event export response feat: allow skiping default branch protection when doing product full import docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 464664497 Source-Link: https://github.com/googleapis/googleapis/commit/c30c9ccfd90bebbe16375d19a666e2651e81931f Source-Link: https://github.com/googleapis/googleapis-gen/commit/a7fe8d672b8cbbadc5ab32253dea50e4c3d8e390 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTdmZThkNjcyYjhjYmJhZGM1YWIzMjI1M2RlYTUwZTRjM2Q4ZTM5MCJ9 feat: support case insensitive match on search facets feat: allow to return min/max values on search numeric facets feat: allow to use serving configs as an alias of placements docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 464560246 Source-Link: https://github.com/googleapis/googleapis/commit/139f56eefb531a0d47bd52720160103a2b9e7fe5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eca9b7ecbdc2c64c2d0ec2e6688f6353aff162ef Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWNhOWI3ZWNiZGMyYzY0YzJkMGVjMmU2Njg4ZjYzNTNhZmYxNjJlZiJ9 --- ...erated_model_service_create_model_async.py | 58 + ...nerated_model_service_create_model_sync.py | 58 + ...erated_model_service_delete_model_async.py | 43 + ...nerated_model_service_delete_model_sync.py | 43 + ...nerated_model_service_list_models_async.py | 46 + ...enerated_model_service_list_models_sync.py | 46 + ...nerated_model_service_pause_model_async.py | 45 + ...enerated_model_service_pause_model_sync.py | 45 + ...erated_model_service_resume_model_async.py | 45 + ...nerated_model_service_resume_model_sync.py | 45 + ...enerated_model_service_tune_model_async.py | 49 + ...generated_model_service_tune_model_sync.py | 49 + ...erated_model_service_update_model_async.py | 53 + ...nerated_model_service_update_model_sync.py | 53 + .../snippet_metadata_retail_v2alpha.json | 1137 +++++++++++++++++ 15 files changed, 1815 insertions(+) create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_sync.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_sync.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_sync.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_sync.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_sync.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_sync.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_async.py create mode 100644 generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_sync.py diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py new file mode 100644 index 000000000000..7a9f490c2778 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_async.py @@ -0,0 +1,58 @@ +# -*- 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_v2alpha_generated_ModelService_CreateModel_async] +from google.cloud import retail_v2alpha + + +async def sample_create_model(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + model = retail_v2alpha.Model() + model.page_optimization_config.page_optimization_event_type = "page_optimization_event_type_value" + model.page_optimization_config.panels.candidates.serving_config_id = "serving_config_id_value" + model.page_optimization_config.panels.default_candidate.serving_config_id = "serving_config_id_value" + model.name = "name_value" + model.display_name = "display_name_value" + model.type_ = "type__value" + + request = retail_v2alpha.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_v2alpha_generated_ModelService_CreateModel_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_sync.py new file mode 100644 index 000000000000..037ea033f9df --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_create_model_sync.py @@ -0,0 +1,58 @@ +# -*- 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_v2alpha_generated_ModelService_CreateModel_sync] +from google.cloud import retail_v2alpha + + +def sample_create_model(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + model = retail_v2alpha.Model() + model.page_optimization_config.page_optimization_event_type = "page_optimization_event_type_value" + model.page_optimization_config.panels.candidates.serving_config_id = "serving_config_id_value" + model.page_optimization_config.panels.default_candidate.serving_config_id = "serving_config_id_value" + model.name = "name_value" + model.display_name = "display_name_value" + model.type_ = "type__value" + + request = retail_v2alpha.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_v2alpha_generated_ModelService_CreateModel_sync] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_async.py new file mode 100644 index 000000000000..fa5552b1717f --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_async.py @@ -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_v2alpha_generated_ModelService_DeleteModel_async] +from google.cloud import retail_v2alpha + + +async def sample_delete_model(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.DeleteModelRequest( + name="name_value", + ) + + # Make the request + await client.delete_model(request=request) + + +# [END retail_v2alpha_generated_ModelService_DeleteModel_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_sync.py new file mode 100644 index 000000000000..54e9f1d0646c --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_delete_model_sync.py @@ -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_v2alpha_generated_ModelService_DeleteModel_sync] +from google.cloud import retail_v2alpha + + +def sample_delete_model(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.DeleteModelRequest( + name="name_value", + ) + + # Make the request + client.delete_model(request=request) + + +# [END retail_v2alpha_generated_ModelService_DeleteModel_sync] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_async.py new file mode 100644 index 000000000000..d1089b1ecabf --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_async.py @@ -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_v2alpha_generated_ModelService_ListModels_async] +from google.cloud import retail_v2alpha + + +async def sample_list_models(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.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_v2alpha_generated_ModelService_ListModels_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_sync.py new file mode 100644 index 000000000000..a00e68f841bf --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_list_models_sync.py @@ -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_v2alpha_generated_ModelService_ListModels_sync] +from google.cloud import retail_v2alpha + + +def sample_list_models(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.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_v2alpha_generated_ModelService_ListModels_sync] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_async.py new file mode 100644 index 000000000000..cbad0ae84c01 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_async.py @@ -0,0 +1,45 @@ +# -*- 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 PauseModel +# 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_v2alpha_generated_ModelService_PauseModel_async] +from google.cloud import retail_v2alpha + + +async def sample_pause_model(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.PauseModelRequest( + name="name_value", + ) + + # Make the request + response = await client.pause_model(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_PauseModel_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_sync.py new file mode 100644 index 000000000000..e51730170655 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_pause_model_sync.py @@ -0,0 +1,45 @@ +# -*- 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 PauseModel +# 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_v2alpha_generated_ModelService_PauseModel_sync] +from google.cloud import retail_v2alpha + + +def sample_pause_model(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.PauseModelRequest( + name="name_value", + ) + + # Make the request + response = client.pause_model(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_PauseModel_sync] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_async.py new file mode 100644 index 000000000000..b71a1d247d54 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_async.py @@ -0,0 +1,45 @@ +# -*- 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 ResumeModel +# 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_v2alpha_generated_ModelService_ResumeModel_async] +from google.cloud import retail_v2alpha + + +async def sample_resume_model(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.ResumeModelRequest( + name="name_value", + ) + + # Make the request + response = await client.resume_model(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_ResumeModel_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_sync.py new file mode 100644 index 000000000000..1399fb652b68 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_resume_model_sync.py @@ -0,0 +1,45 @@ +# -*- 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 ResumeModel +# 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_v2alpha_generated_ModelService_ResumeModel_sync] +from google.cloud import retail_v2alpha + + +def sample_resume_model(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.ResumeModelRequest( + name="name_value", + ) + + # Make the request + response = client.resume_model(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_ResumeModel_sync] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py new file mode 100644 index 000000000000..350cfd691766 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_async.py @@ -0,0 +1,49 @@ +# -*- 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 TuneModel +# 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_v2alpha_generated_ModelService_TuneModel_async] +from google.cloud import retail_v2alpha + + +async def sample_tune_model(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + request = retail_v2alpha.TuneModelRequest( + name="name_value", + ) + + # Make the request + operation = client.tune_model(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_TuneModel_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_sync.py new file mode 100644 index 000000000000..473a2d0dca6c --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_tune_model_sync.py @@ -0,0 +1,49 @@ +# -*- 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 TuneModel +# 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_v2alpha_generated_ModelService_TuneModel_sync] +from google.cloud import retail_v2alpha + + +def sample_tune_model(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + request = retail_v2alpha.TuneModelRequest( + name="name_value", + ) + + # Make the request + operation = client.tune_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_TuneModel_sync] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_async.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_async.py new file mode 100644 index 000000000000..321cbb4a4019 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_async.py @@ -0,0 +1,53 @@ +# -*- 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 UpdateModel +# 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_v2alpha_generated_ModelService_UpdateModel_async] +from google.cloud import retail_v2alpha + + +async def sample_update_model(): + # Create a client + client = retail_v2alpha.ModelServiceAsyncClient() + + # Initialize request argument(s) + model = retail_v2alpha.Model() + model.page_optimization_config.page_optimization_event_type = "page_optimization_event_type_value" + model.page_optimization_config.panels.candidates.serving_config_id = "serving_config_id_value" + model.page_optimization_config.panels.default_candidate.serving_config_id = "serving_config_id_value" + model.name = "name_value" + model.display_name = "display_name_value" + model.type_ = "type__value" + + request = retail_v2alpha.UpdateModelRequest( + model=model, + ) + + # Make the request + response = await client.update_model(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_UpdateModel_async] diff --git a/generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_sync.py b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_sync.py new file mode 100644 index 000000000000..041154c483a0 --- /dev/null +++ b/generated_samples/generated_samples/retail_v2alpha_generated_model_service_update_model_sync.py @@ -0,0 +1,53 @@ +# -*- 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 UpdateModel +# 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_v2alpha_generated_ModelService_UpdateModel_sync] +from google.cloud import retail_v2alpha + + +def sample_update_model(): + # Create a client + client = retail_v2alpha.ModelServiceClient() + + # Initialize request argument(s) + model = retail_v2alpha.Model() + model.page_optimization_config.page_optimization_event_type = "page_optimization_event_type_value" + model.page_optimization_config.panels.candidates.serving_config_id = "serving_config_id_value" + model.page_optimization_config.panels.default_candidate.serving_config_id = "serving_config_id_value" + model.name = "name_value" + model.display_name = "display_name_value" + model.type_ = "type__value" + + request = retail_v2alpha.UpdateModelRequest( + model=model, + ) + + # Make the request + response = client.update_model(request=request) + + # Handle the response + print(response) + +# [END retail_v2alpha_generated_ModelService_UpdateModel_sync] diff --git a/generated_samples/generated_samples/snippet_metadata_retail_v2alpha.json b/generated_samples/generated_samples/snippet_metadata_retail_v2alpha.json index ea2cf419b108..5faec18c8512 100644 --- a/generated_samples/generated_samples/snippet_metadata_retail_v2alpha.json +++ b/generated_samples/generated_samples/snippet_metadata_retail_v2alpha.json @@ -2904,6 +2904,1143 @@ ], "title": "retail_v2alpha_generated_control_service_update_control_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.create_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.CreateModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "CreateModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.CreateModelRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "model", + "type": "google.cloud.retail_v2alpha.types.Model" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_model" + }, + "description": "Sample for CreateModel", + "file": "retail_v2alpha_generated_model_service_create_model_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_CreateModel_async", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_create_model_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.create_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.CreateModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "CreateModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.CreateModelRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "model", + "type": "google.cloud.retail_v2alpha.types.Model" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_model" + }, + "description": "Sample for CreateModel", + "file": "retail_v2alpha_generated_model_service_create_model_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_CreateModel_sync", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_create_model_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.delete_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.DeleteModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "DeleteModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.DeleteModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_model" + }, + "description": "Sample for DeleteModel", + "file": "retail_v2alpha_generated_model_service_delete_model_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_DeleteModel_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_delete_model_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.delete_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.DeleteModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "DeleteModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.DeleteModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_model" + }, + "description": "Sample for DeleteModel", + "file": "retail_v2alpha_generated_model_service_delete_model_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_DeleteModel_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_delete_model_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.list_models", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.ListModels", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "ListModels" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.ListModelsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.services.model_service.pagers.ListModelsAsyncPager", + "shortName": "list_models" + }, + "description": "Sample for ListModels", + "file": "retail_v2alpha_generated_model_service_list_models_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_ListModels_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_list_models_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.list_models", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.ListModels", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "ListModels" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.ListModelsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.services.model_service.pagers.ListModelsPager", + "shortName": "list_models" + }, + "description": "Sample for ListModels", + "file": "retail_v2alpha_generated_model_service_list_models_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_ListModels_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_list_models_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.pause_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.PauseModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "PauseModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.PauseModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.Model", + "shortName": "pause_model" + }, + "description": "Sample for PauseModel", + "file": "retail_v2alpha_generated_model_service_pause_model_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_PauseModel_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_pause_model_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.pause_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.PauseModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "PauseModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.PauseModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.Model", + "shortName": "pause_model" + }, + "description": "Sample for PauseModel", + "file": "retail_v2alpha_generated_model_service_pause_model_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_PauseModel_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_pause_model_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.resume_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.ResumeModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "ResumeModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.ResumeModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.Model", + "shortName": "resume_model" + }, + "description": "Sample for ResumeModel", + "file": "retail_v2alpha_generated_model_service_resume_model_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_ResumeModel_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_resume_model_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.resume_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.ResumeModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "ResumeModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.ResumeModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.Model", + "shortName": "resume_model" + }, + "description": "Sample for ResumeModel", + "file": "retail_v2alpha_generated_model_service_resume_model_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_ResumeModel_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_resume_model_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.tune_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.TuneModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "TuneModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.TuneModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "tune_model" + }, + "description": "Sample for TuneModel", + "file": "retail_v2alpha_generated_model_service_tune_model_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_TuneModel_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_tune_model_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.tune_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.TuneModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "TuneModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.TuneModelRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "tune_model" + }, + "description": "Sample for TuneModel", + "file": "retail_v2alpha_generated_model_service_tune_model_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_TuneModel_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_tune_model_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient", + "shortName": "ModelServiceAsyncClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceAsyncClient.update_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.UpdateModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "UpdateModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.UpdateModelRequest" + }, + { + "name": "model", + "type": "google.cloud.retail_v2alpha.types.Model" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.Model", + "shortName": "update_model" + }, + "description": "Sample for UpdateModel", + "file": "retail_v2alpha_generated_model_service_update_model_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_UpdateModel_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_update_model_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient", + "shortName": "ModelServiceClient" + }, + "fullName": "google.cloud.retail_v2alpha.ModelServiceClient.update_model", + "method": { + "fullName": "google.cloud.retail.v2alpha.ModelService.UpdateModel", + "service": { + "fullName": "google.cloud.retail.v2alpha.ModelService", + "shortName": "ModelService" + }, + "shortName": "UpdateModel" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.retail_v2alpha.types.UpdateModelRequest" + }, + { + "name": "model", + "type": "google.cloud.retail_v2alpha.types.Model" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.retail_v2alpha.types.Model", + "shortName": "update_model" + }, + "description": "Sample for UpdateModel", + "file": "retail_v2alpha_generated_model_service_update_model_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "retail_v2alpha_generated_ModelService_UpdateModel_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "retail_v2alpha_generated_model_service_update_model_sync.py" + }, { "canonical": true, "clientMethod": {