Google Cloud IAM C++ Client  2.1.0
A C++ Client Library for Google Cloud IAM
mock_iam_connection.h
Go to the documentation of this file.
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_MOCKS_MOCK_IAM_CONNECTION_H
20 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CONNECTION_H
21 
22 #include "google/cloud/iam/iam_connection.h"
23 #include <gmock/gmock.h>
24 
25 namespace google {
26 namespace cloud {
27 namespace iam_mocks {
29 
30 /**
31  * A class to mock `IAMConnection`.
32  *
33  * Application developers may want to test their code with simulated responses,
34  * including errors, from an object of type `IAMClient`. To do so,
35  * construct an object of type `IAMClient` with an instance of this
36  * class. Then use the Google Test framework functions to program the behavior
37  * of this mock.
38  *
39  * @see [This example][bq-mock] for how to test your application with
40  * GoogleTest. While the example showcases types from the BigQuery library, the
41  * underlying principles apply for any pair of `*Client` and `*Connection`.
42  *
43  * [bq-mock]: @googleapis_dev_link{bigquery,bigquery-read-mock.html}
44  */
46  public:
47  MOCK_METHOD(Options, options, (), (override));
48 
49  MOCK_METHOD(StreamRange<google::iam::admin::v1::ServiceAccount>,
50  ListServiceAccounts,
51  (google::iam::admin::v1::ListServiceAccountsRequest request),
52  (override));
53 
54  MOCK_METHOD(StatusOr<google::iam::admin::v1::ServiceAccount>,
55  GetServiceAccount,
56  (google::iam::admin::v1::GetServiceAccountRequest const& request),
57  (override));
58 
59  MOCK_METHOD(
60  StatusOr<google::iam::admin::v1::ServiceAccount>, CreateServiceAccount,
61  (google::iam::admin::v1::CreateServiceAccountRequest const& request),
62  (override));
63 
64  MOCK_METHOD(
65  StatusOr<google::iam::admin::v1::ServiceAccount>, PatchServiceAccount,
66  (google::iam::admin::v1::PatchServiceAccountRequest const& request),
67  (override));
68 
69  MOCK_METHOD(
70  Status, DeleteServiceAccount,
71  (google::iam::admin::v1::DeleteServiceAccountRequest const& request),
72  (override));
73 
74  MOCK_METHOD(
75  StatusOr<google::iam::admin::v1::UndeleteServiceAccountResponse>,
76  UndeleteServiceAccount,
77  (google::iam::admin::v1::UndeleteServiceAccountRequest const& request),
78  (override));
79 
80  MOCK_METHOD(
81  Status, EnableServiceAccount,
82  (google::iam::admin::v1::EnableServiceAccountRequest const& request),
83  (override));
84 
85  MOCK_METHOD(
86  Status, DisableServiceAccount,
87  (google::iam::admin::v1::DisableServiceAccountRequest const& request),
88  (override));
89 
90  MOCK_METHOD(
91  StatusOr<google::iam::admin::v1::ListServiceAccountKeysResponse>,
92  ListServiceAccountKeys,
93  (google::iam::admin::v1::ListServiceAccountKeysRequest const& request),
94  (override));
95 
96  MOCK_METHOD(
97  StatusOr<google::iam::admin::v1::ServiceAccountKey>, GetServiceAccountKey,
98  (google::iam::admin::v1::GetServiceAccountKeyRequest const& request),
99  (override));
100 
101  MOCK_METHOD(
102  StatusOr<google::iam::admin::v1::ServiceAccountKey>,
103  CreateServiceAccountKey,
104  (google::iam::admin::v1::CreateServiceAccountKeyRequest const& request),
105  (override));
106 
107  MOCK_METHOD(
108  StatusOr<google::iam::admin::v1::ServiceAccountKey>,
109  UploadServiceAccountKey,
110  (google::iam::admin::v1::UploadServiceAccountKeyRequest const& request),
111  (override));
112 
113  MOCK_METHOD(
114  Status, DeleteServiceAccountKey,
115  (google::iam::admin::v1::DeleteServiceAccountKeyRequest const& request),
116  (override));
117 
118  MOCK_METHOD(StatusOr<google::iam::v1::Policy>, GetIamPolicy,
119  (google::iam::v1::GetIamPolicyRequest const& request),
120  (override));
121 
122  MOCK_METHOD(StatusOr<google::iam::v1::Policy>, SetIamPolicy,
123  (google::iam::v1::SetIamPolicyRequest const& request),
124  (override));
125 
126  MOCK_METHOD(StatusOr<google::iam::v1::TestIamPermissionsResponse>,
127  TestIamPermissions,
128  (google::iam::v1::TestIamPermissionsRequest const& request),
129  (override));
130 
131  MOCK_METHOD(StreamRange<google::iam::admin::v1::Role>, QueryGrantableRoles,
132  (google::iam::admin::v1::QueryGrantableRolesRequest request),
133  (override));
134 
135  MOCK_METHOD(StreamRange<google::iam::admin::v1::Role>, ListRoles,
136  (google::iam::admin::v1::ListRolesRequest request), (override));
137 
138  MOCK_METHOD(StatusOr<google::iam::admin::v1::Role>, GetRole,
139  (google::iam::admin::v1::GetRoleRequest const& request),
140  (override));
141 
142  MOCK_METHOD(StatusOr<google::iam::admin::v1::Role>, CreateRole,
143  (google::iam::admin::v1::CreateRoleRequest const& request),
144  (override));
145 
146  MOCK_METHOD(StatusOr<google::iam::admin::v1::Role>, UpdateRole,
147  (google::iam::admin::v1::UpdateRoleRequest const& request),
148  (override));
149 
150  MOCK_METHOD(StatusOr<google::iam::admin::v1::Role>, DeleteRole,
151  (google::iam::admin::v1::DeleteRoleRequest const& request),
152  (override));
153 
154  MOCK_METHOD(StatusOr<google::iam::admin::v1::Role>, UndeleteRole,
155  (google::iam::admin::v1::UndeleteRoleRequest const& request),
156  (override));
157 
158  MOCK_METHOD(StreamRange<google::iam::admin::v1::Permission>,
159  QueryTestablePermissions,
160  (google::iam::admin::v1::QueryTestablePermissionsRequest request),
161  (override));
162 
163  MOCK_METHOD(
164  StatusOr<google::iam::admin::v1::QueryAuditableServicesResponse>,
165  QueryAuditableServices,
166  (google::iam::admin::v1::QueryAuditableServicesRequest const& request),
167  (override));
168 
169  MOCK_METHOD(StatusOr<google::iam::admin::v1::LintPolicyResponse>, LintPolicy,
170  (google::iam::admin::v1::LintPolicyRequest const& request),
171  (override));
172 };
173 
175 } // namespace iam_mocks
176 } // namespace cloud
177 } // namespace google
178 
179 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_MOCKS_MOCK_IAM_CONNECTION_H