google-cloud-bigquery-reservation-v1 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,17 +81,17 @@ module Google
81
81
 
82
82
  default_config.rpcs.create_reservation.timeout = 300.0
83
83
 
84
- default_config.rpcs.list_reservations.timeout = 60.0
84
+ default_config.rpcs.list_reservations.timeout = 300.0
85
85
  default_config.rpcs.list_reservations.retry_policy = {
86
86
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
87
87
  }
88
88
 
89
- default_config.rpcs.get_reservation.timeout = 60.0
89
+ default_config.rpcs.get_reservation.timeout = 300.0
90
90
  default_config.rpcs.get_reservation.retry_policy = {
91
91
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
92
92
  }
93
93
 
94
- default_config.rpcs.delete_reservation.timeout = 60.0
94
+ default_config.rpcs.delete_reservation.timeout = 300.0
95
95
  default_config.rpcs.delete_reservation.retry_policy = {
96
96
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
97
97
  }
@@ -100,17 +100,17 @@ module Google
100
100
 
101
101
  default_config.rpcs.create_capacity_commitment.timeout = 300.0
102
102
 
103
- default_config.rpcs.list_capacity_commitments.timeout = 60.0
103
+ default_config.rpcs.list_capacity_commitments.timeout = 300.0
104
104
  default_config.rpcs.list_capacity_commitments.retry_policy = {
105
105
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
106
106
  }
107
107
 
108
- default_config.rpcs.get_capacity_commitment.timeout = 60.0
108
+ default_config.rpcs.get_capacity_commitment.timeout = 300.0
109
109
  default_config.rpcs.get_capacity_commitment.retry_policy = {
110
110
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
111
111
  }
112
112
 
113
- default_config.rpcs.delete_capacity_commitment.timeout = 60.0
113
+ default_config.rpcs.delete_capacity_commitment.timeout = 300.0
114
114
  default_config.rpcs.delete_capacity_commitment.retry_policy = {
115
115
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
116
116
  }
@@ -123,24 +123,24 @@ module Google
123
123
 
124
124
  default_config.rpcs.create_assignment.timeout = 300.0
125
125
 
126
- default_config.rpcs.list_assignments.timeout = 60.0
126
+ default_config.rpcs.list_assignments.timeout = 300.0
127
127
  default_config.rpcs.list_assignments.retry_policy = {
128
128
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
129
129
  }
130
130
 
131
- default_config.rpcs.delete_assignment.timeout = 60.0
131
+ default_config.rpcs.delete_assignment.timeout = 300.0
132
132
  default_config.rpcs.delete_assignment.retry_policy = {
133
133
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
134
134
  }
135
135
 
136
- default_config.rpcs.search_assignments.timeout = 60.0
136
+ default_config.rpcs.search_assignments.timeout = 300.0
137
137
  default_config.rpcs.search_assignments.retry_policy = {
138
138
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
139
139
  }
140
140
 
141
141
  default_config.rpcs.move_assignment.timeout = 300.0
142
142
 
143
- default_config.rpcs.get_bi_reservation.timeout = 60.0
143
+ default_config.rpcs.get_bi_reservation.timeout = 300.0
144
144
  default_config.rpcs.get_bi_reservation.retry_policy = {
145
145
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
146
146
  }
@@ -249,8 +249,9 @@ module Google
249
249
  # Required. Project, location. E.g.,
250
250
  # `projects/myproject/locations/US`
251
251
  # @param reservation_id [::String]
252
- # The reservation ID. This field must only contain lower case alphanumeric
253
- # characters or dash. Max length is 64 characters.
252
+ # The reservation ID. It must only contain lower case alphanumeric
253
+ # characters or dashes. It must start with a letter and must not end
254
+ # with a dash. Its maximum length is 64 characters.
254
255
  # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash]
255
256
  # Definition of the new reservation to create.
256
257
  #
@@ -262,6 +263,21 @@ module Google
262
263
  #
263
264
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
264
265
  #
266
+ # @example Basic example
267
+ # require "google/cloud/bigquery/reservation/v1"
268
+ #
269
+ # # Create a client object. The client can be reused for multiple calls.
270
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
271
+ #
272
+ # # Create a request. To set request fields, pass in keyword arguments.
273
+ # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new
274
+ #
275
+ # # Call the create_reservation method.
276
+ # result = client.create_reservation request
277
+ #
278
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation.
279
+ # p result
280
+ #
265
281
  def create_reservation request, options = nil
266
282
  raise ::ArgumentError, "request must be provided" if request.nil?
