Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit f27cab3

Browse files
docs: Add documentation for enums (#385)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 64489f2 commit f27cab3

File tree

52 files changed

+1122
-70
lines changed

Some content is hidden

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

52 files changed

+1122
-70
lines changed

google/cloud/retail_v2/services/catalog_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ def sample_replace_catalog_attribute():
17581758
# Done; return the response.
17591759
return response
17601760

1761-
def __enter__(self):
1761+
def __enter__(self) -> "CatalogServiceClient":
17621762
return self
17631763

17641764
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/completion_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def sample_import_completion_data():
644644
# Done; return the response.
645645
return response
646646

647-
def __enter__(self):
647+
def __enter__(self) -> "CompletionServiceClient":
648648
return self
649649

650650
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/control_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def sample_list_controls():
10421042
# Done; return the response.
10431043
return response
10441044

1045-
def __enter__(self):
1045+
def __enter__(self) -> "ControlServiceClient":
10461046
return self
10471047

10481048
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/prediction_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def sample_predict():
529529
# Done; return the response.
530530
return response
531531

532-
def __enter__(self):
532+
def __enter__(self) -> "PredictionServiceClient":
533533
return self
534534

535535
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/product_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@ def sample_remove_local_inventories():
21242124
# Done; return the response.
21252125
return response
21262126

2127-
def __enter__(self):
2127+
def __enter__(self) -> "ProductServiceClient":
21282128
return self
21292129

21302130
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/search_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def sample_search():
573573
# Done; return the response.
574574
return response
575575

576-
def __enter__(self):
576+
def __enter__(self) -> "SearchServiceClient":
577577
return self
578578

579579
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/serving_config_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ def sample_remove_control():
12821282
# Done; return the response.
12831283
return response
12841284

1285-
def __enter__(self):
1285+
def __enter__(self) -> "ServingConfigServiceClient":
12861286
return self
12871287

12881288
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/services/user_event_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ def sample_rejoin_user_events():
10201020
# Done; return the response.
10211021
return response
10221022

1023-
def __enter__(self):
1023+
def __enter__(self) -> "UserEventServiceClient":
10241024
return self
10251025

10261026
def __exit__(self, type, value, traceback):

google/cloud/retail_v2/types/catalog.py

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,41 +190,102 @@ class CatalogAttribute(proto.Message):
190190
"""
191191

192192
class AttributeType(proto.Enum):
193-
r"""The type of an attribute."""
193+
r"""The type of an attribute.
194+
195+
Values:
196+
UNKNOWN (0):
197+
The type of the attribute is unknown.
198+
199+
Used when type cannot be derived from attribute that is not
200+
[in_use][google.cloud.retail.v2.CatalogAttribute.in_use].
201+
TEXTUAL (1):
202+
Textual attribute.
203+
NUMERICAL (2):
204+
Numerical attribute.
205+
"""
194206
UNKNOWN = 0
195207
TEXTUAL = 1
196208
NUMERICAL = 2
197209

198210
class IndexableOption(proto.Enum):
199-
r"""The status of the indexable option of a catalog attribute."""
211+
r"""The status of the indexable option of a catalog attribute.
212+
213+
Values:
214+
INDEXABLE_OPTION_UNSPECIFIED (0):
215+
Value used when unset.
216+
INDEXABLE_ENABLED (1):
217+
Indexable option enabled for an attribute.
218+
INDEXABLE_DISABLED (2):
219+
Indexable option disabled for an attribute.
220+
"""
200221
INDEXABLE_OPTION_UNSPECIFIED = 0
201222
INDEXABLE_ENABLED = 1
202223
INDEXABLE_DISABLED = 2
203224

204225
class DynamicFacetableOption(proto.Enum):
205226
r"""The status of the dynamic facetable option of a catalog
206227
attribute.
228+
229+
Values:
230+
DYNAMIC_FACETABLE_OPTION_UNSPECIFIED (0):
231+
Value used when unset.
232+
DYNAMIC_FACETABLE_ENABLED (1):
233+
Dynamic facetable option enabled for an
234+
attribute.
235+
DYNAMIC_FACETABLE_DISABLED (2):
236+
Dynamic facetable option disabled for an
237+
attribute.
207238
"""
208239
DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0
209240
DYNAMIC_FACETABLE_ENABLED = 1
210241
DYNAMIC_FACETABLE_DISABLED = 2
211242

212243
class SearchableOption(proto.Enum):
213-
r"""The status of the searchable option of a catalog attribute."""
244+
r"""The status of the searchable option of a catalog attribute.
245+
246+
Values:
247+
SEARCHABLE_OPTION_UNSPECIFIED (0):
248+
Value used when unset.
249+
SEARCHABLE_ENABLED (1):
250+
Searchable option enabled for an attribute.
251+
SEARCHABLE_DISABLED (2):
252+
Searchable option disabled for an attribute.
253+
"""
214254
SEARCHABLE_OPTION_UNSPECIFIED = 0
215255
SEARCHABLE_ENABLED = 1
216256
SEARCHABLE_DISABLED = 2
217257

218258
class ExactSearchableOption(proto.Enum):
219259
r"""The status of the exact-searchable option of a catalog
220260
attribute.
261+
262+
Values:
263+
EXACT_SEARCHABLE_OPTION_UNSPECIFIED (0):
264+
Value used when unset. Defaults to
265+
[EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
266+
EXACT_SEARCHABLE_ENABLED (1):
267+
Exact searchable option enabled for an
268+
attribute.
269+
EXACT_SEARCHABLE_DISABLED (2):
270+
Exact searchable option disabled for an
271+
attribute.
221272
"""
222273
EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0
223274
EXACT_SEARCHABLE_ENABLED = 1
224275
EXACT_SEARCHABLE_DISABLED = 2
225276

226277
class RetrievableOption(proto.Enum):
227-
r"""The status of the retrievable option of a catalog attribute."""
278+
r"""The status of the retrievable option of a catalog attribute.
279+
280+
Values:
281+
RETRIEVABLE_OPTION_UNSPECIFIED (0):
282+
Value used when unset. Defaults to
283+
[RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
284+
RETRIEVABLE_ENABLED (1):
285+
Retrievable option enabled for an attribute.
286+
RETRIEVABLE_DISABLED (2):
287+
Retrievable option disabled for an attribute.
288+
"""
228289
RETRIEVABLE_OPTION_UNSPECIFIED = 0
229290
RETRIEVABLE_ENABLED = 1
230291
RETRIEVABLE_DISABLED = 2

google/cloud/retail_v2/types/common.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,56 @@
4141

4242

4343
class AttributeConfigLevel(proto.Enum):
44-
r"""At which level we offer configuration for attributes."""
44+
r"""At which level we offer configuration for attributes.
45+
46+
Values:
47+
ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED (0):
48+
Value used when unset. In this case, server behavior
49+
defaults to
50+
[CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG].
51+
PRODUCT_LEVEL_ATTRIBUTE_CONFIG (1):
52+
At this level, we honor the attribute configurations set in
53+
[Product.attributes][google.cloud.retail.v2.Product.attributes].
54+
CATALOG_LEVEL_ATTRIBUTE_CONFIG (2):
55+
At this level, we honor the attribute configurations set in
56+
[CatalogConfig.attribute_configs][].
57+
"""
4558
ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0
4659
PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1
4760
CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2
4861

4962

5063
class SolutionType(proto.Enum):
51-
r"""The type of solution."""
64+
r"""The type of solution.
65+
66+
Values:
67+
SOLUTION_TYPE_UNSPECIFIED (0):
68+
Default value.
69+
SOLUTION_TYPE_RECOMMENDATION (1):
70+
Used for Recommendations AI.
71+
SOLUTION_TYPE_SEARCH (2):
72+
Used for Retail Search.
73+
"""
5274
SOLUTION_TYPE_UNSPECIFIED = 0
5375
SOLUTION_TYPE_RECOMMENDATION = 1
5476
SOLUTION_TYPE_SEARCH = 2
5577

5678

5779
class SearchSolutionUseCase(proto.Enum):
58-
r"""The use case of Cloud Retail Search."""
80+
r"""The use case of Cloud Retail Search.
81+
82+
Values:
83+
SEARCH_SOLUTION_USE_CASE_UNSPECIFIED (0):
84+
The value when it's unspecified. In this case, server
85+
behavior defaults to
86+
[SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
87+
SEARCH_SOLUTION_USE_CASE_SEARCH (1):
88+
Search use case. Expects the traffic has a non-empty
89+
[query][google.cloud.retail.v2.SearchRequest.query].
90+
SEARCH_SOLUTION_USE_CASE_BROWSE (2):
91+
Browse use case. Expects the traffic has an empty
92+
[query][google.cloud.retail.v2.SearchRequest.query].
93+
"""
5994
SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0
6095
SEARCH_SOLUTION_USE_CASE_SEARCH = 1
6196
SEARCH_SOLUTION_USE_CASE_BROWSE = 2

0 commit comments

Comments
 (0)