google-cloud-backupdr-v1 1.1.0 → 1.2.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.
@@ -1150,7 +1150,7 @@ module Google
1150
1150
  # @param options [::Gapic::CallOptions, ::Hash]
1151
1151
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1152
1152
  #
1153
- # @overload update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil)
1153
+ # @overload update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil, force_update_access_restriction: nil)
1154
1154
  # Pass arguments to `update_backup_vault` via keyword arguments. Note that at
1155
1155
  # least one keyword argument is required. To specify no parameters, or to keep all
1156
1156
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1183,6 +1183,9 @@ module Google
1183
1183
  # @param force [::Boolean]
1184
1184
  # Optional. If set to true, will not check plan duration against backup vault
1185
1185
  # enforcement duration.
1186
+ # @param force_update_access_restriction [::Boolean]
1187
+ # Optional. If set to true, we will force update access restriction even if
1188
+ # some non compliant data sources are present. The default is 'false'.
1186
1189
  #
1187
1190
  # @yield [response, operation] Access the result along with the RPC operation
1188
1191
  # @yieldparam response [::Gapic::Operation]
@@ -2120,7 +2123,7 @@ module Google
2120
2123
  # @param options [::Gapic::CallOptions, ::Hash]
2121
2124
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2122
2125
  #
2123
- # @overload restore_backup(name: nil, request_id: nil, compute_instance_target_environment: nil, compute_instance_restore_properties: nil)
2126
+ # @overload restore_backup(name: nil, request_id: nil, compute_instance_target_environment: nil, disk_target_environment: nil, region_disk_target_environment: nil, compute_instance_restore_properties: nil, disk_restore_properties: nil)
2124
2127
  # Pass arguments to `restore_backup` via keyword arguments. Note that at
2125
2128
  # least one keyword argument is required. To specify no parameters, or to keep all
2126
2129
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -2144,9 +2147,25 @@ module Google
2144
2147
  # not supported (00000000-0000-0000-0000-000000000000).
2145
2148
  # @param compute_instance_target_environment [::Google::Cloud::BackupDR::V1::ComputeInstanceTargetEnvironment, ::Hash]
2146
2149
  # Compute Engine target environment to be used during restore.
2150
+ #
2151
+ # Note: The following parameters are mutually exclusive: `compute_instance_target_environment`, `disk_target_environment`, `region_disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
2152
+ # @param disk_target_environment [::Google::Cloud::BackupDR::V1::DiskTargetEnvironment, ::Hash]
2153
+ # Disk target environment to be used during restore.
2154
+ #
2155
+ # Note: The following parameters are mutually exclusive: `disk_target_environment`, `compute_instance_target_environment`, `region_disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
2156
+ # @param region_disk_target_environment [::Google::Cloud::BackupDR::V1::RegionDiskTargetEnvironment, ::Hash]
2157
+ # Region disk target environment to be used during restore.
2158
+ #
2159
+ # Note: The following parameters are mutually exclusive: `region_disk_target_environment`, `compute_instance_target_environment`, `disk_target_environment`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
2147
2160
  # @param compute_instance_restore_properties [::Google::Cloud::BackupDR::V1::ComputeInstanceRestoreProperties, ::Hash]
2148
2161
  # Compute Engine instance properties to be overridden during restore.
2149
2162
  #
2163
+ # Note: The following parameters are mutually exclusive: `compute_instance_restore_properties`, `disk_restore_properties`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
2164
+ # @param disk_restore_properties [::Google::Cloud::BackupDR::V1::DiskRestoreProperties, ::Hash]
2165
+ # Disk properties to be overridden during restore.
2166
+ #
2167
+ # Note: The following parameters are mutually exclusive: `disk_restore_properties`, `compute_instance_restore_properties`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
2168
+ #
2150
2169
  # @yield [response, operation] Access the result along with the RPC operation
2151
2170
  # @yieldparam response [::Gapic::Operation]
2152
2171
  # @yieldparam operation [::GRPC::ActiveCall::Operation]
@@ -2337,6 +2356,123 @@ module Google
2337
2356
  raise ::Google::Cloud::Error.from_error(e)
2338
2357
  end
2339
2358
 
