google-cloud-dataflow-v1beta3 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb +31 -8
  4. data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb +33 -7
  5. data/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb +14 -2
  6. data/lib/google/cloud/dataflow/v1beta3/jobs/client.rb +31 -8
  7. data/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb +33 -7
  8. data/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb +14 -2
  9. data/lib/google/cloud/dataflow/v1beta3/messages/client.rb +31 -8
  10. data/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb +33 -7
  11. data/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb +14 -2
  12. data/lib/google/cloud/dataflow/v1beta3/metrics/client.rb +31 -8
  13. data/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb +33 -7
  14. data/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb +14 -2
  15. data/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb +31 -8
  16. data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb +33 -7
  17. data/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb +14 -2
  18. data/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb +31 -8
  19. data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb +33 -7
  20. data/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb +14 -2
  21. data/lib/google/cloud/dataflow/v1beta3/version.rb +1 -1
  22. data/proto_docs/google/api/client.rb +14 -0
  23. data/proto_docs/google/dataflow/v1beta3/jobs.rb +1 -0
  24. data/proto_docs/google/dataflow/v1beta3/streaming.rb +1 -0
  25. metadata +5 -5
@@ -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 create_job REST call
45
57
  #
@@ -31,6 +31,9 @@ module Google
31
31
  # Dataflow jobs.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
36
+
34
37
  # @private
35
38
  attr_reader :messages_stub
36
39
 
@@ -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
+ @messages_stub.universe_domain
104
+ end
105
+
94
106
  ##
95
107
  # Create a new Messages 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 == 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)
@@ -136,8 +149,10 @@ module Google
136
149
 
