# generated by datamodel-codegen:
#   filename:  core/real_estate_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 Address(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    city: Annotated[str | None, Field(description='City name.')] = None
    country: Annotated[
        str | None, Field(description='ISO 3166-1 alpha-2 country code.', pattern='^[A-Z]{2}$')
    ] = None
    postal_code: Annotated[str | None, Field(description='Postal or ZIP code.')] = None
    region: Annotated[str | None, Field(description='State, province, or region.')] = None
    street: Annotated[str | None, Field(description='Street address.')] = None


class Unit(Enum):
    sqft = 'sqft'
    sqm = 'sqm'


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


class ListingType(Enum):
    for_sale = 'for_sale'
    for_rent = 'for_rent'


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 PropertyType(Enum):
    house = 'house'
    apartment = 'apartment'
    condo = 'condo'
    townhouse = 'townhouse'
    land = 'land'
    commercial = 'commercial'


class RealEstateItem(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    address: Annotated[Address, Field(description='Property address.')]
    area: Annotated[Area | None, Field(description='Property size.')] = None
    assets: Annotated[
        list[offering_asset_group.OfferingAssetGroup] | None,
        Field(
            description="Typed creative asset pools for this property listing. Uses the same OfferingAssetGroup structure as offering-type catalogs. Standard group IDs: 'images_landscape' (exterior/interior 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
    bathrooms: Annotated[
        float | None,
        Field(
            description='Number of bathrooms (e.g., 2.5 for two full and one half bath).', ge=0.0
        ),
    ] = None
    bedrooms: Annotated[int | None, Field(description='Number of bedrooms.', ge=0)] = None
    description: Annotated[str | None, Field(description='Property description.')] = None
    ext: ext_1.ExtensionObject | None = None
    image_url: Annotated[AnyUrl | None, Field(description='Primary property image URL.')] = None
    listing_id: Annotated[str, Field(description='Unique identifier for this property listing.')]
    listing_type: Annotated[
        ListingType | None, Field(description='Whether the property is for sale or rent.')
    ] = None
    location: Annotated[
        Location | None, Field(description='Geographic coordinates of the property.')
    ] = None
    neighborhood: Annotated[str | None, Field(description='Neighborhood or area name.')] = None
    price: Annotated[
        price_1.Price | None,
        Field(description="Property price or rental rate. Use period 'month' for rentals."),
    ] = None
    property_type: Annotated[PropertyType | None, Field(description='Type of property.')] = None
    tags: Annotated[
        list[str] | None,
        Field(
            description="Tags for filtering (e.g., 'garden', 'parking', 'renovated', 'waterfront').",
            min_length=1,
        ),
    ] = None
    title: Annotated[
        str, Field(description="Listing title (e.g., 'Spacious 3BR Apartment in Jordaan').")
    ]
    url: Annotated[AnyUrl | None, Field(description='Listing page URL.')] = None
    year_built: Annotated[int | None, Field(description='Year the property was built.')] = None
