Class MockIAMConnection (2.18.0-rc)

A class to mock IAMConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type IAMClient. To do so, construct an object of type IAMClient with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

See Also

This example for how to test your application with GoogleTest. While the example showcases types from the BigQuery library, the underlying principles apply for any pair of *Client and *Connection.

Functions

virtual options()

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Returns
TypeDescription
Options

virtual ListServiceAccounts(google::iam::admin::v1::ListServiceAccountsRequest)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::ListServiceAccountsRequest
Returns
TypeDescription
StreamRange< google::iam::admin::v1::ServiceAccount >

virtual GetServiceAccount(google::iam::admin::v1::GetServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::GetServiceAccountRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ServiceAccount >

virtual CreateServiceAccount(google::iam::admin::v1::CreateServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::CreateServiceAccountRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ServiceAccount >

virtual PatchServiceAccount(google::iam::admin::v1::PatchServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::PatchServiceAccountRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ServiceAccount >

virtual DeleteServiceAccount(google::iam::admin::v1::DeleteServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::DeleteServiceAccountRequest const &
Returns
TypeDescription
Status

virtual UndeleteServiceAccount(google::iam::admin::v1::UndeleteServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::UndeleteServiceAccountRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::UndeleteServiceAccountResponse >

virtual EnableServiceAccount(google::iam::admin::v1::EnableServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::EnableServiceAccountRequest const &
Returns
TypeDescription
Status

virtual DisableServiceAccount(google::iam::admin::v1::DisableServiceAccountRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::DisableServiceAccountRequest const &
Returns
TypeDescription
Status

virtual ListServiceAccountKeys(google::iam::admin::v1::ListServiceAccountKeysRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::ListServiceAccountKeysRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ListServiceAccountKeysResponse >

virtual GetServiceAccountKey(google::iam::admin::v1::GetServiceAccountKeyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::GetServiceAccountKeyRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ServiceAccountKey >

virtual CreateServiceAccountKey(google::iam::admin::v1::CreateServiceAccountKeyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::CreateServiceAccountKeyRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ServiceAccountKey >

virtual UploadServiceAccountKey(google::iam::admin::v1::UploadServiceAccountKeyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::UploadServiceAccountKeyRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::ServiceAccountKey >

virtual DeleteServiceAccountKey(google::iam::admin::v1::DeleteServiceAccountKeyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::DeleteServiceAccountKeyRequest const &
Returns
TypeDescription
Status

virtual DisableServiceAccountKey(google::iam::admin::v1::DisableServiceAccountKeyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::DisableServiceAccountKeyRequest const &
Returns
TypeDescription
Status

virtual EnableServiceAccountKey(google::iam::admin::v1::EnableServiceAccountKeyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::EnableServiceAccountKeyRequest const &
Returns
TypeDescription
Status

virtual GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::v1::GetIamPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

virtual SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::v1::SetIamPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

virtual TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::v1::TestIamPermissionsRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

virtual QueryGrantableRoles(google::iam::admin::v1::QueryGrantableRolesRequest)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::QueryGrantableRolesRequest
Returns
TypeDescription
StreamRange< google::iam::admin::v1::Role >

virtual ListRoles(google::iam::admin::v1::ListRolesRequest)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::ListRolesRequest
Returns
TypeDescription
StreamRange< google::iam::admin::v1::Role >

virtual GetRole(google::iam::admin::v1::GetRoleRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::GetRoleRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::Role >

virtual CreateRole(google::iam::admin::v1::CreateRoleRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::CreateRoleRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::Role >

virtual UpdateRole(google::iam::admin::v1::UpdateRoleRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::UpdateRoleRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::Role >

virtual DeleteRole(google::iam::admin::v1::DeleteRoleRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::DeleteRoleRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::Role >

virtual UndeleteRole(google::iam::admin::v1::UndeleteRoleRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::UndeleteRoleRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::Role >

virtual QueryTestablePermissions(google::iam::admin::v1::QueryTestablePermissionsRequest)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::QueryTestablePermissionsRequest
Returns
TypeDescription
StreamRange< google::iam::admin::v1::Permission >

virtual QueryAuditableServices(google::iam::admin::v1::QueryAuditableServicesRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::QueryAuditableServicesRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::QueryAuditableServicesResponse >

virtual LintPolicy(google::iam::admin::v1::LintPolicyRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::iam::admin::v1::LintPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::admin::v1::LintPolicyResponse >