Google Cloud BigQuery C++ Client  2.4.0
A C++ Client Library for Google Cloud BigQuery
data_transfer_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/datatransfer/v1/datatransfer.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_H
21 
22 #include "google/cloud/bigquery/data_transfer_connection_idempotency_policy.h"
23 #include "google/cloud/bigquery/internal/data_transfer_retry_traits.h"
24 #include "google/cloud/bigquery/internal/data_transfer_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 DataTransferServiceRetryPolicy =
38  ::google::cloud::internal::TraitBasedRetryPolicy<
39  bigquery_internal::DataTransferServiceRetryTraits>;
40 
41 using DataTransferServiceLimitedTimeRetryPolicy =
42  ::google::cloud::internal::LimitedTimeRetryPolicy<
43  bigquery_internal::DataTransferServiceRetryTraits>;
44 
45 using DataTransferServiceLimitedErrorCountRetryPolicy =
46  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47  bigquery_internal::DataTransferServiceRetryTraits>;
48 
49 /**
50  * The `DataTransferServiceConnection` object for `DataTransferServiceClient`.
51  *
52  * This interface defines virtual methods for each of the user-facing overload
53  * sets in `DataTransferServiceClient`. This allows users to inject custom
54  * behavior (e.g., with a Google Mock object) when writing tests that use
55  * objects of type `DataTransferServiceClient`.
56  *
57  * To create a concrete instance, see `MakeDataTransferServiceConnection()`.
58  *
59  * For mocking, see `bigquery_mocks::MockDataTransferServiceConnection`.
60  */
62  public:
64 
65  virtual Options options() { return Options{}; }
66 
67  virtual StatusOr<google::cloud::bigquery::datatransfer::v1::DataSource>
69  google::cloud::bigquery::datatransfer::v1::GetDataSourceRequest const&
70  request);
71 
72  virtual StreamRange<google::cloud::bigquery::datatransfer::v1::DataSource>
74  google::cloud::bigquery::datatransfer::v1::ListDataSourcesRequest
75  request);
76 
77  virtual StatusOr<google::cloud::bigquery::datatransfer::v1::TransferConfig>
78  CreateTransferConfig(google::cloud::bigquery::datatransfer::v1::
79  CreateTransferConfigRequest const& request);
80 
81  virtual StatusOr<google::cloud::bigquery::datatransfer::v1::TransferConfig>
82  UpdateTransferConfig(google::cloud::bigquery::datatransfer::v1::
83  UpdateTransferConfigRequest const& request);
84 
86  google::cloud::bigquery::datatransfer::v1::
87  DeleteTransferConfigRequest const& request);
88 
89  virtual StatusOr<google::cloud::bigquery::datatransfer::v1::TransferConfig>
91  google::cloud::bigquery::datatransfer::v1::GetTransferConfigRequest const&
92  request);
93 
94  virtual StreamRange<google::cloud::bigquery::datatransfer::v1::TransferConfig>
96  google::cloud::bigquery::datatransfer::v1::ListTransferConfigsRequest
97  request);
98 
99  virtual StatusOr<
100  google::cloud::bigquery::datatransfer::v1::ScheduleTransferRunsResponse>
102  ScheduleTransferRunsRequest const& request);
103 
104  virtual StatusOr<google::cloud::bigquery::datatransfer::v1::
105  StartManualTransferRunsResponse>
107  StartManualTransferRunsRequest const& request);
108 
109  virtual StatusOr<google::cloud::bigquery::datatransfer::v1::TransferRun>
111  google::cloud::bigquery::datatransfer::v1::GetTransferRunRequest const&
112  request);
113 
115  google::cloud::bigquery::datatransfer::v1::DeleteTransferRunRequest const&
116  request);
117 
118  virtual StreamRange<google::cloud::bigquery::datatransfer::v1::TransferRun>
120  google::cloud::bigquery::datatransfer::v1::ListTransferRunsRequest
121  request);
122 
123  virtual StreamRange<
124  google::cloud::bigquery::datatransfer::v1::TransferMessage>
126  google::cloud::bigquery::datatransfer::v1::ListTransferLogsRequest
127  request);
128 
129  virtual StatusOr<
130  google::cloud::bigquery::datatransfer::v1::CheckValidCredsResponse>
132  google::cloud::bigquery::datatransfer::v1::CheckValidCredsRequest const&
133  request);
134 
136  google::cloud::bigquery::datatransfer::v1::EnrollDataSourcesRequest const&
137  request);
138 };
139 
140 /**
141  * A factory function to construct an object of type
142  * `DataTransferServiceConnection`.
143  *
144  * The returned connection object should not be used directly; instead it
145  * should be passed as an argument to the constructor of
146  * DataTransferServiceClient.
147  *
148  * The optional @p options argument may be used to configure aspects of the
149  * returned `DataTransferServiceConnection`. Expected options are any of the
150  * types in the following option lists:
151  *
152  * - `google::cloud::CommonOptionList`
153  * - `google::cloud::GrpcOptionList`
154  * - `google::cloud::UnifiedCredentialsOptionList`
155  * - `google::cloud::bigquery::DataTransferServicePolicyOptionList`
156  *
157  * @note Unexpected options will be ignored. To log unexpected options instead,
158  * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
159  *
160  * @param options (optional) Configure the `DataTransferServiceConnection`
161  * created by this function.
162  */
163 std::shared_ptr<DataTransferServiceConnection>
165 
167 } // namespace bigquery
168 } // namespace cloud
169 } // namespace google
170 
171 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_H