google-cloud-retail-v2 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +240 -40
  4. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  5. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  6. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
  7. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +545 -0
  9. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  10. data/lib/google/cloud/retail/v2/completion_service/operations.rb +664 -0
  11. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  12. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  13. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  14. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  15. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  16. data/lib/google/cloud/retail/v2/prediction_service/client.rb +66 -70
  17. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  18. data/lib/google/cloud/retail/v2/product_service/client.rb +682 -43
  19. data/lib/google/cloud/retail/v2/product_service/operations.rb +30 -21
  20. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  21. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
  22. data/lib/google/cloud/retail/v2/search_service/client.rb +552 -0
  23. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  24. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  25. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  26. data/lib/google/cloud/retail/v2/search_service_pb.rb +133 -0
  27. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  28. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  29. data/lib/google/cloud/retail/v2/user_event_service/client.rb +45 -42
  30. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +30 -21
  31. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  32. data/lib/google/cloud/retail/v2/version.rb +1 -1
  33. data/lib/google/cloud/retail/v2.rb +2 -0
  34. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  35. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  36. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  37. data/proto_docs/google/cloud/retail/v2/completion_service.rb +164 -0
  38. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  39. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  40. data/proto_docs/google/cloud/retail/v2/product.rb +265 -9
  41. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  42. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  43. data/proto_docs/google/cloud/retail/v2/search_service.rb +711 -0
  44. data/proto_docs/google/cloud/retail/v2/user_event.rb +110 -6
  45. data/proto_docs/google/type/date.rb +53 -0
  46. metadata +20 -4
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Retail
24
+ module V2
25
+ module SearchService
26
+ # Credentials for the SearchService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "RETAIL_CREDENTIALS",
33
+ "RETAIL_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "RETAIL_CREDENTIALS_JSON",
38
+ "RETAIL_KEYFILE_JSON",
39
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
40
+ "GOOGLE_CLOUD_KEYFILE_JSON",
41
+ "GCLOUD_KEYFILE_JSON"
42
+ ]
43
+ self.paths = [
44
+ "~/.config/google_cloud/application_default_credentials.json"
45
+ ]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Retail
23
+ module V2
24
+ module SearchService
25
+ # Path helper methods for the SearchService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Branch resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param catalog [String]
37
+ # @param branch [String]
38
+ #
39
+ # @return [::String]
40
+ def branch_path project:, location:, catalog:, branch:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+ raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/"
44
+
45
+ "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}"
46
+ end
47
+
48
+ extend self
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/retail/v2/version"
24
+
25
+ require "google/cloud/retail/v2/search_service/credentials"
26
+ require "google/cloud/retail/v2/search_service/paths"
27
+ require "google/cloud/retail/v2/search_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Retail
32
+ module V2
33
+ ##
34
+ # Service for search.
35
+ #
36
+ # This feature is only available for users who have Retail Search enabled.
37
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
38
+ # cloud sales if you are interested in using Retail Search.
39
+ #
40
+ # To load this service and instantiate a client:
41
+ #
42
+ # require "google/cloud/retail/v2/search_service"
43
+ # client = ::Google::Cloud::Retail::V2::SearchService::Client.new
44
+ #
45
+ module SearchService
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "search_service", "helpers.rb"
53
+ require "google/cloud/retail/v2/search_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,133 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/retail/v2/search_service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/cloud/retail/v2/common_pb'
11
+ require 'google/cloud/retail/v2/product_pb'
12
+ require 'google/protobuf/field_mask_pb'
13
+ require 'google/protobuf/struct_pb'
14
+ require 'google/protobuf/timestamp_pb'
15
+ require 'google/protobuf/wrappers_pb'
16
+ Google::Protobuf::DescriptorPool.generated_pool.build do
17
+ add_file("google/cloud/retail/v2/search_service.proto", :syntax => :proto3) do
18
+ add_message "google.cloud.retail.v2.SearchRequest" do
19
+ optional :placement, :string, 1
20
+ optional :branch, :string, 2
21
+ optional :query, :string, 3
22
+ optional :visitor_id, :string, 4
23
+ optional :user_info, :message, 5, "google.cloud.retail.v2.UserInfo"
24
+ optional :page_size, :int32, 7
25
+ optional :page_token, :string, 8
26
+ optional :offset, :int32, 9
27
+ optional :filter, :string, 10
28
+ optional :canonical_filter, :string, 28
29
+ optional :order_by, :string, 11
30
+ repeated :facet_specs, :message, 12, "google.cloud.retail.v2.SearchRequest.FacetSpec"
31
+ optional :dynamic_facet_spec, :message, 21, "google.cloud.retail.v2.SearchRequest.DynamicFacetSpec"
32
+ optional :boost_spec, :message, 13, "google.cloud.retail.v2.SearchRequest.BoostSpec"
33
+ optional :query_expansion_spec, :message, 14, "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec"
34
+ repeated :variant_rollup_keys, :string, 17
35
+ repeated :page_categories, :string, 23
36
+ end
37
+ add_message "google.cloud.retail.v2.SearchRequest.FacetSpec" do
38
+ optional :facet_key, :message, 1, "google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey"
39
+ optional :limit, :int32, 2
40
+ repeated :excluded_filter_keys, :string, 3
41
+ optional :enable_dynamic_position, :bool, 4
42
+ end
43
+ add_message "google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey" do
44
+ optional :key, :string, 1
45
+ repeated :intervals, :message, 2, "google.cloud.retail.v2.Interval"
46
+ repeated :restricted_values, :string, 3
47
+ repeated :prefixes, :string, 8
48
+ repeated :contains, :string, 9
49
+ optional :order_by, :string, 4
50
+ optional :query, :string, 5
51
+ end
52
+ add_message "google.cloud.retail.v2.SearchRequest.DynamicFacetSpec" do
53
+ optional :mode, :enum, 1, "google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode"
54
+ end
55
+ add_enum "google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode" do
56
+ value :MODE_UNSPECIFIED, 0
57
+ value :DISABLED, 1
58
+ value :ENABLED, 2
59
+ end
60
+ add_message "google.cloud.retail.v2.SearchRequest.BoostSpec" do
61
+ repeated :condition_boost_specs, :message, 1, "google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec"
62
+ end
63
+ add_message "google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec" do
64
+ optional :condition, :string, 1
65
+ optional :boost, :float, 2
66
+ end
67
+ add_message "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec" do
68
+ optional :condition, :enum, 1, "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition"
69
+ optional :pin_unexpanded_results, :bool, 2
70
+ end
71
+ add_enum "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition" do
72
+ value :CONDITION_UNSPECIFIED, 0
73
+ value :DISABLED, 1
74
+ value :AUTO, 3
75
+ end
76
+ add_message "google.cloud.retail.v2.SearchResponse" do
77
+ repeated :results, :message, 1, "google.cloud.retail.v2.SearchResponse.SearchResult"
78
+ repeated :facets, :message, 2, "google.cloud.retail.v2.SearchResponse.Facet"
79
+ optional :total_size, :int32, 3
80
+ optional :corrected_query, :string, 4
81
+ optional :attribution_token, :string, 5
82
+ optional :next_page_token, :string, 6
83
+ optional :query_expansion_info, :message, 7, "google.cloud.retail.v2.SearchResponse.QueryExpansionInfo"
84
+ optional :redirect_uri, :string, 10
85
+ end
86
+ add_message "google.cloud.retail.v2.SearchResponse.SearchResult" do
87
+ optional :id, :string, 1
88
+ optional :product, :message, 2, "google.cloud.retail.v2.Product"
89
+ optional :matching_variant_count, :int32, 3
90
+ map :matching_variant_fields, :string, :message, 4, "google.protobuf.FieldMask"
91
+ map :variant_rollup_values, :string, :message, 5, "google.protobuf.Value"
92
+ end
93
+ add_message "google.cloud.retail.v2.SearchResponse.Facet" do
94
+ optional :key, :string, 1
95
+ repeated :values, :message, 2, "google.cloud.retail.v2.SearchResponse.Facet.FacetValue"
96
+ optional :dynamic_facet, :bool, 3
97
+ end
98
+ add_message "google.cloud.retail.v2.SearchResponse.Facet.FacetValue" do
99
+ optional :count, :int64, 3
100
+ oneof :facet_value do
101
+ optional :value, :string, 1
102
+ optional :interval, :message, 2, "google.cloud.retail.v2.Interval"
103
+ end
104
+ end
105
+ add_message "google.cloud.retail.v2.SearchResponse.QueryExpansionInfo" do
106
+ optional :expanded_query, :bool, 1
107
+ optional :pinned_result_count, :int64, 2
108
+ end
109
+ end
110
+ end
111
+
112
+ module Google
113
+ module Cloud
114
+ module Retail
115
+ module V2
116
+ SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest").msgclass
117
+ SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec").msgclass
118
+ SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey").msgclass
119
+ SearchRequest::DynamicFacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec").msgclass
120
+ SearchRequest::DynamicFacetSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode").enummodule
121
+ SearchRequest::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec").msgclass
122
+ SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass
123
+ SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec").msgclass
124
+ SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition").enummodule
125
+ SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse").msgclass
126
+ SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.SearchResult").msgclass
127
+ SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet").msgclass
128
+ SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet.FacetValue").msgclass
129
+ SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.QueryExpansionInfo").msgclass
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,53 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/retail/v2/search_service.proto for package 'Google.Cloud.Retail.V2'
3
+ # Original file comments:
4
+ # Copyright 2020 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/retail/v2/search_service_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Retail
25
+ module V2
26
+ module SearchService
27
+ # Service for search.
28
+ #
29
+ # This feature is only available for users who have Retail Search enabled.
30
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
31
+ # cloud sales if you are interested in using Retail Search.
32
+ class Service
33
+
34
+ include GRPC::GenericService
35
+
36
+ self.marshal_class_method = :encode
37
+ self.unmarshal_class_method = :decode
38
+ self.service_name = 'google.cloud.retail.v2.SearchService'
39
+
40
+ # Performs a search.
41
+ #
42
+ # This feature is only available for users who have Retail Search enabled.
43
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
44
+ # cloud sales if you are interested in using Retail Search.
45
+ rpc :Search, ::Google::Cloud::Retail::V2::SearchRequest, ::Google::Cloud::Retail::V2::SearchResponse
46
+ end
47
+
48
+ Stub = Service.rpc_stub_class
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -14,14 +14,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_message "google.cloud.retail.v2.UserEvent" do
15
15
  optional :event_type, :string, 1