267
283
 
@@ -279,9 +295,11 @@ module Google
279
295
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
280
296
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
297
 
282
- header_params = {
283
- "parent" => request.parent
284
- }
298
+ header_params = {}
299
+ if request.parent
300
+ header_params["parent"] = request.parent
301
+ end
302
+
285
303
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
286
304
  metadata[:"x-goog-request-params"] ||= request_params_header
287
305
 
@@ -335,6 +353,27 @@ module Google
335
353
  #
336
354
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
337
355
  #
356
+ # @example Basic example
357
+ # require "google/cloud/bigquery/reservation/v1"
358
+ #
359
+ # # Create a client object. The client can be reused for multiple calls.
360
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
361
+ #
362
+ # # Create a request. To set request fields, pass in keyword arguments.
363
+ # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new
364
+ #
365
+ # # Call the list_reservations method.
366
+ # result = client.list_reservations request
367
+ #
368
+ # # The returned object is of type Gapic::PagedEnumerable. You can
369
+ # # iterate over all elements by calling #each, and the enumerable
370
+ # # will lazily make API calls to fetch subsequent pages. Other
371
+ # # methods are also available for managing paging directly.
372
+ # result.each do |response|
373
+ # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation.
374
+ # p response
375
+ # end
376
+ #
338
377
  def list_reservations request, options = nil
339
378
  raise ::ArgumentError, "request must be provided" if request.nil?
340
379
 
@@ -352,9 +391,11 @@ module Google
352
391
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
353
392
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
354
393
 
355
- header_params = {
356
- "parent" => request.parent
357
- }
394
+ header_params = {}
395
+ if request.parent
396
+ header_params["parent"] = request.parent
397
+ end
398
+
358
399
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
359
400
  metadata[:"x-goog-request-params"] ||= request_params_header
360
401
 
@@ -405,6 +446,21 @@ module Google
405
446
  #
406
447
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
407
448
  #
449
+ # @example Basic example
450
+ # require "google/cloud/bigquery/reservation/v1"
451
+ #
452
+ # # Create a client object. The client can be reused for multiple calls.
453
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
454
+ #
455
+ # # Create a request. To set request fields, pass in keyword arguments.
456
+ # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new
457
+ #
458
+ # # Call the get_reservation method.
459
+ # result = client.get_reservation request
460
+ #
461
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation.
462
+ # p result
463
+ #
408
464
  def get_reservation request, options = nil
409
465
  raise ::ArgumentError, "request must be provided" if request.nil?
410
466
 
@@ -422,9 +478,11 @@ module Google
422
478
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
423
479
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
424
480
 
425
- header_params = {
426
- "name" => request.name
427
- }
481
+ header_params = {}
482
+ if request.name
483
+ header_params["name"] = request.name
484
+ end
485
+
428
486
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
429
487
  metadata[:"x-goog-request-params"] ||= request_params_header
430
488
 
@@ -476,6 +534,21 @@ module Google
476
534
  #
477
535
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
478
536
  #
537
+ # @example Basic example
538
+ # require "google/cloud/bigquery/reservation/v1"
539
+ #
540
+ # # Create a client object. The client can be reused for multiple calls.
541
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
542
+ #
543
+ # # Create a request. To set request fields, pass in keyword arguments.
544
+ # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new
545
+ #
546
+ # # Call the delete_reservation method.
547
+ # result = client.delete_reservation request
548
+ #
549
+ # # The returned object is of type Google::Protobuf::Empty.
550
+ # p result
551
+ #
479
552
  def delete_reservation request, options = nil
480
553
  raise ::ArgumentError, "request must be provided" if request.nil?
481
554
 
@@ -493,9 +566,11 @@ module Google
493
566
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
494
567
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
495
568
 
496
- header_params = {
497
- "name" => request.name
498
- }
569
+ header_params = {}
570
+ if request.name
571
+ header_params["name"] = request.name
572
+ end
573
+
499
574
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
500
575
  metadata[:"x-goog-request-params"] ||= request_params_header
501
576
 
@@ -546,6 +621,21 @@ module Google
546
621
  #
547
622
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
548
623
  #
624
+ # @example Basic example
625
+ # require "google/cloud/bigquery/reservation/v1"
626
+ #
627
+ # # Create a client object. The client can be reused for multiple calls.
628
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
629
+ #
630
+ # # Create a request. To set request fields, pass in keyword arguments.
631
+ # request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new
632
+ #
633
+ # # Call the update_reservation method.
634
+ # result = client.update_reservation request
635
+ #
636
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation.
637
+ # p result
638
+ #
549
639
  def update_reservation request, options = nil
