def download_invoice(invoice_id, file_handle): http = Config.get_http_module() resp = Request().download(invoice_id).execute(http) resp.raise_for_status() file_handle.write_bytes(resp.content)
def email_invoice(invoice_id, email_addr, message): serializer = Config.get_serializer_module() http = Config.get_http_module() data = serializer.make_email(email_addr, message) resp = Request().email(invoice_id, data).execute(http) resp.raise_for_status() return resp.json()
def create_invoice(invoice): from ifirma.request import InvoiceResponse http = Config.get_http_module() data = _serialize(invoice) resp = Request().submit(data).execute(http) resp.raise_for_status() return InvoiceResponse(resp.json())