google-cloud-spanner-admin-database-v1 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dd7e7bcd60f178f114d0d9bcc20c5677f09c4b3a0e865ef9a4bee0fed39dc91
4
- data.tar.gz: 7e0f9a2ef395b8c5713213a979914e51db9631c44bca6cdcb94a9b8f3eca8a4b
3
+ metadata.gz: 4df2b851c1fc6d2a565ce4fbbbc1a361e23dd38a928908e37589afb1baf94310
4
+ data.tar.gz: 97578c37514e60a240f0338ddf762a0301af8a7e63906db2d9a2279326ba3f2b
5
5
  SHA512:
6
- metadata.gz: c28d6a25a2dff217e9f30cc279a959498de5464545a715aceeda38010552d9cc45d87b7cacbd899ed2ad83fc329a399e46f300f180032ba61a4813c8fdefe1d2
7
- data.tar.gz: 88163d15d90874e82b8ce2774fe3d549ff3d87d422e377a3270a8ea44691bcef43235fdcdafdbfed1545474bf28b9ed4dd0d3239b5fd1ede50c5cc04062afa0c
6
+ metadata.gz: 59b31a2f09758e2663c50e2ec1612acefbc612ca827695be2ab999f7ac24e6cf10367a721e53ac34502c4b6808b5f1ef54d0942537dee87564e26d73badc665a
7
+ data.tar.gz: f7f3113b629bf4a8cf5049ac14c12b51b02742902cc8e012179eba6407584522f6cd5e612d3e2335b191b53f0d176890e550ecd1b1c6fb0e7067079f434e77f3
data/README.md CHANGED
@@ -47,7 +47,7 @@ for general usage information.
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
49
  The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -84,6 +84,11 @@ module Google
84
84
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
85
85
  }
86
86
 
87
+ default_config.rpcs.update_database.timeout = 3600.0
88
+ default_config.rpcs.update_database.retry_policy = {
89
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
90
+ }
91
+
87
92
  default_config.rpcs.update_database_ddl.timeout = 3600.0
