google-cloud-recommendation_engine-v1beta1 0.7.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +32 -8
  4. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +28 -6
  5. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb +34 -7
  6. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb +33 -8
  7. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb +23 -2
  8. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +31 -8
  9. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb +33 -7
  10. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb +23 -2
  11. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +31 -8
  12. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb +33 -7
  13. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb +23 -2
  14. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +32 -8
  15. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +28 -6
  16. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb +34 -7
  17. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb +33 -8
  18. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb +23 -2
  19. data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
  20. data/proto_docs/google/api/client.rb +14 -0
  21. metadata +5 -5
@@ -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, credentials: credentials,
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_catalog_item REST call
45
66
  #
@@ -34,6 +34,9 @@ module Google
34
34
  # key. You can register up to 20 API keys per project.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -109,6 +112,15 @@ module Google
109
112
  @config
110
113
  end
111
114
 
115
+ ##
116
+ # The effective universe domain
117
+ #
118
+ # @return [String]
119
+ #
120
+ def universe_domain
121
+ @prediction_api_key_registry_stub.universe_domain
122
+ end
123
+
112
124
  ##
113
125
  # Create a new PredictionApiKeyRegistry client object.
114
126
  #
@@ -142,8 +154,9 @@ module Google
142
154
  credentials = @config.credentials
143
155
  # Use self-signed JWT if the endpoint is unchanged from default,
144
156
  # but only if the default endpoint does not have a region prefix.
145
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
- !@config.endpoint.split(".").first.include?("-")
157
+ enable_self_signed_jwt = @config.endpoint.nil? ||
158
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
159
+ !@config.endpoint.split(".").first.include?("-"))
147
160
  credentials ||= Credentials.default scope: @config.scope,
148
161
  enable_self_signed_jwt: enable_self_signed_jwt
149
162
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -154,8 +167,10 @@ module Google
154
167
 
