Google Cloud BigQuery C++ Client 2.11.0
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
connection_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/connection/v1/connection.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CLIENT_H
21
22#include "google/cloud/bigquery/connection/v1/connection_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 {
32namespace bigquery_connection_v1 {
33GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
34
35///
36/// Manages external data source connections and credentials.
37///
38/// @par Equality
39///
40/// Instances of this class created via copy-construction or copy-assignment
41/// always compare equal. Instances created with equal
42/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
43/// equal share the same underlying resources.
44///
45/// @par Performance
46///
47/// Creating a new instance of this class is a relatively expensive operation,
48/// new objects establish new connections to the service. In contrast,
49/// copy-construction, move-construction, and the corresponding assignment
50/// operations are relatively efficient as the copies share all underlying
51/// resources.
52///
53/// @par Thread Safety
54///
55/// Concurrent access to different instances of this class, even if they compare
56/// equal, is guaranteed to work. Two or more threads operating on the same
57/// instance of this class is not guaranteed to work. Since copy-construction
58/// and move-construction is a relatively efficient operation, consider using
59/// such a copy when using this class from multiple threads.
60///
62 public:
64 std::shared_ptr<ConnectionServiceConnection> connection,
65 Options opts = {});
67
68 ///@{
69 /// @name Copy and move support
74 ///@}
75
76 ///@{
77 /// @name Equality
78 friend bool operator==(ConnectionServiceClient const& a,
79 ConnectionServiceClient const& b) {
80 return a.connection_ == b.connection_;
81 }
82 friend bool operator!=(ConnectionServiceClient const& a,
83 ConnectionServiceClient const& b) {
84 return !(a == b);
85 }
86 ///@}
87
88 // clang-format off
89 ///
90 /// Creates a new connection.
91 ///
92 /// @param parent Required. Parent resource name.
93 /// Must be in the format `projects/{project_id}/locations/{location_id}`
94 /// @param connection Required. Connection to create.
95 /// @param connection_id Optional. Connection id that should be assigned to the created connection.
96 /// @param opts Optional. Override the class-level options, such as retry and
97 /// backoff policies.
98 /// @return the result of the RPC. The response message type
99 /// ([google.cloud.bigquery.connection.v1.Connection])
100 /// is mapped to a C++ class using the [Protobuf mapping rules].
101 /// If the request fails, the [`StatusOr`] contains the error details.
102 ///
103 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
104 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
105 /// [Long Running Operation]: https://google.aip.dev/151
106 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
107 /// [`future`]: @ref google::cloud::future
108 /// [`StatusOr`]: @ref google::cloud::StatusOr
109 /// [`Status`]: @ref google::cloud::Status
110 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
111 /// [google.cloud.bigquery.connection.v1.CreateConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L138}
112 ///
113 // clang-format on
114 StatusOr<google::cloud::bigquery::connection::v1::Connection>
116 std::string const& parent,
117 google::cloud::bigquery::connection::v1::Connection const& connection,
118 std::string const& connection_id, Options opts = {});
119
120 // clang-format off
121 ///
122 /// Creates a new connection.
123 ///
124 /// @param request Unary RPCs, such as the one wrapped by this
125 /// function, receive a single `request` proto message which includes all
126 /// the inputs for the RPC. In this case, the proto message is a
127 /// [google.cloud.bigquery.connection.v1.CreateConnectionRequest].
128 /// Proto messages are converted to C++ classes by Protobuf, using the
129 /// [Protobuf mapping rules].
130 /// @param opts Optional. Override the class-level options, such as retry and
131 /// backoff policies.
132 /// @return the result of the RPC. The response message type
133 /// ([google.cloud.bigquery.connection.v1.Connection])
134 /// is mapped to a C++ class using the [Protobuf mapping rules].
135 /// If the request fails, the [`StatusOr`] contains the error details.
136 ///
137 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
138 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
139 /// [Long Running Operation]: https://google.aip.dev/151
140 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
141 /// [`future`]: @ref google::cloud::future
142 /// [`StatusOr`]: @ref google::cloud::StatusOr
143 /// [`Status`]: @ref google::cloud::Status
144 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
145 /// [google.cloud.bigquery.connection.v1.CreateConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L138}
146 ///
147 // clang-format on
148 StatusOr<google::cloud::bigquery::connection::v1::Connection>
150 google::cloud::bigquery::connection::v1::CreateConnectionRequest const&
151 request,
152 Options opts = {});
153
154 // clang-format off
155 ///
156 /// Returns specified connection.
157 ///
158 /// @param name Required. Name of the requested connection, for example:
159 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
160 /// @param opts Optional. Override the class-level options, such as retry and
161 /// backoff policies.
162 /// @return the result of the RPC. The response message type
163 /// ([google.cloud.bigquery.connection.v1.Connection])
164 /// is mapped to a C++ class using the [Protobuf mapping rules].
165 /// If the request fails, the [`StatusOr`] contains the error details.
166 ///
167 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
168 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
169 /// [Long Running Operation]: https://google.aip.dev/151
170 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
171 /// [`future`]: @ref google::cloud::future
172 /// [`StatusOr`]: @ref google::cloud::StatusOr
173 /// [`Status`]: @ref google::cloud::Status
174 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
175 /// [google.cloud.bigquery.connection.v1.GetConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L157}
176 ///
177 // clang-format on
178 StatusOr<google::cloud::bigquery::connection::v1::Connection> GetConnection(
179 std::string const& name, Options opts = {});
180
181 // clang-format off
182 ///
183 /// Returns specified connection.
184 ///
185 /// @param request Unary RPCs, such as the one wrapped by this
186 /// function, receive a single `request` proto message which includes all
187 /// the inputs for the RPC. In this case, the proto message is a
188 /// [google.cloud.bigquery.connection.v1.GetConnectionRequest].
189 /// Proto messages are converted to C++ classes by Protobuf, using the
190 /// [Protobuf mapping rules].
191 /// @param opts Optional. Override the class-level options, such as retry and
192 /// backoff policies.
193 /// @return the result of the RPC. The response message type
194 /// ([google.cloud.bigquery.connection.v1.Connection])
195 /// is mapped to a C++ class using the [Protobuf mapping rules].
196 /// If the request fails, the [`StatusOr`] contains the error details.
197 ///
198 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
199 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
200 /// [Long Running Operation]: https://google.aip.dev/151
201 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
202 /// [`future`]: @ref google::cloud::future
203 /// [`StatusOr`]: @ref google::cloud::StatusOr
204 /// [`Status`]: @ref google::cloud::Status
205 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
206 /// [google.cloud.bigquery.connection.v1.GetConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L157}
207 ///
208 // clang-format on
209 StatusOr<google::cloud::bigquery::connection::v1::Connection> GetConnection(
210 google::cloud::bigquery::connection::v1::GetConnectionRequest const&
211 request,
212 Options opts = {});
213
214 // clang-format off
215 ///
216 /// Returns a list of connections in the given project.
217 ///
218 /// @param parent Required. Parent resource name.
219 /// Must be in the form: `projects/{project_id}/locations/{location_id}`
220 /// @param opts Optional. Override the class-level options, such as retry and
221 /// backoff policies.
222 /// @return a [StreamRange](@ref google::cloud::StreamRange)
223 /// to iterate of the results. See the documentation of this type for
224 /// details. In brief, this class has `begin()` and `end()` member
225 /// functions returning a iterator class meeting the
226 /// [input iterator requirements]. The value type for this iterator is a
227 /// [`StatusOr`] as the iteration may fail even after some values are
228 /// retrieved successfully, for example, if there is a network disconnect.
229 /// An empty set of results does not indicate an error, it indicates
230 /// that there are no resources meeting the request criteria.
231 /// On a successful iteration the `StatusOr<T>` contains elements of type
232 /// [google.cloud.bigquery.connection.v1.Connection], or rather,
233 /// the C++ class generated by Protobuf from that type. Please consult the
234 /// Protobuf documentation for details on the [Protobuf mapping rules].
235 ///
236 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
237 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
238 /// [Long Running Operation]: https://google.aip.dev/151
239 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
240 /// [`future`]: @ref google::cloud::future
241 /// [`StatusOr`]: @ref google::cloud::StatusOr
242 /// [`Status`]: @ref google::cloud::Status
243 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
244 /// [google.cloud.bigquery.connection.v1.ListConnectionsRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L170}
245 ///
246 // clang-format on
247 StreamRange<google::cloud::bigquery::connection::v1::Connection>
248 ListConnections(std::string const& parent, Options opts = {});
249
250 // clang-format off
251 ///
252 /// Returns a list of connections in the given project.
253 ///
254 /// @param request Unary RPCs, such as the one wrapped by this
255 /// function, receive a single `request` proto message which includes all
256 /// the inputs for the RPC. In this case, the proto message is a
257 /// [google.cloud.bigquery.connection.v1.ListConnectionsRequest].
258 /// Proto messages are converted to C++ classes by Protobuf, using the
259 /// [Protobuf mapping rules].
260 /// @param opts Optional. Override the class-level options, such as retry and
261 /// backoff policies.
262 /// @return a [StreamRange](@ref google::cloud::StreamRange)
263 /// to iterate of the results. See the documentation of this type for
264 /// details. In brief, this class has `begin()` and `end()` member
265 /// functions returning a iterator class meeting the
266 /// [input iterator requirements]. The value type for this iterator is a
267 /// [`StatusOr`] as the iteration may fail even after some values are
268 /// retrieved successfully, for example, if there is a network disconnect.
269 /// An empty set of results does not indicate an error, it indicates
270 /// that there are no resources meeting the request criteria.
271 /// On a successful iteration the `StatusOr<T>` contains elements of type
272 /// [google.cloud.bigquery.connection.v1.Connection], or rather,
273 /// the C++ class generated by Protobuf from that type. Please consult the
274 /// Protobuf documentation for details on the [Protobuf mapping rules].
275 ///
276 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
277 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
278 /// [Long Running Operation]: https://google.aip.dev/151
279 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
280 /// [`future`]: @ref google::cloud::future
281 /// [`StatusOr`]: @ref google::cloud::StatusOr
282 /// [`Status`]: @ref google::cloud::Status
283 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
284 /// [google.cloud.bigquery.connection.v1.ListConnectionsRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L170}
285 ///
286 // clang-format on
287 StreamRange<google::cloud::bigquery::connection::v1::Connection>
289 google::cloud::bigquery::connection::v1::ListConnectionsRequest request,
290 Options opts = {});
291
292 // clang-format off
293 ///
294 /// Updates the specified connection. For security reasons, also resets
295 /// credential if connection properties are in the update field mask.
296 ///
297 /// @param name Required. Name of the connection to update, for example:
298 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
299 /// @param connection Required. Connection containing the updated fields.
300 /// @param update_mask Required. Update mask for the connection fields to be updated.
301 /// @param opts Optional. Override the class-level options, such as retry and
302 /// backoff policies.
303 /// @return the result of the RPC. The response message type
304 /// ([google.cloud.bigquery.connection.v1.Connection])
305 /// is mapped to a C++ class using the [Protobuf mapping rules].
306 /// If the request fails, the [`StatusOr`] contains the error details.
307 ///
308 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
309 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
310 /// [Long Running Operation]: https://google.aip.dev/151
311 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
312 /// [`future`]: @ref google::cloud::future
313 /// [`StatusOr`]: @ref google::cloud::StatusOr
314 /// [`Status`]: @ref google::cloud::Status
315 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
316 /// [google.cloud.bigquery.connection.v1.UpdateConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L199}
317 ///
318 // clang-format on
319 StatusOr<google::cloud::bigquery::connection::v1::Connection>
321 std::string const& name,
322 google::cloud::bigquery::connection::v1::Connection const& connection,
323 google::protobuf::FieldMask const& update_mask, Options opts = {});
324
325 // clang-format off
326 ///
327 /// Updates the specified connection. For security reasons, also resets
328 /// credential if connection properties are in the update field mask.
329 ///
330 /// @param request Unary RPCs, such as the one wrapped by this
331 /// function, receive a single `request` proto message which includes all
332 /// the inputs for the RPC. In this case, the proto message is a
333 /// [google.cloud.bigquery.connection.v1.UpdateConnectionRequest].
334 /// Proto messages are converted to C++ classes by Protobuf, using the
335 /// [Protobuf mapping rules].
336 /// @param opts Optional. Override the class-level options, such as retry and
337 /// backoff policies.
338 /// @return the result of the RPC. The response message type
339 /// ([google.cloud.bigquery.connection.v1.Connection])
340 /// is mapped to a C++ class using the [Protobuf mapping rules].
341 /// If the request fails, the [`StatusOr`] contains the error details.
342 ///
343 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
344 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
345 /// [Long Running Operation]: https://google.aip.dev/151
346 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
347 /// [`future`]: @ref google::cloud::future
348 /// [`StatusOr`]: @ref google::cloud::StatusOr
349 /// [`Status`]: @ref google::cloud::Status
350 /// [google.cloud.bigquery.connection.v1.Connection]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L231}
351 /// [google.cloud.bigquery.connection.v1.UpdateConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L199}
352 ///
353 // clang-format on
354 StatusOr<google::cloud::bigquery::connection::v1::Connection>
356 google::cloud::bigquery::connection::v1::UpdateConnectionRequest const&
357 request,
358 Options opts = {});
359
360 // clang-format off
361 ///
362 /// Deletes connection and associated credential.
363 ///
364 /// @param name Required. Name of the deleted connection, for example:
365 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
366 /// @param opts Optional. Override the class-level options, such as retry and
367 /// backoff policies.
368 /// @return a [`Status`] object. If the request failed, the
369 /// status contains the details of the failure.
370 ///
371 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
372 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
373 /// [Long Running Operation]: https://google.aip.dev/151
374 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
375 /// [`future`]: @ref google::cloud::future
376 /// [`StatusOr`]: @ref google::cloud::StatusOr
377 /// [`Status`]: @ref google::cloud::Status
378 /// [google.cloud.bigquery.connection.v1.DeleteConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L218}
379 ///
380 // clang-format on
381 Status DeleteConnection(std::string const& name, Options opts = {});
382
383 // clang-format off
384 ///
385 /// Deletes connection and associated credential.
386 ///
387 /// @param request Unary RPCs, such as the one wrapped by this
388 /// function, receive a single `request` proto message which includes all
389 /// the inputs for the RPC. In this case, the proto message is a
390 /// [google.cloud.bigquery.connection.v1.DeleteConnectionRequest].
391 /// Proto messages are converted to C++ classes by Protobuf, using the
392 /// [Protobuf mapping rules].
393 /// @param opts Optional. Override the class-level options, such as retry and
394 /// backoff policies.
395 /// @return a [`Status`] object. If the request failed, the
396 /// status contains the details of the failure.
397 ///
398 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
399 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
400 /// [Long Running Operation]: https://google.aip.dev/151
401 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
402 /// [`future`]: @ref google::cloud::future
403 /// [`StatusOr`]: @ref google::cloud::StatusOr
404 /// [`Status`]: @ref google::cloud::Status
405 /// [google.cloud.bigquery.connection.v1.DeleteConnectionRequest]: @googleapis_reference_link{google/cloud/bigquery/connection/v1/connection.proto#L218}
406 ///
407 // clang-format on
409 google::cloud::bigquery::connection::v1::DeleteConnectionRequest const&
410 request,
411 Options opts = {});
412
413 // clang-format off
414 ///
415 /// Gets the access control policy for a resource.
416 /// Returns an empty policy if the resource exists and does not have a policy
417 /// set.
418 ///
419 /// @param resource REQUIRED: The resource for which the policy is being requested.
420 /// See the operation documentation for the appropriate value for this field.
421 /// @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to
422 /// `GetIamPolicy`.
423 /// @param opts Optional. Override the class-level options, such as retry and
424 /// backoff policies.
425 /// @return the result of the RPC. The response message type
426 /// ([google.iam.v1.Policy])
427 /// is mapped to a C++ class using the [Protobuf mapping rules].
428 /// If the request fails, the [`StatusOr`] contains the error details.
429 ///
430 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
431 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
432 /// [Long Running Operation]: https://google.aip.dev/151
433 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
434 /// [`future`]: @ref google::cloud::future
435 /// [`StatusOr`]: @ref google::cloud::StatusOr
436 /// [`Status`]: @ref google::cloud::Status
437 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
438 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
439 ///
440 // clang-format on
441 StatusOr<google::iam::v1::Policy> GetIamPolicy(
442 std::string const& resource,
443 google::iam::v1::GetPolicyOptions const& options, Options opts = {});
444
445 // clang-format off
446 ///
447 /// Gets the access control policy for a resource.
448 /// Returns an empty policy if the resource exists and does not have a policy
449 /// set.
450 ///
451 /// @param request Unary RPCs, such as the one wrapped by this
452 /// function, receive a single `request` proto message which includes all
453 /// the inputs for the RPC. In this case, the proto message is a
454 /// [google.iam.v1.GetIamPolicyRequest].
455 /// Proto messages are converted to C++ classes by Protobuf, using the
456 /// [Protobuf mapping rules].
457 /// @param opts Optional. Override the class-level options, such as retry and
458 /// backoff policies.
459 /// @return the result of the RPC. The response message type
460 /// ([google.iam.v1.Policy])
461 /// is mapped to a C++ class using the [Protobuf mapping rules].
462 /// If the request fails, the [`StatusOr`] contains the error details.
463 ///
464 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
465 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
466 /// [Long Running Operation]: https://google.aip.dev/151
467 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
468 /// [`future`]: @ref google::cloud::future
469 /// [`StatusOr`]: @ref google::cloud::StatusOr
470 /// [`Status`]: @ref google::cloud::Status
471 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
472 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
473 ///
474 // clang-format on
475 StatusOr<google::iam::v1::Policy> GetIamPolicy(
476 google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
477
478 // clang-format off
479 ///
480 /// Sets the access control policy on the specified resource. Replaces any
481 /// existing policy.
482 ///
483 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
484 ///
485 /// @param resource REQUIRED: The resource for which the policy is being specified.
486 /// See the operation documentation for the appropriate value for this field.
487 /// @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of
488 /// the policy is limited to a few 10s of KB. An empty policy is a
489 /// valid policy but certain Cloud Platform services (such as Projects)
490 /// might reject them.
491 /// @param opts Optional. Override the class-level options, such as retry and
492 /// backoff policies.
493 /// @return the result of the RPC. The response message type
494 /// ([google.iam.v1.Policy])
495 /// is mapped to a C++ class using the [Protobuf mapping rules].
496 /// If the request fails, the [`StatusOr`] contains the error details.
497 ///
498 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
499 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
500 /// [Long Running Operation]: https://google.aip.dev/151
501 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
502 /// [`future`]: @ref google::cloud::future
503 /// [`StatusOr`]: @ref google::cloud::StatusOr
504 /// [`Status`]: @ref google::cloud::Status
505 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
506 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
507 ///
508 // clang-format on
509 StatusOr<google::iam::v1::Policy> SetIamPolicy(
510 std::string const& resource, google::iam::v1::Policy const& policy,
511 Options opts = {});
512
513 // clang-format off
514 ///
515 /// Sets the access control policy on the specified resource. Replaces any
516 /// existing policy.
517 ///
518 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
519 ///
520 /// @param request Unary RPCs, such as the one wrapped by this
521 /// function, receive a single `request` proto message which includes all
522 /// the inputs for the RPC. In this case, the proto message is a
523 /// [google.iam.v1.SetIamPolicyRequest].
524 /// Proto messages are converted to C++ classes by Protobuf, using the
525 /// [Protobuf mapping rules].
526 /// @param opts Optional. Override the class-level options, such as retry and
527 /// backoff policies.
528 /// @return the result of the RPC. The response message type
529 /// ([google.iam.v1.Policy])
530 /// is mapped to a C++ class using the [Protobuf mapping rules].
531 /// If the request fails, the [`StatusOr`] contains the error details.
532 ///
533 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
534 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
535 /// [Long Running Operation]: https://google.aip.dev/151
536 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
537 /// [`future`]: @ref google::cloud::future
538 /// [`StatusOr`]: @ref google::cloud::StatusOr
539 /// [`Status`]: @ref google::cloud::Status
540 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
541 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
542 ///
543 // clang-format on
544 StatusOr<google::iam::v1::Policy> SetIamPolicy(
545 google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
546
547 // clang-format off
548 ///
549 /// Returns permissions that a caller has on the specified resource.
550 /// If the resource does not exist, this will return an empty set of
551 /// permissions, not a `NOT_FOUND` error.
552 ///
553 /// Note: This operation is designed to be used for building permission-aware
554 /// UIs and command-line tools, not for authorization checking. This operation
555 /// may "fail open" without warning.
556 ///
557 /// @param resource REQUIRED: The resource for which the policy detail is being requested.
558 /// See the operation documentation for the appropriate value for this field.
559 /// @param permissions The set of permissions to check for the `resource`. Permissions with
560 /// wildcards (such as '*' or 'storage.*') are not allowed. For more
561 /// information see
562 /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
563 /// @param opts Optional. Override the class-level options, such as retry and
564 /// backoff policies.
565 /// @return the result of the RPC. The response message type
566 /// ([google.iam.v1.TestIamPermissionsResponse])
567 /// is mapped to a C++ class using the [Protobuf mapping rules].
568 /// If the request fails, the [`StatusOr`] contains the error details.
569 ///
570 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
571 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
572 /// [Long Running Operation]: https://google.aip.dev/151
573 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
574 /// [`future`]: @ref google::cloud::future
575 /// [`StatusOr`]: @ref google::cloud::StatusOr
576 /// [`Status`]: @ref google::cloud::Status
577 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
578 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
579 ///
580 // clang-format on
581 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
582 std::string const& resource, std::vector<std::string> const& permissions,
583 Options opts = {});
584
585 // clang-format off
586 ///
587 /// Returns permissions that a caller has on the specified resource.
588 /// If the resource does not exist, this will return an empty set of
589 /// permissions, not a `NOT_FOUND` error.
590 ///
591 /// Note: This operation is designed to be used for building permission-aware
592 /// UIs and command-line tools, not for authorization checking. This operation
593 /// may "fail open" without warning.
594 ///
595 /// @param request Unary RPCs, such as the one wrapped by this
596 /// function, receive a single `request` proto message which includes all
597 /// the inputs for the RPC. In this case, the proto message is a
598 /// [google.iam.v1.TestIamPermissionsRequest].
599 /// Proto messages are converted to C++ classes by Protobuf, using the
600 /// [Protobuf mapping rules].
601 /// @param opts Optional. Override the class-level options, such as retry and
602 /// backoff policies.
603 /// @return the result of the RPC. The response message type
604 /// ([google.iam.v1.TestIamPermissionsResponse])
605 /// is mapped to a C++ class using the [Protobuf mapping rules].
606 /// If the request fails, the [`StatusOr`] contains the error details.
607 ///
608 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
609 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
610 /// [Long Running Operation]: https://google.aip.dev/151
611 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
612 /// [`future`]: @ref google::cloud::future
613 /// [`StatusOr`]: @ref google::cloud::StatusOr
614 /// [`Status`]: @ref google::cloud::Status
615 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
616 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
617 ///
618 // clang-format on
619 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
620 google::iam::v1::TestIamPermissionsRequest const& request,
621 Options opts = {});
622
623 private:
624 std::shared_ptr<ConnectionServiceConnection> connection_;
625 Options options_;
626};
627
628GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
629} // namespace bigquery_connection_v1
630} // namespace cloud
631} // namespace google
632
633#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_V1_CONNECTION_CLIENT_H
Manages external data source connections and credentials.
Definition: connection_client.h:61
Status DeleteConnection(google::cloud::bigquery::connection::v1::DeleteConnectionRequest const &request, Options opts={})
Deletes connection and associated credential.
StatusOr< google::cloud::bigquery::connection::v1::Connection > CreateConnection(google::cloud::bigquery::connection::v1::CreateConnectionRequest const &request, Options opts={})
Creates a new connection.
friend bool operator==(ConnectionServiceClient const &a, ConnectionServiceClient const &b)
Definition: connection_client.h:78
StatusOr< google::cloud::bigquery::connection::v1::Connection > CreateConnection(std::string const &parent, google::cloud::bigquery::connection::v1::Connection const &connection, std::string const &connection_id, Options opts={})
Creates a new connection.
StreamRange< google::cloud::bigquery::connection::v1::Connection > ListConnections(google::cloud::bigquery::connection::v1::ListConnectionsRequest request, Options opts={})
Returns a list of connections in the given project.
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
Returns permissions that a caller has on the specified resource.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
Sets the access control policy on the specified resource.
ConnectionServiceClient & operator=(ConnectionServiceClient const &)=default
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
Returns permissions that a caller has on the specified resource.
StatusOr< google::iam::v1::Policy > GetIamPolicy(std::string const &resource, google::iam::v1::GetPolicyOptions const &options, Options opts={})
Gets the access control policy for a resource.
StatusOr< google::cloud::bigquery::connection::v1::Connection > GetConnection(std::string const &name, Options opts={})
Returns specified connection.
ConnectionServiceClient(ConnectionServiceClient const &)=default
Status DeleteConnection(std::string const &name, Options opts={})
Deletes connection and associated credential.
StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
Gets the access control policy for a resource.
ConnectionServiceClient & operator=(ConnectionServiceClient &&)=default
StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
Sets the access control policy on the specified resource.
ConnectionServiceClient(ConnectionServiceClient &&)=default
ConnectionServiceClient(std::shared_ptr< ConnectionServiceConnection > connection, Options opts={})
StatusOr< google::cloud::bigquery::connection::v1::Connection > UpdateConnection(google::cloud::bigquery::connection::v1::UpdateConnectionRequest const &request, Options opts={})
Updates the specified connection.
StatusOr< google::cloud::bigquery::connection::v1::Connection > GetConnection(google::cloud::bigquery::connection::v1::GetConnectionRequest const &request, Options opts={})
Returns specified connection.
StatusOr< google::cloud::bigquery::connection::v1::Connection > UpdateConnection(std::string const &name, google::cloud::bigquery::connection::v1::Connection const &connection, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates the specified connection.
StreamRange< google::cloud::bigquery::connection::v1::Connection > ListConnections(std::string const &parent, Options opts={})
Returns a list of connections in the given project.
friend bool operator!=(ConnectionServiceClient const &a, ConnectionServiceClient const &b)
Definition: connection_client.h:82
The ConnectionServiceConnection object for ConnectionServiceClient.
Definition: connection_connection.h:62
Definition: connection_client.h:32
Definition: analytics_hub_client.h:30