550
640
  raise ::ArgumentError, "request must be provided" if request.nil?
551
641
 
@@ -563,9 +653,11 @@ module Google
563
653
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
564
654
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
565
655
 
566
- header_params = {
567
- "reservation.name" => request.reservation.name
568
- }
656
+ header_params = {}
657
+ if request.reservation&.name
658
+ header_params["reservation.name"] = request.reservation.name
659
+ end
660
+
569
661
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
570
662
  metadata[:"x-goog-request-params"] ||= request_params_header
571
663
 
@@ -614,8 +706,8 @@ module Google
614
706
  # @param capacity_commitment_id [::String]
615
707
  # The optional capacity commitment ID. Capacity commitment name will be
616
708
  # generated automatically if this field is empty.
617
- # This field must only contain lower case alphanumeric characters or dash.
618
- # Max length is 64 characters.
709
+ # This field must only contain lower case alphanumeric characters or dashes.
710
+ # The first and last character cannot be a dash. Max length is 64 characters.
619
711
  # NOTE: this ID won't be kept if the capacity commitment is split or merged.
620
712
  #
621
713
  # @yield [response, operation] Access the result along with the RPC operation
@@ -626,6 +718,21 @@ module Google
626
718
  #
627
719
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
628
720
  #
721
+ # @example Basic example
722
+ # require "google/cloud/bigquery/reservation/v1"
723
+ #
724
+ # # Create a client object. The client can be reused for multiple calls.
725
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
726
+ #
727
+ # # Create a request. To set request fields, pass in keyword arguments.
728
+ # request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new
729
+ #
730
+ # # Call the create_capacity_commitment method.
731
+ # result = client.create_capacity_commitment request
732
+ #
733
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.
734
+ # p result
735
+ #
629
736
  def create_capacity_commitment request, options = nil
630
737
  raise ::ArgumentError, "request must be provided" if request.nil?
631
738
 
@@ -643,9 +750,11 @@ module Google
643
750
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
644
751
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
645
752
 
646
- header_params = {
647
- "parent" => request.parent
648
- }
753
+ header_params = {}
754
+ if request.parent
755
+ header_params["parent"] = request.parent
756
+ end
757
+
649
758
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
650
759
  metadata[:"x-goog-request-params"] ||= request_params_header
651
760
 
@@ -699,6 +808,27 @@ module Google
699
808
  #
700
809
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
701
810
  #
811
+ # @example Basic example
812
+ # require "google/cloud/bigquery/reservation/v1"
813
+ #
814
+ # # Create a client object. The client can be reused for multiple calls.
815
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
816
+ #
817
+ # # Create a request. To set request fields, pass in keyword arguments.
818
+ # request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new
819
+ #
820
+ # # Call the list_capacity_commitments method.
821
+ # result = client.list_capacity_commitments request
822
+ #
823
+ # # The returned object is of type Gapic::PagedEnumerable. You can
824
+ # # iterate over all elements by calling #each, and the enumerable
825
+ # # will lazily make API calls to fetch subsequent pages. Other
826
+ # # methods are also available for managing paging directly.
827
+ # result.each do |response|
828
+ # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.
829
+ # p response
830
+ # end
831
+ #
702
832
  def list_capacity_commitments request, options = nil
703
833
  raise ::ArgumentError, "request must be provided" if request.nil?
704
834
 
@@ -716,9 +846,11 @@ module Google
716
846
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
717
847
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
718
848
 
719
- header_params = {
720
- "parent" => request.parent
721
- }
849
+ header_params = {}
850
+ if request.parent
851
+ header_params["parent"] = request.parent
852
+ end
853
+
722
854
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
723
855
  metadata[:"x-goog-request-params"] ||= request_params_header
724
856
 
@@ -769,6 +901,21 @@ module Google
769
901
  #
770
902
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
771
903
  #
904
+ # @example Basic example
905
+ # require "google/cloud/bigquery/reservation/v1"
906
+ #
907
+ # # Create a client object. The client can be reused for multiple calls.
908
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
909
+ #
910
+ # # Create a request. To set request fields, pass in keyword arguments.
911
+ # request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new
912
+ #
913
+ # # Call the get_capacity_commitment method.
914
+ # result = client.get_capacity_commitment request
915
+ #
916
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.
917
+ # p result
918
+ #
772
919
  def get_capacity_commitment request, options = nil
