google-cloud-storage_transfer-v1 0.8.0 → 1.4.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.
@@ -34,6 +34,12 @@ module Google
34
34
  # source external to Google to a Cloud Storage bucket.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$"
42
+
37
43
  include Paths
38
44
 
39
45
  # @private
@@ -101,6 +107,15 @@ module Google
101
107
  @config
102
108
  end
103
109
 
110
+ ##
111
+ # The effective universe domain
112
+ #
113
+ # @return [String]
114
+ #
115
+ def universe_domain
116
+ @storage_transfer_service_stub.universe_domain
117
+ end
118
+
104
119
  ##
105
120
  # Create a new StorageTransferService REST client object.
106
121
  #
@@ -128,8 +143,9 @@ module Google
128
143
  credentials = @config.credentials
129
144
  # Use self-signed JWT if the endpoint is unchanged from default,
130
145
  # 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?("-")
146
+ enable_self_signed_jwt = @config.endpoint.nil? ||
147
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
+ !@config.endpoint.split(".").first.include?("-"))
133
149
  credentials ||= Credentials.default scope: @config.scope,
134
150
  enable_self_signed_jwt: enable_self_signed_jwt
135
151
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -143,9 +159,26 @@ module Google
143
159
  config.credentials = credentials
144
160
  config.quota_project = @quota_project_id
145
161
  config.endpoint = @config.endpoint
162
+ config.universe_domain = @config.universe_domain
146
163
  end
147
164
 
148
- @storage_transfer_service_stub = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
165
+ @storage_transfer_service_stub = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.new(
166
+ endpoint: @config.endpoint,
167
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
168
+ universe_domain: @config.universe_domain,
169
+ credentials: credentials,
170
+ logger: @config.logger
171
+ )
172
+
173
+ @storage_transfer_service_stub.logger(stub: true)&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
149
182
  end
150
183
 
151
184
  ##
@@ -155,6 +188,15 @@ module Google
155
188
  #
156
189
  attr_reader :operations_client
157
190
 
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @storage_transfer_service_stub.logger
198
+ end
199
+
158
200
  # Service calls
159
201
 
160
202
  ##
@@ -219,12 +261,13 @@ module Google
219
261
  # Customize the options with defaults
220
262
  call_metadata = @config.rpcs.get_google_service_account.metadata.to_h
221
263
 
222
- # Set x-goog-api-client and x-goog-user-project headers
264
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
223
265
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
224
266
  lib_name: @config.lib_name, lib_version: @config.lib_version,
225
267
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
226
268
  transports_version_send: [:rest]
227
269
 
270
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
228
271
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
229
272
 
230
273
  options.apply_defaults timeout: @config.rpcs.get_google_service_account.timeout,
@@ -237,7 +280,6 @@ module Google
237
280
 
238
281
  @storage_transfer_service_stub.get_google_service_account request, options do |result, operation|
239
282
  yield result, operation if block_given?
240
- return result
241
283
  end
242
284
  rescue ::Gapic::Rest::Error => e
243
285
  raise ::Google::Cloud::Error.from_error(e)
@@ -297,12 +339,13 @@ module Google
297
339
  # Customize the options with defaults
298
340
  call_metadata = @config.rpcs.create_transfer_job.metadata.to_h
299
341
 
300
- # Set x-goog-api-client and x-goog-user-project headers
342
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
301
343
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
302
344
  lib_name: @config.lib_name, lib_version: @config.lib_version,
303
345
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
304
346
  transports_version_send: [:rest]
305
347
 
348
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
306
349
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
307
350
 
308
351
  options.apply_defaults timeout: @config.rpcs.create_transfer_job.timeout,
@@ -315,7 +358,6 @@ module Google
315
358
 
316
359
  @storage_transfer_service_stub.create_transfer_job request, options do |result, operation|
317
360
  yield result, operation if block_given?
318
- return result
319
361
  end
320
362
  rescue ::Gapic::Rest::Error => e
321
363
  raise ::Google::Cloud::Error.from_error(e)
@@ -410,12 +452,13 @@ module Google
410
452
  # Customize the options with defaults
411
453
  call_metadata = @config.rpcs.update_transfer_job.metadata.to_h
