Skip to content

Commit 2fe066d

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: https://github.com/googleapis/googleapis-gen/commit/c371ea8df2e34940875d51200cd57e300a2bc0a8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzM3MWVhOGRmMmUzNDk0MDg3NWQ1MTIwMGNkNTdlMzAwYTJiYzBhOCJ9
1 parent 05b4eb3 commit 2fe066d

17 files changed

+2048
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchRemoveCatalogAttributes
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_async]
27+
from google.cloud import retail_v2beta
28+
29+
30+
async def sample_batch_remove_catalog_attributes():
31+
# Create a client
32+
client = retail_v2beta.CatalogServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = retail_v2beta.BatchRemoveCatalogAttributesRequest(
36+
attributes_config="attributes_config_value",
37+
attribute_keys=['attribute_keys_value_1', 'attribute_keys_value_2'],
38+
)
39+
40+
# Make the request
41+
response = await client.batch_remove_catalog_attributes(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchRemoveCatalogAttributes
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_sync]
27+
from google.cloud import retail_v2beta
28+
29+
30+
def sample_batch_remove_catalog_attributes():
31+
# Create a client
32+
client = retail_v2beta.CatalogServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = retail_v2beta.BatchRemoveCatalogAttributesRequest(
36+
attributes_config="attributes_config_value",
37+
attribute_keys=['attribute_keys_value_1', 'attribute_keys_value_2'],
38+
)
39+
40+
# Make the request
41+
response = client.batch_remove_catalog_attributes(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END retail_v2beta_generated_CatalogService_BatchRemoveCatalogAttributes_sync]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateModel
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_ModelService_CreateModel_async]
27+
from google.cloud import retail_v2beta
28+
29+
30+
async def sample_create_model():
31+
# Create a client
32+
client = retail_v2beta.ModelServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
model = retail_v2beta.Model()
36+
model.name = "name_value"
37+
model.display_name = "display_name_value"
38+
model.type_ = "type__value"
39+
40+
request = retail_v2beta.CreateModelRequest(
41+
parent="parent_value",
42+
model=model,
43+
)
44+
45+
# Make the request
46+
operation = client.create_model(request=request)
47+
48+
print("Waiting for operation to complete...")
49+
50+
response = await operation.result()
51+
52+
# Handle the response
53+
print(response)
54+
55+
# [END retail_v2beta_generated_ModelService_CreateModel_async]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateModel
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_ModelService_CreateModel_sync]
27+
from google.cloud import retail_v2beta
28+
29+
30+
def sample_create_model():
31+
# Create a client
32+
client = retail_v2beta.ModelServiceClient()
33+
34+
# Initialize request argument(s)
35+
model = retail_v2beta.Model()
36+
model.name = "name_value"
37+
model.display_name = "display_name_value"
38+
model.type_ = "type__value"
39+
40+
request = retail_v2beta.CreateModelRequest(
41+
parent="parent_value",
42+
model=model,
43+
)
44+
45+
# Make the request
46+
operation = client.create_model(request=request)
47+
48+
print("Waiting for operation to complete...")
49+
50+
response = operation.result()
51+
52+
# Handle the response
53+
print(response)
54+
55+
# [END retail_v2beta_generated_ModelService_CreateModel_sync]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for DeleteModel
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_ModelService_DeleteModel_async]
27+
from google.cloud import retail_v2beta
28+
29+
30+
async def sample_delete_model():
31+
# Create a client
32+
client = retail_v2beta.ModelServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = retail_v2beta.DeleteModelRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
await client.delete_model(request=request)
41+
42+
43+
# [END retail_v2beta_generated_ModelService_DeleteModel_async]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for DeleteModel
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_ModelService_DeleteModel_sync]
27+
from google.cloud import retail_v2beta
28+
29+
30+
def sample_delete_model():
31+
# Create a client
32+
client = retail_v2beta.ModelServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = retail_v2beta.DeleteModelRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
client.delete_model(request=request)
41+
42+
43+
# [END retail_v2beta_generated_ModelService_DeleteModel_sync]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for ListModels
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_ModelService_ListModels_async]
27+
from google.cloud import retail_v2beta
28+
29+
30+
async def sample_list_models():
31+
# Create a client
32+
client = retail_v2beta.ModelServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = retail_v2beta.ListModelsRequest(
36+
parent="parent_value",
37+
)
38+
39+
# Make the request
40+
page_result = client.list_models(request=request)
41+
42+
# Handle the response
43+
async for response in page_result:
44+
print(response)
45+
46+
# [END retail_v2beta_generated_ModelService_ListModels_async]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for ListModels
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-retail
24+
25+
26+
# [START retail_v2beta_generated_ModelService_ListModels_sync]
27+
from google.cloud import retail_v2beta
28+
29+
30+
def sample_list_models():
31+
# Create a client
32+
client = retail_v2beta.ModelServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = retail_v2beta.ListModelsRequest(
36+
parent="parent_value",
37+
)
38+
39+
# Make the request
40+
page_result = client.list_models(request=request)
41+
42+
# Handle the response
43+
for response in page_result:
44+
print(response)
45+
46+
# [END retail_v2beta_generated_ModelService_ListModels_sync]

0 commit comments

Comments
 (0)