773
920
  raise ::ArgumentError, "request must be provided" if request.nil?
774
921
 
@@ -786,9 +933,11 @@ module Google
786
933
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
787
934
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
788
935
 
789
- header_params = {
790
- "name" => request.name
791
- }
936
+ header_params = {}
937
+ if request.name
938
+ header_params["name"] = request.name
939
+ end
940
+
792
941
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
793
942
  metadata[:"x-goog-request-params"] ||= request_params_header
794
943
 
@@ -844,6 +993,21 @@ module Google
844
993
  #
845
994
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
846
995
  #
996
+ # @example Basic example
997
+ # require "google/cloud/bigquery/reservation/v1"
998
+ #
999
+ # # Create a client object. The client can be reused for multiple calls.
1000
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1001
+ #
1002
+ # # Create a request. To set request fields, pass in keyword arguments.
1003
+ # request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new
1004
+ #
1005
+ # # Call the delete_capacity_commitment method.
1006
+ # result = client.delete_capacity_commitment request
1007
+ #
1008
+ # # The returned object is of type Google::Protobuf::Empty.
1009
+ # p result
1010
+ #
847
1011
  def delete_capacity_commitment request, options = nil
848
1012
  raise ::ArgumentError, "request must be provided" if request.nil?
849
1013
 
@@ -861,9 +1025,11 @@ module Google
861
1025
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
862
1026
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
863
1027
 
864
- header_params = {
865
- "name" => request.name
866
- }
1028
+ header_params = {}
1029
+ if request.name
1030
+ header_params["name"] = request.name
1031
+ end
1032
+
867
1033
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
868
1034
  metadata[:"x-goog-request-params"] ||= request_params_header
869
1035
 
@@ -920,6 +1086,21 @@ module Google
920
1086
  #
921
1087
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
922
1088
  #
1089
+ # @example Basic example
1090
+ # require "google/cloud/bigquery/reservation/v1"
1091
+ #
1092
+ # # Create a client object. The client can be reused for multiple calls.
1093
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1094
+ #
1095
+ # # Create a request. To set request fields, pass in keyword arguments.
1096
+ # request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new
1097
+ #
1098
+ # # Call the update_capacity_commitment method.
1099
+ # result = client.update_capacity_commitment request
1100
+ #
1101
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.
1102
+ # p result
1103
+ #
923
1104
  def update_capacity_commitment request, options = nil
924
1105
  raise ::ArgumentError, "request must be provided" if request.nil?
925
1106
 
@@ -937,9 +1118,11 @@ module Google
937
1118
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
938
1119
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
939
1120
 
940
- header_params = {
941
- "capacity_commitment.name" => request.capacity_commitment.name
942
- }
1121
+ header_params = {}
1122
+ if request.capacity_commitment&.name
1123
+ header_params["capacity_commitment.name"] = request.capacity_commitment.name
1124
+ end
1125
+
943
1126
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
944
1127
  metadata[:"x-goog-request-params"] ||= request_params_header
945
1128
 
@@ -967,7 +1150,7 @@ module Google
967
1150
  #
968
1151
  # For example, in order to downgrade from 10000 slots to 8000, you might
969
1152
  # split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
970
- # you would change the plan of the first one to `FLEX` and then delete it.
1153
+ # you delete the first one after the commitment end time passes.
971
1154
  #
972
1155
  # @overload split_capacity_commitment(request, options = nil)
973
1156
  # Pass arguments to `split_capacity_commitment` via a request object, either of type
@@ -998,6 +1181,21 @@ module Google
998
1181
  #
999
1182
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1000
1183
  #
1184
+ # @example Basic example
1185
+ # require "google/cloud/bigquery/reservation/v1"
1186
+ #
1187
+ # # Create a client object. The client can be reused for multiple calls.
1188
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1189
+ #
1190
+ # # Create a request. To set request fields, pass in keyword arguments.
1191
+ # request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new
1192
+ #
1193
+ # # Call the split_capacity_commitment method.
1194
+ # result = client.split_capacity_commitment request
1195
+ #
1196
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.
1197
+ # p result
1198
+ #
1001
1199
  def split_capacity_commitment request, options = nil
1002
1200
  raise ::ArgumentError, "request must be provided" if request.nil?
1003
1201
 
@@ -1015,9 +1213,11 @@ module Google
1015
1213
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1016
1214
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1017
1215
 
1018
- header_params = {
1019
- "name" => request.name
1020
- }
1216
+ header_params = {}
1217
+ if request.name
1218
+ header_params["name"] = request.name
1219
+ end
1220
+
1021
1221
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1022
1222
  metadata[:"x-goog-request-params"] ||= request_params_header