2359
+ ##
2360
+ # Update a BackupPlan.
2361
+ #
2362
+ # @overload update_backup_plan(request, options = nil)
2363
+ # Pass arguments to `update_backup_plan` via a request object, either of type
2364
+ # {::Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest} or an equivalent Hash.
2365
+ #
2366
+ # @param request [::Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest, ::Hash]
2367
+ # A request object representing the call parameters. Required. To specify no
2368
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2369
+ # @param options [::Gapic::CallOptions, ::Hash]
2370
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2371
+ #
2372
+ # @overload update_backup_plan(backup_plan: nil, update_mask: nil, request_id: nil)
2373
+ # Pass arguments to `update_backup_plan` via keyword arguments. Note that at
2374
+ # least one keyword argument is required. To specify no parameters, or to keep all
2375
+ # the default parameter values, pass an empty Hash as a request object (see above).
2376
+ #
2377
+ # @param backup_plan [::Google::Cloud::BackupDR::V1::BackupPlan, ::Hash]
2378
+ # Required. The resource being updated
2379
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2380
+ # Required. The list of fields to update.
2381
+ # Field mask is used to specify the fields to be overwritten in the
2382
+ # BackupPlan resource by the update.
2383
+ # The fields specified in the update_mask are relative to the resource, not
2384
+ # the full request. A field will be overwritten if it is in the mask. If the
2385
+ # user does not provide a mask then the request will fail.
2386
+ # Currently, these fields are supported in update: description, schedules,
2387
+ # retention period, adding and removing Backup Rules.
2388
+ # @param request_id [::String]
2389
+ # Optional. An optional request ID to identify requests. Specify a unique
2390
+ # request ID so that if you must retry your request, the server will know to
2391
+ # ignore the request if it has already been completed. The server will
2392
+ # guarantee that for at least 60 minutes since the first request.
2393
+ #
2394
+ # For example, consider a situation where you make an initial request and t
2395
+ # he request times out. If you make the request again with the same request
2396
+ # ID, the server can check if original operation with the same request ID
2397
+ # was received, and if so, will ignore the second request. This prevents
2398
+ # clients from accidentally creating duplicate commitments.
2399
+ #
2400
+ # The request ID must be a valid UUID with the exception that zero UUID is
2401
+ # not supported (00000000-0000-0000-0000-000000000000).
2402
+ #
2403
+ # @yield [response, operation] Access the result along with the RPC operation
2404
+ # @yieldparam response [::Gapic::Operation]
2405
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2406
+ #
2407
+ # @return [::Gapic::Operation]
2408
+ #
2409
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2410
+ #
2411
+ # @example Basic example
2412
+ # require "google/cloud/backupdr/v1"
2413
+ #
2414
+ # # Create a client object. The client can be reused for multiple calls.
2415
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
2416
+ #
2417
+ # # Create a request. To set request fields, pass in keyword arguments.
2418
+ # request = Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest.new
2419
+ #
2420
+ # # Call the update_backup_plan method.
2421
+ # result = client.update_backup_plan request
2422
+ #
2423
+ # # The returned object is of type Gapic::Operation. You can use it to
2424
+ # # check the status of an operation, cancel it, or wait for results.
2425
+ # # Here is how to wait for a response.
2426
+ # result.wait_until_done! timeout: 60
2427
+ # if result.response?
2428
+ # p result.response
2429
+ # else
2430
+ # puts "No response received."
2431
+ # end
2432
+ #
2433
+ def update_backup_plan request, options = nil
2434
+ raise ::ArgumentError, "request must be provided" if request.nil?
2435
+
2436
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest
2437
+
2438
+ # Converts hash and nil to an options object
2439
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2440
+
2441
+ # Customize the options with defaults
2442
+ metadata = @config.rpcs.update_backup_plan.metadata.to_h
2443
+
2444
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2445
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2446
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2447
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
2448
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2449
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2450
+
2451
+ header_params = {}
2452
+ if request.backup_plan&.name
2453
+ header_params["backup_plan.name"] = request.backup_plan.name
2454
+ end
2455
+
2456
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2457
+ metadata[:"x-goog-request-params"] ||= request_params_header
2458
+
2459
+ options.apply_defaults timeout: @config.rpcs.update_backup_plan.timeout,
2460
+ metadata: metadata,
2461
+ retry_policy: @config.rpcs.update_backup_plan.retry_policy
2462
+
2463
+ options.apply_defaults timeout: @config.timeout,
2464
+ metadata: @config.metadata,
2465
+ retry_policy: @config.retry_policy
2466
+
2467
+ @backup_dr_stub.call_rpc :update_backup_plan, request, options: options do |response, operation|
2468
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2469
+ yield response, operation if block_given?
2470
+ throw :response, response
2471
+ end
2472
+ rescue ::GRPC::BadStatus => e
2473
+ raise ::Google::Cloud::Error.from_error(e)
2474
+ end
2475
+
2340
2476
  ##
2341
2477
  # Gets details of a single BackupPlan.
2342
2478
  #
@@ -2647,6 +2783,202 @@ module Google
2647
2783
  raise ::Google::Cloud::Error.from_error(e)
2648
2784
  end
2649
2785
 