412
454
 
413
- # Set x-goog-api-client and x-goog-user-project headers
455
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
414
456
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
415
457
  lib_name: @config.lib_name, lib_version: @config.lib_version,
416
458
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
417
459
  transports_version_send: [:rest]
418
460
 
461
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
419
462
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
420
463
 
421
464
  options.apply_defaults timeout: @config.rpcs.update_transfer_job.timeout,
@@ -428,7 +471,6 @@ module Google
428
471
 
429
472
  @storage_transfer_service_stub.update_transfer_job request, options do |result, operation|
430
473
  yield result, operation if block_given?
431
- return result
432
474
  end
433
475
  rescue ::Gapic::Rest::Error => e
434
476
  raise ::Google::Cloud::Error.from_error(e)
@@ -491,12 +533,13 @@ module Google
491
533
  # Customize the options with defaults
492
534
  call_metadata = @config.rpcs.get_transfer_job.metadata.to_h
493
535
 
494
- # Set x-goog-api-client and x-goog-user-project headers
536
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
495
537
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
496
538
  lib_name: @config.lib_name, lib_version: @config.lib_version,
497
539
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
498
540
  transports_version_send: [:rest]
499
541
 
542
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
500
543
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
501
544
 
502
545
  options.apply_defaults timeout: @config.rpcs.get_transfer_job.timeout,
@@ -509,7 +552,6 @@ module Google
509
552
 
510
553
  @storage_transfer_service_stub.get_transfer_job request, options do |result, operation|
511
554
  yield result, operation if block_given?
512
- return result
513
555
  end
514
556
  rescue ::Gapic::Rest::Error => e
515
557
  raise ::Google::Cloud::Error.from_error(e)
@@ -535,17 +577,32 @@ module Google
535
577
  #
536
578
  # @param filter [::String]
537
579
  # Required. A list of query parameters specified as JSON text in the form of:
538
- # `{"projectId":"my_project_id",
539
- # "jobNames":["jobid1","jobid2",...],
540
- # "jobStatuses":["status1","status2",...]}`
541
- #
542
- # Since `jobNames` and `jobStatuses` support multiple values, their values
543
- # must be specified with array notation. `projectId` is required.
544
- # `jobNames` and `jobStatuses` are optional. The valid values for
545
- # `jobStatuses` are case-insensitive:
546
- # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED},
547
- # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, and
548
- # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}.
580
+ #
581
+ # ```
582
+ # {
583
+ # "projectId":"my_project_id",
584
+ # "jobNames":["jobid1","jobid2",...],
585
+ # "jobStatuses":["status1","status2",...],
586
+ # "dataBackend":"QUERY_REPLICATION_CONFIGS",
587
+ # "sourceBucket":"source-bucket-name",
588
+ # "sinkBucket":"sink-bucket-name",
589
+ # }
590
+ # ```
591
+ #
592
+ # The JSON formatting in the example is for display only; provide the
593
+ # query parameters without spaces or line breaks.
594
+ #
595
+ # * `projectId` is required.
596
+ # * Since `jobNames` and `jobStatuses` support multiple values, their values
597
+ # must be specified with array notation. `jobNames` and `jobStatuses` are
598
+ # optional. Valid values are case-insensitive:
599
+ # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED}
600
+ # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}
601
+ # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}
602
+ # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of
603
+ # cross-bucket replication jobs.
604
+ # * Limit the results to jobs from a particular bucket with `sourceBucket`
605
+ # and/or to a particular bucket with `sinkBucket`.
549
606
  # @param page_size [::Integer]
550
607
  # The list page size. The max allowed value is 256.
551
608
  # @param page_token [::String]
@@ -588,12 +645,13 @@ module Google
588
645
  # Customize the options with defaults
589
646
  call_metadata = @config.rpcs.list_transfer_jobs.metadata.to_h
590
647
 
591
- # Set x-goog-api-client and x-goog-user-project headers
648
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
592
649
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
593
650
  lib_name: @config.lib_name, lib_version: @config.lib_version,
594
651
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
595
652
  transports_version_send: [:rest]
596
653
 
654
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
597
655
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
598
656
 
