google-cloud-app_engine-v1 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/app_engine/v1/applications/client.rb +42 -9
  4. data/lib/google/cloud/app_engine/v1/applications/operations.rb +38 -7
  5. data/lib/google/cloud/app_engine/v1/applications/rest/client.rb +119 -7
  6. data/lib/google/cloud/app_engine/v1/applications/rest/operations.rb +108 -8
  7. data/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +14 -2
  8. data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +41 -9
  9. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/client.rb +117 -7
  10. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +14 -2
  11. data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +41 -9
  12. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/client.rb +53 -7
  13. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +14 -2
  14. data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +42 -9
  15. data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +38 -7
  16. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/client.rb +139 -7
  17. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/operations.rb +108 -8
  18. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +14 -2
  19. data/lib/google/cloud/app_engine/v1/firewall/client.rb +41 -9
  20. data/lib/google/cloud/app_engine/v1/firewall/rest/client.rb +133 -7
  21. data/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +14 -2
  22. data/lib/google/cloud/app_engine/v1/instances/client.rb +42 -9
  23. data/lib/google/cloud/app_engine/v1/instances/operations.rb +38 -7
  24. data/lib/google/cloud/app_engine/v1/instances/rest/client.rb +116 -7
  25. data/lib/google/cloud/app_engine/v1/instances/rest/operations.rb +108 -8
  26. data/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +14 -2
  27. data/lib/google/cloud/app_engine/v1/services/client.rb +42 -9
  28. data/lib/google/cloud/app_engine/v1/services/operations.rb +38 -7
  29. data/lib/google/cloud/app_engine/v1/services/rest/client.rb +116 -7
  30. data/lib/google/cloud/app_engine/v1/services/rest/operations.rb +108 -8
  31. data/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +14 -2
  32. data/lib/google/cloud/app_engine/v1/version.rb +1 -1
  33. data/lib/google/cloud/app_engine/v1/versions/client.rb +42 -9
  34. data/lib/google/cloud/app_engine/v1/versions/operations.rb +38 -7
  35. data/lib/google/cloud/app_engine/v1/versions/rest/client.rb +139 -7
  36. data/lib/google/cloud/app_engine/v1/versions/rest/operations.rb +108 -8
  37. data/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +14 -2
  38. data/proto_docs/google/api/client.rb +14 -0
  39. data/proto_docs/google/api/field_behavior.rb +14 -0
  40. metadata +5 -5
@@ -33,6 +33,9 @@ module Google
33
33
  # administer any SSL certificates applicable to their authorized domains.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "appengine.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :authorized_certificates_stub
38
41
 
@@ -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
+ @authorized_certificates_stub.universe_domain
104
+ end
105
+
94
106
  ##
95
107
  # Create a new AuthorizedCertificates REST client object.
96
108
  #
@@ -118,8 +130,9 @@ module Google
118
130
  credentials = @config.credentials
119
131
  # Use self-signed JWT if the endpoint is unchanged from default,
120
132
  # but only if the default endpoint does not have a region prefix.
121
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
122
- !@config.endpoint.split(".").first.include?("-")
133
+ enable_self_signed_jwt = @config.endpoint.nil? ||
134
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
135
+ !@config.endpoint.split(".").first.include?("-"))
123
136
  credentials ||= Credentials.default scope: @config.scope,
124
137
  enable_self_signed_jwt: enable_self_signed_jwt
125
138
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -129,7 +142,12 @@ module Google
129
142
  @quota_project_id = @config.quota_project
130
143
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
131
144
 
132
- @authorized_certificates_stub = ::Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
145
+ @authorized_certificates_stub = ::Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::ServiceStub.new(
146
+ endpoint: @config.endpoint,
147
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
148
+ universe_domain: @config.universe_domain,
149
+ credentials: credentials
150
+ )
133
151
  end
134
152
 
135
153
  # Service calls
@@ -167,6 +185,26 @@ module Google
167
185
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::AuthorizedCertificate>]
168
186
  #
169
187
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
188
+ #
189
+ # @example Basic example
190
+ # require "google/cloud/app_engine/v1"
191
+ #
192
+ # # Create a client object. The client can be reused for multiple calls.
193
+ # client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::Client.new
194
+ #
195
+ # # Create a request. To set request fields, pass in keyword arguments.
196
+ # request = Google::Cloud::AppEngine::V1::ListAuthorizedCertificatesRequest.new
197
+ #
198
+ # # Call the list_authorized_certificates method.
199
+ # result = client.list_authorized_certificates request
200
+ #
201
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
202
+ # # over elements, and API calls will be issued to fetch pages as needed.
203
+ # result.each do |item|
204
+ # # Each element is of type ::Google::Cloud::AppEngine::V1::AuthorizedCertificate.
205
+ # p item
206
+ # end
207
+ #
170
208
  def list_authorized_certificates request, options = nil