2786
+ ##
2787
+ # Gets details of a single BackupPlanRevision.
2788
+ #
2789
+ # @overload get_backup_plan_revision(request, options = nil)
2790
+ # Pass arguments to `get_backup_plan_revision` via a request object, either of type
2791
+ # {::Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest} or an equivalent Hash.
2792
+ #
2793
+ # @param request [::Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest, ::Hash]
2794
+ # A request object representing the call parameters. Required. To specify no
2795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2796
+ # @param options [::Gapic::CallOptions, ::Hash]
2797
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2798
+ #
2799
+ # @overload get_backup_plan_revision(name: nil)
2800
+ # Pass arguments to `get_backup_plan_revision` via keyword arguments. Note that at
2801
+ # least one keyword argument is required. To specify no parameters, or to keep all
2802
+ # the default parameter values, pass an empty Hash as a request object (see above).
2803
+ #
2804
+ # @param name [::String]
2805
+ # Required. The resource name of the `BackupPlanRevision` to retrieve.
2806
+ #
2807
+ # Format:
2808
+ # `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`
2809
+ #
2810
+ # @yield [response, operation] Access the result along with the RPC operation
2811
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::BackupPlanRevision]
2812
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2813
+ #
2814
+ # @return [::Google::Cloud::BackupDR::V1::BackupPlanRevision]
2815
+ #
2816
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2817
+ #
2818
+ # @example Basic example
2819
+ # require "google/cloud/backupdr/v1"
2820
+ #
2821
+ # # Create a client object. The client can be reused for multiple calls.
2822
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
2823
+ #
2824
+ # # Create a request. To set request fields, pass in keyword arguments.
2825
+ # request = Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest.new
2826
+ #
2827
+ # # Call the get_backup_plan_revision method.
2828
+ # result = client.get_backup_plan_revision request
2829
+ #
2830
+ # # The returned object is of type Google::Cloud::BackupDR::V1::BackupPlanRevision.
2831
+ # p result
2832
+ #
2833
+ def get_backup_plan_revision request, options = nil
2834
+ raise ::ArgumentError, "request must be provided" if request.nil?
2835
+
2836
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest
2837
+
2838
+ # Converts hash and nil to an options object
2839
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2840
+
2841
+ # Customize the options with defaults
2842
+ metadata = @config.rpcs.get_backup_plan_revision.metadata.to_h
2843
+
2844
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2845
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2846
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2847
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
2848
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2849
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2850
+
2851
+ header_params = {}
2852
+ if request.name
2853
+ header_params["name"] = request.name
2854
+ end
2855
+
2856
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2857
+ metadata[:"x-goog-request-params"] ||= request_params_header
2858
+
2859
+ options.apply_defaults timeout: @config.rpcs.get_backup_plan_revision.timeout,
2860
+ metadata: metadata,
2861
+ retry_policy: @config.rpcs.get_backup_plan_revision.retry_policy
2862
+
2863
+ options.apply_defaults timeout: @config.timeout,
2864
+ metadata: @config.metadata,
2865
+ retry_policy: @config.retry_policy
2866
+
2867
+ @backup_dr_stub.call_rpc :get_backup_plan_revision, request, options: options do |response, operation|
2868
+ yield response, operation if block_given?
2869
+ end
2870
+ rescue ::GRPC::BadStatus => e
2871
+ raise ::Google::Cloud::Error.from_error(e)
2872
+ end
2873
+
2874
+ ##
2875
+ # Lists BackupPlanRevisions in a given project and location.
2876
+ #
2877
+ # @overload list_backup_plan_revisions(request, options = nil)
2878
+ # Pass arguments to `list_backup_plan_revisions` via a request object, either of type
2879
+ # {::Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest} or an equivalent Hash.
2880
+ #
2881
+ # @param request [::Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest, ::Hash]
2882
+ # A request object representing the call parameters. Required. To specify no
2883
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2884
+ # @param options [::Gapic::CallOptions, ::Hash]
2885
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2886
+ #
2887
+ # @overload list_backup_plan_revisions(parent: nil, page_size: nil, page_token: nil)
2888
+ # Pass arguments to `list_backup_plan_revisions` via keyword arguments. Note that at
2889
+ # least one keyword argument is required. To specify no parameters, or to keep all
2890
+ # the default parameter values, pass an empty Hash as a request object (see above).
2891
+ #
2892
+ # @param parent [::String]
2893
+ # Required. The project and location for which to retrieve
2894
+ # `BackupPlanRevisions` information. Format:
2895
+ # `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In
2896
+ # Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**.
2897
+ # @param page_size [::Integer]
2898
+ # Optional. The maximum number of `BackupPlans` to return in a single
2899
+ # response. If not specified, a default value will be chosen by the service.
2900
+ # Note that the response may include a partial list and a caller should
2901
+ # only rely on the response's
2902
+ # {::Google::Cloud::BackupDR::V1::ListBackupPlansResponse#next_page_token next_page_token}
2903
+ # to determine if there are more instances left to be queried.
2904
+ # @param page_token [::String]
2905
+ # Optional. The value of
2906
+ # {::Google::Cloud::BackupDR::V1::ListBackupPlansResponse#next_page_token next_page_token}
2907
+ # received from a previous `ListBackupPlans` call.
2908
+ # Provide this to retrieve the subsequent page in a multi-page list of
2909
+ # results. When paginating, all other parameters provided to
2910
+ # `ListBackupPlans` must match the call that provided the page token.
2911
+ #
2912
+ # @yield [response, operation] Access the result along with the RPC operation
2913
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanRevision>]
2914
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2915
+ #
2916
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanRevision>]
2917
+ #
2918
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2919
+ #
2920
+ # @example Basic example
2921
+ # require "google/cloud/backupdr/v1"
2922
+ #
2923
+ # # Create a client object. The client can be reused for multiple calls.
2924
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
2925
+ #
2926
+ # # Create a request. To set request fields, pass in keyword arguments.
2927
+ # request = Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest.new
2928
+ #
2929
+ # # Call the list_backup_plan_revisions method.
2930
+ # result = client.list_backup_plan_revisions request
2931
+ #
2932
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2933
+ # # over elements, and API calls will be issued to fetch pages as needed.
2934
+ # result.each do |item|
2935
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlanRevision.
2936
+ # p item
2937
+ # end
2938
+ #
2939
+ def list_backup_plan_revisions request, options = nil
2940
+ raise ::ArgumentError, "request must be provided" if request.nil?
2941
+
2942
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest
2943
+
2944
+ # Converts hash and nil to an options object
2945
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2946
+
2947
+ # Customize the options with defaults
2948
+ metadata = @config.rpcs.list_backup_plan_revisions.metadata.to_h
2949
+
2950
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2951
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2952
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2953
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
2954
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2955
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2956
+
2957
+ header_params = {}
2958
+ if request.parent
2959
+ header_params["parent"] = request.parent
2960
+ end
2961
+
2962
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2963
+ metadata[:"x-goog-request-params"] ||= request_params_header
2964
+
2965
+ options.apply_defaults timeout: @config.rpcs.list_backup_plan_revisions.timeout,
2966
+ metadata: metadata,
2967
+ retry_policy: @config.rpcs.list_backup_plan_revisions.retry_policy
2968
+
2969
+ options.apply_defaults timeout: @config.timeout,
2970
+ metadata: @config.metadata,
2971
+ retry_policy: @config.retry_policy
2972
+
2973
+ @backup_dr_stub.call_rpc :list_backup_plan_revisions, request, options: options do |response, operation|
2974
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_revisions, request, response, operation, options
2975
+ yield response, operation if block_given?
2976
+ throw :response, response
2977
+ end
2978
+ rescue ::GRPC::BadStatus => e
2979
+ raise ::Google::Cloud::Error.from_error(e)
2980
+ end
2981
+
2650
2982
  ##
2651
2983
  # Create a BackupPlanAssociation
2652
2984
  #
@@ -2704,10 +3036,126 @@ module Google
2704
3036
  # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
2705
3037
  #
2706
3038
  # # Create a request. To set request fields, pass in keyword arguments.
