Skip to content

test_availability_configuration async

test_availability_configuration(
    organization_id: OrganizationId,
    *,
    config_overrides: Optional[AsyncWorkMailClientConfig] = None,
    domain_name: Optional[DomainName] = None,
    ews_provider: Optional[EwsAvailabilityProvider] = None,
    lambda_provider: Optional[LambdaAvailabilityProvider] = None,
) -> TestAvailabilityConfigurationResponse

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.

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.

Parameters:

  • organization_id (OrganizationId) –

    The WorkMail organization where the availability provider will be tested.

  • domain_name (Optional[DomainName], default: None ) –

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

Raises:

Source code in docs_src/capo_workmail/_services/async_work_mail.py
async def test_availability_configuration(
    self,
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    *,
    config_overrides: Optional[AsyncWorkMailClientConfig] = None,
    domain_name: Optional["capo_workmail.types.domain_name.DomainName"] = None,
    ews_provider: Optional[
        "capo_workmail.types.ews_availability_provider.EwsAvailabilityProvider"
    ] = None,
    lambda_provider: Optional[
        "capo_workmail.types.lambda_availability_provider.LambdaAvailabilityProvider"
    ] = None,
) -> "capo_workmail.types.test_availability_configuration_response.TestAvailabilityConfigurationResponse":
    """<p>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 <code>SourceArn</code> or <code>SourceAccount</code> header.</p> <note> <p>The request must contain either one provider definition (<code>EwsProvider</code> or <code>LambdaProvider</code>) or the <code>DomainName</code> parameter. If the <code>DomainName</code> parameter is provided, the configuration stored under the <code>DomainName</code> will be tested.</p> </note>

    Args:
        organization_id: <p>The WorkMail organization where the availability provider will be tested.</p>
        domain_name: <p>The domain to which the provider applies. If this field is provided, a stored availability provider associated to this domain name will be tested.</p>

    Raises:
        capo_workmail.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the input parameters don't match the service's restrictions.</p>
        capo_workmail.errors.organization_not_found_exception.OrganizationNotFoundException: <p>An operation received a valid organization identifier that either doesn't belong or exist in the system.</p>
        capo_workmail.errors.organization_state_exception.OrganizationStateException: <p>The organization must have a valid state to perform certain operations on the organization or its members.</p>
        capo_workmail.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource cannot be found.</p>
        capo_workmail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workmail.types.test_availability_configuration_request.TestAvailabilityConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_workmail.types.test_availability_configuration_response.TestAvailabilityConfigurationResponse"
    ]:
        import capo_workmail._operations.work_mail_service.test_availability_configuration

        (
            output,
            http_response,
        ) = await capo_workmail._operations.work_mail_service.test_availability_configuration.async_test_availability_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workmail.types.test_availability_configuration_request.TestAvailabilityConfigurationRequest",
    ) -> dict[str, Any]:
        import capo_workmail.types.test_availability_configuration_request

        return capo_workmail.types.test_availability_configuration_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "TestAvailabilityConfiguration", redact_input=_redact_input
        ),
    )
    input_: capo_workmail.types.test_availability_configuration_request.TestAvailabilityConfigurationRequest = {
        "organization_id": organization_id
    }
    if domain_name is not None:
        input_["domain_name"] = domain_name
    if ews_provider is not None:
        input_["ews_provider"] = ews_provider
    if lambda_provider is not None:
        input_["lambda_provider"] = lambda_provider

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output