# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from swagger_server.models.base_model_ import Model
from swagger_server.models.amount_of_money import AmountOfMoney  # noqa: F401,E501
from swagger_server.models.country import Country  # noqa: F401,E501
from swagger_server import util


class FarePart(Model):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    def __init__(self, amount: float=None, amount_ex_vat: float=None, currency_code: str=None, vat_rate: float=None, vat_country_code: Country=None, type: str=None, unit_type: str=None, units: float=None, scale_from: float=None, scale_to: float=None, scale_type: str=None, name: str=None, _class: str='FARE', meta: Dict=None):  # noqa: E501
        """FarePart - a model defined in Swagger

        :param amount: The amount of this FarePart.  # noqa: E501
        :type amount: float
        :param amount_ex_vat: The amount_ex_vat of this FarePart.  # noqa: E501
        :type amount_ex_vat: float
        :param currency_code: The currency_code of this FarePart.  # noqa: E501
        :type currency_code: str
        :param vat_rate: The vat_rate of this FarePart.  # noqa: E501
        :type vat_rate: float
        :param vat_country_code: The vat_country_code of this FarePart.  # noqa: E501
        :type vat_country_code: Country
        :param type: The type of this FarePart.  # noqa: E501
        :type type: str
        :param unit_type: The unit_type of this FarePart.  # noqa: E501
        :type unit_type: str
        :param units: The units of this FarePart.  # noqa: E501
        :type units: float
        :param scale_from: The scale_from of this FarePart.  # noqa: E501
        :type scale_from: float
        :param scale_to: The scale_to of this FarePart.  # noqa: E501
        :type scale_to: float
        :param scale_type: The scale_type of this FarePart.  # noqa: E501
        :type scale_type: str
        :param name: The name of this FarePart.  # noqa: E501
        :type name: str
        :param _class: The _class of this FarePart.  # noqa: E501
        :type _class: str
        :param meta: The meta of this FarePart.  # noqa: E501
        :type meta: Dict
        """
        self.swagger_types = {
            'amount': float,
            'amount_ex_vat': float,
            'currency_code': str,
            'vat_rate': float,
            'vat_country_code': Country,
            'type': str,
            'unit_type': str,
            'units': float,
            'scale_from': float,
            'scale_to': float,
            'scale_type': str,
            'name': str,
            '_class': str,
            'meta': Dict
        }

        self.attribute_map = {
            'amount': 'amount',
            'amount_ex_vat': 'amountExVat',
            'currency_code': 'currencyCode',
            'vat_rate': 'vatRate',
            'vat_country_code': 'vatCountryCode',
            'type': 'type',
            'unit_type': 'unitType',
            'units': 'units',
            'scale_from': 'scaleFrom',
            'scale_to': 'scaleTo',
            'scale_type': 'scaleType',
            'name': 'name',
            '_class': 'class',
            'meta': 'meta'
        }
        self._amount = amount
        self._amount_ex_vat = amount_ex_vat
        self._currency_code = currency_code
        self._vat_rate = vat_rate
        self._vat_country_code = vat_country_code
        self._type = type
        self._unit_type = unit_type
        self._units = units
        self._scale_from = scale_from
        self._scale_to = scale_to
        self._scale_type = scale_type
        self._name = name
        self.__class = _class
        self._meta = meta

    @classmethod
    def from_dict(cls, dikt) -> 'FarePart':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The farePart of this FarePart.  # noqa: E501
        :rtype: FarePart
        """
        return util.deserialize_model(dikt, cls)

    @property
    def amount(self) -> float:
        """Gets the amount of this FarePart.

        This should be in the base unit as defined by the ISO 4217 currency code with the appropriate number of decimal places and omitting the currency symbol. e.g. if the price is in US Dollars the price would be 9.95. This is inclusive VAT  # noqa: E501

        :return: The amount of this FarePart.
        :rtype: float
        """
        return self._amount

    @amount.setter
    def amount(self, amount: float):
        """Sets the amount of this FarePart.

        This should be in the base unit as defined by the ISO 4217 currency code with the appropriate number of decimal places and omitting the currency symbol. e.g. if the price is in US Dollars the price would be 9.95. This is inclusive VAT  # noqa: E501

        :param amount: The amount of this FarePart.
        :type amount: float
        """
        if amount is None:
            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501

        self._amount = amount

    @property
    def amount_ex_vat(self) -> float:
        """Gets the amount_ex_vat of this FarePart.


        :return: The amount_ex_vat of this FarePart.
        :rtype: float
        """
        return self._amount_ex_vat

    @amount_ex_vat.setter
    def amount_ex_vat(self, amount_ex_vat: float):
        """Sets the amount_ex_vat of this FarePart.


        :param amount_ex_vat: The amount_ex_vat of this FarePart.
        :type amount_ex_vat: float
        """

        self._amount_ex_vat = amount_ex_vat

    @property
    def currency_code(self) -> str:
        """Gets the currency_code of this FarePart.

        ISO 4217 currency code  # noqa: E501

        :return: The currency_code of this FarePart.
        :rtype: str
        """
        return self._currency_code

    @currency_code.setter
    def currency_code(self, currency_code: str):
        """Sets the currency_code of this FarePart.

        ISO 4217 currency code  # noqa: E501

        :param currency_code: The currency_code of this FarePart.
        :type currency_code: str
        """

        self._currency_code = currency_code

    @property
    def vat_rate(self) -> float:
        """Gets the vat_rate of this FarePart.

        value added tax rate (percentage of amount)  # noqa: E501

        :return: The vat_rate of this FarePart.
        :rtype: float
        """
        return self._vat_rate

    @vat_rate.setter
    def vat_rate(self, vat_rate: float):
        """Sets the vat_rate of this FarePart.

        value added tax rate (percentage of amount)  # noqa: E501

        :param vat_rate: The vat_rate of this FarePart.
        :type vat_rate: float
        """

        self._vat_rate = vat_rate

    @property
    def vat_country_code(self) -> Country:
        """Gets the vat_country_code of this FarePart.


        :return: The vat_country_code of this FarePart.
        :rtype: Country
        """
        return self._vat_country_code

    @vat_country_code.setter
    def vat_country_code(self, vat_country_code: Country):
        """Sets the vat_country_code of this FarePart.


        :param vat_country_code: The vat_country_code of this FarePart.
        :type vat_country_code: Country
        """

        self._vat_country_code = vat_country_code

    @property
    def type(self) -> str:
        """Gets the type of this FarePart.

        type of fare part. If there is only one farepart and this field is missing, it should be assumed it is 'FIXED'. In all other situations this field is mandatory.  # noqa: E501

        :return: The type of this FarePart.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type: str):
        """Sets the type of this FarePart.

        type of fare part. If there is only one farepart and this field is missing, it should be assumed it is 'FIXED'. In all other situations this field is mandatory.  # noqa: E501

        :param type: The type of this FarePart.
        :type type: str
        """
        allowed_values = ["FIXED", "FLEX", "MAX"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"
                .format(type, allowed_values)
            )

        self._type = type

    @property
    def unit_type(self) -> str:
        """Gets the unit_type of this FarePart.

        in case of 'FLEX' mandatory, otherwise not allowed. E.g. 0.5 EUR per HOUR  # noqa: E501

        :return: The unit_type of this FarePart.
        :rtype: str
        """
        return self._unit_type

    @unit_type.setter
    def unit_type(self, unit_type: str):
        """Sets the unit_type of this FarePart.

        in case of 'FLEX' mandatory, otherwise not allowed. E.g. 0.5 EUR per HOUR  # noqa: E501

        :param unit_type: The unit_type of this FarePart.
        :type unit_type: str
        """
        allowed_values = ["KM", "SECOND", "MINUTE", "HOUR", "MILE", "PERCENTAGE"]  # noqa: E501
        if unit_type not in allowed_values:
            raise ValueError(
                "Invalid value for `unit_type` ({0}), must be one of {1}"
                .format(unit_type, allowed_values)
            )

        self._unit_type = unit_type

    @property
    def units(self) -> float:
        """Gets the units of this FarePart.

        the number of km, seconds etc. Mandatory when the type is 'FLEX', otherwise not allowed. In case of 0.5 EUR per 15 MINUTES, `units` should contain 15 and `unitType` MINUTES.  # noqa: E501

        :return: The units of this FarePart.
        :rtype: float
        """
        return self._units

    @units.setter
    def units(self, units: float):
        """Sets the units of this FarePart.

        the number of km, seconds etc. Mandatory when the type is 'FLEX', otherwise not allowed. In case of 0.5 EUR per 15 MINUTES, `units` should contain 15 and `unitType` MINUTES.  # noqa: E501

        :param units: The units of this FarePart.
        :type units: float
        """

        self._units = units

    @property
    def scale_from(self) -> float:
        """Gets the scale_from of this FarePart.

        in case of scaling, this is the bottom value (f.x. in the first hour 3 CAD, the `scaleFrom` should contain 0 and the `scaleType` HOUR). When `scaleTo` is used, but this field is missing, it should be assumed it is a 0.  # noqa: E501

        :return: The scale_from of this FarePart.
        :rtype: float
        """
        return self._scale_from

    @scale_from.setter
    def scale_from(self, scale_from: float):
        """Sets the scale_from of this FarePart.

        in case of scaling, this is the bottom value (f.x. in the first hour 3 CAD, the `scaleFrom` should contain 0 and the `scaleType` HOUR). When `scaleTo` is used, but this field is missing, it should be assumed it is a 0.  # noqa: E501

        :param scale_from: The scale_from of this FarePart.
        :type scale_from: float
        """

        self._scale_from = scale_from

    @property
    def scale_to(self) -> float:
        """Gets the scale_to of this FarePart.

        the upper value of the scale (f.x. 3 CAD in the first hour, this field should contain 1, `scaleFrom` 0 and `scaleType` HOUR)  # noqa: E501

        :return: The scale_to of this FarePart.
        :rtype: float
        """
        return self._scale_to

    @scale_to.setter
    def scale_to(self, scale_to: float):
        """Sets the scale_to of this FarePart.

        the upper value of the scale (f.x. 3 CAD in the first hour, this field should contain 1, `scaleFrom` 0 and `scaleType` HOUR)  # noqa: E501

        :param scale_to: The scale_to of this FarePart.
        :type scale_to: float
        """

        self._scale_to = scale_to

    @property
    def scale_type(self) -> str:
        """Gets the scale_type of this FarePart.


        :return: The scale_type of this FarePart.
        :rtype: str
        """
        return self._scale_type

    @scale_type.setter
    def scale_type(self, scale_type: str):
        """Sets the scale_type of this FarePart.


        :param scale_type: The scale_type of this FarePart.
        :type scale_type: str
        """
        allowed_values = ["KM", "MILE", "HOUR", "MINUTE"]  # noqa: E501
        if scale_type not in allowed_values:
            raise ValueError(
                "Invalid value for `scale_type` ({0}), must be one of {1}"
                .format(scale_type, allowed_values)
            )

        self._scale_type = scale_type

    @property
    def name(self) -> str:
        """Gets the name of this FarePart.

        an optional description of this fare part.  # noqa: E501

        :return: The name of this FarePart.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name: str):
        """Sets the name of this FarePart.

        an optional description of this fare part.  # noqa: E501

        :param name: The name of this FarePart.
        :type name: str
        """

        self._name = name

    @property
    def _class(self) -> str:
        """Gets the _class of this FarePart.

        class of this fare part. Could be FARE or ANCILLARY  # noqa: E501

        :return: The _class of this FarePart.
        :rtype: str
        """
        return self.__class

    @_class.setter
    def _class(self, _class: str):
        """Sets the _class of this FarePart.

        class of this fare part. Could be FARE or ANCILLARY  # noqa: E501

        :param _class: The _class of this FarePart.
        :type _class: str
        """
        allowed_values = ["FARE", "ANCILLARY"]  # noqa: E501
        if _class not in allowed_values:
            raise ValueError(
                "Invalid value for `_class` ({0}), must be one of {1}"
                .format(_class, allowed_values)
            )

        self.__class = _class

    @property
    def meta(self) -> Dict:
        """Gets the meta of this FarePart.


        :return: The meta of this FarePart.
        :rtype: Dict
        """
        return self._meta

    @meta.setter
    def meta(self, meta: Dict):
        """Sets the meta of this FarePart.


        :param meta: The meta of this FarePart.
        :type meta: Dict
        """

        self._meta = meta