16
16
  optional :visitor_id, :string, 2
17
+ optional :session_id, :string, 21
17
18
  optional :event_time, :message, 3, "google.protobuf.Timestamp"
18
19
  repeated :experiment_ids, :string, 4
19
20
  optional :attribution_token, :string, 5
20
21
  repeated :product_details, :message, 6, "google.cloud.retail.v2.ProductDetail"
22
+ optional :completion_detail, :message, 22, "google.cloud.retail.v2.CompletionDetail"
21
23
  map :attributes, :string, :message, 7, "google.cloud.retail.v2.CustomAttribute"
22
24
  optional :cart_id, :string, 8
23
25
  optional :purchase_transaction, :message, 9, "google.cloud.retail.v2.PurchaseTransaction"
24
26
  optional :search_query, :string, 10
27
+ optional :filter, :string, 16
28
+ optional :order_by, :string, 17
29
+ optional :offset, :int32, 18
25
30
  repeated :page_categories, :string, 11
26
31
  optional :user_info, :message, 12, "google.cloud.retail.v2.UserInfo"
27
32
  optional :uri, :string, 13
@@ -32,6 +37,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
32
37
  optional :product, :message, 1, "google.cloud.retail.v2.Product"
33
38
  optional :quantity, :message, 2, "google.protobuf.Int32Value"
