Skip to content

put_account_sending_attributes

put_account_sending_attributes(
    *,
    config_overrides: Optional[SESv2ClientConfig] = 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 Amazon Web Services 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_sesv2/_services/se_sv2.py
def put_account_sending_attributes(
    self,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
    sending_enabled: Optional["capo_sesv2.types.enabled.Enabled"] = None,
) -> "capo_sesv2.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 Amazon Web Services 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_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sesv2.types.put_account_sending_attributes_request.PutAccountSendingAttributesRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.put_account_sending_attributes_response.PutAccountSendingAttributesResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.put_account_sending_attributes

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.put_account_sending_attributes.put_account_sending_attributes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output