155
168
  @prediction_api_key_registry_stub = ::Gapic::ServiceStub.new(
156
169
  ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Stub,
157
- credentials: credentials,
158
- endpoint: @config.endpoint,
170
+ credentials: credentials,
171
+ endpoint: @config.endpoint,
172
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
173
+ universe_domain: @config.universe_domain,
159
174
  channel_args: @config.channel_args,
160
175
  interceptors: @config.interceptors,
161
176
  channel_pool_config: @config.channel_pool
@@ -464,9 +479,9 @@ module Google
464
479
  # end
465
480
  #
466
481
  # @!attribute [rw] endpoint
467
- # The hostname or hostname:port of the service endpoint.
468
- # Defaults to `"recommendationengine.googleapis.com"`.
469
- # @return [::String]
482
+ # A custom service endpoint, as a hostname or hostname:port. The default is
483
+ # nil, indicating to use the default endpoint in the current universe domain.
484
+ # @return [::String,nil]
470
485
  # @!attribute [rw] credentials
471
486
  # Credentials to send with calls. You may provide any of the following types:
472
487
  # * (`String`) The path to a service account key file in JSON format
@@ -512,13 +527,20 @@ module Google
512
527
  # @!attribute [rw] quota_project
513
528
  # A separate project against which to charge quota.
514
529
  # @return [::String]
530
+ # @!attribute [rw] universe_domain
531
+ # The universe domain within which to make requests. This determines the
532
+ # default endpoint URL. The default value of nil uses the environment
533
+ # universe (usually the default "googleapis.com" universe).
534
+ # @return [::String,nil]
515
535
  #
516
536
  class Configuration
517
537
  extend ::Gapic::Config
518
538
 
539
+ # @private
540
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
519
541
  DEFAULT_ENDPOINT = "recommendationengine.googleapis.com"
520
542
 
521
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
543
+ config_attr :endpoint, nil, ::String, nil
522
544
  config_attr :credentials, nil do |value|
523
545
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
524
546
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -533,6 +555,7 @@ module Google
533
555
  config_attr :metadata, nil, ::Hash, nil
534
556
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
535
557
  config_attr :quota_project, nil, ::String, nil
558
+ config_attr :universe_domain, nil, ::String, nil
536
559
 
537
560
  # @private
538
561
  def initialize parent_config = nil
@@ -36,6 +36,9 @@ module Google
36
36
  # key. You can register up to 20 API keys per project.
37
37
  #
38
38
  class Client
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$"
41
+
39
42
  include Paths
40
43
 
41
44
  # @private
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @prediction_api_key_registry_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new PredictionApiKeyRegistry REST client object.
116
128
  #
@@ -138,8 +150,9 @@ module Google
138
150
  credentials = @config.credentials
139
151
  # Use self-signed JWT if the endpoint is unchanged from default,
140
152
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
- !@config.endpoint.split(".").first.include?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
143
156
  credentials ||= Credentials.default scope: @config.scope,
144
157
  enable_self_signed_jwt: enable_self_signed_jwt
145
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -149,7 +162,12 @@ module Google
149
162
  @quota_project_id = @config.quota_project
150
163
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
164
 
152
- @prediction_api_key_registry_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
165
+ @prediction_api_key_registry_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.new(
166
+ endpoint: @config.endpoint,
167
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
168
+ universe_domain: @config.universe_domain,
169
+ credentials: credentials
170
+ )
153
171
  end
154
172
 
155
173
  # Service calls
@@ -433,9 +451,9 @@ module Google
433
451
  # end
434
452
  #
435
453
  # @!attribute [rw] endpoint
436
- # The hostname or hostname:port of the service endpoint.
437
- # Defaults to `"recommendationengine.googleapis.com"`.
438
- # @return [::String]
454
+ # A custom service endpoint, as a hostname or hostname:port. The default is
455
+ # nil, indicating to use the default endpoint in the current universe domain.
456
+ # @return [::String,nil]
439
457
  # @!attribute [rw] credentials
440
458
  # Credentials to send with calls. You may provide any of the following types:
441
459
  # * (`String`) The path to a service account key file in JSON format
@@ -472,13 +490,20 @@ module Google
472
490
  # @!attribute [rw] quota_project
473
491
  # A separate project against which to charge quota.
474
492
  # @return [::String]
493
+ # @!attribute [rw] universe_domain
494
+ # The universe domain within which to make requests. This determines the
495
+ # default endpoint URL. The default value of nil uses the environment
496
+ # universe (usually the default "googleapis.com" universe).
497
+ # @return [::String,nil]
475
498
  #
476
499
  class Configuration
477
500
  extend ::Gapic::Config
478
501
 
502
+ # @private
503
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
479
504
  DEFAULT_ENDPOINT = "recommendationengine.googleapis.com"
480
505
 
481
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
506
+ config_attr :endpoint, nil, ::String, nil
482
507
  config_attr :credentials, nil do |value|
483
508
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
484
509
  allowed.any? { |klass| klass === value }
@@ -490,6 +515,7 @@ module Google
490
515
  config_attr :metadata, nil, ::Hash, nil
491
516
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
492
517
  config_attr :quota_project, nil, ::String, nil
518
+ config_attr :universe_domain, nil, ::String, nil
493
519
 
494
520
  # @private
495
521
  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, credentials: credentials,
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_prediction_api_key_registration REST call
45
66
  #
@@ -30,6 +30,9 @@ module Google
30
30
  # Service for making recommendation prediction.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$"
35
+
33
36
  include Paths
34
37
 
35
38
  # @private
@@ -95,6 +98,15 @@ module Google
95
98
  @config
96
99
  end
97
100
 
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @prediction_service_stub.universe_domain
108
+ end
109
+
98
110
  ##
99
111
  # Create a new PredictionService client object.
100
112
  #
@@ -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 == Configuration::DEFAULT_ENDPOINT &&
132
- !@config.endpoint.split(".").first.include?("-")
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)
@@ -140,8 +153,10 @@ module Google
140
153
 
