Google Cloud BigQuery C++ Client 2.10.1
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
data_policy_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/datapolicies/v1/datapolicy.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_DATA_POLICY_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_DATA_POLICY_CLIENT_H
21
22#include "google/cloud/bigquery/datapolicies/v1/data_policy_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 {
33GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
34
35///
36/// Data Policy Service provides APIs for managing the label-policy bindings.
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<DataPolicyServiceConnection> connection,
65 Options opts = {});
67
68 ///@{
69 /// @name Copy and move support
74 ///@}
75
76 ///@{
77 /// @name Equality
78 friend bool operator==(DataPolicyServiceClient const& a,
79 DataPolicyServiceClient const& b) {
80 return a.connection_ == b.connection_;
81 }
82 friend bool operator!=(DataPolicyServiceClient const& a,
83 DataPolicyServiceClient const& b) {
84 return !(a == b);
85 }
86 ///@}
87
88 ///
89 /// Creates a new data policy under a project with the given `dataPolicyId`
90 /// (used as the display name), policy tag, and data policy type.
91 ///
92 /// @param parent Required. Resource name of the project that the data policy
93 /// will belong to.
94 /// The format is `projects/{project_number}/locations/{location_id}`.
95 /// @param data_policy Required. The data policy to create. The `name` field
96 /// does not need to be
97 /// provided for the data policy creation.
98 /// @param opts Optional. Override the class-level options, such as retry and
99 /// backoff policies.
100 /// @return
101 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
102 ///
103 /// [google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest]:
104 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L127}
105 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
106 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
107 ///
108 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
110 std::string const& parent,
111 google::cloud::bigquery::datapolicies::v1::DataPolicy const& data_policy,
112 Options opts = {});
113
114 ///
115 /// Creates a new data policy under a project with the given `dataPolicyId`
116 /// (used as the display name), policy tag, and data policy type.
117 ///
118 /// @param request
119 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L127}
120 /// @param opts Optional. Override the class-level options, such as retry and
121 /// backoff policies.
122 /// @return
123 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
124 ///
125 /// [google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest]:
126 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L127}
127 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
128 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
129 ///
130 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
132 google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const&
133 request,
134 Options opts = {});
135
136 ///
137 /// Updates the metadata for an existing data policy. The target data policy
138 /// can be specified by the resource name.
139 ///
140 /// @param data_policy Required. Update the data policy's metadata.
141 /// The target data policy is determined by the `name` field.
142 /// Other fields are updated to the specified values based on the field
143 /// masks.
144 /// @param update_mask The update mask applies to the resource. For the
145 /// `FieldMask` definition,
146 /// see
147 /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
148 /// If not set, defaults to all of the fields that are allowed to update.
149 /// Updates to the `name` and `dataPolicyId` fields are not allowed.
150 /// @param opts Optional. Override the class-level options, such as retry and
151 /// backoff policies.
152 /// @return
153 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
154 ///
155 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
156 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
157 /// [google.cloud.bigquery.datapolicies.v1.UpdateDataPolicyRequest]:
158 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L143}
159 ///
160 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
162 google::cloud::bigquery::datapolicies::v1::DataPolicy const& data_policy,
163 google::protobuf::FieldMask const& update_mask, Options opts = {});
164
165 ///
166 /// Updates the metadata for an existing data policy. The target data policy
167 /// can be specified by the resource name.
168 ///
169 /// @param request
170 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L143}
171 /// @param opts Optional. Override the class-level options, such as retry and
172 /// backoff policies.
173 /// @return
174 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
175 ///
176 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
177 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
178 /// [google.cloud.bigquery.datapolicies.v1.UpdateDataPolicyRequest]:
179 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L143}
180 ///
181 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
183 google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const&
184 request,
185 Options opts = {});
186
187 ///
188 /// Renames the id (display name) of the specified data policy.
189 ///
190 /// @param name Required. Resource name of the data policy to rename. The
191 /// format is
192 /// `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`
193 /// @param new_data_policy_id Required. The new data policy id.
194 /// @param opts Optional. Override the class-level options, such as retry and
195 /// backoff policies.
196 /// @return
197 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
198 ///
199 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
200 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
201 /// [google.cloud.bigquery.datapolicies.v1.RenameDataPolicyRequest]:
202 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L160}
203 ///
204 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
205 RenameDataPolicy(std::string const& name,
206 std::string const& new_data_policy_id, Options opts = {});
207
208 ///
209 /// Renames the id (display name) of the specified data policy.
210 ///
211 /// @param request
212 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L160}
213 /// @param opts Optional. Override the class-level options, such as retry and
214 /// backoff policies.
215 /// @return
216 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
217 ///
218 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
219 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
220 /// [google.cloud.bigquery.datapolicies.v1.RenameDataPolicyRequest]:
221 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L160}
222 ///
223 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
225 google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const&
226 request,
227 Options opts = {});
228
229 ///
230 /// Deletes the data policy specified by its resource name.
231 ///
232 /// @param name Required. Resource name of the data policy to delete. Format
233 /// is
234 /// `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
235 /// @param opts Optional. Override the class-level options, such as retry and
236 /// backoff policies.
237 ///
238 /// [google.cloud.bigquery.datapolicies.v1.DeleteDataPolicyRequest]:
239 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L170}
240 ///
241 Status DeleteDataPolicy(std::string const& name, Options opts = {});
242
243 ///
244 /// Deletes the data policy specified by its resource name.
245 ///
246 /// @param request
247 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L170}
248 /// @param opts Optional. Override the class-level options, such as retry and
249 /// backoff policies.
250 ///
251 /// [google.cloud.bigquery.datapolicies.v1.DeleteDataPolicyRequest]:
252 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L170}
253 ///
255 google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const&
256 request,
257 Options opts = {});
258
259 ///
260 /// Gets the data policy specified by its resource name.
261 ///
262 /// @param name Required. Resource name of the requested data policy. Format
263 /// is
264 /// `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
265 /// @param opts Optional. Override the class-level options, such as retry and
266 /// backoff policies.
267 /// @return
268 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
269 ///
270 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
271 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
272 /// [google.cloud.bigquery.datapolicies.v1.GetDataPolicyRequest]:
273 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L182}
274 ///
275 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy> GetDataPolicy(
276 std::string const& name, Options opts = {});
277
278 ///
279 /// Gets the data policy specified by its resource name.
280 ///
281 /// @param request
282 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L182}
283 /// @param opts Optional. Override the class-level options, such as retry and
284 /// backoff policies.
285 /// @return
286 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
287 ///
288 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
289 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
290 /// [google.cloud.bigquery.datapolicies.v1.GetDataPolicyRequest]:
291 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L182}
292 ///
293 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy> GetDataPolicy(
294 google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const&
295 request,
296 Options opts = {});
297
298 ///
299 /// List all of the data policies in the specified parent project.
300 ///
301 /// @param parent Required. Resource name of the project for which to list
302 /// data policies.
303 /// Format is `projects/{project_number}/locations/{location_id}`.
304 /// @param opts Optional. Override the class-level options, such as retry and
305 /// backoff policies.
306 /// @return
307 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
308 ///
309 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
310 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
311 /// [google.cloud.bigquery.datapolicies.v1.ListDataPoliciesRequest]:
312 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L194}
313 ///
314 StreamRange<google::cloud::bigquery::datapolicies::v1::DataPolicy>
315 ListDataPolicies(std::string const& parent, Options opts = {});
316
317 ///
318 /// List all of the data policies in the specified parent project.
319 ///
320 /// @param request
321 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L194}
322 /// @param opts Optional. Override the class-level options, such as retry and
323 /// backoff policies.
324 /// @return
325 /// @googleapis_link{google::cloud::bigquery::datapolicies::v1::DataPolicy,google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
326 ///
327 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]:
328 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
329 /// [google.cloud.bigquery.datapolicies.v1.ListDataPoliciesRequest]:
330 /// @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L194}
331 ///
332 StreamRange<google::cloud::bigquery::datapolicies::v1::DataPolicy>
334 google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest
335 request,
336 Options opts = {});
337
338 ///
339 /// Gets the IAM policy for the specified data policy.
340 ///
341 /// @param request
342 /// @googleapis_link{google::iam::v1::GetIamPolicyRequest,google/iam/v1/iam_policy.proto#L123}
343 /// @param opts Optional. Override the class-level options, such as retry and
344 /// backoff policies.
345 /// @return
346 /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L98}
347 ///
348 /// [google.iam.v1.GetIamPolicyRequest]:
349 /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
350 /// [google.iam.v1.Policy]:
351 /// @googleapis_reference_link{google/iam/v1/policy.proto#L98}
352 ///
353 StatusOr<google::iam::v1::Policy> GetIamPolicy(
354 google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
355
356 ///
357 /// Sets the IAM policy for the specified data policy.
358 ///
359 /// @param request
360 /// @googleapis_link{google::iam::v1::SetIamPolicyRequest,google/iam/v1/iam_policy.proto#L101}
361 /// @param opts Optional. Override the class-level options, such as retry and
362 /// backoff policies.
363 /// @return
364 /// @googleapis_link{google::iam::v1::Policy,google/iam/v1/policy.proto#L98}
365 ///
366 /// [google.iam.v1.Policy]:
367 /// @googleapis_reference_link{google/iam/v1/policy.proto#L98}
368 /// [google.iam.v1.SetIamPolicyRequest]:
369 /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
370 ///
371 StatusOr<google::iam::v1::Policy> SetIamPolicy(
372 google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
373
374 ///
375 /// Returns the caller's permission on the specified data policy resource.
376 ///
377 /// @param request
378 /// @googleapis_link{google::iam::v1::TestIamPermissionsRequest,google/iam/v1/iam_policy.proto#L136}
379 /// @param opts Optional. Override the class-level options, such as retry and
380 /// backoff policies.
381 /// @return
382 /// @googleapis_link{google::iam::v1::TestIamPermissionsResponse,google/iam/v1/iam_policy.proto#L151}
383 ///
384 /// [google.iam.v1.TestIamPermissionsRequest]:
385 /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
386 /// [google.iam.v1.TestIamPermissionsResponse]:
387 /// @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
388 ///
389 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
390 google::iam::v1::TestIamPermissionsRequest const& request,
391 Options opts = {});
392
393 private:
394 std::shared_ptr<DataPolicyServiceConnection> connection_;
395 Options options_;
396};
397
398GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
399} // namespace bigquery_datapolicies_v1
400} // namespace cloud
401} // namespace google
402
403#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATAPOLICIES_V1_DATA_POLICY_CLIENT_H
Data Policy Service provides APIs for managing the label-policy bindings.
Definition: data_policy_client.h:61
DataPolicyServiceClient & operator=(DataPolicyServiceClient const &)=default
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
Returns the caller's permission on the specified data policy resource.
Status DeleteDataPolicy(std::string const &name, Options opts={})
Deletes the data policy specified by its resource name.
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > UpdateDataPolicy(google::cloud::bigquery::datapolicies::v1::DataPolicy const &data_policy, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates the metadata for an existing data policy.
Status DeleteDataPolicy(google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const &request, Options opts={})
Deletes the data policy specified by its resource name.
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > GetDataPolicy(google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const &request, Options opts={})
Gets the data policy specified by its resource name.
StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy > ListDataPolicies(std::string const &parent, Options opts={})
List all of the data policies in the specified parent project.
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > CreateDataPolicy(std::string const &parent, google::cloud::bigquery::datapolicies::v1::DataPolicy const &data_policy, Options opts={})
Creates a new data policy under a project with the given dataPolicyId (used as the display name),...
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > RenameDataPolicy(google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const &request, Options opts={})
Renames the id (display name) of the specified data policy.
friend bool operator!=(DataPolicyServiceClient const &a, DataPolicyServiceClient const &b)
Definition: data_policy_client.h:82
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > CreateDataPolicy(google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const &request, Options opts={})
Creates a new data policy under a project with the given dataPolicyId (used as the display name),...
StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
Sets the IAM policy for the specified data policy.
StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
Gets the IAM policy for the specified data policy.
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > RenameDataPolicy(std::string const &name, std::string const &new_data_policy_id, Options opts={})
Renames the id (display name) of the specified data policy.
DataPolicyServiceClient(DataPolicyServiceClient const &)=default
StreamRange< google::cloud::bigquery::datapolicies::v1::DataPolicy > ListDataPolicies(google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest request, Options opts={})
List all of the data policies in the specified parent project.
DataPolicyServiceClient(std::shared_ptr< DataPolicyServiceConnection > connection, Options opts={})
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > UpdateDataPolicy(google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const &request, Options opts={})
Updates the metadata for an existing data policy.
DataPolicyServiceClient & operator=(DataPolicyServiceClient &&)=default
StatusOr< google::cloud::bigquery::datapolicies::v1::DataPolicy > GetDataPolicy(std::string const &name, Options opts={})
Gets the data policy specified by its resource name.
friend bool operator==(DataPolicyServiceClient const &a, DataPolicyServiceClient const &b)
Definition: data_policy_client.h:78
The DataPolicyServiceConnection object for DataPolicyServiceClient.
Definition: data_policy_connection.h:62
Definition: data_policy_client.h:32
Definition: analytics_hub_client.h:30