88
93
  default_config.rpcs.update_database_ddl.retry_policy = {
89
94
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
@@ -544,6 +549,139 @@ module Google
544
549
  raise ::Google::Cloud::Error.from_error(e)
545
550
  end
546
551
 
552
+ ##
553
+ # Updates a Cloud Spanner database. The returned
554
+ # {::Google::Longrunning::Operation long-running operation} can be used to track
555
+ # the progress of updating the database. If the named database does not
556
+ # exist, returns `NOT_FOUND`.
557
+ #
558
+ # While the operation is pending:
559
+ #
560
+ # * The database's
561
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling}
562
+ # field is set to true.
563
+ # * Cancelling the operation is best-effort. If the cancellation succeeds,
564
+ # the operation metadata's
565
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata#cancel_time cancel_time}
566
+ # is set, the updates are reverted, and the operation terminates with a
567
+ # `CANCELLED` status.
568
+ # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error
569
+ # until the pending operation is done (returns successfully or with
570
+ # error).
571
+ # * Reading the database via the API continues to give the pre-request
572
+ # values.
573
+ #
574
+ # Upon completion of the returned operation:
575
+ #
576
+ # * The new values are in effect and readable via the API.
577
+ # * The database's
578
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling}
579
+ # field becomes false.
580
+ #
581
+ # The returned {::Google::Longrunning::Operation long-running operation} will
582
+ # have a name of the format
583
+ # `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
584
+ # and can be used to track the database modification. The
585
+ # {::Google::Longrunning::Operation#metadata metadata} field type is
586
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata UpdateDatabaseMetadata}.
587
+ # The {::Google::Longrunning::Operation#response response} field type is
588
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful.
589
+ #
590
+ # @overload update_database(request, options = nil)
591
+ # Pass arguments to `update_database` via a request object, either of type
592
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest} or an equivalent Hash.
593
+ #
594
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Hash]
595
+ # A request object representing the call parameters. Required. To specify no
596
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
597
+ # @param options [::Gapic::CallOptions, ::Hash]
598
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
599
+ #
600
+ # @overload update_database(database: nil, update_mask: nil)
601
+ # Pass arguments to `update_database` via keyword arguments. Note that at
602
+ # least one keyword argument is required. To specify no parameters, or to keep all
603
+ # the default parameter values, pass an empty Hash as a request object (see above).
604
+ #
605
+ # @param database [::Google::Cloud::Spanner::Admin::Database::V1::Database, ::Hash]
606
+ # Required. The database to update.
607
+ # The `name` field of the database is of the form
608
+ # `projects/<project>/instances/<instance>/databases/<database>`.
609
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
610
+ # Required. The list of fields to update. Currently, only
611
+ # `enable_drop_protection` field can be updated.
612
+ #
613
+ # @yield [response, operation] Access the result along with the RPC operation
614
+ # @yieldparam response [::Gapic::Operation]
615
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
616
+ #
617
+ # @return [::Gapic::Operation]
618
+ #
619
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
620
+ #
621
+ # @example Basic example
622
+ # require "google/cloud/spanner/admin/database/v1"
623
+ #
624
+ # # Create a client object. The client can be reused for multiple calls.
625
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
626
+ #
627
+ # # Create a request. To set request fields, pass in keyword arguments.
628
+ # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new
629
+ #
630
+ # # Call the update_database method.
631
+ # result = client.update_database request
632
+ #
633
+ # # The returned object is of type Gapic::Operation. You can use it to
634
+ # # check the status of an operation, cancel it, or wait for results.
635
+ # # Here is how to wait for a response.
636
+ # result.wait_until_done! timeout: 60
637
+ # if result.response?
638
+ # p result.response
639
+ # else
640
+ # puts "No response received."
641
+ # end
642
+ #
643
+ def update_database request, options = nil
644
+ raise ::ArgumentError, "request must be provided" if request.nil?
645
+
646
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest
647
+
648
+ # Converts hash and nil to an options object
649
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
650
+
651
+ # Customize the options with defaults
652
+ metadata = @config.rpcs.update_database.metadata.to_h
653
+
654
+ # Set x-goog-api-client and x-goog-user-project headers
655
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
656
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
657
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
658
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
659
+
660
+ header_params = {}
661
+ if request.database&.name
662
+ header_params["database.name"] = request.database.name
663
+ end
664
+
665
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
666
+ metadata[:"x-goog-request-params"] ||= request_params_header
667
+
668
+ options.apply_defaults timeout: @config.rpcs.update_database.timeout,
669
+ metadata: metadata,
670
+ retry_policy: @config.rpcs.update_database.retry_policy
671
+
672
+ options.apply_defaults timeout: @config.timeout,
673
+ metadata: @config.metadata,
674
+ retry_policy: @config.retry_policy
675
+
676
+ @database_admin_stub.call_rpc :update_database, request, options: options do |response, operation|
677
+ response = ::Gapic::Operation.new response, @operations_client, options: options
678
+ yield response, operation if block_given?
679
+ return response
680
+ end
681
+ rescue ::GRPC::BadStatus => e
682
+ raise ::Google::Cloud::Error.from_error(e)
683
+ end
684
+
547
685
  ##
548
686
  # Updates the schema of a Cloud Spanner database by
549
687
  # creating/altering/dropping tables, columns, indexes, etc. The returned
@@ -2387,9 +2525,9 @@ module Google
2387
2525
  # * (`String`) The path to a service account key file in JSON format
2388
2526
  # * (`Hash`) A service account key as a Hash
2389
2527
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2390
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2528
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2391
2529
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2392
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2530
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2393
2531
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2394
2532
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2395
2533
  # * (`nil`) indicating no credentials
@@ -2500,6 +2638,11 @@ module Google
2500
2638
  #
2501
2639
  attr_reader :get_database
2502
2640
  ##
2641
+ # RPC-specific configuration for `update_database`
2642
+ # @return [::Gapic::Config::Method]
2643
+ #
2644
+ attr_reader :update_database
2645
+ ##
2503
2646
  # RPC-specific configuration for `update_database_ddl`
2504
2647
  # @return [::Gapic::Config::Method]
2505
2648
  #
@@ -2588,6 +2731,8 @@ module Google
2588
2731
  @create_database = ::Gapic::Config::Method.new create_database_config
