Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
iam_client.h
1// Copyright 2021 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/iam/admin/v1/iam.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_IAM_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_IAM_CLIENT_H
21
22#include "google/cloud/iam/admin/v1/iam_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/iam_updater.h"
25#include "google/cloud/options.h"
26#include "google/cloud/polling_policy.h"
27#include "google/cloud/status_or.h"
28#include "google/cloud/version.h"
29#include <memory>
30
31namespace google {
32namespace cloud {
33namespace iam_admin_v1 {
34GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
35
36///
37/// Creates and manages Identity and Access Management (IAM) resources.
38///
39/// You can use this service to work with all of the following resources:
40///
41/// * **Service accounts**, which identify an application or a virtual machine
42/// (VM) instance rather than a person
43/// * **Service account keys**, which service accounts use to authenticate with
44/// Google APIs
45/// * **IAM policies for service accounts**, which specify the roles that a
46/// principal has for the service account
47/// * **IAM custom roles**, which help you limit the number of permissions that
48/// you grant to principals
49///
50/// In addition, you can use this service to complete the following tasks, among
51/// others:
52///
53/// * Test whether a service account can use specific permissions
54/// * Check which roles you can grant for a specific resource
55/// * Lint, or validate, condition expressions in an IAM policy
56///
57/// When you read data from the IAM API, each read is eventually consistent. In
58/// other words, if you write data with the IAM API, then immediately read that
59/// data, the read operation might return an older version of the data. To deal
60/// with this behavior, your application can retry the request with truncated
61/// exponential backoff.
62///
63/// In contrast, writing data to the IAM API is sequentially consistent. In
64/// other words, write operations are always processed in the order in which
65/// they were received.
66///
67/// @par Equality
68///
69/// Instances of this class created via copy-construction or copy-assignment
70/// always compare equal. Instances created with equal
71/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
72/// equal share the same underlying resources.
73///
74/// @par Performance
75///
76/// Creating a new instance of this class is a relatively expensive operation,
77/// new objects establish new connections to the service. In contrast,
78/// copy-construction, move-construction, and the corresponding assignment
79/// operations are relatively efficient as the copies share all underlying
80/// resources.
81///
82/// @par Thread Safety
83///
84/// Concurrent access to different instances of this class, even if they compare
85/// equal, is guaranteed to work. Two or more threads operating on the same
86/// instance of this class is not guaranteed to work. Since copy-construction
87/// and move-construction is a relatively efficient operation, consider using
88/// such a copy when using this class from multiple threads.
89///
90class IAMClient {
91 public:
92 explicit IAMClient(std::shared_ptr<IAMConnection> connection,
93 Options opts = {});
94 ~IAMClient();
95
96 ///@{
97 /// @name Copy and move support
98 IAMClient(IAMClient const&) = default;
99 IAMClient& operator=(IAMClient const&) = default;
100 IAMClient(IAMClient&&) = default;
101 IAMClient& operator=(IAMClient&&) = default;
102 ///@}
103
104 ///@{
105 /// @name Equality
106 friend bool operator==(IAMClient const& a, IAMClient const& b) {
107 return a.connection_ == b.connection_;
108 }
109 friend bool operator!=(IAMClient const& a, IAMClient const& b) {
110 return !(a == b);
111 }
112 ///@}
113
114 // clang-format off
115 ///
116 /// Lists every [ServiceAccount][google.iam.admin.v1.ServiceAccount] that belongs to a specific project.
117 ///
118 /// @param name Required. The resource name of the project associated with the service
119 /// accounts, such as `projects/my-project-123`.
120 /// @param opts Optional. Override the class-level options, such as retry and
121 /// backoff policies.
122 /// @return a [StreamRange](@ref google::cloud::StreamRange)
123 /// to iterate of the results. See the documentation of this type for
124 /// details. In brief, this class has `begin()` and `end()` member
125 /// functions returning a iterator class meeting the
126 /// [input iterator requirements]. The value type for this iterator is a
127 /// [`StatusOr`] as the iteration may fail even after some values are
128 /// retrieved successfully, for example, if there is a network disconnect.
129 /// An empty set of results does not indicate an error, it indicates
130 /// that there are no resources meeting the request criteria.
131 /// On a successful iteration the `StatusOr<T>` contains elements of type
132 /// [google.iam.admin.v1.ServiceAccount], or rather,
133 /// the C++ class generated by Protobuf from that type. Please consult the
134 /// Protobuf documentation for details on the [Protobuf mapping rules].
135 ///
136 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
137 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
138 /// [Long Running Operation]: https://google.aip.dev/151
139 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
140 /// [`future`]: @ref google::cloud::future
141 /// [`StatusOr`]: @ref google::cloud::StatusOr
142 /// [`Status`]: @ref google::cloud::Status
143 /// [google.iam.admin.v1.ListServiceAccountsRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L576}
144 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
145 ///
146 // clang-format on
147 StreamRange<google::iam::admin::v1::ServiceAccount> ListServiceAccounts(
148 std::string const& name, Options opts = {});
149
150 // clang-format off
151 ///
152 /// Lists every [ServiceAccount][google.iam.admin.v1.ServiceAccount] that belongs to a specific project.
153 ///
154 /// @param request Unary RPCs, such as the one wrapped by this
155 /// function, receive a single `request` proto message which includes all
156 /// the inputs for the RPC. In this case, the proto message is a
157 /// [google.iam.admin.v1.ListServiceAccountsRequest].
158 /// Proto messages are converted to C++ classes by Protobuf, using the
159 /// [Protobuf mapping rules].
160 /// @param opts Optional. Override the class-level options, such as retry and
161 /// backoff policies.
162 /// @return a [StreamRange](@ref google::cloud::StreamRange)
163 /// to iterate of the results. See the documentation of this type for
164 /// details. In brief, this class has `begin()` and `end()` member
165 /// functions returning a iterator class meeting the
166 /// [input iterator requirements]. The value type for this iterator is a
167 /// [`StatusOr`] as the iteration may fail even after some values are
168 /// retrieved successfully, for example, if there is a network disconnect.
169 /// An empty set of results does not indicate an error, it indicates
170 /// that there are no resources meeting the request criteria.
171 /// On a successful iteration the `StatusOr<T>` contains elements of type
172 /// [google.iam.admin.v1.ServiceAccount], or rather,
173 /// the C++ class generated by Protobuf from that type. Please consult the
174 /// Protobuf documentation for details on the [Protobuf mapping rules].
175 ///
176 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
177 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
178 /// [Long Running Operation]: https://google.aip.dev/151
179 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
180 /// [`future`]: @ref google::cloud::future
181 /// [`StatusOr`]: @ref google::cloud::StatusOr
182 /// [`Status`]: @ref google::cloud::Status
183 /// [google.iam.admin.v1.ListServiceAccountsRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L576}
184 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
185 ///
186 // clang-format on
187 StreamRange<google::iam::admin::v1::ServiceAccount> ListServiceAccounts(
188 google::iam::admin::v1::ListServiceAccountsRequest request,
189 Options opts = {});
190
191 // clang-format off
192 ///
193 /// Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
194 ///
195 /// @param name Required. The resource name of the service account in the following format:
196 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
197 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
198 /// the account. The `ACCOUNT` value can be the `email` address or the
199 /// `unique_id` of the service account.
200 /// @param opts Optional. Override the class-level options, such as retry and
201 /// backoff policies.
202 /// @return the result of the RPC. The response message type
203 /// ([google.iam.admin.v1.ServiceAccount])
204 /// is mapped to a C++ class using the [Protobuf mapping rules].
205 /// If the request fails, the [`StatusOr`] contains the error details.
206 ///
207 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
208 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
209 /// [Long Running Operation]: https://google.aip.dev/151
210 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
211 /// [`future`]: @ref google::cloud::future
212 /// [`StatusOr`]: @ref google::cloud::StatusOr
213 /// [`Status`]: @ref google::cloud::Status
214 /// [google.iam.admin.v1.GetServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L611}
215 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
216 ///
217 // clang-format on
218 StatusOr<google::iam::admin::v1::ServiceAccount> GetServiceAccount(
219 std::string const& name, Options opts = {});
220
221 // clang-format off
222 ///
223 /// Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
224 ///
225 /// @param request Unary RPCs, such as the one wrapped by this
226 /// function, receive a single `request` proto message which includes all
227 /// the inputs for the RPC. In this case, the proto message is a
228 /// [google.iam.admin.v1.GetServiceAccountRequest].
229 /// Proto messages are converted to C++ classes by Protobuf, using the
230 /// [Protobuf mapping rules].
231 /// @param opts Optional. Override the class-level options, such as retry and
232 /// backoff policies.
233 /// @return the result of the RPC. The response message type
234 /// ([google.iam.admin.v1.ServiceAccount])
235 /// is mapped to a C++ class using the [Protobuf mapping rules].
236 /// If the request fails, the [`StatusOr`] contains the error details.
237 ///
238 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
239 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
240 /// [Long Running Operation]: https://google.aip.dev/151
241 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
242 /// [`future`]: @ref google::cloud::future
243 /// [`StatusOr`]: @ref google::cloud::StatusOr
244 /// [`Status`]: @ref google::cloud::Status
245 /// [google.iam.admin.v1.GetServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L611}
246 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
247 ///
248 // clang-format on
249 StatusOr<google::iam::admin::v1::ServiceAccount> GetServiceAccount(
250 google::iam::admin::v1::GetServiceAccountRequest const& request,
251 Options opts = {});
252
253 // clang-format off
254 ///
255 /// Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
256 ///
257 /// @param name Required. The resource name of the project associated with the service
258 /// accounts, such as `projects/my-project-123`.
259 /// @param account_id Required. The account id that is used to generate the service account
260 /// email address and a stable unique id. It is unique within a project,
261 /// must be 6-30 characters long, and match the regular expression
262 /// `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035.
263 /// @param service_account The [ServiceAccount][google.iam.admin.v1.ServiceAccount] resource to
264 /// create. Currently, only the following values are user assignable:
265 /// `display_name` and `description`.
266 /// @param opts Optional. Override the class-level options, such as retry and
267 /// backoff policies.
268 /// @return the result of the RPC. The response message type
269 /// ([google.iam.admin.v1.ServiceAccount])
270 /// is mapped to a C++ class using the [Protobuf mapping rules].
271 /// If the request fails, the [`StatusOr`] contains the error details.
272 ///
273 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
274 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
275 /// [Long Running Operation]: https://google.aip.dev/151
276 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
277 /// [`future`]: @ref google::cloud::future
278 /// [`StatusOr`]: @ref google::cloud::StatusOr
279 /// [`Status`]: @ref google::cloud::Status
280 /// [google.iam.admin.v1.CreateServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L553}
281 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
282 ///
283 // clang-format on
284 StatusOr<google::iam::admin::v1::ServiceAccount> CreateServiceAccount(
285 std::string const& name, std::string const& account_id,
286 google::iam::admin::v1::ServiceAccount const& service_account,
287 Options opts = {});
288
289 // clang-format off
290 ///
291 /// Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
292 ///
293 /// @param request Unary RPCs, such as the one wrapped by this
294 /// function, receive a single `request` proto message which includes all
295 /// the inputs for the RPC. In this case, the proto message is a
296 /// [google.iam.admin.v1.CreateServiceAccountRequest].
297 /// Proto messages are converted to C++ classes by Protobuf, using the
298 /// [Protobuf mapping rules].
299 /// @param opts Optional. Override the class-level options, such as retry and
300 /// backoff policies.
301 /// @return the result of the RPC. The response message type
302 /// ([google.iam.admin.v1.ServiceAccount])
303 /// is mapped to a C++ class using the [Protobuf mapping rules].
304 /// If the request fails, the [`StatusOr`] contains the error details.
305 ///
306 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
307 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
308 /// [Long Running Operation]: https://google.aip.dev/151
309 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
310 /// [`future`]: @ref google::cloud::future
311 /// [`StatusOr`]: @ref google::cloud::StatusOr
312 /// [`Status`]: @ref google::cloud::Status
313 /// [google.iam.admin.v1.CreateServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L553}
314 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
315 ///
316 // clang-format on
317 StatusOr<google::iam::admin::v1::ServiceAccount> CreateServiceAccount(
318 google::iam::admin::v1::CreateServiceAccountRequest const& request,
319 Options opts = {});
320
321 // clang-format off
322 ///
323 /// Patches a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
324 ///
325 /// @param request Unary RPCs, such as the one wrapped by this
326 /// function, receive a single `request` proto message which includes all
327 /// the inputs for the RPC. In this case, the proto message is a
328 /// [google.iam.admin.v1.PatchServiceAccountRequest].
329 /// Proto messages are converted to C++ classes by Protobuf, using the
330 /// [Protobuf mapping rules].
331 /// @param opts Optional. Override the class-level options, such as retry and
332 /// backoff policies.
333 /// @return the result of the RPC. The response message type
334 /// ([google.iam.admin.v1.ServiceAccount])
335 /// is mapped to a C++ class using the [Protobuf mapping rules].
336 /// If the request fails, the [`StatusOr`] contains the error details.
337 ///
338 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
339 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
340 /// [Long Running Operation]: https://google.aip.dev/151
341 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
342 /// [`future`]: @ref google::cloud::future
343 /// [`StatusOr`]: @ref google::cloud::StatusOr
344 /// [`Status`]: @ref google::cloud::Status
345 /// [google.iam.admin.v1.PatchServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L647}
346 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
347 ///
348 // clang-format on
349 StatusOr<google::iam::admin::v1::ServiceAccount> PatchServiceAccount(
350 google::iam::admin::v1::PatchServiceAccountRequest const& request,
351 Options opts = {});
352
353 // clang-format off
354 ///
355 /// Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
356 ///
357 /// **Warning:** After you delete a service account, you might not be able to
358 /// undelete it. If you know that you need to re-enable the service account in
359 /// the future, use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] instead.
360 ///
361 /// If you delete a service account, IAM permanently removes the service
362 /// account 30 days later. Google Cloud cannot recover the service account
363 /// after it is permanently removed, even if you file a support request.
364 ///
365 /// To help avoid unplanned outages, we recommend that you disable the service
366 /// account before you delete it. Use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] to disable the
367 /// service account, then wait at least 24 hours and watch for unintended
368 /// consequences. If there are no unintended consequences, you can delete the
369 /// service account.
370 ///
371 /// @param name Required. The resource name of the service account in the following format:
372 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
373 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
374 /// the account. The `ACCOUNT` value can be the `email` address or the
375 /// `unique_id` of the service account.
376 /// @param opts Optional. Override the class-level options, such as retry and
377 /// backoff policies.
378 /// @return a [`Status`] object. If the request failed, the
379 /// status contains the details of the failure.
380 ///
381 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
382 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
383 /// [Long Running Operation]: https://google.aip.dev/151
384 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
385 /// [`future`]: @ref google::cloud::future
386 /// [`StatusOr`]: @ref google::cloud::StatusOr
387 /// [`Status`]: @ref google::cloud::Status
388 /// [google.iam.admin.v1.DeleteServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L626}
389 /// [google.iam.admin.v1.IAM.DisableServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L184}
390 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
391 ///
392 // clang-format on
393 Status DeleteServiceAccount(std::string const& name, Options opts = {});
394
395 // clang-format off
396 ///
397 /// Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
398 ///
399 /// **Warning:** After you delete a service account, you might not be able to
400 /// undelete it. If you know that you need to re-enable the service account in
401 /// the future, use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] instead.
402 ///
403 /// If you delete a service account, IAM permanently removes the service
404 /// account 30 days later. Google Cloud cannot recover the service account
405 /// after it is permanently removed, even if you file a support request.
406 ///
407 /// To help avoid unplanned outages, we recommend that you disable the service
408 /// account before you delete it. Use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] to disable the
409 /// service account, then wait at least 24 hours and watch for unintended
410 /// consequences. If there are no unintended consequences, you can delete the
411 /// service account.
412 ///
413 /// @param request Unary RPCs, such as the one wrapped by this
414 /// function, receive a single `request` proto message which includes all
415 /// the inputs for the RPC. In this case, the proto message is a
416 /// [google.iam.admin.v1.DeleteServiceAccountRequest].
417 /// Proto messages are converted to C++ classes by Protobuf, using the
418 /// [Protobuf mapping rules].
419 /// @param opts Optional. Override the class-level options, such as retry and
420 /// backoff policies.
421 /// @return a [`Status`] object. If the request failed, the
422 /// status contains the details of the failure.
423 ///
424 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
425 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
426 /// [Long Running Operation]: https://google.aip.dev/151
427 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
428 /// [`future`]: @ref google::cloud::future
429 /// [`StatusOr`]: @ref google::cloud::StatusOr
430 /// [`Status`]: @ref google::cloud::Status
431 /// [google.iam.admin.v1.DeleteServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L626}
432 /// [google.iam.admin.v1.IAM.DisableServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L184}
433 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
434 ///
435 // clang-format on
437 google::iam::admin::v1::DeleteServiceAccountRequest const& request,
438 Options opts = {});
439
440 // clang-format off
441 ///
442 /// Restores a deleted [ServiceAccount][google.iam.admin.v1.ServiceAccount].
443 ///
444 /// **Important:** It is not always possible to restore a deleted service
445 /// account. Use this method only as a last resort.
446 ///
447 /// After you delete a service account, IAM permanently removes the service
448 /// account 30 days later. There is no way to restore a deleted service account
449 /// that has been permanently removed.
450 ///
451 /// @param request Unary RPCs, such as the one wrapped by this
452 /// function, receive a single `request` proto message which includes all
453 /// the inputs for the RPC. In this case, the proto message is a
454 /// [google.iam.admin.v1.UndeleteServiceAccountRequest].
455 /// Proto messages are converted to C++ classes by Protobuf, using the
456 /// [Protobuf mapping rules].
457 /// @param opts Optional. Override the class-level options, such as retry and
458 /// backoff policies.
459 /// @return the result of the RPC. The response message type
460 /// ([google.iam.admin.v1.UndeleteServiceAccountResponse])
461 /// is mapped to a C++ class using the [Protobuf mapping rules].
462 /// If the request fails, the [`StatusOr`] contains the error details.
463 ///
464 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
465 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
466 /// [Long Running Operation]: https://google.aip.dev/151
467 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
468 /// [`future`]: @ref google::cloud::future
469 /// [`StatusOr`]: @ref google::cloud::StatusOr
470 /// [`Status`]: @ref google::cloud::Status
471 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
472 /// [google.iam.admin.v1.UndeleteServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L654}
473 /// [google.iam.admin.v1.UndeleteServiceAccountResponse]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L662}
474 ///
475 // clang-format on
476 StatusOr<google::iam::admin::v1::UndeleteServiceAccountResponse>
478 google::iam::admin::v1::UndeleteServiceAccountRequest const& request,
479 Options opts = {});
480
481 // clang-format off
482 ///
483 /// Enables a [ServiceAccount][google.iam.admin.v1.ServiceAccount] that was disabled by
484 /// [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount].
485 ///
486 /// If the service account is already enabled, then this method has no effect.
487 ///
488 /// If the service account was disabled by other means—for example, if Google
489 /// disabled the service account because it was compromised—you cannot use this
490 /// method to enable the service account.
491 ///
492 /// @param request Unary RPCs, such as the one wrapped by this
493 /// function, receive a single `request` proto message which includes all
494 /// the inputs for the RPC. In this case, the proto message is a
495 /// [google.iam.admin.v1.EnableServiceAccountRequest].
496 /// Proto messages are converted to C++ classes by Protobuf, using the
497 /// [Protobuf mapping rules].
498 /// @param opts Optional. Override the class-level options, such as retry and
499 /// backoff policies.
500 /// @return a [`Status`] object. If the request failed, the
501 /// status contains the details of the failure.
502 ///
503 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
504 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
505 /// [Long Running Operation]: https://google.aip.dev/151
506 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
507 /// [`future`]: @ref google::cloud::future
508 /// [`StatusOr`]: @ref google::cloud::StatusOr
509 /// [`Status`]: @ref google::cloud::Status
510 /// [google.iam.admin.v1.EnableServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L668}
511 /// [google.iam.admin.v1.IAM.DisableServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L184}
512 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
513 ///
514 // clang-format on
516 google::iam::admin::v1::EnableServiceAccountRequest const& request,
517 Options opts = {});
518
519 // clang-format off
520 ///
521 /// Disables a [ServiceAccount][google.iam.admin.v1.ServiceAccount] immediately.
522 ///
523 /// If an application uses the service account to authenticate, that
524 /// application can no longer call Google APIs or access Google Cloud
525 /// resources. Existing access tokens for the service account are rejected, and
526 /// requests for new access tokens will fail.
527 ///
528 /// To re-enable the service account, use [EnableServiceAccount][google.iam.admin.v1.IAM.EnableServiceAccount]. After you
529 /// re-enable the service account, its existing access tokens will be accepted,
530 /// and you can request new access tokens.
531 ///
532 /// To help avoid unplanned outages, we recommend that you disable the service
533 /// account before you delete it. Use this method to disable the service
534 /// account, then wait at least 24 hours and watch for unintended consequences.
535 /// If there are no unintended consequences, you can delete the service account
536 /// with [DeleteServiceAccount][google.iam.admin.v1.IAM.DeleteServiceAccount].
537 ///
538 /// @param request Unary RPCs, such as the one wrapped by this
539 /// function, receive a single `request` proto message which includes all
540 /// the inputs for the RPC. In this case, the proto message is a
541 /// [google.iam.admin.v1.DisableServiceAccountRequest].
542 /// Proto messages are converted to C++ classes by Protobuf, using the
543 /// [Protobuf mapping rules].
544 /// @param opts Optional. Override the class-level options, such as retry and
545 /// backoff policies.
546 /// @return a [`Status`] object. If the request failed, the
547 /// status contains the details of the failure.
548 ///
549 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
550 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
551 /// [Long Running Operation]: https://google.aip.dev/151
552 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
553 /// [`future`]: @ref google::cloud::future
554 /// [`StatusOr`]: @ref google::cloud::StatusOr
555 /// [`Status`]: @ref google::cloud::Status
556 /// [google.iam.admin.v1.DisableServiceAccountRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L678}
557 /// [google.iam.admin.v1.IAM.DeleteServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L131}
558 /// [google.iam.admin.v1.IAM.EnableServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L161}
559 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
560 ///
561 // clang-format on
563 google::iam::admin::v1::DisableServiceAccountRequest const& request,
564 Options opts = {});
565
566 // clang-format off
567 ///
568 /// Lists every [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] for a service account.
569 ///
570 /// @param name Required. The resource name of the service account in the following format:
571 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
572 /// @n
573 /// Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from
574 /// the account. The `ACCOUNT` value can be the `email` address or the
575 /// `unique_id` of the service account.
576 /// @param key_types Filters the types of keys the user wants to include in the list
577 /// response. Duplicate key types are not allowed. If no key type
578 /// is provided, all keys are returned.
579 /// @param opts Optional. Override the class-level options, such as retry and
580 /// backoff policies.
581 /// @return the result of the RPC. The response message type
582 /// ([google.iam.admin.v1.ListServiceAccountKeysResponse])
583 /// is mapped to a C++ class using the [Protobuf mapping rules].
584 /// If the request fails, the [`StatusOr`] contains the error details.
585 ///
586 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
587 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
588 /// [Long Running Operation]: https://google.aip.dev/151
589 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
590 /// [`future`]: @ref google::cloud::future
591 /// [`StatusOr`]: @ref google::cloud::StatusOr
592 /// [`Status`]: @ref google::cloud::Status
593 /// [google.iam.admin.v1.ListServiceAccountKeysRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L688}
594 /// [google.iam.admin.v1.ListServiceAccountKeysResponse]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L723}
595 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
596 ///
597 // clang-format on
598 StatusOr<google::iam::admin::v1::ListServiceAccountKeysResponse>
600 std::string const& name,
601 std::vector<
602 google::iam::admin::v1::ListServiceAccountKeysRequest::KeyType> const&
603 key_types,
604 Options opts = {});
605
606 // clang-format off
607 ///
608 /// Lists every [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] for a service account.
609 ///
610 /// @param request Unary RPCs, such as the one wrapped by this
611 /// function, receive a single `request` proto message which includes all
612 /// the inputs for the RPC. In this case, the proto message is a
613 /// [google.iam.admin.v1.ListServiceAccountKeysRequest].
614 /// Proto messages are converted to C++ classes by Protobuf, using the
615 /// [Protobuf mapping rules].
616 /// @param opts Optional. Override the class-level options, such as retry and
617 /// backoff policies.
618 /// @return the result of the RPC. The response message type
619 /// ([google.iam.admin.v1.ListServiceAccountKeysResponse])
620 /// is mapped to a C++ class using the [Protobuf mapping rules].
621 /// If the request fails, the [`StatusOr`] contains the error details.
622 ///
623 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
624 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
625 /// [Long Running Operation]: https://google.aip.dev/151
626 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
627 /// [`future`]: @ref google::cloud::future
628 /// [`StatusOr`]: @ref google::cloud::StatusOr
629 /// [`Status`]: @ref google::cloud::Status
630 /// [google.iam.admin.v1.ListServiceAccountKeysRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L688}
631 /// [google.iam.admin.v1.ListServiceAccountKeysResponse]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L723}
632 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
633 ///
634 // clang-format on
635 StatusOr<google::iam::admin::v1::ListServiceAccountKeysResponse>
637 google::iam::admin::v1::ListServiceAccountKeysRequest const& request,
638 Options opts = {});
639
640 // clang-format off
641 ///
642 /// Gets a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
643 ///
644 /// @param name Required. The resource name of the service account key in the following format:
645 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
646 /// @n
647 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
648 /// the account. The `ACCOUNT` value can be the `email` address or the
649 /// `unique_id` of the service account.
650 /// @param public_key_type Optional. The output format of the public key. The default is `TYPE_NONE`, which
651 /// means that the public key is not returned.
652 /// @param opts Optional. Override the class-level options, such as retry and
653 /// backoff policies.
654 /// @return the result of the RPC. The response message type
655 /// ([google.iam.admin.v1.ServiceAccountKey])
656 /// is mapped to a C++ class using the [Protobuf mapping rules].
657 /// If the request fails, the [`StatusOr`] contains the error details.
658 ///
659 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
660 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
661 /// [Long Running Operation]: https://google.aip.dev/151
662 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
663 /// [`future`]: @ref google::cloud::future
664 /// [`StatusOr`]: @ref google::cloud::StatusOr
665 /// [`Status`]: @ref google::cloud::Status
666 /// [google.iam.admin.v1.GetServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L729}
667 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
668 ///
669 // clang-format on
670 StatusOr<google::iam::admin::v1::ServiceAccountKey> GetServiceAccountKey(
671 std::string const& name,
672 google::iam::admin::v1::ServiceAccountPublicKeyType public_key_type,
673 Options opts = {});
674
675 // clang-format off
676 ///
677 /// Gets a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
678 ///
679 /// @param request Unary RPCs, such as the one wrapped by this
680 /// function, receive a single `request` proto message which includes all
681 /// the inputs for the RPC. In this case, the proto message is a
682 /// [google.iam.admin.v1.GetServiceAccountKeyRequest].
683 /// Proto messages are converted to C++ classes by Protobuf, using the
684 /// [Protobuf mapping rules].
685 /// @param opts Optional. Override the class-level options, such as retry and
686 /// backoff policies.
687 /// @return the result of the RPC. The response message type
688 /// ([google.iam.admin.v1.ServiceAccountKey])
689 /// is mapped to a C++ class using the [Protobuf mapping rules].
690 /// If the request fails, the [`StatusOr`] contains the error details.
691 ///
692 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
693 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
694 /// [Long Running Operation]: https://google.aip.dev/151
695 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
696 /// [`future`]: @ref google::cloud::future
697 /// [`StatusOr`]: @ref google::cloud::StatusOr
698 /// [`Status`]: @ref google::cloud::Status
699 /// [google.iam.admin.v1.GetServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L729}
700 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
701 ///
702 // clang-format on
703 StatusOr<google::iam::admin::v1::ServiceAccountKey> GetServiceAccountKey(
704 google::iam::admin::v1::GetServiceAccountKeyRequest const& request,
705 Options opts = {});
706
707 // clang-format off
708 ///
709 /// Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
710 ///
711 /// @param name Required. The resource name of the service account in the following format:
712 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
713 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
714 /// the account. The `ACCOUNT` value can be the `email` address or the
715 /// `unique_id` of the service account.
716 /// @param private_key_type The output format of the private key. The default value is
717 /// `TYPE_GOOGLE_CREDENTIALS_FILE`, which is the Google Credentials File
718 /// format.
719 /// @param key_algorithm Which type of key and algorithm to use for the key.
720 /// The default is currently a 2K RSA key. However this may change in the
721 /// future.
722 /// @param opts Optional. Override the class-level options, such as retry and
723 /// backoff policies.
724 /// @return the result of the RPC. The response message type
725 /// ([google.iam.admin.v1.ServiceAccountKey])
726 /// is mapped to a C++ class using the [Protobuf mapping rules].
727 /// If the request fails, the [`StatusOr`] contains the error details.
728 ///
729 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
730 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
731 /// [Long Running Operation]: https://google.aip.dev/151
732 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
733 /// [`future`]: @ref google::cloud::future
734 /// [`StatusOr`]: @ref google::cloud::StatusOr
735 /// [`Status`]: @ref google::cloud::Status
736 /// [google.iam.admin.v1.CreateServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L875}
737 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
738 ///
739 // clang-format on
740 StatusOr<google::iam::admin::v1::ServiceAccountKey> CreateServiceAccountKey(
741 std::string const& name,
742 google::iam::admin::v1::ServiceAccountPrivateKeyType private_key_type,
743 google::iam::admin::v1::ServiceAccountKeyAlgorithm key_algorithm,
744 Options opts = {});
745
746 // clang-format off
747 ///
748 /// Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
749 ///
750 /// @param request Unary RPCs, such as the one wrapped by this
751 /// function, receive a single `request` proto message which includes all
752 /// the inputs for the RPC. In this case, the proto message is a
753 /// [google.iam.admin.v1.CreateServiceAccountKeyRequest].
754 /// Proto messages are converted to C++ classes by Protobuf, using the
755 /// [Protobuf mapping rules].
756 /// @param opts Optional. Override the class-level options, such as retry and
757 /// backoff policies.
758 /// @return the result of the RPC. The response message type
759 /// ([google.iam.admin.v1.ServiceAccountKey])
760 /// is mapped to a C++ class using the [Protobuf mapping rules].
761 /// If the request fails, the [`StatusOr`] contains the error details.
762 ///
763 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
764 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
765 /// [Long Running Operation]: https://google.aip.dev/151
766 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
767 /// [`future`]: @ref google::cloud::future
768 /// [`StatusOr`]: @ref google::cloud::StatusOr
769 /// [`Status`]: @ref google::cloud::Status
770 /// [google.iam.admin.v1.CreateServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L875}
771 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
772 ///
773 // clang-format on
774 StatusOr<google::iam::admin::v1::ServiceAccountKey> CreateServiceAccountKey(
775 google::iam::admin::v1::CreateServiceAccountKeyRequest const& request,
776 Options opts = {});
777
778 // clang-format off
779 ///
780 /// Uploads the public key portion of a key pair that you manage, and
781 /// associates the public key with a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
782 ///
783 /// After you upload the public key, you can use the private key from the key
784 /// pair as a service account key.
785 ///
786 /// @param request Unary RPCs, such as the one wrapped by this
787 /// function, receive a single `request` proto message which includes all
788 /// the inputs for the RPC. In this case, the proto message is a
789 /// [google.iam.admin.v1.UploadServiceAccountKeyRequest].
790 /// Proto messages are converted to C++ classes by Protobuf, using the
791 /// [Protobuf mapping rules].
792 /// @param opts Optional. Override the class-level options, such as retry and
793 /// backoff policies.
794 /// @return the result of the RPC. The response message type
795 /// ([google.iam.admin.v1.ServiceAccountKey])
796 /// is mapped to a C++ class using the [Protobuf mapping rules].
797 /// If the request fails, the [`StatusOr`] contains the error details.
798 ///
799 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
800 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
801 /// [Long Running Operation]: https://google.aip.dev/151
802 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
803 /// [`future`]: @ref google::cloud::future
804 /// [`StatusOr`]: @ref google::cloud::StatusOr
805 /// [`Status`]: @ref google::cloud::Status
806 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
807 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
808 /// [google.iam.admin.v1.UploadServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L900}
809 ///
810 // clang-format on
811 StatusOr<google::iam::admin::v1::ServiceAccountKey> UploadServiceAccountKey(
812 google::iam::admin::v1::UploadServiceAccountKeyRequest const& request,
813 Options opts = {});
814
815 // clang-format off
816 ///
817 /// Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. Deleting a service account key does not
818 /// revoke short-lived credentials that have been issued based on the service
819 /// account key.
820 ///
821 /// @param name Required. The resource name of the service account key in the following format:
822 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
823 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
824 /// the account. The `ACCOUNT` value can be the `email` address or the
825 /// `unique_id` of the service account.
826 /// @param opts Optional. Override the class-level options, such as retry and
827 /// backoff policies.
828 /// @return a [`Status`] object. If the request failed, the
829 /// status contains the details of the failure.
830 ///
831 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
832 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
833 /// [Long Running Operation]: https://google.aip.dev/151
834 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
835 /// [`future`]: @ref google::cloud::future
836 /// [`StatusOr`]: @ref google::cloud::StatusOr
837 /// [`Status`]: @ref google::cloud::Status
838 /// [google.iam.admin.v1.DeleteServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L916}
839 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
840 ///
841 // clang-format on
842 Status DeleteServiceAccountKey(std::string const& name, Options opts = {});
843
844 // clang-format off
845 ///
846 /// Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. Deleting a service account key does not
847 /// revoke short-lived credentials that have been issued based on the service
848 /// account key.
849 ///
850 /// @param request Unary RPCs, such as the one wrapped by this
851 /// function, receive a single `request` proto message which includes all
852 /// the inputs for the RPC. In this case, the proto message is a
853 /// [google.iam.admin.v1.DeleteServiceAccountKeyRequest].
854 /// Proto messages are converted to C++ classes by Protobuf, using the
855 /// [Protobuf mapping rules].
856 /// @param opts Optional. Override the class-level options, such as retry and
857 /// backoff policies.
858 /// @return a [`Status`] object. If the request failed, the
859 /// status contains the details of the failure.
860 ///
861 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
862 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
863 /// [Long Running Operation]: https://google.aip.dev/151
864 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
865 /// [`future`]: @ref google::cloud::future
866 /// [`StatusOr`]: @ref google::cloud::StatusOr
867 /// [`Status`]: @ref google::cloud::Status
868 /// [google.iam.admin.v1.DeleteServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L916}
869 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
870 ///
871 // clang-format on
873 google::iam::admin::v1::DeleteServiceAccountKeyRequest const& request,
874 Options opts = {});
875
876 // clang-format off
877 ///
878 /// Disable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. A disabled service account key can be
879 /// re-enabled with [EnableServiceAccountKey][google.iam.admin.v1.IAM.EnableServiceAccountKey].
880 ///
881 /// @param name Required. The resource name of the service account key in the following format:
882 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
883 /// @n
884 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
885 /// the account. The `ACCOUNT` value can be the `email` address or the
886 /// `unique_id` of the service account.
887 /// @param opts Optional. Override the class-level options, such as retry and
888 /// backoff policies.
889 /// @return a [`Status`] object. If the request failed, the
890 /// status contains the details of the failure.
891 ///
892 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
893 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
894 /// [Long Running Operation]: https://google.aip.dev/151
895 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
896 /// [`future`]: @ref google::cloud::future
897 /// [`StatusOr`]: @ref google::cloud::StatusOr
898 /// [`Status`]: @ref google::cloud::Status
899 /// [google.iam.admin.v1.DisableServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L931}
900 /// [google.iam.admin.v1.IAM.EnableServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L249}
901 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
902 ///
903 // clang-format on
904 Status DisableServiceAccountKey(std::string const& name, Options opts = {});
905
906 // clang-format off
907 ///
908 /// Disable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. A disabled service account key can be
909 /// re-enabled with [EnableServiceAccountKey][google.iam.admin.v1.IAM.EnableServiceAccountKey].
910 ///
911 /// @param request Unary RPCs, such as the one wrapped by this
912 /// function, receive a single `request` proto message which includes all
913 /// the inputs for the RPC. In this case, the proto message is a
914 /// [google.iam.admin.v1.DisableServiceAccountKeyRequest].
915 /// Proto messages are converted to C++ classes by Protobuf, using the
916 /// [Protobuf mapping rules].
917 /// @param opts Optional. Override the class-level options, such as retry and
918 /// backoff policies.
919 /// @return a [`Status`] object. If the request failed, the
920 /// status contains the details of the failure.
921 ///
922 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
923 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
924 /// [Long Running Operation]: https://google.aip.dev/151
925 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
926 /// [`future`]: @ref google::cloud::future
927 /// [`StatusOr`]: @ref google::cloud::StatusOr
928 /// [`Status`]: @ref google::cloud::Status
929 /// [google.iam.admin.v1.DisableServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L931}
930 /// [google.iam.admin.v1.IAM.EnableServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L249}
931 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
932 ///
933 // clang-format on
935 google::iam::admin::v1::DisableServiceAccountKeyRequest const& request,
936 Options opts = {});
937
938 // clang-format off
939 ///
940 /// Enable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
941 ///
942 /// @param name Required. The resource name of the service account key in the following format:
943 /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
944 /// @n
945 /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
946 /// the account. The `ACCOUNT` value can be the `email` address or the
947 /// `unique_id` of the service account.
948 /// @param opts Optional. Override the class-level options, such as retry and
949 /// backoff policies.
950 /// @return a [`Status`] object. If the request failed, the
951 /// status contains the details of the failure.
952 ///
953 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
954 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
955 /// [Long Running Operation]: https://google.aip.dev/151
956 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
957 /// [`future`]: @ref google::cloud::future
958 /// [`StatusOr`]: @ref google::cloud::StatusOr
959 /// [`Status`]: @ref google::cloud::Status
960 /// [google.iam.admin.v1.EnableServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L947}
961 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
962 ///
963 // clang-format on
964 Status EnableServiceAccountKey(std::string const& name, Options opts = {});
965
966 // clang-format off
967 ///
968 /// Enable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
969 ///
970 /// @param request Unary RPCs, such as the one wrapped by this
971 /// function, receive a single `request` proto message which includes all
972 /// the inputs for the RPC. In this case, the proto message is a
973 /// [google.iam.admin.v1.EnableServiceAccountKeyRequest].
974 /// Proto messages are converted to C++ classes by Protobuf, using the
975 /// [Protobuf mapping rules].
976 /// @param opts Optional. Override the class-level options, such as retry and
977 /// backoff policies.
978 /// @return a [`Status`] object. If the request failed, the
979 /// status contains the details of the failure.
980 ///
981 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
982 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
983 /// [Long Running Operation]: https://google.aip.dev/151
984 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
985 /// [`future`]: @ref google::cloud::future
986 /// [`StatusOr`]: @ref google::cloud::StatusOr
987 /// [`Status`]: @ref google::cloud::Status
988 /// [google.iam.admin.v1.EnableServiceAccountKeyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L947}
989 /// [google.iam.admin.v1.ServiceAccountKey]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L822}
990 ///
991 // clang-format on
993 google::iam::admin::v1::EnableServiceAccountKeyRequest const& request,
994 Options opts = {});
995
996 // clang-format off
997 ///
998 /// Gets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. This IAM
999 /// policy specifies which principals have access to the service account.
1000 ///
1001 /// This method does not tell you whether the service account has been granted
1002 /// any roles on other resources. To check whether a service account has role
1003 /// grants on a resource, use the `getIamPolicy` method for that resource. For
1004 /// example, to view the role grants for a project, call the Resource Manager
1005 /// API's
1006 /// [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy)
1007 /// method.
1008 ///
1009 /// @param resource REQUIRED: The resource for which the policy is being requested.
1010 /// See the operation documentation for the appropriate value for this field.
1011 /// @param opts Optional. Override the class-level options, such as retry and
1012 /// backoff policies.
1013 /// @return the result of the RPC. The response message type
1014 /// ([google.iam.v1.Policy])
1015 /// is mapped to a C++ class using the [Protobuf mapping rules].
1016 /// If the request fails, the [`StatusOr`] contains the error details.
1017 ///
1018 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1019 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1020 /// [Long Running Operation]: https://google.aip.dev/151
1021 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1022 /// [`future`]: @ref google::cloud::future
1023 /// [`StatusOr`]: @ref google::cloud::StatusOr
1024 /// [`Status`]: @ref google::cloud::Status
1025 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
1026 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
1027 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1028 ///
1029 // clang-format on
1030 StatusOr<google::iam::v1::Policy> GetIamPolicy(std::string const& resource,
1031 Options opts = {});
1032
1033 // clang-format off
1034 ///
1035 /// Gets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. This IAM
1036 /// policy specifies which principals have access to the service account.
1037 ///
1038 /// This method does not tell you whether the service account has been granted
1039 /// any roles on other resources. To check whether a service account has role
1040 /// grants on a resource, use the `getIamPolicy` method for that resource. For
1041 /// example, to view the role grants for a project, call the Resource Manager
1042 /// API's
1043 /// [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy)
1044 /// method.
1045 ///
1046 /// @param request Unary RPCs, such as the one wrapped by this
1047 /// function, receive a single `request` proto message which includes all
1048 /// the inputs for the RPC. In this case, the proto message is a
1049 /// [google.iam.v1.GetIamPolicyRequest].
1050 /// Proto messages are converted to C++ classes by Protobuf, using the
1051 /// [Protobuf mapping rules].
1052 /// @param opts Optional. Override the class-level options, such as retry and
1053 /// backoff policies.
1054 /// @return the result of the RPC. The response message type
1055 /// ([google.iam.v1.Policy])
1056 /// is mapped to a C++ class using the [Protobuf mapping rules].
1057 /// If the request fails, the [`StatusOr`] contains the error details.
1058 ///
1059 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1060 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1061 /// [Long Running Operation]: https://google.aip.dev/151
1062 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1063 /// [`future`]: @ref google::cloud::future
1064 /// [`StatusOr`]: @ref google::cloud::StatusOr
1065 /// [`Status`]: @ref google::cloud::Status
1066 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
1067 /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123}
1068 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1069 ///
1070 // clang-format on
1071 StatusOr<google::iam::v1::Policy> GetIamPolicy(
1072 google::iam::v1::GetIamPolicyRequest const& request, Options opts = {});
1073
1074 // clang-format off
1075 ///
1076 /// Sets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
1077 ///
1078 /// Use this method to grant or revoke access to the service account. For
1079 /// example, you could grant a principal the ability to impersonate the service
1080 /// account.
1081 ///
1082 /// This method does not enable the service account to access other resources.
1083 /// To grant roles to a service account on a resource, follow these steps:
1084 ///
1085 /// 1. Call the resource's `getIamPolicy` method to get its current IAM policy.
1086 /// 2. Edit the policy so that it binds the service account to an IAM role for
1087 /// the resource.
1088 /// 3. Call the resource's `setIamPolicy` method to update its IAM policy.
1089 ///
1090 /// For detailed instructions, see
1091 /// [Manage access to project, folders, and
1092 /// organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts)
1093 /// or [Manage access to other
1094 /// resources](https://cloud.google.com/iam/help/access/manage-other-resources).
1095 ///
1096 /// @param resource REQUIRED: The resource for which the policy is being specified.
1097 /// See the operation documentation for the appropriate value for this field.
1098 /// @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of
1099 /// the policy is limited to a few 10s of KB. An empty policy is a
1100 /// valid policy but certain Cloud Platform services (such as Projects)
1101 /// might reject them.
1102 /// @param opts Optional. Override the class-level options, such as retry and
1103 /// backoff policies.
1104 /// @return the result of the RPC. The response message type
1105 /// ([google.iam.v1.Policy])
1106 /// is mapped to a C++ class using the [Protobuf mapping rules].
1107 /// If the request fails, the [`StatusOr`] contains the error details.
1108 ///
1109 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1110 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1111 /// [Long Running Operation]: https://google.aip.dev/151
1112 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1113 /// [`future`]: @ref google::cloud::future
1114 /// [`StatusOr`]: @ref google::cloud::StatusOr
1115 /// [`Status`]: @ref google::cloud::Status
1116 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
1117 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1118 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
1119 ///
1120 // clang-format on
1121 StatusOr<google::iam::v1::Policy> SetIamPolicy(
1122 std::string const& resource, google::iam::v1::Policy const& policy,
1123 Options opts = {});
1124
1125 /**
1126 * Updates the IAM policy for @p resource using an optimistic concurrency
1127 * control loop.
1128 *
1129 * The loop fetches the current policy for @p resource, and passes it to @p
1130 * updater, which should return the new policy. This new policy should use the
1131 * current etag so that the read-modify-write cycle can detect races and rerun
1132 * the update when there is a mismatch. If the new policy does not have an
1133 * etag, the existing policy will be blindly overwritten. If @p updater does
1134 * not yield a policy, the control loop is terminated and kCancelled is
1135 * returned.
1136 *
1137 * @param resource Required. The resource for which the policy is being
1138 * specified. See the operation documentation for the appropriate value for
1139 * this field.
1140 * @param updater Required. Functor to map the current policy to a new one.
1141 * @param opts Optional. Override the class-level options, such as retry and
1142 * backoff policies.
1143 * @return google::iam::v1::Policy
1144 */
1145 StatusOr<google::iam::v1::Policy> SetIamPolicy(std::string const& resource,
1146 IamUpdater const& updater,
1147 Options opts = {});
1148
1149 // clang-format off
1150 ///
1151 /// Sets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
1152 ///
1153 /// Use this method to grant or revoke access to the service account. For
1154 /// example, you could grant a principal the ability to impersonate the service
1155 /// account.
1156 ///
1157 /// This method does not enable the service account to access other resources.
1158 /// To grant roles to a service account on a resource, follow these steps:
1159 ///
1160 /// 1. Call the resource's `getIamPolicy` method to get its current IAM policy.
1161 /// 2. Edit the policy so that it binds the service account to an IAM role for
1162 /// the resource.
1163 /// 3. Call the resource's `setIamPolicy` method to update its IAM policy.
1164 ///
1165 /// For detailed instructions, see
1166 /// [Manage access to project, folders, and
1167 /// organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts)
1168 /// or [Manage access to other
1169 /// resources](https://cloud.google.com/iam/help/access/manage-other-resources).
1170 ///
1171 /// @param request Unary RPCs, such as the one wrapped by this
1172 /// function, receive a single `request` proto message which includes all
1173 /// the inputs for the RPC. In this case, the proto message is a
1174 /// [google.iam.v1.SetIamPolicyRequest].
1175 /// Proto messages are converted to C++ classes by Protobuf, using the
1176 /// [Protobuf mapping rules].
1177 /// @param opts Optional. Override the class-level options, such as retry and
1178 /// backoff policies.
1179 /// @return the result of the RPC. The response message type
1180 /// ([google.iam.v1.Policy])
1181 /// is mapped to a C++ class using the [Protobuf mapping rules].
1182 /// If the request fails, the [`StatusOr`] contains the error details.
1183 ///
1184 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1185 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1186 /// [Long Running Operation]: https://google.aip.dev/151
1187 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1188 /// [`future`]: @ref google::cloud::future
1189 /// [`StatusOr`]: @ref google::cloud::StatusOr
1190 /// [`Status`]: @ref google::cloud::Status
1191 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
1192 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1193 /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L101}
1194 ///
1195 // clang-format on
1196 StatusOr<google::iam::v1::Policy> SetIamPolicy(
1197 google::iam::v1::SetIamPolicyRequest const& request, Options opts = {});
1198
1199 // clang-format off
1200 ///
1201 /// Tests whether the caller has the specified permissions on a
1202 /// [ServiceAccount][google.iam.admin.v1.ServiceAccount].
1203 ///
1204 /// @param resource REQUIRED: The resource for which the policy detail is being requested.
1205 /// See the operation documentation for the appropriate value for this field.
1206 /// @param permissions The set of permissions to check for the `resource`. Permissions with
1207 /// wildcards (such as '*' or 'storage.*') are not allowed. For more
1208 /// information see
1209 /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1210 /// @param opts Optional. Override the class-level options, such as retry and
1211 /// backoff policies.
1212 /// @return the result of the RPC. The response message type
1213 /// ([google.iam.v1.TestIamPermissionsResponse])
1214 /// is mapped to a C++ class using the [Protobuf mapping rules].
1215 /// If the request fails, the [`StatusOr`] contains the error details.
1216 ///
1217 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1218 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1219 /// [Long Running Operation]: https://google.aip.dev/151
1220 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1221 /// [`future`]: @ref google::cloud::future
1222 /// [`StatusOr`]: @ref google::cloud::StatusOr
1223 /// [`Status`]: @ref google::cloud::Status
1224 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
1225 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
1226 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
1227 ///
1228 // clang-format on
1229 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
1230 std::string const& resource, std::vector<std::string> const& permissions,
1231 Options opts = {});
1232
1233 // clang-format off
1234 ///
1235 /// Tests whether the caller has the specified permissions on a
1236 /// [ServiceAccount][google.iam.admin.v1.ServiceAccount].
1237 ///
1238 /// @param request Unary RPCs, such as the one wrapped by this
1239 /// function, receive a single `request` proto message which includes all
1240 /// the inputs for the RPC. In this case, the proto message is a
1241 /// [google.iam.v1.TestIamPermissionsRequest].
1242 /// Proto messages are converted to C++ classes by Protobuf, using the
1243 /// [Protobuf mapping rules].
1244 /// @param opts Optional. Override the class-level options, such as retry and
1245 /// backoff policies.
1246 /// @return the result of the RPC. The response message type
1247 /// ([google.iam.v1.TestIamPermissionsResponse])
1248 /// is mapped to a C++ class using the [Protobuf mapping rules].
1249 /// If the request fails, the [`StatusOr`] contains the error details.
1250 ///
1251 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1252 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1253 /// [Long Running Operation]: https://google.aip.dev/151
1254 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1255 /// [`future`]: @ref google::cloud::future
1256 /// [`StatusOr`]: @ref google::cloud::StatusOr
1257 /// [`Status`]: @ref google::cloud::Status
1258 /// [google.iam.admin.v1.ServiceAccount]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L493}
1259 /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L136}
1260 /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L151}
1261 ///
1262 // clang-format on
1263 StatusOr<google::iam::v1::TestIamPermissionsResponse> TestIamPermissions(
1264 google::iam::v1::TestIamPermissionsRequest const& request,
1265 Options opts = {});
1266
1267 // clang-format off
1268 ///
1269 /// Lists roles that can be granted on a Google Cloud resource. A role is
1270 /// grantable if the IAM policy for the resource can contain bindings to the
1271 /// role.
1272 ///
1273 /// @param full_resource_name Required. The full resource name to query from the list of grantable roles.
1274 /// @n
1275 /// The name follows the Google Cloud Platform resource format.
1276 /// For example, a Cloud Platform project with id `my-project` will be named
1277 /// `//cloudresourcemanager.googleapis.com/projects/my-project`.
1278 /// @param opts Optional. Override the class-level options, such as retry and
1279 /// backoff policies.
1280 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1281 /// to iterate of the results. See the documentation of this type for
1282 /// details. In brief, this class has `begin()` and `end()` member
1283 /// functions returning a iterator class meeting the
1284 /// [input iterator requirements]. The value type for this iterator is a
1285 /// [`StatusOr`] as the iteration may fail even after some values are
1286 /// retrieved successfully, for example, if there is a network disconnect.
1287 /// An empty set of results does not indicate an error, it indicates
1288 /// that there are no resources meeting the request criteria.
1289 /// On a successful iteration the `StatusOr<T>` contains elements of type
1290 /// [google.iam.admin.v1.Role], or rather,
1291 /// the C++ class generated by Protobuf from that type. Please consult the
1292 /// Protobuf documentation for details on the [Protobuf mapping rules].
1293 ///
1294 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1295 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1296 /// [Long Running Operation]: https://google.aip.dev/151
1297 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1298 /// [`future`]: @ref google::cloud::future
1299 /// [`StatusOr`]: @ref google::cloud::StatusOr
1300 /// [`Status`]: @ref google::cloud::Status
1301 /// [google.iam.admin.v1.QueryGrantableRolesRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1128}
1302 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1303 ///
1304 // clang-format on
1305 StreamRange<google::iam::admin::v1::Role> QueryGrantableRoles(
1306 std::string const& full_resource_name, Options opts = {});
1307
1308 // clang-format off
1309 ///
1310 /// Lists roles that can be granted on a Google Cloud resource. A role is
1311 /// grantable if the IAM policy for the resource can contain bindings to the
1312 /// role.
1313 ///
1314 /// @param request Unary RPCs, such as the one wrapped by this
1315 /// function, receive a single `request` proto message which includes all
1316 /// the inputs for the RPC. In this case, the proto message is a
1317 /// [google.iam.admin.v1.QueryGrantableRolesRequest].
1318 /// Proto messages are converted to C++ classes by Protobuf, using the
1319 /// [Protobuf mapping rules].
1320 /// @param opts Optional. Override the class-level options, such as retry and
1321 /// backoff policies.
1322 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1323 /// to iterate of the results. See the documentation of this type for
1324 /// details. In brief, this class has `begin()` and `end()` member
1325 /// functions returning a iterator class meeting the
1326 /// [input iterator requirements]. The value type for this iterator is a
1327 /// [`StatusOr`] as the iteration may fail even after some values are
1328 /// retrieved successfully, for example, if there is a network disconnect.
1329 /// An empty set of results does not indicate an error, it indicates
1330 /// that there are no resources meeting the request criteria.
1331 /// On a successful iteration the `StatusOr<T>` contains elements of type
1332 /// [google.iam.admin.v1.Role], or rather,
1333 /// the C++ class generated by Protobuf from that type. Please consult the
1334 /// Protobuf documentation for details on the [Protobuf mapping rules].
1335 ///
1336 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1337 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1338 /// [Long Running Operation]: https://google.aip.dev/151
1339 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1340 /// [`future`]: @ref google::cloud::future
1341 /// [`StatusOr`]: @ref google::cloud::StatusOr
1342 /// [`Status`]: @ref google::cloud::Status
1343 /// [google.iam.admin.v1.QueryGrantableRolesRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1128}
1344 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1345 ///
1346 // clang-format on
1347 StreamRange<google::iam::admin::v1::Role> QueryGrantableRoles(
1348 google::iam::admin::v1::QueryGrantableRolesRequest request,
1349 Options opts = {});
1350
1351 // clang-format off
1352 ///
1353 /// Lists every predefined [Role][google.iam.admin.v1.Role] that IAM supports, or every custom role
1354 /// that is defined for an organization or project.
1355 ///
1356 /// @param request Unary RPCs, such as the one wrapped by this
1357 /// function, receive a single `request` proto message which includes all
1358 /// the inputs for the RPC. In this case, the proto message is a
1359 /// [google.iam.admin.v1.ListRolesRequest].
1360 /// Proto messages are converted to C++ classes by Protobuf, using the
1361 /// [Protobuf mapping rules].
1362 /// @param opts Optional. Override the class-level options, such as retry and
1363 /// backoff policies.
1364 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1365 /// to iterate of the results. See the documentation of this type for
1366 /// details. In brief, this class has `begin()` and `end()` member
1367 /// functions returning a iterator class meeting the
1368 /// [input iterator requirements]. The value type for this iterator is a
1369 /// [`StatusOr`] as the iteration may fail even after some values are
1370 /// retrieved successfully, for example, if there is a network disconnect.
1371 /// An empty set of results does not indicate an error, it indicates
1372 /// that there are no resources meeting the request criteria.
1373 /// On a successful iteration the `StatusOr<T>` contains elements of type
1374 /// [google.iam.admin.v1.Role], or rather,
1375 /// the C++ class generated by Protobuf from that type. Please consult the
1376 /// Protobuf documentation for details on the [Protobuf mapping rules].
1377 ///
1378 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1379 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1380 /// [Long Running Operation]: https://google.aip.dev/151
1381 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1382 /// [`future`]: @ref google::cloud::future
1383 /// [`StatusOr`]: @ref google::cloud::StatusOr
1384 /// [`Status`]: @ref google::cloud::Status
1385 /// [google.iam.admin.v1.ListRolesRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1169}
1386 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1387 ///
1388 // clang-format on
1389 StreamRange<google::iam::admin::v1::Role> ListRoles(
1390 google::iam::admin::v1::ListRolesRequest request, Options opts = {});
1391
1392 // clang-format off
1393 ///
1394 /// Gets the definition of a [Role][google.iam.admin.v1.Role].
1395 ///
1396 /// @param request Unary RPCs, such as the one wrapped by this
1397 /// function, receive a single `request` proto message which includes all
1398 /// the inputs for the RPC. In this case, the proto message is a
1399 /// [google.iam.admin.v1.GetRoleRequest].
1400 /// Proto messages are converted to C++ classes by Protobuf, using the
1401 /// [Protobuf mapping rules].
1402 /// @param opts Optional. Override the class-level options, such as retry and
1403 /// backoff policies.
1404 /// @return the result of the RPC. The response message type
1405 /// ([google.iam.admin.v1.Role])
1406 /// is mapped to a C++ class using the [Protobuf mapping rules].
1407 /// If the request fails, the [`StatusOr`] contains the error details.
1408 ///
1409 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1410 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1411 /// [Long Running Operation]: https://google.aip.dev/151
1412 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1413 /// [`future`]: @ref google::cloud::future
1414 /// [`StatusOr`]: @ref google::cloud::StatusOr
1415 /// [`Status`]: @ref google::cloud::Status
1416 /// [google.iam.admin.v1.GetRoleRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1233}
1417 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1418 ///
1419 // clang-format on
1420 StatusOr<google::iam::admin::v1::Role> GetRole(
1421 google::iam::admin::v1::GetRoleRequest const& request, Options opts = {});
1422
1423 // clang-format off
1424 ///
1425 /// Creates a new custom [Role][google.iam.admin.v1.Role].
1426 ///
1427 /// @param request Unary RPCs, such as the one wrapped by this
1428 /// function, receive a single `request` proto message which includes all
1429 /// the inputs for the RPC. In this case, the proto message is a
1430 /// [google.iam.admin.v1.CreateRoleRequest].
1431 /// Proto messages are converted to C++ classes by Protobuf, using the
1432 /// [Protobuf mapping rules].
1433 /// @param opts Optional. Override the class-level options, such as retry and
1434 /// backoff policies.
1435 /// @return the result of the RPC. The response message type
1436 /// ([google.iam.admin.v1.Role])
1437 /// is mapped to a C++ class using the [Protobuf mapping rules].
1438 /// If the request fails, the [`StatusOr`] contains the error details.
1439 ///
1440 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1441 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1442 /// [Long Running Operation]: https://google.aip.dev/151
1443 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1444 /// [`future`]: @ref google::cloud::future
1445 /// [`StatusOr`]: @ref google::cloud::StatusOr
1446 /// [`Status`]: @ref google::cloud::Status
1447 /// [google.iam.admin.v1.CreateRoleRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1271}
1448 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1449 ///
1450 // clang-format on
1451 StatusOr<google::iam::admin::v1::Role> CreateRole(
1452 google::iam::admin::v1::CreateRoleRequest const& request,
1453 Options opts = {});
1454
1455 // clang-format off
1456 ///
1457 /// Updates the definition of a custom [Role][google.iam.admin.v1.Role].
1458 ///
1459 /// @param request Unary RPCs, such as the one wrapped by this
1460 /// function, receive a single `request` proto message which includes all
1461 /// the inputs for the RPC. In this case, the proto message is a
1462 /// [google.iam.admin.v1.UpdateRoleRequest].
1463 /// Proto messages are converted to C++ classes by Protobuf, using the
1464 /// [Protobuf mapping rules].
1465 /// @param opts Optional. Override the class-level options, such as retry and
1466 /// backoff policies.
1467 /// @return the result of the RPC. The response message type
1468 /// ([google.iam.admin.v1.Role])
1469 /// is mapped to a C++ class using the [Protobuf mapping rules].
1470 /// If the request fails, the [`StatusOr`] contains the error details.
1471 ///
1472 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1473 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1474 /// [Long Running Operation]: https://google.aip.dev/151
1475 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1476 /// [`future`]: @ref google::cloud::future
1477 /// [`StatusOr`]: @ref google::cloud::StatusOr
1478 /// [`Status`]: @ref google::cloud::Status
1479 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1480 /// [google.iam.admin.v1.UpdateRoleRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1311}
1481 ///
1482 // clang-format on
1483 StatusOr<google::iam::admin::v1::Role> UpdateRole(
1484 google::iam::admin::v1::UpdateRoleRequest const& request,
1485 Options opts = {});
1486
1487 // clang-format off
1488 ///
1489 /// Deletes a custom [Role][google.iam.admin.v1.Role].
1490 ///
1491 /// When you delete a custom role, the following changes occur immediately:
1492 ///
1493 /// * You cannot bind a principal to the custom role in an IAM
1494 /// [Policy][google.iam.v1.Policy].
1495 /// * Existing bindings to the custom role are not changed, but they have no
1496 /// effect.
1497 /// * By default, the response from [ListRoles][google.iam.admin.v1.IAM.ListRoles] does not include the custom
1498 /// role.
1499 ///
1500 /// You have 7 days to undelete the custom role. After 7 days, the following
1501 /// changes occur:
1502 ///
1503 /// * The custom role is permanently deleted and cannot be recovered.
1504 /// * If an IAM policy contains a binding to the custom role, the binding is
1505 /// permanently removed.
1506 ///
1507 /// @param request Unary RPCs, such as the one wrapped by this
1508 /// function, receive a single `request` proto message which includes all
1509 /// the inputs for the RPC. In this case, the proto message is a
1510 /// [google.iam.admin.v1.DeleteRoleRequest].
1511 /// Proto messages are converted to C++ classes by Protobuf, using the
1512 /// [Protobuf mapping rules].
1513 /// @param opts Optional. Override the class-level options, such as retry and
1514 /// backoff policies.
1515 /// @return the result of the RPC. The response message type
1516 /// ([google.iam.admin.v1.Role])
1517 /// is mapped to a C++ class using the [Protobuf mapping rules].
1518 /// If the request fails, the [`StatusOr`] contains the error details.
1519 ///
1520 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1521 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1522 /// [Long Running Operation]: https://google.aip.dev/151
1523 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1524 /// [`future`]: @ref google::cloud::future
1525 /// [`StatusOr`]: @ref google::cloud::StatusOr
1526 /// [`Status`]: @ref google::cloud::Status
1527 /// [google.iam.admin.v1.DeleteRoleRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1347}
1528 /// [google.iam.admin.v1.IAM.ListRoles]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L359}
1529 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1530 /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L98}
1531 ///
1532 // clang-format on
1533 StatusOr<google::iam::admin::v1::Role> DeleteRole(
1534 google::iam::admin::v1::DeleteRoleRequest const& request,
1535 Options opts = {});
1536
1537 // clang-format off
1538 ///
1539 /// Undeletes a custom [Role][google.iam.admin.v1.Role].
1540 ///
1541 /// @param request Unary RPCs, such as the one wrapped by this
1542 /// function, receive a single `request` proto message which includes all
1543 /// the inputs for the RPC. In this case, the proto message is a
1544 /// [google.iam.admin.v1.UndeleteRoleRequest].
1545 /// Proto messages are converted to C++ classes by Protobuf, using the
1546 /// [Protobuf mapping rules].
1547 /// @param opts Optional. Override the class-level options, such as retry and
1548 /// backoff policies.
1549 /// @return the result of the RPC. The response message type
1550 /// ([google.iam.admin.v1.Role])
1551 /// is mapped to a C++ class using the [Protobuf mapping rules].
1552 /// If the request fails, the [`StatusOr`] contains the error details.
1553 ///
1554 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1555 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1556 /// [Long Running Operation]: https://google.aip.dev/151
1557 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1558 /// [`future`]: @ref google::cloud::future
1559 /// [`StatusOr`]: @ref google::cloud::StatusOr
1560 /// [`Status`]: @ref google::cloud::Status
1561 /// [google.iam.admin.v1.Role]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1070}
1562 /// [google.iam.admin.v1.UndeleteRoleRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1380}
1563 ///
1564 // clang-format on
1565 StatusOr<google::iam::admin::v1::Role> UndeleteRole(
1566 google::iam::admin::v1::UndeleteRoleRequest const& request,
1567 Options opts = {});
1568
1569 // clang-format off
1570 ///
1571 /// Lists every permission that you can test on a resource. A permission is
1572 /// testable if you can check whether a principal has that permission on the
1573 /// resource.
1574 ///
1575 /// @param request Unary RPCs, such as the one wrapped by this
1576 /// function, receive a single `request` proto message which includes all
1577 /// the inputs for the RPC. In this case, the proto message is a
1578 /// [google.iam.admin.v1.QueryTestablePermissionsRequest].
1579 /// Proto messages are converted to C++ classes by Protobuf, using the
1580 /// [Protobuf mapping rules].
1581 /// @param opts Optional. Override the class-level options, such as retry and
1582 /// backoff policies.
1583 /// @return a [StreamRange](@ref google::cloud::StreamRange)
1584 /// to iterate of the results. See the documentation of this type for
1585 /// details. In brief, this class has `begin()` and `end()` member
1586 /// functions returning a iterator class meeting the
1587 /// [input iterator requirements]. The value type for this iterator is a
1588 /// [`StatusOr`] as the iteration may fail even after some values are
1589 /// retrieved successfully, for example, if there is a network disconnect.
1590 /// An empty set of results does not indicate an error, it indicates
1591 /// that there are no resources meeting the request criteria.
1592 /// On a successful iteration the `StatusOr<T>` contains elements of type
1593 /// [google.iam.admin.v1.Permission], or rather,
1594 /// the C++ class generated by Protobuf from that type. Please consult the
1595 /// Protobuf documentation for details on the [Protobuf mapping rules].
1596 ///
1597 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1598 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1599 /// [Long Running Operation]: https://google.aip.dev/151
1600 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1601 /// [`future`]: @ref google::cloud::future
1602 /// [`StatusOr`]: @ref google::cloud::StatusOr
1603 /// [`Status`]: @ref google::cloud::Status
1604 /// [google.iam.admin.v1.Permission]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1413}
1605 /// [google.iam.admin.v1.QueryTestablePermissionsRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1468}
1606 ///
1607 // clang-format on
1608 StreamRange<google::iam::admin::v1::Permission> QueryTestablePermissions(
1609 google::iam::admin::v1::QueryTestablePermissionsRequest request,
1610 Options opts = {});
1611
1612 // clang-format off
1613 ///
1614 /// Returns a list of services that allow you to opt into audit logs that are
1615 /// not generated by default.
1616 ///
1617 /// To learn more about audit logs, see the [Logging
1618 /// documentation](https://cloud.google.com/logging/docs/audit).
1619 ///
1620 /// @param request Unary RPCs, such as the one wrapped by this
1621 /// function, receive a single `request` proto message which includes all
1622 /// the inputs for the RPC. In this case, the proto message is a
1623 /// [google.iam.admin.v1.QueryAuditableServicesRequest].
1624 /// Proto messages are converted to C++ classes by Protobuf, using the
1625 /// [Protobuf mapping rules].
1626 /// @param opts Optional. Override the class-level options, such as retry and
1627 /// backoff policies.
1628 /// @return the result of the RPC. The response message type
1629 /// ([google.iam.admin.v1.QueryAuditableServicesResponse])
1630 /// is mapped to a C++ class using the [Protobuf mapping rules].
1631 /// If the request fails, the [`StatusOr`] contains the error details.
1632 ///
1633 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1634 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1635 /// [Long Running Operation]: https://google.aip.dev/151
1636 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1637 /// [`future`]: @ref google::cloud::future
1638 /// [`StatusOr`]: @ref google::cloud::StatusOr
1639 /// [`Status`]: @ref google::cloud::Status
1640 /// [google.iam.admin.v1.QueryAuditableServicesRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1498}
1641 /// [google.iam.admin.v1.QueryAuditableServicesResponse]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1509}
1642 ///
1643 // clang-format on
1644 StatusOr<google::iam::admin::v1::QueryAuditableServicesResponse>
1646 google::iam::admin::v1::QueryAuditableServicesRequest const& request,
1647 Options opts = {});
1648
1649 // clang-format off
1650 ///
1651 /// Lints, or validates, an IAM policy. Currently checks the
1652 /// [google.iam.v1.Binding.condition][google.iam.v1.Binding.condition] field, which contains a condition
1653 /// expression for a role binding.
1654 ///
1655 /// Successful calls to this method always return an HTTP `200 OK` status code,
1656 /// even if the linter detects an issue in the IAM policy.
1657 ///
1658 /// @param request Unary RPCs, such as the one wrapped by this
1659 /// function, receive a single `request` proto message which includes all
1660 /// the inputs for the RPC. In this case, the proto message is a
1661 /// [google.iam.admin.v1.LintPolicyRequest].
1662 /// Proto messages are converted to C++ classes by Protobuf, using the
1663 /// [Protobuf mapping rules].
1664 /// @param opts Optional. Override the class-level options, such as retry and
1665 /// backoff policies.
1666 /// @return the result of the RPC. The response message type
1667 /// ([google.iam.admin.v1.LintPolicyResponse])
1668 /// is mapped to a C++ class using the [Protobuf mapping rules].
1669 /// If the request fails, the [`StatusOr`] contains the error details.
1670 ///
1671 /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/
1672 /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator
1673 /// [Long Running Operation]: https://google.aip.dev/151
1674 /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string
1675 /// [`future`]: @ref google::cloud::future
1676 /// [`StatusOr`]: @ref google::cloud::StatusOr
1677 /// [`Status`]: @ref google::cloud::Status
1678 /// [google.iam.admin.v1.LintPolicyRequest]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1522}
1679 /// [google.iam.admin.v1.LintPolicyResponse]: @googleapis_reference_link{google/iam/admin/v1/iam.proto#L1620}
1680 /// [google.iam.v1.Binding.condition]: @googleapis_reference_link{google/iam/v1/policy.proto#L220}
1681 ///
1682 // clang-format on
1683 StatusOr<google::iam::admin::v1::LintPolicyResponse> LintPolicy(
1684 google::iam::admin::v1::LintPolicyRequest const& request,
1685 Options opts = {});
1686
1687 private:
1688 std::shared_ptr<IAMConnection> connection_;
1689 Options options_;
1690};
1691
1692GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1693namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
1694} // namespace iam_admin_v1
1695} // namespace cloud
1696} // namespace google
1697
1698#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_IAM_CLIENT_H
Creates and manages Identity and Access Management (IAM) resources.
Definition: iam_client.h:90
StatusOr< google::iam::admin::v1::ServiceAccount > CreateServiceAccount(std::string const &name, std::string const &account_id, google::iam::admin::v1::ServiceAccount const &service_account, Options opts={})
Creates a ServiceAccount.
friend bool operator==(IAMClient const &a, IAMClient const &b)
Definition: iam_client.h:106
IAMClient & operator=(IAMClient const &)=default
StatusOr< google::iam::admin::v1::ServiceAccountKey > UploadServiceAccountKey(google::iam::admin::v1::UploadServiceAccountKeyRequest const &request, Options opts={})
Uploads the public key portion of a key pair that you manage, and associates the public key with a Se...
Status DisableServiceAccountKey(google::iam::admin::v1::DisableServiceAccountKeyRequest const &request, Options opts={})
Disable a ServiceAccountKey.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, IamUpdater const &updater, Options opts={})
Updates the IAM policy for resource using an optimistic concurrency control loop.
StreamRange< google::iam::admin::v1::Permission > QueryTestablePermissions(google::iam::admin::v1::QueryTestablePermissionsRequest request, Options opts={})
Lists every permission that you can test on a resource.
Status DeleteServiceAccount(std::string const &name, Options opts={})
Deletes a ServiceAccount.
StreamRange< google::iam::admin::v1::Role > QueryGrantableRoles(std::string const &full_resource_name, Options opts={})
Lists roles that can be granted on a Google Cloud resource.
StatusOr< google::iam::admin::v1::ListServiceAccountKeysResponse > ListServiceAccountKeys(std::string const &name, std::vector< google::iam::admin::v1::ListServiceAccountKeysRequest::KeyType > const &key_types, Options opts={})
Lists every ServiceAccountKey for a service account.
IAMClient(std::shared_ptr< IAMConnection > connection, Options opts={})
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
Sets the IAM policy that is attached to a ServiceAccount.
StatusOr< google::iam::admin::v1::Role > CreateRole(google::iam::admin::v1::CreateRoleRequest const &request, Options opts={})
Creates a new custom Role.
StatusOr< google::iam::admin::v1::ListServiceAccountKeysResponse > ListServiceAccountKeys(google::iam::admin::v1::ListServiceAccountKeysRequest const &request, Options opts={})
Lists every ServiceAccountKey for a service account.
friend bool operator!=(IAMClient const &a, IAMClient const &b)
Definition: iam_client.h:109
StatusOr< google::iam::admin::v1::ServiceAccountKey > GetServiceAccountKey(std::string const &name, google::iam::admin::v1::ServiceAccountPublicKeyType public_key_type, Options opts={})
Gets a ServiceAccountKey.
Status EnableServiceAccountKey(google::iam::admin::v1::EnableServiceAccountKeyRequest const &request, Options opts={})
Enable a ServiceAccountKey.
StatusOr< google::iam::admin::v1::QueryAuditableServicesResponse > QueryAuditableServices(google::iam::admin::v1::QueryAuditableServicesRequest const &request, Options opts={})
Returns a list of services that allow you to opt into audit logs that are not generated by default.
StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
Sets the IAM policy that is attached to a ServiceAccount.
Status DisableServiceAccountKey(std::string const &name, Options opts={})
Disable a ServiceAccountKey.
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
Tests whether the caller has the specified permissions on a ServiceAccount.
Status DeleteServiceAccountKey(std::string const &name, Options opts={})
Deletes a ServiceAccountKey.
StatusOr< google::iam::admin::v1::ServiceAccountKey > CreateServiceAccountKey(google::iam::admin::v1::CreateServiceAccountKeyRequest const &request, Options opts={})
Creates a ServiceAccountKey.
StreamRange< google::iam::admin::v1::ServiceAccount > ListServiceAccounts(google::iam::admin::v1::ListServiceAccountsRequest request, Options opts={})
Lists every ServiceAccount that belongs to a specific project.
StatusOr< google::iam::admin::v1::Role > GetRole(google::iam::admin::v1::GetRoleRequest const &request, Options opts={})
Gets the definition of a Role.
StatusOr< google::iam::admin::v1::ServiceAccountKey > CreateServiceAccountKey(std::string const &name, google::iam::admin::v1::ServiceAccountPrivateKeyType private_key_type, google::iam::admin::v1::ServiceAccountKeyAlgorithm key_algorithm, Options opts={})
Creates a ServiceAccountKey.
StatusOr< google::iam::admin::v1::Role > DeleteRole(google::iam::admin::v1::DeleteRoleRequest const &request, Options opts={})
Deletes a custom Role.
StreamRange< google::iam::admin::v1::Role > QueryGrantableRoles(google::iam::admin::v1::QueryGrantableRolesRequest request, Options opts={})
Lists roles that can be granted on a Google Cloud resource.
StatusOr< google::iam::admin::v1::ServiceAccount > GetServiceAccount(std::string const &name, Options opts={})
Gets a ServiceAccount.
StatusOr< google::iam::admin::v1::Role > UpdateRole(google::iam::admin::v1::UpdateRoleRequest const &request, Options opts={})
Updates the definition of a custom Role.
StatusOr< google::iam::admin::v1::LintPolicyResponse > LintPolicy(google::iam::admin::v1::LintPolicyRequest const &request, Options opts={})
Lints, or validates, an IAM policy.
StatusOr< google::iam::admin::v1::ServiceAccount > GetServiceAccount(google::iam::admin::v1::GetServiceAccountRequest const &request, Options opts={})
Gets a ServiceAccount.
StatusOr< google::iam::admin::v1::ServiceAccount > CreateServiceAccount(google::iam::admin::v1::CreateServiceAccountRequest const &request, Options opts={})
Creates a ServiceAccount.
StatusOr< google::iam::v1::Policy > GetIamPolicy(std::string const &resource, Options opts={})
Gets the IAM policy that is attached to a ServiceAccount.
Status EnableServiceAccount(google::iam::admin::v1::EnableServiceAccountRequest const &request, Options opts={})
Enables a ServiceAccount that was disabled by DisableServiceAccount.
IAMClient(IAMClient const &)=default
StatusOr< google::iam::admin::v1::UndeleteServiceAccountResponse > UndeleteServiceAccount(google::iam::admin::v1::UndeleteServiceAccountRequest const &request, Options opts={})
Restores a deleted ServiceAccount.
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
Tests whether the caller has the specified permissions on a ServiceAccount.
Status EnableServiceAccountKey(std::string const &name, Options opts={})
Enable a ServiceAccountKey.
StreamRange< google::iam::admin::v1::Role > ListRoles(google::iam::admin::v1::ListRolesRequest request, Options opts={})
Lists every predefined Role that IAM supports, or every custom role that is defined for an organizati...
StatusOr< google::iam::admin::v1::ServiceAccountKey > GetServiceAccountKey(google::iam::admin::v1::GetServiceAccountKeyRequest const &request, Options opts={})
Gets a ServiceAccountKey.
StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
Gets the IAM policy that is attached to a ServiceAccount.
Status DisableServiceAccount(google::iam::admin::v1::DisableServiceAccountRequest const &request, Options opts={})
Disables a ServiceAccount immediately.
StreamRange< google::iam::admin::v1::ServiceAccount > ListServiceAccounts(std::string const &name, Options opts={})
Lists every ServiceAccount that belongs to a specific project.
IAMClient & operator=(IAMClient &&)=default
StatusOr< google::iam::admin::v1::Role > UndeleteRole(google::iam::admin::v1::UndeleteRoleRequest const &request, Options opts={})
Undeletes a custom Role.
StatusOr< google::iam::admin::v1::ServiceAccount > PatchServiceAccount(google::iam::admin::v1::PatchServiceAccountRequest const &request, Options opts={})
Patches a ServiceAccount.
Status DeleteServiceAccountKey(google::iam::admin::v1::DeleteServiceAccountKeyRequest const &request, Options opts={})
Deletes a ServiceAccountKey.
Status DeleteServiceAccount(google::iam::admin::v1::DeleteServiceAccountRequest const &request, Options opts={})
Deletes a ServiceAccount.
The IAMConnection object for IAMClient.
Definition: iam_connection.h:60
Definition: iam_client.h:33