google-cloud-bigquery-reservation-v1 1.7.0 → 1.9.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.
@@ -1298,7 +1298,7 @@ module Google
1298
1298
  # @param options [::Gapic::CallOptions, ::Hash]
1299
1299
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1300
1300
  #
1301
- # @overload merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil)
1301
+ # @overload merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil, capacity_commitment_id: nil)
1302
1302
  # Pass arguments to `merge_capacity_commitments` via keyword arguments. Note that at
1303
1303
  # least one keyword argument is required. To specify no parameters, or to keep all
1304
1304
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1312,6 +1312,11 @@ module Google
1312
1312
  # specified in the parent.
1313
1313
  # ID is the last portion of capacity commitment name e.g., 'abc' for
1314
1314
  # projects/myproject/locations/US/capacityCommitments/abc
1315
+ # @param capacity_commitment_id [::String]
1316
+ # Optional. The optional resulting capacity commitment ID. Capacity
1317
+ # commitment name will be generated automatically if this field is empty.
1318
+ # This field must only contain lower case alphanumeric characters or dashes.
1319
+ # The first and last character cannot be a dash. Max length is 64 characters.
1315
1320
  # @yield [result, operation] Access the result along with the TransportOperation object
1316
1321
  # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment]
1317
1322
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -2275,6 +2280,625 @@ module Google
2275
2280
  raise ::Google::Cloud::Error.from_error(e)
2276
2281
  end
2277
2282
 
