Google Cloud BigQuery C++ Client  2.1.0
A C++ Client Library for Google Cloud BigQuery
reservation_connection.h
Go to the documentation of this file.
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_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_H
21 
22 #include "google/cloud/bigquery/internal/reservation_retry_traits.h"
23 #include "google/cloud/bigquery/internal/reservation_stub.h"
24 #include "google/cloud/bigquery/reservation_connection_idempotency_policy.h"
25 #include "google/cloud/backoff_policy.h"
26 #include "google/cloud/options.h"
27 #include "google/cloud/status_or.h"
28 #include "google/cloud/stream_range.h"
29 #include "google/cloud/version.h"
30 #include <memory>
31 
32 namespace google {
33 namespace cloud {
34 namespace bigquery {
36 
37 using ReservationServiceRetryPolicy =
38  ::google::cloud::internal::TraitBasedRetryPolicy<
39  bigquery_internal::ReservationServiceRetryTraits>;
40 
41 using ReservationServiceLimitedTimeRetryPolicy =
42  ::google::cloud::internal::LimitedTimeRetryPolicy<
43  bigquery_internal::ReservationServiceRetryTraits>;
44 
45 using ReservationServiceLimitedErrorCountRetryPolicy =
46  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47  bigquery_internal::ReservationServiceRetryTraits>;
48 
49 /**
50  * The `ReservationServiceConnection` object for `ReservationServiceClient`.
51  *
52  * This interface defines virtual methods for each of the user-facing overload
53  * sets in `ReservationServiceClient`. This allows users to inject custom
54  * behavior (e.g., with a Google Mock object) when writing tests that use
55  * objects of type `ReservationServiceClient`.
56  *
57  * To create a concrete instance, see `MakeReservationServiceConnection()`.
58  *
59  * For mocking, see `bigquery_mocks::MockReservationServiceConnection`.
60  */
62  public:
64 
65  virtual Options options() { return Options{}; }
66 
67  virtual StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
69  google::cloud::bigquery::reservation::v1::CreateReservationRequest const&
70  request);
71 
72  virtual StreamRange<google::cloud::bigquery::reservation::v1::Reservation>
74  google::cloud::bigquery::reservation::v1::ListReservationsRequest
75  request);
76 
77  virtual StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
79  google::cloud::bigquery::reservation::v1::GetReservationRequest const&
80  request);
81 
83  google::cloud::bigquery::reservation::v1::DeleteReservationRequest const&
84  request);
85 
86  virtual StatusOr<google::cloud::bigquery::reservation::v1::Reservation>
88  google::cloud::bigquery::reservation::v1::UpdateReservationRequest const&
89  request);
90 
91  virtual StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
93  CreateCapacityCommitmentRequest const& request);
94 
95  virtual StreamRange<
96  google::cloud::bigquery::reservation::v1::CapacityCommitment>
98  google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest
99  request);
100 
101  virtual StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
103  GetCapacityCommitmentRequest const& request);
104 
106  google::cloud::bigquery::reservation::v1::
107  DeleteCapacityCommitmentRequest const& request);
108 
109  virtual StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
111  UpdateCapacityCommitmentRequest const& request);
112 
113  virtual StatusOr<
114  google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse>
116  SplitCapacityCommitmentRequest const& request);
117 
118  virtual StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment>
120  MergeCapacityCommitmentsRequest const& request);
121 
122  virtual StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
124  google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const&
125  request);
126 
127  virtual StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
129  google::cloud::bigquery::reservation::v1::ListAssignmentsRequest request);
130 
132  google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const&
133  request);
134 
135  virtual StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
137  google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest
138  request);
139 
140  virtual StreamRange<google::cloud::bigquery::reservation::v1::Assignment>
142  google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest
143  request);
144 
145  virtual StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
147  google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const&
148  request);
149 
150  virtual StatusOr<google::cloud::bigquery::reservation::v1::Assignment>
152  google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const&
153  request);
154 
155  virtual StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
157  google::cloud::bigquery::reservation::v1::GetBiReservationRequest const&
158  request);
159 
160  virtual StatusOr<google::cloud::bigquery::reservation::v1::BiReservation>
162  UpdateBiReservationRequest const& request);
163 };
164 
165 /**
166  * A factory function to construct an object of type
167  * `ReservationServiceConnection`.
168  *
169  * The returned connection object should not be used directly; instead it
170  * should be passed as an argument to the constructor of
171  * ReservationServiceClient, and that class used instead.
172  *
173  * The optional @p opts argument may be used to configure aspects of the
174  * returned `ReservationServiceConnection`. Expected options are any of the
175  * types in the following option lists:
176  *
177  * - `google::cloud::CommonOptionList`
178  * - `google::cloud::GrpcOptionList`
179  * - `google::cloud::bigquery::ReservationServicePolicyOptionList`
180  *
181  * @note Unrecognized options will be ignored. To debug issues with options set
182  * `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment and unexpected
183  * options will be logged.
184  *
185  * @param options (optional) Configure the `ReservationServiceConnection`
186  * created by this function.
187  */
189  Options options = {});
190 
192 } // namespace bigquery
193 } // namespace cloud
194 } // namespace google
195 
196 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_RESERVATION_CONNECTION_H