"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
import requests as requests_http
from ..shared import invoices as shared_invoices
from datetime import date, datetime
from enum import Enum
from typing import Optional

class ListInvoicesDateTypeDateType(str, Enum):
    DUE_DATE = 'due_date'
    INVOICE_DATE = 'invoice_date'

class ListInvoicesStatusStatus(str, Enum):
    DRAFT = 'draft'
    ISSUED = 'issued'
    PAID = 'paid'
    SYNCED = 'synced'
    VOID = 'void'

class ListInvoicesStatus(str, Enum):
    DRAFT = 'draft'
    ISSUED = 'issued'
    PAID = 'paid'
    SYNCED = 'synced'
    VOID = 'void'



@dataclasses.dataclass
class ListInvoicesRequest:
    amount: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'amount', 'style': 'form', 'explode': True }})
    amount_gt: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'amount[gt]', 'style': 'form', 'explode': True }})
    amount_lt: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'amount[lt]', 'style': 'form', 'explode': True }})
    cursor: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'cursor', 'style': 'form', 'explode': True }})
    customer_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'customer_id', 'style': 'form', 'explode': True }})
    date_type: Optional[ListInvoicesDateTypeDateType] = dataclasses.field(default=ListInvoicesDateTypeDateType.INVOICE_DATE, metadata={'query_param': { 'field_name': 'date_type', 'style': 'form', 'explode': True }})
    due_date: Optional[date] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'due_date', 'style': 'form', 'explode': True }})
    due_date_window: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'due_date_window', 'style': 'form', 'explode': True }})
    due_date_gt: Optional[date] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'due_date[gt]', 'style': 'form', 'explode': True }})
    due_date_lt: Optional[date] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'due_date[lt]', 'style': 'form', 'explode': True }})
    external_customer_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'external_customer_id', 'style': 'form', 'explode': True }})
    invoice_date_gt: Optional[datetime] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'invoice_date[gt]', 'style': 'form', 'explode': True }})
    invoice_date_gte: Optional[datetime] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'invoice_date[gte]', 'style': 'form', 'explode': True }})
    invoice_date_lt: Optional[datetime] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'invoice_date[lt]', 'style': 'form', 'explode': True }})
    invoice_date_lte: Optional[datetime] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'invoice_date[lte]', 'style': 'form', 'explode': True }})
    is_recurring: Optional[bool] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'is_recurring', 'style': 'form', 'explode': True }})
    limit: Optional[int] = dataclasses.field(default=20, metadata={'query_param': { 'field_name': 'limit', 'style': 'form', 'explode': True }})
    status: Optional[ListInvoicesStatusStatus] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'status', 'style': 'form', 'explode': True }})
    statuses: Optional[list[ListInvoicesStatus]] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'status[]', 'style': 'form', 'explode': True }})
    subscription_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'subscription_id', 'style': 'form', 'explode': True }})
    




@dataclasses.dataclass
class ListInvoicesResponse:
    content_type: str = dataclasses.field()
    r"""HTTP response content type for this operation"""
    status_code: int = dataclasses.field()
    r"""HTTP response status code for this operation"""
    invoices: Optional[shared_invoices.Invoices] = dataclasses.field(default=None)
    r"""OK"""
    raw_response: Optional[requests_http.Response] = dataclasses.field(default=None)
    r"""Raw HTTP response; suitable for custom response parsing"""
    

