Skip to content

update_availability_configuration async

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

Updates an existing AvailabilityConfiguration for the given WorkMail organization and domain.

Parameters:

  • organization_id (OrganizationId) –

    The WorkMail organization for which the AvailabilityConfiguration will be updated.

  • domain_name (DomainName) –

    The domain to which the provider applies the availability configuration.

  • ews_provider (Optional[EwsAvailabilityProvider], default: None ) –

    The EWS availability provider definition. The request must contain exactly one provider definition, either EwsProvider or LambdaProvider. The previously stored provider will be overridden by the one provided.

  • lambda_provider (Optional[LambdaAvailabilityProvider], default: None ) –

    The Lambda availability provider definition. The request must contain exactly one provider definition, either EwsProvider or LambdaProvider. The previously stored provider will be overridden by the one provided.

Raises:

Source code in docs_src/capo_workmail/_services/async_work_mail.py
async def update_availability_configuration(
    self,
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    domain_name: "capo_workmail.types.domain_name.DomainName",
    *,
    config_overrides: Optional[AsyncWorkMailClientConfig] = 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.update_availability_configuration_response.UpdateAvailabilityConfigurationResponse":
    """<p>Updates an existing <code>AvailabilityConfiguration</code> for the given WorkMail organization and domain.</p>

    Args:
        organization_id: <p>The WorkMail organization for which the <code>AvailabilityConfiguration</code> will be updated.</p>
        domain_name: <p>The domain to which the provider applies the availability configuration.</p>
        ews_provider: <p>The EWS availability provider definition. The request must contain exactly one provider definition, either <code>EwsProvider</code> or <code>LambdaProvider</code>. The previously stored provider will be overridden by the one provided.</p>
        lambda_provider: <p>The Lambda availability provider definition. The request must contain exactly one provider definition, either <code>EwsProvider</code> or <code>LambdaProvider</code>. The previously stored provider will be overridden by the one provided.</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.update_availability_configuration_request.UpdateAvailabilityConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_workmail.types.update_availability_configuration_response.UpdateAvailabilityConfigurationResponse"
    ]:
        import capo_workmail._operations.work_mail_service.update_availability_configuration

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

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

        return capo_workmail.types.update_availability_configuration_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateAvailabilityConfiguration", redact_input=_redact_input
        ),
    )
    input_: capo_workmail.types.update_availability_configuration_request.UpdateAvailabilityConfigurationRequest = {
        "organization_id": organization_id,
        "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