Google Cloud BigQuery C++ Client 2.13.0
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 // clang-format off
89 ///
90 /// Creates a new data policy under a project with the given `dataPolicyId`
91 /// (used as the display name), policy tag, and data policy type.
92 ///
93 /// @param parent Required. Resource name of the project that the data policy 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 does not need to be
96 /// provided for the data policy creation.
97 /// @param opts Optional. Override the class-level options, such as retry and
98 /// backoff policies.
99 /// @return the result of the RPC. The response message type
100 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
101 /// is mapped to a C++ class using the [Protobuf mapping rules].
102 /// If the request fails, the [`StatusOr`] contains the error details.
103 ///
104 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
105 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
106 /// [Long Running Operation]: https://google.aip.dev/151
107 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
108 /// [`future`]: @ref google::cloud::future
109 /// [`StatusOr`]: @ref google::cloud::StatusOr
110 /// [`Status`]: @ref google::cloud::Status
111 /// [google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L127}
112 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
113 ///
114 // clang-format on
115 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
117 std::string const& parent,
118 google::cloud::bigquery::datapolicies::v1::DataPolicy const& data_policy,
119 Options opts = {});
120
121 // clang-format off
122 ///
123 /// Creates a new data policy under a project with the given `dataPolicyId`
124 /// (used as the display name), policy tag, and data policy type.
125 ///
126 /// @param request Unary RPCs, such as the one wrapped by this
127 /// function, receive a single `request` proto message which includes all
128 /// the inputs for the RPC. In this case, the proto message is a
129 /// [google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest].
130 /// Proto messages are converted to C++ classes by Protobuf, using the
131 /// [Protobuf mapping rules].
132 /// @param opts Optional. Override the class-level options, such as retry and
133 /// backoff policies.
134 /// @return the result of the RPC. The response message type
135 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
136 /// is mapped to a C++ class using the [Protobuf mapping rules].
137 /// If the request fails, the [`StatusOr`] contains the error details.
138 ///
139 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
140 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
141 /// [Long Running Operation]: https://google.aip.dev/151
142 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
143 /// [`future`]: @ref google::cloud::future
144 /// [`StatusOr`]: @ref google::cloud::StatusOr
145 /// [`Status`]: @ref google::cloud::Status
146 /// [google.cloud.bigquery.datapolicies.v1.CreateDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L127}
147 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
148 ///
149 // clang-format on
150 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
152 google::cloud::bigquery::datapolicies::v1::CreateDataPolicyRequest const&
153 request,
154 Options opts = {});
155
156 // clang-format off
157 ///
158 /// Updates the metadata for an existing data policy. The target data policy
159 /// can be specified by the resource name.
160 ///
161 /// @param data_policy Required. Update the data policy's metadata.
162 /// @n
163 /// The target data policy is determined by the `name` field.
164 /// Other fields are updated to the specified values based on the field masks.
165 /// @param update_mask The update mask applies to the resource. For the `FieldMask` definition,
166 /// see
167 /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
168 /// If not set, defaults to all of the fields that are allowed to update.
169 /// @n
170 /// Updates to the `name` and `dataPolicyId` fields are not allowed.
171 /// @param opts Optional. Override the class-level options, such as retry and
172 /// backoff policies.
173 /// @return the result of the RPC. The response message type
174 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
175 /// is mapped to a C++ class using the [Protobuf mapping rules].
176 /// If the request fails, the [`StatusOr`] contains the error details.
177 ///
178 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
179 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
180 /// [Long Running Operation]: https://google.aip.dev/151
181 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
182 /// [`future`]: @ref google::cloud::future
183 /// [`StatusOr`]: @ref google::cloud::StatusOr
184 /// [`Status`]: @ref google::cloud::Status
185 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
186 /// [google.cloud.bigquery.datapolicies.v1.UpdateDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L143}
187 ///
188 // clang-format on
189 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
191 google::cloud::bigquery::datapolicies::v1::DataPolicy const& data_policy,
192 google::protobuf::FieldMask const& update_mask, Options opts = {});
193
194 // clang-format off
195 ///
196 /// Updates the metadata for an existing data policy. The target data policy
197 /// can be specified by the resource name.
198 ///
199 /// @param request Unary RPCs, such as the one wrapped by this
200 /// function, receive a single `request` proto message which includes all
201 /// the inputs for the RPC. In this case, the proto message is a
202 /// [google.cloud.bigquery.datapolicies.v1.UpdateDataPolicyRequest].
203 /// Proto messages are converted to C++ classes by Protobuf, using the
204 /// [Protobuf mapping rules].
205 /// @param opts Optional. Override the class-level options, such as retry and
206 /// backoff policies.
207 /// @return the result of the RPC. The response message type
208 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
209 /// is mapped to a C++ class using the [Protobuf mapping rules].
210 /// If the request fails, the [`StatusOr`] contains the error details.
211 ///
212 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
213 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
214 /// [Long Running Operation]: https://google.aip.dev/151
215 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
216 /// [`future`]: @ref google::cloud::future
217 /// [`StatusOr`]: @ref google::cloud::StatusOr
218 /// [`Status`]: @ref google::cloud::Status
219 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
220 /// [google.cloud.bigquery.datapolicies.v1.UpdateDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L143}
221 ///
222 // clang-format on
223 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
225 google::cloud::bigquery::datapolicies::v1::UpdateDataPolicyRequest const&
226 request,
227 Options opts = {});
228
229 // clang-format off
230 ///
231 /// Renames the id (display name) of the specified data policy.
232 ///
233 /// @param name Required. Resource name of the data policy to rename. The format is
234 /// `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`
235 /// @param new_data_policy_id Required. The new data policy id.
236 /// @param opts Optional. Override the class-level options, such as retry and
237 /// backoff policies.
238 /// @return the result of the RPC. The response message type
239 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
240 /// is mapped to a C++ class using the [Protobuf mapping rules].
241 /// If the request fails, the [`StatusOr`] contains the error details.
242 ///
243 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
244 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
245 /// [Long Running Operation]: https://google.aip.dev/151
246 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
247 /// [`future`]: @ref google::cloud::future
248 /// [`StatusOr`]: @ref google::cloud::StatusOr
249 /// [`Status`]: @ref google::cloud::Status
250 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
251 /// [google.cloud.bigquery.datapolicies.v1.RenameDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L160}
252 ///
253 // clang-format on
254 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
255 RenameDataPolicy(std::string const& name,
256 std::string const& new_data_policy_id, Options opts = {});
257
258 // clang-format off
259 ///
260 /// Renames the id (display name) of the specified data policy.
261 ///
262 /// @param request Unary RPCs, such as the one wrapped by this
263 /// function, receive a single `request` proto message which includes all
264 /// the inputs for the RPC. In this case, the proto message is a
265 /// [google.cloud.bigquery.datapolicies.v1.RenameDataPolicyRequest].
266 /// Proto messages are converted to C++ classes by Protobuf, using the
267 /// [Protobuf mapping rules].
268 /// @param opts Optional. Override the class-level options, such as retry and
269 /// backoff policies.
270 /// @return the result of the RPC. The response message type
271 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
272 /// is mapped to a C++ class using the [Protobuf mapping rules].
273 /// If the request fails, the [`StatusOr`] contains the error details.
274 ///
275 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
276 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
277 /// [Long Running Operation]: https://google.aip.dev/151
278 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
279 /// [`future`]: @ref google::cloud::future
280 /// [`StatusOr`]: @ref google::cloud::StatusOr
281 /// [`Status`]: @ref google::cloud::Status
282 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
283 /// [google.cloud.bigquery.datapolicies.v1.RenameDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L160}
284 ///
285 // clang-format on
286 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy>
288 google::cloud::bigquery::datapolicies::v1::RenameDataPolicyRequest const&
289 request,
290 Options opts = {});
291
292 // clang-format off
293 ///
294 /// Deletes the data policy specified by its resource name.
295 ///
296 /// @param name Required. Resource name of the data policy to delete. Format is
297 /// `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
298 /// @param opts Optional. Override the class-level options, such as retry and
299 /// backoff policies.
300 /// @return a [`Status`] object. If the request failed, the
301 /// status contains the details of the failure.
302 ///
303 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
304 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
305 /// [Long Running Operation]: https://google.aip.dev/151
306 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
307 /// [`future`]: @ref google::cloud::future
308 /// [`StatusOr`]: @ref google::cloud::StatusOr
309 /// [`Status`]: @ref google::cloud::Status
310 /// [google.cloud.bigquery.datapolicies.v1.DeleteDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L170}
311 ///
312 // clang-format on
313 Status DeleteDataPolicy(std::string const& name, Options opts = {});
314
315 // clang-format off
316 ///
317 /// Deletes the data policy specified by its resource name.
318 ///
319 /// @param request Unary RPCs, such as the one wrapped by this
320 /// function, receive a single `request` proto message which includes all
321 /// the inputs for the RPC. In this case, the proto message is a
322 /// [google.cloud.bigquery.datapolicies.v1.DeleteDataPolicyRequest].
323 /// Proto messages are converted to C++ classes by Protobuf, using the
324 /// [Protobuf mapping rules].
325 /// @param opts Optional. Override the class-level options, such as retry and
326 /// backoff policies.
327 /// @return a [`Status`] object. If the request failed, the
328 /// status contains the details of the failure.
329 ///
330 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
331 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
332 /// [Long Running Operation]: https://google.aip.dev/151
333 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
334 /// [`future`]: @ref google::cloud::future
335 /// [`StatusOr`]: @ref google::cloud::StatusOr
336 /// [`Status`]: @ref google::cloud::Status
337 /// [google.cloud.bigquery.datapolicies.v1.DeleteDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L170}
338 ///
339 // clang-format on
341 google::cloud::bigquery::datapolicies::v1::DeleteDataPolicyRequest const&
342 request,
343 Options opts = {});
344
345 // clang-format off
346 ///
347 /// Gets the data policy specified by its resource name.
348 ///
349 /// @param name Required. Resource name of the requested data policy. Format is
350 /// `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
351 /// @param opts Optional. Override the class-level options, such as retry and
352 /// backoff policies.
353 /// @return the result of the RPC. The response message type
354 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
355 /// is mapped to a C++ class using the [Protobuf mapping rules].
356 /// If the request fails, the [`StatusOr`] contains the error details.
357 ///
358 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
359 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
360 /// [Long Running Operation]: https://google.aip.dev/151
361 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
362 /// [`future`]: @ref google::cloud::future
363 /// [`StatusOr`]: @ref google::cloud::StatusOr
364 /// [`Status`]: @ref google::cloud::Status
365 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
366 /// [google.cloud.bigquery.datapolicies.v1.GetDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L182}
367 ///
368 // clang-format on
369 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy> GetDataPolicy(
370 std::string const& name, Options opts = {});
371
372 // clang-format off
373 ///
374 /// Gets the data policy specified by its resource name.
375 ///
376 /// @param request Unary RPCs, such as the one wrapped by this
377 /// function, receive a single `request` proto message which includes all
378 /// the inputs for the RPC. In this case, the proto message is a
379 /// [google.cloud.bigquery.datapolicies.v1.GetDataPolicyRequest].
380 /// Proto messages are converted to C++ classes by Protobuf, using the
381 /// [Protobuf mapping rules].
382 /// @param opts Optional. Override the class-level options, such as retry and
383 /// backoff policies.
384 /// @return the result of the RPC. The response message type
385 /// ([google.cloud.bigquery.datapolicies.v1.DataPolicy])
386 /// is mapped to a C++ class using the [Protobuf mapping rules].
387 /// If the request fails, the [`StatusOr`] contains the error details.
388 ///
389 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
390 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
391 /// [Long Running Operation]: https://google.aip.dev/151
392 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
393 /// [`future`]: @ref google::cloud::future
394 /// [`StatusOr`]: @ref google::cloud::StatusOr
395 /// [`Status`]: @ref google::cloud::Status
396 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
397 /// [google.cloud.bigquery.datapolicies.v1.GetDataPolicyRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L182}
398 ///
399 // clang-format on
400 StatusOr<google::cloud::bigquery::datapolicies::v1::DataPolicy> GetDataPolicy(
401 google::cloud::bigquery::datapolicies::v1::GetDataPolicyRequest const&
402 request,
403 Options opts = {});
404
405 // clang-format off
406 ///
407 /// List all of the data policies in the specified parent project.
408 ///
409 /// @param parent Required. Resource name of the project for which to list data policies.
410 /// Format is `projects/{project_number}/locations/{location_id}`.
411 /// @param opts Optional. Override the class-level options, such as retry and
412 /// backoff policies.
413 /// @return a [StreamRange](@ref google::cloud::StreamRange)
414 /// to iterate of the results. See the documentation of this type for
415 /// details. In brief, this class has `begin()` and `end()` member
416 /// functions returning a iterator class meeting the
417 /// [input iterator requirements]. The value type for this iterator is a
418 /// [`StatusOr`] as the iteration may fail even after some values are
419 /// retrieved successfully, for example, if there is a network disconnect.
420 /// An empty set of results does not indicate an error, it indicates
421 /// that there are no resources meeting the request criteria.
422 /// On a successful iteration the `StatusOr<T>` contains elements of type
423 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy], or rather,
424 /// the C++ class generated by Protobuf from that type. Please consult the
425 /// Protobuf documentation for details on the [Protobuf mapping rules].
426 ///
427 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
428 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
429 /// [Long Running Operation]: https://google.aip.dev/151
430 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
431 /// [`future`]: @ref google::cloud::future
432 /// [`StatusOr`]: @ref google::cloud::StatusOr
433 /// [`Status`]: @ref google::cloud::Status
434 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
435 /// [google.cloud.bigquery.datapolicies.v1.ListDataPoliciesRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L194}
436 ///
437 // clang-format on
438 StreamRange<google::cloud::bigquery::datapolicies::v1::DataPolicy>
439 ListDataPolicies(std::string const& parent, Options opts = {});
440
441 // clang-format off
442 ///
443 /// List all of the data policies in the specified parent project.
444 ///
445 /// @param request Unary RPCs, such as the one wrapped by this
446 /// function, receive a single `request` proto message which includes all
447 /// the inputs for the RPC. In this case, the proto message is a
448 /// [google.cloud.bigquery.datapolicies.v1.ListDataPoliciesRequest].
449 /// Proto messages are converted to C++ classes by Protobuf, using the
450 /// [Protobuf mapping rules].
451 /// @param opts Optional. Override the class-level options, such as retry and
452 /// backoff policies.
453 /// @return a [StreamRange](@ref google::cloud::StreamRange)
454 /// to iterate of the results. See the documentation of this type for
455 /// details. In brief, this class has `begin()` and `end()` member
456 /// functions returning a iterator class meeting the
457 /// [input iterator requirements]. The value type for this iterator is a
458 /// [`StatusOr`] as the iteration may fail even after some values are
459 /// retrieved successfully, for example, if there is a network disconnect.
460 /// An empty set of results does not indicate an error, it indicates
461 /// that there are no resources meeting the request criteria.
462 /// On a successful iteration the `StatusOr<T>` contains elements of type
463 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy], or rather,
464 /// the C++ class generated by Protobuf from that type. Please consult the
465 /// Protobuf documentation for details on the [Protobuf mapping rules].
466 ///
467 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
468 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
469 /// [Long Running Operation]: https://google.aip.dev/151
470 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
471 /// [`future`]: @ref google::cloud::future
472 /// [`StatusOr`]: @ref google::cloud::StatusOr
473 /// [`Status`]: @ref google::cloud::Status
474 /// [google.cloud.bigquery.datapolicies.v1.DataPolicy]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L234}
475 /// [google.cloud.bigquery.datapolicies.v1.ListDataPoliciesRequest]: @googleapis_reference_link{google/cloud/bigquery/datapolicies/v1/datapolicy.proto#L194}
476 ///
477 // clang-format on
478 StreamRange<google::cloud::bigquery::datapolicies::v1::DataPolicy>
480 google::cloud::bigquery::datapolicies::v1::ListDataPoliciesRequest
481 request,
482 Options opts = {});
483
484 // clang-format off
485 ///
486 /// Gets the IAM policy for the specified data policy.
487 ///
488 /// @param request Unary RPCs, such as the one wrapped by this
489 /// function, receive a single `request` proto message which includes all
490 /// the inputs for the RPC. In this case, the proto message is a
491 /// [google.iam.v1.GetIamPolicyRequest].
492 /// Proto messages are converted to C++ classes by Protobuf, using the
493 /// [Protobuf mapping rules].
494 /// @param opts Optional. Override the class-level options, such as retry and
495 /// backoff policies.
496 /// @return the result of the RPC. The response message type
497 /// ([google.iam.v1.Policy])
498 /// is mapped to a C++ class using the [Protobuf mapping rules].
499 /// If the request fails, the [`StatusOr`] contains the error details.
500 ///
501 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
502 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
503 /// [Long Running Operation]: https://google.aip.dev/151
504 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
505 /// [`future`]: @ref google::cloud::future
506 /// [`StatusOr`]: @ref google::cloud::StatusOr
507 /// [`Status`]: @ref google::cloud::Status
508 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
509 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
510 ///
511 // clang-format on
512 StatusOr<google::iam::v1::Policy> GetIamPolicy(
513 google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
514
515 // clang-format off
516 ///
517 /// Sets the IAM policy for the specified data policy.
518 ///
519 /// @param request Unary RPCs, such as the one wrapped by this
520 /// function, receive a single `request` proto message which includes all
521 /// the inputs for the RPC. In this case, the proto message is a
522 /// [google.iam.v1.SetIamPolicyRequest].
523 /// Proto messages are converted to C++ classes by Protobuf, using the
524 /// [Protobuf mapping rules].
525 /// @param opts Optional. Override the class-level options, such as retry and
526 /// backoff policies.
527 /// @return the result of the RPC. The response message type
528 /// ([google.iam.v1.Policy])
529 /// is mapped to a C++ class using the [Protobuf mapping rules].
530 /// If the request fails, the [`StatusOr`] contains the error details.
531 ///
532 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
533 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
534 /// [Long Running Operation]: https://google.aip.dev/151
535 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
536 /// [`future`]: @ref google::cloud::future
537 /// [`StatusOr`]: @ref google::cloud::StatusOr
538 /// [`Status`]: @ref google::cloud::Status
539 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
540 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
541 ///
542 // clang-format on
543 StatusOr<google::iam::v1::Policy> SetIamPolicy(
544 google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
545
546 // clang-format off
547 ///
548 /// Returns the caller's permission on the specified data policy resource.
549 ///
550 /// @param request Unary RPCs, such as the one wrapped by this
551 /// function, receive a single `request` proto message which includes all
552 /// the inputs for the RPC. In this case, the proto message is a
553 /// [google.iam.v1.TestIamPermissionsRequest].
554 /// Proto messages are converted to C++ classes by Protobuf, using the
555 /// [Protobuf mapping rules].
556 /// @param opts Optional. Override the class-level options, such as retry and
557 /// backoff policies.
558 /// @return the result of the RPC. The response message type
559 /// ([google.iam.v1.TestIamPermissionsResponse])
560 /// is mapped to a C++ class using the [Protobuf mapping rules].
561 /// If the request fails, the [`StatusOr`] contains the error details.
562 ///
563 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
564 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
565 /// [Long Running Operation]: https://google.aip.dev/151
566 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
567 /// [`future`]: @ref google::cloud::future
568 /// [`StatusOr`]: @ref google::cloud::StatusOr
569 /// [`Status`]: @ref google::cloud::Status
570 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
571 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
572 ///
573 // clang-format on
574 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
575 google::iam::v1::TestIamPermissionsRequest const& request,
576 Options opts = {});
577
578 private:
579 std::shared_ptr<DataPolicyServiceConnection> connection_;
580 Options options_;
581};
582
583GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
584} // namespace bigquery_datapolicies_v1
585} // namespace cloud
586} // namespace google
587
588#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