2589
2732
  get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database
2590
2733
  @get_database = ::Gapic::Config::Method.new get_database_config
2734
+ update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database
2735
+ @update_database = ::Gapic::Config::Method.new update_database_config
2591
2736
  update_database_ddl_config = parent_rpcs.update_database_ddl if parent_rpcs.respond_to? :update_database_ddl
2592
2737
  @update_database_ddl = ::Gapic::Config::Method.new update_database_ddl_config
2593
2738
  drop_database_config = parent_rpcs.drop_database if parent_rpcs.respond_to? :drop_database
@@ -622,9 +622,9 @@ module Google
622
622
  # * (`String`) The path to a service account key file in JSON format
623
623
  # * (`Hash`) A service account key as a Hash
624
624
  # * (`Google::Auth::Credentials`) A googleauth credentials object
625
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
625
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
626
626
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
627
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
627
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
628
628
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
629
629
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
630
630
  # * (`nil`) indicating no credentials
@@ -86,6 +86,11 @@ module Google
86
86
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
87
87
  }
88
88
 
89
+ default_config.rpcs.update_database.timeout = 3600.0
90
+ default_config.rpcs.update_database.retry_policy = {
91
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
92
+ }
93
+
89
94
  default_config.rpcs.update_database_ddl.timeout = 3600.0
90
95
  default_config.rpcs.update_database_ddl.retry_policy = {
91
96
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
@@ -455,6 +460,109 @@ module Google
455
460
  raise ::Google::Cloud::Error.from_error(e)
456
461
  end
457
462
 
463
+ ##
464
+ # Updates a Cloud Spanner database. The returned
465
+ # {::Google::Longrunning::Operation long-running operation} can be used to track
466
+ # the progress of updating the database. If the named database does not
467
+ # exist, returns `NOT_FOUND`.
468
+ #
469
+ # While the operation is pending:
470
+ #
471
+ # * The database's
472
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling}
473
+ # field is set to true.
474
+ # * Cancelling the operation is best-effort. If the cancellation succeeds,
475
+ # the operation metadata's
476
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata#cancel_time cancel_time}
477
+ # is set, the updates are reverted, and the operation terminates with a
478
+ # `CANCELLED` status.
479
+ # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error
480
+ # until the pending operation is done (returns successfully or with
481
+ # error).
482
+ # * Reading the database via the API continues to give the pre-request
483
+ # values.
484
+ #
485
+ # Upon completion of the returned operation:
486
+ #
487
+ # * The new values are in effect and readable via the API.
488
+ # * The database's
489
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling}
490
+ # field becomes false.
491
+ #
492
+ # The returned {::Google::Longrunning::Operation long-running operation} will
493
+ # have a name of the format
494
+ # `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
495
+ # and can be used to track the database modification. The
496
+ # {::Google::Longrunning::Operation#metadata metadata} field type is
497
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata UpdateDatabaseMetadata}.
498
+ # The {::Google::Longrunning::Operation#response response} field type is
499
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful.
500
+ #
501
+ # @overload update_database(request, options = nil)
502
+ # Pass arguments to `update_database` via a request object, either of type
503
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest} or an equivalent Hash.
504
+ #
505
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Hash]
506
+ # A request object representing the call parameters. Required. To specify no
507
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
508
+ # @param options [::Gapic::CallOptions, ::Hash]
509
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
510
+ #
511
+ # @overload update_database(database: nil, update_mask: nil)
512
+ # Pass arguments to `update_database` via keyword arguments. Note that at
513
+ # least one keyword argument is required. To specify no parameters, or to keep all
514
+ # the default parameter values, pass an empty Hash as a request object (see above).
515
+ #
516
+ # @param database [::Google::Cloud::Spanner::Admin::Database::V1::Database, ::Hash]
517
+ # Required. The database to update.
518
+ # The `name` field of the database is of the form
519
+ # `projects/<project>/instances/<instance>/databases/<database>`.
520
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
521
+ # Required. The list of fields to update. Currently, only
522
+ # `enable_drop_protection` field can be updated.
523
+ # @yield [result, operation] Access the result along with the TransportOperation object
524
+ # @yieldparam result [::Gapic::Operation]
525
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
526
+ #
527
+ # @return [::Gapic::Operation]
528
+ #
529
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
530
+ def update_database request, options = nil
531
+ raise ::ArgumentError, "request must be provided" if request.nil?
532
+
533
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest
534
+
535
+ # Converts hash and nil to an options object
536
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
537
+
538
+ # Customize the options with defaults
539
+ call_metadata = @config.rpcs.update_database.metadata.to_h
540
+
541
+ # Set x-goog-api-client and x-goog-user-project headers
542
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
543
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
544
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
545
+ transports_version_send: [:rest]
546
+
547
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
548
+
549
+ options.apply_defaults timeout: @config.rpcs.update_database.timeout,
550
+ metadata: call_metadata,
551
+ retry_policy: @config.rpcs.update_database.retry_policy
552
+
553
+ options.apply_defaults timeout: @config.timeout,
554
+ metadata: @config.metadata,
555
+ retry_policy: @config.retry_policy
556
+
557
+ @database_admin_stub.update_database request, options do |result, operation|
558
+ result = ::Gapic::Operation.new result, @operations_client, options: options
559
+ yield result, operation if block_given?
560
+ return result
561
+ end
562
+ rescue ::Gapic::Rest::Error => e
563
+ raise ::Google::Cloud::Error.from_error(e)
564
+ end
565
+
458
566
  ##
