google-cloud-retail-v2 0.3.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/retail/v2.rb +2 -0
  5. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  6. data/lib/google/cloud/retail/v2/catalog_service/client.rb +242 -45
  7. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  8. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  9. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +47 -1
  10. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  11. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  12. data/lib/google/cloud/retail/v2/completion_service/client.rb +543 -0
  13. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  14. data/lib/google/cloud/retail/v2/completion_service/operations.rb +664 -0
  15. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  16. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  17. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  18. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  19. data/lib/google/cloud/retail/v2/prediction_service/client.rb +68 -75
  20. data/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +1 -1
  21. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  22. data/lib/google/cloud/retail/v2/product_service/client.rb +684 -48
  23. data/lib/google/cloud/retail/v2/product_service/operations.rb +34 -25
  24. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  25. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +76 -1
  26. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  27. data/lib/google/cloud/retail/v2/search_service/client.rb +531 -0
  28. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  29. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  30. data/lib/google/cloud/retail/v2/search_service_pb.rb +131 -0
  31. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  32. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  33. data/lib/google/cloud/retail/v2/user_event_service/client.rb +47 -47
  34. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +34 -25
  35. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  36. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +1 -1
  37. data/lib/google/cloud/retail/v2/version.rb +1 -1
  38. data/proto_docs/google/api/field_behavior.rb +7 -1
  39. data/proto_docs/google/api/httpbody.rb +4 -3
  40. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  41. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  42. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  43. data/proto_docs/google/cloud/retail/v2/completion_service.rb +162 -0
  44. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  45. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  46. data/proto_docs/google/cloud/retail/v2/product.rb +266 -10
  47. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  48. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  49. data/proto_docs/google/cloud/retail/v2/search_service.rb +681 -0
  50. data/proto_docs/google/cloud/retail/v2/user_event.rb +95 -3
  51. data/proto_docs/google/type/date.rb +53 -0
  52. 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,131 @@
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
+ end
70
+ add_enum "google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition" do
71
+ value :CONDITION_UNSPECIFIED, 0
72
+ value :DISABLED, 1
73
+ value :AUTO, 3
74
+ end
75
+ add_message "google.cloud.retail.v2.SearchResponse" do
76
+ repeated :results, :message, 1, "google.cloud.retail.v2.SearchResponse.SearchResult"
77
+ repeated :facets, :message, 2, "google.cloud.retail.v2.SearchResponse.Facet"
78
+ optional :total_size, :int32, 3
79
+ optional :corrected_query, :string, 4
80
+ optional :attribution_token, :string, 5
81
+ optional :next_page_token, :string, 6
82
+ optional :query_expansion_info, :message, 7, "google.cloud.retail.v2.SearchResponse.QueryExpansionInfo"
83
+ optional :redirect_uri, :string, 10
84
+ end
85
+ add_message "google.cloud.retail.v2.SearchResponse.SearchResult" do
86
+ optional :id, :string, 1
87
+ optional :product, :message, 2, "google.cloud.retail.v2.Product"
88
+ optional :matching_variant_count, :int32, 3
89
+ map :matching_variant_fields, :string, :message, 4, "google.protobuf.FieldMask"
90
+ map :variant_rollup_values, :string, :message, 5, "google.protobuf.Value"
91
+ end
92
+ add_message "google.cloud.retail.v2.SearchResponse.Facet" do
93
+ optional :key, :string, 1
94
+ repeated :values, :message, 2, "google.cloud.retail.v2.SearchResponse.Facet.FacetValue"
95
+ optional :dynamic_facet, :bool, 3
96
+ end
97
+ add_message "google.cloud.retail.v2.SearchResponse.Facet.FacetValue" do
98
+ optional :count, :int64, 3
99
+ oneof :facet_value do
100
+ optional :value, :string, 1
101
+ optional :interval, :message, 2, "google.cloud.retail.v2.Interval"
102
+ end
103
+ end
104
+ add_message "google.cloud.retail.v2.SearchResponse.QueryExpansionInfo" do
105
+ optional :expanded_query, :bool, 1
106
+ end
107
+ end
108
+ end
109
+
110
+ module Google
111
+ module Cloud
112
+ module Retail
113
+ module V2
114
+ SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest").msgclass
115
+ SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec").msgclass
116
+ SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey").msgclass
117
+ SearchRequest::DynamicFacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec").msgclass
118
+ SearchRequest::DynamicFacetSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode").enummodule
119
+ SearchRequest::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec").msgclass
120
+ SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass
121
+ SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec").msgclass
122
+ SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition").enummodule
123
+ SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse").msgclass
124
+ SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.SearchResult").msgclass
125
+ SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet").msgclass
126
+ SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet.FacetValue").msgclass
127
+ SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.QueryExpansionInfo").msgclass
128
+ end
129
+ end
130
+ end
131
+ 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
+ # Contact Retail Support (retail-search-support@google.com) if you are
31
+ # 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
+ # Contact Retail Support (retail-search-support@google.com) if you are
44
+ # 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]
@@ -67,10 +66,7 @@ module Google
67
66
 
