Google Cloud BigQuery C++ Client  2.6.0
A C++ Client Library for Google Cloud BigQuery
migration_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/migration/v2/migration_service.proto
18 
19 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_H
21 
22 #include "google/cloud/bigquery/internal/migration_retry_traits.h"
23 #include "google/cloud/bigquery/internal/migration_stub.h"
24 #include "google/cloud/bigquery/migration_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 MigrationServiceRetryPolicy =
38  ::google::cloud::internal::TraitBasedRetryPolicy<
39  bigquery_internal::MigrationServiceRetryTraits>;
40 
41 using MigrationServiceLimitedTimeRetryPolicy =
42  ::google::cloud::internal::LimitedTimeRetryPolicy<
43  bigquery_internal::MigrationServiceRetryTraits>;
44 
45 using MigrationServiceLimitedErrorCountRetryPolicy =
46  ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47  bigquery_internal::MigrationServiceRetryTraits>;
48 
49 /**
50  * The `MigrationServiceConnection` object for `MigrationServiceClient`.
51  *
52  * This interface defines virtual methods for each of the user-facing overload
53  * sets in `MigrationServiceClient`. This allows users to inject custom behavior
54  * (e.g., with a Google Mock object) when writing tests that use objects of type
55  * `MigrationServiceClient`.
56  *
57  * To create a concrete instance, see `MakeMigrationServiceConnection()`.
58  *
59  * For mocking, see `bigquery_mocks::MockMigrationServiceConnection`.
60  */
62  public:
64 
65  virtual Options options() { return Options{}; }
66 
67  virtual StatusOr<google::cloud::bigquery::migration::v2::MigrationWorkflow>
69  CreateMigrationWorkflowRequest const& request);
70 
71  virtual StatusOr<google::cloud::bigquery::migration::v2::MigrationWorkflow>
73  google::cloud::bigquery::migration::v2::GetMigrationWorkflowRequest const&
74  request);
75 
76  virtual StreamRange<google::cloud::bigquery::migration::v2::MigrationWorkflow>
78  google::cloud::bigquery::migration::v2::ListMigrationWorkflowsRequest
79  request);
80 
82  google::cloud::bigquery::migration::v2::
83  DeleteMigrationWorkflowRequest const& request);
84 
86  google::cloud::bigquery::migration::v2::
87  StartMigrationWorkflowRequest const& request);
88 
89  virtual StatusOr<google::cloud::bigquery::migration::v2::MigrationSubtask>
91  google::cloud::bigquery::migration::v2::GetMigrationSubtaskRequest const&
92  request);
93 
94  virtual StreamRange<google::cloud::bigquery::migration::v2::MigrationSubtask>
96  google::cloud::bigquery::migration::v2::ListMigrationSubtasksRequest
97  request);
98 };
99 
100 /**
101  * A factory function to construct an object of type
102  * `MigrationServiceConnection`.
103  *
104  * The returned connection object should not be used directly; instead it
105  * should be passed as an argument to the constructor of MigrationServiceClient.
106  *
107  * The optional @p options argument may be used to configure aspects of the
108  * returned `MigrationServiceConnection`. Expected options are any of the types
109  * in the following option lists:
110  *
111  * - `google::cloud::CommonOptionList`
112  * - `google::cloud::GrpcOptionList`
113  * - `google::cloud::UnifiedCredentialsOptionList`
114  * - `google::cloud::bigquery::MigrationServicePolicyOptionList`
115  *
116  * @note Unexpected options will be ignored. To log unexpected options instead,
117  * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
118  *
119  * @param options (optional) Configure the `MigrationServiceConnection` created
120  * by this function.
121  */
123  Options options = {});
124 
126 } // namespace bigquery
127 } // namespace cloud
128 } // namespace google
129 
130 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_MIGRATION_CONNECTION_H