2283
+ ##
2284
+ # Gets the access control policy for a resource.
2285
+ # May return:
2286
+ #
2287
+ # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the
2288
+ # permission to view it.
2289
+ # * An empty policy if the resource exists but doesn't have a set policy.
2290
+ #
2291
+ # Supported resources are:
2292
+ # - Reservations
2293
+ # - ReservationAssignments
2294
+ #
2295
+ # To call this method, you must have the following Google IAM permissions:
2296
+ #
2297
+ # - `bigqueryreservation.reservations.getIamPolicy` to get policies on
2298
+ # reservations.
2299
+ #
2300
+ # @overload get_iam_policy(request, options = nil)
2301
+ # Pass arguments to `get_iam_policy` via a request object, either of type
2302
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
2303
+ #
2304
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
2305
+ # A request object representing the call parameters. Required. To specify no
2306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2307
+ # @param options [::Gapic::CallOptions, ::Hash]
2308
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2309
+ #
2310
+ # @overload get_iam_policy(resource: nil, options: nil)
2311
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
2312
+ # least one keyword argument is required. To specify no parameters, or to keep all
2313
+ # the default parameter values, pass an empty Hash as a request object (see above).
2314
+ #
2315
+ # @param resource [::String]
2316
+ # REQUIRED: The resource for which the policy is being requested.
2317
+ # See the operation documentation for the appropriate value for this field.
2318
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
2319
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
2320
+ # `GetIamPolicy`.
2321
+ # @yield [result, operation] Access the result along with the TransportOperation object
2322
+ # @yieldparam result [::Google::Iam::V1::Policy]
2323
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2324
+ #
2325
+ # @return [::Google::Iam::V1::Policy]
2326
+ #
2327
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2328
+ #
2329
+ # @example Basic example
2330
+ # require "google/cloud/bigquery/reservation/v1"
2331
+ #
2332
+ # # Create a client object. The client can be reused for multiple calls.
2333
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2334
+ #
2335
+ # # Create a request. To set request fields, pass in keyword arguments.
2336
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
2337
+ #
2338
+ # # Call the get_iam_policy method.
2339
+ # result = client.get_iam_policy request
2340
+ #
2341
+ # # The returned object is of type Google::Iam::V1::Policy.
2342
+ # p result
2343
+ #
2344
+ def get_iam_policy request, options = nil
2345
+ raise ::ArgumentError, "request must be provided" if request.nil?
2346
+
2347
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
2348
+
2349
+ # Converts hash and nil to an options object
2350
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2351
+
2352
+ # Customize the options with defaults
2353
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
2354
+
2355
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2356
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2357
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2358
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2359
+ transports_version_send: [:rest]
2360
+
2361
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2362
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2363
+
2364
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
2365
+ metadata: call_metadata,
2366
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
2367
+
2368
+ options.apply_defaults timeout: @config.timeout,
2369
+ metadata: @config.metadata,
2370
+ retry_policy: @config.retry_policy
2371
+
2372
+ @reservation_service_stub.get_iam_policy request, options do |result, operation|
2373
+ yield result, operation if block_given?
2374
+ end
2375
+ rescue ::Gapic::Rest::Error => e
2376
+ raise ::Google::Cloud::Error.from_error(e)
2377
+ end
2378
+
2379
+ ##
2380
+ # Sets an access control policy for a resource. Replaces any existing
2381
+ # policy.
2382
+ #
2383
+ # Supported resources are:
2384
+ # - Reservations
2385
+ #
2386
+ # To call this method, you must have the following Google IAM permissions:
2387
+ #
2388
+ # - `bigqueryreservation.reservations.setIamPolicy` to set policies on
2389
+ # reservations.
2390
+ #
2391
+ # @overload set_iam_policy(request, options = nil)
2392
+ # Pass arguments to `set_iam_policy` via a request object, either of type
2393
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
2394
+ #
2395
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
2396
+ # A request object representing the call parameters. Required. To specify no
2397
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2398
+ # @param options [::Gapic::CallOptions, ::Hash]
2399
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2400
+ #
2401
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
2402
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
2403
+ # least one keyword argument is required. To specify no parameters, or to keep all
2404
+ # the default parameter values, pass an empty Hash as a request object (see above).
2405
+ #
2406
+ # @param resource [::String]
2407
+ # REQUIRED: The resource for which the policy is being specified.
2408
+ # See the operation documentation for the appropriate value for this field.
2409
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
2410
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
2411
+ # the policy is limited to a few 10s of KB. An empty policy is a
2412
+ # valid policy but certain Cloud Platform services (such as Projects)
2413
+ # might reject them.
2414
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2415
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
2416
+ # the fields in the mask will be modified. If no mask is provided, the
2417
+ # following default mask is used:
2418
+ #
2419
+ # `paths: "bindings, etag"`
2420
+ # @yield [result, operation] Access the result along with the TransportOperation object
2421
+ # @yieldparam result [::Google::Iam::V1::Policy]
2422
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2423
+ #
2424
+ # @return [::Google::Iam::V1::Policy]
2425
+ #
2426
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2427
+ #
2428
+ # @example Basic example
2429
+ # require "google/cloud/bigquery/reservation/v1"
2430
+ #
2431
+ # # Create a client object. The client can be reused for multiple calls.
2432
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2433
+ #
2434
+ # # Create a request. To set request fields, pass in keyword arguments.
2435
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
2436
+ #
2437
+ # # Call the set_iam_policy method.
2438
+ # result = client.set_iam_policy request
2439
+ #
2440
+ # # The returned object is of type Google::Iam::V1::Policy.
2441
+ # p result
2442
+ #
2443
+ def set_iam_policy request, options = nil
2444
+ raise ::ArgumentError, "request must be provided" if request.nil?
2445
+
2446
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
2447
+
2448
+ # Converts hash and nil to an options object
2449
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2450
+
2451
+ # Customize the options with defaults
2452
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
2453
+
2454
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2455
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2456
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2457
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2458
+ transports_version_send: [:rest]
2459
+
2460
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2461
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2462
+
2463
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
2464
+ metadata: call_metadata,
2465
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
2466
+
2467
+ options.apply_defaults timeout: @config.timeout,
2468
+ metadata: @config.metadata,
2469
+ retry_policy: @config.retry_policy
2470
+
2471
+ @reservation_service_stub.set_iam_policy request, options do |result, operation|
2472
+ yield result, operation if block_given?
2473
+ end
2474
+ rescue ::Gapic::Rest::Error => e
2475
+ raise ::Google::Cloud::Error.from_error(e)
2476
+ end
2477
+
2478
+ ##
2479
+ # Gets your permissions on a resource. Returns an empty set of permissions if
2480
+ # the resource doesn't exist.
2481
+ #
2482
+ # Supported resources are:
2483
+ # - Reservations
2484
+ #
2485
+ # No Google IAM permissions are required to call this method.
2486
+ #
2487
+ # @overload test_iam_permissions(request, options = nil)
2488
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
2489
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
2490
+ #
2491
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
2492
+ # A request object representing the call parameters. Required. To specify no
2493
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2494
+ # @param options [::Gapic::CallOptions, ::Hash]
2495
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2496
+ #
2497
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
2498
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
2499
+ # least one keyword argument is required. To specify no parameters, or to keep all
2500
+ # the default parameter values, pass an empty Hash as a request object (see above).
2501
+ #
2502
+ # @param resource [::String]
2503
+ # REQUIRED: The resource for which the policy detail is being requested.
2504
+ # See the operation documentation for the appropriate value for this field.
2505
+ # @param permissions [::Array<::String>]
2506
+ # The set of permissions to check for the `resource`. Permissions with
2507
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
2508
+ # information see
2509
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
2510
+ # @yield [result, operation] Access the result along with the TransportOperation object
2511
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
2512
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2513
+ #
2514
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
2515
+ #
2516
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2517
+ #
2518
+ # @example Basic example
2519
+ # require "google/cloud/bigquery/reservation/v1"
2520
+ #
2521
+ # # Create a client object. The client can be reused for multiple calls.
2522
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2523
+ #
2524
+ # # Create a request. To set request fields, pass in keyword arguments.
2525
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
2526
+ #
2527
+ # # Call the test_iam_permissions method.
2528
+ # result = client.test_iam_permissions request
2529
+ #
2530
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
2531
+ # p result
2532
+ #
2533
+ def test_iam_permissions request, options = nil
2534
+ raise ::ArgumentError, "request must be provided" if request.nil?
2535
+
2536
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
2537
+
2538
+ # Converts hash and nil to an options object
2539
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2540
+
2541
+ # Customize the options with defaults
2542
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
2543
+
2544
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2545
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2546
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2547
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2548
+ transports_version_send: [:rest]
2549
+
2550
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2551
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2552
+
2553
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
2554
+ metadata: call_metadata,
2555
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
2556
+
2557
+ options.apply_defaults timeout: @config.timeout,
2558
+ metadata: @config.metadata,
2559
+ retry_policy: @config.retry_policy
2560
+
2561
+ @reservation_service_stub.test_iam_permissions request, options do |result, operation|
2562
+ yield result, operation if block_given?
2563
+ end
2564
+ rescue ::Gapic::Rest::Error => e
2565
+ raise ::Google::Cloud::Error.from_error(e)
2566
+ end
2567
+
2568
+ ##
2569
+ # Creates a new reservation group.
2570
+ #
2571
+ # @overload create_reservation_group(request, options = nil)
2572
+ # Pass arguments to `create_reservation_group` via a request object, either of type
2573
+ # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest} or an equivalent Hash.
2574
+ #
2575
+ # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Hash]
2576
+ # A request object representing the call parameters. Required. To specify no
2577
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2578
+ # @param options [::Gapic::CallOptions, ::Hash]
2579
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2580
+ #
2581
+ # @overload create_reservation_group(parent: nil, reservation_group_id: nil, reservation_group: nil)
2582
+ # Pass arguments to `create_reservation_group` via keyword arguments. Note that at
2583
+ # least one keyword argument is required. To specify no parameters, or to keep all
2584
+ # the default parameter values, pass an empty Hash as a request object (see above).
2585
+ #
2586
+ # @param parent [::String]
2587
+ # Required. Project, location. E.g.,
2588
+ # `projects/myproject/locations/US`
2589
+ # @param reservation_group_id [::String]
2590
+ # Required. The reservation group ID. It must only contain lower case
2591
+ # alphanumeric characters or dashes. It must start with a letter and must not
2592
+ # end with a dash. Its maximum length is 64 characters.
2593
+ # @param reservation_group [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup, ::Hash]
2594
+ # Required. New Reservation Group to create.
2595
+ # @yield [result, operation] Access the result along with the TransportOperation object
2596
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup]
2597
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2598
+ #
2599
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup]
2600
+ #
2601
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2602
+ #
2603
+ # @example Basic example
2604
+ # require "google/cloud/bigquery/reservation/v1"
2605
+ #
2606
+ # # Create a client object. The client can be reused for multiple calls.
2607
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2608
+ #
2609
+ # # Create a request. To set request fields, pass in keyword arguments.
2610
+ # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new
2611
+ #
2612
+ # # Call the create_reservation_group method.
2613
+ # result = client.create_reservation_group request
2614
+ #
2615
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.
2616
+ # p result
2617
+ #
2618
+ def create_reservation_group request, options = nil
2619
+ raise ::ArgumentError, "request must be provided" if request.nil?
2620
+
2621
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest
2622
+
2623
+ # Converts hash and nil to an options object
2624
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2625
+
2626
+ # Customize the options with defaults
2627
+ call_metadata = @config.rpcs.create_reservation_group.metadata.to_h
2628
+
2629
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2630
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2631
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2632
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2633
+ transports_version_send: [:rest]
2634
+
2635
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2636
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2637
+
2638
+ options.apply_defaults timeout: @config.rpcs.create_reservation_group.timeout,
2639
+ metadata: call_metadata,
2640
+ retry_policy: @config.rpcs.create_reservation_group.retry_policy
2641
+
2642
+ options.apply_defaults timeout: @config.timeout,
2643
+ metadata: @config.metadata,
2644
+ retry_policy: @config.retry_policy
2645
+
2646
+ @reservation_service_stub.create_reservation_group request, options do |result, operation|
2647
+ yield result, operation if block_given?
2648
+ end
2649
+ rescue ::Gapic::Rest::Error => e
2650
+ raise ::Google::Cloud::Error.from_error(e)
2651
+ end
2652
+
2653
+ ##
2654
+ # Returns information about the reservation group.
2655
+ #
2656
+ # @overload get_reservation_group(request, options = nil)
2657
+ # Pass arguments to `get_reservation_group` via a request object, either of type
2658
+ # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest} or an equivalent Hash.
2659
+ #
2660
+ # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Hash]
2661
+ # A request object representing the call parameters. Required. To specify no
2662
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2663
+ # @param options [::Gapic::CallOptions, ::Hash]
2664
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2665
+ #
2666
+ # @overload get_reservation_group(name: nil)
2667
+ # Pass arguments to `get_reservation_group` via keyword arguments. Note that at
2668
+ # least one keyword argument is required. To specify no parameters, or to keep all
2669
+ # the default parameter values, pass an empty Hash as a request object (see above).
2670
+ #
2671
+ # @param name [::String]
2672
+ # Required. Resource name of the reservation group to retrieve. E.g.,
2673
+ # `projects/myproject/locations/US/reservationGroups/team1-prod`
2674
+ # @yield [result, operation] Access the result along with the TransportOperation object
2675
+ # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup]
2676
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2677
+ #
2678
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup]
2679
+ #
2680
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2681
+ #
2682
+ # @example Basic example
2683
+ # require "google/cloud/bigquery/reservation/v1"
2684
+ #
2685
+ # # Create a client object. The client can be reused for multiple calls.
2686
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2687
+ #
2688
+ # # Create a request. To set request fields, pass in keyword arguments.
2689
+ # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new
2690
+ #
2691
+ # # Call the get_reservation_group method.
2692
+ # result = client.get_reservation_group request
2693
+ #
2694
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.
2695
+ # p result
2696
+ #
2697
+ def get_reservation_group request, options = nil
2698
+ raise ::ArgumentError, "request must be provided" if request.nil?
2699
+
2700
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest
2701
+
2702
+ # Converts hash and nil to an options object
2703
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2704
+
2705
+ # Customize the options with defaults
2706
+ call_metadata = @config.rpcs.get_reservation_group.metadata.to_h
2707
+
2708
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2709
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2710
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2711
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2712
+ transports_version_send: [:rest]
2713
+
2714
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2715
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2716
+
2717
+ options.apply_defaults timeout: @config.rpcs.get_reservation_group.timeout,
2718
+ metadata: call_metadata,
2719
+ retry_policy: @config.rpcs.get_reservation_group.retry_policy
2720
+
2721
+ options.apply_defaults timeout: @config.timeout,
2722
+ metadata: @config.metadata,
2723
+ retry_policy: @config.retry_policy
2724
+
2725
+ @reservation_service_stub.get_reservation_group request, options do |result, operation|
2726
+ yield result, operation if block_given?
2727
+ end
2728
+ rescue ::Gapic::Rest::Error => e
2729
+ raise ::Google::Cloud::Error.from_error(e)
2730
+ end
2731
+
2732
+ ##
2733
+ # Deletes a reservation.
2734
+ # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
2735
+ # assignments.
2736
+ #
2737
+ # @overload delete_reservation_group(request, options = nil)
2738
+ # Pass arguments to `delete_reservation_group` via a request object, either of type
2739
+ # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest} or an equivalent Hash.
2740
+ #
2741
+ # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Hash]
2742
+ # A request object representing the call parameters. Required. To specify no
2743
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2744
+ # @param options [::Gapic::CallOptions, ::Hash]
2745
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2746
+ #
2747
+ # @overload delete_reservation_group(name: nil)
2748
+ # Pass arguments to `delete_reservation_group` via keyword arguments. Note that at
2749
+ # least one keyword argument is required. To specify no parameters, or to keep all
2750
+ # the default parameter values, pass an empty Hash as a request object (see above).
2751
+ #
2752
+ # @param name [::String]
2753
+ # Required. Resource name of the reservation group to retrieve. E.g.,
2754
+ # `projects/myproject/locations/US/reservationGroups/team1-prod`
2755
+ # @yield [result, operation] Access the result along with the TransportOperation object
2756
+ # @yieldparam result [::Google::Protobuf::Empty]
2757
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2758
+ #
2759
+ # @return [::Google::Protobuf::Empty]
2760
+ #
2761
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2762
+ #
2763
+ # @example Basic example
2764
+ # require "google/cloud/bigquery/reservation/v1"
2765
+ #
2766
+ # # Create a client object. The client can be reused for multiple calls.
2767
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2768
+ #
2769
+ # # Create a request. To set request fields, pass in keyword arguments.
2770
+ # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new
2771
+ #
2772
+ # # Call the delete_reservation_group method.
2773
+ # result = client.delete_reservation_group request
2774
+ #
2775
+ # # The returned object is of type Google::Protobuf::Empty.
2776
+ # p result
2777
+ #
2778
+ def delete_reservation_group request, options = nil
2779
+ raise ::ArgumentError, "request must be provided" if request.nil?
2780
+
2781
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest
2782
+
2783
+ # Converts hash and nil to an options object
2784
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2785
+
2786
+ # Customize the options with defaults
2787
+ call_metadata = @config.rpcs.delete_reservation_group.metadata.to_h
2788
+
2789
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2790
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2791
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2792
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2793
+ transports_version_send: [:rest]
2794
+
2795
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2796
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2797
+
2798
+ options.apply_defaults timeout: @config.rpcs.delete_reservation_group.timeout,
2799
+ metadata: call_metadata,
2800
+ retry_policy: @config.rpcs.delete_reservation_group.retry_policy
2801
+
2802
+ options.apply_defaults timeout: @config.timeout,
2803
+ metadata: @config.metadata,
2804
+ retry_policy: @config.retry_policy
2805
+
2806
+ @reservation_service_stub.delete_reservation_group request, options do |result, operation|
2807
+ yield result, operation if block_given?
2808
+ end
2809
+ rescue ::Gapic::Rest::Error => e
2810
+ raise ::Google::Cloud::Error.from_error(e)
2811
+ end
2812
+
2813
+ ##
2814
+ # Lists all the reservation groups for the project in the specified location.
2815
+ #
2816
+ # @overload list_reservation_groups(request, options = nil)
2817
+ # Pass arguments to `list_reservation_groups` via a request object, either of type
2818
+ # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest} or an equivalent Hash.
2819
+ #
2820
+ # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Hash]
2821
+ # A request object representing the call parameters. Required. To specify no
2822
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2823
+ # @param options [::Gapic::CallOptions, ::Hash]
2824
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2825
+ #
2826
+ # @overload list_reservation_groups(parent: nil, page_size: nil, page_token: nil)
2827
+ # Pass arguments to `list_reservation_groups` via keyword arguments. Note that at
2828
+ # least one keyword argument is required. To specify no parameters, or to keep all
2829
+ # the default parameter values, pass an empty Hash as a request object (see above).
2830
+ #
2831
+ # @param parent [::String]
2832
+ # Required. The parent resource name containing project and location, e.g.:
2833
+ # `projects/myproject/locations/US`
2834
+ # @param page_size [::Integer]
2835
+ # The maximum number of items to return per page.
2836
+ # @param page_token [::String]
2837
+ # The next_page_token value returned from a previous List request, if any.
2838
+ # @yield [result, operation] Access the result along with the TransportOperation object
2839
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>]
2840
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2841
+ #
2842
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>]
2843
+ #
2844
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2845
+ #
2846
+ # @example Basic example
2847
+ # require "google/cloud/bigquery/reservation/v1"
2848
+ #
2849
+ # # Create a client object. The client can be reused for multiple calls.
2850
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new
2851
+ #
2852
+ # # Create a request. To set request fields, pass in keyword arguments.
2853
+ # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new
2854
+ #
2855
+ # # Call the list_reservation_groups method.
2856
+ # result = client.list_reservation_groups request
2857
+ #
2858
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2859
+ # # over elements, and API calls will be issued to fetch pages as needed.
2860
+ # result.each do |item|
2861
+ # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.
2862
+ # p item
2863
+ # end
2864
+ #
2865
+ def list_reservation_groups request, options = nil
2866
+ raise ::ArgumentError, "request must be provided" if request.nil?
2867
+
2868
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest
2869
+
2870
+ # Converts hash and nil to an options object
2871
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2872
+
2873
+ # Customize the options with defaults
2874
+ call_metadata = @config.rpcs.list_reservation_groups.metadata.to_h
2875
+
2876
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2877
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2878
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2879
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION,
2880
+ transports_version_send: [:rest]
2881
+
2882
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2883
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2884
+
2885
+ options.apply_defaults timeout: @config.rpcs.list_reservation_groups.timeout,
2886
+ metadata: call_metadata,
2887
+ retry_policy: @config.rpcs.list_reservation_groups.retry_policy
2888
+
2889
+ options.apply_defaults timeout: @config.timeout,
2890
+ metadata: @config.metadata,
2891
+ retry_policy: @config.retry_policy
2892
+
2893
+ @reservation_service_stub.list_reservation_groups request, options do |result, operation|
2894
+ result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservation_groups, "reservation_groups", request, result, options
2895
+ yield result, operation if block_given?
2896
+ throw :response, result
2897
+ end
2898
+ rescue ::Gapic::Rest::Error => e
2899
+ raise ::Google::Cloud::Error.from_error(e)
2900
+ end
2901
+
2278
2902
  ##
