Skip to content

Commit

Permalink
feat: release Model Services to v2beta version (#333)
Browse files Browse the repository at this point in the history
- [ ] 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: https://github.com/googleapis/googleapis-gen/commit/c371ea8df2e34940875d51200cd57e300a2bc0a8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzM3MWVhOGRmMmUzNDk0MDg3NWQ1MTIwMGNkNTdlMzAwYTJiYzBhOCJ9
  • Loading branch information
gcf-owl-bot[bot] committed Sep 2, 2022
1 parent 05b4eb3 commit 2fe066d
Show file tree
Hide file tree
Showing 17 changed files with 2,048 additions and 0 deletions.
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]
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]
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]
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]
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]
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]
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]
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]
Loading

0 comments on commit 2fe066d

Please sign in to comment.