Skip to content

Commit d90d9e9

Browse files
authored
Fix issues in add_hotel_listing_group_tree example (#373)
1 parent 18c16f8 commit d90d9e9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/hotel_ads/add_hotel_listing_group_tree.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ def _add_level1_nodes(
245245
other_hotels_listing_dimension_info = client.get_type(
246246
"ListingDimensionInfo", version="v6"
247247
)
248+
# Set "hotel_class" as the oneof field on the ListingDimentionInfo object
249+
# without specifying the optional hotel_class.value field.
250+
other_hotels_listing_dimension_info.hotel_class.CopyFrom(
251+
client.get_type("HotelClassInfo", version="v6")
252+
)
248253

249254
# Create listing group info for other hotel classes as a SUBDIVISION node,
250255
# which will be used as a parent node for children nodes of the next level.
@@ -351,6 +356,12 @@ def _add_level2_nodes(
351356
other_hotel_regions_listing_dimension_info = client.get_type(
352357
"ListingDimensionInfo", version="v6"
353358
)
359+
# Set "hotel_country_region" as the oneof field on the ListingDimentionInfo
360+
# object without specifying the optional
361+
# hotel_country_region.country_region_criterion field.
362+
other_hotel_regions_listing_dimension_info.hotel_country_region.CopyFrom(
363+
client.get_type("HotelCountryRegionInfo", version="v6")
364+
)
354365

355366
# Create listing group info for hotels in other regions as a UNIT node.
356367
# The "others" node is always required for every level of the tree.

0 commit comments

Comments
 (0)