from __future__ import annotations

from datetime import datetime
from typing import Any

from pydantic import Field

from pyuspostalservice.models.base.base_model import USPSModel

class Pagination(USPSModel):
    current_page: int | None = Field(default=None, alias="CurrentPage")
    current_page_count: int | None = Field(default=None, alias="CurrentPageCount")
    limit: int | None = Field(default=None, alias="Limit")
    total_count: int | None = Field(default=None, alias="TotalCount")
    next_page: int | None = Field(default=None, alias="NextPage")
    next_page_url: str | None = Field(default=None, alias="NextPageURL")
    next_page_token: str | None = Field(default=None, alias="NextPageToken")
    
class Address(USPSModel):
    firm: str | None = Field(default=None, alias="Firm")
    address: dict[str, Any] | None = Field(default=None, alias="Address")
    additionalInfo: dict[str, Any] | None = Field(default=None, alias="AdditionalInfo")
    corrections: list[dict[str, Any]] | None = Field(default=None, alias="Corrections")
    matches: list[dict[str, Any]] | None = Field(default=None, alias="Matches")
    warnings: list[str] | None = Field(default=None, alias="Warnings")

class CityState(USPSModel):
    city: str | None = Field(default=None, alias="City")
    state: str | None = Field(default=None, alias="State")
    ZIPcode: str | None = Field(default=None, alias="ZIPCode")

class ZIPcode(USPSModel):
    firm: str | None = Field(default=None, alias="Firm")
    address: dict[str, str | None] | None = Field(default=None, alias="Address")

class TrackingNotifications(USPSModel):
    transactionMessage: str | None = Field(default=None, alias="TransactionMessage")

class TrackingProofOfDelivery(USPSModel):
    transactionMessage: str | None = Field(default=None, alias="TransactionMessage")

class Tracking(USPSModel):
    trackingNumber: str | None = Field(default=None, alias="TrackingNumber")
    associatedTrackingNumber: str | None = Field(default=None, alias="AssociatedTrackingNumber")
    destinationCity: str | None = Field(default=None, alias="DestinationCity")
    destinationCountry: str | None = Field(default=None, alias="DestinationCountry")
    destinationState: str | None = Field(default=None, alias="DestinationState")
    destinationZIPCode: str | None = Field(default=None, alias="DestinationZIPCode")
    kahalaIndicator: bool | None = Field(default=None, alias="KahalaIndicator")
    mailClass: str | None = Field(default=None, alias="MailClass")
    mailingDate: datetime | None = Field(default=None, alias="MailingDate")
    mailType: str | None = Field(default=None, alias="MailType")
    originCity: str | None = Field(default=None, alias="OriginCity")
    originCountry: str | None = Field(default=None, alias="OriginCountry")
    originState: str | None = Field(default=None, alias="OriginState")
    originZIPCode: str | None = Field(default=None, alias="OriginZIPCode")
    services: list[str] | None = Field(default=None, alias="Services")
    serviceTypeCode: str | None = Field(default=None, alias="ServiceTypeCode")
    status: str | None = Field(default=None, alias="Status")
    statusCategory: str | None = Field(default=None, alias="StatusCategory")
    statusSummary: str | None = Field(default=None, alias="StatusSummary")
    uniqueTrackingID: str | None = Field(default=None, alias="UniqueTrackingID")
    deliveryDateExpectation: dict[str, Any] | None = Field(default=None, alias="DeliveryDateExpectation")
    servicesEligibility: dict[str, bool] | None = Field(default=None, alias="ServicesEligibility")
    trackingEvents: list[dict[str, Any]] | None = Field(default=None, alias="TrackingEvents")
    statusCode: str | None = Field(default=None, alias="StatusCode")
    apiVersion: str | None = Field(default=None, alias="APIVersion")
    error: list[dict[str, Any]] | None = Field(default=None, alias="Error")

