from .client import http_delete as http_delete, http_get as http_get, http_get_raw as http_get_raw, http_patch as http_patch, http_post as http_post, paginate as paginate
from .custom_field_model import CustomFieldModel as CustomFieldModel
from .model import Synchronizable as Synchronizable, ensure_list_of as ensure_list_of
from .payment import Payment as Payment
from _typeshed import Incomplete
from pydantic import BaseModel
from typing import Any, Self

class SalesInvoiceDetailsAttribute(BaseModel):
    id: int | None
    description: str | None
    period: str | None
    price: int | str | None
    amount: int | str | None
    tax_rate_id: int | None
    ledger_account_id: int | str | None
    project_id: int | str | None
    product_id: int | str | None
    row_order: int | None
    model_config: Incomplete
    def update(self, data: dict[str, Any]) -> None: ...

class SalesInvoice(Synchronizable, CustomFieldModel):
    contact_id: int | None
    contact_person_id: int | None
    invoice_id: str | None
    draft_id: int | None
    workflow_id: int | None
    document_style_id: int | None
    identity_id: int | None
    invoice_date: str | None
    due_date: str | None
    payment_conditions: str | None
    payment_reference: str | None
    short_payment_reference: str | None
    reference: str | None
    language: str | None
    currency: str | None
    discount: str | None
    first_due_interval: int | None
    prices_are_incl_tax: bool | None
    state: str | None
    paused: bool | None
    total_paid: str | None
    total_unpaid: str | None
    total_unpaid_base: str | None
    total_price_excl_tax: str | None
    total_price_excl_tax_base: str | None
    total_price_incl_tax: str | None
    total_price_incl_tax_base: str | None
    total_discount: str | None
    paid_at: str | None
    sent_at: str | None
    created_at: str | None
    updated_at: str | None
    version: int | None
    marked_dubious_on: str | None
    marked_uncollectible_on: str | None
    url: str | None
    payment_url: str | None
    public_view_code: str | None
    reminder_count: int | None
    next_reminder: str | None
    original_estimate_id: int | None
    recurring_sales_invoice_id: int | None
    subscription_id: int | None
    details: list[SalesInvoiceDetailsAttribute]
    payments: list[Payment]
    tax_totals: list[dict[str, Any]]
    def ensure_payments(cls, value: list[dict[str, Any]] | list[Payment] | None) -> list[Payment]: ...
    def ensure_details(cls, value: list[dict[str, Any]] | list[SalesInvoiceDetailsAttribute] | None) -> list[SalesInvoiceDetailsAttribute]: ...
    def save(self) -> None: ...
    def add_detail(self, detail: SalesInvoiceDetailsAttribute) -> None: ...
    def get_detail(self, detail_id: int) -> SalesInvoiceDetailsAttribute: ...
    def update_detail(self, detail_id: int, data: dict[str, Any]) -> SalesInvoiceDetailsAttribute: ...
    def delete_detail(self, detail_id: int) -> None: ...
    def create_payment(self, payment: Payment) -> None: ...
    def delete_payment(self, payment_id: int) -> None: ...
    def send_invoice(self, delivery_method: str | None = None, sending_scheduled: bool = False, deliver_ubl: bool = False, mergeable: bool = False, email_address: str | None = None, email_message: str | None = None) -> None: ...
    def download_pdf(self) -> bytes: ...
    def download_ubl(self) -> bytes: ...
    def pause(self) -> None: ...
    def resume(self) -> None: ...
    def mark_as_dubious(self) -> None: ...
    def mark_as_uncollectible(self) -> None: ...
    def register_payment(self, payment: Payment) -> None: ...
    def duplicate_creditinvoice(self) -> SalesInvoice: ...
    @classmethod
    def list_all(cls, state: str | None = None, period: str | None = None, contact_id: int | None = None, reference: str | None = None) -> list[Self]: ...
    @classmethod
    def find_by_invoice_id(cls, invoice_id: str) -> Self: ...
    @classmethod
    def find_by_reference(cls, reference: str) -> Self: ...