171
209
  raise ::ArgumentError, "request must be provided" if request.nil?
172
210
 
@@ -233,6 +271,22 @@ module Google
233
271
  # @return [::Google::Cloud::AppEngine::V1::AuthorizedCertificate]
234
272
  #
235
273
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
274
+ #
275
+ # @example Basic example
276
+ # require "google/cloud/app_engine/v1"
277
+ #
278
+ # # Create a client object. The client can be reused for multiple calls.
279
+ # client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::Client.new
280
+ #
281
+ # # Create a request. To set request fields, pass in keyword arguments.
282
+ # request = Google::Cloud::AppEngine::V1::GetAuthorizedCertificateRequest.new
283
+ #
284
+ # # Call the get_authorized_certificate method.
285
+ # result = client.get_authorized_certificate request
286
+ #
287
+ # # The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate.
288
+ # p result
289
+ #
236
290
  def get_authorized_certificate request, options = nil
237
291
  raise ::ArgumentError, "request must be provided" if request.nil?
238
292
 
@@ -297,6 +351,22 @@ module Google
297
351
  # @return [::Google::Cloud::AppEngine::V1::AuthorizedCertificate]
298
352
  #
299
353
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
354
+ #
355
+ # @example Basic example
356
+ # require "google/cloud/app_engine/v1"
357
+ #
358
+ # # Create a client object. The client can be reused for multiple calls.
359
+ # client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::Client.new
360
+ #
361
+ # # Create a request. To set request fields, pass in keyword arguments.
362
+ # request = Google::Cloud::AppEngine::V1::CreateAuthorizedCertificateRequest.new
363
+ #
364
+ # # Call the create_authorized_certificate method.
365
+ # result = client.create_authorized_certificate request
366
+ #
367
+ # # The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate.
368
+ # p result
369
+ #
300
370
  def create_authorized_certificate request, options = nil
301
371
  raise ::ArgumentError, "request must be provided" if request.nil?
302
372
 
@@ -370,6 +440,22 @@ module Google
370
440
  # @return [::Google::Cloud::AppEngine::V1::AuthorizedCertificate]
371
441
  #
372
442
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
443
+ #
444
+ # @example Basic example
445
+ # require "google/cloud/app_engine/v1"
446
+ #
447
+ # # Create a client object. The client can be reused for multiple calls.
448
+ # client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::Client.new
449
+ #
450
+ # # Create a request. To set request fields, pass in keyword arguments.
451
+ # request = Google::Cloud::AppEngine::V1::UpdateAuthorizedCertificateRequest.new
452
+ #
453
+ # # Call the update_authorized_certificate method.
454
+ # result = client.update_authorized_certificate request
455
+ #
456
+ # # The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate.
457
+ # p result
458
+ #
373
459
  def update_authorized_certificate request, options = nil
374
460
  raise ::ArgumentError, "request must be provided" if request.nil?
375
461
 
@@ -433,6 +519,22 @@ module Google
433
519
  # @return [::Google::Protobuf::Empty]
434
520
  #
435
521
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
522
+ #
523
+ # @example Basic example
524
+ # require "google/cloud/app_engine/v1"
525
+ #
526
+ # # Create a client object. The client can be reused for multiple calls.
527
+ # client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::Client.new
528
+ #
529
+ # # Create a request. To set request fields, pass in keyword arguments.
530
+ # request = Google::Cloud::AppEngine::V1::DeleteAuthorizedCertificateRequest.new
531
+ #
532
+ # # Call the delete_authorized_certificate method.
533
+ # result = client.delete_authorized_certificate request
534
+ #
535
+ # # The returned object is of type Google::Protobuf::Empty.
536
+ # p result
537
+ #
436
538
  def delete_authorized_certificate request, options = nil
437
539
  raise ::ArgumentError, "request must be provided" if request.nil?
438
540
 
@@ -498,9 +600,9 @@ module Google
498
600
  # end
499
601
  #
500
602
  # @!attribute [rw] endpoint
501
- # The hostname or hostname:port of the service endpoint.
502
- # Defaults to `"appengine.googleapis.com"`.
503
- # @return [::String]
603
+ # A custom service endpoint, as a hostname or hostname:port. The default is
604
+ # nil, indicating to use the default endpoint in the current universe domain.
605
+ # @return [::String,nil]
504
606
  # @!attribute [rw] credentials
505
607
  # Credentials to send with calls. You may provide any of the following types:
