Source code for q2_sdk.core.http_handlers.check_image_handler

from __future__ import annotations
from copy import deepcopy
from q2_sdk.core.http_handlers.adapter_handler import Q2AdapterRequestHandler
from q2_sdk.models.adapters.check_image import CheckImage, CheckImageRequest


[docs] class Q2CheckImageRequestHandler(Q2AdapterRequestHandler): """ Adapter type for displaying check images. Invoked when navigating through an account history page and selecting a transaction with a check image icon. """ async def handle_adapter(self, message: dict, *args, **kwargs) -> dict: response_as_dict = deepcopy(message) request = CheckImageRequest.from_hq_request(message) if not request.routing_number: request.routing_number = self.hq_credentials.aba images = await self.get_check_images(request) response_as_dict["HostAccount_Req"][0]["HostErrorCode"] = 0 response_as_dict["Image_Rsp"] = [ x.as_adapter_response(request.transaction_id) for x in images ] return response_as_dict
[docs] async def get_check_images( self, check_image_request: CheckImageRequest ) -> list[CheckImage]: # pragma: no cover """Using the information provided in ``check_image_request`` param, return a list of CheckImages""" raise NotImplementedError