google-cloud-spanner-admin-database-v1 0.19.0 → 0.20.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.
@@ -162,6 +162,31 @@ module Google
162
162
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
163
163
  }
164
164
 
165
+ default_config.rpcs.create_backup_schedule.timeout = 3600.0
166
+ default_config.rpcs.create_backup_schedule.retry_policy = {
167
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
168
+ }
169
+
170
+ default_config.rpcs.get_backup_schedule.timeout = 3600.0
171
+ default_config.rpcs.get_backup_schedule.retry_policy = {
172
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
173
+ }
174
+
175
+ default_config.rpcs.update_backup_schedule.timeout = 3600.0
176
+ default_config.rpcs.update_backup_schedule.retry_policy = {
177
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
178
+ }
179
+
180
+ default_config.rpcs.delete_backup_schedule.timeout = 3600.0
181
+ default_config.rpcs.delete_backup_schedule.retry_policy = {
182
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
183
+ }
184
+
185
+ default_config.rpcs.list_backup_schedules.timeout = 3600.0
186
+ default_config.rpcs.list_backup_schedules.retry_policy = {
187
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
188
+ }
189
+
165
190
  default_config
166
191
  end
167
192
  yield @configure if block_given?
@@ -2430,6 +2455,435 @@ module Google
2430
2455
  raise ::Google::Cloud::Error.from_error(e)
2431
2456
  end
2432
2457
 