506
608
  # * (`String`) The path to a service account key file in JSON format
@@ -537,13 +639,20 @@ module Google
537
639
  # @!attribute [rw] quota_project
538
640
  # A separate project against which to charge quota.
539
641
  # @return [::String]
642
+ # @!attribute [rw] universe_domain
643
+ # The universe domain within which to make requests. This determines the
644
+ # default endpoint URL. The default value of nil uses the environment
645
+ # universe (usually the default "googleapis.com" universe).
646
+ # @return [::String,nil]
540
647
  #
541
648
  class Configuration
542
649
  extend ::Gapic::Config
543
650
 
651
+ # @private
652
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
544
653
  DEFAULT_ENDPOINT = "appengine.googleapis.com"
545
654
 
546
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
655
+ config_attr :endpoint, nil, ::String, nil
547
656
  config_attr :credentials, nil do |value|
548
657
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
549
658
  allowed.any? { |klass| klass === value }
@@ -555,6 +664,7 @@ module Google
555
664
  config_attr :metadata, nil, ::Hash, nil
556
665
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
557
666
  config_attr :quota_project, nil, ::String, nil
667
+ config_attr :universe_domain, nil, ::String, nil
558
668
 
559
669
  # @private
560
670
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the list_authorized_certificates REST call
45
57
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # [Webmaster Central](https://www.google.com/webmasters/verification/home).
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "appengine.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :authorized_domains_stub
37
40
 
@@ -90,6 +93,15 @@ module Google
90
93
  @config
91
94
  end
92
95
 
96
+ ##
97
+ # The effective universe domain
98
+ #
99
+ # @return [String]
100
+ #
101
+ def universe_domain
102
+ @authorized_domains_stub.universe_domain
103
+ end
104
+
93
105
  ##
94
106
  # Create a new AuthorizedDomains client object.
95
107
  #
@@ -123,8 +135,9 @@ module Google
123
135
  credentials = @config.credentials
124
136
  # Use self-signed JWT if the endpoint is unchanged from default,
125
137
  # but only if the default endpoint does not have a region prefix.
126
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
127
- !@config.endpoint.split(".").first.include?("-")
138
+ enable_self_signed_jwt = @config.endpoint.nil? ||
139
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
+ !@config.endpoint.split(".").first.include?("-"))
128
141
  credentials ||= Credentials.default scope: @config.scope,
129
142
  enable_self_signed_jwt: enable_self_signed_jwt
130
143
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -135,10 +148,13 @@ module Google
135
148
 
136
149
  @authorized_domains_stub = ::Gapic::ServiceStub.new(
137
150
  ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Stub,
138
- credentials: credentials,
139
- endpoint: @config.endpoint,
151
+ credentials: credentials,
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
140
155
  channel_args: @config.channel_args,
141
- interceptors: @config.interceptors
156
+ interceptors: @config.interceptors,
157
+ channel_pool_config: @config.channel_pool
142
158
  )
143
159
  end
144
160
 
@@ -268,9 +284,9 @@ module Google
268
284
  # end
269
285
  #
270
286
  # @!attribute [rw] endpoint
271
- # The hostname or hostname:port of the service endpoint.
272
- # Defaults to `"appengine.googleapis.com"`.
273
- # @return [::String]
287
+ # A custom service endpoint, as a hostname or hostname:port. The default is
288
+ # nil, indicating to use the default endpoint in the current universe domain.
289
+ # @return [::String,nil]
274
290
  # @!attribute [rw] credentials
275
291
  # Credentials to send with calls. You may provide any of the following types:
276
292
  # * (`String`) The path to a service account key file in JSON format
@@ -316,13 +332,20 @@ module Google
316
332
  # @!attribute [rw] quota_project
317
333
  # A separate project against which to charge quota.
318
334
  # @return [::String]
335
+ # @!attribute [rw] universe_domain
336
+ # The universe domain within which to make requests. This determines the
337
+ # default endpoint URL. The default value of nil uses the environment
338
+ # universe (usually the default "googleapis.com" universe).
339
+ # @return [::String,nil]
319
340
  #
320
341
  class Configuration
321
342
  extend ::Gapic::Config
322
343
 
344
+ # @private
345
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
323
346
  DEFAULT_ENDPOINT = "appengine.googleapis.com"
324
347
 
325
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
348
+ config_attr :endpoint, nil, ::String, nil
326
349
  config_attr :credentials, nil do |value|
327
350
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
328
351
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -337,6 +360,7 @@ module Google
337
360
  config_attr :metadata, nil, ::Hash, nil
338
361
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
339
362
  config_attr :quota_project, nil, ::String, nil
