Google Cloud BigQuery C++ Client 2.11.0
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 // clang-format off
104 ///
105 /// Creates a new reservation resource.
106 ///
107 /// @param parent Required. Project, location. E.g.,
108 /// `projects/myproject/locations/US`
109 /// @param reservation Definition of the new reservation to create.
110 /// @param reservation_id The reservation ID. It must only contain lower case 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 the result of the RPC. The response message type
116 /// ([google.cloud.bigquery.reservation.v1.Reservation])
117 /// is mapped to a C++ class using the [Protobuf mapping rules].
118 /// If the request fails, the [`StatusOr`] contains the error details.
119 ///
120 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
121 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
122 /// [Long Running Operation]: https://google.aip.dev/151
123 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
124 /// [`future`]: @ref google::cloud::future
125 /// [`StatusOr`]: @ref google::cloud::StatusOr
126 /// [`Status`]: @ref google::cloud::Status
127 /// [google.cloud.bigquery.reservation.v1.CreateReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L617}
128 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
129 ///
130 // clang-format on
131 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
133 std::string const& parent,
134 google::cloud::bigquery::reservation::v1::Reservation const& reservation,
135 std::string const& reservation_id, Options opts = {});
136
137 // clang-format off
138 ///
139 /// Creates a new reservation resource.
140 ///
141 /// @param request Unary RPCs, such as the one wrapped by this
142 /// function, receive a single `request` proto message which includes all
143 /// the inputs for the RPC. In this case, the proto message is a
144 /// [google.cloud.bigquery.reservation.v1.CreateReservationRequest].
145 /// Proto messages are converted to C++ classes by Protobuf, using the
146 /// [Protobuf mapping rules].
147 /// @param opts Optional. Override the class-level options, such as retry and
148 /// backoff policies.
149 /// @return the result of the RPC. The response message type
150 /// ([google.cloud.bigquery.reservation.v1.Reservation])
151 /// is mapped to a C++ class using the [Protobuf mapping rules].
152 /// If the request fails, the [`StatusOr`] contains the error details.
153 ///
154 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
155 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
156 /// [Long Running Operation]: https://google.aip.dev/151
157 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
158 /// [`future`]: @ref google::cloud::future
159 /// [`StatusOr`]: @ref google::cloud::StatusOr
160 /// [`Status`]: @ref google::cloud::Status
161 /// [google.cloud.bigquery.reservation.v1.CreateReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L617}
162 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
163 ///
164 // clang-format on
165 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
167 google::cloud::bigquery::reservation::v1::CreateReservationRequest const&
168 request,
169 Options opts = {});
170
171 // clang-format off
172 ///
173 /// Lists all the reservations for the project in the specified location.
174 ///
175 /// @param parent Required. The parent resource name containing project and location, e.g.:
176 /// `projects/myproject/locations/US`
177 /// @param opts Optional. Override the class-level options, such as retry and
178 /// backoff policies.
179 /// @return a [StreamRange](@ref google::cloud::StreamRange)
180 /// to iterate of the results. See the documentation of this type for
181 /// details. In brief, this class has `begin()` and `end()` member
182 /// functions returning a iterator class meeting the
183 /// [input iterator requirements]. The value type for this iterator is a
184 /// [`StatusOr`] as the iteration may fail even after some values are
185 /// retrieved successfully, for example, if there is a network disconnect.
186 /// An empty set of results does not indicate an error, it indicates
187 /// that there are no resources meeting the request criteria.
188 /// On a successful iteration the `StatusOr<T>` contains elements of type
189 /// [google.cloud.bigquery.reservation.v1.Reservation], or rather,
190 /// the C++ class generated by Protobuf from that type. Please consult the
191 /// Protobuf documentation for details on the [Protobuf mapping rules].
192 ///
193 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
194 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
195 /// [Long Running Operation]: https://google.aip.dev/151
196 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
197 /// [`future`]: @ref google::cloud::future
198 /// [`StatusOr`]: @ref google::cloud::StatusOr
199 /// [`Status`]: @ref google::cloud::Status
200 /// [google.cloud.bigquery.reservation.v1.ListReservationsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L638}
201 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
202 ///
203 // clang-format on
204 StreamRange<google::cloud::bigquery::reservation::v1::Reservation>
205 ListReservations(std::string const& parent, Options opts = {});
206
207 // clang-format off
208 ///
209 /// Lists all the reservations for the project in the specified location.
210 ///
211 /// @param request Unary RPCs, such as the one wrapped by this
212 /// function, receive a single `request` proto message which includes all
213 /// the inputs for the RPC. In this case, the proto message is a
214 /// [google.cloud.bigquery.reservation.v1.ListReservationsRequest].
215 /// Proto messages are converted to C++ classes by Protobuf, using the
216 /// [Protobuf mapping rules].
217 /// @param opts Optional. Override the class-level options, such as retry and
218 /// backoff policies.
219 /// @return a [StreamRange](@ref google::cloud::StreamRange)
220 /// to iterate of the results. See the documentation of this type for
221 /// details. In brief, this class has `begin()` and `end()` member
222 /// functions returning a iterator class meeting the
223 /// [input iterator requirements]. The value type for this iterator is a
224 /// [`StatusOr`] as the iteration may fail even after some values are
225 /// retrieved successfully, for example, if there is a network disconnect.
226 /// An empty set of results does not indicate an error, it indicates
227 /// that there are no resources meeting the request criteria.
228 /// On a successful iteration the `StatusOr<T>` contains elements of type
229 /// [google.cloud.bigquery.reservation.v1.Reservation], or rather,
230 /// the C++ class generated by Protobuf from that type. Please consult the
231 /// Protobuf documentation for details on the [Protobuf mapping rules].
232 ///
233 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
234 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
235 /// [Long Running Operation]: https://google.aip.dev/151
236 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
237 /// [`future`]: @ref google::cloud::future
238 /// [`StatusOr`]: @ref google::cloud::StatusOr
239 /// [`Status`]: @ref google::cloud::Status
240 /// [google.cloud.bigquery.reservation.v1.ListReservationsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L638}
241 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
242 ///
243 // clang-format on
244 StreamRange<google::cloud::bigquery::reservation::v1::Reservation>
246 google::cloud::bigquery::reservation::v1::ListReservationsRequest request,
247 Options opts = {});
248
249 // clang-format off
250 ///
251 /// Returns information about the reservation.
252 ///
253 /// @param name Required. Resource name of the reservation to retrieve. E.g.,
254 /// `projects/myproject/locations/US/reservations/team1-prod`
255 /// @param opts Optional. Override the class-level options, such as retry and
256 /// backoff policies.
257 /// @return the result of the RPC. The response message type
258 /// ([google.cloud.bigquery.reservation.v1.Reservation])
259 /// is mapped to a C++ class using the [Protobuf mapping rules].
260 /// If the request fails, the [`StatusOr`] contains the error details.
261 ///
262 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
263 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
264 /// [Long Running Operation]: https://google.aip.dev/151
265 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
266 /// [`future`]: @ref google::cloud::future
267 /// [`StatusOr`]: @ref google::cloud::StatusOr
268 /// [`Status`]: @ref google::cloud::Status
269 /// [google.cloud.bigquery.reservation.v1.GetReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L668}
270 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
271 ///
272 // clang-format on
273 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
274 GetReservation(std::string const& name, Options opts = {});
275
276 // clang-format off
277 ///
278 /// Returns information about the reservation.
279 ///
280 /// @param request Unary RPCs, such as the one wrapped by this
281 /// function, receive a single `request` proto message which includes all
282 /// the inputs for the RPC. In this case, the proto message is a
283 /// [google.cloud.bigquery.reservation.v1.GetReservationRequest].
284 /// Proto messages are converted to C++ classes by Protobuf, using the
285 /// [Protobuf mapping rules].
286 /// @param opts Optional. Override the class-level options, such as retry and
287 /// backoff policies.
288 /// @return the result of the RPC. The response message type
289 /// ([google.cloud.bigquery.reservation.v1.Reservation])
290 /// is mapped to a C++ class using the [Protobuf mapping rules].
291 /// If the request fails, the [`StatusOr`] contains the error details.
292 ///
293 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
294 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
295 /// [Long Running Operation]: https://google.aip.dev/151
296 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
297 /// [`future`]: @ref google::cloud::future
298 /// [`StatusOr`]: @ref google::cloud::StatusOr
299 /// [`Status`]: @ref google::cloud::Status
300 /// [google.cloud.bigquery.reservation.v1.GetReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L668}
301 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
302 ///
303 // clang-format on
304 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
306 google::cloud::bigquery::reservation::v1::GetReservationRequest const&
307 request,
308 Options opts = {});
309
310 // clang-format off
311 ///
312 /// Deletes a reservation.
313 /// Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
314 /// assignments.
315 ///
316 /// @param name Required. Resource name of the reservation to retrieve. E.g.,
317 /// `projects/myproject/locations/US/reservations/team1-prod`
318 /// @param opts Optional. Override the class-level options, such as retry and
319 /// backoff policies.
320 /// @return a [`Status`] object. If the request failed, the
321 /// status contains the details of the failure.
322 ///
323 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
324 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
325 /// [Long Running Operation]: https://google.aip.dev/151
326 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
327 /// [`future`]: @ref google::cloud::future
328 /// [`StatusOr`]: @ref google::cloud::StatusOr
329 /// [`Status`]: @ref google::cloud::Status
330 /// [google.cloud.bigquery.reservation.v1.DeleteReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L681}
331 ///
332 // clang-format on
333 Status DeleteReservation(std::string const& name, Options opts = {});
334
335 // clang-format off
336 ///
337 /// Deletes a reservation.
338 /// Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
339 /// assignments.
340 ///
341 /// @param request Unary RPCs, such as the one wrapped by this
342 /// function, receive a single `request` proto message which includes all
343 /// the inputs for the RPC. In this case, the proto message is a
344 /// [google.cloud.bigquery.reservation.v1.DeleteReservationRequest].
345 /// Proto messages are converted to C++ classes by Protobuf, using the
346 /// [Protobuf mapping rules].
347 /// @param opts Optional. Override the class-level options, such as retry and
348 /// backoff policies.
349 /// @return a [`Status`] object. If the request failed, the
350 /// status contains the details of the failure.
351 ///
352 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
353 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
354 /// [Long Running Operation]: https://google.aip.dev/151
355 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
356 /// [`future`]: @ref google::cloud::future
357 /// [`StatusOr`]: @ref google::cloud::StatusOr
358 /// [`Status`]: @ref google::cloud::Status
359 /// [google.cloud.bigquery.reservation.v1.DeleteReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L681}
360 ///
361 // clang-format on
363 google::cloud::bigquery::reservation::v1::DeleteReservationRequest const&
364 request,
365 Options opts = {});
366
367 // clang-format off
368 ///
369 /// Updates an existing reservation resource.
370 ///
371 /// @param reservation Content of the reservation to update.
372 /// @param update_mask Standard field mask for the set of fields to be updated.
373 /// @param opts Optional. Override the class-level options, such as retry and
374 /// backoff policies.
375 /// @return the result of the RPC. The response message type
376 /// ([google.cloud.bigquery.reservation.v1.Reservation])
377 /// is mapped to a C++ class using the [Protobuf mapping rules].
378 /// If the request fails, the [`StatusOr`] contains the error details.
379 ///
380 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
381 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
382 /// [Long Running Operation]: https://google.aip.dev/151
383 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
384 /// [`future`]: @ref google::cloud::future
385 /// [`StatusOr`]: @ref google::cloud::StatusOr
386 /// [`Status`]: @ref google::cloud::Status
387 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
388 /// [google.cloud.bigquery.reservation.v1.UpdateReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L694}
389 ///
390 // clang-format on
391 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
393 google::cloud::bigquery::reservation::v1::Reservation const& reservation,
394 google::protobuf::FieldMask const& update_mask, Options opts = {});
395
396 // clang-format off
397 ///
398 /// Updates an existing reservation resource.
399 ///
400 /// @param request Unary RPCs, such as the one wrapped by this
401 /// function, receive a single `request` proto message which includes all
402 /// the inputs for the RPC. In this case, the proto message is a
403 /// [google.cloud.bigquery.reservation.v1.UpdateReservationRequest].
404 /// Proto messages are converted to C++ classes by Protobuf, using the
405 /// [Protobuf mapping rules].
406 /// @param opts Optional. Override the class-level options, such as retry and
407 /// backoff policies.
408 /// @return the result of the RPC. The response message type
409 /// ([google.cloud.bigquery.reservation.v1.Reservation])
410 /// is mapped to a C++ class using the [Protobuf mapping rules].
411 /// If the request fails, the [`StatusOr`] contains the error details.
412 ///
413 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
414 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
415 /// [Long Running Operation]: https://google.aip.dev/151
416 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
417 /// [`future`]: @ref google::cloud::future
418 /// [`StatusOr`]: @ref google::cloud::StatusOr
419 /// [`Status`]: @ref google::cloud::Status
420 /// [google.cloud.bigquery.reservation.v1.Reservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L395}
421 /// [google.cloud.bigquery.reservation.v1.UpdateReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L694}
422 ///
423 // clang-format on
424 StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
426 google::cloud::bigquery::reservation::v1::UpdateReservationRequest const&
427 request,
428 Options opts = {});
429
430 // clang-format off
431 ///
432 /// Creates a new capacity commitment resource.
433 ///
434 /// @param parent Required. Resource name of the parent reservation. E.g.,
435 /// `projects/myproject/locations/US`
436 /// @param capacity_commitment Content of the capacity commitment to create.
437 /// @param opts Optional. Override the class-level options, such as retry and
438 /// backoff policies.
439 /// @return the result of the RPC. The response message type
440 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
441 /// is mapped to a C++ class using the [Protobuf mapping rules].
442 /// If the request fails, the [`StatusOr`] contains the error details.
443 ///
444 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
445 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
446 /// [Long Running Operation]: https://google.aip.dev/151
447 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
448 /// [`future`]: @ref google::cloud::future
449 /// [`StatusOr`]: @ref google::cloud::StatusOr
450 /// [`Status`]: @ref google::cloud::Status
451 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
452 /// [google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L704}
453 ///
454 // clang-format on
455 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
457 std::string const& parent,
458 google::cloud::bigquery::reservation::v1::CapacityCommitment const&
459 capacity_commitment,
460 Options opts = {});
461
462 // clang-format off
463 ///
464 /// Creates a new capacity commitment resource.
465 ///
466 /// @param request Unary RPCs, such as the one wrapped by this
467 /// function, receive a single `request` proto message which includes all
468 /// the inputs for the RPC. In this case, the proto message is a
469 /// [google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest].
470 /// Proto messages are converted to C++ classes by Protobuf, using the
471 /// [Protobuf mapping rules].
472 /// @param opts Optional. Override the class-level options, such as retry and
473 /// backoff policies.
474 /// @return the result of the RPC. The response message type
475 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
476 /// is mapped to a C++ class using the [Protobuf mapping rules].
477 /// If the request fails, the [`StatusOr`] contains the error details.
478 ///
479 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
480 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
481 /// [Long Running Operation]: https://google.aip.dev/151
482 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
483 /// [`future`]: @ref google::cloud::future
484 /// [`StatusOr`]: @ref google::cloud::StatusOr
485 /// [`Status`]: @ref google::cloud::Status
486 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
487 /// [google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L704}
488 ///
489 // clang-format on
490 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
491 CreateCapacityCommitment(google::cloud::bigquery::reservation::v1::
492 CreateCapacityCommitmentRequest const& request,
493 Options opts = {});
494
495 // clang-format off
496 ///
497 /// Lists all the capacity commitments for the admin project.
498 ///
499 /// @param parent Required. Resource name of the parent reservation. E.g.,
500 /// `projects/myproject/locations/US`
501 /// @param opts Optional. Override the class-level options, such as retry and
502 /// backoff policies.
503 /// @return a [StreamRange](@ref google::cloud::StreamRange)
504 /// to iterate of the results. See the documentation of this type for
505 /// details. In brief, this class has `begin()` and `end()` member
506 /// functions returning a iterator class meeting the
507 /// [input iterator requirements]. The value type for this iterator is a
508 /// [`StatusOr`] as the iteration may fail even after some values are
509 /// retrieved successfully, for example, if there is a network disconnect.
510 /// An empty set of results does not indicate an error, it indicates
511 /// that there are no resources meeting the request criteria.
512 /// On a successful iteration the `StatusOr<T>` contains elements of type
513 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment], or rather,
514 /// the C++ class generated by Protobuf from that type. Please consult the
515 /// Protobuf documentation for details on the [Protobuf mapping rules].
516 ///
517 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
518 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
519 /// [Long Running Operation]: https://google.aip.dev/151
520 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
521 /// [`future`]: @ref google::cloud::future
522 /// [`StatusOr`]: @ref google::cloud::StatusOr
523 /// [`Status`]: @ref google::cloud::Status
524 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
525 /// [google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L731}
526 ///
527 // clang-format on
528 StreamRange<google::cloud::bigquery::reservation::v1::CapacityCommitment>
529 ListCapacityCommitments(std::string const& parent, Options opts = {});
530
531 // clang-format off
532 ///
533 /// Lists all the capacity commitments for the admin project.
534 ///
535 /// @param request Unary RPCs, such as the one wrapped by this
536 /// function, receive a single `request` proto message which includes all
537 /// the inputs for the RPC. In this case, the proto message is a
538 /// [google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest].
539 /// Proto messages are converted to C++ classes by Protobuf, using the
540 /// [Protobuf mapping rules].
541 /// @param opts Optional. Override the class-level options, such as retry and
542 /// backoff policies.
543 /// @return a [StreamRange](@ref google::cloud::StreamRange)
544 /// to iterate of the results. See the documentation of this type for
545 /// details. In brief, this class has `begin()` and `end()` member
546 /// functions returning a iterator class meeting the
547 /// [input iterator requirements]. The value type for this iterator is a
548 /// [`StatusOr`] as the iteration may fail even after some values are
549 /// retrieved successfully, for example, if there is a network disconnect.
550 /// An empty set of results does not indicate an error, it indicates
551 /// that there are no resources meeting the request criteria.
552 /// On a successful iteration the `StatusOr<T>` contains elements of type
553 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment], or rather,
554 /// the C++ class generated by Protobuf from that type. Please consult the
555 /// Protobuf documentation for details on the [Protobuf mapping rules].
556 ///
557 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
558 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
559 /// [Long Running Operation]: https://google.aip.dev/151
560 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
561 /// [`future`]: @ref google::cloud::future
562 /// [`StatusOr`]: @ref google::cloud::StatusOr
563 /// [`Status`]: @ref google::cloud::Status
564 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
565 /// [google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L731}
566 ///
567 // clang-format on
568 StreamRange<google::cloud::bigquery::reservation::v1::CapacityCommitment>
570 google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest
571 request,
572 Options opts = {});
573
574 // clang-format off
575 ///
576 /// Returns information about the capacity commitment.
577 ///
578 /// @param name Required. Resource name of the capacity commitment to retrieve. E.g.,
579 /// `projects/myproject/locations/US/capacityCommitments/123`
580 /// @param opts Optional. Override the class-level options, such as retry and
581 /// backoff policies.
582 /// @return the result of the RPC. The response message type
583 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
584 /// is mapped to a C++ class using the [Protobuf mapping rules].
585 /// If the request fails, the [`StatusOr`] contains the error details.
586 ///
587 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
588 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
589 /// [Long Running Operation]: https://google.aip.dev/151
590 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
591 /// [`future`]: @ref google::cloud::future
592 /// [`StatusOr`]: @ref google::cloud::StatusOr
593 /// [`Status`]: @ref google::cloud::Status
594 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
595 /// [google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L761}
596 ///
597 // clang-format on
598 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
599 GetCapacityCommitment(std::string const& name, Options opts = {});
600
601 // clang-format off
602 ///
603 /// Returns information about the capacity commitment.
604 ///
605 /// @param request Unary RPCs, such as the one wrapped by this
606 /// function, receive a single `request` proto message which includes all
607 /// the inputs for the RPC. In this case, the proto message is a
608 /// [google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest].
609 /// Proto messages are converted to C++ classes by Protobuf, using the
610 /// [Protobuf mapping rules].
611 /// @param opts Optional. Override the class-level options, such as retry and
612 /// backoff policies.
613 /// @return the result of the RPC. The response message type
614 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
615 /// is mapped to a C++ class using the [Protobuf mapping rules].
616 /// If the request fails, the [`StatusOr`] contains the error details.
617 ///
618 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
619 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
620 /// [Long Running Operation]: https://google.aip.dev/151
621 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
622 /// [`future`]: @ref google::cloud::future
623 /// [`StatusOr`]: @ref google::cloud::StatusOr
624 /// [`Status`]: @ref google::cloud::Status
625 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
626 /// [google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L761}
627 ///
628 // clang-format on
629 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
630 GetCapacityCommitment(google::cloud::bigquery::reservation::v1::
631 GetCapacityCommitmentRequest const& request,
632 Options opts = {});
633
634 // clang-format off
635 ///
636 /// Deletes a capacity commitment. Attempting to delete capacity commitment
637 /// before its commitment_end_time will fail with the error code
638 /// `google.rpc.Code.FAILED_PRECONDITION`.
639 ///
640 /// @param name Required. Resource name of the capacity commitment to delete. E.g.,
641 /// `projects/myproject/locations/US/capacityCommitments/123`
642 /// @param opts Optional. Override the class-level options, such as retry and
643 /// backoff policies.
644 /// @return a [`Status`] object. If the request failed, the
645 /// status contains the details of the failure.
646 ///
647 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
648 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
649 /// [Long Running Operation]: https://google.aip.dev/151
650 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
651 /// [`future`]: @ref google::cloud::future
652 /// [`StatusOr`]: @ref google::cloud::StatusOr
653 /// [`Status`]: @ref google::cloud::Status
654 /// [google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L774}
655 ///
656 // clang-format on
657 Status DeleteCapacityCommitment(std::string const& name, Options opts = {});
658
659 // clang-format off
660 ///
661 /// Deletes a capacity commitment. Attempting to delete capacity commitment
662 /// before its commitment_end_time will fail with the error code
663 /// `google.rpc.Code.FAILED_PRECONDITION`.
664 ///
665 /// @param request Unary RPCs, such as the one wrapped by this
666 /// function, receive a single `request` proto message which includes all
667 /// the inputs for the RPC. In this case, the proto message is a
668 /// [google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest].
669 /// Proto messages are converted to C++ classes by Protobuf, using the
670 /// [Protobuf mapping rules].
671 /// @param opts Optional. Override the class-level options, such as retry and
672 /// backoff policies.
673 /// @return a [`Status`] object. If the request failed, the
674 /// status contains the details of the failure.
675 ///
676 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
677 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
678 /// [Long Running Operation]: https://google.aip.dev/151
679 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
680 /// [`future`]: @ref google::cloud::future
681 /// [`StatusOr`]: @ref google::cloud::StatusOr
682 /// [`Status`]: @ref google::cloud::Status
683 /// [google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L774}
684 ///
685 // clang-format on
687 google::cloud::bigquery::reservation::v1::
688 DeleteCapacityCommitmentRequest const& request,
689 Options opts = {});
690
691 // clang-format off
692 ///
693 /// Updates an existing capacity commitment.
694 ///
695 /// Only `plan` and `renewal_plan` fields can be updated.
696 ///
697 /// Plan can only be changed to a plan of a longer commitment period.
698 /// Attempting to change to a plan with shorter commitment period will fail
699 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
700 ///
701 /// @param capacity_commitment Content of the capacity commitment to update.
702 /// @param update_mask Standard field mask for the set of fields to be updated.
703 /// @param opts Optional. Override the class-level options, such as retry and
704 /// backoff policies.
705 /// @return the result of the RPC. The response message type
706 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
707 /// is mapped to a C++ class using the [Protobuf mapping rules].
708 /// If the request fails, the [`StatusOr`] contains the error details.
709 ///
710 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
711 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
712 /// [Long Running Operation]: https://google.aip.dev/151
713 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
714 /// [`future`]: @ref google::cloud::future
715 /// [`StatusOr`]: @ref google::cloud::StatusOr
716 /// [`Status`]: @ref google::cloud::Status
717 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
718 /// [google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L792}
719 ///
720 // clang-format on
721 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
723 google::cloud::bigquery::reservation::v1::CapacityCommitment const&
724 capacity_commitment,
725 google::protobuf::FieldMask const& update_mask, Options opts = {});
726
727 // clang-format off
728 ///
729 /// Updates an existing capacity commitment.
730 ///
731 /// Only `plan` and `renewal_plan` fields can be updated.
732 ///
733 /// Plan can only be changed to a plan of a longer commitment period.
734 /// Attempting to change to a plan with shorter commitment period will fail
735 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
736 ///
737 /// @param request Unary RPCs, such as the one wrapped by this
738 /// function, receive a single `request` proto message which includes all
739 /// the inputs for the RPC. In this case, the proto message is a
740 /// [google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest].
741 /// Proto messages are converted to C++ classes by Protobuf, using the
742 /// [Protobuf mapping rules].
743 /// @param opts Optional. Override the class-level options, such as retry and
744 /// backoff policies.
745 /// @return the result of the RPC. The response message type
746 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
747 /// is mapped to a C++ class using the [Protobuf mapping rules].
748 /// If the request fails, the [`StatusOr`] contains the error details.
749 ///
750 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
751 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
752 /// [Long Running Operation]: https://google.aip.dev/151
753 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
754 /// [`future`]: @ref google::cloud::future
755 /// [`StatusOr`]: @ref google::cloud::StatusOr
756 /// [`Status`]: @ref google::cloud::Status
757 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
758 /// [google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L792}
759 ///
760 // clang-format on
761 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
762 UpdateCapacityCommitment(google::cloud::bigquery::reservation::v1::
763 UpdateCapacityCommitmentRequest const& request,
764 Options opts = {});
765
766 // clang-format off
767 ///
768 /// Splits capacity commitment to two commitments of the same plan and
769 /// `commitment_end_time`.
770 ///
771 /// A common use case is to enable downgrading commitments.
772 ///
773 /// For example, in order to downgrade from 10000 slots to 8000, you might
774 /// split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
775 /// you delete the first one after the commitment end time passes.
776 ///
777 /// @param name Required. The resource name e.g.,:
778 /// `projects/myproject/locations/US/capacityCommitments/123`
779 /// @param slot_count Number of slots in the capacity commitment after the split.
780 /// @param opts Optional. Override the class-level options, such as retry and
781 /// backoff policies.
782 /// @return the result of the RPC. The response message type
783 /// ([google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse])
784 /// is mapped to a C++ class using the [Protobuf mapping rules].
785 /// If the request fails, the [`StatusOr`] contains the error details.
786 ///
787 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
788 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
789 /// [Long Running Operation]: https://google.aip.dev/151
790 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
791 /// [`future`]: @ref google::cloud::future
792 /// [`StatusOr`]: @ref google::cloud::StatusOr
793 /// [`Status`]: @ref google::cloud::Status
794 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L802}
795 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L818}
796 ///
797 // clang-format on
798 StatusOr<
799 google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse>
800 SplitCapacityCommitment(std::string const& name, std::int64_t slot_count,
801 Options opts = {});
802
803 // clang-format off
804 ///
805 /// Splits capacity commitment to two commitments of the same plan and
806 /// `commitment_end_time`.
807 ///
808 /// A common use case is to enable downgrading commitments.
809 ///
810 /// For example, in order to downgrade from 10000 slots to 8000, you might
811 /// split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
812 /// you delete the first one after the commitment end time passes.
813 ///
814 /// @param request Unary RPCs, such as the one wrapped by this
815 /// function, receive a single `request` proto message which includes all
816 /// the inputs for the RPC. In this case, the proto message is a
817 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest].
818 /// Proto messages are converted to C++ classes by Protobuf, using the
819 /// [Protobuf mapping rules].
820 /// @param opts Optional. Override the class-level options, such as retry and
821 /// backoff policies.
822 /// @return the result of the RPC. The response message type
823 /// ([google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse])
824 /// is mapped to a C++ class using the [Protobuf mapping rules].
825 /// If the request fails, the [`StatusOr`] contains the error details.
826 ///
827 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
828 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
829 /// [Long Running Operation]: https://google.aip.dev/151
830 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
831 /// [`future`]: @ref google::cloud::future
832 /// [`StatusOr`]: @ref google::cloud::StatusOr
833 /// [`Status`]: @ref google::cloud::Status
834 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L802}
835 /// [google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L818}
836 ///
837 // clang-format on
838 StatusOr<
839 google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse>
840 SplitCapacityCommitment(google::cloud::bigquery::reservation::v1::
841 SplitCapacityCommitmentRequest const& request,
842 Options opts = {});
843
844 // clang-format off
845 ///
846 /// Merges capacity commitments of the same plan into a single commitment.
847 ///
848 /// The resulting capacity commitment has the greater commitment_end_time
849 /// out of the to-be-merged capacity commitments.
850 ///
851 /// Attempting to merge capacity commitments of different plan will fail
852 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
853 ///
854 /// @param parent Parent resource that identifies admin project and location e.g.,
855 /// `projects/myproject/locations/us`
856 /// @param capacity_commitment_ids Ids of capacity commitments to merge.
857 /// These capacity commitments must exist under admin project and location
858 /// specified in the parent.
859 /// ID is the last portion of capacity commitment name e.g., 'abc' for
860 /// projects/myproject/locations/US/capacityCommitments/abc
861 /// @param opts Optional. Override the class-level options, such as retry and
862 /// backoff policies.
863 /// @return the result of the RPC. The response message type
864 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
865 /// is mapped to a C++ class using the [Protobuf mapping rules].
866 /// If the request fails, the [`StatusOr`] contains the error details.
867 ///
868 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
869 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
870 /// [Long Running Operation]: https://google.aip.dev/151
871 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
872 /// [`future`]: @ref google::cloud::future
873 /// [`StatusOr`]: @ref google::cloud::StatusOr
874 /// [`Status`]: @ref google::cloud::Status
875 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
876 /// [google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L828}
877 ///
878 // clang-format on
879 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
881 std::string const& parent,
882 std::vector<std::string> const& capacity_commitment_ids,
883 Options opts = {});
884
885 // clang-format off
886 ///
887 /// Merges capacity commitments of the same plan into a single commitment.
888 ///
889 /// The resulting capacity commitment has the greater commitment_end_time
890 /// out of the to-be-merged capacity commitments.
891 ///
892 /// Attempting to merge capacity commitments of different plan will fail
893 /// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
894 ///
895 /// @param request Unary RPCs, such as the one wrapped by this
896 /// function, receive a single `request` proto message which includes all
897 /// the inputs for the RPC. In this case, the proto message is a
898 /// [google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest].
899 /// Proto messages are converted to C++ classes by Protobuf, using the
900 /// [Protobuf mapping rules].
901 /// @param opts Optional. Override the class-level options, such as retry and
902 /// backoff policies.
903 /// @return the result of the RPC. The response message type
904 /// ([google.cloud.bigquery.reservation.v1.CapacityCommitment])
905 /// is mapped to a C++ class using the [Protobuf mapping rules].
906 /// If the request fails, the [`StatusOr`] contains the error details.
907 ///
908 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
909 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
910 /// [Long Running Operation]: https://google.aip.dev/151
911 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
912 /// [`future`]: @ref google::cloud::future
913 /// [`StatusOr`]: @ref google::cloud::StatusOr
914 /// [`Status`]: @ref google::cloud::Status
915 /// [google.cloud.bigquery.reservation.v1.CapacityCommitment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L487}
916 /// [google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L828}
917 ///
918 // clang-format on
919 StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
920 MergeCapacityCommitments(google::cloud::bigquery::reservation::v1::
921 MergeCapacityCommitmentsRequest const& request,
922 Options opts = {});
923
924 // clang-format off
925 ///
926 /// Creates an assignment object which allows the given project to submit jobs
927 /// of a certain type using slots from the specified reservation.
928 ///
929 /// Currently a
930 /// resource (project, folder, organization) can only have one assignment per
931 /// each (job_type, location) combination, and that reservation will be used
932 /// for all jobs of the matching type.
933 ///
934 /// Different assignments can be created on different levels of the
935 /// projects, folders or organization hierarchy. During query execution,
936 /// the assignment is looked up at the project, folder and organization levels
937 /// in that order. The first assignment found is applied to the query.
938 ///
939 /// When creating assignments, it does not matter if other assignments exist at
940 /// higher levels.
941 ///
942 /// Example:
943 ///
944 /// * The organization `organizationA` contains two projects, `project1`
945 /// and `project2`.
946 /// * Assignments for all three entities (`organizationA`, `project1`, and
947 /// `project2`) could all be created and mapped to the same or different
948 /// reservations.
949 ///
950 /// "None" assignments represent an absence of the assignment. Projects
951 /// assigned to None use on-demand pricing. To create a "None" assignment, use
952 /// "none" as a reservation_id in the parent. Example parent:
953 /// `projects/myproject/locations/US/reservations/none`.
954 ///
955 /// Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
956 /// 'bigquery.admin' permissions on the project using the reservation
957 /// and the project that owns this reservation.
958 ///
959 /// Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
960 /// does not match location of the reservation.
961 ///
962 /// @param parent Required. The parent resource name of the assignment
963 /// E.g. `projects/myproject/locations/US/reservations/team1-prod`
964 /// @param assignment Assignment resource to create.
965 /// @param opts Optional. Override the class-level options, such as retry and
966 /// backoff policies.
967 /// @return the result of the RPC. The response message type
968 /// ([google.cloud.bigquery.reservation.v1.Assignment])
969 /// is mapped to a C++ class using the [Protobuf mapping rules].
970 /// If the request fails, the [`StatusOr`] contains the error details.
971 ///
972 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
973 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
974 /// [Long Running Operation]: https://google.aip.dev/151
975 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
976 /// [`future`]: @ref google::cloud::future
977 /// [`StatusOr`]: @ref google::cloud::StatusOr
978 /// [`Status`]: @ref google::cloud::Status
979 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
980 /// [google.cloud.bigquery.reservation.v1.CreateAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L907}
981 ///
982 // clang-format on
983 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
985 std::string const& parent,
986 google::cloud::bigquery::reservation::v1::Assignment const& assignment,
987 Options opts = {});
988
989 // clang-format off
990 ///
991 /// Creates an assignment object which allows the given project to submit jobs
992 /// of a certain type using slots from the specified reservation.
993 ///
994 /// Currently a
995 /// resource (project, folder, organization) can only have one assignment per
996 /// each (job_type, location) combination, and that reservation will be used
997 /// for all jobs of the matching type.
998 ///
999 /// Different assignments can be created on different levels of the
1000 /// projects, folders or organization hierarchy. During query execution,
1001 /// the assignment is looked up at the project, folder and organization levels
1002 /// in that order. The first assignment found is applied to the query.
1003 ///
1004 /// When creating assignments, it does not matter if other assignments exist at
1005 /// higher levels.
1006 ///
1007 /// Example:
1008 ///
1009 /// * The organization `organizationA` contains two projects, `project1`
1010 /// and `project2`.
1011 /// * Assignments for all three entities (`organizationA`, `project1`, and
1012 /// `project2`) could all be created and mapped to the same or different
1013 /// reservations.
1014 ///
1015 /// "None" assignments represent an absence of the assignment. Projects
1016 /// assigned to None use on-demand pricing. To create a "None" assignment, use
1017 /// "none" as a reservation_id in the parent. Example parent:
1018 /// `projects/myproject/locations/US/reservations/none`.
1019 ///
1020 /// Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
1021 /// 'bigquery.admin' permissions on the project using the reservation
1022 /// and the project that owns this reservation.
1023 ///
1024 /// Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
1025 /// does not match location of the reservation.
1026 ///
1027 /// @param request Unary RPCs, such as the one wrapped by this
1028 /// function, receive a single `request` proto message which includes all
1029 /// the inputs for the RPC. In this case, the proto message is a
1030 /// [google.cloud.bigquery.reservation.v1.CreateAssignmentRequest].
1031 /// Proto messages are converted to C++ classes by Protobuf, using the
1032 /// [Protobuf mapping rules].
1033 /// @param opts Optional. Override the class-level options, such as retry and
1034 /// backoff policies.
1035 /// @return the result of the RPC. The response message type
1036 /// ([google.cloud.bigquery.reservation.v1.Assignment])
1037 /// is mapped to a C++ class using the [Protobuf mapping rules].
1038 /// If the request fails, the [`StatusOr`] contains the error details.
1039 ///
1040 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1041 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1042 /// [Long Running Operation]: https://google.aip.dev/151
1043 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1044 /// [`future`]: @ref google::cloud::future
1045 /// [`StatusOr`]: @ref google::cloud::StatusOr
1046 /// [`Status`]: @ref google::cloud::Status
1047 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1048 /// [google.cloud.bigquery.reservation.v1.CreateAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L907}
1049 ///
1050 // clang-format on
1051 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
1053 google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const&
1054 request,
1055 Options opts = {});
1056
1057 // clang-format off
1058 ///
1059 /// Lists assignments.
1060 ///
1061 /// Only explicitly created assignments will be returned.
1062 ///
1063 /// Example:
1064 ///
1065 /// * Organization `organizationA` contains two projects, `project1` and
1066 /// `project2`.
1067 /// * Reservation `res1` exists and was created previously.
1068 /// * CreateAssignment was used previously to define the following
1069 /// associations between entities and reservations: `<organizationA, res1>`
1070 /// and `<project1, res1>`
1071 ///
1072 /// In this example, ListAssignments will just return the above two assignments
1073 /// for reservation `res1`, and no expansion/merge will happen.
1074 ///
1075 /// The wildcard "-" can be used for
1076 /// reservations in the request. In that case all assignments belongs to the
1077 /// specified project and location will be listed.
1078 ///
1079 /// **Note** "-" cannot be used for projects nor locations.
1080 ///
1081 /// @param parent Required. The parent resource name e.g.:
1082 /// @n
1083 /// `projects/myproject/locations/US/reservations/team1-prod`
1084 /// @n
1085 /// Or:
1086 /// @n
1087 /// `projects/myproject/locations/US/reservations/-`
1088 /// @param opts Optional. Override the class-level options, such as retry and
1089 /// backoff policies.
1090 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1091 /// to iterate of the results. See the documentation of this type for
1092 /// details. In brief, this class has `begin()` and `end()` member
1093 /// functions returning a iterator class meeting the
1094 /// [input iterator requirements]. The value type for this iterator is a
1095 /// [`StatusOr`] as the iteration may fail even after some values are
1096 /// retrieved successfully, for example, if there is a network disconnect.
1097 /// An empty set of results does not indicate an error, it indicates
1098 /// that there are no resources meeting the request criteria.
1099 /// On a successful iteration the `StatusOr<T>` contains elements of type
1100 /// [google.cloud.bigquery.reservation.v1.Assignment], or rather,
1101 /// the C++ class generated by Protobuf from that type. Please consult the
1102 /// Protobuf documentation for details on the [Protobuf mapping rules].
1103 ///
1104 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1105 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1106 /// [Long Running Operation]: https://google.aip.dev/151
1107 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1108 /// [`future`]: @ref google::cloud::future
1109 /// [`StatusOr`]: @ref google::cloud::StatusOr
1110 /// [`Status`]: @ref google::cloud::Status
1111 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1112 /// [google.cloud.bigquery.reservation.v1.ListAssignmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L929}
1113 ///
1114 // clang-format on
1115 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1116 ListAssignments(std::string const& parent, Options opts = {});
1117
1118 // clang-format off
1119 ///
1120 /// Lists assignments.
1121 ///
1122 /// Only explicitly created assignments will be returned.
1123 ///
1124 /// Example:
1125 ///
1126 /// * Organization `organizationA` contains two projects, `project1` and
1127 /// `project2`.
1128 /// * Reservation `res1` exists and was created previously.
1129 /// * CreateAssignment was used previously to define the following
1130 /// associations between entities and reservations: `<organizationA, res1>`
1131 /// and `<project1, res1>`
1132 ///
1133 /// In this example, ListAssignments will just return the above two assignments
1134 /// for reservation `res1`, and no expansion/merge will happen.
1135 ///
1136 /// The wildcard "-" can be used for
1137 /// reservations in the request. In that case all assignments belongs to the
1138 /// specified project and location will be listed.
1139 ///
1140 /// **Note** "-" cannot be used for projects nor locations.
1141 ///
1142 /// @param request Unary RPCs, such as the one wrapped by this
1143 /// function, receive a single `request` proto message which includes all
1144 /// the inputs for the RPC. In this case, the proto message is a
1145 /// [google.cloud.bigquery.reservation.v1.ListAssignmentsRequest].
1146 /// Proto messages are converted to C++ classes by Protobuf, using the
1147 /// [Protobuf mapping rules].
1148 /// @param opts Optional. Override the class-level options, such as retry and
1149 /// backoff policies.
1150 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1151 /// to iterate of the results. See the documentation of this type for
1152 /// details. In brief, this class has `begin()` and `end()` member
1153 /// functions returning a iterator class meeting the
1154 /// [input iterator requirements]. The value type for this iterator is a
1155 /// [`StatusOr`] as the iteration may fail even after some values are
1156 /// retrieved successfully, for example, if there is a network disconnect.
1157 /// An empty set of results does not indicate an error, it indicates
1158 /// that there are no resources meeting the request criteria.
1159 /// On a successful iteration the `StatusOr<T>` contains elements of type
1160 /// [google.cloud.bigquery.reservation.v1.Assignment], or rather,
1161 /// the C++ class generated by Protobuf from that type. Please consult the
1162 /// Protobuf documentation for details on the [Protobuf mapping rules].
1163 ///
1164 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1165 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1166 /// [Long Running Operation]: https://google.aip.dev/151
1167 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1168 /// [`future`]: @ref google::cloud::future
1169 /// [`StatusOr`]: @ref google::cloud::StatusOr
1170 /// [`Status`]: @ref google::cloud::Status
1171 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1172 /// [google.cloud.bigquery.reservation.v1.ListAssignmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L929}
1173 ///
1174 // clang-format on
1175 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1177 google::cloud::bigquery::reservation::v1::ListAssignmentsRequest request,
1178 Options opts = {});
1179
1180 // clang-format off
1181 ///
1182 /// Deletes a assignment. No expansion will happen.
1183 ///
1184 /// Example:
1185 ///
1186 /// * Organization `organizationA` contains two projects, `project1` and
1187 /// `project2`.
1188 /// * Reservation `res1` exists and was created previously.
1189 /// * CreateAssignment was used previously to define the following
1190 /// associations between entities and reservations: `<organizationA, res1>`
1191 /// and `<project1, res1>`
1192 ///
1193 /// In this example, deletion of the `<organizationA, res1>` assignment won't
1194 /// affect the other assignment `<project1, res1>`. After said deletion,
1195 /// queries from `project1` will still use `res1` while queries from
1196 /// `project2` will switch to use on-demand mode.
1197 ///
1198 /// @param name Required. Name of the resource, e.g.
1199 /// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
1200 /// @param opts Optional. Override the class-level options, such as retry and
1201 /// backoff policies.
1202 /// @return a [`Status`] object. If the request failed, the
1203 /// status contains the details of the failure.
1204 ///
1205 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1206 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1207 /// [Long Running Operation]: https://google.aip.dev/151
1208 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1209 /// [`future`]: @ref google::cloud::future
1210 /// [`StatusOr`]: @ref google::cloud::StatusOr
1211 /// [`Status`]: @ref google::cloud::Status
1212 /// [google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L966}
1213 ///
1214 // clang-format on
1215 Status DeleteAssignment(std::string const& name, Options opts = {});
1216
1217 // clang-format off
1218 ///
1219 /// Deletes a assignment. No expansion will happen.
1220 ///
1221 /// Example:
1222 ///
1223 /// * Organization `organizationA` contains two projects, `project1` and
1224 /// `project2`.
1225 /// * Reservation `res1` exists and was created previously.
1226 /// * CreateAssignment was used previously to define the following
1227 /// associations between entities and reservations: `<organizationA, res1>`
1228 /// and `<project1, res1>`
1229 ///
1230 /// In this example, deletion of the `<organizationA, res1>` assignment won't
1231 /// affect the other assignment `<project1, res1>`. After said deletion,
1232 /// queries from `project1` will still use `res1` while queries from
1233 /// `project2` will switch to use on-demand mode.
1234 ///
1235 /// @param request Unary RPCs, such as the one wrapped by this
1236 /// function, receive a single `request` proto message which includes all
1237 /// the inputs for the RPC. In this case, the proto message is a
1238 /// [google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest].
1239 /// Proto messages are converted to C++ classes by Protobuf, using the
1240 /// [Protobuf mapping rules].
1241 /// @param opts Optional. Override the class-level options, such as retry and
1242 /// backoff policies.
1243 /// @return a [`Status`] object. If the request failed, the
1244 /// status contains the details of the failure.
1245 ///
1246 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1247 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1248 /// [Long Running Operation]: https://google.aip.dev/151
1249 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1250 /// [`future`]: @ref google::cloud::future
1251 /// [`StatusOr`]: @ref google::cloud::StatusOr
1252 /// [`Status`]: @ref google::cloud::Status
1253 /// [google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L966}
1254 ///
1255 // clang-format on
1257 google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const&
1258 request,
1259 Options opts = {});
1260
1261 // clang-format off
1262 ///
1263 /// Deprecated: Looks up assignments for a specified resource for a particular
1264 /// region. If the request is about a project:
1265 ///
1266 /// 1. Assignments created on the project will be returned if they exist.
1267 /// 2. Otherwise assignments created on the closest ancestor will be
1268 /// returned.
1269 /// 3. Assignments for different JobTypes will all be returned.
1270 ///
1271 /// The same logic applies if the request is about a folder.
1272 ///
1273 /// If the request is about an organization, then assignments created on the
1274 /// organization will be returned (organization doesn't have ancestors).
1275 ///
1276 /// Comparing to ListAssignments, there are some behavior
1277 /// differences:
1278 ///
1279 /// 1. permission on the assignee will be verified in this API.
1280 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
1281 /// 3. Parent here is `projects/*/locations/*`, instead of
1282 /// `projects/*/locations/*reservations/*`.
1283 ///
1284 /// **Note** "-" cannot be used for projects
1285 /// nor locations.
1286 ///
1287 /// @param parent Required. The resource name of the admin project(containing project and
1288 /// location), e.g.:
1289 /// `projects/myproject/locations/US`.
1290 /// @param query Please specify resource name as assignee in the query.
1291 /// @n
1292 /// Examples:
1293 /// @n
1294 /// * `assignee=projects/myproject`
1295 /// * `assignee=folders/123`
1296 /// * `assignee=organizations/456`
1297 /// @param opts Optional. Override the class-level options, such as retry and
1298 /// backoff policies.
1299 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1300 /// to iterate of the results. See the documentation of this type for
1301 /// details. In brief, this class has `begin()` and `end()` member
1302 /// functions returning a iterator class meeting the
1303 /// [input iterator requirements]. The value type for this iterator is a
1304 /// [`StatusOr`] as the iteration may fail even after some values are
1305 /// retrieved successfully, for example, if there is a network disconnect.
1306 /// An empty set of results does not indicate an error, it indicates
1307 /// that there are no resources meeting the request criteria.
1308 /// On a successful iteration the `StatusOr<T>` contains elements of type
1309 /// [google.cloud.bigquery.reservation.v1.Assignment], or rather,
1310 /// the C++ class generated by Protobuf from that type. Please consult the
1311 /// Protobuf documentation for details on the [Protobuf mapping rules].
1312 ///
1313 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1314 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1315 /// [Long Running Operation]: https://google.aip.dev/151
1316 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1317 /// [`future`]: @ref google::cloud::future
1318 /// [`StatusOr`]: @ref google::cloud::StatusOr
1319 /// [`Status`]: @ref google::cloud::Status
1320 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1321 /// [google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L981}
1322 ///
1323 // clang-format on
1324 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1325 SearchAssignments(std::string const& parent, std::string const& query,
1326 Options opts = {});
1327
1328 // clang-format off
1329 ///
1330 /// Deprecated: Looks up assignments for a specified resource for a particular
1331 /// region. If the request is about a project:
1332 ///
1333 /// 1. Assignments created on the project will be returned if they exist.
1334 /// 2. Otherwise assignments created on the closest ancestor will be
1335 /// returned.
1336 /// 3. Assignments for different JobTypes will all be returned.
1337 ///
1338 /// The same logic applies if the request is about a folder.
1339 ///
1340 /// If the request is about an organization, then assignments created on the
1341 /// organization will be returned (organization doesn't have ancestors).
1342 ///
1343 /// Comparing to ListAssignments, there are some behavior
1344 /// differences:
1345 ///
1346 /// 1. permission on the assignee will be verified in this API.
1347 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
1348 /// 3. Parent here is `projects/*/locations/*`, instead of
1349 /// `projects/*/locations/*reservations/*`.
1350 ///
1351 /// **Note** "-" cannot be used for projects
1352 /// nor locations.
1353 ///
1354 /// @param request Unary RPCs, such as the one wrapped by this
1355 /// function, receive a single `request` proto message which includes all
1356 /// the inputs for the RPC. In this case, the proto message is a
1357 /// [google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest].
1358 /// Proto messages are converted to C++ classes by Protobuf, using the
1359 /// [Protobuf mapping rules].
1360 /// @param opts Optional. Override the class-level options, such as retry and
1361 /// backoff policies.
1362 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1363 /// to iterate of the results. See the documentation of this type for
1364 /// details. In brief, this class has `begin()` and `end()` member
1365 /// functions returning a iterator class meeting the
1366 /// [input iterator requirements]. The value type for this iterator is a
1367 /// [`StatusOr`] as the iteration may fail even after some values are
1368 /// retrieved successfully, for example, if there is a network disconnect.
1369 /// An empty set of results does not indicate an error, it indicates
1370 /// that there are no resources meeting the request criteria.
1371 /// On a successful iteration the `StatusOr<T>` contains elements of type
1372 /// [google.cloud.bigquery.reservation.v1.Assignment], or rather,
1373 /// the C++ class generated by Protobuf from that type. Please consult the
1374 /// Protobuf documentation for details on the [Protobuf mapping rules].
1375 ///
1376 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1377 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1378 /// [Long Running Operation]: https://google.aip.dev/151
1379 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1380 /// [`future`]: @ref google::cloud::future
1381 /// [`StatusOr`]: @ref google::cloud::StatusOr
1382 /// [`Status`]: @ref google::cloud::Status
1383 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1384 /// [google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L981}
1385 ///
1386 // clang-format on
1387 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1389 google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest
1390 request,
1391 Options opts = {});
1392
1393 // clang-format off
1394 ///
1395 /// Looks up assignments for a specified resource for a particular region.
1396 /// If the request is about a project:
1397 ///
1398 /// 1. Assignments created on the project will be returned if they exist.
1399 /// 2. Otherwise assignments created on the closest ancestor will be
1400 /// returned.
1401 /// 3. Assignments for different JobTypes will all be returned.
1402 ///
1403 /// The same logic applies if the request is about a folder.
1404 ///
1405 /// If the request is about an organization, then assignments created on the
1406 /// organization will be returned (organization doesn't have ancestors).
1407 ///
1408 /// Comparing to ListAssignments, there are some behavior
1409 /// differences:
1410 ///
1411 /// 1. permission on the assignee will be verified in this API.
1412 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
1413 /// 3. Parent here is `projects/*/locations/*`, instead of
1414 /// `projects/*/locations/*reservations/*`.
1415 ///
1416 /// @param parent Required. The resource name with location (project name could be the
1417 /// wildcard '-'), e.g.:
1418 /// `projects/-/locations/US`.
1419 /// @param query Please specify resource name as assignee in the query.
1420 /// @n
1421 /// Examples:
1422 /// @n
1423 /// * `assignee=projects/myproject`
1424 /// * `assignee=folders/123`
1425 /// * `assignee=organizations/456`
1426 /// @param opts Optional. Override the class-level options, such as retry and
1427 /// backoff policies.
1428 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1429 /// to iterate of the results. See the documentation of this type for
1430 /// details. In brief, this class has `begin()` and `end()` member
1431 /// functions returning a iterator class meeting the
1432 /// [input iterator requirements]. The value type for this iterator is a
1433 /// [`StatusOr`] as the iteration may fail even after some values are
1434 /// retrieved successfully, for example, if there is a network disconnect.
1435 /// An empty set of results does not indicate an error, it indicates
1436 /// that there are no resources meeting the request criteria.
1437 /// On a successful iteration the `StatusOr<T>` contains elements of type
1438 /// [google.cloud.bigquery.reservation.v1.Assignment], or rather,
1439 /// the C++ class generated by Protobuf from that type. Please consult the
1440 /// Protobuf documentation for details on the [Protobuf mapping rules].
1441 ///
1442 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1443 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1444 /// [Long Running Operation]: https://google.aip.dev/151
1445 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1446 /// [`future`]: @ref google::cloud::future
1447 /// [`StatusOr`]: @ref google::cloud::StatusOr
1448 /// [`Status`]: @ref google::cloud::Status
1449 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1450 /// [google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1012}
1451 ///
1452 // clang-format on
1453 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1454 SearchAllAssignments(std::string const& parent, std::string const& query,
1455 Options opts = {});
1456
1457 // clang-format off
1458 ///
1459 /// Looks up assignments for a specified resource for a particular region.
1460 /// If the request is about a project:
1461 ///
1462 /// 1. Assignments created on the project will be returned if they exist.
1463 /// 2. Otherwise assignments created on the closest ancestor will be
1464 /// returned.
1465 /// 3. Assignments for different JobTypes will all be returned.
1466 ///
1467 /// The same logic applies if the request is about a folder.
1468 ///
1469 /// If the request is about an organization, then assignments created on the
1470 /// organization will be returned (organization doesn't have ancestors).
1471 ///
1472 /// Comparing to ListAssignments, there are some behavior
1473 /// differences:
1474 ///
1475 /// 1. permission on the assignee will be verified in this API.
1476 /// 2. Hierarchy lookup (project->folder->organization) happens in this API.
1477 /// 3. Parent here is `projects/*/locations/*`, instead of
1478 /// `projects/*/locations/*reservations/*`.
1479 ///
1480 /// @param request Unary RPCs, such as the one wrapped by this
1481 /// function, receive a single `request` proto message which includes all
1482 /// the inputs for the RPC. In this case, the proto message is a
1483 /// [google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest].
1484 /// Proto messages are converted to C++ classes by Protobuf, using the
1485 /// [Protobuf mapping rules].
1486 /// @param opts Optional. Override the class-level options, such as retry and
1487 /// backoff policies.
1488 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1489 /// to iterate of the results. See the documentation of this type for
1490 /// details. In brief, this class has `begin()` and `end()` member
1491 /// functions returning a iterator class meeting the
1492 /// [input iterator requirements]. The value type for this iterator is a
1493 /// [`StatusOr`] as the iteration may fail even after some values are
1494 /// retrieved successfully, for example, if there is a network disconnect.
1495 /// An empty set of results does not indicate an error, it indicates
1496 /// that there are no resources meeting the request criteria.
1497 /// On a successful iteration the `StatusOr<T>` contains elements of type
1498 /// [google.cloud.bigquery.reservation.v1.Assignment], or rather,
1499 /// the C++ class generated by Protobuf from that type. Please consult the
1500 /// Protobuf documentation for details on the [Protobuf mapping rules].
1501 ///
1502 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1503 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1504 /// [Long Running Operation]: https://google.aip.dev/151
1505 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1506 /// [`future`]: @ref google::cloud::future
1507 /// [`StatusOr`]: @ref google::cloud::StatusOr
1508 /// [`Status`]: @ref google::cloud::Status
1509 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1510 /// [google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1012}
1511 ///
1512 // clang-format on
1513 StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
1515 google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest
1516 request,
1517 Options opts = {});
1518
1519 // clang-format off
1520 ///
1521 /// Moves an assignment under a new reservation.
1522 ///
1523 /// This differs from removing an existing assignment and recreating a new one
1524 /// by providing a transactional change that ensures an assignee always has an
1525 /// associated reservation.
1526 ///
1527 /// @param name Required. The resource name of the assignment,
1528 /// e.g.
1529 /// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
1530 /// @param destination_id The new reservation ID, e.g.:
1531 /// `projects/myotherproject/locations/US/reservations/team2-prod`
1532 /// @param opts Optional. Override the class-level options, such as retry and
1533 /// backoff policies.
1534 /// @return the result of the RPC. The response message type
1535 /// ([google.cloud.bigquery.reservation.v1.Assignment])
1536 /// is mapped to a C++ class using the [Protobuf mapping rules].
1537 /// If the request fails, the [`StatusOr`] contains the error details.
1538 ///
1539 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1540 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1541 /// [Long Running Operation]: https://google.aip.dev/151
1542 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1543 /// [`future`]: @ref google::cloud::future
1544 /// [`StatusOr`]: @ref google::cloud::StatusOr
1545 /// [`Status`]: @ref google::cloud::Status
1546 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1547 /// [google.cloud.bigquery.reservation.v1.MoveAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1070}
1548 ///
1549 // clang-format on
1550 StatusOr<google::cloud::bigquery::reservation::v1::Assignment> MoveAssignment(
1551 std::string const& name, std::string const& destination_id,
1552 Options opts = {});
1553
1554 // clang-format off
1555 ///
1556 /// Moves an assignment under a new reservation.
1557 ///
1558 /// This differs from removing an existing assignment and recreating a new one
1559 /// by providing a transactional change that ensures an assignee always has an
1560 /// associated reservation.
1561 ///
1562 /// @param request Unary RPCs, such as the one wrapped by this
1563 /// function, receive a single `request` proto message which includes all
1564 /// the inputs for the RPC. In this case, the proto message is a
1565 /// [google.cloud.bigquery.reservation.v1.MoveAssignmentRequest].
1566 /// Proto messages are converted to C++ classes by Protobuf, using the
1567 /// [Protobuf mapping rules].
1568 /// @param opts Optional. Override the class-level options, such as retry and
1569 /// backoff policies.
1570 /// @return the result of the RPC. The response message type
1571 /// ([google.cloud.bigquery.reservation.v1.Assignment])
1572 /// is mapped to a C++ class using the [Protobuf mapping rules].
1573 /// If the request fails, the [`StatusOr`] contains the error details.
1574 ///
1575 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1576 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1577 /// [Long Running Operation]: https://google.aip.dev/151
1578 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1579 /// [`future`]: @ref google::cloud::future
1580 /// [`StatusOr`]: @ref google::cloud::StatusOr
1581 /// [`Status`]: @ref google::cloud::Status
1582 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1583 /// [google.cloud.bigquery.reservation.v1.MoveAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1070}
1584 ///
1585 // clang-format on
1586 StatusOr<google::cloud::bigquery::reservation::v1::Assignment> MoveAssignment(
1587 google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const&
1588 request,
1589 Options opts = {});
1590
1591 // clang-format off
1592 ///
1593 /// Updates an existing assignment.
1594 ///
1595 /// Only the `priority` field can be updated.
1596 ///
1597 /// @param assignment Content of the assignment to update.
1598 /// @param update_mask Standard field mask for the set of fields to be updated.
1599 /// @param opts Optional. Override the class-level options, such as retry and
1600 /// backoff policies.
1601 /// @return the result of the RPC. The response message type
1602 /// ([google.cloud.bigquery.reservation.v1.Assignment])
1603 /// is mapped to a C++ class using the [Protobuf mapping rules].
1604 /// If the request fails, the [`StatusOr`] contains the error details.
1605 ///
1606 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1607 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1608 /// [Long Running Operation]: https://google.aip.dev/151
1609 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1610 /// [`future`]: @ref google::cloud::future
1611 /// [`StatusOr`]: @ref google::cloud::StatusOr
1612 /// [`Status`]: @ref google::cloud::Status
1613 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1614 /// [google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1097}
1615 ///
1616 // clang-format on
1617 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
1619 google::cloud::bigquery::reservation::v1::Assignment const& assignment,
1620 google::protobuf::FieldMask const& update_mask, Options opts = {});
1621
1622 // clang-format off
1623 ///
1624 /// Updates an existing assignment.
1625 ///
1626 /// Only the `priority` field can be updated.
1627 ///
1628 /// @param request Unary RPCs, such as the one wrapped by this
1629 /// function, receive a single `request` proto message which includes all
1630 /// the inputs for the RPC. In this case, the proto message is a
1631 /// [google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest].
1632 /// Proto messages are converted to C++ classes by Protobuf, using the
1633 /// [Protobuf mapping rules].
1634 /// @param opts Optional. Override the class-level options, such as retry and
1635 /// backoff policies.
1636 /// @return the result of the RPC. The response message type
1637 /// ([google.cloud.bigquery.reservation.v1.Assignment])
1638 /// is mapped to a C++ class using the [Protobuf mapping rules].
1639 /// If the request fails, the [`StatusOr`] contains the error details.
1640 ///
1641 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1642 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1643 /// [Long Running Operation]: https://google.aip.dev/151
1644 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1645 /// [`future`]: @ref google::cloud::future
1646 /// [`StatusOr`]: @ref google::cloud::StatusOr
1647 /// [`Status`]: @ref google::cloud::Status
1648 /// [google.cloud.bigquery.reservation.v1.Assignment]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L845}
1649 /// [google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1097}
1650 ///
1651 // clang-format on
1652 StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
1654 google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const&
1655 request,
1656 Options opts = {});
1657
1658 // clang-format off
1659 ///
1660 /// Retrieves a BI reservation.
1661 ///
1662 /// @param name Required. Name of the requested reservation, for example:
1663 /// `projects/{project_id}/locations/{location_id}/biReservation`
1664 /// @param opts Optional. Override the class-level options, such as retry and
1665 /// backoff policies.
1666 /// @return the result of the RPC. The response message type
1667 /// ([google.cloud.bigquery.reservation.v1.BiReservation])
1668 /// is mapped to a C++ class using the [Protobuf mapping rules].
1669 /// If the request fails, the [`StatusOr`] contains the error details.
1670 ///
1671 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1672 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1673 /// [Long Running Operation]: https://google.aip.dev/151
1674 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1675 /// [`future`]: @ref google::cloud::future
1676 /// [`StatusOr`]: @ref google::cloud::StatusOr
1677 /// [`Status`]: @ref google::cloud::Status
1678 /// [google.cloud.bigquery.reservation.v1.BiReservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1679 /// [google.cloud.bigquery.reservation.v1.GetBiReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1142}
1680 ///
1681 // clang-format on
1682 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1683 GetBiReservation(std::string const& name, Options opts = {});
1684
1685 // clang-format off
1686 ///
1687 /// Retrieves a BI reservation.
1688 ///
1689 /// @param request Unary RPCs, such as the one wrapped by this
1690 /// function, receive a single `request` proto message which includes all
1691 /// the inputs for the RPC. In this case, the proto message is a
1692 /// [google.cloud.bigquery.reservation.v1.GetBiReservationRequest].
1693 /// Proto messages are converted to C++ classes by Protobuf, using the
1694 /// [Protobuf mapping rules].
1695 /// @param opts Optional. Override the class-level options, such as retry and
1696 /// backoff policies.
1697 /// @return the result of the RPC. The response message type
1698 /// ([google.cloud.bigquery.reservation.v1.BiReservation])
1699 /// is mapped to a C++ class using the [Protobuf mapping rules].
1700 /// If the request fails, the [`StatusOr`] contains the error details.
1701 ///
1702 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1703 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1704 /// [Long Running Operation]: https://google.aip.dev/151
1705 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1706 /// [`future`]: @ref google::cloud::future
1707 /// [`StatusOr`]: @ref google::cloud::StatusOr
1708 /// [`Status`]: @ref google::cloud::Status
1709 /// [google.cloud.bigquery.reservation.v1.BiReservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1710 /// [google.cloud.bigquery.reservation.v1.GetBiReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1142}
1711 ///
1712 // clang-format on
1713 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1715 google::cloud::bigquery::reservation::v1::GetBiReservationRequest const&
1716 request,
1717 Options opts = {});
1718
1719 // clang-format off
1720 ///
1721 /// Updates a BI reservation.
1722 ///
1723 /// Only fields specified in the `field_mask` are updated.
1724 ///
1725 /// A singleton BI reservation always exists with default size 0.
1726 /// In order to reserve BI capacity it needs to be updated to an amount
1727 /// greater than 0. In order to release BI capacity reservation size
1728 /// must be set to 0.
1729 ///
1730 /// @param bi_reservation A reservation to update.
1731 /// @param update_mask A list of fields to be updated in this request.
1732 /// @param opts Optional. Override the class-level options, such as retry and
1733 /// backoff policies.
1734 /// @return the result of the RPC. The response message type
1735 /// ([google.cloud.bigquery.reservation.v1.BiReservation])
1736 /// is mapped to a C++ class using the [Protobuf mapping rules].
1737 /// If the request fails, the [`StatusOr`] contains the error details.
1738 ///
1739 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1740 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1741 /// [Long Running Operation]: https://google.aip.dev/151
1742 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1743 /// [`future`]: @ref google::cloud::future
1744 /// [`StatusOr`]: @ref google::cloud::StatusOr
1745 /// [`Status`]: @ref google::cloud::Status
1746 /// [google.cloud.bigquery.reservation.v1.BiReservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1747 /// [google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1154}
1748 ///
1749 // clang-format on
1750 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1752 google::cloud::bigquery::reservation::v1::BiReservation const&
1753 bi_reservation,
1754 google::protobuf::FieldMask const& update_mask, Options opts = {});
1755
1756 // clang-format off
1757 ///
1758 /// Updates a BI reservation.
1759 ///
1760 /// Only fields specified in the `field_mask` are updated.
1761 ///
1762 /// A singleton BI reservation always exists with default size 0.
1763 /// In order to reserve BI capacity it needs to be updated to an amount
1764 /// greater than 0. In order to release BI capacity reservation size
1765 /// must be set to 0.
1766 ///
1767 /// @param request Unary RPCs, such as the one wrapped by this
1768 /// function, receive a single `request` proto message which includes all
1769 /// the inputs for the RPC. In this case, the proto message is a
1770 /// [google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest].
1771 /// Proto messages are converted to C++ classes by Protobuf, using the
1772 /// [Protobuf mapping rules].
1773 /// @param opts Optional. Override the class-level options, such as retry and
1774 /// backoff policies.
1775 /// @return the result of the RPC. The response message type
1776 /// ([google.cloud.bigquery.reservation.v1.BiReservation])
1777 /// is mapped to a C++ class using the [Protobuf mapping rules].
1778 /// If the request fails, the [`StatusOr`] contains the error details.
1779 ///
1780 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1781 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1782 /// [Long Running Operation]: https://google.aip.dev/151
1783 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1784 /// [`future`]: @ref google::cloud::future
1785 /// [`StatusOr`]: @ref google::cloud::StatusOr
1786 /// [`Status`]: @ref google::cloud::Status
1787 /// [google.cloud.bigquery.reservation.v1.BiReservation]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1119}
1788 /// [google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest]: @googleapis_reference_link{google/cloud/bigquery/reservation/v1/reservation.proto#L1154}
1789 ///
1790 // clang-format on
1791 StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
1792 UpdateBiReservation(google::cloud::bigquery::reservation::v1::
1793 UpdateBiReservationRequest const& request,
1794 Options opts = {});
1795
1796 private:
1797 std::shared_ptr<ReservationServiceConnection> connection_;
1798 Options options_;
1799};
1800
1801GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1802} // namespace bigquery_reservation_v1
1803} // namespace cloud
1804} // namespace google
1805
1806#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