google-cloud-spanner-admin-database-v1 0.18.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,6 +28,9 @@ module Google
28
28
  module DatabaseAdmin
29
29
  # Service that implements Longrunning Operations API.
30
30
  class Operations
31
+ # @private
32
+ API_VERSION = ""
33
+
31
34
  # @private
32
35
  DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$"
33
36
 
@@ -193,10 +196,11 @@ module Google
193
196
  # Customize the options with defaults
194
197
  metadata = @config.rpcs.list_operations.metadata.to_h
195
198
 
196
- # Set x-goog-api-client and x-goog-user-project headers
199
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
197
200
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
198
201
  lib_name: @config.lib_name, lib_version: @config.lib_version,
199
202
  gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
203
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
200
204
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
201
205
 
202
206
  header_params = {}
@@ -289,10 +293,11 @@ module Google
289
293
  # Customize the options with defaults
290
294
  metadata = @config.rpcs.get_operation.metadata.to_h
291
295
 
292
- # Set x-goog-api-client and x-goog-user-project headers
296
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
293
297
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
294
298
  lib_name: @config.lib_name, lib_version: @config.lib_version,
295
299
  gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
300
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
296
301
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
297
302
 
298
303
  header_params = {}
@@ -378,10 +383,11 @@ module Google
378
383
  # Customize the options with defaults
379
384
  metadata = @config.rpcs.delete_operation.metadata.to_h
380
385
 
381
- # Set x-goog-api-client and x-goog-user-project headers
386
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
382
387
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
383
388
  lib_name: @config.lib_name, lib_version: @config.lib_version,
384
389
  gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
390
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
385
391
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
386
392
 
387
393
  header_params = {}
@@ -472,10 +478,11 @@ module Google
472
478
  # Customize the options with defaults
473
479
  metadata = @config.rpcs.cancel_operation.metadata.to_h
474
480
 
475
- # Set x-goog-api-client and x-goog-user-project headers
481
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
476
482
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
477
483
  lib_name: @config.lib_name, lib_version: @config.lib_version,
478
484
  gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
485
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
479
486
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
480
487
 
481
488
  header_params = {}
@@ -576,10 +583,11 @@ module Google
576
583
  # Customize the options with defaults
577
584
  metadata = @config.rpcs.wait_operation.metadata.to_h
578
585
 
579
- # Set x-goog-api-client and x-goog-user-project headers
586
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
580
587
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
581
588
  lib_name: @config.lib_name, lib_version: @config.lib_version,
582
589
  gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
590
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
583
591
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
592
 
585
593
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
@@ -45,6 +45,27 @@ module Google
45
45
  "projects/#{project}/instances/#{instance}/backups/#{backup}"
46
46
  end
47
47
 
48
+ ##
49
+ # Create a fully-qualified BackupSchedule resource string.
50
+ #
51
+ # The resource will be in the following format:
52
+ #
53
+ # `projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}`
54
+ #
55
+ # @param project [String]
56
+ # @param instance [String]
57
+ # @param database [String]
58
+ # @param schedule [String]
59
+ #
60
+ # @return [::String]
61
+ def backup_schedule_path project:, instance:, database:, schedule:
62
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
63
+ raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/"
64
+ raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"
65
+
66
+ "projects/#{project}/instances/#{instance}/databases/#{database}/backupSchedules/#{schedule}"
67
+ end
68
+
48
69
  ##
49
70
  # Create a fully-qualified CryptoKey resource string.
50
71
  #