459
567
  # Updates the schema of a Cloud Spanner database by
460
568
  # creating/altering/dropping tables, columns, indexes, etc. The returned
@@ -1884,9 +1992,9 @@ module Google
1884
1992
  # * (`String`) The path to a service account key file in JSON format
1885
1993
  # * (`Hash`) A service account key as a Hash
1886
1994
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1887
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1995
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1888
1996
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1889
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1997
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1890
1998
  # * (`nil`) indicating no credentials
1891
1999
  # @return [::Object]
1892
2000
  # @!attribute [rw] scope
@@ -1985,6 +2093,11 @@ module Google
1985
2093
  #
1986
2094
  attr_reader :get_database
1987
2095
  ##
2096
+ # RPC-specific configuration for `update_database`
2097
+ # @return [::Gapic::Config::Method]
2098
+ #
2099
+ attr_reader :update_database
2100
+ ##
1988
2101
  # RPC-specific configuration for `update_database_ddl`
1989
2102
  # @return [::Gapic::Config::Method]
1990
2103
  #
@@ -2073,6 +2186,8 @@ module Google
2073
2186
  @create_database = ::Gapic::Config::Method.new create_database_config
2074
2187
  get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database
2075
2188
  @get_database = ::Gapic::Config::Method.new get_database_config
2189
+ update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database
2190
+ @update_database = ::Gapic::Config::Method.new update_database_config
2076
2191
  update_database_ddl_config = parent_rpcs.update_database_ddl if parent_rpcs.respond_to? :update_database_ddl
2077
2192
  @update_database_ddl = ::Gapic::Config::Method.new update_database_ddl_config
2078
2193
  drop_database_config = parent_rpcs.drop_database if parent_rpcs.respond_to? :drop_database
@@ -413,9 +413,9 @@ module Google
413
413
  # * (`String`) The path to a service account key file in JSON format
414
414
  # * (`Hash`) A service account key as a Hash
415
415
  # * (`Google::Auth::Credentials`) A googleauth credentials object
416
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
416
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
417
417
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
418
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
418
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
419
419
  # * (`nil`) indicating no credentials
420
420
  # @return [::Object]
421
421
  # @!attribute [rw] scope
@@ -156,6 +156,44 @@ module Google
156
156
  result
157
157
  end
158
158
 