363
+ config_attr :universe_domain, nil, ::String, nil
340
364
 
341
365
  # @private
342
366
  def initialize parent_config = nil
@@ -357,6 +381,14 @@ module Google
357
381
  end
358
382
  end
359
383
 
384
+ ##
385
+ # Configuration for the channel pool
386
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
387
+ #
388
+ def channel_pool
389
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
390
+ end
391
+
360
392
  ##
361
393
  # Configuration RPC class for the AuthorizedDomains API.
362
394
  #
@@ -34,6 +34,9 @@ module Google
34
34
  # [Webmaster Central](https://www.google.com/webmasters/verification/home).
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "appengine.$UNIVERSE_DOMAIN$"
39
+
37
40
  # @private
38
41
  attr_reader :authorized_domains_stub
39
42
 
@@ -92,6 +95,15 @@ module Google
92
95
  @config
93
96
  end
94
97
 
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @authorized_domains_stub.universe_domain
105
+ end
106
+
95
107
  ##
96
108
  # Create a new AuthorizedDomains REST client object.
97
109
  #
@@ -119,8 +131,9 @@ module Google
119
131
  credentials = @config.credentials
120
132
  # Use self-signed JWT if the endpoint is unchanged from default,
121
133
  # but only if the default endpoint does not have a region prefix.
122
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
123
- !@config.endpoint.split(".").first.include?("-")
134
+ enable_self_signed_jwt = @config.endpoint.nil? ||
135
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
136
+ !@config.endpoint.split(".").first.include?("-"))
124
137
  credentials ||= Credentials.default scope: @config.scope,
125
138
  enable_self_signed_jwt: enable_self_signed_jwt
126
139
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -130,7 +143,12 @@ module Google
130
143
  @quota_project_id = @config.quota_project
131
144
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
132
145
 
133
- @authorized_domains_stub = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
+ @authorized_domains_stub = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::ServiceStub.new(
147
+ endpoint: @config.endpoint,
148
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
149
+ universe_domain: @config.universe_domain,
150
+ credentials: credentials
151
+ )
134
152
  end
135
153
 
136
154
  # Service calls
@@ -166,6 +184,26 @@ module Google
166
184
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::AuthorizedDomain>]
167
185
  #
168
186
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
187
+ #
188
+ # @example Basic example
189
+ # require "google/cloud/app_engine/v1"
190
+ #
191
+ # # Create a client object. The client can be reused for multiple calls.
192
+ # client = Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new
193
+ #
194
+ # # Create a request. To set request fields, pass in keyword arguments.
195
+ # request = Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest.new
196
+ #
197
+ # # Call the list_authorized_domains method.
198
+ # result = client.list_authorized_domains request
199
+ #
200
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
201
+ # # over elements, and API calls will be issued to fetch pages as needed.
202
+ # result.each do |item|
203
+ # # Each element is of type ::Google::Cloud::AppEngine::V1::AuthorizedDomain.
204
+ # p item
205
+ # end
206
+ #
169
207
  def list_authorized_domains request, options = nil
170
208
  raise ::ArgumentError, "request must be provided" if request.nil?
171
209
 
@@ -232,9 +270,9 @@ module Google
232
270
  # end
233
271
  #
234
272
  # @!attribute [rw] endpoint
235
- # The hostname or hostname:port of the service endpoint.
236
- # Defaults to `"appengine.googleapis.com"`.
237
- # @return [::String]
273
+ # A custom service endpoint, as a hostname or hostname:port. The default is
274
+ # nil, indicating to use the default endpoint in the current universe domain.
275
+ # @return [::String,nil]
238
276
  # @!attribute [rw] credentials
239
277
  # Credentials to send with calls. You may provide any of the following types:
240
278
  # * (`String`) The path to a service account key file in JSON format
@@ -271,13 +309,20 @@ module Google
271
309
  # @!attribute [rw] quota_project
272
310
  # A separate project against which to charge quota.
273
311
  # @return [::String]
312
+ # @!attribute [rw] universe_domain
313
+ # The universe domain within which to make requests. This determines the
314
+ # default endpoint URL. The default value of nil uses the environment
315
+ # universe (usually the default "googleapis.com" universe).
316
+ # @return [::String,nil]
274
317
  #
275
318
  class Configuration
276
319
  extend ::Gapic::Config
277
320
 
321
+ # @private
322
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
278
323
  DEFAULT_ENDPOINT = "appengine.googleapis.com"
279
324
 
280
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
325
+ config_attr :endpoint, nil, ::String, nil
281
326
  config_attr :credentials, nil do |value|
282
327
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
283
328
  allowed.any? { |klass| klass === value }
