Skip to content

reject_certificate_transfer

reject_certificate_transfer(
    certificate_id: CertificateId,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    reject_reason: Optional[Message] = None,
) -> None

Rejects a pending certificate transfer. After IoT rejects a certificate transfer, the certificate status changes from PENDING_TRANSFER to INACTIVE.

To check for pending certificate transfers, call ListCertificates to enumerate your certificates.

This operation can only be called by the transfer destination. After it is called, the certificate will be returned to the source's account in the INACTIVE state.

Requires permission to access the RejectCertificateTransfer action.

Parameters:

  • certificate_id (CertificateId) –

    The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)

  • reject_reason (Optional[Message], default: None ) –

    The reason the certificate transfer was rejected.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def reject_certificate_transfer(
    self,
    certificate_id: "capo_iot.types.certificate_id.CertificateId",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    reject_reason: Optional["capo_iot.types.message.Message"] = None,
) -> None:
    """<p>Rejects a pending certificate transfer. After IoT rejects a certificate transfer, the certificate status changes from <b>PENDING_TRANSFER</b> to <b>INACTIVE</b>.</p> <p>To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate your certificates.</p> <p>This operation can only be called by the transfer destination. After it is called, the certificate will be returned to the source's account in the INACTIVE state.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">RejectCertificateTransfer</a> action.</p>

    Args:
        certificate_id: <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
        reject_reason: <p>The reason the certificate transfer was rejected.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.transfer_already_completed_exception.TransferAlreadyCompletedException: <p>You can't revert the certificate transfer because the transfer is already complete.</p>
        capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.reject_certificate_transfer_request.RejectCertificateTransferRequest]",
    ) -> OperationResponse[None]:
        import capo_iot._operations.aws_iot_service.reject_certificate_transfer

        output, http_response = (
            capo_iot._operations.aws_iot_service.reject_certificate_transfer.reject_certificate_transfer(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RejectCertificateTransfer")
    )
    input_: capo_iot.types.reject_certificate_transfer_request.RejectCertificateTransferRequest = {
        "certificate_id": certificate_id
    }
    if reject_reason is not None:
        input_["reject_reason"] = reject_reason

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