159
+ ##
160
+ # Baseline implementation for the update_database REST call
161
+ #
162
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest]
163
+ # A request object representing the call parameters. Required.
164
+ # @param options [::Gapic::CallOptions]
165
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
166
+ #
167
+ # @yield [result, operation] Access the result along with the TransportOperation object
168
+ # @yieldparam result [::Google::Longrunning::Operation]
169
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
170
+ #
171
+ # @return [::Google::Longrunning::Operation]
172
+ # A result object deserialized from the server's reply
173
+ def update_database request_pb, options = nil
174
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
175
+
176
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_database_request request_pb
177
+ query_string_params = if query_string_params.any?
178
+ query_string_params.to_h { |p| p.split("=", 2) }
179
+ else
180
+ {}
181
+ end
182
+
183
+ response = @client_stub.make_http_request(
184
+ verb,
185
+ uri: uri,
186
+ body: body || "",
187
+ params: query_string_params,
188
+ options: options
189
+ )
190
+ operation = ::Gapic::Rest::TransportOperation.new response
191
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
192
+
193
+ yield result, operation if block_given?
194
+ result
195
+ end
196
+
159
197
  ##
160
198
  # Baseline implementation for the update_database_ddl REST call
161
199
  #
@@ -828,6 +866,28 @@ module Google
828
866
  transcoder.transcode request_pb
829
867
  end
830
868
 