1023
1223
 
@@ -1079,6 +1279,21 @@ module Google
1079
1279
  #
1080
1280
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1081
1281
  #
1282
+ # @example Basic example
1283
+ # require "google/cloud/bigquery/reservation/v1"
1284
+ #
1285
+ # # Create a client object. The client can be reused for multiple calls.
1286
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1287
+ #
1288
+ # # Create a request. To set request fields, pass in keyword arguments.
1289
+ # request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new
1290
+ #
1291
+ # # Call the merge_capacity_commitments method.
1292
+ # result = client.merge_capacity_commitments request
1293
+ #
1294
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.
1295
+ # p result
1296
+ #
1082
1297
  def merge_capacity_commitments request, options = nil
1083
1298
  raise ::ArgumentError, "request must be provided" if request.nil?
1084
1299
 
@@ -1096,9 +1311,11 @@ module Google
1096
1311
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1097
1312
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1098
1313
 
1099
- header_params = {
1100
- "parent" => request.parent
1101
- }
1314
+ header_params = {}
1315
+ if request.parent
1316
+ header_params["parent"] = request.parent
1317
+ end
1318
+
1102
1319
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1103
1320
  metadata[:"x-goog-request-params"] ||= request_params_header
1104
1321
 
@@ -1178,7 +1395,7 @@ module Google
1178
1395
  # @param assignment_id [::String]
1179
1396
  # The optional assignment ID. Assignment name will be generated automatically
1180
1397
  # if this field is empty.
1181
- # This field must only contain lower case alphanumeric characters or dash.
1398
+ # This field must only contain lower case alphanumeric characters or dashes.
1182
1399
  # Max length is 64 characters.
1183
1400
  #
1184
1401
  # @yield [response, operation] Access the result along with the RPC operation
@@ -1189,6 +1406,21 @@ module Google
1189
1406
  #
1190
1407
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1191
1408
  #
1409
+ # @example Basic example
1410
+ # require "google/cloud/bigquery/reservation/v1"
1411
+ #
1412
+ # # Create a client object. The client can be reused for multiple calls.
1413
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1414
+ #
1415
+ # # Create a request. To set request fields, pass in keyword arguments.
1416
+ # request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new
1417
+ #
1418
+ # # Call the create_assignment method.
1419
+ # result = client.create_assignment request
1420
+ #
1421
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment.
1422
+ # p result
1423
+ #
1192
1424
  def create_assignment request, options = nil
1193
1425
  raise ::ArgumentError, "request must be provided" if request.nil?
1194
1426
 
@@ -1206,9 +1438,11 @@ module Google
1206
1438
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1207
1439
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1208
1440
 
1209
- header_params = {
1210
- "parent" => request.parent
1211
- }
1441
+ header_params = {}
1442
+ if request.parent
1443
+ header_params["parent"] = request.parent
1444
+ end
1445
+
1212
1446
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1213
1447
  metadata[:"x-goog-request-params"] ||= request_params_header
1214
1448
 
@@ -1287,6 +1521,27 @@ module Google
1287
1521
  #
1288
1522
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1289
1523
  #
1524
+ # @example Basic example
1525
+ # require "google/cloud/bigquery/reservation/v1"
1526
+ #
1527
+ # # Create a client object. The client can be reused for multiple calls.
1528
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1529
+ #
1530
+ # # Create a request. To set request fields, pass in keyword arguments.
1531
+ # request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new
1532
+ #
1533
+ # # Call the list_assignments method.
1534
+ # result = client.list_assignments request
1535
+ #
1536
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1537
+ # # iterate over all elements by calling #each, and the enumerable
1538
+ # # will lazily make API calls to fetch subsequent pages. Other
1539
+ # # methods are also available for managing paging directly.
1540
+ # result.each do |response|
1541
+ # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment.
1542
+ # p response
1543
+ # end
1544
+ #
1290
1545
  def list_assignments request, options = nil
1291
1546
  raise ::ArgumentError, "request must be provided" if request.nil?
1292
1547
 
@@ -1304,9 +1559,11 @@ module Google
1304
1559
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1305
1560
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1306
1561
 
1307
- header_params = {
1308
- "parent" => request.parent
1309
- }
1562
+ header_params = {}
1563
+ if request.parent
1564
+ header_params["parent"] = request.parent
1565
+ end
1566
+
1310
1567
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1311
1568
  metadata[:"x-goog-request-params"] ||= request_params_header