599
657
  options.apply_defaults timeout: @config.rpcs.list_transfer_jobs.timeout,
@@ -607,7 +665,7 @@ module Google
607
665
  @storage_transfer_service_stub.list_transfer_jobs request, options do |result, operation|
608
666
  result = ::Gapic::Rest::PagedEnumerable.new @storage_transfer_service_stub, :list_transfer_jobs, "transfer_jobs", request, result, options
609
667
  yield result, operation if block_given?
610
- return result
668
+ throw :response, result
611
669
  end
612
670
  rescue ::Gapic::Rest::Error => e
613
671
  raise ::Google::Cloud::Error.from_error(e)
@@ -667,12 +725,13 @@ module Google
667
725
  # Customize the options with defaults
668
726
  call_metadata = @config.rpcs.pause_transfer_operation.metadata.to_h
669
727
 
670
- # Set x-goog-api-client and x-goog-user-project headers
728
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
671
729
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
672
730
  lib_name: @config.lib_name, lib_version: @config.lib_version,
673
731
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
674
732
  transports_version_send: [:rest]
675
733
 
734
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
676
735
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
677
736
 
678
737
  options.apply_defaults timeout: @config.rpcs.pause_transfer_operation.timeout,
@@ -685,7 +744,6 @@ module Google
685
744
 
686
745
  @storage_transfer_service_stub.pause_transfer_operation request, options do |result, operation|
687
746
  yield result, operation if block_given?
688
- return result
689
747
  end
690
748
  rescue ::Gapic::Rest::Error => e
691
749
  raise ::Google::Cloud::Error.from_error(e)
@@ -745,12 +803,13 @@ module Google
745
803
  # Customize the options with defaults
746
804
  call_metadata = @config.rpcs.resume_transfer_operation.metadata.to_h
747
805
 
748
- # Set x-goog-api-client and x-goog-user-project headers
806
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
749
807
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
750
808
  lib_name: @config.lib_name, lib_version: @config.lib_version,
751
809
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
752
810
  transports_version_send: [:rest]
753
811
 
812
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
754
813
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
755
814
 
756
815
  options.apply_defaults timeout: @config.rpcs.resume_transfer_operation.timeout,
@@ -763,7 +822,6 @@ module Google
763
822
 
764
823
  @storage_transfer_service_stub.resume_transfer_operation request, options do |result, operation|
765
824
  yield result, operation if block_given?
766
- return result
767
825
  end
768
826
  rescue ::Gapic::Rest::Error => e
769
827
  raise ::Google::Cloud::Error.from_error(e)
@@ -836,12 +894,13 @@ module Google
836
894
  # Customize the options with defaults
837
895
  call_metadata = @config.rpcs.run_transfer_job.metadata.to_h
838
896
 
839
- # Set x-goog-api-client and x-goog-user-project headers
897
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
840
898
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
841
899
  lib_name: @config.lib_name, lib_version: @config.lib_version,
842
900
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
843
901
  transports_version_send: [:rest]
844
902
 
903
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
845
904
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
846
905
 
847
906
  options.apply_defaults timeout: @config.rpcs.run_transfer_job.timeout,
@@ -855,7 +914,7 @@ module Google
855
914
  @storage_transfer_service_stub.run_transfer_job request, options do |result, operation|
856
915
  result = ::Gapic::Operation.new result, @operations_client, options: options
857
916
  yield result, operation if block_given?
858
- return result
917
+ throw :response, result
859
918
  end
860
919
  rescue ::Gapic::Rest::Error => e
861
920
  raise ::Google::Cloud::Error.from_error(e)
@@ -919,12 +978,13 @@ module Google
919
978
  # Customize the options with defaults
920
979
  call_metadata = @config.rpcs.delete_transfer_job.metadata.to_h
921
980
 
922
- # Set x-goog-api-client and x-goog-user-project headers
981
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
923
982
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
924
983
  lib_name: @config.lib_name, lib_version: @config.lib_version,
925
984
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
926
985
  transports_version_send: [:rest]
927
986
 
987
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
928
988
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
929
989
 
930
990
  options.apply_defaults timeout: @config.rpcs.delete_transfer_job.timeout,
