google-cloud-retail-v2 1.0.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/retail/v2/analytics_service/client.rb +29 -2
  4. data/lib/google/cloud/retail/v2/analytics_service/operations.rb +12 -15
  5. data/lib/google/cloud/retail/v2/analytics_service/rest/client.rb +29 -2
  6. data/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb +43 -38
  7. data/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb +22 -8
  8. data/lib/google/cloud/retail/v2/catalog_service/client.rb +29 -12
  9. data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +29 -12
  10. data/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +102 -68
  11. data/lib/google/cloud/retail/v2/completion_service/client.rb +31 -5
  12. data/lib/google/cloud/retail/v2/completion_service/operations.rb +12 -15
  13. data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +31 -5
  14. data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +43 -38
  15. data/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +30 -14
  16. data/lib/google/cloud/retail/v2/completion_service_pb.rb +2 -1
  17. data/lib/google/cloud/retail/v2/control_service/client.rb +29 -6
  18. data/lib/google/cloud/retail/v2/control_service/rest/client.rb +29 -6
  19. data/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +54 -32
  20. data/lib/google/cloud/retail/v2/generative_question_pb.rb +45 -0
  21. data/lib/google/cloud/retail/v2/generative_question_service/client.rb +853 -0
  22. data/lib/google/cloud/retail/v2/generative_question_service/credentials.rb +51 -0
  23. data/lib/google/cloud/retail/v2/generative_question_service/paths.rb +52 -0
  24. data/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb +792 -0
  25. data/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb +389 -0
  26. data/lib/google/cloud/retail/v2/generative_question_service/rest.rb +52 -0
  27. data/lib/google/cloud/retail/v2/generative_question_service.rb +55 -0
  28. data/lib/google/cloud/retail/v2/generative_question_service_pb.rb +57 -0
  29. data/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb +55 -0
  30. data/lib/google/cloud/retail/v2/model_service/client.rb +31 -9
  31. data/lib/google/cloud/retail/v2/model_service/operations.rb +12 -15
  32. data/lib/google/cloud/retail/v2/model_service/rest/client.rb +31 -9
  33. data/lib/google/cloud/retail/v2/model_service/rest/operations.rb +43 -38
  34. data/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +78 -50
  35. data/lib/google/cloud/retail/v2/prediction_service/client.rb +28 -2
  36. data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +28 -2
  37. data/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +22 -8
  38. data/lib/google/cloud/retail/v2/product_service/client.rb +36 -13
  39. data/lib/google/cloud/retail/v2/product_service/operations.rb +12 -15
  40. data/lib/google/cloud/retail/v2/product_service/rest/client.rb +36 -13
  41. data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +43 -38
  42. data/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +110 -74
  43. data/lib/google/cloud/retail/v2/rest.rb +1 -0
  44. data/lib/google/cloud/retail/v2/search_service/client.rb +35 -3
  45. data/lib/google/cloud/retail/v2/search_service/rest/client.rb +34 -3
  46. data/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +22 -8
  47. data/lib/google/cloud/retail/v2/search_service_pb.rb +13 -2
  48. data/lib/google/cloud/retail/v2/serving_config_service/client.rb +29 -8
  49. data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +29 -8
  50. data/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +70 -44
  51. data/lib/google/cloud/retail/v2/user_event_service/client.rb +31 -6
  52. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +12 -15
  53. data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +31 -6
  54. data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +43 -38
  55. data/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +54 -32
  56. data/lib/google/cloud/retail/v2/version.rb +1 -1
  57. data/lib/google/cloud/retail/v2.rb +1 -0
  58. data/proto_docs/google/api/client.rb +39 -0
  59. data/proto_docs/google/cloud/retail/v2/common.rb +1 -1
  60. data/proto_docs/google/cloud/retail/v2/completion_service.rb +30 -2
  61. data/proto_docs/google/cloud/retail/v2/generative_question.rb +75 -0
  62. data/proto_docs/google/cloud/retail/v2/generative_question_service.rb +109 -0
  63. data/proto_docs/google/cloud/retail/v2/product.rb +9 -2
  64. data/proto_docs/google/cloud/retail/v2/search_service.rb +204 -0
  65. data/proto_docs/google/longrunning/operations.rb +19 -14
  66. metadata +17 -5
@@ -14,7 +14,7 @@ require 'google/protobuf/field_mask_pb'
14
14
  require 'google/protobuf/struct_pb'
15
15
 
16
16
 