1312
1569
 
@@ -1371,6 +1628,21 @@ module Google
1371
1628
  #
1372
1629
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1373
1630
  #
1631
+ # @example Basic example
1632
+ # require "google/cloud/bigquery/reservation/v1"
1633
+ #
1634
+ # # Create a client object. The client can be reused for multiple calls.
1635
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1636
+ #
1637
+ # # Create a request. To set request fields, pass in keyword arguments.
1638
+ # request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new
1639
+ #
1640
+ # # Call the delete_assignment method.
1641
+ # result = client.delete_assignment request
1642
+ #
1643
+ # # The returned object is of type Google::Protobuf::Empty.
1644
+ # p result
1645
+ #
1374
1646
  def delete_assignment request, options = nil
1375
1647
  raise ::ArgumentError, "request must be provided" if request.nil?
1376
1648
 
@@ -1388,9 +1660,11 @@ module Google
1388
1660
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1389
1661
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1390
1662
 
1391
- header_params = {
1392
- "name" => request.name
1393
- }
1663
+ header_params = {}
1664
+ if request.name
1665
+ header_params["name"] = request.name
1666
+ end
1667
+
1394
1668
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1395
1669
  metadata[:"x-goog-request-params"] ||= request_params_header
1396
1670
 
@@ -1411,8 +1685,8 @@ module Google
1411
1685
  end
1412
1686
 
1413
1687
  ##
1414
- # Deprecated: Looks up assignments for a specified resource for a particular region.
1415
- # If the request is about a project:
1688
+ # Deprecated: Looks up assignments for a specified resource for a particular
1689
+ # region. If the request is about a project:
1416
1690
  #
1417
1691
  # 1. Assignments created on the project will be returned if they exist.
1418
1692
  # 2. Otherwise assignments created on the closest ancestor will be
@@ -1477,6 +1751,27 @@ module Google
1477
1751
  #
1478
1752
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1479
1753
  #
1754
+ # @example Basic example
1755
+ # require "google/cloud/bigquery/reservation/v1"
1756
+ #
1757
+ # # Create a client object. The client can be reused for multiple calls.
1758
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1759
+ #
1760
+ # # Create a request. To set request fields, pass in keyword arguments.
1761
+ # request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new
1762
+ #
1763
+ # # Call the search_assignments method.
1764
+ # result = client.search_assignments request
1765
+ #
1766
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1767
+ # # iterate over all elements by calling #each, and the enumerable
1768
+ # # will lazily make API calls to fetch subsequent pages. Other
1769
+ # # methods are also available for managing paging directly.
1770
+ # result.each do |response|
1771
+ # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment.
1772
+ # p response
1773
+ # end
1774
+ #
1480
1775
  def search_assignments request, options = nil
1481
1776
  raise ::ArgumentError, "request must be provided" if request.nil?
1482
1777
 
@@ -1494,9 +1789,11 @@ module Google
1494
1789
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1495
1790
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1496
1791
 
1497
- header_params = {
1498
- "parent" => request.parent
1499
- }
1792
+ header_params = {}
1793
+ if request.parent
1794
+ header_params["parent"] = request.parent
1795
+ end
1796
+
1500
1797
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1501
1798
  metadata[:"x-goog-request-params"] ||= request_params_header
1502
1799
 
@@ -1579,6 +1876,27 @@ module Google
1579
1876
  #
1580
1877
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1581
1878
  #
1879
+ # @example Basic example
1880
+ # require "google/cloud/bigquery/reservation/v1"
1881
+ #
1882
+ # # Create a client object. The client can be reused for multiple calls.
1883
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1884
+ #
1885
+ # # Create a request. To set request fields, pass in keyword arguments.
1886
+ # request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new
1887
+ #
1888
+ # # Call the search_all_assignments method.
1889
+ # result = client.search_all_assignments request
1890
+ #
1891
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1892
+ # # iterate over all elements by calling #each, and the enumerable
1893
+ # # will lazily make API calls to fetch subsequent pages. Other
1894
+ # # methods are also available for managing paging directly.
1895
+ # result.each do |response|
1896
+ # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment.
1897
+ # p response
1898
+ # end
1899
+ #
1582
1900
  def search_all_assignments request, options = nil
1583
1901
  raise ::ArgumentError, "request must be provided" if request.nil?
1584
1902
 
@@ -1596,9 +1914,11 @@ module Google
1596
1914
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1597
1915
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1598
1916
 