2458
+ ##
2459
+ # Creates a new backup schedule.
2460
+ #
2461
+ # @overload create_backup_schedule(request, options = nil)
2462
+ # Pass arguments to `create_backup_schedule` via a request object, either of type
2463
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash.
2464
+ #
2465
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash]
2466
+ # A request object representing the call parameters. Required. To specify no
2467
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2468
+ # @param options [::Gapic::CallOptions, ::Hash]
2469
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2470
+ #
2471
+ # @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil)
2472
+ # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at
2473
+ # least one keyword argument is required. To specify no parameters, or to keep all
2474
+ # the default parameter values, pass an empty Hash as a request object (see above).
2475
+ #
2476
+ # @param parent [::String]
2477
+ # Required. The name of the database that this backup schedule applies to.
2478
+ # @param backup_schedule_id [::String]
2479
+ # Required. The Id to use for the backup schedule. The `backup_schedule_id`
2480
+ # appended to `parent` forms the full backup schedule name of the form
2481
+ # `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
2482
+ # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash]
2483
+ # Required. The backup schedule to create.
2484
+ # @yield [result, operation] Access the result along with the TransportOperation object
2485
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
2486
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2487
+ #
2488
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
2489
+ #
2490
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2491
+ #
2492
+ # @example Basic example
2493
+ # require "google/cloud/spanner/admin/database/v1"
2494
+ #
2495
+ # # Create a client object. The client can be reused for multiple calls.
2496
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2497
+ #
2498
+ # # Create a request. To set request fields, pass in keyword arguments.
2499
+ # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new
2500
+ #
2501
+ # # Call the create_backup_schedule method.
2502
+ # result = client.create_backup_schedule request
2503
+ #
2504
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
2505
+ # p result
2506
+ #
2507
+ def create_backup_schedule request, options = nil
2508
+ raise ::ArgumentError, "request must be provided" if request.nil?
2509
+
2510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest
2511
+
2512
+ # Converts hash and nil to an options object
2513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2514
+
2515
+ # Customize the options with defaults
2516
+ call_metadata = @config.rpcs.create_backup_schedule.metadata.to_h
2517
+
2518
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2519
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2521
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
2522
+ transports_version_send: [:rest]
2523
+
2524
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2525
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2526
+
2527
+ options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout,
2528
+ metadata: call_metadata,
2529
+ retry_policy: @config.rpcs.create_backup_schedule.retry_policy
2530
+
2531
+ options.apply_defaults timeout: @config.timeout,
2532
+ metadata: @config.metadata,
2533
+ retry_policy: @config.retry_policy
2534
+
2535
+ @database_admin_stub.create_backup_schedule request, options do |result, operation|
2536
+ yield result, operation if block_given?
2537
+ return result
2538
+ end
2539
+ rescue ::Gapic::Rest::Error => e
2540
+ raise ::Google::Cloud::Error.from_error(e)
2541
+ end
2542
+
2543
+ ##
2544
+ # Gets backup schedule for the input schedule name.
2545
+ #
2546
+ # @overload get_backup_schedule(request, options = nil)
2547
+ # Pass arguments to `get_backup_schedule` via a request object, either of type
2548
+ # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash.
2549
+ #
2550
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash]
2551
+ # A request object representing the call parameters. Required. To specify no
2552
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2553
+ # @param options [::Gapic::CallOptions, ::Hash]
2554
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2555
+ #
2556
+ # @overload get_backup_schedule(name: nil)
2557
+ # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at
2558
+ # least one keyword argument is required. To specify no parameters, or to keep all
2559
+ # the default parameter values, pass an empty Hash as a request object (see above).
2560
+ #
2561
+ # @param name [::String]
2562
+ # Required. The name of the schedule to retrieve.
2563
+ # Values are of the form
2564
+ # `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
2565
+ # @yield [result, operation] Access the result along with the TransportOperation object
2566
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
2567
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2568
+ #
2569
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
2570
+ #
2571
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2572
+ #
2573
+ # @example Basic example
2574
+ # require "google/cloud/spanner/admin/database/v1"
2575
+ #
2576
+ # # Create a client object. The client can be reused for multiple calls.
2577
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2578
+ #
2579
+ # # Create a request. To set request fields, pass in keyword arguments.
2580
+ # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new
2581
+ #
2582
+ # # Call the get_backup_schedule method.
2583
+ # result = client.get_backup_schedule request
2584
+ #
2585
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
2586
+ # p result
2587
+ #
2588
+ def get_backup_schedule request, options = nil
2589
+ raise ::ArgumentError, "request must be provided" if request.nil?
2590
+
2591
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest
2592
+
2593
+ # Converts hash and nil to an options object
2594
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2595
+
2596
+ # Customize the options with defaults
2597
+ call_metadata = @config.rpcs.get_backup_schedule.metadata.to_h
2598
+
2599
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2600
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2601
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2602
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
2603
+ transports_version_send: [:rest]
2604
+
2605
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2606
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2607
+
2608
+ options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout,
2609
+ metadata: call_metadata,
2610
+ retry_policy: @config.rpcs.get_backup_schedule.retry_policy
2611
+
2612
+ options.apply_defaults timeout: @config.timeout,
2613
+ metadata: @config.metadata,
2614
+ retry_policy: @config.retry_policy
2615
+
2616
+ @database_admin_stub.get_backup_schedule request, options do |result, operation|
2617
+ yield result, operation if block_given?
2618
+ return result
2619
+ end
2620
+ rescue ::Gapic::Rest::Error => e
2621
+ raise ::Google::Cloud::Error.from_error(e)
2622
+ end
2623
+
2624
+ ##
2625
+ # Updates a backup schedule.
2626
+ #
2627
+ # @overload update_backup_schedule(request, options = nil)
2628
+ # Pass arguments to `update_backup_schedule` via a request object, either of type
2629
+ # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash.
2630
+ #
2631
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash]
2632
+ # A request object representing the call parameters. Required. To specify no
2633
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2634
+ # @param options [::Gapic::CallOptions, ::Hash]
2635
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2636
+ #
2637
+ # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil)
2638
+ # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at
2639
+ # least one keyword argument is required. To specify no parameters, or to keep all
2640
+ # the default parameter values, pass an empty Hash as a request object (see above).
2641
+ #
2642
+ # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash]
2643
+ # Required. The backup schedule to update. `backup_schedule.name`, and the
2644
+ # fields to be updated as specified by `update_mask` are required. Other
2645
+ # fields are ignored.
2646
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2647
+ # Required. A mask specifying which fields in the BackupSchedule resource
2648
+ # should be updated. This mask is relative to the BackupSchedule resource,
2649
+ # not to the request message. The field mask must always be
2650
+ # specified; this prevents any future fields from being erased
2651
+ # accidentally.
2652
+ # @yield [result, operation] Access the result along with the TransportOperation object
2653
+ # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
2654
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2655
+ #
2656
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
2657
+ #
2658
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2659
+ #
2660
+ # @example Basic example
2661
+ # require "google/cloud/spanner/admin/database/v1"
2662
+ #
2663
+ # # Create a client object. The client can be reused for multiple calls.
2664
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2665
+ #
2666
+ # # Create a request. To set request fields, pass in keyword arguments.
2667
+ # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new
2668
+ #
2669
+ # # Call the update_backup_schedule method.
2670
+ # result = client.update_backup_schedule request
2671
+ #
2672
+ # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
2673
+ # p result
2674
+ #
2675
+ def update_backup_schedule request, options = nil
2676
+ raise ::ArgumentError, "request must be provided" if request.nil?
2677
+
2678
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest
2679
+
2680
+ # Converts hash and nil to an options object
2681
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2682
+
2683
+ # Customize the options with defaults
2684
+ call_metadata = @config.rpcs.update_backup_schedule.metadata.to_h
2685
+
2686
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2687
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2688
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2689
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
2690
+ transports_version_send: [:rest]
2691
+
2692
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2693
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2694
+
2695
+ options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout,
2696
+ metadata: call_metadata,
2697
+ retry_policy: @config.rpcs.update_backup_schedule.retry_policy
2698
+
2699
+ options.apply_defaults timeout: @config.timeout,
2700
+ metadata: @config.metadata,
2701
+ retry_policy: @config.retry_policy
2702
+
2703
+ @database_admin_stub.update_backup_schedule request, options do |result, operation|
2704
+ yield result, operation if block_given?
2705
+ return result
2706
+ end
2707
+ rescue ::Gapic::Rest::Error => e
2708
+ raise ::Google::Cloud::Error.from_error(e)
2709
+ end
2710
+
2711
+ ##
2712
+ # Deletes a backup schedule.
2713
+ #
2714
+ # @overload delete_backup_schedule(request, options = nil)
2715
+ # Pass arguments to `delete_backup_schedule` via a request object, either of type
2716
+ # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash.
2717
+ #
2718
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash]
2719
+ # A request object representing the call parameters. Required. To specify no
2720
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2721
+ # @param options [::Gapic::CallOptions, ::Hash]
2722
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2723
+ #
2724
+ # @overload delete_backup_schedule(name: nil)
2725
+ # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at
2726
+ # least one keyword argument is required. To specify no parameters, or to keep all
2727
+ # the default parameter values, pass an empty Hash as a request object (see above).
2728
+ #
2729
+ # @param name [::String]
2730
+ # Required. The name of the schedule to delete.
2731
+ # Values are of the form
2732
+ # `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
2733
+ # @yield [result, operation] Access the result along with the TransportOperation object
2734
+ # @yieldparam result [::Google::Protobuf::Empty]
2735
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2736
+ #
2737
+ # @return [::Google::Protobuf::Empty]
2738
+ #
2739
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2740
+ #
2741
+ # @example Basic example
2742
+ # require "google/cloud/spanner/admin/database/v1"
2743
+ #
2744
+ # # Create a client object. The client can be reused for multiple calls.
2745
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2746
+ #
2747
+ # # Create a request. To set request fields, pass in keyword arguments.
2748
+ # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new
2749
+ #
2750
+ # # Call the delete_backup_schedule method.
2751
+ # result = client.delete_backup_schedule request
2752
+ #
2753
+ # # The returned object is of type Google::Protobuf::Empty.
2754
+ # p result
2755
+ #
2756
+ def delete_backup_schedule request, options = nil
2757
+ raise ::ArgumentError, "request must be provided" if request.nil?
2758
+
2759
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest
2760
+
2761
+ # Converts hash and nil to an options object
2762
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2763
+
2764
+ # Customize the options with defaults
2765
+ call_metadata = @config.rpcs.delete_backup_schedule.metadata.to_h
2766
+
2767
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2768
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2769
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2770
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
2771
+ transports_version_send: [:rest]
2772
+
2773
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2774
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2775
+
2776
+ options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout,
2777
+ metadata: call_metadata,
2778
+ retry_policy: @config.rpcs.delete_backup_schedule.retry_policy
2779
+
2780
+ options.apply_defaults timeout: @config.timeout,
2781
+ metadata: @config.metadata,
2782
+ retry_policy: @config.retry_policy
2783
+
2784
+ @database_admin_stub.delete_backup_schedule request, options do |result, operation|
2785
+ yield result, operation if block_given?
2786
+ return result
2787
+ end
2788
+ rescue ::Gapic::Rest::Error => e
2789
+ raise ::Google::Cloud::Error.from_error(e)
2790
+ end
2791
+
2792
+ ##
2793
+ # Lists all the backup schedules for the database.
2794
+ #
2795
+ # @overload list_backup_schedules(request, options = nil)
2796
+ # Pass arguments to `list_backup_schedules` via a request object, either of type
2797
+ # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash.
2798
+ #
2799
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash]
2800
+ # A request object representing the call parameters. Required. To specify no
2801
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2802
+ # @param options [::Gapic::CallOptions, ::Hash]
2803
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2804
+ #
2805
+ # @overload list_backup_schedules(parent: nil, page_size: nil, page_token: nil)
2806
+ # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at
2807
+ # least one keyword argument is required. To specify no parameters, or to keep all
2808
+ # the default parameter values, pass an empty Hash as a request object (see above).
2809
+ #
2810
+ # @param parent [::String]
2811
+ # Required. Database is the parent resource whose backup schedules should be
2812
+ # listed. Values are of the form
2813
+ # projects/<project>/instances/<instance>/databases/<database>
2814
+ # @param page_size [::Integer]
2815
+ # Optional. Number of backup schedules to be returned in the response. If 0
2816
+ # or less, defaults to the server's maximum allowed page size.
2817
+ # @param page_token [::String]
2818
+ # Optional. If non-empty, `page_token` should contain a
2819
+ # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token}
2820
+ # from a previous
2821
+ # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse}
2822
+ # to the same `parent`.
2823
+ # @yield [result, operation] Access the result along with the TransportOperation object
2824
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>]
2825
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2826
+ #
2827
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>]
2828
+ #
2829
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2830
+ #
2831
+ # @example Basic example
2832
+ # require "google/cloud/spanner/admin/database/v1"
2833
+ #
2834
+ # # Create a client object. The client can be reused for multiple calls.
2835
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
2836
+ #
2837
+ # # Create a request. To set request fields, pass in keyword arguments.
2838
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new
2839
+ #
2840
+ # # Call the list_backup_schedules method.
2841
+ # result = client.list_backup_schedules request
2842
+ #
2843
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2844
+ # # over elements, and API calls will be issued to fetch pages as needed.
2845
+ # result.each do |item|
2846
+ # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
2847
+ # p item
2848
+ # end
2849
+ #
2850
+ def list_backup_schedules request, options = nil
2851
+ raise ::ArgumentError, "request must be provided" if request.nil?
2852
+
2853
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest
2854
+
2855
+ # Converts hash and nil to an options object
2856
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2857
+
2858
+ # Customize the options with defaults
2859
+ call_metadata = @config.rpcs.list_backup_schedules.metadata.to_h
2860
+
2861
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2862
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2863
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2864
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
2865
+ transports_version_send: [:rest]
2866
+
2867
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2868
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2869
+
2870
+ options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout,
2871
+ metadata: call_metadata,
2872
+ retry_policy: @config.rpcs.list_backup_schedules.retry_policy
2873
+
2874
+ options.apply_defaults timeout: @config.timeout,
2875
+ metadata: @config.metadata,
2876
+ retry_policy: @config.retry_policy
2877
+
2878
+ @database_admin_stub.list_backup_schedules request, options do |result, operation|
2879
+ result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, "backup_schedules", request, result, options
2880
+ yield result, operation if block_given?
2881
+ return result
2882
+ end
2883
+ rescue ::Gapic::Rest::Error => e
2884
+ raise ::Google::Cloud::Error.from_error(e)
2885
+ end
2886
+
2433
2887
  ##