869
+ ##
870
+ # @private
871
+ #
872
+ # GRPC transcoding helper method for the update_database REST call
873
+ #
874
+ # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest]
875
+ # A request object representing the call parameters. Required.
876
+ # @return [Array(String, [String, nil], Hash{String => String})]
877
+ # Uri, Body, Query string parameters
878
+ def self.transcode_update_database_request request_pb
879
+ transcoder = Gapic::Rest::GrpcTranscoder.new
880
+ .with_bindings(
881
+ uri_method: :patch,
882
+ uri_template: "/v1/{database.name}",
883
+ body: "database",
884
+ matches: [
885
+ ["database.name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false]
886
+ ]
887
+ )
888
+ transcoder.transcode request_pb
889
+ end
890
+
831
891
  ##
832
892
  # @private
833
893
  #
@@ -23,7 +23,7 @@ module Google
23
23
  module Admin
24
24
  module Database
25
25
  module V1
26
- VERSION = "0.12.0"
26
+ VERSION = "0.14.0"
27
27
  end
28
28
  end
29
29
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/spanner/admin/database/v1/backup.proto
3
4
 
@@ -10,109 +11,35 @@ require 'google/protobuf/field_mask_pb'
10
11
  require 'google/protobuf/timestamp_pb'
11
12
  require 'google/spanner/admin/database/v1/common_pb'
12
13
 
13
- Google::Protobuf::DescriptorPool.generated_pool.build do
14
- add_file("google/spanner/admin/database/v1/backup.proto", :syntax => :proto3) do
15
- add_message "google.spanner.admin.database.v1.Backup" do
16
- optional :database, :string, 2
17
- optional :version_time, :message, 9, "google.protobuf.Timestamp"
18
- optional :expire_time, :message, 3, "google.protobuf.Timestamp"
19
- optional :name, :string, 1
20
- optional :create_time, :message, 4, "google.protobuf.Timestamp"
21
- optional :size_bytes, :int64, 5
22
- optional :state, :enum, 6, "google.spanner.admin.database.v1.Backup.State"
23
- repeated :referencing_databases, :string, 7
24
- optional :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
25
- optional :database_dialect, :enum, 10, "google.spanner.admin.database.v1.DatabaseDialect"
26
- repeated :referencing_backups, :string, 11
27
- optional :max_expire_time, :message, 12, "google.protobuf.Timestamp"
28
- end
29
- add_enum "google.spanner.admin.database.v1.Backup.State" do
30
- value :STATE_UNSPECIFIED, 0
31
- value :CREATING, 1
32
- value :READY, 2
33
- end
34
- add_message "google.spanner.admin.database.v1.CreateBackupRequest" do
35
- optional :parent, :string, 1
36
- optional :backup_id, :string, 2
37
- optional :backup, :message, 3, "google.spanner.admin.database.v1.Backup"
38
- optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig"
39
- end
40
- add_message "google.spanner.admin.database.v1.CreateBackupMetadata" do
41
- optional :name, :string, 1
42
- optional :database, :string, 2
43
- optional :progress, :message, 3, "google.spanner.admin.database.v1.OperationProgress"
44
- optional :cancel_time, :message, 4, "google.protobuf.Timestamp"
45
- end
46
- add_message "google.spanner.admin.database.v1.CopyBackupRequest" do
47
- optional :parent, :string, 1
48
- optional :backup_id, :string, 2
49
- optional :source_backup, :string, 3
50
- optional :expire_time, :message, 4, "google.protobuf.Timestamp"
51
- optional :encryption_config, :message, 5, "google.spanner.admin.database.v1.CopyBackupEncryptionConfig"
52
- end
53
- add_message "google.spanner.admin.database.v1.CopyBackupMetadata" do
54
- optional :name, :string, 1
55
- optional :source_backup, :string, 2
56
- optional :progress, :message, 3, "google.spanner.admin.database.v1.OperationProgress"
57
- optional :cancel_time, :message, 4, "google.protobuf.Timestamp"
58
- end
59
- add_message "google.spanner.admin.database.v1.UpdateBackupRequest" do
60
- optional :backup, :message, 1, "google.spanner.admin.database.v1.Backup"
61
- optional :update_mask, :message, 2, "google.protobuf.FieldMask"
62
- end
63
- add_message "google.spanner.admin.database.v1.GetBackupRequest" do
64
- optional :name, :string, 1
65
- end
66
- add_message "google.spanner.admin.database.v1.DeleteBackupRequest" do
67
- optional :name, :string, 1
68
- end
69
- add_message "google.spanner.admin.database.v1.ListBackupsRequest" do
70
- optional :parent, :string, 1
71
- optional :filter, :string, 2
72
- optional :page_size, :int32, 3
73
- optional :page_token, :string, 4
74
- end
75
- add_message "google.spanner.admin.database.v1.ListBackupsResponse" do
76
- repeated :backups, :message, 1, "google.spanner.admin.database.v1.Backup"
77
- optional :next_page_token, :string, 2
78
- end
79
- add_message "google.spanner.admin.database.v1.ListBackupOperationsRequest" do
80
- optional :parent, :string, 1
81
- optional :filter, :string, 2
82
- optional :page_size, :int32, 3
83
- optional :page_token, :string, 4
84
- end
85
- add_message "google.spanner.admin.database.v1.ListBackupOperationsResponse" do
86
- repeated :operations, :message, 1, "google.longrunning.Operation"
87
- optional :next_page_token, :string, 2
88
- end
89
- add_message "google.spanner.admin.database.v1.BackupInfo" do
90
- optional :backup, :string, 1
91
- optional :version_time, :message, 4, "google.protobuf.Timestamp"
92
- optional :create_time, :message, 2, "google.protobuf.Timestamp"
93
- optional :source_database, :string, 3
94
- end
95
- add_message "google.spanner.admin.database.v1.CreateBackupEncryptionConfig" do
96
- optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType"
97
- optional :kms_key_name, :string, 2
98
- end
99
- add_enum "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType" do
100
- value :ENCRYPTION_TYPE_UNSPECIFIED, 0
101
- value :USE_DATABASE_ENCRYPTION, 1
102
- value :GOOGLE_DEFAULT_ENCRYPTION, 2
103
- value :CUSTOMER_MANAGED_ENCRYPTION, 3
104
- end
105
- add_message "google.spanner.admin.database.v1.CopyBackupEncryptionConfig" do
106
- optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType"
107
- optional :kms_key_name, :string, 2
108
- end
109
- add_enum "google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType" do
110
- value :ENCRYPTION_TYPE_UNSPECIFIED, 0
111
- value :USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION, 1
112
- value :GOOGLE_DEFAULT_ENCRYPTION, 2
113
- value :CUSTOMER_MANAGED_ENCRYPTION, 3
14
+
15
+ descriptor_data = "\n-google/spanner/admin/database/v1/backup.proto\x12 google.spanner.admin.database.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/database/v1/common.proto\"\xc3\x06\n\x06\x42\x61\x63kup\x12\x36\n\x08\x64\x61tabase\x18\x02 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x0cversion_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x06 \x01(\x0e\x32..google.spanner.admin.database.v1.Backup.StateB\x03\xe0\x41\x03\x12\x46\n\x15referencing_databases\x18\x07 \x03(\tB\'\xe0\x41\x03\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12N\n\x0f\x65ncryption_info\x18\x08 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12P\n\x10\x64\x61tabase_dialect\x18\n \x01(\x0e\x32\x31.google.spanner.admin.database.v1.DatabaseDialectB\x03\xe0\x41\x03\x12\x42\n\x13referencing_backups\x18\x0b \x03(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x38\n\x0fmax_expire_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\\\xea\x41Y\n\x1dspanner.googleapis.com/Backup\x12\x38projects/{project}/instances/{instance}/backups/{backup}\"\x85\x02\n\x13\x43reateBackupRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x62\x61\x63kup\x18\x03 \x01(\x0b\x32(.google.spanner.admin.database.v1.BackupB\x03\xe0\x41\x02\x12^\n\x11\x65ncryption_config\x18\x04 \x01(\x0b\x32>.google.spanner.admin.database.v1.CreateBackupEncryptionConfigB\x03\xe0\x41\x01\"\xf8\x01\n\x14\x43reateBackupMetadata\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x36\n\x08\x64\x61tabase\x18\x02 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x45\n\x08progress\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.database.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb6\x02\n\x11\x43opyBackupRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\rsource_backup\x18\x03 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x34\n\x0b\x65xpire_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\\\n\x11\x65ncryption_config\x18\x05 \x01(\x0b\x32<.google.spanner.admin.database.v1.CopyBackupEncryptionConfigB\x03\xe0\x41\x01\"\xf9\x01\n\x12\x43opyBackupMetadata\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x39\n\rsource_backup\x18\x02 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x45\n\x08progress\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.database.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8a\x01\n\x13UpdateBackupRequest\x12=\n\x06\x62\x61\x63kup\x18\x01 \x01(\x0b\x32(.google.spanner.admin.database.v1.BackupB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"G\n\x10GetBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\"J\n\x13\x44\x65leteBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\"\x84\x01\n\x12ListBackupsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"i\n\x13ListBackupsResponse\x12\x39\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32(.google.spanner.admin.database.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8d\x01\n\x1bListBackupOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"j\n\x1cListBackupOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe2\x01\n\nBackupInfo\x12\x32\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x30\n\x0cversion_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12=\n\x0fsource_database\x18\x03 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\"\xdd\x02\n\x1c\x43reateBackupEncryptionConfig\x12k\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32M.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionTypeB\x03\xe0\x41\x02\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8e\x01\n\x0e\x45ncryptionType\x12\x1f\n\x1b\x45NCRYPTION_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17USE_DATABASE_ENCRYPTION\x10\x01\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x02\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x03\"\xe9\x02\n\x1a\x43opyBackupEncryptionConfig\x12i\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32K.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionTypeB\x03\xe0\x41\x02\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x9e\x01\n\x0e\x45ncryptionType\x12\x1f\n\x1b\x45NCRYPTION_TYPE_UNSPECIFIED\x10\x00\x12+\n\'USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION\x10\x01\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x02\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x03\x42\xfd\x01\n$com.google.spanner.admin.database.v1B\x0b\x42\x61\x63kupProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1b\x06proto3"
16
+
17
+ pool = Google::Protobuf::DescriptorPool.generated_pool
18
+
19
+ begin
20
+ pool.add_serialized_file(descriptor_data)
21
+ rescue TypeError => e
22
+ # Compatibility code: will be removed in the next major version.
23
+ require 'google/protobuf/descriptor_pb'
24
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
25
+ parsed.clear_dependency
26
+ serialized = parsed.class.encode(parsed)
27
+ file = pool.add_serialized_file(serialized)
28
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
29
+ imports = [
30
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
31
+ ["google.spanner.admin.database.v1.EncryptionInfo", "google/spanner/admin/database/v1/common.proto"],
32
+ ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"],
33
+ ["google.longrunning.Operation", "google/longrunning/operations.proto"],
34
+ ]
35
+ imports.each do |type_name, expected_filename|
36
+ import_file = pool.lookup(type_name).file_descriptor
37
+ if import_file.name != expected_filename
38
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
114
39
  end
115
40
  end
41
+ warn "Each proto file must use a consistent fully-qualified name."
42
+ warn "This will become an error in the next major version."
116
43
  end
117
44
 
118
45
  module Google