Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
iam_connection.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_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_IAM_CONNECTION_H
21
22#include "google/cloud/iam/admin/v1/iam_connection_idempotency_policy.h"
23#include "google/cloud/iam/admin/v1/internal/iam_retry_traits.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/options.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/stream_range.h"
28#include "google/cloud/version.h"
29#include <google/iam/admin/v1/iam.pb.h>
30#include <memory>
31
32namespace google {
33namespace cloud {
34namespace iam_admin_v1 {
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
36
37using IAMRetryPolicy = ::google::cloud::internal::TraitBasedRetryPolicy<
38 iam_admin_v1_internal::IAMRetryTraits>;
39
40using IAMLimitedTimeRetryPolicy =
41 ::google::cloud::internal::LimitedTimeRetryPolicy<
42 iam_admin_v1_internal::IAMRetryTraits>;
43
44using IAMLimitedErrorCountRetryPolicy =
45 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
46 iam_admin_v1_internal::IAMRetryTraits>;
47
48/**
49 * The `IAMConnection` object for `IAMClient`.
50 *
51 * This interface defines virtual methods for each of the user-facing overload
52 * sets in `IAMClient`. This allows users to inject custom behavior
53 * (e.g., with a Google Mock object) when writing tests that use objects of type
54 * `IAMClient`.
55 *
56 * To create a concrete instance, see `MakeIAMConnection()`.
57 *
58 * For mocking, see `iam_admin_v1_mocks::MockIAMConnection`.
59 */
60class IAMConnection {
61 public:
62 virtual ~IAMConnection() = 0;
63
64 virtual Options options() { return Options{}; }
65
66 virtual StreamRange<google::iam::admin::v1::ServiceAccount>
68 google::iam::admin::v1::ListServiceAccountsRequest request);
69
70 virtual StatusOr<google::iam::admin::v1::ServiceAccount> GetServiceAccount(
71 google::iam::admin::v1::GetServiceAccountRequest const& request);
72
73 virtual StatusOr<google::iam::admin::v1::ServiceAccount> CreateServiceAccount(
74 google::iam::admin::v1::CreateServiceAccountRequest const& request);
75
76 virtual StatusOr<google::iam::admin::v1::ServiceAccount> PatchServiceAccount(
77 google::iam::admin::v1::PatchServiceAccountRequest const& request);
78
80 google::iam::admin::v1::DeleteServiceAccountRequest const& request);
81
82 virtual StatusOr<google::iam::admin::v1::UndeleteServiceAccountResponse>
84 google::iam::admin::v1::UndeleteServiceAccountRequest const& request);
85
87 google::iam::admin::v1::EnableServiceAccountRequest const& request);
88
90 google::iam::admin::v1::DisableServiceAccountRequest const& request);
91
92 virtual StatusOr<google::iam::admin::v1::ListServiceAccountKeysResponse>
94 google::iam::admin::v1::ListServiceAccountKeysRequest const& request);
95
96 virtual StatusOr<google::iam::admin::v1::ServiceAccountKey>
98 google::iam::admin::v1::GetServiceAccountKeyRequest const& request);
99
100 virtual StatusOr<google::iam::admin::v1::ServiceAccountKey>
102 google::iam::admin::v1::CreateServiceAccountKeyRequest const& request);
103
104 virtual StatusOr<google::iam::admin::v1::ServiceAccountKey>
106 google::iam::admin::v1::UploadServiceAccountKeyRequest const& request);
107
109 google::iam::admin::v1::DeleteServiceAccountKeyRequest const& request);
110
112 google::iam::admin::v1::DisableServiceAccountKeyRequest const& request);
113
115 google::iam::admin::v1::EnableServiceAccountKeyRequest const& request);
116
117 virtual StatusOr<google::iam::v1::Policy> GetIamPolicy(
118 google::iam::v1::GetIamPolicyRequest const& request);
119
120 virtual StatusOr<google::iam::v1::Policy> SetIamPolicy(
121 google::iam::v1::SetIamPolicyRequest const& request);
122
123 virtual StatusOr<google::iam::v1::TestIamPermissionsResponse>
124 TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request);
125
126 virtual StreamRange<google::iam::admin::v1::Role> QueryGrantableRoles(
127 google::iam::admin::v1::QueryGrantableRolesRequest request);
128
129 virtual StreamRange<google::iam::admin::v1::Role> ListRoles(
130 google::iam::admin::v1::ListRolesRequest request);
131
132 virtual StatusOr<google::iam::admin::v1::Role> GetRole(
133 google::iam::admin::v1::GetRoleRequest const& request);
134
135 virtual StatusOr<google::iam::admin::v1::Role> CreateRole(
136 google::iam::admin::v1::CreateRoleRequest const& request);
137
138 virtual StatusOr<google::iam::admin::v1::Role> UpdateRole(
139 google::iam::admin::v1::UpdateRoleRequest const& request);
140
141 virtual StatusOr<google::iam::admin::v1::Role> DeleteRole(
142 google::iam::admin::v1::DeleteRoleRequest const& request);
143
144 virtual StatusOr<google::iam::admin::v1::Role> UndeleteRole(
145 google::iam::admin::v1::UndeleteRoleRequest const& request);
146
147 virtual StreamRange<google::iam::admin::v1::Permission>
149 google::iam::admin::v1::QueryTestablePermissionsRequest request);
150
151 virtual StatusOr<google::iam::admin::v1::QueryAuditableServicesResponse>
153 google::iam::admin::v1::QueryAuditableServicesRequest const& request);
154
155 virtual StatusOr<google::iam::admin::v1::LintPolicyResponse> LintPolicy(
156 google::iam::admin::v1::LintPolicyRequest const& request);
157};
158
159/**
160 * A factory function to construct an object of type `IAMConnection`.
161 *
162 * The returned connection object should not be used directly; instead it
163 * should be passed as an argument to the constructor of IAMClient.
164 *
165 * The optional @p options argument may be used to configure aspects of the
166 * returned `IAMConnection`. Expected options are any of the types in
167 * the following option lists:
168 *
169 * - `google::cloud::CommonOptionList`
170 * - `google::cloud::GrpcOptionList`
171 * - `google::cloud::UnifiedCredentialsOptionList`
172 * - `google::cloud::iam_admin_v1::IAMPolicyOptionList`
173 *
174 * @note Unexpected options will be ignored. To log unexpected options instead,
175 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
176 *
177 * @param options (optional) Configure the `IAMConnection` created by
178 * this function.
179 */
180std::shared_ptr<IAMConnection> MakeIAMConnection(Options options = {});
181
182GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
183namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS; // NOLINT(misc-unused-alias-decls)
184} // namespace iam_admin_v1
185} // namespace cloud
186} // namespace google
187
188#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_ADMIN_V1_IAM_CONNECTION_H
The IAMConnection object for IAMClient.
Definition: iam_connection.h:60
virtual StatusOr< google::iam::admin::v1::ServiceAccount > PatchServiceAccount(google::iam::admin::v1::PatchServiceAccountRequest const &request)
virtual StreamRange< google::iam::admin::v1::ServiceAccount > ListServiceAccounts(google::iam::admin::v1::ListServiceAccountsRequest request)
virtual StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request)
virtual Status DisableServiceAccountKey(google::iam::admin::v1::DisableServiceAccountKeyRequest const &request)
virtual StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request)
virtual StatusOr< google::iam::admin::v1::ServiceAccount > GetServiceAccount(google::iam::admin::v1::GetServiceAccountRequest const &request)
virtual StreamRange< google::iam::admin::v1::Permission > QueryTestablePermissions(google::iam::admin::v1::QueryTestablePermissionsRequest request)
virtual StatusOr< google::iam::admin::v1::ListServiceAccountKeysResponse > ListServiceAccountKeys(google::iam::admin::v1::ListServiceAccountKeysRequest const &request)
virtual StatusOr< google::iam::admin::v1::LintPolicyResponse > LintPolicy(google::iam::admin::v1::LintPolicyRequest const &request)
virtual StreamRange< google::iam::admin::v1::Role > QueryGrantableRoles(google::iam::admin::v1::QueryGrantableRolesRequest request)
virtual StatusOr< google::iam::admin::v1::Role > UndeleteRole(google::iam::admin::v1::UndeleteRoleRequest const &request)
virtual StatusOr< google::iam::admin::v1::Role > GetRole(google::iam::admin::v1::GetRoleRequest const &request)
virtual StatusOr< google::iam::admin::v1::ServiceAccountKey > GetServiceAccountKey(google::iam::admin::v1::GetServiceAccountKeyRequest const &request)
virtual Status DisableServiceAccount(google::iam::admin::v1::DisableServiceAccountRequest const &request)
virtual StatusOr< google::iam::admin::v1::Role > UpdateRole(google::iam::admin::v1::UpdateRoleRequest const &request)
virtual Status DeleteServiceAccount(google::iam::admin::v1::DeleteServiceAccountRequest const &request)
virtual Status EnableServiceAccountKey(google::iam::admin::v1::EnableServiceAccountKeyRequest const &request)
virtual StatusOr< google::iam::admin::v1::ServiceAccountKey > CreateServiceAccountKey(google::iam::admin::v1::CreateServiceAccountKeyRequest const &request)
virtual StatusOr< google::iam::admin::v1::ServiceAccount > CreateServiceAccount(google::iam::admin::v1::CreateServiceAccountRequest const &request)
virtual StatusOr< google::iam::admin::v1::ServiceAccountKey > UploadServiceAccountKey(google::iam::admin::v1::UploadServiceAccountKeyRequest const &request)
virtual StatusOr< google::iam::admin::v1::Role > CreateRole(google::iam::admin::v1::CreateRoleRequest const &request)
virtual StatusOr< google::iam::admin::v1::UndeleteServiceAccountResponse > UndeleteServiceAccount(google::iam::admin::v1::UndeleteServiceAccountRequest const &request)
virtual Status EnableServiceAccount(google::iam::admin::v1::EnableServiceAccountRequest const &request)
virtual StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request)
virtual StatusOr< google::iam::admin::v1::Role > DeleteRole(google::iam::admin::v1::DeleteRoleRequest const &request)
virtual Status DeleteServiceAccountKey(google::iam::admin::v1::DeleteServiceAccountKeyRequest const &request)
virtual StatusOr< google::iam::admin::v1::QueryAuditableServicesResponse > QueryAuditableServices(google::iam::admin::v1::QueryAuditableServicesRequest const &request)
virtual Options options()
Definition: iam_connection.h:64
virtual StreamRange< google::iam::admin::v1::Role > ListRoles(google::iam::admin::v1::ListRolesRequest request)
Definition: iam_client.h:33
std::shared_ptr< IAMConnection > MakeIAMConnection(Options options={})
A factory function to construct an object of type IAMConnection.