# 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 .identifier_value import IdentifierValue, IdentifierValueGuard


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

    :param id_: id_, defaults to None
    :type id_: IdentifierValue, optional
    :param label: label, defaults to None
    :type label: str, optional
    """

    def __init__(self, id_: IdentifierValue = None, label: str = None):
        if id_ is not None:
            self.id_ = IdentifierValueGuard.return_one_of(id_)
        if label is not None:
            self.label = label


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

    :param id_: id_, defaults to None
    :type id_: IdentifierValue, optional
    :param name: Insurance plan name., defaults to None
    :type name: str, optional
    :param price: Insurance price., defaults to None
    :type price: str, optional
    :param currency: Insurance payment currency., defaults to None
    :type currency: str, optional
    :param is_enabled: is_enabled, defaults to None
    :type is_enabled: bool, optional
    """

    def __init__(
        self,
        id_: IdentifierValue = None,
        name: str = None,
        price: str = None,
        currency: str = None,
        is_enabled: bool = None,
    ):
        if id_ is not None:
            self.id_ = IdentifierValueGuard.return_one_of(id_)
        if name is not None:
            self.name = name
        if price is not None:
            self.price = price
        if currency is not None:
            self.currency = currency
        if is_enabled is not None:
            self.is_enabled = is_enabled


@JsonMap({"id_": "id", "type_": "type"})
class HealthInsuranceProvider(BaseModel):
    """Health insurance provider.

    :param id_: id_, defaults to None
    :type id_: IdentifierValue, optional
    :param name: Name of insurance provider., defaults to None
    :type name: str, optional
    :param is_unisure: is_unisure, defaults to None
    :type is_unisure: bool, optional
    :param home_page_url: Insurance provider's home page url., defaults to None
    :type home_page_url: str, optional
    :param currency: Payment currency., defaults to None
    :type currency: str, optional
    :param type_: Insurance type., defaults to None
    :type type_: str, optional
    :param ending_rule: Insurance cycle ending rule., defaults to None
    :type ending_rule: str, optional
    :param days_to_cancel: Days to cancel the insurance., defaults to None
    :type days_to_cancel: str, optional
    :param pricing_info_link: URL to price info., defaults to None
    :type pricing_info_link: str, optional
    :param fixed_price: URL to price info., defaults to None
    :type fixed_price: bool, optional
    :param attachments: File attachments., defaults to None
    :type attachments: List[HealthInsuranceProviderAttachments], optional
    :param client_info_banner: Health insurance info banner., defaults to None
    :type client_info_banner: str, optional
    :param is_available_for_new_quotes: is_available_for_new_quotes, defaults to None
    :type is_available_for_new_quotes: bool, optional
    :param plans: plans, defaults to None
    :type plans: List[Plans], optional
    """

    def __init__(
        self,
        id_: IdentifierValue = None,
        name: str = None,
        is_unisure: bool = None,
        home_page_url: str = None,
        currency: str = None,
        type_: str = None,
        ending_rule: str = None,
        days_to_cancel: str = None,
        pricing_info_link: str = None,
        fixed_price: bool = None,
        attachments: List[HealthInsuranceProviderAttachments] = None,
        client_info_banner: str = None,
        is_available_for_new_quotes: bool = None,
        plans: List[Plans] = None,
    ):
        if id_ is not None:
            self.id_ = IdentifierValueGuard.return_one_of(id_)
        if name is not None:
            self.name = name
        if is_unisure is not None:
            self.is_unisure = is_unisure
        if home_page_url is not None:
            self.home_page_url = home_page_url
        if currency is not None:
            self.currency = currency
        if type_ is not None:
            self.type_ = type_
        if ending_rule is not None:
            self.ending_rule = ending_rule
        if days_to_cancel is not None:
            self.days_to_cancel = days_to_cancel
        if pricing_info_link is not None:
            self.pricing_info_link = pricing_info_link
        if fixed_price is not None:
            self.fixed_price = fixed_price
        if attachments is not None:
            self.attachments = self._define_list(
                attachments, HealthInsuranceProviderAttachments
            )
        if client_info_banner is not None:
            self.client_info_banner = client_info_banner
        if is_available_for_new_quotes is not None:
            self.is_available_for_new_quotes = is_available_for_new_quotes
        if plans is not None:
            self.plans = self._define_list(plans, Plans)