17
- descriptor_data = "\n+google/cloud/retail/v2/search_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a$google/cloud/retail/v2/product.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xbe\x13\n\rSearchRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x06\x62ranch\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12\x17\n\nvisitor_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tuser_info\x18\x05 \x01(\x0b\x32 .google.cloud.retail.v2.UserInfo\x12\x11\n\tpage_size\x18\x07 \x01(\x05\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x0e\n\x06\x66ilter\x18\n \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1c \x01(\t\x12\x10\n\x08order_by\x18\x0b \x01(\t\x12\x44\n\x0b\x66\x61\x63\x65t_specs\x18\x0c \x03(\x0b\x32/.google.cloud.retail.v2.SearchRequest.FacetSpec\x12V\n\x12\x64ynamic_facet_spec\x18\x15 \x01(\x0b\x32\x36.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecB\x02\x18\x01\x12\x43\n\nboost_spec\x18\r \x01(\x0b\x32/.google.cloud.retail.v2.SearchRequest.BoostSpec\x12V\n\x14query_expansion_spec\x18\x0e \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec\x12\x1b\n\x13variant_rollup_keys\x18\x11 \x03(\t\x12\x17\n\x0fpage_categories\x18\x17 \x03(\t\x12\x45\n\x0bsearch_mode\x18\x1f \x01(\x0e\x32\x30.google.cloud.retail.v2.SearchRequest.SearchMode\x12W\n\x14personalization_spec\x18 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.PersonalizationSpec\x12\x41\n\x06labels\x18\" \x03(\x0b\x32\x31.google.cloud.retail.v2.SearchRequest.LabelsEntry\x12]\n\x15spell_correction_spec\x18# \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecH\x00\x88\x01\x01\x12\x0e\n\x06\x65ntity\x18& \x01(\t\x1a\x91\x03\n\tFacetSpec\x12P\n\tfacet_key\x18\x01 \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xe3\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tintervals\x18\x02 \x03(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x08 \x03(\t\x12\x10\n\x08\x63ontains\x18\t \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\n \x01(\x08\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\r\n\x05query\x18\x05 \x01(\t\x12\x16\n\x0ereturn_min_max\x18\x0b \x01(\x08\x1a\x96\x01\n\x10\x44ynamicFacetSpec\x12I\n\x04mode\x18\x01 \x01(\x0e\x32;.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x1a\xee\x01\n\tBoostSpec\x12\x61\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12\'\n\x1askip_boost_spec_validation\x18\x02 \x01(\x08H\x00\x88\x01\x01\x1a\x36\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x42\x1d\n\x1b_skip_boost_spec_validation\x1a\xcb\x01\n\x12QueryExpansionSpec\x12U\n\tcondition\x18\x01 \x01(\x0e\x32\x42.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x03\x1a\x99\x01\n\x13PersonalizationSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode\"4\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41UTO\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x1a\xa0\x01\n\x13SpellCorrectionSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"[\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x17\n\x13PRODUCT_SEARCH_ONLY\x10\x01\x12\x17\n\x13\x46\x41\x43\x45TED_SEARCH_ONLY\x10\x02\x42\x18\n\x16_spell_correction_spec\"\x9a\x0b\n\x0eSearchResponse\x12\x44\n\x07results\x18\x01 \x03(\x0b\x32\x33.google.cloud.retail.v2.SearchResponse.SearchResult\x12<\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32,.google.cloud.retail.v2.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x17\n\x0f\x63orrected_query\x18\x04 \x01(\t\x12\x19\n\x11\x61ttribution_token\x18\x05 \x01(\t\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\x12W\n\x14query_expansion_info\x18\x07 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo\x12\x14\n\x0credirect_uri\x18\n \x01(\t\x12\x18\n\x10\x61pplied_controls\x18\x0c \x03(\t\x12i\n\x1dinvalid_condition_boost_specs\x18\x0e \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12?\n\x0f\x65xperiment_info\x18\x11 \x03(\x0b\x32&.google.cloud.retail.v2.ExperimentInfo\x1a\x91\x04\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x07product\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.Product\x12\x1e\n\x16matching_variant_count\x18\x03 \x01(\x05\x12o\n\x17matching_variant_fields\x18\x04 \x03(\x0b\x32N.google.cloud.retail.v2.SearchResponse.SearchResult.MatchingVariantFieldsEntry\x12k\n\x15variant_rollup_values\x18\x05 \x03(\x0b\x32L.google.cloud.retail.v2.SearchResponse.SearchResult.VariantRollupValuesEntry\x12\x17\n\x0fpersonal_labels\x18\x07 \x03(\t\x1aX\n\x1aMatchingVariantFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask:\x02\x38\x01\x1aR\n\x18VariantRollupValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x8e\x02\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x06values\x18\x02 \x03(\x0b\x32\x37.google.cloud.retail.v2.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1a\x97\x01\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12\x34\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x12\x11\n\tmin_value\x18\x05 \x01(\x01\x12\x11\n\tmax_value\x18\x06 \x01(\x01\x42\r\n\x0b\x66\x61\x63\x65t_value\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\"\xfb\x02\n\x0e\x45xperimentInfo\x12\x63\n\x19serving_config_experiment\x18\x02 \x01(\x0b\x32>.google.cloud.retail.v2.ExperimentInfo.ServingConfigExperimentH\x00\x12\x39\n\nexperiment\x18\x01 \x01(\tB%\xfa\x41\"\n retail.googleapis.com/Experiment\x1a\xb1\x01\n\x17ServingConfigExperiment\x12I\n\x17original_serving_config\x18\x01 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12K\n\x19\x65xperiment_serving_config\x18\x02 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfigB\x15\n\x13\x65xperiment_metadata2\xd8\x02\n\rSearchService\x12\xfb\x01\n\x06Search\x12%.google.cloud.retail.v2.SearchRequest\x1a&.google.cloud.retail.v2.SearchResponse\"\xa1\x01\x82\xd3\xe4\x93\x02\x9a\x01\"E/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search:\x01*ZN\"I/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb7\x02\n\x1a\x63om.google.cloud.retail.v2B\x12SearchServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2\xea\x41w\n retail.googleapis.com/Experiment\x12Sprojects/{project}/locations/{location}/catalogs/{catalog}/experiments/{experiment}b\x06proto3"
17
+ descriptor_data = "\n+google/cloud/retail/v2/search_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a$google/cloud/retail/v2/product.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"4\n\x15ProductAttributeValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\\\n\x18ProductAttributeInterval\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\"\xe8\x01\n\x04Tile\x12P\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueH\x00\x12V\n\x1aproduct_attribute_interval\x18\x02 \x01(\x0b\x32\x30.google.cloud.retail.v2.ProductAttributeIntervalH\x00\x12!\n\x19representative_product_id\x18\x03 \x01(\tB\x13\n\x11product_attribute\"\x8c\x1a\n\rSearchRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x06\x62ranch\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12\x17\n\nvisitor_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tuser_info\x18\x05 \x01(\x0b\x32 .google.cloud.retail.v2.UserInfo\x12\x11\n\tpage_size\x18\x07 \x01(\x05\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x0e\n\x06\x66ilter\x18\n \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1c \x01(\t\x12\x10\n\x08order_by\x18\x0b \x01(\t\x12\x44\n\x0b\x66\x61\x63\x65t_specs\x18\x0c \x03(\x0b\x32/.google.cloud.retail.v2.SearchRequest.FacetSpec\x12V\n\x12\x64ynamic_facet_spec\x18\x15 \x01(\x0b\x32\x36.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecB\x02\x18\x01\x12\x43\n\nboost_spec\x18\r \x01(\x0b\x32/.google.cloud.retail.v2.SearchRequest.BoostSpec\x12V\n\x14query_expansion_spec\x18\x0e \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec\x12\x1b\n\x13variant_rollup_keys\x18\x11 \x03(\t\x12\x17\n\x0fpage_categories\x18\x17 \x03(\t\x12\x45\n\x0bsearch_mode\x18\x1f \x01(\x0e\x32\x30.google.cloud.retail.v2.SearchRequest.SearchMode\x12W\n\x14personalization_spec\x18 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.PersonalizationSpec\x12\x41\n\x06labels\x18\" \x03(\x0b\x32\x31.google.cloud.retail.v2.SearchRequest.LabelsEntry\x12]\n\x15spell_correction_spec\x18# \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecH\x00\x88\x01\x01\x12\x0e\n\x06\x65ntity\x18& \x01(\t\x12g\n\x1a\x63onversational_search_spec\x18( \x01(\x0b\x32>.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpecB\x03\xe0\x41\x01\x12[\n\x14tile_navigation_spec\x18) \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.TileNavigationSpecB\x03\xe0\x41\x01\x1a\x91\x03\n\tFacetSpec\x12P\n\tfacet_key\x18\x01 \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xe3\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tintervals\x18\x02 \x03(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x08 \x03(\t\x12\x10\n\x08\x63ontains\x18\t \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\n \x01(\x08\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\r\n\x05query\x18\x05 \x01(\t\x12\x16\n\x0ereturn_min_max\x18\x0b \x01(\x08\x1a\x96\x01\n\x10\x44ynamicFacetSpec\x12I\n\x04mode\x18\x01 \x01(\x0e\x32;.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x1a\xee\x01\n\tBoostSpec\x12\x61\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12\'\n\x1askip_boost_spec_validation\x18\x02 \x01(\x08H\x00\x88\x01\x01\x1a\x36\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x42\x1d\n\x1b_skip_boost_spec_validation\x1a\xcb\x01\n\x12QueryExpansionSpec\x12U\n\tcondition\x18\x01 \x01(\x0e\x32\x42.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x03\x1a\x99\x01\n\x13PersonalizationSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode\"4\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41UTO\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x1a\xa0\x01\n\x13SpellCorrectionSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\x97\x04\n\x18\x43onversationalSearchSpec\x12\'\n\x1f\x66ollowup_conversation_requested\x18\x01 \x01(\x08\x12\x17\n\x0f\x63onversation_id\x18\x02 \x01(\t\x12^\n\x0buser_answer\x18\x03 \x01(\x0b\x32I.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer\x1a\xd8\x02\n\nUserAnswer\x12\x15\n\x0btext_answer\x18\x01 \x01(\tH\x00\x12s\n\x0fselected_answer\x18\x02 \x01(\x0b\x32X.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswerH\x00\x1a\xb5\x01\n\x0eSelectedAnswer\x12S\n\x18product_attribute_values\x18\x01 \x03(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x02\x18\x01\x12N\n\x17product_attribute_value\x18\x02 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x06\n\x04type\x1al\n\x12TileNavigationSpec\x12!\n\x19tile_navigation_requested\x18\x01 \x01(\x08\x12\x33\n\rapplied_tiles\x18\x02 \x03(\x0b\x32\x1c.google.cloud.retail.v2.Tile\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"[\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x17\n\x13PRODUCT_SEARCH_ONLY\x10\x01\x12\x17\n\x13\x46\x41\x43\x45TED_SEARCH_ONLY\x10\x02\x42\x18\n\x16_spell_correction_spec\"\xa7\x12\n\x0eSearchResponse\x12\x44\n\x07results\x18\x01 \x03(\x0b\x32\x33.google.cloud.retail.v2.SearchResponse.SearchResult\x12<\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32,.google.cloud.retail.v2.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x17\n\x0f\x63orrected_query\x18\x04 \x01(\t\x12\x19\n\x11\x61ttribution_token\x18\x05 \x01(\t\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\x12W\n\x14query_expansion_info\x18\x07 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo\x12\x14\n\x0credirect_uri\x18\n \x01(\t\x12\x18\n\x10\x61pplied_controls\x18\x0c \x03(\t\x12i\n\x1dinvalid_condition_boost_specs\x18\x0e \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12?\n\x0f\x65xperiment_info\x18\x11 \x03(\x0b\x32&.google.cloud.retail.v2.ExperimentInfo\x12g\n\x1c\x63onversational_search_result\x18\x12 \x01(\x0b\x32\x41.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult\x12[\n\x16tile_navigation_result\x18\x13 \x01(\x0b\x32;.google.cloud.retail.v2.SearchResponse.TileNavigationResult\x1a\x91\x04\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x07product\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.Product\x12\x1e\n\x16matching_variant_count\x18\x03 \x01(\x05\x12o\n\x17matching_variant_fields\x18\x04 \x03(\x0b\x32N.google.cloud.retail.v2.SearchResponse.SearchResult.MatchingVariantFieldsEntry\x12k\n\x15variant_rollup_values\x18\x05 \x03(\x0b\x32L.google.cloud.retail.v2.SearchResponse.SearchResult.VariantRollupValuesEntry\x12\x17\n\x0fpersonal_labels\x18\x07 \x03(\t\x1aX\n\x1aMatchingVariantFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask:\x02\x38\x01\x1aR\n\x18VariantRollupValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x8e\x02\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x06values\x18\x02 \x03(\x0b\x32\x37.google.cloud.retail.v2.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1a\x97\x01\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12\x34\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x12\x11\n\tmin_value\x18\x05 \x01(\x01\x12\x11\n\tmax_value\x18\x06 \x01(\x01\x42\r\n\x0b\x66\x61\x63\x65t_value\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a\xff\x04\n\x1a\x43onversationalSearchResult\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x15\n\rrefined_query\x18\x02 \x01(\t\x12r\n\x12\x61\x64\x64itional_filters\x18\x03 \x03(\x0b\x32R.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilterB\x02\x18\x01\x12\x19\n\x11\x66ollowup_question\x18\x04 \x01(\t\x12l\n\x11suggested_answers\x18\x05 \x03(\x0b\x32Q.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer\x12m\n\x11\x61\x64\x64itional_filter\x18\x06 \x01(\x0b\x32R.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter\x1a\x61\n\x0fSuggestedAnswer\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x62\n\x10\x41\x64\x64itionalFilter\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x43\n\x14TileNavigationResult\x12+\n\x05tiles\x18\x01 \x03(\x0b\x32\x1c.google.cloud.retail.v2.Tile\"\xfb\x02\n\x0e\x45xperimentInfo\x12\x63\n\x19serving_config_experiment\x18\x02 \x01(\x0b\x32>.google.cloud.retail.v2.ExperimentInfo.ServingConfigExperimentH\x00\x12\x39\n\nexperiment\x18\x01 \x01(\tB%\xfa\x41\"\n retail.googleapis.com/Experiment\x1a\xb1\x01\n\x17ServingConfigExperiment\x12I\n\x17original_serving_config\x18\x01 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12K\n\x19\x65xperiment_serving_config\x18\x02 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfigB\x15\n\x13\x65xperiment_metadata2\xd8\x02\n\rSearchService\x12\xfb\x01\n\x06Search\x12%.google.cloud.retail.v2.SearchRequest\x1a&.google.cloud.retail.v2.SearchResponse\"\xa1\x01\x82\xd3\xe4\x93\x02\x9a\x01\"E/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search:\x01*ZN\"I/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb7\x02\n\x1a\x63om.google.cloud.retail.v2B\x12SearchServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2\xea\x41w\n retail.googleapis.com/Experiment\x12Sprojects/{project}/locations/{location}/catalogs/{catalog}/experiments/{experiment}b\x06proto3"
18
18
 
19
19
  pool = Google::Protobuf::DescriptorPool.generated_pool
20
20
 
@@ -29,7 +29,7 @@ rescue TypeError
29
29
  file = pool.add_serialized_file(serialized)
30
30
  warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
31
31
  imports = [
32
- ["google.cloud.retail.v2.UserInfo", "google/cloud/retail/v2/common.proto"],
32
+ ["google.cloud.retail.v2.Interval", "google/cloud/retail/v2/common.proto"],
33
33
  ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"],
34
34
  ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"],
35
35
  ["google.protobuf.Value", "google/protobuf/struct.proto"],
@@ -48,6 +48,9 @@ module Google
48
48
  module Cloud
49
49
  module Retail
50
50
  module V2
51
+ ProductAttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductAttributeValue").msgclass
52
+ ProductAttributeInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductAttributeInterval").msgclass
53
+ Tile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Tile").msgclass
51
54
  SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest").msgclass
52
55
  SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec").msgclass
53
56
  SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey").msgclass
@@ -61,12 +64,20 @@ module Google
61
64
  SearchRequest::PersonalizationSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode").enummodule
62
65
  SearchRequest::SpellCorrectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec").msgclass
63
66
  SearchRequest::SpellCorrectionSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode").enummodule
67
+ SearchRequest::ConversationalSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec").msgclass
68
+ SearchRequest::ConversationalSearchSpec::UserAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer").msgclass
69
+ SearchRequest::ConversationalSearchSpec::UserAnswer::SelectedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer").msgclass
70
+ SearchRequest::TileNavigationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.TileNavigationSpec").msgclass
64
71
  SearchRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SearchMode").enummodule
65
72
  SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse").msgclass
66
73
  SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.SearchResult").msgclass
67
74
  SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet").msgclass
68
75
  SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet.FacetValue").msgclass
69
76
  SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.QueryExpansionInfo").msgclass
77
+ SearchResponse::ConversationalSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult").msgclass
78
+ SearchResponse::ConversationalSearchResult::SuggestedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer").msgclass
79
+ SearchResponse::ConversationalSearchResult::AdditionalFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter").msgclass
80
+ SearchResponse::TileNavigationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.TileNavigationResult").msgclass
70
81
  ExperimentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExperimentInfo").msgclass
71
82
  ExperimentInfo::ServingConfigExperiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment").msgclass
72
83
  end
@@ -158,14 +158,26 @@ module Google
158
158
  universe_domain: @config.universe_domain,
159
159
  channel_args: @config.channel_args,
160
160
  interceptors: @config.interceptors,
161
- channel_pool_config: @config.channel_pool
161
+ channel_pool_config: @config.channel_pool,
162
+ logger: @config.logger
162
163
  )
163
164
 
165
+ @serving_config_service_stub.stub_logger&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
164
175
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
165
176
  config.credentials = credentials
166
177
  config.quota_project = @quota_project_id
167
178
  config.endpoint = @serving_config_service_stub.endpoint
168
179
  config.universe_domain = @serving_config_service_stub.universe_domain
180
+ config.logger = @serving_config_service_stub.logger if config.respond_to? :logger=
169
181
  end
170
182
  end
171
183
 
@@ -176,6 +188,15 @@ module Google
176
188
  #
177
189
  attr_reader :location_client
178
190
 
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @serving_config_service_stub.logger
198
+ end
199
+
179
200
  # Service calls
180
201
 
181
202
  ##
@@ -271,7 +292,6 @@ module Google
271
292
 
272
293
  @serving_config_service_stub.call_rpc :create_serving_config, request, options: options do |response, operation|
273
294
  yield response, operation if block_given?
274
- return response
275
295
  end
276
296
  rescue ::GRPC::BadStatus => e
277
297
  raise ::Google::Cloud::Error.from_error(e)
@@ -360,7 +380,6 @@ module Google
360
380
 
361
381
  @serving_config_service_stub.call_rpc :delete_serving_config, request, options: options do |response, operation|
362
382
  yield response, operation if block_given?
363
- return response
364
383
  end
365
384
  rescue ::GRPC::BadStatus => e
366
385
  raise ::Google::Cloud::Error.from_error(e)
@@ -454,7 +473,6 @@ module Google
454
473
 
455
474
  @serving_config_service_stub.call_rpc :update_serving_config, request, options: options do |response, operation|
456
475
  yield response, operation if block_given?
457
- return response
458
476
  end
459
477
  rescue ::GRPC::BadStatus => e
460
478
  raise ::Google::Cloud::Error.from_error(e)
@@ -543,7 +561,6 @@ module Google
543
561
 
544
562
  @serving_config_service_stub.call_rpc :get_serving_config, request, options: options do |response, operation|
545
563
  yield response, operation if block_given?
546
- return response
547
564
  end
548
565
  rescue ::GRPC::BadStatus => e
549
566
  raise ::Google::Cloud::Error.from_error(e)
@@ -642,7 +659,7 @@ module Google
642
659
  @serving_config_service_stub.call_rpc :list_serving_configs, request, options: options do |response, operation|
643
660
  response = ::Gapic::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, request, response, operation, options
644
661
  yield response, operation if block_given?
645
- return response
662
+ throw :response, response
646
663
  end
647
664
  rescue ::GRPC::BadStatus => e
648
665
  raise ::Google::Cloud::Error.from_error(e)
@@ -738,7 +755,6 @@ module Google
738
755
 
739
756
  @serving_config_service_stub.call_rpc :add_control, request, options: options do |response, operation|
740
757
  yield response, operation if block_given?
741
- return response
742
758
  end
743
759
  rescue ::GRPC::BadStatus => e
744
760
  raise ::Google::Cloud::Error.from_error(e)
@@ -831,7 +847,6 @@ module Google
831
847
 
832
848
  @serving_config_service_stub.call_rpc :remove_control, request, options: options do |response, operation|
833
849
  yield response, operation if block_given?
834
- return response
835
850
  end
836
851
  rescue ::GRPC::BadStatus => e
837
852
  raise ::Google::Cloud::Error.from_error(e)
@@ -920,6 +935,11 @@ module Google
920
935
  # default endpoint URL. The default value of nil uses the environment
921
936
  # universe (usually the default "googleapis.com" universe).
922
937
  # @return [::String,nil]
938
+ # @!attribute [rw] logger
939
+ # A custom logger to use for request/response debug logging, or the value
940
+ # `:default` (the default) to construct a default logger, or `nil` to
941
+ # explicitly disable logging.
942
+ # @return [::Logger,:default,nil]
923
943
  #
924
944
  class Configuration
925
945
  extend ::Gapic::Config
@@ -944,6 +964,7 @@ module Google
944
964
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
945
965
  config_attr :quota_project, nil, ::String, nil
946
966
  config_attr :universe_domain, nil, ::String, nil
967
+ config_attr :logger, :default, ::Logger, nil, :default
947
968
 
948
969
  # @private
949
970
  def initialize parent_config = nil
@@ -151,14 +151,26 @@ module Google
151
151
  endpoint: @config.endpoint,
152
152
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
153
153
  universe_domain: @config.universe_domain,
154
- credentials: credentials
154
+ credentials: credentials,
155
+ logger: @config.logger
155
156
  )
156
157
 
158
+ @serving_config_service_stub.logger(stub: true)&.info do |entry|
159
+ entry.set_system_name
160
+ entry.set_service
161
+ entry.message = "Created client for #{entry.service}"
162
+ entry.set_credentials_fields credentials
163
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
164
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
165
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
166
+ end
167
+
157
168
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
158
169
  config.credentials = credentials
159
170
  config.quota_project = @quota_project_id
160
171
  config.endpoint = @serving_config_service_stub.endpoint
161
172
  config.universe_domain = @serving_config_service_stub.universe_domain
173
+ config.logger = @serving_config_service_stub.logger if config.respond_to? :logger=
162
174
  end
163
175
  end
164
176
 
@@ -169,6 +181,15 @@ module Google
169
181
  #
170
182
  attr_reader :location_client
171
183
 
184
+ ##
185
+ # The logger used for request/response debug logging.
186
+ #
187
+ # @return [Logger]
188
+ #
189
+ def logger
190
+ @serving_config_service_stub.logger
191
+ end
192
+
172
193
  # Service calls
173
194
 
174
195
  ##
@@ -257,7 +278,6 @@ module Google
257
278
 
258
279
  @serving_config_service_stub.create_serving_config request, options do |result, operation|
259
280
  yield result, operation if block_given?
260
- return result
261
281
  end
262
282
  rescue ::Gapic::Rest::Error => e
263
283
  raise ::Google::Cloud::Error.from_error(e)
@@ -339,7 +359,6 @@ module Google
339
359
 
340
360
  @serving_config_service_stub.delete_serving_config request, options do |result, operation|
341
361
  yield result, operation if block_given?
342
- return result
343
362
  end
344
363
  rescue ::Gapic::Rest::Error => e
345
364
  raise ::Google::Cloud::Error.from_error(e)
@@ -426,7 +445,6 @@ module Google
426
445
 
427
446
  @serving_config_service_stub.update_serving_config request, options do |result, operation|
428
447
  yield result, operation if block_given?
429
- return result
430
448
  end
431
449
  rescue ::Gapic::Rest::Error => e
432
450
  raise ::Google::Cloud::Error.from_error(e)
@@ -508,7 +526,6 @@ module Google
508
526
 
509
527
  @serving_config_service_stub.get_serving_config request, options do |result, operation|
510
528
  yield result, operation if block_given?
511
- return result
512
529
  end
513
530
  rescue ::Gapic::Rest::Error => e
514
531
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +617,7 @@ module Google
600
617
  @serving_config_service_stub.list_serving_configs request, options do |result, operation|
601
618
  result = ::Gapic::Rest::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, "serving_configs", request, result, options
602
619
  yield result, operation if block_given?
603
- return result
620
+ throw :response, result
604
621
  end
605
622
  rescue ::Gapic::Rest::Error => e
606
623
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,7 +706,6 @@ module Google
689
706
 
690
707
  @serving_config_service_stub.add_control request, options do |result, operation|
691
708
  yield result, operation if block_given?
692
- return result
693
709
  end
694
710
  rescue ::Gapic::Rest::Error => e
695
711
  raise ::Google::Cloud::Error.from_error(e)
@@ -775,7 +791,6 @@ module Google
775
791
 
776
792
  @serving_config_service_stub.remove_control request, options do |result, operation|
777
793
  yield result, operation if block_given?
778
- return result
779
794
  end
780
795
  rescue ::Gapic::Rest::Error => e
781
796
  raise ::Google::Cloud::Error.from_error(e)
@@ -855,6 +870,11 @@ module Google
855
870
  # default endpoint URL. The default value of nil uses the environment
856
871
  # universe (usually the default "googleapis.com" universe).
857
872
  # @return [::String,nil]
873
+ # @!attribute [rw] logger
874
+ # A custom logger to use for request/response debug logging, or the value
875
+ # `:default` (the default) to construct a default logger, or `nil` to
876
+ # explicitly disable logging.
877
+ # @return [::Logger,:default,nil]
858
878
  #
859
879
  class Configuration
860
880
  extend ::Gapic::Config
@@ -876,6 +896,7 @@ module Google
876
896
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
877
897
  config_attr :quota_project, nil, ::String, nil
878
898
  config_attr :universe_domain, nil, ::String, nil
899
+ config_attr :logger, :default, ::Logger, nil, :default
879
900
 
880
901
  # @private
881
902
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_serving_config REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_serving_config",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "delete_serving_config",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "update_serving_config",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "get_serving_config",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "list_serving_configs",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "add_control",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "remove_control",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -180,14 +180,26 @@ module Google
180
180
  universe_domain: @config.universe_domain,
181
181
  channel_args: @config.channel_args,
182
182
  interceptors: @config.interceptors,
183
- channel_pool_config: @config.channel_pool
183
+ channel_pool_config: @config.channel_pool,
184
+ logger: @config.logger
184
185
  )