1599
- header_params = {
1600
- "parent" => request.parent
1601
- }
1917
+ header_params = {}
1918
+ if request.parent
1919
+ header_params["parent"] = request.parent
1920
+ end
1921
+
1602
1922
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1603
1923
  metadata[:"x-goog-request-params"] ||= request_params_header
1604
1924
 
@@ -1657,6 +1977,21 @@ module Google
1657
1977
  #
1658
1978
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1659
1979
  #
1980
+ # @example Basic example
1981
+ # require "google/cloud/bigquery/reservation/v1"
1982
+ #
1983
+ # # Create a client object. The client can be reused for multiple calls.
1984
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
1985
+ #
1986
+ # # Create a request. To set request fields, pass in keyword arguments.
1987
+ # request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new
1988
+ #
1989
+ # # Call the move_assignment method.
1990
+ # result = client.move_assignment request
1991
+ #
1992
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment.
1993
+ # p result
1994
+ #
1660
1995
  def move_assignment request, options = nil
1661
1996
  raise ::ArgumentError, "request must be provided" if request.nil?
1662
1997
 
@@ -1674,9 +2009,11 @@ module Google
1674
2009
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1675
2010
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1676
2011
 
1677
- header_params = {
1678
- "name" => request.name
1679
- }
2012
+ header_params = {}
2013
+ if request.name
2014
+ header_params["name"] = request.name
2015
+ end
2016
+
1680
2017
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1681
2018
  metadata[:"x-goog-request-params"] ||= request_params_header
1682
2019
 
@@ -1696,6 +2033,95 @@ module Google
1696
2033
  raise ::Google::Cloud::Error.from_error(e)
1697
2034
  end
1698
2035
 
2036
+ ##
2037
+ # Updates an existing assignment.
2038
+ #
2039
+ # Only the `priority` field can be updated.
2040
+ #
2041
+ # @overload update_assignment(request, options = nil)
2042
+ # Pass arguments to `update_assignment` via a request object, either of type
2043
+ # {::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest} or an equivalent Hash.
2044
+ #
2045
+ # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Hash]
2046
+ # A request object representing the call parameters. Required. To specify no
2047
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2048
+ # @param options [::Gapic::CallOptions, ::Hash]
2049
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2050
+ #
2051
+ # @overload update_assignment(assignment: nil, update_mask: nil)
2052
+ # Pass arguments to `update_assignment` via keyword arguments. Note that at
2053
+ # least one keyword argument is required. To specify no parameters, or to keep all
2054
+ # the default parameter values, pass an empty Hash as a request object (see above).
2055
+ #
2056
+ # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash]
2057
+ # Content of the assignment to update.
2058
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2059
+ # Standard field mask for the set of fields to be updated.
2060
+ #
2061
+ # @yield [response, operation] Access the result along with the RPC operation
2062
+ # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
2063
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2064
+ #
2065
+ # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment]
2066
+ #
2067
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2068
+ #
2069
+ # @example Basic example
2070
+ # require "google/cloud/bigquery/reservation/v1"
2071
+ #
2072
+ # # Create a client object. The client can be reused for multiple calls.
2073
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
2074
+ #
2075
+ # # Create a request. To set request fields, pass in keyword arguments.
2076
+ # request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new
2077
+ #
2078
+ # # Call the update_assignment method.
2079
+ # result = client.update_assignment request
2080
+ #
2081
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment.
2082
+ # p result
2083
+ #
2084
+ def update_assignment request, options = nil
2085
+ raise ::ArgumentError, "request must be provided" if request.nil?
2086
+
2087
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest
2088
+
2089
+ # Converts hash and nil to an options object
2090
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2091
+
2092
+ # Customize the options with defaults
2093
+ metadata = @config.rpcs.update_assignment.metadata.to_h
2094
+
2095
+ # Set x-goog-api-client and x-goog-user-project headers
2096
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2097
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2098
+ gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
2099
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2100
+
2101
+ header_params = {}
2102
+ if request.assignment&.name
2103
+ header_params["assignment.name"] = request.assignment.name
2104
+ end
2105
+
2106
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2107
+ metadata[:"x-goog-request-params"] ||= request_params_header
2108
+
2109
+ options.apply_defaults timeout: @config.rpcs.update_assignment.timeout,
2110
+ metadata: metadata,
2111
+ retry_policy: @config.rpcs.update_assignment.retry_policy
2112
+
2113
+ options.apply_defaults timeout: @config.timeout,
2114
+ metadata: @config.metadata,
2115
+ retry_policy: @config.retry_policy
2116
+
2117
+ @reservation_service_stub.call_rpc :update_assignment, request, options: options do |response, operation|
2118
+ yield response, operation if block_given?
2119
+ return response
2120
+ end
2121
+ rescue ::GRPC::BadStatus => e
2122
+ raise ::Google::Cloud::Error.from_error(e)
2123
+ end
2124
+
1699
2125
  ##
