Google Cloud BigQuery C++ Client  2.4.0
A C++ Client Library for Google Cloud BigQuery
connection_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/connection/v1/connection.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_H
21 
22 #include "google/cloud/bigquery/connection_connection_idempotency_policy.h"
23 #include "google/cloud/bigquery/internal/connection_retry_traits.h"
24 #include "google/cloud/bigquery/internal/connection_stub.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 ConnectionServiceRetryPolicy =
38  ::google::cloud::internal::TraitBasedRetryPolicy<
39  bigquery_internal::ConnectionServiceRetryTraits>;
40 
41 using ConnectionServiceLimitedTimeRetryPolicy =
42  ::google::cloud::internal::LimitedTimeRetryPolicy<
43  bigquery_internal::ConnectionServiceRetryTraits>;
44 
45 using ConnectionServiceLimitedErrorCountRetryPolicy =
46  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47  bigquery_internal::ConnectionServiceRetryTraits>;
48 
49 /**
50  * The `ConnectionServiceConnection` object for `ConnectionServiceClient`.
51  *
52  * This interface defines virtual methods for each of the user-facing overload
53  * sets in `ConnectionServiceClient`. This allows users to inject custom
54  * behavior (e.g., with a Google Mock object) when writing tests that use
55  * objects of type `ConnectionServiceClient`.
56  *
57  * To create a concrete instance, see `MakeConnectionServiceConnection()`.
58  *
59  * For mocking, see `bigquery_mocks::MockConnectionServiceConnection`.
60  */
62  public:
64 
65  virtual Options options() { return Options{}; }
66 
67  virtual StatusOr<google::cloud::bigquery::connection::v1::Connection>
69  google::cloud::bigquery::connection::v1::CreateConnectionRequest const&
70  request);
71 
72  virtual StatusOr<google::cloud::bigquery::connection::v1::Connection>
74  google::cloud::bigquery::connection::v1::GetConnectionRequest const&
75  request);
76 
77  virtual StreamRange<google::cloud::bigquery::connection::v1::Connection>
79  google::cloud::bigquery::connection::v1::ListConnectionsRequest request);
80 
81  virtual StatusOr<google::cloud::bigquery::connection::v1::Connection>
83  google::cloud::bigquery::connection::v1::UpdateConnectionRequest const&
84  request);
85 
87  google::cloud::bigquery::connection::v1::DeleteConnectionRequest const&
88  request);
89 
90  virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
91  google::iam::v1::GetIamPolicyRequest const& request);
92 
93  virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
94  google::iam::v1::SetIamPolicyRequest const& request);
95 
96  virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
97  TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
98 };
99 
100 /**
101  * A factory function to construct an object of type
102  * `ConnectionServiceConnection`.
103  *
104  * The returned connection object should not be used directly; instead it
105  * should be passed as an argument to the constructor of
106  * ConnectionServiceClient.
107  *
108  * The optional @p options argument may be used to configure aspects of the
109  * returned `ConnectionServiceConnection`. Expected options are any of the types
110  * in the following option lists:
111  *
112  * - `google::cloud::CommonOptionList`
113  * - `google::cloud::GrpcOptionList`
114  * - `google::cloud::UnifiedCredentialsOptionList`
115  * - `google::cloud::bigquery::ConnectionServicePolicyOptionList`
116  *
117  * @note Unexpected options will be ignored. To log unexpected options instead,
118  * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
119  *
120  * @param options (optional) Configure the `ConnectionServiceConnection` created
121  * by this function.
122  */
124  Options options = {});
125 
127 } // namespace bigquery
128 } // namespace cloud
129 } // namespace google
130 
131 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_CONNECTION_CONNECTION_H