# This file was generated by liblab | https://liblab.com/

from __future__ import annotations
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .price_data_dto_double import PriceDataDtoDouble
from .product_dto import ProductDto


@JsonMap({"id_": "id"})
class SearchOutputDto(BaseModel):
    """SearchOutputDto

    :param id_: A signed integer number that uniquely identifies an accommodation property., defaults to None
    :type id_: int, optional
    :param currency: A three-letter code that uniquely identifies a monetary currency as defined by the ISO 4217 standard., defaults to None
    :type currency: str, optional
    :param deep_link_url: Deep link mobile app URL., defaults to None
    :type deep_link_url: str, optional
    :param url: Internet address for the property page on Booking.com., defaults to None
    :type url: str, optional
    :param price: The price components of this product or selection of products. 'base' and 'extra_charges' are returned only when explicitly requested (via 'extras=extra_charges')., defaults to None
    :type price: PriceDataDtoDouble, optional
    :param products: products, defaults to None
    :type products: List[ProductDto], optional
    """

    def __init__(
        self,
        id_: int = None,
        currency: str = None,
        deep_link_url: str = None,
        url: str = None,
        price: PriceDataDtoDouble = None,
        products: List[ProductDto] = None,
    ):
        if id_ is not None:
            self.id_ = id_
        if currency is not None:
            self.currency = self._pattern_matching(currency, "^[A-Z]{3}$", "currency")
        if deep_link_url is not None:
            self.deep_link_url = deep_link_url
        if url is not None:
            self.url = url
        if price is not None:
            self.price = self._define_object(price, PriceDataDtoDouble)
        if products is not None:
            self.products = self._define_list(products, ProductDto)