2707
- # request = Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest.new
3039
+ # request = Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest.new
3040
+ #
3041
+ # # Call the create_backup_plan_association method.
3042
+ # result = client.create_backup_plan_association request
3043
+ #
3044
+ # # The returned object is of type Gapic::Operation. You can use it to
3045
+ # # check the status of an operation, cancel it, or wait for results.
3046
+ # # Here is how to wait for a response.
3047
+ # result.wait_until_done! timeout: 60
3048
+ # if result.response?
3049
+ # p result.response
3050
+ # else
3051
+ # puts "No response received."
3052
+ # end
3053
+ #
3054
+ def create_backup_plan_association request, options = nil
3055
+ raise ::ArgumentError, "request must be provided" if request.nil?
3056
+
3057
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest
3058
+
3059
+ # Converts hash and nil to an options object
3060
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3061
+
3062
+ # Customize the options with defaults
3063
+ metadata = @config.rpcs.create_backup_plan_association.metadata.to_h
3064
+
3065
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3066
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3067
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3068
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
3069
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3070
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3071
+
3072
+ header_params = {}
3073
+ if request.parent
3074
+ header_params["parent"] = request.parent
3075
+ end
3076
+
3077
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3078
+ metadata[:"x-goog-request-params"] ||= request_params_header
3079
+
3080
+ options.apply_defaults timeout: @config.rpcs.create_backup_plan_association.timeout,
3081
+ metadata: metadata,
3082
+ retry_policy: @config.rpcs.create_backup_plan_association.retry_policy
3083
+
3084
+ options.apply_defaults timeout: @config.timeout,
3085
+ metadata: @config.metadata,
3086
+ retry_policy: @config.retry_policy
3087
+
3088
+ @backup_dr_stub.call_rpc :create_backup_plan_association, request, options: options do |response, operation|
3089
+ response = ::Gapic::Operation.new response, @operations_client, options: options
3090
+ yield response, operation if block_given?
3091
+ throw :response, response
3092
+ end
3093
+ rescue ::GRPC::BadStatus => e
3094
+ raise ::Google::Cloud::Error.from_error(e)
3095
+ end
3096
+
3097
+ ##
3098
+ # Update a BackupPlanAssociation.
3099
+ #
3100
+ # @overload update_backup_plan_association(request, options = nil)
3101
+ # Pass arguments to `update_backup_plan_association` via a request object, either of type
3102
+ # {::Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest} or an equivalent Hash.
3103
+ #
3104
+ # @param request [::Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest, ::Hash]
3105
+ # A request object representing the call parameters. Required. To specify no
3106
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3107
+ # @param options [::Gapic::CallOptions, ::Hash]
3108
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3109
+ #
3110
+ # @overload update_backup_plan_association(backup_plan_association: nil, update_mask: nil, request_id: nil)
3111
+ # Pass arguments to `update_backup_plan_association` via keyword arguments. Note that at
3112
+ # least one keyword argument is required. To specify no parameters, or to keep all
3113
+ # the default parameter values, pass an empty Hash as a request object (see above).
3114
+ #
3115
+ # @param backup_plan_association [::Google::Cloud::BackupDR::V1::BackupPlanAssociation, ::Hash]
3116
+ # Required. The resource being updated
3117
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3118
+ # Required. The list of fields to update.
3119
+ # Field mask is used to specify the fields to be overwritten in the
3120
+ # BackupPlanAssociation resource by the update.
3121
+ # The fields specified in the update_mask are relative to the resource, not
3122
+ # the full request. A field will be overwritten if it is in the mask. If the
3123
+ # user does not provide a mask then the request will fail.
3124
+ # Currently backup_plan_association.backup_plan is the only supported field.
3125
+ # @param request_id [::String]
3126
+ # Optional. An optional request ID to identify requests. Specify a unique
3127
+ # request ID so that if you must retry your request, the server will know to
3128
+ # ignore the request if it has already been completed. The server will
3129
+ # guarantee that for at least 60 minutes since the first request.
3130
+ #
3131
+ # For example, consider a situation where you make an initial request and t
3132
+ # he request times out. If you make the request again with the same request
3133
+ # ID, the server can check if original operation with the same request ID
3134
+ # was received, and if so, will ignore the second request. This prevents
3135
+ # clients from accidentally creating duplicate commitments.
3136
+ #
3137
+ # The request ID must be a valid UUID with the exception that zero UUID is
3138
+ # not supported (00000000-0000-0000-0000-000000000000).
3139
+ #
3140
+ # @yield [response, operation] Access the result along with the RPC operation
3141
+ # @yieldparam response [::Gapic::Operation]
3142
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3143
+ #
3144
+ # @return [::Gapic::Operation]
3145
+ #
3146
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3147
+ #
3148
+ # @example Basic example
3149
+ # require "google/cloud/backupdr/v1"
3150
+ #
3151
+ # # Create a client object. The client can be reused for multiple calls.
3152
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
3153
+ #
3154
+ # # Create a request. To set request fields, pass in keyword arguments.
3155
+ # request = Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest.new
2708
3156
  #
2709
- # # Call the create_backup_plan_association method.
2710
- # result = client.create_backup_plan_association request
3157
+ # # Call the update_backup_plan_association method.
3158
+ # result = client.update_backup_plan_association request
2711
3159
  #
2712
3160
  # # The returned object is of type Gapic::Operation. You can use it to
2713
3161
  # # check the status of an operation, cancel it, or wait for results.
@@ -2719,16 +3167,16 @@ module Google
2719
3167
  # puts "No response received."
2720
3168
  # end
2721
3169
  #
2722
- def create_backup_plan_association request, options = nil
3170
+ def update_backup_plan_association request, options = nil
2723
3171
  raise ::ArgumentError, "request must be provided" if request.nil?
2724
3172
 
2725
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest
3173
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest
2726
3174
 
2727
3175
  # Converts hash and nil to an options object
2728
3176
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2729
3177
 
2730
3178
  # Customize the options with defaults
2731
- metadata = @config.rpcs.create_backup_plan_association.metadata.to_h
3179
+ metadata = @config.rpcs.update_backup_plan_association.metadata.to_h
2732
3180
 
2733
3181
  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2734
3182
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -2738,22 +3186,22 @@ module Google
2738
3186
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2739
3187
 
2740
3188
  header_params = {}
2741
- if request.parent
2742
- header_params["parent"] = request.parent
3189
+ if request.backup_plan_association&.name
3190
+ header_params["backup_plan_association.name"] = request.backup_plan_association.name
2743
3191
  end