2434
2888
  # Configuration class for the DatabaseAdmin REST API.
2435
2889
  #
@@ -2663,6 +3117,31 @@ module Google
2663
3117
  # @return [::Gapic::Config::Method]
2664
3118
  #
2665
3119
  attr_reader :list_database_roles
3120
+ ##
3121
+ # RPC-specific configuration for `create_backup_schedule`
3122
+ # @return [::Gapic::Config::Method]
3123
+ #
3124
+ attr_reader :create_backup_schedule
3125
+ ##
3126
+ # RPC-specific configuration for `get_backup_schedule`
3127
+ # @return [::Gapic::Config::Method]
3128
+ #
3129
+ attr_reader :get_backup_schedule
3130
+ ##
3131
+ # RPC-specific configuration for `update_backup_schedule`
3132
+ # @return [::Gapic::Config::Method]
3133
+ #
3134
+ attr_reader :update_backup_schedule
3135
+ ##
3136
+ # RPC-specific configuration for `delete_backup_schedule`
3137
+ # @return [::Gapic::Config::Method]
3138
+ #
3139
+ attr_reader :delete_backup_schedule
3140
+ ##
3141
+ # RPC-specific configuration for `list_backup_schedules`
3142
+ # @return [::Gapic::Config::Method]
3143
+ #
3144
+ attr_reader :list_backup_schedules
2666
3145
 
2667
3146
  # @private
2668
3147
  def initialize parent_rpcs = nil
@@ -2706,6 +3185,16 @@ module Google
2706
3185
  @list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config
2707
3186
  list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles
2708
3187
  @list_database_roles = ::Gapic::Config::Method.new list_database_roles_config
3188
+ create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule
3189
+ @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config
3190
+ get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule
3191
+ @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config
3192
+ update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule
3193
+ @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
3194
+ delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
3195
+ @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
3196
+ list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules
3197
+ @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config
2709
3198
 
2710
3199
  yield self if block_given?
2711
3200
  end