185
186
 
187
+ @user_event_service_stub.stub_logger&.info do |entry|
188
+ entry.set_system_name
189
+ entry.set_service
190
+ entry.message = "Created client for #{entry.service}"
191
+ entry.set_credentials_fields credentials
192
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
193
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
194
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
195
+ end
196
+
186
197
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
187
198
  config.credentials = credentials
188
199
  config.quota_project = @quota_project_id
189
200
  config.endpoint = @user_event_service_stub.endpoint
190
201
  config.universe_domain = @user_event_service_stub.universe_domain
202
+ config.logger = @user_event_service_stub.logger if config.respond_to? :logger=
191
203
  end
192
204
  end
193
205
 
@@ -205,6 +217,15 @@ module Google
205
217
  #
206
218
  attr_reader :location_client
207
219
 
220
+ ##
221
+ # The logger used for request/response debug logging.
222
+ #
223
+ # @return [Logger]
224
+ #
225
+ def logger
226
+ @user_event_service_stub.logger
227
+ end
228
+
208
229
  # Service calls
209
230
 
210
231
  ##
@@ -295,7 +316,6 @@ module Google
295
316
 
296
317
  @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation|
297
318
  yield response, operation if block_given?
298
- return response
299
319
  end
300
320
  rescue ::GRPC::BadStatus => e
