Google Cloud BigQuery C++ Client 2.10.1
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
reservation_client.h
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Generated by the Codegen C++ plugin.
16// If you make any local changes, they will be lost.
17// source: google/cloud/bigquery/reservation/v1/reservation.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_RESERVATION_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_RESERVATION_CLIENT_H
21
22#include "google/cloud/bigquery/reservation/v1/reservation_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/options.h"
25#include "google/cloud/polling_policy.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/version.h"
28#include <memory>
29
30namespace google {
31namespace cloud {
33GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
34
35///
36/// This API allows users to manage their BigQuery reservations.
37///
38/// A reservation provides computational resource guarantees, in the form of
39/// [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
40/// unit of computational power in BigQuery, and serves as the basic unit of
41/// parallelism. In a scan of a multi-partitioned table, a single slot operates
42/// on a single partition of the table. A reservation resource exists as a child
43/// resource of the admin project and location, e.g.:
44/// `projects/myproject/locations/US/reservations/reservationName`.
45///
46/// A capacity commitment is a way to purchase compute capacity for BigQuery
47/// jobs (in the form of slots) with some committed period of usage. A capacity
48/// commitment resource exists as a child resource of the admin project and
49/// location, e.g.:
50/// `projects/myproject/locations/US/capacityCommitments/id`.
51///
52/// @par Equality
53///
54/// Instances of this class created via copy-construction or copy-assignment
55/// always compare equal. Instances created with equal
56/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
57/// equal share the same underlying resources.
58///
59/// @par Performance
60///
61/// Creating a new instance of this class is a relatively expensive operation,
62/// new objects establish new connections to the service. In contrast,
63/// copy-construction, move-construction, and the corresponding assignment
64/// operations are relatively efficient as the copies share all underlying
65/// resources.
66///
67/// @par Thread Safety
68///
69/// Concurrent access to different instances of this class, even if they compare
70/// equal, is guaranteed to work. Two or more threads operating on the same
71/// instance of this class is not guaranteed to work. Since copy-construction
72/// and move-construction is a relatively efficient operation, consider using
73/// such a copy when using this class from multiple threads.
74///
76 public:
78 std::shared_ptr<ReservationServiceConnection> connection,
79 Options opts = {});
81
82 ///@{
83 /// @name Copy and move support
86 default;
89 ///@}
90
91 ///@{
92 /// @name Equality
93 friend bool operator==(ReservationServiceClient const& a,
94 ReservationServiceClient const& b) {
95 return a.connection_ == b.connection_;
96 }
97 friend bool operator!=(ReservationServiceClient const& a,
98 ReservationServiceClient const& b) {
99 return !(a == b);
100 }
101 ///@}
102
103 ///
104 /// Creates a new reservation resource.
105 ///
106 /// @param parent Required. Project, location. E.g.,
107 /// `projects/myproject/locations/US`
108 /// @param reservation Definition of the new reservation to create.
109 /// @param reservation_id The reservation ID. It must only contain lower case
110 /// alphanumeric
111 /// characters or dashes. It must start with a letter and must not end
112 /// with a dash. Its maximum length is 64 characters.
113 /// @param opts Optional. Override the class-level options, such as retry and
114 /// backoff policies.
115 /// @return
116 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
117 ///
118 /// [google.cloud.bigquery.reservation.v1.CreateReservationRequest]:
119 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L617}
120 /// [google.cloud.bigquery.reservation.v1.Reservation]:
121 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
122 ///
123 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
125 std::string const& parent,
126 google::cloud::bigquery::reservation::v1::Reservation const& reservation,
127 std::string const& reservation_id, Options opts = {});
128
129 ///
130 /// Creates a new reservation resource.
131 ///
132 /// @param request
133 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CreateReservationRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L617}
134 /// @param opts Optional. Override the class-level options, such as retry and
135 /// backoff policies.
136 /// @return
137 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
138 ///
139 /// [google.cloud.bigquery.reservation.v1.CreateReservationRequest]:
140 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L617}
141 /// [google.cloud.bigquery.reservation.v1.Reservation]:
142 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
143 ///
144 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
146 google::cloud::bigquery::reservation::v1::CreateReservationRequest const&
147 request,
148 Options opts = {});
149
150 ///
151 /// Lists all the reservations for the project in the specified location.
152 ///
153 /// @param parent Required. The parent resource name containing project and
154 /// location, e.g.:
155 /// `projects/myproject/locations/US`
156 /// @param opts Optional. Override the class-level options, such as retry and
157 /// backoff policies.
158 /// @return
159 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
160 ///
161 /// [google.cloud.bigquery.reservation.v1.ListReservationsRequest]:
162 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L638}
163 /// [google.cloud.bigquery.reservation.v1.Reservation]:
164 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
165 ///
166 StreamRange<google::cloud::bigquery::reservation::v1::Reservation>
167 ListReservations(std::string const& parent, Options opts = {});
168
169 ///
170 /// Lists all the reservations for the project in the specified location.
171 ///
172 /// @param request
173 /// @googleapis_link{google::cloud::bigquery::reservation::v1::ListReservationsRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L638}
174 /// @param opts Optional. Override the class-level options, such as retry and
175 /// backoff policies.
176 /// @return
177 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
178 ///
179 /// [google.cloud.bigquery.reservation.v1.ListReservationsRequest]:
180 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L638}
181 /// [google.cloud.bigquery.reservation.v1.Reservation]:
182 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
183 ///
184 StreamRange<google::cloud::bigquery::reservation::v1::Reservation>
186 google::cloud::bigquery::reservation::v1::ListReservationsRequest request,
187 Options opts = {});
188
189 ///
190 /// Returns information about the reservation.
191 ///
192 /// @param name Required. Resource name of the reservation to retrieve. E.g.,
193 /// `projects/myproject/locations/US/reservations/team1-prod`
194 /// @param opts Optional. Override the class-level options, such as retry and
195 /// backoff policies.
196 /// @return
197 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
198 ///
199 /// [google.cloud.bigquery.reservation.v1.GetReservationRequest]:
200 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L668}
201 /// [google.cloud.bigquery.reservation.v1.Reservation]:
202 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
203 ///
204 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
205 GetReservation(std::string const& name, Options opts = {});
206
207 ///
208 /// Returns information about the reservation.
209 ///
210 /// @param request
211 /// @googleapis_link{google::cloud::bigquery::reservation::v1::GetReservationRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L668}
212 /// @param opts Optional. Override the class-level options, such as retry and
213 /// backoff policies.
214 /// @return
215 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
216 ///
217 /// [google.cloud.bigquery.reservation.v1.GetReservationRequest]:
218 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L668}
219 /// [google.cloud.bigquery.reservation.v1.Reservation]:
220 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
221 ///
222 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
224 google::cloud::bigquery::reservation::v1::GetReservationRequest const&
225 request,
226 Options opts = {});
227
228 ///
229 /// Deletes a reservation.
230 /// Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
231 /// assignments.
232 ///
233 /// @param name Required. Resource name of the reservation to retrieve. E.g.,
234 /// `projects/myproject/locations/US/reservations/team1-prod`
235 /// @param opts Optional. Override the class-level options, such as retry and
236 /// backoff policies.
237 ///
238 /// [google.cloud.bigquery.reservation.v1.DeleteReservationRequest]:
239 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L681}
240 ///
241 Status DeleteReservation(std::string const& name, Options opts = {});
242
243 ///
244 /// Deletes a reservation.
245 /// Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
246 /// assignments.
247 ///
248 /// @param request
249 /// @googleapis_link{google::cloud::bigquery::reservation::v1::DeleteReservationRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L681}
250 /// @param opts Optional. Override the class-level options, such as retry and
251 /// backoff policies.
252 ///
253 /// [google.cloud.bigquery.reservation.v1.DeleteReservationRequest]:
254 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L681}
255 ///
257 google::cloud::bigquery::reservation::v1::DeleteReservationRequest const&
258 request,
259 Options opts = {});
260
261 ///
262 /// Updates an existing reservation resource.
263 ///
264 /// @param reservation Content of the reservation to update.
265 /// @param update_mask Standard field mask for the set of fields to be
266 /// updated.
267 /// @param opts Optional. Override the class-level options, such as retry and
268 /// backoff policies.
269 /// @return
270 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
271 ///
272 /// [google.cloud.bigquery.reservation.v1.Reservation]:
273 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
274 /// [google.cloud.bigquery.reservation.v1.UpdateReservationRequest]:
275 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L694}
276 ///
277 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
279 google::cloud::bigquery::reservation::v1::Reservation const& reservation,
280 google::protobuf::FieldMask const& update_mask, Options opts = {});
281
282 ///
283 /// Updates an existing reservation resource.
284 ///
285 /// @param request
286 /// @googleapis_link{google::cloud::bigquery::reservation::v1::UpdateReservationRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L694}
287 /// @param opts Optional. Override the class-level options, such as retry and
288 /// backoff policies.
289 /// @return
290 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Reservation,google/cloud/bigquery/reservation/v1/reservation.proto#L395}
291 ///
292 /// [google.cloud.bigquery.reservation.v1.Reservation]:
293 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
294 /// [google.cloud.bigquery.reservation.v1.UpdateReservationRequest]:
295 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L694}
296 ///
297 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
299 google::cloud::bigquery::reservation::v1::UpdateReservationRequest const&
300 request,
301 Options opts = {});
302
303 ///
304 /// Creates a new capacity commitment resource.
305 ///
306 /// @param parent Required. Resource name of the parent reservation. E.g.,
307 /// `projects/myproject/locations/US`
308 /// @param capacity_commitment Content of the capacity commitment to create.
309 /// @param opts Optional. Override the class-level options, such as retry and
310 /// backoff policies.
311 /// @return
312 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
313 ///
314 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
315 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
316 /// [google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest]:
317 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L704}
318 ///
319 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
321 std::string const& parent,
322 google::cloud::bigquery::reservation::v1::CapacityCommitment const&
323 capacity_commitment,
324 Options opts = {});
325
326 ///
327 /// Creates a new capacity commitment resource.
328 ///
329 /// @param request
330 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L704}
331 /// @param opts Optional. Override the class-level options, such as retry and
332 /// backoff policies.
333 /// @return
334 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
335 ///
336 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
337 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
338 /// [google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest]:
339 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L704}
340 ///
341 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
342 CreateCapacityCommitment(google::cloud::bigquery::reservation::v1::
343 CreateCapacityCommitmentRequest const& request,
344 Options opts = {});
345
346 ///
347 /// Lists all the capacity commitments for the admin project.
348 ///
349 /// @param parent Required. Resource name of the parent reservation. E.g.,
350 /// `projects/myproject/locations/US`
351 /// @param opts Optional. Override the class-level options, such as retry and
352 /// backoff policies.
353 /// @return
354 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
355 ///
356 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
357 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
358 /// [google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest]:
359 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L731}
360 ///
361 StreamRange<google::cloud::bigquery::reservation::v1::CapacityCommitment>
362 ListCapacityCommitments(std::string const& parent, Options opts = {});
363
364 ///
365 /// Lists all the capacity commitments for the admin project.
366 ///
367 /// @param request
368 /// @googleapis_link{google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L731}
369 /// @param opts Optional. Override the class-level options, such as retry and
370 /// backoff policies.
371 /// @return
372 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
373 ///
374 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
375 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
376 /// [google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest]:
377 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L731}
378 ///
379 StreamRange<google::cloud::bigquery::reservation::v1::CapacityCommitment>
381 google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest
382 request,
383 Options opts = {});
384
385 ///
386 /// Returns information about the capacity commitment.
387 ///
388 /// @param name Required. Resource name of the capacity commitment to
389 /// retrieve. E.g.,
390 /// `projects/myproject/locations/US/capacityCommitments/123`
391 /// @param opts Optional. Override the class-level options, such as retry and
392 /// backoff policies.
393 /// @return
394 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
395 ///
396 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
397 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
398 /// [google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest]:
399 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L761}
400 ///
401 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
402 GetCapacityCommitment(std::string const& name, Options opts = {});
403
404 ///
405 /// Returns information about the capacity commitment.
406 ///
407 /// @param request
408 /// @googleapis_link{google::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L761}
409 /// @param opts Optional. Override the class-level options, such as retry and
410 /// backoff policies.
411 /// @return
412 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
413 ///
414 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
415 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
416 /// [google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest]:
417 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L761}
418 ///
419 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
420 GetCapacityCommitment(google::cloud::bigquery::reservation::v1::
421 GetCapacityCommitmentRequest const& request,
422 Options opts = {});
423
424 ///
425 /// Deletes a capacity commitment. Attempting to delete capacity commitment
426 /// before its commitment_end_time will fail with the error code
427 /// `google.rpc.Code.FAILED_PRECONDITION`.
428 ///
429 /// @param name Required. Resource name of the capacity commitment to delete.
430 /// E.g.,
431 /// `projects/myproject/locations/US/capacityCommitments/123`
432 /// @param opts Optional. Override the class-level options, such as retry and
433 /// backoff policies.
434 ///
435 /// [google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest]:
436 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L774}
437 ///
438 Status DeleteCapacityCommitment(std::string const& name, Options opts = {});
439
440 ///
441 /// Deletes a capacity commitment. Attempting to delete capacity commitment
442 /// before its commitment_end_time will fail with the error code
443 /// `google.rpc.Code.FAILED_PRECONDITION`.
444 ///
445 /// @param request
446 /// @googleapis_link{google::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L774}
447 /// @param opts Optional. Override the class-level options, such as retry and
448 /// backoff policies.
449 ///
450 /// [google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest]:
451 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L774}
452 ///
454 google::cloud::bigquery::reservation::v1::
455 DeleteCapacityCommitmentRequest const& request,
456 Options opts = {});
457
458 ///
459 /// Updates an existing capacity commitment.
460 ///
461 /// Only `plan` and `renewal_plan` fields can be updated.
462 ///
463 /// Plan can only be changed to a plan of a longer commitment period.
464 /// Attempting to change to a plan with shorter commitment period will fail
465 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
466 ///
467 /// @param capacity_commitment Content of the capacity commitment to update.
468 /// @param update_mask Standard field mask for the set of fields to be
469 /// updated.
470 /// @param opts Optional. Override the class-level options, such as retry and
471 /// backoff policies.
472 /// @return
473 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
474 ///
475 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
476 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
477 /// [google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest]:
478 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L792}
479 ///
480 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
482 google::cloud::bigquery::reservation::v1::CapacityCommitment const&
483 capacity_commitment,
484 google::protobuf::FieldMask const& update_mask, Options opts = {});
485
486 ///
487 /// Updates an existing capacity commitment.
488 ///
489 /// Only `plan` and `renewal_plan` fields can be updated.
490 ///
491 /// Plan can only be changed to a plan of a longer commitment period.
492 /// Attempting to change to a plan with shorter commitment period will fail
493 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
494 ///
495 /// @param request
496 /// @googleapis_link{google::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L792}
497 /// @param opts Optional. Override the class-level options, such as retry and
498 /// backoff policies.
499 /// @return
500 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
501 ///
502 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
503 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
504 /// [google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest]:
505 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L792}
506 ///
507 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
508 UpdateCapacityCommitment(google::cloud::bigquery::reservation::v1::
509 UpdateCapacityCommitmentRequest const& request,
510 Options opts = {});
511
512 ///
513 /// Splits capacity commitment to two commitments of the same plan and
514 /// `commitment_end_time`.
515 ///
516 /// A common use case is to enable downgrading commitments.
517 ///
518 /// For example, in order to downgrade from 10000 slots to 8000, you might
519 /// split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
520 /// you delete the first one after the commitment end time passes.
521 ///
522 /// @param name Required. The resource name e.g.,:
523 /// `projects/myproject/locations/US/capacityCommitments/123`
524 /// @param slot_count Number of slots in the capacity commitment after the
525 /// split.
526 /// @param opts Optional. Override the class-level options, such as retry and
527 /// backoff policies.
528 /// @return
529 /// @googleapis_link{google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse,google/cloud/bigquery/reservation/v1/reservation.proto#L818}
530 ///
531 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest]:
532 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L802}
533 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse]:
534 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L818}
535 ///
536 StatusOr<
537 google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse>
538 SplitCapacityCommitment(std::string const& name, std::int64_t slot_count,
539 Options opts = {});
540
541 ///
542 /// Splits capacity commitment to two commitments of the same plan and
543 /// `commitment_end_time`.
544 ///
545 /// A common use case is to enable downgrading commitments.
546 ///
547 /// For example, in order to downgrade from 10000 slots to 8000, you might
548 /// split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
549 /// you delete the first one after the commitment end time passes.
550 ///
551 /// @param request
552 /// @googleapis_link{google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L802}
553 /// @param opts Optional. Override the class-level options, such as retry and
554 /// backoff policies.
555 /// @return
556 /// @googleapis_link{google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse,google/cloud/bigquery/reservation/v1/reservation.proto#L818}
557 ///
558 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest]:
559 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L802}
560 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse]:
561 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L818}
562 ///
563 StatusOr<
564 google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse>
565 SplitCapacityCommitment(google::cloud::bigquery::reservation::v1::
566 SplitCapacityCommitmentRequest const& request,
567 Options opts = {});
568
569 ///
570 /// Merges capacity commitments of the same plan into a single commitment.
571 ///
572 /// The resulting capacity commitment has the greater commitment_end_time
573 /// out of the to-be-merged capacity commitments.
574 ///
575 /// Attempting to merge capacity commitments of different plan will fail
576 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
577 ///
578 /// @param parent Parent resource that identifies admin project and location
579 /// e.g.,
580 /// `projects/myproject/locations/us`
581 /// @param capacity_commitment_ids Ids of capacity commitments to merge.
582 /// These capacity commitments must exist under admin project and location
583 /// specified in the parent.
584 /// ID is the last portion of capacity commitment name e.g., 'abc' for
585 /// projects/myproject/locations/US/capacityCommitments/abc
586 /// @param opts Optional. Override the class-level options, such as retry and
587 /// backoff policies.
588 /// @return
589 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
590 ///
591 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
592 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
593 /// [google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest]:
594 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L828}
595 ///
596 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
598 std::string const& parent,
599 std::vector<std::string> const& capacity_commitment_ids,
600 Options opts = {});
601
602 ///
603 /// Merges capacity commitments of the same plan into a single commitment.
604 ///
605 /// The resulting capacity commitment has the greater commitment_end_time
606 /// out of the to-be-merged capacity commitments.
607 ///
608 /// Attempting to merge capacity commitments of different plan will fail
609 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
610 ///
611 /// @param request
612 /// @googleapis_link{google::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L828}
613 /// @param opts Optional. Override the class-level options, such as retry and
614 /// backoff policies.
615 /// @return
616 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CapacityCommitment,google/cloud/bigquery/reservation/v1/reservation.proto#L487}
617 ///
618 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]:
619 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
620 /// [google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest]:
621 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L828}
622 ///
623 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
624 MergeCapacityCommitments(google::cloud::bigquery::reservation::v1::
625 MergeCapacityCommitmentsRequest const& request,
626 Options opts = {});
627
628 ///
629 /// Creates an assignment object which allows the given project to submit jobs
630 /// of a certain type using slots from the specified reservation.
631 ///
632 /// Currently a
633 /// resource (project, folder, organization) can only have one assignment per
634 /// each (job_type, location) combination, and that reservation will be used
635 /// for all jobs of the matching type.
636 ///
637 /// Different assignments can be created on different levels of the
638 /// projects, folders or organization hierarchy. During query execution,
639 /// the assignment is looked up at the project, folder and organization levels
640 /// in that order. The first assignment found is applied to the query.
641 ///
642 /// When creating assignments, it does not matter if other assignments exist
643 /// at higher levels.
644 ///
645 /// Example:
646 ///
647 /// * The organization `organizationA` contains two projects, `project1`
648 /// and `project2`.
649 /// * Assignments for all three entities (`organizationA`, `project1`, and
650 /// `project2`) could all be created and mapped to the same or different
651 /// reservations.
652 ///
653 /// "None" assignments represent an absence of the assignment. Projects
654 /// assigned to None use on-demand pricing. To create a "None" assignment, use
655 /// "none" as a reservation_id in the parent. Example parent:
656 /// `projects/myproject/locations/US/reservations/none`.
657 ///
658 /// Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
659 /// 'bigquery.admin' permissions on the project using the reservation
660 /// and the project that owns this reservation.
661 ///
662 /// Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
663 /// does not match location of the reservation.
664 ///
665 /// @param parent Required. The parent resource name of the assignment
666 /// E.g. `projects/myproject/locations/US/reservations/team1-prod`
667 /// @param assignment Assignment resource to create.
668 /// @param opts Optional. Override the class-level options, such as retry and
669 /// backoff policies.
670 /// @return
671 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
672 ///
673 /// [google.cloud.bigquery.reservation.v1.Assignment]:
674 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
675 /// [google.cloud.bigquery.reservation.v1.CreateAssignmentRequest]:
676 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L907}
677 ///
678 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
680 std::string const& parent,
681 google::cloud::bigquery::reservation::v1::Assignment const& assignment,
682 Options opts = {});
683
684 ///
685 /// Creates an assignment object which allows the given project to submit jobs
686 /// of a certain type using slots from the specified reservation.
687 ///
688 /// Currently a
689 /// resource (project, folder, organization) can only have one assignment per
690 /// each (job_type, location) combination, and that reservation will be used
691 /// for all jobs of the matching type.
692 ///
693 /// Different assignments can be created on different levels of the
694 /// projects, folders or organization hierarchy. During query execution,
695 /// the assignment is looked up at the project, folder and organization levels
696 /// in that order. The first assignment found is applied to the query.
697 ///
698 /// When creating assignments, it does not matter if other assignments exist
699 /// at higher levels.
700 ///
701 /// Example:
702 ///
703 /// * The organization `organizationA` contains two projects, `project1`
704 /// and `project2`.
705 /// * Assignments for all three entities (`organizationA`, `project1`, and
706 /// `project2`) could all be created and mapped to the same or different
707 /// reservations.
708 ///
709 /// "None" assignments represent an absence of the assignment. Projects
710 /// assigned to None use on-demand pricing. To create a "None" assignment, use
711 /// "none" as a reservation_id in the parent. Example parent:
712 /// `projects/myproject/locations/US/reservations/none`.
713 ///
714 /// Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
715 /// 'bigquery.admin' permissions on the project using the reservation
716 /// and the project that owns this reservation.
717 ///
718 /// Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
719 /// does not match location of the reservation.
720 ///
721 /// @param request
722 /// @googleapis_link{google::cloud::bigquery::reservation::v1::CreateAssignmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L907}
723 /// @param opts Optional. Override the class-level options, such as retry and
724 /// backoff policies.
725 /// @return
726 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
727 ///
728 /// [google.cloud.bigquery.reservation.v1.Assignment]:
729 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
730 /// [google.cloud.bigquery.reservation.v1.CreateAssignmentRequest]:
731 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L907}
732 ///
733 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
735 google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const&
736 request,
737 Options opts = {});
738
739 ///
740 /// Lists assignments.
741 ///
742 /// Only explicitly created assignments will be returned.
743 ///
744 /// Example:
745 ///
746 /// * Organization `organizationA` contains two projects, `project1` and
747 /// `project2`.
748 /// * Reservation `res1` exists and was created previously.
749 /// * CreateAssignment was used previously to define the following
750 /// associations between entities and reservations: `<organizationA, res1>`
751 /// and `<project1, res1>`
752 ///
753 /// In this example, ListAssignments will just return the above two
754 /// assignments for reservation `res1`, and no expansion/merge will happen.
755 ///
756 /// The wildcard "-" can be used for
757 /// reservations in the request. In that case all assignments belongs to the
758 /// specified project and location will be listed.
759 ///
760 /// **Note** "-" cannot be used for projects nor locations.
761 ///
762 /// @param parent Required. The parent resource name e.g.:
763 /// `projects/myproject/locations/US/reservations/team1-prod`
764 /// Or:
765 /// `projects/myproject/locations/US/reservations/-`
766 /// @param opts Optional. Override the class-level options, such as retry and
767 /// backoff policies.
768 /// @return
769 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
770 ///
771 /// [google.cloud.bigquery.reservation.v1.Assignment]:
772 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
773 /// [google.cloud.bigquery.reservation.v1.ListAssignmentsRequest]:
774 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L929}
775 ///
776 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
777 ListAssignments(std::string const& parent, Options opts = {});
778
779 ///
780 /// Lists assignments.
781 ///
782 /// Only explicitly created assignments will be returned.
783 ///
784 /// Example:
785 ///
786 /// * Organization `organizationA` contains two projects, `project1` and
787 /// `project2`.
788 /// * Reservation `res1` exists and was created previously.
789 /// * CreateAssignment was used previously to define the following
790 /// associations between entities and reservations: `<organizationA, res1>`
791 /// and `<project1, res1>`
792 ///
793 /// In this example, ListAssignments will just return the above two
794 /// assignments for reservation `res1`, and no expansion/merge will happen.
795 ///
796 /// The wildcard "-" can be used for
797 /// reservations in the request. In that case all assignments belongs to the
798 /// specified project and location will be listed.
799 ///
800 /// **Note** "-" cannot be used for projects nor locations.
801 ///
802 /// @param request
803 /// @googleapis_link{google::cloud::bigquery::reservation::v1::ListAssignmentsRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L929}
804 /// @param opts Optional. Override the class-level options, such as retry and
805 /// backoff policies.
806 /// @return
807 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
808 ///
809 /// [google.cloud.bigquery.reservation.v1.Assignment]:
810 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
811 /// [google.cloud.bigquery.reservation.v1.ListAssignmentsRequest]:
812 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L929}
813 ///
814 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
816 google::cloud::bigquery::reservation::v1::ListAssignmentsRequest request,
817 Options opts = {});
818
819 ///
820 /// Deletes a assignment. No expansion will happen.
821 ///
822 /// Example:
823 ///
824 /// * Organization `organizationA` contains two projects, `project1` and
825 /// `project2`.
826 /// * Reservation `res1` exists and was created previously.
827 /// * CreateAssignment was used previously to define the following
828 /// associations between entities and reservations: `<organizationA, res1>`
829 /// and `<project1, res1>`
830 ///
831 /// In this example, deletion of the `<organizationA, res1>` assignment won't
832 /// affect the other assignment `<project1, res1>`. After said deletion,
833 /// queries from `project1` will still use `res1` while queries from
834 /// `project2` will switch to use on-demand mode.
835 ///
836 /// @param name Required. Name of the resource, e.g.
837 /// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
838 /// @param opts Optional. Override the class-level options, such as retry and
839 /// backoff policies.
840 ///
841 /// [google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest]:
842 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L966}
843 ///
844 Status DeleteAssignment(std::string const& name, Options opts = {});
845
846 ///
847 /// Deletes a assignment. No expansion will happen.
848 ///
849 /// Example:
850 ///
851 /// * Organization `organizationA` contains two projects, `project1` and
852 /// `project2`.
853 /// * Reservation `res1` exists and was created previously.
854 /// * CreateAssignment was used previously to define the following
855 /// associations between entities and reservations: `<organizationA, res1>`
856 /// and `<project1, res1>`
857 ///
858 /// In this example, deletion of the `<organizationA, res1>` assignment won't
859 /// affect the other assignment `<project1, res1>`. After said deletion,
860 /// queries from `project1` will still use `res1` while queries from
861 /// `project2` will switch to use on-demand mode.
862 ///
863 /// @param request
864 /// @googleapis_link{google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L966}
865 /// @param opts Optional. Override the class-level options, such as retry and
866 /// backoff policies.
867 ///
868 /// [google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest]:
869 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L966}
870 ///
872 google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const&
873 request,
874 Options opts = {});
875
876 ///
877 /// Deprecated: Looks up assignments for a specified resource for a particular
878 /// region. If the request is about a project:
879 ///
880 /// 1. Assignments created on the project will be returned if they exist.
881 /// 2. Otherwise assignments created on the closest ancestor will be
882 /// returned.
883 /// 3. Assignments for different JobTypes will all be returned.
884 ///
885 /// The same logic applies if the request is about a folder.
886 ///
887 /// If the request is about an organization, then assignments created on the
888 /// organization will be returned (organization doesn't have ancestors).
889 ///
890 /// Comparing to ListAssignments, there are some behavior
891 /// differences:
892 ///
893 /// 1. permission on the assignee will be verified in this API.
894 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
895 /// 3. Parent here is `projects/*/locations/*`, instead of
896 /// `projects/*/locations/*reservations/*`.
897 ///
898 /// **Note** "-" cannot be used for projects
899 /// nor locations.
900 ///
901 /// @param parent Required. The resource name of the admin project(containing
902 /// project and
903 /// location), e.g.:
904 /// `projects/myproject/locations/US`.
905 /// @param query Please specify resource name as assignee in the query.
906 /// Examples:
907 /// * `assignee=projects/myproject`
908 /// * `assignee=folders/123`
909 /// * `assignee=organizations/456`
910 /// @param opts Optional. Override the class-level options, such as retry and
911 /// backoff policies.
912 /// @return
913 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
914 ///
915 /// [google.cloud.bigquery.reservation.v1.Assignment]:
916 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
917 /// [google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest]:
918 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L981}
919 ///
920 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
921 SearchAssignments(std::string const& parent, std::string const& query,
922 Options opts = {});
923
924 ///
925 /// Deprecated: Looks up assignments for a specified resource for a particular
926 /// region. If the request is about a project:
927 ///
928 /// 1. Assignments created on the project will be returned if they exist.
929 /// 2. Otherwise assignments created on the closest ancestor will be
930 /// returned.
931 /// 3. Assignments for different JobTypes will all be returned.
932 ///
933 /// The same logic applies if the request is about a folder.
934 ///
935 /// If the request is about an organization, then assignments created on the
936 /// organization will be returned (organization doesn't have ancestors).
937 ///
938 /// Comparing to ListAssignments, there are some behavior
939 /// differences:
940 ///
941 /// 1. permission on the assignee will be verified in this API.
942 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
943 /// 3. Parent here is `projects/*/locations/*`, instead of
944 /// `projects/*/locations/*reservations/*`.
945 ///
946 /// **Note** "-" cannot be used for projects
947 /// nor locations.
948 ///
949 /// @param request
950 /// @googleapis_link{google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L981}
951 /// @param opts Optional. Override the class-level options, such as retry and
952 /// backoff policies.
953 /// @return
954 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
955 ///
956 /// [google.cloud.bigquery.reservation.v1.Assignment]:
957 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
958 /// [google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest]:
959 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L981}
960 ///
961 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
963 google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest
964 request,
965 Options opts = {});
966
967 ///
968 /// Looks up assignments for a specified resource for a particular region.
969 /// If the request is about a project:
970 ///
971 /// 1. Assignments created on the project will be returned if they exist.
972 /// 2. Otherwise assignments created on the closest ancestor will be
973 /// returned.
974 /// 3. Assignments for different JobTypes will all be returned.
975 ///
976 /// The same logic applies if the request is about a folder.
977 ///
978 /// If the request is about an organization, then assignments created on the
979 /// organization will be returned (organization doesn't have ancestors).
980 ///
981 /// Comparing to ListAssignments, there are some behavior
982 /// differences:
983 ///
984 /// 1. permission on the assignee will be verified in this API.
985 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
986 /// 3. Parent here is `projects/*/locations/*`, instead of
987 /// `projects/*/locations/*reservations/*`.
988 ///
989 /// @param parent Required. The resource name with location (project name
990 /// could be the
991 /// wildcard '-'), e.g.:
992 /// `projects/-/locations/US`.
993 /// @param query Please specify resource name as assignee in the query.
994 /// Examples:
995 /// * `assignee=projects/myproject`
996 /// * `assignee=folders/123`
997 /// * `assignee=organizations/456`
998 /// @param opts Optional. Override the class-level options, such as retry and
999 /// backoff policies.
1000 /// @return
1001 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1002 ///
1003 /// [google.cloud.bigquery.reservation.v1.Assignment]:
1004 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1005 /// [google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest]:
1006 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1012}
1007 ///
1008 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1009 SearchAllAssignments(std::string const& parent, std::string const& query,
1010 Options opts = {});
1011
1012 ///
1013 /// Looks up assignments for a specified resource for a particular region.
1014 /// If the request is about a project:
1015 ///
1016 /// 1. Assignments created on the project will be returned if they exist.
1017 /// 2. Otherwise assignments created on the closest ancestor will be
1018 /// returned.
1019 /// 3. Assignments for different JobTypes will all be returned.
1020 ///
1021 /// The same logic applies if the request is about a folder.
1022 ///
1023 /// If the request is about an organization, then assignments created on the
1024 /// organization will be returned (organization doesn't have ancestors).
1025 ///
1026 /// Comparing to ListAssignments, there are some behavior
1027 /// differences:
1028 ///
1029 /// 1. permission on the assignee will be verified in this API.
1030 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
1031 /// 3. Parent here is `projects/*/locations/*`, instead of
1032 /// `projects/*/locations/*reservations/*`.
1033 ///
1034 /// @param request
1035 /// @googleapis_link{google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L1012}
1036 /// @param opts Optional. Override the class-level options, such as retry and
1037 /// backoff policies.
1038 /// @return
1039 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1040 ///
1041 /// [google.cloud.bigquery.reservation.v1.Assignment]:
1042 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1043 /// [google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest]:
1044 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1012}
1045 ///
1046 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1048 google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest
1049 request,
1050 Options opts = {});
1051
1052 ///
1053 /// Moves an assignment under a new reservation.
1054 ///
1055 /// This differs from removing an existing assignment and recreating a new one
1056 /// by providing a transactional change that ensures an assignee always has an
1057 /// associated reservation.
1058 ///
1059 /// @param name Required. The resource name of the assignment,
1060 /// e.g.
1061 /// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
1062 /// @param destination_id The new reservation ID, e.g.:
1063 /// `projects/myotherproject/locations/US/reservations/team2-prod`
1064 /// @param opts Optional. Override the class-level options, such as retry and
1065 /// backoff policies.
1066 /// @return
1067 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1068 ///
1069 /// [google.cloud.bigquery.reservation.v1.Assignment]:
1070 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1071 /// [google.cloud.bigquery.reservation.v1.MoveAssignmentRequest]:
1072 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1070}
1073 ///
1074 StatusOr<google::cloud::bigquery::reservation::v1::Assignment> MoveAssignment(
1075 std::string const& name, std::string const& destination_id,
1076 Options opts = {});
1077
1078 ///
1079 /// Moves an assignment under a new reservation.
1080 ///
1081 /// This differs from removing an existing assignment and recreating a new one
1082 /// by providing a transactional change that ensures an assignee always has an
1083 /// associated reservation.
1084 ///
1085 /// @param request
1086 /// @googleapis_link{google::cloud::bigquery::reservation::v1::MoveAssignmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L1070}
1087 /// @param opts Optional. Override the class-level options, such as retry and
1088 /// backoff policies.
1089 /// @return
1090 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1091 ///
1092 /// [google.cloud.bigquery.reservation.v1.Assignment]:
1093 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1094 /// [google.cloud.bigquery.reservation.v1.MoveAssignmentRequest]:
1095 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1070}
1096 ///
1097 StatusOr<google::cloud::bigquery::reservation::v1::Assignment> MoveAssignment(
1098 google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const&
1099 request,
1100 Options opts = {});
1101
1102 ///
1103 /// Updates an existing assignment.
1104 ///
1105 /// Only the `priority` field can be updated.
1106 ///
1107 /// @param assignment Content of the assignment to update.
1108 /// @param update_mask Standard field mask for the set of fields to be
1109 /// updated.
1110 /// @param opts Optional. Override the class-level options, such as retry and
1111 /// backoff policies.
1112 /// @return
1113 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1114 ///
1115 /// [google.cloud.bigquery.reservation.v1.Assignment]:
1116 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1117 /// [google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest]:
1118 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1097}
1119 ///
1120 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
1122 google::cloud::bigquery::reservation::v1::Assignment const& assignment,
1123 google::protobuf::FieldMask const& update_mask, Options opts = {});
1124
1125 ///
1126 /// Updates an existing assignment.
1127 ///
1128 /// Only the `priority` field can be updated.
1129 ///
1130 /// @param request
1131 /// @googleapis_link{google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L1097}
1132 /// @param opts Optional. Override the class-level options, such as retry and
1133 /// backoff policies.
1134 /// @return
1135 /// @googleapis_link{google::cloud::bigquery::reservation::v1::Assignment,google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1136 ///
1137 /// [google.cloud.bigquery.reservation.v1.Assignment]:
1138 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1139 /// [google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest]:
1140 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1097}
1141 ///
1142 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
1144 google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const&
1145 request,
1146 Options opts = {});
1147
1148 ///
1149 /// Retrieves a BI reservation.
1150 ///
1151 /// @param name Required. Name of the requested reservation, for example:
1152 /// `projects/{project_id}/locations/{location_id}/biReservation`
1153 /// @param opts Optional. Override the class-level options, such as retry and
1154 /// backoff policies.
1155 /// @return
1156 /// @googleapis_link{google::cloud::bigquery::reservation::v1::BiReservation,google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1157 ///
1158 /// [google.cloud.bigquery.reservation.v1.BiReservation]:
1159 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1160 /// [google.cloud.bigquery.reservation.v1.GetBiReservationRequest]:
1161 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1142}
1162 ///
1163 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1164 GetBiReservation(std::string const& name, Options opts = {});
1165
1166 ///
1167 /// Retrieves a BI reservation.
1168 ///
1169 /// @param request
1170 /// @googleapis_link{google::cloud::bigquery::reservation::v1::GetBiReservationRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L1142}
1171 /// @param opts Optional. Override the class-level options, such as retry and
1172 /// backoff policies.
1173 /// @return
1174 /// @googleapis_link{google::cloud::bigquery::reservation::v1::BiReservation,google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1175 ///
1176 /// [google.cloud.bigquery.reservation.v1.BiReservation]:
1177 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1178 /// [google.cloud.bigquery.reservation.v1.GetBiReservationRequest]:
1179 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1142}
1180 ///
1181 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1183 google::cloud::bigquery::reservation::v1::GetBiReservationRequest const&
1184 request,
1185 Options opts = {});
1186
1187 ///
1188 /// Updates a BI reservation.
1189 ///
1190 /// Only fields specified in the `field_mask` are updated.
1191 ///
1192 /// A singleton BI reservation always exists with default size 0.
1193 /// In order to reserve BI capacity it needs to be updated to an amount
1194 /// greater than 0. In order to release BI capacity reservation size
1195 /// must be set to 0.
1196 ///
1197 /// @param bi_reservation A reservation to update.
1198 /// @param update_mask A list of fields to be updated in this request.
1199 /// @param opts Optional. Override the class-level options, such as retry and
1200 /// backoff policies.
1201 /// @return
1202 /// @googleapis_link{google::cloud::bigquery::reservation::v1::BiReservation,google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1203 ///
1204 /// [google.cloud.bigquery.reservation.v1.BiReservation]:
1205 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1206 /// [google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest]:
1207 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1154}
1208 ///
1209 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1211 google::cloud::bigquery::reservation::v1::BiReservation const&
1212 bi_reservation,
1213 google::protobuf::FieldMask const& update_mask, Options opts = {});
1214
1215 ///
1216 /// Updates a BI reservation.
1217 ///
1218 /// Only fields specified in the `field_mask` are updated.
1219 ///
1220 /// A singleton BI reservation always exists with default size 0.
1221 /// In order to reserve BI capacity it needs to be updated to an amount
1222 /// greater than 0. In order to release BI capacity reservation size
1223 /// must be set to 0.
1224 ///
1225 /// @param request
1226 /// @googleapis_link{google::cloud::bigquery::reservation::v1::UpdateBiReservationRequest,google/cloud/bigquery/reservation/v1/reservation.proto#L1154}
1227 /// @param opts Optional. Override the class-level options, such as retry and
1228 /// backoff policies.
1229 /// @return
1230 /// @googleapis_link{google::cloud::bigquery::reservation::v1::BiReservation,google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1231 ///
1232 /// [google.cloud.bigquery.reservation.v1.BiReservation]:
1233 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1234 /// [google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest]:
1235 /// @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1154}
1236 ///
1237 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1238 UpdateBiReservation(google::cloud::bigquery::reservation::v1::
1239 UpdateBiReservationRequest const& request,
1240 Options opts = {});
1241
1242 private:
1243 std::shared_ptr<ReservationServiceConnection> connection_;
1244 Options options_;
1245};
1246
1247GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1248} // namespace bigquery_reservation_v1
1249} // namespace cloud
1250} // namespace google
1251
1252#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_V1_RESERVATION_CLIENT_H
This API allows users to manage their BigQuery reservations.
Definition: reservation_client.h:75
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > ListAssignments(google::cloud::bigquery::reservation::v1::ListAssignmentsRequest request, Options opts={})
Lists assignments.
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > GetReservation(std::string const &name, Options opts={})
Returns information about the reservation.
ReservationServiceClient(ReservationServiceClient const &)=default
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAllAssignments(std::string const &parent, std::string const &query, Options opts={})
Looks up assignments for a specified resource for a particular region.
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > CreateAssignment(google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const &request, Options opts={})
Creates an assignment object which allows the given project to submit jobs of a certain type using sl...
ReservationServiceClient(ReservationServiceClient &&)=default
StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse > SplitCapacityCommitment(std::string const &name, std::int64_t slot_count, Options opts={})
Splits capacity commitment to two commitments of the same plan and commitment_end_time.
Status DeleteCapacityCommitment(google::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest const &request, Options opts={})
Deletes a capacity commitment.
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > GetBiReservation(google::cloud::bigquery::reservation::v1::GetBiReservationRequest const &request, Options opts={})
Retrieves a BI reservation.
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAllAssignments(google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest request, Options opts={})
Looks up assignments for a specified resource for a particular region.
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > UpdateAssignment(google::cloud::bigquery::reservation::v1::Assignment const &assignment, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates an existing assignment.
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAssignments(google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest request, Options opts={})
Deprecated: Looks up assignments for a specified resource for a particular region.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > UpdateCapacityCommitment(google::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest const &request, Options opts={})
Updates an existing capacity commitment.
Status DeleteReservation(google::cloud::bigquery::reservation::v1::DeleteReservationRequest const &request, Options opts={})
Deletes a reservation.
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > CreateReservation(std::string const &parent, google::cloud::bigquery::reservation::v1::Reservation const &reservation, std::string const &reservation_id, Options opts={})
Creates a new reservation resource.
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > UpdateBiReservation(google::cloud::bigquery::reservation::v1::BiReservation const &bi_reservation, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates a BI reservation.
ReservationServiceClient & operator=(ReservationServiceClient const &)=default
ReservationServiceClient & operator=(ReservationServiceClient &&)=default
StreamRange< google::cloud::bigquery::reservation::v1::CapacityCommitment > ListCapacityCommitments(google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest request, Options opts={})
Lists all the capacity commitments for the admin project.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > GetCapacityCommitment(google::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest const &request, Options opts={})
Returns information about the capacity commitment.
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > UpdateAssignment(google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const &request, Options opts={})
Updates an existing assignment.
Status DeleteAssignment(google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const &request, Options opts={})
Deletes a assignment.
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > GetBiReservation(std::string const &name, Options opts={})
Retrieves a BI reservation.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > GetCapacityCommitment(std::string const &name, Options opts={})
Returns information about the capacity commitment.
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > UpdateReservation(google::cloud::bigquery::reservation::v1::UpdateReservationRequest const &request, Options opts={})
Updates an existing reservation resource.
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > UpdateBiReservation(google::cloud::bigquery::reservation::v1::UpdateBiReservationRequest const &request, Options opts={})
Updates a BI reservation.
Status DeleteReservation(std::string const &name, Options opts={})
Deletes a reservation.
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > MoveAssignment(std::string const &name, std::string const &destination_id, Options opts={})
Moves an assignment under a new reservation.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > CreateCapacityCommitment(google::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest const &request, Options opts={})
Creates a new capacity commitment resource.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > MergeCapacityCommitments(google::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest const &request, Options opts={})
Merges capacity commitments of the same plan into a single commitment.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > CreateCapacityCommitment(std::string const &parent, google::cloud::bigquery::reservation::v1::CapacityCommitment const &capacity_commitment, Options opts={})
Creates a new capacity commitment resource.
Status DeleteAssignment(std::string const &name, Options opts={})
Deletes a assignment.
Status DeleteCapacityCommitment(std::string const &name, Options opts={})
Deletes a capacity commitment.
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > CreateReservation(google::cloud::bigquery::reservation::v1::CreateReservationRequest const &request, Options opts={})
Creates a new reservation resource.
StreamRange< google::cloud::bigquery::reservation::v1::Reservation > ListReservations(google::cloud::bigquery::reservation::v1::ListReservationsRequest request, Options opts={})
Lists all the reservations for the project in the specified location.
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > GetReservation(google::cloud::bigquery::reservation::v1::GetReservationRequest const &request, Options opts={})
Returns information about the reservation.
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > ListAssignments(std::string const &parent, Options opts={})
Lists assignments.
StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse > SplitCapacityCommitment(google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest const &request, Options opts={})
Splits capacity commitment to two commitments of the same plan and commitment_end_time.
friend bool operator!=(ReservationServiceClient const &a, ReservationServiceClient const &b)
Definition: reservation_client.h:97
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > MergeCapacityCommitments(std::string const &parent, std::vector< std::string > const &capacity_commitment_ids, Options opts={})
Merges capacity commitments of the same plan into a single commitment.
StreamRange< google::cloud::bigquery::reservation::v1::CapacityCommitment > ListCapacityCommitments(std::string const &parent, Options opts={})
Lists all the capacity commitments for the admin project.
friend bool operator==(ReservationServiceClient const &a, ReservationServiceClient const &b)
Definition: reservation_client.h:93
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAssignments(std::string const &parent, std::string const &query, Options opts={})
Deprecated: Looks up assignments for a specified resource for a particular region.
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > UpdateReservation(google::cloud::bigquery::reservation::v1::Reservation const &reservation, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates an existing reservation resource.
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > UpdateCapacityCommitment(google::cloud::bigquery::reservation::v1::CapacityCommitment const &capacity_commitment, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates an existing capacity commitment.
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > CreateAssignment(std::string const &parent, google::cloud::bigquery::reservation::v1::Assignment const &assignment, Options opts={})
Creates an assignment object which allows the given project to submit jobs of a certain type using sl...
StreamRange< google::cloud::bigquery::reservation::v1::Reservation > ListReservations(std::string const &parent, Options opts={})
Lists all the reservations for the project in the specified location.
ReservationServiceClient(std::shared_ptr< ReservationServiceConnection > connection, Options opts={})
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > MoveAssignment(google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const &request, Options opts={})
Moves an assignment under a new reservation.
The ReservationServiceConnection object for ReservationServiceClient.
Definition: reservation_connection.h:62
Definition: reservation_client.h:32
Definition: analytics_hub_client.h:30