@@ -289,6 +334,7 @@ module Google
289
334
  config_attr :metadata, nil, ::Hash, nil
290
335
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
291
336
  config_attr :quota_project, nil, ::String, nil
337
+ config_attr :universe_domain, nil, ::String, nil
292
338
 
293
339
  # @private
294
340
  def initialize parent_config = nil
@@ -30,16 +30,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the list_authorized_domains REST call
45
57
  #
@@ -30,6 +30,9 @@ module Google
30
30
  # Manages domains serving an application.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "appengine.$UNIVERSE_DOMAIN$"
35
+
33
36
  # @private
34
37
  attr_reader :domain_mappings_stub
35
38
 
@@ -88,6 +91,15 @@ module Google
88
91
  @config
89
92
  end
90
93
 
94
+ ##
95
+ # The effective universe domain
96
+ #
97
+ # @return [String]
98
+ #
99
+ def universe_domain
100
+ @domain_mappings_stub.universe_domain
101
+ end
102
+
91
103
  ##
92
104
  # Create a new DomainMappings client object.
93
105
  #
@@ -121,8 +133,9 @@ module Google
121
133
  credentials = @config.credentials
122
134
  # Use self-signed JWT if the endpoint is unchanged from default,
123
135
  # but only if the default endpoint does not have a region prefix.
124
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
125
- !@config.endpoint.split(".").first.include?("-")
136
+ enable_self_signed_jwt = @config.endpoint.nil? ||
137
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
138
+ !@config.endpoint.split(".").first.include?("-"))
126
139
  credentials ||= Credentials.default scope: @config.scope,
127
140
  enable_self_signed_jwt: enable_self_signed_jwt
128
141
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -135,14 +148,18 @@ module Google
135
148
  config.credentials = credentials
136
149
  config.quota_project = @quota_project_id
137
150
  config.endpoint = @config.endpoint
151
+ config.universe_domain = @config.universe_domain
138
152
  end
139
153
 
140
154
  @domain_mappings_stub = ::Gapic::ServiceStub.new(
141
155
  ::Google::Cloud::AppEngine::V1::DomainMappings::Stub,
142
- credentials: credentials,
143
- endpoint: @config.endpoint,
156
+ credentials: credentials,
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
144
160
  channel_args: @config.channel_args,
145
- interceptors: @config.interceptors
161
+ interceptors: @config.interceptors,
162
+ channel_pool_config: @config.channel_pool
146
163
  )
147
164
  end
148
165
 
@@ -663,9 +680,9 @@ module Google
663
680
  # end
664
681
  #
665
682
  # @!attribute [rw] endpoint
666
- # The hostname or hostname:port of the service endpoint.
667
- # Defaults to `"appengine.googleapis.com"`.
668
- # @return [::String]
683
+ # A custom service endpoint, as a hostname or hostname:port. The default is
684
+ # nil, indicating to use the default endpoint in the current universe domain.
685
+ # @return [::String,nil]
669
686
  # @!attribute [rw] credentials
670
687
  # Credentials to send with calls. You may provide any of the following types:
671
688
  # * (`String`) The path to a service account key file in JSON format
@@ -711,13 +728,20 @@ module Google
711
728
  # @!attribute [rw] quota_project
712
729
  # A separate project against which to charge quota.
713
730
  # @return [::String]
731
+ # @!attribute [rw] universe_domain
732
+ # The universe domain within which to make requests. This determines the
733
+ # default endpoint URL. The default value of nil uses the environment
734
+ # universe (usually the default "googleapis.com" universe).
735
+ # @return [::String,nil]
714
736
  #
715
737
  class Configuration
716
738
  extend ::Gapic::Config
717
739
 
740
+ # @private
741
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
718
742
  DEFAULT_ENDPOINT = "appengine.googleapis.com"
719
743
 
720
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
744
+ config_attr :endpoint, nil, ::String, nil
721
745
  config_attr :credentials, nil do |value|
722
746
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
723
747
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -732,6 +756,7 @@ module Google
732
756
  config_attr :metadata, nil, ::Hash, nil
733
757
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
734
758
  config_attr :quota_project, nil, ::String, nil
759
+ config_attr :universe_domain, nil, ::String, nil
735
760
 
736
761
  # @private
737
762
  def initialize parent_config = nil
@@ -752,6 +777,14 @@ module Google
752
777
  end
753
778
  end
754
779
 
780
+ ##
781
+ # Configuration for the channel pool
782
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
783
+ #
784
+ def channel_pool
785
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
786
+ end
787
+
755
788
  ##
756
789
  # Configuration RPC class for the DomainMappings API.
757
790
  #