Skip to content

put_account_sending_attributes async

put_account_sending_attributes(
    *,
    config_overrides: Optional[AsyncPinpointEmailClientConfig] = None,
    sending_enabled: Optional[Enabled] = None,
) -> PutAccountSendingAttributesResponse

Enable or disable the ability of your account to send email.

Parameters:

  • sending_enabled (Optional[Enabled], default: None ) –

    Enables or disables your account's ability to send email. Set to true to enable email sending, or set to false to disable email sending.

    If AWS paused your account's ability to send email, you can't use this operation to resume your account's ability to send email.

Raises:

Source code in docs_src/capo_pinpoint_email/_services/async_pinpoint_email.py
async def put_account_sending_attributes(
    self,
    *,
    config_overrides: Optional[AsyncPinpointEmailClientConfig] = None,
    sending_enabled: Optional["capo_pinpoint_email.types.enabled.Enabled"] = None,
) -> "capo_pinpoint_email.types.put_account_sending_attributes_response.PutAccountSendingAttributesResponse":
    """<p>Enable or disable the ability of your account to send email.</p>

    Args:
        sending_enabled: <p>Enables or disables your account's ability to send email. Set to <code>true</code> to enable email sending, or set to <code>false</code> to disable email sending.</p> <note> <p>If AWS paused your account's ability to send email, you can't use this operation to resume your account's ability to send email.</p> </note>

    Raises:
        capo_pinpoint_email.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_pinpoint_email.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_pinpoint_email.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pinpoint_email.types.put_account_sending_attributes_request.PutAccountSendingAttributesRequest]",
    ) -> AsyncOperationResponse[
        "capo_pinpoint_email.types.put_account_sending_attributes_response.PutAccountSendingAttributesResponse"
    ]:
        import capo_pinpoint_email._operations.amazon_pinpoint_email_service.put_account_sending_attributes

        (
            output,
            http_response,
        ) = await capo_pinpoint_email._operations.amazon_pinpoint_email_service.put_account_sending_attributes.async_put_account_sending_attributes(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutAccountSendingAttributes")
    )
    input_: capo_pinpoint_email.types.put_account_sending_attributes_request.PutAccountSendingAttributesRequest = {}
    if sending_enabled is not None:
        input_["sending_enabled"] = sending_enabled

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