2744
3192
 
2745
3193
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2746
3194
  metadata[:"x-goog-request-params"] ||= request_params_header
2747
3195
 
2748
- options.apply_defaults timeout: @config.rpcs.create_backup_plan_association.timeout,
3196
+ options.apply_defaults timeout: @config.rpcs.update_backup_plan_association.timeout,
2749
3197
  metadata: metadata,
2750
- retry_policy: @config.rpcs.create_backup_plan_association.retry_policy
3198
+ retry_policy: @config.rpcs.update_backup_plan_association.retry_policy
2751
3199
 
2752
3200
  options.apply_defaults timeout: @config.timeout,
2753
3201
  metadata: @config.metadata,
2754
3202
  retry_policy: @config.retry_policy
2755
3203
 
2756
- @backup_dr_stub.call_rpc :create_backup_plan_association, request, options: options do |response, operation|
3204
+ @backup_dr_stub.call_rpc :update_backup_plan_association, request, options: options do |response, operation|
2757
3205
  response = ::Gapic::Operation.new response, @operations_client, options: options
2758
3206
  yield response, operation if block_given?
2759
3207
  throw :response, response
@@ -2951,6 +3399,130 @@ module Google
2951
3399
  raise ::Google::Cloud::Error.from_error(e)
2952
3400
  end
2953
3401
 
3402
+ ##
3403
+ # List BackupPlanAssociations for a given resource type.
3404
+ #
3405
+ # @overload fetch_backup_plan_associations_for_resource_type(request, options = nil)
3406
+ # Pass arguments to `fetch_backup_plan_associations_for_resource_type` via a request object, either of type
3407
+ # {::Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest} or an equivalent Hash.
3408
+ #
3409
+ # @param request [::Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest, ::Hash]
3410
+ # A request object representing the call parameters. Required. To specify no
3411
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3412
+ # @param options [::Gapic::CallOptions, ::Hash]
3413
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3414
+ #
3415
+ # @overload fetch_backup_plan_associations_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
3416
+ # Pass arguments to `fetch_backup_plan_associations_for_resource_type` via keyword arguments. Note that at
3417
+ # least one keyword argument is required. To specify no parameters, or to keep all
3418
+ # the default parameter values, pass an empty Hash as a request object (see above).
3419
+ #
3420
+ # @param parent [::String]
3421
+ # Required. The parent resource name.
3422
+ # Format: projects/\\{project}/locations/\\{location}
3423
+ # @param resource_type [::String]
3424
+ # Required. The type of the GCP resource.
3425
+ # Ex: sql.googleapis.com/Instance
3426
+ # @param page_size [::Integer]
3427
+ # Optional. The maximum number of BackupPlanAssociations to return. The
3428
+ # service may return fewer than this value. If unspecified, at most 50
3429
+ # BackupPlanAssociations will be returned. The maximum value is 100; values
3430
+ # above 100 will be coerced to 100.
3431
+ # @param page_token [::String]
3432
+ # Optional. A page token, received from a previous call of
3433
+ # `FetchBackupPlanAssociationsForResourceType`.
3434
+ # Provide this to retrieve the subsequent page.
3435
+ #
3436
+ # When paginating, all other parameters provided to
3437
+ # `FetchBackupPlanAssociationsForResourceType` must match
3438
+ # the call that provided the page token.
3439
+ # @param filter [::String]
3440
+ # Optional. A filter expression that filters the results fetched in the
3441
+ # response. The expression must specify the field name, a comparison
3442
+ # operator, and the value that you want to use for filtering. Supported
3443
+ # fields:
3444
+ # * resource
3445
+ # * backup_plan
3446
+ # * state
3447
+ # * data_source
3448
+ # * cloud_sql_instance_backup_plan_association_properties.instance_create_time
3449
+ # @param order_by [::String]
3450
+ # Optional. A comma-separated list of fields to order by, sorted in ascending
3451
+ # order. Use "desc" after a field name for descending.
3452
+ #
3453
+ # Supported fields:
3454
+ # * name
3455
+ #
3456
+ # @yield [response, operation] Access the result along with the RPC operation
3457
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>]
3458
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3459
+ #
3460
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>]
3461
+ #
3462
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3463
+ #
3464
+ # @example Basic example
3465
+ # require "google/cloud/backupdr/v1"
3466
+ #
3467
+ # # Create a client object. The client can be reused for multiple calls.
3468
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
3469
+ #
3470
+ # # Create a request. To set request fields, pass in keyword arguments.
3471
+ # request = Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest.new
3472
+ #
3473
+ # # Call the fetch_backup_plan_associations_for_resource_type method.
3474
+ # result = client.fetch_backup_plan_associations_for_resource_type request
3475
+ #
3476
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3477
+ # # over elements, and API calls will be issued to fetch pages as needed.
3478
+ # result.each do |item|
3479
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlanAssociation.
3480
+ # p item
3481
+ # end
3482
+ #
3483
+ def fetch_backup_plan_associations_for_resource_type request, options = nil
3484
+ raise ::ArgumentError, "request must be provided" if request.nil?
3485
+
3486
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest
3487
+
3488
+ # Converts hash and nil to an options object
3489
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3490
+
3491
+ # Customize the options with defaults
3492
+ metadata = @config.rpcs.fetch_backup_plan_associations_for_resource_type.metadata.to_h
3493
+
3494
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3495
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3496
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3497
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
3498
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3499
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3500
+
3501
+ header_params = {}
3502
+ if request.parent
3503
+ header_params["parent"] = request.parent
3504
+ end
3505
+
3506
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3507
+ metadata[:"x-goog-request-params"] ||= request_params_header
3508
+
3509
+ options.apply_defaults timeout: @config.rpcs.fetch_backup_plan_associations_for_resource_type.timeout,
3510
+ metadata: metadata,
3511
+ retry_policy: @config.rpcs.fetch_backup_plan_associations_for_resource_type.retry_policy
3512
+
3513
+ options.apply_defaults timeout: @config.timeout,
3514
+ metadata: @config.metadata,
3515
+ retry_policy: @config.retry_policy
3516
+
3517
+ @backup_dr_stub.call_rpc :fetch_backup_plan_associations_for_resource_type, request, options: options do |response, operation|
3518
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_backup_plan_associations_for_resource_type, request, response, operation, options
3519
+ yield response, operation if block_given?
3520
+ throw :response, response
3521
+ end
3522
+ rescue ::GRPC::BadStatus => e
3523
+ raise ::Google::Cloud::Error.from_error(e)
3524
+ end
3525
+
2954
3526
  ##