68
67
  default_config.timeout = 60.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14, 4]
69
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
74
70
  }
75
71
 
76
72
  default_config
@@ -102,19 +98,15 @@ module Google
102
98
  ##
103
99
  # Create a new UserEventService client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new UserEventService client with the default
108
- # configuration:
109
- #
110
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new
101
+ # @example
111
102
  #
112
- # To create a new UserEventService client with a custom
113
- # configuration:
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new
114
105
  #
115
- # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config|
116
- # config.timeout = 10.0
117
- # 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
118
110
  #
119
111
  # @yield [config] Configure the UserEventService client.
120
112
  # @yieldparam config [Client::Configuration]
@@ -134,14 +126,13 @@ module Google
134
126
 
135
127
  # Create credentials
136
128
  credentials = @config.credentials
137
- # 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,
138
130
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
132
  !@config.endpoint.split(".").first.include?("-")
142
133
  credentials ||= Credentials.default scope: @config.scope,
143
134
  enable_self_signed_jwt: enable_self_signed_jwt
144
- if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
136
  credentials = Credentials.new credentials, scope: @config.scope
146
137
  end
147
138
  @quota_project_id = @config.quota_project
@@ -228,7 +219,9 @@ module Google
228
219
  options.apply_defaults timeout: @config.rpcs.write_user_event.timeout,
229
220
  metadata: metadata,
230
221
  retry_policy: @config.rpcs.write_user_event.retry_policy
231
- options.apply_defaults metadata: @config.metadata,
222
+
223
+ options.apply_defaults timeout: @config.timeout,
224
+ metadata: @config.metadata,
232
225
  retry_policy: @config.retry_policy
233
226
 
234
227
  @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation|
@@ -311,7 +304,9 @@ module Google
311
304
  options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout,
312
305
  metadata: metadata,
313
306
  retry_policy: @config.rpcs.collect_user_event.retry_policy
314
- options.apply_defaults metadata: @config.metadata,
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
315
310
  retry_policy: @config.retry_policy
316
311
 
317
312
  @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation|
@@ -346,7 +341,7 @@ module Google
346
341
  # @param parent [::String]
347
342
  # Required. The resource name of the catalog under which the events are
348
343
  # created. The format is
349
- # "projects/$\\{projectId}/locations/global/catalogs/$\\{catalogId}"
344
+ # `projects/${projectId}/locations/global/catalogs/${catalogId}`
350
345
  # @param filter [::String]
351
346
  # Required. The filter string to specify the events to be deleted with a
352
347
  # length limit of 5,000 characters. Empty string filter is not allowed. The
@@ -410,7 +405,9 @@ module Google
410
405
  options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
411
406
  metadata: metadata,
412
407
  retry_policy: @config.rpcs.purge_user_events.retry_policy
413
- options.apply_defaults metadata: @config.metadata,
408
+
409
+ options.apply_defaults timeout: @config.timeout,
410
+ metadata: @config.metadata,
414
411
  retry_policy: @config.retry_policy
415
412
 
416
413
  @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
@@ -488,7 +485,9 @@ module Google
488
485
  options.apply_defaults timeout: @config.rpcs.import_user_events.timeout,
489
486
  metadata: metadata,
490
487
  retry_policy: @config.rpcs.import_user_events.retry_policy
491
- options.apply_defaults metadata: @config.metadata,
488
+
489
+ options.apply_defaults timeout: @config.timeout,
490
+ metadata: @config.metadata,
492
491
  retry_policy: @config.retry_policy
493
492
 
494
493
  @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation|
@@ -567,7 +566,9 @@ module Google
567
566
  options.apply_defaults timeout: @config.rpcs.rejoin_user_events.timeout,
568
567
  metadata: metadata,
569
568
  retry_policy: @config.rpcs.rejoin_user_events.retry_policy
570
- options.apply_defaults metadata: @config.metadata,
569
+
570
+ options.apply_defaults timeout: @config.timeout,
571
+ metadata: @config.metadata,
571
572
  retry_policy: @config.retry_policy
572
573
 
573
574
  @user_event_service_stub.call_rpc :rejoin_user_events, request, options: options do |response, operation|
@@ -592,22 +593,21 @@ module Google
592
593
  # Configuration can be applied globally to all clients, or to a single client
593
594
  # on construction.
594
595
  #
595
- # # Examples
596
- #
597
- # To modify the global config, setting the timeout for write_user_event
598
- # to 20 seconds, and all remaining timeouts to 10 seconds:
599
- #
600
- # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config|
601
- # config.timeout = 10.0
602
- # config.rpcs.write_user_event.timeout = 20.0
603
- # end
604
- #
605
- # To apply the above configuration only to a new client:
606
- #
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
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
611
611
  #
612
612
  # @!attribute [rw] endpoint
613
613
  # The hostname or hostname:port of the service endpoint.