@@ -937,7 +997,6 @@ module Google
937
997
 
938
998
  @storage_transfer_service_stub.delete_transfer_job request, options do |result, operation|
939
999
  yield result, operation if block_given?
940
- return result
941
1000
  end
942
1001
  rescue ::Gapic::Rest::Error => e
943
1002
  raise ::Google::Cloud::Error.from_error(e)
@@ -1014,12 +1073,13 @@ module Google
1014
1073
  # Customize the options with defaults
1015
1074
  call_metadata = @config.rpcs.create_agent_pool.metadata.to_h
1016
1075
 
1017
- # Set x-goog-api-client and x-goog-user-project headers
1076
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1018
1077
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1019
1078
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1020
1079
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
1021
1080
  transports_version_send: [:rest]
1022
1081
 
1082
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1023
1083
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1024
1084
 
1025
1085
  options.apply_defaults timeout: @config.rpcs.create_agent_pool.timeout,
@@ -1032,7 +1092,6 @@ module Google
1032
1092
 
1033
1093
  @storage_transfer_service_stub.create_agent_pool request, options do |result, operation|
1034
1094
  yield result, operation if block_given?
1035
- return result
1036
1095
  end
1037
1096
  rescue ::Gapic::Rest::Error => e
1038
1097
  raise ::Google::Cloud::Error.from_error(e)
@@ -1110,12 +1169,13 @@ module Google
1110
1169
  # Customize the options with defaults
1111
1170
  call_metadata = @config.rpcs.update_agent_pool.metadata.to_h
1112
1171
 
1113
- # Set x-goog-api-client and x-goog-user-project headers
1172
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1114
1173
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1115
1174
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1116
1175
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
1117
1176
  transports_version_send: [:rest]
1118
1177
 
1178
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1119
1179
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1120
1180
 
1121
1181
  options.apply_defaults timeout: @config.rpcs.update_agent_pool.timeout,
@@ -1128,7 +1188,6 @@ module Google
1128
1188
 
1129
1189
  @storage_transfer_service_stub.update_agent_pool request, options do |result, operation|
1130
1190
  yield result, operation if block_given?
1131
- return result
1132
1191
  end
1133
1192
  rescue ::Gapic::Rest::Error => e
1134
1193
  raise ::Google::Cloud::Error.from_error(e)
@@ -1188,12 +1247,13 @@ module Google
1188
1247
  # Customize the options with defaults
1189
1248
  call_metadata = @config.rpcs.get_agent_pool.metadata.to_h
1190
1249
 
1191
- # Set x-goog-api-client and x-goog-user-project headers
1250
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1192
1251
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1193
1252
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1194
1253
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
1195
1254
  transports_version_send: [:rest]
1196
1255
 
1256
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1197
1257
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1198
1258
 
1199
1259
  options.apply_defaults timeout: @config.rpcs.get_agent_pool.timeout,
@@ -1206,7 +1266,6 @@ module Google
1206
1266
 
1207
1267
  @storage_transfer_service_stub.get_agent_pool request, options do |result, operation|
1208
1268
  yield result, operation if block_given?
1209
- return result
1210
1269
  end
1211
1270
  rescue ::Gapic::Rest::Error => e
1212
1271
  raise ::Google::Cloud::Error.from_error(e)
@@ -1283,12 +1342,13 @@ module Google
1283
1342
  # Customize the options with defaults
1284
1343
  call_metadata = @config.rpcs.list_agent_pools.metadata.to_h
1285
1344
 
1286
- # Set x-goog-api-client and x-goog-user-project headers
1345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1287
1346
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1288
1347
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1289
1348
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
1290
1349
  transports_version_send: [:rest]
1291
1350
 
1351
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1292
1352
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1293
1353
 
1294
1354
  options.apply_defaults timeout: @config.rpcs.list_agent_pools.timeout,
@@ -1302,7 +1362,7 @@ module Google
1302
1362
  @storage_transfer_service_stub.list_agent_pools request, options do |result, operation|
1303
1363
  result = ::Gapic::Rest::PagedEnumerable.new @storage_transfer_service_stub, :list_agent_pools, "agent_pools", request, result, options