141
154
  @prediction_service_stub = ::Gapic::ServiceStub.new(
142
155
  ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Stub,
143
- credentials: credentials,
144
- endpoint: @config.endpoint,
156
+ credentials: credentials,
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
145
160
  channel_args: @config.channel_args,
146
161
  interceptors: @config.interceptors,
147
162
  channel_pool_config: @config.channel_pool
@@ -360,9 +375,9 @@ module Google
360
375
  # end
361
376
  #
362
377
  # @!attribute [rw] endpoint
363
- # The hostname or hostname:port of the service endpoint.
364
- # Defaults to `"recommendationengine.googleapis.com"`.
365
- # @return [::String]
378
+ # A custom service endpoint, as a hostname or hostname:port. The default is
379
+ # nil, indicating to use the default endpoint in the current universe domain.
380
+ # @return [::String,nil]
366
381
  # @!attribute [rw] credentials
367
382
  # Credentials to send with calls. You may provide any of the following types:
368
383
  # * (`String`) The path to a service account key file in JSON format
@@ -408,13 +423,20 @@ module Google
408
423
  # @!attribute [rw] quota_project
409
424
  # A separate project against which to charge quota.
410
425
  # @return [::String]
426
+ # @!attribute [rw] universe_domain
427
+ # The universe domain within which to make requests. This determines the
428
+ # default endpoint URL. The default value of nil uses the environment
429
+ # universe (usually the default "googleapis.com" universe).
430
+ # @return [::String,nil]
411
431
  #
412
432
  class Configuration
413
433
  extend ::Gapic::Config
414
434
 
435
+ # @private
436
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
415
437
  DEFAULT_ENDPOINT = "recommendationengine.googleapis.com"
416
438
 
417
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
439
+ config_attr :endpoint, nil, ::String, nil
418
440
  config_attr :credentials, nil do |value|
419
441
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
420
442
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -429,6 +451,7 @@ module Google
429
451
  config_attr :metadata, nil, ::Hash, nil
430
452
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
431
453
  config_attr :quota_project, nil, ::String, nil
454
+ config_attr :universe_domain, nil, ::String, nil
432
455
 
433
456
  # @private
434
457
  def initialize parent_config = nil
@@ -32,6 +32,9 @@ module Google
32
32
  # Service for making recommendation prediction.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -97,6 +100,15 @@ module Google
97
100
  @config
98
101
  end
99
102
 
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @prediction_service_stub.universe_domain
110
+ end
111
+
100
112
  ##
101
113
  # Create a new PredictionService REST client object.
102
114
  #
@@ -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 == Configuration::DEFAULT_ENDPOINT &&
128
- !@config.endpoint.split(".").first.include?("-")
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)
@@ -135,7 +148,12 @@ module Google
135
148
  @quota_project_id = @config.quota_project
136
149
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
150
 
138
- @prediction_service_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
151
+ @prediction_service_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::ServiceStub.new(
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
155
+ credentials: credentials
156
+ )
139
157
  end
140
158
 
141
159
  # Service calls
@@ -343,9 +361,9 @@ module Google
343
361
  # end
344
362
  #
345
363
  # @!attribute [rw] endpoint
346
- # The hostname or hostname:port of the service endpoint.
347
- # Defaults to `"recommendationengine.googleapis.com"`.
348
- # @return [::String]
364
+ # A custom service endpoint, as a hostname or hostname:port. The default is
365
+ # nil, indicating to use the default endpoint in the current universe domain.
366
+ # @return [::String,nil]
349
367
  # @!attribute [rw] credentials
350
368
  # Credentials to send with calls. You may provide any of the following types:
351
369
  # * (`String`) The path to a service account key file in JSON format
@@ -382,13 +400,20 @@ module Google
382
400
  # @!attribute [rw] quota_project
383
401
  # A separate project against which to charge quota.
384
402
  # @return [::String]
403
+ # @!attribute [rw] universe_domain
404
+ # The universe domain within which to make requests. This determines the
405
+ # default endpoint URL. The default value of nil uses the environment
406
+ # universe (usually the default "googleapis.com" universe).
407
+ # @return [::String,nil]
385
408
  #
386
409
  class Configuration
387
410
  extend ::Gapic::Config
388
411
 
412
+ # @private
413
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
389
414
  DEFAULT_ENDPOINT = "recommendationengine.googleapis.com"
390
415
 
391
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
416
+ config_attr :endpoint, nil, ::String, nil
392
417
  config_attr :credentials, nil do |value|
393
418
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
394
419
  allowed.any? { |klass| klass === value }
