:doc:`WorkMail <../../workmail>` / Client / assume_impersonation_role

*************************
assume_impersonation_role
*************************



.. py:method:: WorkMail.Client.assume_impersonation_role(**kwargs)

  

  Assumes an impersonation role for the given WorkMail organization. This method returns an authentication token you can use to make impersonated calls.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/AssumeImpersonationRole>`_  


  **Request Syntax**
  ::

    response = client.assume_impersonation_role(
        OrganizationId='string',
        ImpersonationRoleId='string'
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The WorkMail organization under which the impersonation role will be assumed.

    

  
  :type ImpersonationRoleId: string
  :param ImpersonationRoleId: **[REQUIRED]** 

    The impersonation role ID to assume.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Token': 'string',
          'ExpiresIn': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Token** *(string) --* 

        The authentication token for the impersonation role.

        
      

      - **ExpiresIn** *(integer) --* 

        The authentication token's validity, in seconds.

        
  
  **Exceptions**
  
  *   :py:class:`WorkMail.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationStateException`

  
  *   :py:class:`WorkMail.Client.exceptions.ResourceNotFoundException`

  