google-cloud-dataflow-v1beta3 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 (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 +23 -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 +23 -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 +23 -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 +23 -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 +23 -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 +23 -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
@@ -33,6 +33,9 @@ module Google
33
33
  # A Job is a multi-stage computation graph run by the Cloud Dataflow service.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "dataflow.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :jobs_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
+ @jobs_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new Jobs 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
- @jobs_stub = ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
+ @jobs_stub = ::Google::Cloud::Dataflow::V1beta3::Jobs::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
@@ -736,9 +754,9 @@ module Google
736
754
  # end
737
755
  #
738
756
  # @!attribute [rw] endpoint
739
- # The hostname or hostname:port of the service endpoint.
740
- # Defaults to `"dataflow.googleapis.com"`.
741
- # @return [::String]
757
+ # A custom service endpoint, as a hostname or hostname:port. The default is
758
+ # nil, indicating to use the default endpoint in the current universe domain.
759
+ # @return [::String,nil]
742
760
  # @!attribute [rw] credentials
743
761
  # Credentials to send with calls. You may provide any of the following types:
744
762
  # * (`String`) The path to a service account key file in JSON format
@@ -775,13 +793,20 @@ module Google
775
793
  # @!attribute [rw] quota_project
776
794
  # A separate project against which to charge quota.
777
795
  # @return [::String]
796
+ # @!attribute [rw] universe_domain
797
+ # The universe domain within which to make requests. This determines the
798
+ # default endpoint URL. The default value of nil uses the environment
799
+ # universe (usually the default "googleapis.com" universe).
800
+ # @return [::String,nil]
778
801
  #
779
802
  class Configuration
780
803
  extend ::Gapic::Config
781
804
 
805
+ # @private
806
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
782
807
  DEFAULT_ENDPOINT = "dataflow.googleapis.com"
783
808
 
784
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
809
+ config_attr :endpoint, nil, ::String, nil
785
810
  config_attr :credentials, nil do |value|
786
811
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
787
812
  allowed.any? { |klass| klass === value }
@@ -793,6 +818,7 @@ module Google
793
818
  config_attr :metadata, nil, ::Hash, nil
794
819
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
795
820
  config_attr :quota_project, nil, ::String, nil
821
+ config_attr :universe_domain, nil, ::String, nil
796
822
 
797
823
  # @private
798
824
  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_job REST call
45
66
  #
@@ -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,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 list_job_messages REST call
45
66
  #
@@ -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,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 get_job_metrics REST call
45
66
  #