@@ -400,6 +425,7 @@ module Google
400
425
  config_attr :metadata, nil, ::Hash, nil
401
426
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
402
427
  config_attr :quota_project, nil, ::String, nil
428
+ config_attr :universe_domain, nil, ::String, nil
403
429
 
404
430
  # @private
405
431
  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, credentials: credentials,
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 predict REST call
45
66
  #
@@ -30,6 +30,9 @@ module Google
30
30
  # Service for ingesting end user actions on the customer website.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$"
35
+
33
36
  include Paths
34
37
 
35
38
  # @private
@@ -115,6 +118,15 @@ module Google
115
118
  @config
116
119
  end
117
120
 
121
+ ##
122
+ # The effective universe domain
123
+ #
124
+ # @return [String]
125
+ #
126
+ def universe_domain
127
+ @user_event_service_stub.universe_domain
128
+ end
129
+
118
130
  ##
119
131
  # Create a new UserEventService client object.
120
132
  #
@@ -148,8 +160,9 @@ module Google
148
160
  credentials = @config.credentials
149
161
  # Use self-signed JWT if the endpoint is unchanged from default,
150
162
  # but only if the default endpoint does not have a region prefix.
151
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
- !@config.endpoint.split(".").first.include?("-")
163
+ enable_self_signed_jwt = @config.endpoint.nil? ||
164
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
165
+ !@config.endpoint.split(".").first.include?("-"))
153
166
  credentials ||= Credentials.default scope: @config.scope,
154
167
  enable_self_signed_jwt: enable_self_signed_jwt
155
168
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -162,12 +175,15 @@ module Google
162
175
  config.credentials = credentials
163
176
  config.quota_project = @quota_project_id
164
177
  config.endpoint = @config.endpoint
178
+ config.universe_domain = @config.universe_domain
165
179
  end
166
180
 
167
181
  @user_event_service_stub = ::Gapic::ServiceStub.new(
168
182
  ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Stub,
169
- credentials: credentials,
170
- endpoint: @config.endpoint,
183
+ credentials: credentials,
184
+ endpoint: @config.endpoint,
185
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
186
+ universe_domain: @config.universe_domain,
171
187
  channel_args: @config.channel_args,
172
188
  interceptors: @config.interceptors,
173
189
  channel_pool_config: @config.channel_pool
@@ -763,9 +779,9 @@ module Google
763
779
  # end
764
780
  #
765
781
  # @!attribute [rw] endpoint
766
- # The hostname or hostname:port of the service endpoint.
767
- # Defaults to `"recommendationengine.googleapis.com"`.
768
- # @return [::String]
782
+ # A custom service endpoint, as a hostname or hostname:port. The default is
783
+ # nil, indicating to use the default endpoint in the current universe domain.
784
+ # @return [::String,nil]
769
785
  # @!attribute [rw] credentials
770
786
  # Credentials to send with calls. You may provide any of the following types:
771
787
  # * (`String`) The path to a service account key file in JSON format
@@ -811,13 +827,20 @@ module Google
811
827
  # @!attribute [rw] quota_project
812
828
  # A separate project against which to charge quota.
813
829
  # @return [::String]
830
+ # @!attribute [rw] universe_domain
831
+ # The universe domain within which to make requests. This determines the
832
+ # default endpoint URL. The default value of nil uses the environment
833
+ # universe (usually the default "googleapis.com" universe).
834
+ # @return [::String,nil]
814
835
  #
815
836
  class Configuration
816
837
  extend ::Gapic::Config
817
838
 
839
+ # @private
840
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
818
841
  DEFAULT_ENDPOINT = "recommendationengine.googleapis.com"
819
842
 
820
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
843
+ config_attr :endpoint, nil, ::String, nil
821
844
  config_attr :credentials, nil do |value|
822
845
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
823
846
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -832,6 +855,7 @@ module Google
832
855
  config_attr :metadata, nil, ::Hash, nil
833
856
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
834
857
  config_attr :quota_project, nil, ::String, nil
858
+ config_attr :universe_domain, nil, ::String, nil
835
859
 
836
860
  # @private
837
861
  def initialize parent_config = nil