2955
3527
  # Deletes a single BackupPlanAssociation.
2956
3528
  #
@@ -3171,6 +3743,221 @@ module Google
3171
3743
  raise ::Google::Cloud::Error.from_error(e)
3172
3744
  end
3173
3745
 
3746
+ ##
3747
+ # Gets details of a single DataSourceReference.
3748
+ #
3749
+ # @overload get_data_source_reference(request, options = nil)
3750
+ # Pass arguments to `get_data_source_reference` via a request object, either of type
3751
+ # {::Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest} or an equivalent Hash.
3752
+ #
3753
+ # @param request [::Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest, ::Hash]
3754
+ # A request object representing the call parameters. Required. To specify no
3755
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3756
+ # @param options [::Gapic::CallOptions, ::Hash]
3757
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3758
+ #
3759
+ # @overload get_data_source_reference(name: nil)
3760
+ # Pass arguments to `get_data_source_reference` via keyword arguments. Note that at
3761
+ # least one keyword argument is required. To specify no parameters, or to keep all
3762
+ # the default parameter values, pass an empty Hash as a request object (see above).
3763
+ #
3764
+ # @param name [::String]
3765
+ # Required. The name of the DataSourceReference to retrieve.
3766
+ # Format:
3767
+ # projects/\\{project}/locations/\\{location}/dataSourceReferences/\\{data_source_reference}
3768
+ #
3769
+ # @yield [response, operation] Access the result along with the RPC operation
3770
+ # @yieldparam response [::Google::Cloud::BackupDR::V1::DataSourceReference]
3771
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3772
+ #
3773
+ # @return [::Google::Cloud::BackupDR::V1::DataSourceReference]
3774
+ #
3775
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3776
+ #
3777
+ # @example Basic example
3778
+ # require "google/cloud/backupdr/v1"
3779
+ #
3780
+ # # Create a client object. The client can be reused for multiple calls.
3781
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
3782
+ #
3783
+ # # Create a request. To set request fields, pass in keyword arguments.
3784
+ # request = Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest.new
3785
+ #
3786
+ # # Call the get_data_source_reference method.
3787
+ # result = client.get_data_source_reference request
3788
+ #
3789
+ # # The returned object is of type Google::Cloud::BackupDR::V1::DataSourceReference.
3790
+ # p result
3791
+ #
3792
+ def get_data_source_reference request, options = nil
3793
+ raise ::ArgumentError, "request must be provided" if request.nil?
3794
+
3795
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest
3796
+
3797
+ # Converts hash and nil to an options object
3798
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3799
+
3800
+ # Customize the options with defaults
3801
+ metadata = @config.rpcs.get_data_source_reference.metadata.to_h
3802
+
3803
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3804
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3805
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3806
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
3807
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3808
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3809
+
3810
+ header_params = {}
3811
+ if request.name
3812
+ header_params["name"] = request.name
3813
+ end
3814
+
3815
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3816
+ metadata[:"x-goog-request-params"] ||= request_params_header
3817
+
3818
+ options.apply_defaults timeout: @config.rpcs.get_data_source_reference.timeout,
3819
+ metadata: metadata,
3820
+ retry_policy: @config.rpcs.get_data_source_reference.retry_policy
3821
+
3822
+ options.apply_defaults timeout: @config.timeout,
3823
+ metadata: @config.metadata,
3824
+ retry_policy: @config.retry_policy
3825
+
3826
+ @backup_dr_stub.call_rpc :get_data_source_reference, request, options: options do |response, operation|
3827
+ yield response, operation if block_given?
3828
+ end
3829
+ rescue ::GRPC::BadStatus => e
3830
+ raise ::Google::Cloud::Error.from_error(e)
3831
+ end
3832
+
3833
+ ##
3834
+ # Fetch DataSourceReferences for a given project, location and resource type.
3835
+ #
3836
+ # @overload fetch_data_source_references_for_resource_type(request, options = nil)
3837
+ # Pass arguments to `fetch_data_source_references_for_resource_type` via a request object, either of type
3838
+ # {::Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest} or an equivalent Hash.
3839
+ #
3840
+ # @param request [::Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest, ::Hash]
3841
+ # A request object representing the call parameters. Required. To specify no
3842
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3843
+ # @param options [::Gapic::CallOptions, ::Hash]
3844
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3845
+ #
3846
+ # @overload fetch_data_source_references_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
3847
+ # Pass arguments to `fetch_data_source_references_for_resource_type` via keyword arguments. Note that at
3848
+ # least one keyword argument is required. To specify no parameters, or to keep all
3849
+ # the default parameter values, pass an empty Hash as a request object (see above).
3850
+ #
3851
+ # @param parent [::String]
3852
+ # Required. The parent resource name.
3853
+ # Format: projects/\\{project}/locations/\\{location}
3854
+ # @param resource_type [::String]
3855
+ # Required. The type of the GCP resource.
3856
+ # Ex: sql.googleapis.com/Instance
3857
+ # @param page_size [::Integer]
3858
+ # Optional. The maximum number of DataSourceReferences to return. The service
3859
+ # may return fewer than this value. If unspecified, at most 50
3860
+ # DataSourceReferences will be returned. The maximum value is 100; values
3861
+ # above 100 will be coerced to 100.
3862
+ # @param page_token [::String]
3863
+ # Optional. A page token, received from a previous call of
3864
+ # `FetchDataSourceReferencesForResourceType`.
3865
+ # Provide this to retrieve the subsequent page.
3866
+ #
3867
+ # When paginating, all other parameters provided to
3868
+ # `FetchDataSourceReferencesForResourceType` must match
3869
+ # the call that provided the page token.
3870
+ # @param filter [::String]
3871
+ # Optional. A filter expression that filters the results fetched in the
3872
+ # response. The expression must specify the field name, a comparison
3873
+ # operator, and the value that you want to use for filtering. Supported
3874
+ # fields:
3875
+ # * data_source
3876
+ # * data_source_gcp_resource_info.gcp_resourcename
3877
+ # * data_source_backup_config_state
3878
+ # * data_source_backup_count
3879
+ # * data_source_backup_config_info.last_backup_state
3880
+ # * data_source_gcp_resource_info.gcp_resourcename
3881
+ # * data_source_gcp_resource_info.type
3882
+ # * data_source_gcp_resource_info.location
3883
+ # * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time
3884
+ # @param order_by [::String]
3885
+ # Optional. A comma-separated list of fields to order by, sorted in ascending
3886
+ # order. Use "desc" after a field name for descending.
3887
+ #
3888
+ # Supported fields:
3889
+ # * name
3890
+ #
3891
+ # @yield [response, operation] Access the result along with the RPC operation
3892
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>]
3893
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3894
+ #
3895
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>]
3896
+ #
3897
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3898
+ #
3899
+ # @example Basic example
3900
+ # require "google/cloud/backupdr/v1"
3901
+ #
3902
+ # # Create a client object. The client can be reused for multiple calls.
3903
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
3904
+ #
3905
+ # # Create a request. To set request fields, pass in keyword arguments.
3906
+ # request = Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest.new
3907
+ #
3908
+ # # Call the fetch_data_source_references_for_resource_type method.
3909
+ # result = client.fetch_data_source_references_for_resource_type request
3910
+ #
3911
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3912
+ # # over elements, and API calls will be issued to fetch pages as needed.
3913
+ # result.each do |item|
3914
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::DataSourceReference.
3915
+ # p item
3916
+ # end
3917
+ #
3918
+ def fetch_data_source_references_for_resource_type request, options = nil
3919
+ raise ::ArgumentError, "request must be provided" if request.nil?
3920
+
3921
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest
3922
+
3923
+ # Converts hash and nil to an options object
3924
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3925
+
3926
+ # Customize the options with defaults
3927
+ metadata = @config.rpcs.fetch_data_source_references_for_resource_type.metadata.to_h
3928
+
3929
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3930
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3931
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3932
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
3933
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3934
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3935
+
3936
+ header_params = {}
3937
+ if request.parent
3938
+ header_params["parent"] = request.parent
3939
+ end
3940
+
3941
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3942
+ metadata[:"x-goog-request-params"] ||= request_params_header
3943
+
3944
+ options.apply_defaults timeout: @config.rpcs.fetch_data_source_references_for_resource_type.timeout,
3945
+ metadata: metadata,
3946
+ retry_policy: @config.rpcs.fetch_data_source_references_for_resource_type.retry_policy
3947
+
3948
+ options.apply_defaults timeout: @config.timeout,
3949
+ metadata: @config.metadata,
3950
+ retry_policy: @config.retry_policy
3951
+
3952
+ @backup_dr_stub.call_rpc :fetch_data_source_references_for_resource_type, request, options: options do |response, operation|
3953
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_data_source_references_for_resource_type, request, response, operation, options
3954
+ yield response, operation if block_given?
3955
+ throw :response, response
3956
+ end
3957
+ rescue ::GRPC::BadStatus => e
3958
+ raise ::Google::Cloud::Error.from_error(e)
3959
+ end
3960
+
3174
3961
  ##
