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

*******************************
test_availability_configuration
*******************************



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

  

  Performs a test on an availability provider to ensure that access is allowed. For EWS, it verifies the provided credentials can be used to successfully log in. For Lambda, it verifies that the Lambda function can be invoked and that the resource access policy was configured to deny anonymous access. An anonymous invocation is one done without providing either a ``SourceArn`` or ``SourceAccount`` header.

   

  .. note::

    

    The request must contain either one provider definition ( ``EwsProvider`` or ``LambdaProvider``) or the ``DomainName`` parameter. If the ``DomainName`` parameter is provided, the configuration stored under the ``DomainName`` will be tested.

    

  

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


  **Request Syntax**
  ::

    response = client.test_availability_configuration(
        OrganizationId='string',
        DomainName='string',
        EwsProvider={
            'EwsEndpoint': 'string',
            'EwsUsername': 'string',
            'EwsPassword': 'string'
        },
        LambdaProvider={
            'LambdaArn': 'string'
        }
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The WorkMail organization where the availability provider will be tested.

    

  
  :type DomainName: string
  :param DomainName: 

    The domain to which the provider applies. If this field is provided, a stored availability provider associated to this domain name will be tested.

    

  
  :type EwsProvider: dict
  :param EwsProvider: 

    Describes an EWS based availability provider. This is only used as input to the service.

    

  
    - **EwsEndpoint** *(string) --* **[REQUIRED]** 

      The endpoint of the remote EWS server.

      

    
    - **EwsUsername** *(string) --* **[REQUIRED]** 

      The username used to authenticate the remote EWS server.

      

    
    - **EwsPassword** *(string) --* **[REQUIRED]** 

      The password used to authenticate the remote EWS server.

      

    
  
  :type LambdaProvider: dict
  :param LambdaProvider: 

    Describes a Lambda based availability provider.

    

  
    - **LambdaArn** *(string) --* **[REQUIRED]** 

      The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.

      

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

    
    ::

      {
          'TestPassed': True|False,
          'FailureReason': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TestPassed** *(boolean) --* 

        Boolean indicating whether the test passed or failed.

        
      

      - **FailureReason** *(string) --* 

        String containing the reason for a failed test if ``TestPassed`` is false.

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

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

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

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

  