getImpersonationRoleEffect method

Future<GetImpersonationRoleEffectResponse> getImpersonationRoleEffect({
  1. required String impersonationRoleId,
  2. required String organizationId,
  3. required String targetUser,
})

Tests whether the given impersonation role can impersonate a target user.

May throw EntityNotFoundException. May throw EntityStateException. May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException. May throw ResourceNotFoundException.

Parameter impersonationRoleId : The impersonation role ID to test.

Parameter organizationId : The WorkMail organization where the impersonation role is defined.

Parameter targetUser : The WorkMail organization user chosen to test the impersonation role. The following identity formats are available:

  • User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
  • Email address: user@domain.tld
  • User name: user

Implementation

Future<GetImpersonationRoleEffectResponse> getImpersonationRoleEffect({
  required String impersonationRoleId,
  required String organizationId,
  required String targetUser,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.GetImpersonationRoleEffect'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ImpersonationRoleId': impersonationRoleId,
      'OrganizationId': organizationId,
      'TargetUser': targetUser,
    },
  );

  return GetImpersonationRoleEffectResponse.fromJson(jsonResponse.body);
}