# generated by datamodel-codegen:
#   filename:  core/vehicle_item.json
#   timestamp: 2026-02-27T02:10:10+00:00

from __future__ import annotations

from enum import Enum
from typing import Annotated

from adcp.types.base import AdCPBaseModel
from pydantic import AnyUrl, ConfigDict, Field

from . import ext as ext_1
from . import offering_asset_group
from . import price as price_1


class BodyStyle(Enum):
    sedan = 'sedan'
    suv = 'suv'
    truck = 'truck'
    coupe = 'coupe'
    convertible = 'convertible'
    wagon = 'wagon'
    van = 'van'
    hatchback = 'hatchback'


class Condition(Enum):
    new = 'new'
    used = 'used'
    certified_pre_owned = 'certified_pre_owned'


class FuelType(Enum):
    gasoline = 'gasoline'
    diesel = 'diesel'
    electric = 'electric'
    hybrid = 'hybrid'
    plug_in_hybrid = 'plug_in_hybrid'


class Location(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    lat: Annotated[
        float, Field(description='Latitude in decimal degrees (WGS 84).', ge=-90.0, le=90.0)
    ]
    lng: Annotated[
        float, Field(description='Longitude in decimal degrees (WGS 84).', ge=-180.0, le=180.0)
    ]


class Unit(Enum):
    km = 'km'
    mi = 'mi'


class Mileage(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    unit: Annotated[Unit, Field(description='Distance unit.')]
    value: Annotated[float, Field(description='Mileage value.', ge=0.0)]


class Transmission(Enum):
    automatic = 'automatic'
    manual = 'manual'
    cvt = 'cvt'


class VehicleItem(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    assets: Annotated[
        list[offering_asset_group.OfferingAssetGroup] | None,
        Field(
            description="Typed creative asset pools for this vehicle. Uses the same OfferingAssetGroup structure as offering-type catalogs. Standard group IDs: 'images_landscape' (exterior hero), 'images_vertical' (9:16 for Stories), 'images_square' (1:1). Enables formats to declare typed image requirements that map unambiguously to the right asset regardless of platform.",
            min_length=1,
        ),
    ] = None
    body_style: Annotated[BodyStyle | None, Field(description='Vehicle body style.')] = None
    condition: Annotated[Condition | None, Field(description='Vehicle condition.')] = None
    ext: ext_1.ExtensionObject | None = None
    exterior_color: Annotated[str | None, Field(description='Exterior color.')] = None
    fuel_type: Annotated[FuelType | None, Field(description='Fuel or powertrain type.')] = None
    image_url: Annotated[AnyUrl | None, Field(description='Primary vehicle image URL.')] = None
    interior_color: Annotated[str | None, Field(description='Interior color.')] = None
    location: Annotated[Location | None, Field(description='Dealer or vehicle location.')] = None
    make: Annotated[str, Field(description="Vehicle manufacturer (e.g., 'Honda', 'Ford', 'BMW').")]
    mileage: Annotated[Mileage | None, Field(description='Odometer reading.')] = None
    model: Annotated[str, Field(description="Vehicle model (e.g., 'Civic', 'F-150', 'X5').")]
    price: Annotated[price_1.Price | None, Field(description='Vehicle price.')] = None
    tags: Annotated[
        list[str] | None,
        Field(
            description="Tags for filtering (e.g., 'low-mileage', 'one-owner', 'dealer-certified').",
            min_length=1,
        ),
    ] = None
    title: Annotated[str, Field(description="Listing title (e.g., '2024 Honda Civic EX Sedan').")]
    transmission: Annotated[Transmission | None, Field(description='Transmission type.')] = None
    trim: Annotated[
        str | None, Field(description="Trim level (e.g., 'EX', 'Limited', 'Sport').")
    ] = None
    url: Annotated[AnyUrl | None, Field(description='Vehicle listing page URL.')] = None
    vehicle_id: Annotated[str, Field(description='Unique identifier for this vehicle listing.')]
    vin: Annotated[
        str | None, Field(description='Vehicle Identification Number (17-character VIN).')
    ] = None
    year: Annotated[int, Field(description='Model year.', ge=1900)]