3175
3962
  # Initializes the service related config for a project.
3176
3963
  #
@@ -3184,7 +3971,7 @@ module Google
3184
3971
  # @param options [::Gapic::CallOptions, ::Hash]
3185
3972
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3186
3973
  #
3187
- # @overload initialize_service(name: nil, resource_type: nil, request_id: nil)
3974
+ # @overload initialize_service(name: nil, resource_type: nil, request_id: nil, cloud_sql_instance_initialization_config: nil)
3188
3975
  # Pass arguments to `initialize_service` via keyword arguments. Note that at
3189
3976
  # least one keyword argument is required. To specify no parameters, or to keep all
3190
3977
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -3211,6 +3998,8 @@ module Google
3211
3998
  #
3212
3999
  # The request ID must be a valid UUID with the exception that zero UUID is
3213
4000
  # not supported (00000000-0000-0000-0000-000000000000).
4001
+ # @param cloud_sql_instance_initialization_config [::Google::Cloud::BackupDR::V1::CloudSqlInstanceInitializationConfig, ::Hash]
4002
+ # Optional. The configuration for initializing a Cloud SQL instance.
3214
4003
  #
3215
4004
  # @yield [response, operation] Access the result along with the RPC operation
3216
4005
  # @yieldparam response [::Gapic::Operation]
@@ -3547,6 +4336,11 @@ module Google
3547
4336
  #
3548
4337
  attr_reader :create_backup_plan
3549
4338
  ##
4339
+ # RPC-specific configuration for `update_backup_plan`
4340
+ # @return [::Gapic::Config::Method]
4341
+ #
4342
+ attr_reader :update_backup_plan
4343
+ ##
3550
4344
  # RPC-specific configuration for `get_backup_plan`
3551
4345
  # @return [::Gapic::Config::Method]
3552
4346
  #
@@ -3562,11 +4356,26 @@ module Google
3562
4356
  #
3563
4357
  attr_reader :delete_backup_plan
3564
4358
  ##