1700
2126
  # Retrieves a BI reservation.
1701
2127
  #
@@ -1726,6 +2152,21 @@ module Google
1726
2152
  #
1727
2153
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1728
2154
  #
2155
+ # @example Basic example
2156
+ # require "google/cloud/bigquery/reservation/v1"
2157
+ #
2158
+ # # Create a client object. The client can be reused for multiple calls.
2159
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
2160
+ #
2161
+ # # Create a request. To set request fields, pass in keyword arguments.
2162
+ # request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new
2163
+ #
2164
+ # # Call the get_bi_reservation method.
2165
+ # result = client.get_bi_reservation request
2166
+ #
2167
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation.
2168
+ # p result
2169
+ #
1729
2170
  def get_bi_reservation request, options = nil
1730
2171
  raise ::ArgumentError, "request must be provided" if request.nil?
1731
2172
 
@@ -1743,9 +2184,11 @@ module Google
1743
2184
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1744
2185
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1745
2186
 
1746
- header_params = {
1747
- "name" => request.name
1748
- }
2187
+ header_params = {}
2188
+ if request.name
2189
+ header_params["name"] = request.name
2190
+ end
2191
+
1749
2192
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1750
2193
  metadata[:"x-goog-request-params"] ||= request_params_header
1751
2194
 
@@ -1803,6 +2246,21 @@ module Google
1803
2246
  #
1804
2247
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1805
2248
  #
2249
+ # @example Basic example
2250
+ # require "google/cloud/bigquery/reservation/v1"
2251
+ #
2252
+ # # Create a client object. The client can be reused for multiple calls.
2253
+ # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new
2254
+ #
2255
+ # # Create a request. To set request fields, pass in keyword arguments.
2256
+ # request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new
2257
+ #
2258
+ # # Call the update_bi_reservation method.
2259
+ # result = client.update_bi_reservation request
2260
+ #
2261
+ # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation.
2262
+ # p result
2263
+ #
1806
2264
  def update_bi_reservation request, options = nil
1807
2265
  raise ::ArgumentError, "request must be provided" if request.nil?
1808
2266
 
@@ -1820,9 +2278,11 @@ module Google
1820
2278
  gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION
1821
2279
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1822
2280
 
1823
- header_params = {
1824
- "bi_reservation.name" => request.bi_reservation.name
1825
- }
2281
+ header_params = {}
2282
+ if request.bi_reservation&.name
2283
+ header_params["bi_reservation.name"] = request.bi_reservation.name
2284
+ end
2285
+
1826
2286
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1827
2287
  metadata[:"x-goog-request-params"] ||= request_params_header
1828
2288
 
@@ -2068,6 +2528,11 @@ module Google
2068
2528
  #
2069
2529
  attr_reader :move_assignment
2070
2530
  ##
2531
+ # RPC-specific configuration for `update_assignment`
2532
+ # @return [::Gapic::Config::Method]
2533
+ #
2534
+ attr_reader :update_assignment
2535
+ ##
2071
2536
  # RPC-specific configuration for `get_bi_reservation`
2072
2537
  # @return [::Gapic::Config::Method]
2073
2538
  #
@@ -2116,6 +2581,8 @@ module Google
2116
2581
  @search_all_assignments = ::Gapic::Config::Method.new search_all_assignments_config
2117
2582
  move_assignment_config = parent_rpcs.move_assignment if parent_rpcs.respond_to? :move_assignment
2118
2583
  @move_assignment = ::Gapic::Config::Method.new move_assignment_config
2584
+ update_assignment_config = parent_rpcs.update_assignment if parent_rpcs.respond_to? :update_assignment
2585
+ @update_assignment = ::Gapic::Config::Method.new update_assignment_config
2119
2586
  get_bi_reservation_config = parent_rpcs.get_bi_reservation if parent_rpcs.respond_to? :get_bi_reservation
2120
2587
  @get_bi_reservation = ::Gapic::Config::Method.new get_bi_reservation_config
2121
2588
  update_bi_reservation_config = parent_rpcs.update_bi_reservation if parent_rpcs.respond_to? :update_bi_reservation