1304
1364
  yield result, operation if block_given?
1305
- return result
1365
+ throw :response, result
1306
1366
  end
1307
1367
  rescue ::Gapic::Rest::Error => e
1308
1368
  raise ::Google::Cloud::Error.from_error(e)
@@ -1362,12 +1422,13 @@ module Google
1362
1422
  # Customize the options with defaults
1363
1423
  call_metadata = @config.rpcs.delete_agent_pool.metadata.to_h
1364
1424
 
1365
- # Set x-goog-api-client and x-goog-user-project headers
1425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1366
1426
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1367
1427
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1368
1428
  gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION,
1369
1429
  transports_version_send: [:rest]
1370
1430
 
1431
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1371
1432
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1372
1433
 
1373
1434
  options.apply_defaults timeout: @config.rpcs.delete_agent_pool.timeout,
@@ -1380,7 +1441,6 @@ module Google
1380
1441
 
1381
1442
  @storage_transfer_service_stub.delete_agent_pool request, options do |result, operation|
1382
1443
  yield result, operation if block_given?
1383
- return result
1384
1444
  end
1385
1445
  rescue ::Gapic::Rest::Error => e
1386
1446
  raise ::Google::Cloud::Error.from_error(e)
@@ -1416,9 +1476,9 @@ module Google
1416
1476
  # end
1417
1477
  #
1418
1478
  # @!attribute [rw] endpoint
1419
- # The hostname or hostname:port of the service endpoint.
1420
- # Defaults to `"storagetransfer.googleapis.com"`.
1421
- # @return [::String]
1479
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1480
+ # nil, indicating to use the default endpoint in the current universe domain.
1481
+ # @return [::String,nil]
1422
1482
  # @!attribute [rw] credentials
1423
1483
  # Credentials to send with calls. You may provide any of the following types:
1424
1484
  # * (`String`) The path to a service account key file in JSON format
@@ -1428,6 +1488,13 @@ module Google
1428
1488
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1429
1489
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1430
1490
  # * (`nil`) indicating no credentials
1491
+ #
1492
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1493
+ # external source for authentication to Google Cloud, you must validate it before
1494
+ # providing it to a Google API client library. Providing an unvalidated credential
1495
+ # configuration to Google APIs can compromise the security of your systems and data.
1496
+ # For more information, refer to [Validate credential configurations from external
1497
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1431
1498
  # @return [::Object]
1432
1499
  # @!attribute [rw] scope
1433
1500
  # The OAuth scopes
@@ -1455,13 +1522,25 @@ module Google
1455
1522
  # @!attribute [rw] quota_project
1456
1523
  # A separate project against which to charge quota.
1457
1524
  # @return [::String]
1525
+ # @!attribute [rw] universe_domain
1526
+ # The universe domain within which to make requests. This determines the
1527
+ # default endpoint URL. The default value of nil uses the environment
1528
+ # universe (usually the default "googleapis.com" universe).
1529
+ # @return [::String,nil]
1530
+ # @!attribute [rw] logger
1531
+ # A custom logger to use for request/response debug logging, or the value
1532
+ # `:default` (the default) to construct a default logger, or `nil` to
1533
+ # explicitly disable logging.
1534
+ # @return [::Logger,:default,nil]
1458
1535
  #
1459
1536
  class Configuration
1460
1537
  extend ::Gapic::Config
1461
1538
 
1539
+ # @private
1540
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1462
1541
  DEFAULT_ENDPOINT = "storagetransfer.googleapis.com"
1463
1542
 
1464
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1543
+ config_attr :endpoint, nil, ::String, nil
1465
1544
  config_attr :credentials, nil do |value|
1466
1545
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1467
1546
  allowed.any? { |klass| klass === value }
@@ -1473,6 +1552,8 @@ module Google
1473
1552
  config_attr :metadata, nil, ::Hash, nil
1474
1553
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1475
1554
  config_attr :quota_project, nil, ::String, nil
1555
+ config_attr :universe_domain, nil, ::String, nil
1556
+ config_attr :logger, :default, ::Logger, nil, :default
1476
1557
 
1477
1558
  # @private
1478
1559
  def initialize parent_config = nil