137
150
  @messages_stub = ::Gapic::ServiceStub.new(
138
151
  ::Google::Cloud::Dataflow::V1beta3::MessagesV1Beta3::Stub,
139
- credentials: credentials,
140
- endpoint: @config.endpoint,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
155
+ universe_domain: @config.universe_domain,
141
156
  channel_args: @config.channel_args,
142
157
  interceptors: @config.interceptors,
143
158
  channel_pool_config: @config.channel_pool
@@ -300,9 +315,9 @@ module Google
300
315
  # end
301
316
  #
302
317
  # @!attribute [rw] endpoint
303
- # The hostname or hostname:port of the service endpoint.
304
- # Defaults to `"dataflow.googleapis.com"`.
305
- # @return [::String]
318
+ # A custom service endpoint, as a hostname or hostname:port. The default is
319
+ # nil, indicating to use the default endpoint in the current universe domain.
320
+ # @return [::String,nil]
306
321
  # @!attribute [rw] credentials
307
322
  # Credentials to send with calls. You may provide any of the following types:
308
323
  # * (`String`) The path to a service account key file in JSON format
@@ -348,13 +363,20 @@ module Google
348
363
  # @!attribute [rw] quota_project
349
364
  # A separate project against which to charge quota.
350
365
  # @return [::String]
366
+ # @!attribute [rw] universe_domain
367
+ # The universe domain within which to make requests. This determines the
368
+ # default endpoint URL. The default value of nil uses the environment
369
+ # universe (usually the default "googleapis.com" universe).
370
+ # @return [::String,nil]
351
371
  #
352
372
  class Configuration
353
373
  extend ::Gapic::Config
354
374
 
375
+ # @private
376
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
355
377
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
356
378
 
357
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
379
+ config_attr :endpoint, nil, ::String, nil
358
380
  config_attr :credentials, nil do |value|
359
381
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
360
382
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -369,6 +391,7 @@ module Google
369
391
  config_attr :metadata, nil, ::Hash, nil
370
392
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
371
393
  config_attr :quota_project, nil, ::String, nil
394
+ config_attr :universe_domain, nil, ::String, nil
372
395
 
373
396
  # @private
374
397
  def initialize parent_config = nil
@@ -33,6 +33,9 @@ module Google
33
33
  # Dataflow jobs.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :messages_stub
38
41
 
@@ -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
+ @messages_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new Messages 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 == Configuration::DEFAULT_ENDPOINT &&
124
- !@config.endpoint.split(".").first.include?("-")
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,7 +144,12 @@ 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
 
134
- @messages_stub = ::Google::Cloud::Dataflow::V1beta3::Messages::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
+ @messages_stub = ::Google::Cloud::Dataflow::V1beta3::Messages::Rest::ServiceStub.new(
148
+ endpoint: @config.endpoint,
149
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
150
+ universe_domain: @config.universe_domain,
151
+ credentials: credentials
152
+ )
135
153
  end
136
154
 
137
155
  # Service calls
@@ -276,9 +294,9 @@ module Google
276
294
  # end
277
295
  #
278
296
  # @!attribute [rw] endpoint
279
- # The hostname or hostname:port of the service endpoint.
280
- # Defaults to `"dataflow.googleapis.com"`.
281
- # @return [::String]
297
+ # A custom service endpoint, as a hostname or hostname:port. The default is
298
+ # nil, indicating to use the default endpoint in the current universe domain.
299
+ # @return [::String,nil]
282
300
  # @!attribute [rw] credentials
283
301
  # Credentials to send with calls. You may provide any of the following types:
284
302
  # * (`String`) The path to a service account key file in JSON format
@@ -315,13 +333,20 @@ module Google
315
333
  # @!attribute [rw] quota_project
316
334
  # A separate project against which to charge quota.
317
335
  # @return [::String]
336
+ # @!attribute [rw] universe_domain
337
+ # The universe domain within which to make requests. This determines the
338
+ # default endpoint URL. The default value of nil uses the environment
339
+ # universe (usually the default "googleapis.com" universe).
340
+ # @return [::String,nil]
318
341
  #
319
342
  class Configuration
320
343
  extend ::Gapic::Config
321
344
 
345
+ # @private
346
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
322
347
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
323
348
 
324
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
349
+ config_attr :endpoint, nil, ::String, nil
325
350
  config_attr :credentials, nil do |value|
326
351
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
327
352
  allowed.any? { |klass| klass === value }
@@ -333,6 +358,7 @@ module Google
333
358
  config_attr :metadata, nil, ::Hash, nil
334
359
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
335
360
  config_attr :quota_project, nil, ::String, nil
361
+ config_attr :universe_domain, nil, ::String, nil
336
362
 
337
363
  # @private
338
364
  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_job_messages REST call
45
57
  #
@@ -31,6 +31,9 @@ module Google
31
31
  # jobs.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
36
+
34
37
  # @private
35
38
  attr_reader :metrics_stub
36
39
 
@@ -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
+ @metrics_stub.universe_domain
104
+ end
105
+
94
106
  ##
95
107
  # Create a new Metrics 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 == 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)
@@ -136,8 +149,10 @@ module Google
136
149
 
137
150
  @metrics_stub = ::Gapic::ServiceStub.new(
138
151
  ::Google::Cloud::Dataflow::V1beta3::MetricsV1Beta3::Stub,
139
- credentials: credentials,
140
- endpoint: @config.endpoint,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
155
+ universe_domain: @config.universe_domain,
141
156
  channel_args: @config.channel_args,
142
157
  interceptors: @config.interceptors,
143
158
  channel_pool_config: @config.channel_pool
@@ -516,9 +531,9 @@ module Google
516
531
  # end
517
532
  #
518
533
  # @!attribute [rw] endpoint
519
- # The hostname or hostname:port of the service endpoint.
520
- # Defaults to `"dataflow.googleapis.com"`.
521
- # @return [::String]
534
+ # A custom service endpoint, as a hostname or hostname:port. The default is
535
+ # nil, indicating to use the default endpoint in the current universe domain.
536
+ # @return [::String,nil]
522
537
  # @!attribute [rw] credentials
523
538
  # Credentials to send with calls. You may provide any of the following types:
524
539
  # * (`String`) The path to a service account key file in JSON format
@@ -564,13 +579,20 @@ module Google
564
579
  # @!attribute [rw] quota_project
565
580
  # A separate project against which to charge quota.
566
581
  # @return [::String]
582
+ # @!attribute [rw] universe_domain
583
+ # The universe domain within which to make requests. This determines the
584
+ # default endpoint URL. The default value of nil uses the environment
585
+ # universe (usually the default "googleapis.com" universe).
586
+ # @return [::String,nil]
567
587
  #
568
588
  class Configuration
569
589
  extend ::Gapic::Config
570
590
 
591
+ # @private
592
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
571
593
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
572
594
 
573
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
595
+ config_attr :endpoint, nil, ::String, nil
574
596
  config_attr :credentials, nil do |value|
575
597
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
576
598
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -585,6 +607,7 @@ module Google
585
607
  config_attr :metadata, nil, ::Hash, nil
586
608
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
587
609
  config_attr :quota_project, nil, ::String, nil
610
+ config_attr :universe_domain, nil, ::String, nil
588
611
 
589
612
  # @private
590
613
  def initialize parent_config = nil
@@ -33,6 +33,9 @@ module Google
33
33
  # jobs.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :metrics_stub
38
41
 
@@ -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
+ @metrics_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new Metrics 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 == Configuration::DEFAULT_ENDPOINT &&
124
- !@config.endpoint.split(".").first.include?("-")
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,7 +144,12 @@ 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
 
134
- @metrics_stub = ::Google::Cloud::Dataflow::V1beta3::Metrics::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
+ @metrics_stub = ::Google::Cloud::Dataflow::V1beta3::Metrics::Rest::ServiceStub.new(
148
+ endpoint: @config.endpoint,
149
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
150
+ universe_domain: @config.universe_domain,
151
+ credentials: credentials
152
+ )
135
153
  end
136
154
 
137
155
  # Service calls
@@ -464,9 +482,9 @@ module Google
464
482
  # end
465
483
  #
466
484
  # @!attribute [rw] endpoint
467
- # The hostname or hostname:port of the service endpoint.
468
- # Defaults to `"dataflow.googleapis.com"`.
469
- # @return [::String]
485
+ # A custom service endpoint, as a hostname or hostname:port. The default is
486
+ # nil, indicating to use the default endpoint in the current universe domain.
487
+ # @return [::String,nil]
470
488
  # @!attribute [rw] credentials
471
489
  # Credentials to send with calls. You may provide any of the following types:
472
490
  # * (`String`) The path to a service account key file in JSON format
@@ -503,13 +521,20 @@ module Google
503
521
  # @!attribute [rw] quota_project
504
522
  # A separate project against which to charge quota.
505
523
  # @return [::String]
524
+ # @!attribute [rw] universe_domain
525
+ # The universe domain within which to make requests. This determines the
526
+ # default endpoint URL. The default value of nil uses the environment
527
+ # universe (usually the default "googleapis.com" universe).
528
+ # @return [::String,nil]
506
529
  #
507
530
  class Configuration
508
531
  extend ::Gapic::Config
509
532
 
533
+ # @private
534
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
510
535
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
511
536
 
512
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
537
+ config_attr :endpoint, nil, ::String, nil
513
538
  config_attr :credentials, nil do |value|
514
539
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
515
540
  allowed.any? { |klass| klass === value }
@@ -521,6 +546,7 @@ module Google
521
546
  config_attr :metadata, nil, ::Hash, nil
522
547
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
523
548
  config_attr :quota_project, nil, ::String, nil
549
+ config_attr :universe_domain, nil, ::String, nil
524
550
 
525
551
  # @private
526
552
  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 get_job_metrics REST call
45
57
  #
@@ -30,6 +30,9 @@ module Google
30
30
  # Provides methods to manage snapshots of Google Cloud Dataflow jobs.
31
31
  #
32
32
  class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
35
+
33
36
  # @private
34
37
  attr_reader :snapshots_stub
35
38
 
@@ -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
+ @snapshots_stub.universe_domain
103
+ end
104
+
93
105
  ##
94
106
  # Create a new Snapshots 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,8 +148,10 @@ module Google
135
148
 
136
149
  @snapshots_stub = ::Gapic::ServiceStub.new(
137
150
  ::Google::Cloud::Dataflow::V1beta3::SnapshotsV1Beta3::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
156
  interceptors: @config.interceptors,
142
157
  channel_pool_config: @config.channel_pool
@@ -460,9 +475,9 @@ module Google
460
475
  # end
461
476
  #
462
477
  # @!attribute [rw] endpoint
463
- # The hostname or hostname:port of the service endpoint.
464
- # Defaults to `"dataflow.googleapis.com"`.
465
- # @return [::String]
478
+ # A custom service endpoint, as a hostname or hostname:port. The default is
479
+ # nil, indicating to use the default endpoint in the current universe domain.
480
+ # @return [::String,nil]
466
481
  # @!attribute [rw] credentials
467
482
  # Credentials to send with calls. You may provide any of the following types:
468
483
  # * (`String`) The path to a service account key file in JSON format
@@ -508,13 +523,20 @@ module Google
508
523
  # @!attribute [rw] quota_project
509
524
  # A separate project against which to charge quota.
510
525
  # @return [::String]
526
+ # @!attribute [rw] universe_domain
527
+ # The universe domain within which to make requests. This determines the
528
+ # default endpoint URL. The default value of nil uses the environment
529
+ # universe (usually the default "googleapis.com" universe).
530
+ # @return [::String,nil]
511
531
  #
512
532
  class Configuration
513
533
  extend ::Gapic::Config
514
534
 
535
+ # @private
536
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
515
537
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
516
538
 
517
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
539
+ config_attr :endpoint, nil, ::String, nil
518
540
  config_attr :credentials, nil do |value|
519
541
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
520
542
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -529,6 +551,7 @@ module Google
529
551
  config_attr :metadata, nil, ::Hash, nil
530
552
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
531
553
  config_attr :quota_project, nil, ::String, nil
554
+ config_attr :universe_domain, nil, ::String, nil
532
555
 
533
556
  # @private
534
557
  def initialize parent_config = nil
@@ -32,6 +32,9 @@ module Google
32
32
  # Provides methods to manage snapshots of Google Cloud Dataflow jobs.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :snapshots_stub
37
40
 
@@ -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
+ @snapshots_stub.universe_domain
105
+ end
106
+
95
107
  ##
96
108
  # Create a new Snapshots 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
- @snapshots_stub = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
+ @snapshots_stub = ::Google::Cloud::Dataflow::V1beta3::Snapshots::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
@@ -411,9 +429,9 @@ module Google
411
429
  # end
412
430
  #
413
431
  # @!attribute [rw] endpoint
414
- # The hostname or hostname:port of the service endpoint.
415
- # Defaults to `"dataflow.googleapis.com"`.
416
- # @return [::String]
432
+ # A custom service endpoint, as a hostname or hostname:port. The default is
433
+ # nil, indicating to use the default endpoint in the current universe domain.
434
+ # @return [::String,nil]
417
435
  # @!attribute [rw] credentials
418
436
  # Credentials to send with calls. You may provide any of the following types:
419
437
  # * (`String`) The path to a service account key file in JSON format
@@ -450,13 +468,20 @@ module Google
450
468
  # @!attribute [rw] quota_project
451
469
  # A separate project against which to charge quota.
452
470
  # @return [::String]
471
+ # @!attribute [rw] universe_domain
472
+ # The universe domain within which to make requests. This determines the
473
+ # default endpoint URL. The default value of nil uses the environment
474
+ # universe (usually the default "googleapis.com" universe).
475
+ # @return [::String,nil]
453
476
  #
454
477
  class Configuration
455
478
  extend ::Gapic::Config
456
479
 
480
+ # @private
481
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
457
482
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
458
483
 
459
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
484
+ config_attr :endpoint, nil, ::String, nil
460
485
  config_attr :credentials, nil do |value|
461
486
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
462
487
  allowed.any? { |klass| klass === value }
@@ -468,6 +493,7 @@ module Google
468
493
  config_attr :metadata, nil, ::Hash, nil
469
494
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
470
495
  config_attr :quota_project, nil, ::String, nil
496
+ config_attr :universe_domain, nil, ::String, nil
471
497
 
472
498
  # @private
473
499
  def initialize parent_config = nil