2279
2903
  # Configuration class for the ReservationService REST API.
2280
2904
  #
@@ -2531,6 +3155,41 @@ module Google
2531
3155
  # @return [::Gapic::Config::Method]
2532
3156
  #
2533
3157
  attr_reader :update_bi_reservation
3158
+ ##
3159
+ # RPC-specific configuration for `get_iam_policy`
3160
+ # @return [::Gapic::Config::Method]
3161
+ #
3162
+ attr_reader :get_iam_policy
3163
+ ##
3164
+ # RPC-specific configuration for `set_iam_policy`
3165
+ # @return [::Gapic::Config::Method]
3166
+ #
3167
+ attr_reader :set_iam_policy
3168
+ ##
3169
+ # RPC-specific configuration for `test_iam_permissions`
3170
+ # @return [::Gapic::Config::Method]
3171
+ #
3172
+ attr_reader :test_iam_permissions
3173
+ ##
3174
+ # RPC-specific configuration for `create_reservation_group`
3175
+ # @return [::Gapic::Config::Method]
3176
+ #
3177
+ attr_reader :create_reservation_group
3178
+ ##
3179
+ # RPC-specific configuration for `get_reservation_group`
3180
+ # @return [::Gapic::Config::Method]
3181
+ #
3182
+ attr_reader :get_reservation_group
3183
+ ##
3184
+ # RPC-specific configuration for `delete_reservation_group`
3185
+ # @return [::Gapic::Config::Method]
3186
+ #
3187
+ attr_reader :delete_reservation_group
3188
+ ##
3189
+ # RPC-specific configuration for `list_reservation_groups`
3190
+ # @return [::Gapic::Config::Method]
3191
+ #
3192
+ attr_reader :list_reservation_groups
2534
3193
 