34
39
  end
40
+ add_message "google.cloud.retail.v2.CompletionDetail" do
41
+ optional :completion_attribution_token, :string, 1
42
+ optional :selected_suggestion, :string, 2
43
+ optional :selected_position, :int32, 3
44
+ end
35
45
  add_message "google.cloud.retail.v2.PurchaseTransaction" do
36
46
  optional :id, :string, 1
37
47
  optional :revenue, :float, 2
@@ -48,6 +58,7 @@ module Google
48
58
  module V2
49
59
  UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEvent").msgclass
50
60
  ProductDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductDetail").msgclass
61
+ CompletionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionDetail").msgclass
51
62
  PurchaseTransaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurchaseTransaction").msgclass
52
63
  end
53
64
  end
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Retail::V2::UserEventService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all UserEventService clients:
47
- #
48
- # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all UserEventService clients
47
+ # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -99,19 +98,15 @@ module Google
99
98
  ##
100
99
  # Create a new UserEventService client object.
101
100
  #
102
- # ## Examples
103
- #
104
- # To create a new UserEventService client with the default
105
- # configuration:
106
- #
107
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new
101
+ # @example
108
102
  #
109
- # To create a new UserEventService client with a custom
110
- # configuration:
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new
111
105
  #
112
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
113
- # config.timeout = 10.0
114
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
115
110
  #
116
111
  # @yield [config] Configure the UserEventService client.
117
112
  # @yieldparam config [Client::Configuration]
@@ -131,10 +126,9 @@ module Google
131
126
 
132
127
  # Create credentials
133
128
  credentials = @config.credentials