301
321
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +426,6 @@ module Google
406
426
 
407
427
  @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation|
408
428
  yield response, operation if block_given?
409
- return response
410
429
  end
411
430
  rescue ::GRPC::BadStatus => e
412
431
  raise ::Google::Cloud::Error.from_error(e)
@@ -533,7 +552,7 @@ module Google
533
552
  @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
534
553
  response = ::Gapic::Operation.new response, @operations_client, options: options
535
554
  yield response, operation if block_given?
536
- return response
555
+ throw :response, response
537
556
  end
538
557
  rescue ::GRPC::BadStatus => e
539
558
  raise ::Google::Cloud::Error.from_error(e)
@@ -638,7 +657,7 @@ module Google
638
657
  @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation|
639
658
  response = ::Gapic::Operation.new response, @operations_client, options: options
640
659
  yield response, operation if block_given?
641
- return response
660
+ throw :response, response
642
661
  end
643
662
  rescue ::GRPC::BadStatus => e
644
663
  raise ::Google::Cloud::Error.from_error(e)
@@ -745,7 +764,7 @@ module Google
745
764
  @user_event_service_stub.call_rpc :rejoin_user_events, request, options: options do |response, operation|
746
765
  response = ::Gapic::Operation.new response, @operations_client, options: options
747
766
  yield response, operation if block_given?
748
- return response
767
+ throw :response, response
749
768
  end
750
769
  rescue ::GRPC::BadStatus => e
751
770
  raise ::Google::Cloud::Error.from_error(e)
@@ -834,6 +853,11 @@ module Google
834
853
  # default endpoint URL. The default value of nil uses the environment
835
854
  # universe (usually the default "googleapis.com" universe).
836
855
  # @return [::String,nil]
856
+ # @!attribute [rw] logger
857
+ # A custom logger to use for request/response debug logging, or the value
858
+ # `:default` (the default) to construct a default logger, or `nil` to
859
+ # explicitly disable logging.
860
+ # @return [::Logger,:default,nil]
837
861
  #
838
862
  class Configuration
839
863
  extend ::Gapic::Config
@@ -858,6 +882,7 @@ module Google
858
882
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
859
883
  config_attr :quota_project, nil, ::String, nil
860
884
  config_attr :universe_domain, nil, ::String, nil
885
+ config_attr :logger, :default, ::Logger, nil, :default
861
886
 
862
887
  # @private
863
888
  def initialize parent_config = nil