Google Cloud BigQuery C++ Client 2.10.1
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
migration_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/migration/v2/migration_service.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_MIGRATION_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_MIGRATION_CLIENT_H
21
22#include "google/cloud/bigquery/migration/v2/migration_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 <map>
29#include <memory>
30
31namespace google {
32namespace cloud {
33namespace bigquery_migration_v2 {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36///
37/// Service to handle EDW migrations.
38///
39/// @par Equality
40///
41/// Instances of this class created via copy-construction or copy-assignment
42/// always compare equal. Instances created with equal
43/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
44/// equal share the same underlying resources.
45///
46/// @par Performance
47///
48/// Creating a new instance of this class is a relatively expensive operation,
49/// new objects establish new connections to the service. In contrast,
50/// copy-construction, move-construction, and the corresponding assignment
51/// operations are relatively efficient as the copies share all underlying
52/// resources.
53///
54/// @par Thread Safety
55///
56/// Concurrent access to different instances of this class, even if they compare
57/// equal, is guaranteed to work. Two or more threads operating on the same
58/// instance of this class is not guaranteed to work. Since copy-construction
59/// and move-construction is a relatively efficient operation, consider using
60/// such a copy when using this class from multiple threads.
61///
63 public:
65 std::shared_ptr<MigrationServiceConnection> connection,
66 Options opts = {});
68
69 ///@{
70 /// @name Copy and move support
75 ///@}
76
77 ///@{
78 /// @name Equality
79 friend bool operator==(MigrationServiceClient const& a,
80 MigrationServiceClient const& b) {
81 return a.connection_ == b.connection_;
82 }
83 friend bool operator!=(MigrationServiceClient const& a,
84 MigrationServiceClient const& b) {
85 return !(a == b);
86 }
87 ///@}
88
89 ///
90 /// Creates a migration workflow.
91 ///
92 /// @param parent Required. The name of the project to which this migration
93 /// workflow belongs.
94 /// Example: `projects/foo/locations/bar`
95 /// @param migration_workflow Required. The migration workflow to create.
96 /// @param opts Optional. Override the class-level options, such as retry and
97 /// backoff policies.
98 /// @return
99 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationWorkflow,google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
100 ///
101 /// [google.cloud.bigquery.migration.v2.CreateMigrationWorkflowRequest]:
102 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L110}
103 /// [google.cloud.bigquery.migration.v2.MigrationWorkflow]:
104 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
105 ///
106 StatusOr<google::cloud::bigquery::migration::v2::MigrationWorkflow>
108 std::string const& parent,
109 google::cloud::bigquery::migration::v2::MigrationWorkflow const&
110 migration_workflow,
111 Options opts = {});
112
113 ///
114 /// Creates a migration workflow.
115 ///
116 /// @param request
117 /// @googleapis_link{google::cloud::bigquery::migration::v2::CreateMigrationWorkflowRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L110}
118 /// @param opts Optional. Override the class-level options, such as retry and
119 /// backoff policies.
120 /// @return
121 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationWorkflow,google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
122 ///
123 /// [google.cloud.bigquery.migration.v2.CreateMigrationWorkflowRequest]:
124 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L110}
125 /// [google.cloud.bigquery.migration.v2.MigrationWorkflow]:
126 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
127 ///
128 StatusOr<google::cloud::bigquery::migration::v2::MigrationWorkflow>
130 CreateMigrationWorkflowRequest const& request,
131 Options opts = {});
132
133 ///
134 /// Gets a previously created migration workflow.
135 ///
136 /// @param name Required. The unique identifier for the migration workflow.
137 /// Example: `projects/123/locations/us/workflows/1234`
138 /// @param opts Optional. Override the class-level options, such as retry and
139 /// backoff policies.
140 /// @return
141 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationWorkflow,google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
142 ///
143 /// [google.cloud.bigquery.migration.v2.GetMigrationWorkflowRequest]:
144 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L126}
145 /// [google.cloud.bigquery.migration.v2.MigrationWorkflow]:
146 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
147 ///
148 StatusOr<google::cloud::bigquery::migration::v2::MigrationWorkflow>
149 GetMigrationWorkflow(std::string const& name, Options opts = {});
150
151 ///
152 /// Gets a previously created migration workflow.
153 ///
154 /// @param request
155 /// @googleapis_link{google::cloud::bigquery::migration::v2::GetMigrationWorkflowRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L126}
156 /// @param opts Optional. Override the class-level options, such as retry and
157 /// backoff policies.
158 /// @return
159 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationWorkflow,google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
160 ///
161 /// [google.cloud.bigquery.migration.v2.GetMigrationWorkflowRequest]:
162 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L126}
163 /// [google.cloud.bigquery.migration.v2.MigrationWorkflow]:
164 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
165 ///
166 StatusOr<google::cloud::bigquery::migration::v2::MigrationWorkflow>
168 google::cloud::bigquery::migration::v2::GetMigrationWorkflowRequest const&
169 request,
170 Options opts = {});
171
172 ///
173 /// Lists previously created migration workflow.
174 ///
175 /// @param parent Required. The project and location of the migration
176 /// workflows to list.
177 /// Example: `projects/123/locations/us`
178 /// @param opts Optional. Override the class-level options, such as retry and
179 /// backoff policies.
180 /// @return
181 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationWorkflow,google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
182 ///
183 /// [google.cloud.bigquery.migration.v2.ListMigrationWorkflowsRequest]:
184 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L141}
185 /// [google.cloud.bigquery.migration.v2.MigrationWorkflow]:
186 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
187 ///
188 StreamRange<google::cloud::bigquery::migration::v2::MigrationWorkflow>
189 ListMigrationWorkflows(std::string const& parent, Options opts = {});
190
191 ///
192 /// Lists previously created migration workflow.
193 ///
194 /// @param request
195 /// @googleapis_link{google::cloud::bigquery::migration::v2::ListMigrationWorkflowsRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L141}
196 /// @param opts Optional. Override the class-level options, such as retry and
197 /// backoff policies.
198 /// @return
199 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationWorkflow,google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
200 ///
201 /// [google.cloud.bigquery.migration.v2.ListMigrationWorkflowsRequest]:
202 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L141}
203 /// [google.cloud.bigquery.migration.v2.MigrationWorkflow]:
204 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L36}
205 ///
206 StreamRange<google::cloud::bigquery::migration::v2::MigrationWorkflow>
208 google::cloud::bigquery::migration::v2::ListMigrationWorkflowsRequest
209 request,
210 Options opts = {});
211
212 ///
213 /// Deletes a migration workflow by name.
214 ///
215 /// @param name Required. The unique identifier for the migration workflow.
216 /// Example: `projects/123/locations/us/workflows/1234`
217 /// @param opts Optional. Override the class-level options, such as retry and
218 /// backoff policies.
219 ///
220 /// [google.cloud.bigquery.migration.v2.DeleteMigrationWorkflowRequest]:
221 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L177}
222 ///
223 Status DeleteMigrationWorkflow(std::string const& name, Options opts = {});
224
225 ///
226 /// Deletes a migration workflow by name.
227 ///
228 /// @param request
229 /// @googleapis_link{google::cloud::bigquery::migration::v2::DeleteMigrationWorkflowRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L177}
230 /// @param opts Optional. Override the class-level options, such as retry and
231 /// backoff policies.
232 ///
233 /// [google.cloud.bigquery.migration.v2.DeleteMigrationWorkflowRequest]:
234 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L177}
235 ///
237 google::cloud::bigquery::migration::v2::
238 DeleteMigrationWorkflowRequest const& request,
239 Options opts = {});
240
241 ///
242 /// Starts a previously created migration workflow. I.e., the state
243 /// transitions from DRAFT to RUNNING. This is a no-op if the state is already
244 /// RUNNING. An error will be signaled if the state is anything other than
245 /// DRAFT or RUNNING.
246 ///
247 /// @param name Required. The unique identifier for the migration workflow.
248 /// Example: `projects/123/locations/us/workflows/1234`
249 /// @param opts Optional. Override the class-level options, such as retry and
250 /// backoff policies.
251 ///
252 /// [google.cloud.bigquery.migration.v2.StartMigrationWorkflowRequest]:
253 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L189}
254 ///
255 Status StartMigrationWorkflow(std::string const& name, Options opts = {});
256
257 ///
258 /// Starts a previously created migration workflow. I.e., the state
259 /// transitions from DRAFT to RUNNING. This is a no-op if the state is already
260 /// RUNNING. An error will be signaled if the state is anything other than
261 /// DRAFT or RUNNING.
262 ///
263 /// @param request
264 /// @googleapis_link{google::cloud::bigquery::migration::v2::StartMigrationWorkflowRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L189}
265 /// @param opts Optional. Override the class-level options, such as retry and
266 /// backoff policies.
267 ///
268 /// [google.cloud.bigquery.migration.v2.StartMigrationWorkflowRequest]:
269 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L189}
270 ///
272 google::cloud::bigquery::migration::v2::
273 StartMigrationWorkflowRequest const& request,
274 Options opts = {});
275
276 ///
277 /// Gets a previously created migration subtask.
278 ///
279 /// @param name Required. The unique identifier for the migration subtask.
280 /// Example: `projects/123/locations/us/workflows/1234/subtasks/543`
281 /// @param opts Optional. Override the class-level options, such as retry and
282 /// backoff policies.
283 /// @return
284 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationSubtask,google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
285 ///
286 /// [google.cloud.bigquery.migration.v2.GetMigrationSubtaskRequest]:
287 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L201}
288 /// [google.cloud.bigquery.migration.v2.MigrationSubtask]:
289 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
290 ///
291 StatusOr<google::cloud::bigquery::migration::v2::MigrationSubtask>
292 GetMigrationSubtask(std::string const& name, Options opts = {});
293
294 ///
295 /// Gets a previously created migration subtask.
296 ///
297 /// @param request
298 /// @googleapis_link{google::cloud::bigquery::migration::v2::GetMigrationSubtaskRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L201}
299 /// @param opts Optional. Override the class-level options, such as retry and
300 /// backoff policies.
301 /// @return
302 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationSubtask,google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
303 ///
304 /// [google.cloud.bigquery.migration.v2.GetMigrationSubtaskRequest]:
305 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L201}
306 /// [google.cloud.bigquery.migration.v2.MigrationSubtask]:
307 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
308 ///
309 StatusOr<google::cloud::bigquery::migration::v2::MigrationSubtask>
311 google::cloud::bigquery::migration::v2::GetMigrationSubtaskRequest const&
312 request,
313 Options opts = {});
314
315 ///
316 /// Lists previously created migration subtasks.
317 ///
318 /// @param parent Required. The migration task of the subtasks to list.
319 /// Example: `projects/123/locations/us/workflows/1234`
320 /// @param opts Optional. Override the class-level options, such as retry and
321 /// backoff policies.
322 /// @return
323 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationSubtask,google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
324 ///
325 /// [google.cloud.bigquery.migration.v2.ListMigrationSubtasksRequest]:
326 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L217}
327 /// [google.cloud.bigquery.migration.v2.MigrationSubtask]:
328 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
329 ///
330 StreamRange<google::cloud::bigquery::migration::v2::MigrationSubtask>
331 ListMigrationSubtasks(std::string const& parent, Options opts = {});
332
333 ///
334 /// Lists previously created migration subtasks.
335 ///
336 /// @param request
337 /// @googleapis_link{google::cloud::bigquery::migration::v2::ListMigrationSubtasksRequest,google/cloud/bigquery/migration/v2/migration_service.proto#L217}
338 /// @param opts Optional. Override the class-level options, such as retry and
339 /// backoff policies.
340 /// @return
341 /// @googleapis_link{google::cloud::bigquery::migration::v2::MigrationSubtask,google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
342 ///
343 /// [google.cloud.bigquery.migration.v2.ListMigrationSubtasksRequest]:
344 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_service.proto#L217}
345 /// [google.cloud.bigquery.migration.v2.MigrationSubtask]:
346 /// @googleapis_reference_link{google/cloud/bigquery/migration/v2/migration_entities.proto#L160}
347 ///
348 StreamRange<google::cloud::bigquery::migration::v2::MigrationSubtask>
350 google::cloud::bigquery::migration::v2::ListMigrationSubtasksRequest
351 request,
352 Options opts = {});
353
354 private:
355 std::shared_ptr<MigrationServiceConnection> connection_;
356 Options options_;
357};
358
359GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
360} // namespace bigquery_migration_v2
361} // namespace cloud
362} // namespace google
363
364#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_V2_MIGRATION_CLIENT_H
Service to handle EDW migrations.
Definition: migration_client.h:62
Status DeleteMigrationWorkflow(google::cloud::bigquery::migration::v2::DeleteMigrationWorkflowRequest const &request, Options opts={})
Deletes a migration workflow by name.
StatusOr< google::cloud::bigquery::migration::v2::MigrationWorkflow > CreateMigrationWorkflow(google::cloud::bigquery::migration::v2::CreateMigrationWorkflowRequest const &request, Options opts={})
Creates a migration workflow.
StatusOr< google::cloud::bigquery::migration::v2::MigrationWorkflow > GetMigrationWorkflow(std::string const &name, Options opts={})
Gets a previously created migration workflow.
StreamRange< google::cloud::bigquery::migration::v2::MigrationSubtask > ListMigrationSubtasks(std::string const &parent, Options opts={})
Lists previously created migration subtasks.
StreamRange< google::cloud::bigquery::migration::v2::MigrationSubtask > ListMigrationSubtasks(google::cloud::bigquery::migration::v2::ListMigrationSubtasksRequest request, Options opts={})
Lists previously created migration subtasks.
MigrationServiceClient & operator=(MigrationServiceClient const &)=default
StatusOr< google::cloud::bigquery::migration::v2::MigrationSubtask > GetMigrationSubtask(google::cloud::bigquery::migration::v2::GetMigrationSubtaskRequest const &request, Options opts={})
Gets a previously created migration subtask.
StreamRange< google::cloud::bigquery::migration::v2::MigrationWorkflow > ListMigrationWorkflows(google::cloud::bigquery::migration::v2::ListMigrationWorkflowsRequest request, Options opts={})
Lists previously created migration workflow.
StatusOr< google::cloud::bigquery::migration::v2::MigrationWorkflow > GetMigrationWorkflow(google::cloud::bigquery::migration::v2::GetMigrationWorkflowRequest const &request, Options opts={})
Gets a previously created migration workflow.
StreamRange< google::cloud::bigquery::migration::v2::MigrationWorkflow > ListMigrationWorkflows(std::string const &parent, Options opts={})
Lists previously created migration workflow.
StatusOr< google::cloud::bigquery::migration::v2::MigrationSubtask > GetMigrationSubtask(std::string const &name, Options opts={})
Gets a previously created migration subtask.
Status DeleteMigrationWorkflow(std::string const &name, Options opts={})
Deletes a migration workflow by name.
Status StartMigrationWorkflow(std::string const &name, Options opts={})
Starts a previously created migration workflow.
StatusOr< google::cloud::bigquery::migration::v2::MigrationWorkflow > CreateMigrationWorkflow(std::string const &parent, google::cloud::bigquery::migration::v2::MigrationWorkflow const &migration_workflow, Options opts={})
Creates a migration workflow.
friend bool operator!=(MigrationServiceClient const &a, MigrationServiceClient const &b)
Definition: migration_client.h:83
MigrationServiceClient(MigrationServiceClient &&)=default
MigrationServiceClient & operator=(MigrationServiceClient &&)=default
MigrationServiceClient(std::shared_ptr< MigrationServiceConnection > connection, Options opts={})
Status StartMigrationWorkflow(google::cloud::bigquery::migration::v2::StartMigrationWorkflowRequest const &request, Options opts={})
Starts a previously created migration workflow.
MigrationServiceClient(MigrationServiceClient const &)=default
friend bool operator==(MigrationServiceClient const &a, MigrationServiceClient const &b)
Definition: migration_client.h:79
The MigrationServiceConnection object for MigrationServiceClient.
Definition: migration_connection.h:62
Definition: migration_client.h:33
Definition: analytics_hub_client.h:30