134
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
135
130
  # but only if the default endpoint does not have a region prefix.
136
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
137
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
138
132
  !@config.endpoint.split(".").first.include?("-")
139
133
  credentials ||= Credentials.default scope: @config.scope,
140
134
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -225,7 +219,9 @@ module Google
225
219
  options.apply_defaults timeout: @config.rpcs.write_user_event.timeout,
226
220
  metadata: metadata,
227
221
  retry_policy: @config.rpcs.write_user_event.retry_policy
228
- options.apply_defaults metadata: @config.metadata,
222
+
223
+ options.apply_defaults timeout: @config.timeout,
224
+ metadata: @config.metadata,
229
225
  retry_policy: @config.retry_policy
230
226
 
231
227
  @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation|
@@ -308,7 +304,9 @@ module Google
308
304
  options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout,
309
305
  metadata: metadata,
310
306
  retry_policy: @config.rpcs.collect_user_event.retry_policy
311
- options.apply_defaults metadata: @config.metadata,
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
312
310
  retry_policy: @config.retry_policy
313
311
 
314
312
  @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation|
@@ -343,7 +341,7 @@ module Google
343
341
  # @param parent [::String]
344
342
  # Required. The resource name of the catalog under which the events are
345
343
  # created. The format is
346
- # "projects/$\\{projectId}/locations/global/catalogs/$\\{catalogId}"
344
+ # `projects/${projectId}/locations/global/catalogs/${catalogId}`
347
345
  # @param filter [::String]
348
346
  # Required. The filter string to specify the events to be deleted with a
349
347
  # length limit of 5,000 characters. Empty string filter is not allowed. The
@@ -407,7 +405,9 @@ module Google
407
405
  options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
408
406
  metadata: metadata,
409
407
  retry_policy: @config.rpcs.purge_user_events.retry_policy
410
- options.apply_defaults metadata: @config.metadata,
408
+
409
+ options.apply_defaults timeout: @config.timeout,
410
+ metadata: @config.metadata,
411
411
  retry_policy: @config.retry_policy
412
412
 
413
413
  @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
@@ -485,7 +485,9 @@ module Google
485
485
  options.apply_defaults timeout: @config.rpcs.import_user_events.timeout,
486
486
  metadata: metadata,
487
487
  retry_policy: @config.rpcs.import_user_events.retry_policy
488
- options.apply_defaults metadata: @config.metadata,
488
+
489
+ options.apply_defaults timeout: @config.timeout,
490
+ metadata: @config.metadata,
489
491
  retry_policy: @config.retry_policy
490
492
 
491
493
  @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation|
@@ -564,7 +566,9 @@ module Google
564
566
  options.apply_defaults timeout: @config.rpcs.rejoin_user_events.timeout,
565
567
  metadata: metadata,
566
568
  retry_policy: @config.rpcs.rejoin_user_events.retry_policy
567
- options.apply_defaults metadata: @config.metadata,
569
+
570
+ options.apply_defaults timeout: @config.timeout,
571
+ metadata: @config.metadata,
568
572
  retry_policy: @config.retry_policy
569
573
 
570
574
  @user_event_service_stub.call_rpc :rejoin_user_events, request, options: options do |response, operation|
@@ -589,22 +593,21 @@ module Google
589
593
  # Configuration can be applied globally to all clients, or to a single client
590
594
  # on construction.
591
595
  #
592
- # # Examples
593
- #
594
- # To modify the global config, setting the timeout for write_user_event
595
- # to 20 seconds, and all remaining timeouts to 10 seconds:
596
- #
597
- # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
598
- # config.timeout = 10.0
599
- # config.rpcs.write_user_event.timeout = 20.0
600
- # end
601
- #
602
- # To apply the above configuration only to a new client:
603
- #
604
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
605
- # config.timeout = 10.0
606
- # config.rpcs.write_user_event.timeout = 20.0
607
- # end
596
+ # @example
597
+ #
598
+ # # Modify the global config, setting the timeout for
599
+ # # write_user_event to 20 seconds,
600
+ # # and all remaining timeouts to 10 seconds.
601
+ # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
602
+ # config.timeout = 10.0
603
+ # config.rpcs.write_user_event.timeout = 20.0
604
+ # end
605
+ #
606
+ # # Apply the above configuration only to a new client.
607
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
608
+ # config.timeout = 10.0
609
+ # config.rpcs.write_user_event.timeout = 20.0
610
+ # end
608
611
  #
609
612
  # @!attribute [rw] endpoint
610
613
  # The hostname or hostname:port of the service endpoint.