4359
+ # RPC-specific configuration for `get_backup_plan_revision`
4360
+ # @return [::Gapic::Config::Method]
4361
+ #
4362
+ attr_reader :get_backup_plan_revision
4363
+ ##
4364
+ # RPC-specific configuration for `list_backup_plan_revisions`
4365
+ # @return [::Gapic::Config::Method]
4366
+ #
4367
+ attr_reader :list_backup_plan_revisions
4368
+ ##
3565
4369
  # RPC-specific configuration for `create_backup_plan_association`
3566
4370
  # @return [::Gapic::Config::Method]
3567
4371
  #
3568
4372
  attr_reader :create_backup_plan_association
3569
4373
  ##
4374
+ # RPC-specific configuration for `update_backup_plan_association`
4375
+ # @return [::Gapic::Config::Method]
4376
+ #
4377
+ attr_reader :update_backup_plan_association
4378
+ ##
3570
4379
  # RPC-specific configuration for `get_backup_plan_association`
3571
4380
  # @return [::Gapic::Config::Method]
3572
4381
  #
@@ -3577,6 +4386,11 @@ module Google
3577
4386
  #
3578
4387
  attr_reader :list_backup_plan_associations
3579
4388
  ##
4389
+ # RPC-specific configuration for `fetch_backup_plan_associations_for_resource_type`
4390
+ # @return [::Gapic::Config::Method]
4391
+ #
4392
+ attr_reader :fetch_backup_plan_associations_for_resource_type
4393
+ ##
3580
4394
  # RPC-specific configuration for `delete_backup_plan_association`
3581
4395
  # @return [::Gapic::Config::Method]
3582
4396
  #
@@ -3587,6 +4401,16 @@ module Google
3587
4401
  #
3588
4402
  attr_reader :trigger_backup
3589
4403
  ##
4404
+ # RPC-specific configuration for `get_data_source_reference`
4405
+ # @return [::Gapic::Config::Method]
4406
+ #
4407
+ attr_reader :get_data_source_reference
4408
+ ##
4409
+ # RPC-specific configuration for `fetch_data_source_references_for_resource_type`
4410
+ # @return [::Gapic::Config::Method]
4411
+ #
4412
+ attr_reader :fetch_data_source_references_for_resource_type
4413
+ ##
3590
4414
  # RPC-specific configuration for `initialize_service`
3591
4415
  # @return [::Gapic::Config::Method]
3592
4416
  #
@@ -3632,22 +4456,36 @@ module Google
3632
4456
  @restore_backup = ::Gapic::Config::Method.new restore_backup_config
3633
4457
  create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan
3634
4458
  @create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config
4459
+ update_backup_plan_config = parent_rpcs.update_backup_plan if parent_rpcs.respond_to? :update_backup_plan
4460
+ @update_backup_plan = ::Gapic::Config::Method.new update_backup_plan_config
3635
4461
  get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan
3636
4462
  @get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config
3637
4463
  list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans
3638
4464
  @list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config
3639
4465
  delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan
3640
4466
  @delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config
4467
+ get_backup_plan_revision_config = parent_rpcs.get_backup_plan_revision if parent_rpcs.respond_to? :get_backup_plan_revision
4468
+ @get_backup_plan_revision = ::Gapic::Config::Method.new get_backup_plan_revision_config
4469
+ list_backup_plan_revisions_config = parent_rpcs.list_backup_plan_revisions if parent_rpcs.respond_to? :list_backup_plan_revisions
4470
+ @list_backup_plan_revisions = ::Gapic::Config::Method.new list_backup_plan_revisions_config
3641
4471
  create_backup_plan_association_config = parent_rpcs.create_backup_plan_association if parent_rpcs.respond_to? :create_backup_plan_association
3642
4472
  @create_backup_plan_association = ::Gapic::Config::Method.new create_backup_plan_association_config
4473
+ update_backup_plan_association_config = parent_rpcs.update_backup_plan_association if parent_rpcs.respond_to? :update_backup_plan_association
4474
+ @update_backup_plan_association = ::Gapic::Config::Method.new update_backup_plan_association_config
3643
4475
  get_backup_plan_association_config = parent_rpcs.get_backup_plan_association if parent_rpcs.respond_to? :get_backup_plan_association
3644
4476
  @get_backup_plan_association = ::Gapic::Config::Method.new get_backup_plan_association_config
3645
4477
  list_backup_plan_associations_config = parent_rpcs.list_backup_plan_associations if parent_rpcs.respond_to? :list_backup_plan_associations
3646
4478
  @list_backup_plan_associations = ::Gapic::Config::Method.new list_backup_plan_associations_config
4479
+ fetch_backup_plan_associations_for_resource_type_config = parent_rpcs.fetch_backup_plan_associations_for_resource_type if parent_rpcs.respond_to? :fetch_backup_plan_associations_for_resource_type
4480
+ @fetch_backup_plan_associations_for_resource_type = ::Gapic::Config::Method.new fetch_backup_plan_associations_for_resource_type_config
3647
4481
  delete_backup_plan_association_config = parent_rpcs.delete_backup_plan_association if parent_rpcs.respond_to? :delete_backup_plan_association
3648
4482
  @delete_backup_plan_association = ::Gapic::Config::Method.new delete_backup_plan_association_config
3649
4483
  trigger_backup_config = parent_rpcs.trigger_backup if parent_rpcs.respond_to? :trigger_backup
3650
4484
  @trigger_backup = ::Gapic::Config::Method.new trigger_backup_config
4485
+ get_data_source_reference_config = parent_rpcs.get_data_source_reference if parent_rpcs.respond_to? :get_data_source_reference
4486
+ @get_data_source_reference = ::Gapic::Config::Method.new get_data_source_reference_config
4487
+ fetch_data_source_references_for_resource_type_config = parent_rpcs.fetch_data_source_references_for_resource_type if parent_rpcs.respond_to? :fetch_data_source_references_for_resource_type
4488
+ @fetch_data_source_references_for_resource_type = ::Gapic::Config::Method.new fetch_data_source_references_for_resource_type_config
3651
4489
  initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service
3652
4490
  @initialize_service = ::Gapic::Config::Method.new initialize_service_config
3653
4491