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

from __future__ import annotations

from typing import Annotated

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

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


class Destination(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    airport_code: Annotated[str, Field(description='IATA airport code.', pattern='^[A-Z]{3}$')]
    city: Annotated[str | None, Field(description='City name.')] = None


class Origin(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    airport_code: Annotated[
        str,
        Field(description="IATA airport code (e.g., 'AMS', 'JFK', 'LHR').", pattern='^[A-Z]{3}$'),
    ]
    city: Annotated[str | None, Field(description="City name (e.g., 'Amsterdam', 'New York').")] = (
        None
    )


class FlightItem(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    airline: Annotated[str | None, Field(description='Airline name or IATA airline code.')] = None
    arrival_time: Annotated[
        AwareDatetime | None, Field(description='Arrival date and time (ISO 8601).')
    ] = None
    assets: Annotated[
        list[offering_asset_group.OfferingAssetGroup] | None,
        Field(
            description="Typed creative asset pools for this flight. Uses the same OfferingAssetGroup structure as offering-type catalogs. Standard group IDs: 'images_landscape' (destination 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
    departure_time: Annotated[
        AwareDatetime | None, Field(description='Departure date and time (ISO 8601).')
    ] = None
    description: Annotated[
        str | None, Field(description='Route description or promotional text.')
    ] = None
    destination: Annotated[Destination, Field(description='Arrival airport or city.')]
    ext: ext_1.ExtensionObject | None = None
    flight_id: Annotated[
        str, Field(description='Unique identifier for this flight route or offer.')
    ]
    image_url: Annotated[
        AnyUrl | None, Field(description='Promotional image URL (typically a destination photo).')
    ] = None
    origin: Annotated[Origin, Field(description='Departure airport or city.')]
    price: Annotated[price_1.Price | None, Field(description='Ticket price or starting fare.')] = (
        None
    )
    tags: Annotated[
        list[str] | None,
        Field(
            description="Tags for filtering (e.g., 'direct', 'red-eye', 'business-class').",
            min_length=1,
        ),
    ] = None
    url: Annotated[AnyUrl | None, Field(description='Booking page URL for this route.')] = None