2535
3194
  # @private
2536
3195
  def initialize parent_rpcs = nil
@@ -2578,6 +3237,20 @@ module Google
2578
3237
  @get_bi_reservation = ::Gapic::Config::Method.new get_bi_reservation_config
2579
3238
  update_bi_reservation_config = parent_rpcs.update_bi_reservation if parent_rpcs.respond_to? :update_bi_reservation
2580
3239
  @update_bi_reservation = ::Gapic::Config::Method.new update_bi_reservation_config
3240
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
3241
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
3242
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
3243
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
3244
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
3245
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
3246
+ create_reservation_group_config = parent_rpcs.create_reservation_group if parent_rpcs.respond_to? :create_reservation_group
3247
+ @create_reservation_group = ::Gapic::Config::Method.new create_reservation_group_config
3248
+ get_reservation_group_config = parent_rpcs.get_reservation_group if parent_rpcs.respond_to? :get_reservation_group
3249
+ @get_reservation_group = ::Gapic::Config::Method.new get_reservation_group_config
3250
+ delete_reservation_group_config = parent_rpcs.delete_reservation_group if parent_rpcs.respond_to? :delete_reservation_group
3251
+ @delete_reservation_group = ::Gapic::Config::Method.new delete_reservation_group_config
3252
+ list_reservation_groups_config = parent_rpcs.list_reservation_groups if parent_rpcs.respond_to? :list_reservation_groups
3253
+ @list_reservation_groups = ::Gapic::Config::Method.new list_reservation_groups_config
2581
3254
 
2582
3255
  yield self if block_given?
2583
3256
  end