google-cloud-retail-v2 0.17.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +38 -14
- data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +36 -9
- data/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/completion_service/client.rb +39 -14
- data/lib/google/cloud/retail/v2/completion_service/operations.rb +28 -6
- data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +37 -9
- data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +33 -8
- data/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/control_service/client.rb +38 -14
- data/lib/google/cloud/retail/v2/control_service/rest/client.rb +36 -9
- data/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/model_service/client.rb +39 -14
- data/lib/google/cloud/retail/v2/model_service/operations.rb +28 -6
- data/lib/google/cloud/retail/v2/model_service/rest/client.rb +37 -9
- data/lib/google/cloud/retail/v2/model_service/rest/operations.rb +33 -8
- data/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +38 -14
- data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +36 -9
- data/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/product_service/client.rb +39 -14
- data/lib/google/cloud/retail/v2/product_service/operations.rb +28 -6
- data/lib/google/cloud/retail/v2/product_service/rest/client.rb +37 -9
- data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +33 -8
- data/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/search_service/client.rb +38 -14
- data/lib/google/cloud/retail/v2/search_service/rest/client.rb +36 -9
- data/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/serving_config_service/client.rb +38 -14
- data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +36 -9
- data/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +39 -14
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +28 -6
- data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +37 -9
- data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +33 -8
- data/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/retail/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/retail/v2/common.rb +2 -0
- data/proto_docs/google/cloud/retail/v2/import_config.rb +2 -0
- data/proto_docs/google/cloud/retail/v2/prediction_service.rb +1 -0
- data/proto_docs/google/cloud/retail/v2/product.rb +1 -0
- data/proto_docs/google/cloud/retail/v2/search_service.rb +1 -0
- metadata +7 -7
@@ -36,6 +36,9 @@ module Google
|
|
36
36
|
# Enable Retail Search on Cloud Console before using this feature.
|
37
37
|
#
|
38
38
|
class Client
|
39
|
+
# @private
|
40
|
+
DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$"
|
41
|
+
|
39
42
|
include Paths
|
40
43
|
|
41
44
|
# @private
|
@@ -101,6 +104,15 @@ module Google
|
|
101
104
|
@config
|
102
105
|
end
|
103
106
|
|
107
|
+
##
|
108
|
+
# The effective universe domain
|
109
|
+
#
|
110
|
+
# @return [String]
|
111
|
+
#
|
112
|
+
def universe_domain
|
113
|
+
@search_service_stub.universe_domain
|
114
|
+
end
|
115
|
+
|
104
116
|
##
|
105
117
|
# Create a new SearchService REST client object.
|
106
118
|
#
|
@@ -128,8 +140,9 @@ module Google
|
|
128
140
|
credentials = @config.credentials
|
129
141
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
130
142
|
# but only if the default endpoint does not have a region prefix.
|
131
|
-
enable_self_signed_jwt = @config.endpoint
|
132
|
-
|
143
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
144
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
145
|
+
!@config.endpoint.split(".").first.include?("-"))
|
133
146
|
credentials ||= Credentials.default scope: @config.scope,
|
134
147
|
enable_self_signed_jwt: enable_self_signed_jwt
|
135
148
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -139,13 +152,19 @@ module Google
|
|
139
152
|
@quota_project_id = @config.quota_project
|
140
153
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
141
154
|
|
155
|
+
@search_service_stub = ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.new(
|
156
|
+
endpoint: @config.endpoint,
|
157
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
158
|
+
universe_domain: @config.universe_domain,
|
159
|
+
credentials: credentials
|
160
|
+
)
|
161
|
+
|
142
162
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
143
163
|
config.credentials = credentials
|
144
164
|
config.quota_project = @quota_project_id
|
145
|
-
config.endpoint = @
|
165
|
+
config.endpoint = @search_service_stub.endpoint
|
166
|
+
config.universe_domain = @search_service_stub.universe_domain
|
146
167
|
end
|
147
|
-
|
148
|
-
@search_service_stub = ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
149
168
|
end
|
150
169
|
|
151
170
|
##
|
@@ -508,9 +527,9 @@ module Google
|
|
508
527
|
# end
|
509
528
|
#
|
510
529
|
# @!attribute [rw] endpoint
|
511
|
-
#
|
512
|
-
#
|
513
|
-
# @return [::String]
|
530
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
531
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
532
|
+
# @return [::String,nil]
|
514
533
|
# @!attribute [rw] credentials
|
515
534
|
# Credentials to send with calls. You may provide any of the following types:
|
516
535
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -547,13 +566,20 @@ module Google
|
|
547
566
|
# @!attribute [rw] quota_project
|
548
567
|
# A separate project against which to charge quota.
|
549
568
|
# @return [::String]
|
569
|
+
# @!attribute [rw] universe_domain
|
570
|
+
# The universe domain within which to make requests. This determines the
|
571
|
+
# default endpoint URL. The default value of nil uses the environment
|
572
|
+
# universe (usually the default "googleapis.com" universe).
|
573
|
+
# @return [::String,nil]
|
550
574
|
#
|
551
575
|
class Configuration
|
552
576
|
extend ::Gapic::Config
|
553
577
|
|
578
|
+
# @private
|
579
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
554
580
|
DEFAULT_ENDPOINT = "retail.googleapis.com"
|
555
581
|
|
556
|
-
config_attr :endpoint,
|
582
|
+
config_attr :endpoint, nil, ::String, nil
|
557
583
|
config_attr :credentials, nil do |value|
|
558
584
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
559
585
|
allowed.any? { |klass| klass === value }
|
@@ -565,6 +591,7 @@ module Google
|
|
565
591
|
config_attr :metadata, nil, ::Hash, nil
|
566
592
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
567
593
|
config_attr :quota_project, nil, ::String, nil
|
594
|
+
config_attr :universe_domain, nil, ::String, nil
|
568
595
|
|
569
596
|
# @private
|
570
597
|
def initialize parent_config = nil
|
@@ -30,16 +30,37 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
def initialize endpoint:, credentials:
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
34
34
|
# These require statements are intentionally placed here to initialize
|
35
35
|
# the REST modules only when it's required.
|
36
36
|
require "gapic/rest"
|
37
37
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
39
42
|
numeric_enums: true,
|
40
43
|
raise_faraday_errors: false
|
41
44
|
end
|
42
45
|
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the search REST call
|
45
66
|
#
|
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Service for modifying ServingConfig.
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$"
|
36
|
+
|
34
37
|
include Paths
|
35
38
|
|
36
39
|
# @private
|
@@ -91,6 +94,15 @@ module Google
|
|
91
94
|
@config
|
92
95
|
end
|
93
96
|
|
97
|
+
##
|
98
|
+
# The effective universe domain
|
99
|
+
#
|
100
|
+
# @return [String]
|
101
|
+
#
|
102
|
+
def universe_domain
|
103
|
+
@serving_config_service_stub.universe_domain
|
104
|
+
end
|
105
|
+
|
94
106
|
##
|
95
107
|
# Create a new ServingConfigService client object.
|
96
108
|
#
|
@@ -124,8 +136,9 @@ module Google
|
|
124
136
|
credentials = @config.credentials
|
125
137
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
126
138
|
# but only if the default endpoint does not have a region prefix.
|
127
|
-
enable_self_signed_jwt = @config.endpoint
|
128
|
-
|
139
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
140
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
141
|
+
!@config.endpoint.split(".").first.include?("-"))
|
129
142
|
credentials ||= Credentials.default scope: @config.scope,
|
130
143
|
enable_self_signed_jwt: enable_self_signed_jwt
|
131
144
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -134,20 +147,23 @@ module Google
|
|
134
147
|
@quota_project_id = @config.quota_project
|
135
148
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
136
149
|
|
137
|
-
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
138
|
-
config.credentials = credentials
|
139
|
-
config.quota_project = @quota_project_id
|
140
|
-
config.endpoint = @config.endpoint
|
141
|
-
end
|
142
|
-
|
143
150
|
@serving_config_service_stub = ::Gapic::ServiceStub.new(
|
144
151
|
::Google::Cloud::Retail::V2::ServingConfigService::Stub,
|
145
|
-
credentials:
|
146
|
-
endpoint:
|
152
|
+
credentials: credentials,
|
153
|
+
endpoint: @config.endpoint,
|
154
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
155
|
+
universe_domain: @config.universe_domain,
|
147
156
|
channel_args: @config.channel_args,
|
148
157
|
interceptors: @config.interceptors,
|
149
158
|
channel_pool_config: @config.channel_pool
|
150
159
|
)
|
160
|
+
|
161
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
162
|
+
config.credentials = credentials
|
163
|
+
config.quota_project = @quota_project_id
|
164
|
+
config.endpoint = @serving_config_service_stub.endpoint
|
165
|
+
config.universe_domain = @serving_config_service_stub.universe_domain
|
166
|
+
end
|
151
167
|
end
|
152
168
|
|
153
169
|
##
|
@@ -841,9 +857,9 @@ module Google
|
|
841
857
|
# end
|
842
858
|
#
|
843
859
|
# @!attribute [rw] endpoint
|
844
|
-
#
|
845
|
-
#
|
846
|
-
# @return [::String]
|
860
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
861
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
862
|
+
# @return [::String,nil]
|
847
863
|
# @!attribute [rw] credentials
|
848
864
|
# Credentials to send with calls. You may provide any of the following types:
|
849
865
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -889,13 +905,20 @@ module Google
|
|
889
905
|
# @!attribute [rw] quota_project
|
890
906
|
# A separate project against which to charge quota.
|
891
907
|
# @return [::String]
|
908
|
+
# @!attribute [rw] universe_domain
|
909
|
+
# The universe domain within which to make requests. This determines the
|
910
|
+
# default endpoint URL. The default value of nil uses the environment
|
911
|
+
# universe (usually the default "googleapis.com" universe).
|
912
|
+
# @return [::String,nil]
|
892
913
|
#
|
893
914
|
class Configuration
|
894
915
|
extend ::Gapic::Config
|
895
916
|
|
917
|
+
# @private
|
918
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
896
919
|
DEFAULT_ENDPOINT = "retail.googleapis.com"
|
897
920
|
|
898
|
-
config_attr :endpoint,
|
921
|
+
config_attr :endpoint, nil, ::String, nil
|
899
922
|
config_attr :credentials, nil do |value|
|
900
923
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
901
924
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -910,6 +933,7 @@ module Google
|
|
910
933
|
config_attr :metadata, nil, ::Hash, nil
|
911
934
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
912
935
|
config_attr :quota_project, nil, ::String, nil
|
936
|
+
config_attr :universe_domain, nil, ::String, nil
|
913
937
|
|
914
938
|
# @private
|
915
939
|
def initialize parent_config = nil
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# Service for modifying ServingConfig.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
include Paths
|
37
40
|
|
38
41
|
# @private
|
@@ -93,6 +96,15 @@ module Google
|
|
93
96
|
@config
|
94
97
|
end
|
95
98
|
|
99
|
+
##
|
100
|
+
# The effective universe domain
|
101
|
+
#
|
102
|
+
# @return [String]
|
103
|
+
#
|
104
|
+
def universe_domain
|
105
|
+
@serving_config_service_stub.universe_domain
|
106
|
+
end
|
107
|
+
|
96
108
|
##
|
97
109
|
# Create a new ServingConfigService REST client object.
|
98
110
|
#
|
@@ -120,8 +132,9 @@ module Google
|
|
120
132
|
credentials = @config.credentials
|
121
133
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
122
134
|
# but only if the default endpoint does not have a region prefix.
|
123
|
-
enable_self_signed_jwt = @config.endpoint
|
124
|
-
|
135
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
136
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
137
|
+
!@config.endpoint.split(".").first.include?("-"))
|
125
138
|
credentials ||= Credentials.default scope: @config.scope,
|
126
139
|
enable_self_signed_jwt: enable_self_signed_jwt
|
127
140
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -131,13 +144,19 @@ module Google
|
|
131
144
|
@quota_project_id = @config.quota_project
|
132
145
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
133
146
|
|
147
|
+
@serving_config_service_stub = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.new(
|
148
|
+
endpoint: @config.endpoint,
|
149
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
150
|
+
universe_domain: @config.universe_domain,
|
151
|
+
credentials: credentials
|
152
|
+
)
|
153
|
+
|
134
154
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
135
155
|
config.credentials = credentials
|
136
156
|
config.quota_project = @quota_project_id
|
137
|
-
config.endpoint = @
|
157
|
+
config.endpoint = @serving_config_service_stub.endpoint
|
158
|
+
config.universe_domain = @serving_config_service_stub.universe_domain
|
138
159
|
end
|
139
|
-
|
140
|
-
@serving_config_service_stub = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
141
160
|
end
|
142
161
|
|
143
162
|
##
|
@@ -782,9 +801,9 @@ module Google
|
|
782
801
|
# end
|
783
802
|
#
|
784
803
|
# @!attribute [rw] endpoint
|
785
|
-
#
|
786
|
-
#
|
787
|
-
# @return [::String]
|
804
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
805
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
806
|
+
# @return [::String,nil]
|
788
807
|
# @!attribute [rw] credentials
|
789
808
|
# Credentials to send with calls. You may provide any of the following types:
|
790
809
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -821,13 +840,20 @@ module Google
|
|
821
840
|
# @!attribute [rw] quota_project
|
822
841
|
# A separate project against which to charge quota.
|
823
842
|
# @return [::String]
|
843
|
+
# @!attribute [rw] universe_domain
|
844
|
+
# The universe domain within which to make requests. This determines the
|
845
|
+
# default endpoint URL. The default value of nil uses the environment
|
846
|
+
# universe (usually the default "googleapis.com" universe).
|
847
|
+
# @return [::String,nil]
|
824
848
|
#
|
825
849
|
class Configuration
|
826
850
|
extend ::Gapic::Config
|
827
851
|
|
852
|
+
# @private
|
853
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
828
854
|
DEFAULT_ENDPOINT = "retail.googleapis.com"
|
829
855
|
|
830
|
-
config_attr :endpoint,
|
856
|
+
config_attr :endpoint, nil, ::String, nil
|
831
857
|
config_attr :credentials, nil do |value|
|
832
858
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
833
859
|
allowed.any? { |klass| klass === value }
|
@@ -839,6 +865,7 @@ module Google
|
|
839
865
|
config_attr :metadata, nil, ::Hash, nil
|
840
866
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
841
867
|
config_attr :quota_project, nil, ::String, nil
|
868
|
+
config_attr :universe_domain, nil, ::String, nil
|
842
869
|
|
843
870
|
# @private
|
844
871
|
def initialize parent_config = nil
|
@@ -30,16 +30,37 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
def initialize endpoint:, credentials:
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
34
34
|
# These require statements are intentionally placed here to initialize
|
35
35
|
# the REST modules only when it's required.
|
36
36
|
require "gapic/rest"
|
37
37
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
39
42
|
numeric_enums: true,
|
40
43
|
raise_faraday_errors: false
|
41
44
|
end
|
42
45
|
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the create_serving_config REST call
|
45
66
|
#
|
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Service for ingesting end user actions on the customer website.
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$"
|
36
|
+
|
34
37
|
include Paths
|
35
38
|
|
36
39
|
# @private
|
@@ -106,6 +109,15 @@ module Google
|
|
106
109
|
@config
|
107
110
|
end
|
108
111
|
|
112
|
+
##
|
113
|
+
# The effective universe domain
|
114
|
+
#
|
115
|
+
# @return [String]
|
116
|
+
#
|
117
|
+
def universe_domain
|
118
|
+
@user_event_service_stub.universe_domain
|
119
|
+
end
|
120
|
+
|
109
121
|
##
|
110
122
|
# Create a new UserEventService client object.
|
111
123
|
#
|
@@ -139,8 +151,9 @@ module Google
|
|
139
151
|
credentials = @config.credentials
|
140
152
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
141
153
|
# but only if the default endpoint does not have a region prefix.
|
142
|
-
enable_self_signed_jwt = @config.endpoint
|
143
|
-
|
154
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
155
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
156
|
+
!@config.endpoint.split(".").first.include?("-"))
|
144
157
|
credentials ||= Credentials.default scope: @config.scope,
|
145
158
|
enable_self_signed_jwt: enable_self_signed_jwt
|
146
159
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -153,22 +166,26 @@ module Google
|
|
153
166
|
config.credentials = credentials
|
154
167
|
config.quota_project = @quota_project_id
|
155
168
|
config.endpoint = @config.endpoint
|
156
|
-
|
157
|
-
|
158
|
-
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
159
|
-
config.credentials = credentials
|
160
|
-
config.quota_project = @quota_project_id
|
161
|
-
config.endpoint = @config.endpoint
|
169
|
+
config.universe_domain = @config.universe_domain
|
162
170
|
end
|
163
171
|
|
164
172
|
@user_event_service_stub = ::Gapic::ServiceStub.new(
|
165
173
|
::Google::Cloud::Retail::V2::UserEventService::Stub,
|
166
|
-
credentials:
|
167
|
-
endpoint:
|
174
|
+
credentials: credentials,
|
175
|
+
endpoint: @config.endpoint,
|
176
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
177
|
+
universe_domain: @config.universe_domain,
|
168
178
|
channel_args: @config.channel_args,
|
169
179
|
interceptors: @config.interceptors,
|
170
180
|
channel_pool_config: @config.channel_pool
|
171
181
|
)
|
182
|
+
|
183
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
184
|
+
config.credentials = credentials
|
185
|
+
config.quota_project = @quota_project_id
|
186
|
+
config.endpoint = @user_event_service_stub.endpoint
|
187
|
+
config.universe_domain = @user_event_service_stub.universe_domain
|
188
|
+
end
|
172
189
|
end
|
173
190
|
|
174
191
|
##
|
@@ -756,9 +773,9 @@ module Google
|
|
756
773
|
# end
|
757
774
|
#
|
758
775
|
# @!attribute [rw] endpoint
|
759
|
-
#
|
760
|
-
#
|
761
|
-
# @return [::String]
|
776
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
777
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
778
|
+
# @return [::String,nil]
|
762
779
|
# @!attribute [rw] credentials
|
763
780
|
# Credentials to send with calls. You may provide any of the following types:
|
764
781
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -804,13 +821,20 @@ module Google
|
|
804
821
|
# @!attribute [rw] quota_project
|
805
822
|
# A separate project against which to charge quota.
|
806
823
|
# @return [::String]
|
824
|
+
# @!attribute [rw] universe_domain
|
825
|
+
# The universe domain within which to make requests. This determines the
|
826
|
+
# default endpoint URL. The default value of nil uses the environment
|
827
|
+
# universe (usually the default "googleapis.com" universe).
|
828
|
+
# @return [::String,nil]
|
807
829
|
#
|
808
830
|
class Configuration
|
809
831
|
extend ::Gapic::Config
|
810
832
|
|
833
|
+
# @private
|
834
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
811
835
|
DEFAULT_ENDPOINT = "retail.googleapis.com"
|
812
836
|
|
813
|
-
config_attr :endpoint,
|
837
|
+
config_attr :endpoint, nil, ::String, nil
|
814
838
|
config_attr :credentials, nil do |value|
|
815
839
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
816
840
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -825,6 +849,7 @@ module Google
|
|
825
849
|
config_attr :metadata, nil, ::Hash, nil
|
826
850
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
827
851
|
config_attr :quota_project, nil, ::String, nil
|
852
|
+
config_attr :universe_domain, nil, ::String, nil
|
828
853
|
|
829
854
|
# @private
|
830
855
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module UserEventService
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$"
|
31
|
+
|
29
32
|
# @private
|
30
33
|
attr_reader :operations_stub
|
31
34
|
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@config
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The effective universe domain
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
#
|
71
|
+
def universe_domain
|
72
|
+
@operations_stub.universe_domain
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Create a new Operations client object.
|
65
77
|
#
|
@@ -90,8 +102,10 @@ module Google
|
|
90
102
|
|
91
103
|
@operations_stub = ::Gapic::ServiceStub.new(
|
92
104
|
::Google::Longrunning::Operations::Stub,
|
93
|
-
credentials:
|
94
|
-
endpoint:
|
105
|
+
credentials: credentials,
|
106
|
+
endpoint: @config.endpoint,
|
107
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
108
|
+
universe_domain: @config.universe_domain,
|
95
109
|
channel_args: @config.channel_args,
|
96
110
|
interceptors: @config.interceptors,
|
97
111
|
channel_pool_config: @config.channel_pool
|
@@ -613,9 +627,9 @@ module Google
|
|
613
627
|
# end
|
614
628
|
#
|
615
629
|
# @!attribute [rw] endpoint
|
616
|
-
#
|
617
|
-
#
|
618
|
-
# @return [::String]
|
630
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
631
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
632
|
+
# @return [::String,nil]
|
619
633
|
# @!attribute [rw] credentials
|
620
634
|
# Credentials to send with calls. You may provide any of the following types:
|
621
635
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -661,13 +675,20 @@ module Google
|
|
661
675
|
# @!attribute [rw] quota_project
|
662
676
|
# A separate project against which to charge quota.
|
663
677
|
# @return [::String]
|
678
|
+
# @!attribute [rw] universe_domain
|
679
|
+
# The universe domain within which to make requests. This determines the
|
680
|
+
# default endpoint URL. The default value of nil uses the environment
|
681
|
+
# universe (usually the default "googleapis.com" universe).
|
682
|
+
# @return [::String,nil]
|
664
683
|
#
|
665
684
|
class Configuration
|
666
685
|
extend ::Gapic::Config
|
667
686
|
|
687
|
+
# @private
|
688
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
668
689
|
DEFAULT_ENDPOINT = "retail.googleapis.com"
|
669
690
|
|
670
|
-
config_attr :endpoint,
|
691
|
+
config_attr :endpoint, nil, ::String, nil
|
671
692
|
config_attr :credentials, nil do |value|
|
672
693
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
673
694
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -682,6 +703,7 @@ module Google
|
|
682
703
|
config_attr :metadata, nil, ::Hash, nil
|
683
704
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
684
705
|
config_attr :quota_project, nil, ::String, nil
|
706
|
+
config_attr :universe_domain, nil, ::String, nil
|
685
707
|
|
686
708
|
# @private
|
687
709
|
def initialize parent_config = nil
|