# 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.condition import Condition  # noqa: F401,E501
from swagger_server.models.distance import Distance  # noqa: F401,E501
from swagger_server.models.duration import Duration  # noqa: F401,E501
from swagger_server.models.leg_state import LegState  # noqa: F401,E501
from swagger_server.models.suboperator import Suboperator  # noqa: F401,E501
from swagger_server.models.all_ofleg_from import AllOflegFrom  # noqa: F401,E501
from swagger_server.models.all_ofleg_to import AllOflegTo  # noqa: F401,E501
from swagger_server.models.all_ofleg_asset_type import AllOflegAssetType  # noqa: F401,E501
from swagger_server.models.all_ofleg_asset import AllOflegAsset  # noqa: F401,E501
from swagger_server.models.all_ofleg_pricing import AllOflegPricing  # noqa: F401,E501
from swagger_server.models.all_ofleg_progress_geometry import AllOflegProgressGeometry  # noqa: F401,E501
from swagger_server.models.all_ofleg_ticket import AllOflegTicket  # noqa: F401,E501
from swagger_server.models.all_ofleg_asset_access_data import AllOflegAssetAccessData  # noqa: F401,E501
from swagger_server.models.all_ofleg_all_asset_access_data import AllOflegAllAssetAccessData  # noqa: F401,E501
from swagger_server import util


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

    Do not edit the class manually.
    """
    def __init__(self, id: str=None, _from: AllOflegFrom=None, to: AllOflegTo=None, departure_time: datetime=None, arrival_time: datetime=None, traveler_reference_numbers: List[str]=None, asset_type: AllOflegAssetType=None, leg_sequence_number: int=None, asset: AllOflegAsset=None, pricing: AllOflegPricing=None, suboperator: Suboperator=None, conditions: List[Condition]=None, state: LegState=None, departure_delay: Duration=None, arrival_delay: Duration=None, distance: Distance=None, progress_geometry: AllOflegProgressGeometry=None, ticket: AllOflegTicket=None, asset_access_data: AllOflegAssetAccessData=None, all_asset_access_data: AllOflegAllAssetAccessData=None):  # noqa: E501
        """Leg - a model defined in Swagger

        :param id: The id of this Leg.  # noqa: E501
        :type id: str
        :param _from: The _from of this Leg.  # noqa: E501
        :type _from: AllOflegFrom
        :param to: The to of this Leg.  # noqa: E501
        :type to: AllOflegTo
        :param departure_time: The departure_time of this Leg.  # noqa: E501
        :type departure_time: datetime
        :param arrival_time: The arrival_time of this Leg.  # noqa: E501
        :type arrival_time: datetime
        :param traveler_reference_numbers: The traveler_reference_numbers of this Leg.  # noqa: E501
        :type traveler_reference_numbers: List[str]
        :param asset_type: The asset_type of this Leg.  # noqa: E501
        :type asset_type: AllOflegAssetType
        :param leg_sequence_number: The leg_sequence_number of this Leg.  # noqa: E501
        :type leg_sequence_number: int
        :param asset: The asset of this Leg.  # noqa: E501
        :type asset: AllOflegAsset
        :param pricing: The pricing of this Leg.  # noqa: E501
        :type pricing: AllOflegPricing
        :param suboperator: The suboperator of this Leg.  # noqa: E501
        :type suboperator: Suboperator
        :param conditions: The conditions of this Leg.  # noqa: E501
        :type conditions: List[Condition]
        :param state: The state of this Leg.  # noqa: E501
        :type state: LegState
        :param departure_delay: The departure_delay of this Leg.  # noqa: E501
        :type departure_delay: Duration
        :param arrival_delay: The arrival_delay of this Leg.  # noqa: E501
        :type arrival_delay: Duration
        :param distance: The distance of this Leg.  # noqa: E501
        :type distance: Distance
        :param progress_geometry: The progress_geometry of this Leg.  # noqa: E501
        :type progress_geometry: AllOflegProgressGeometry
        :param ticket: The ticket of this Leg.  # noqa: E501
        :type ticket: AllOflegTicket
        :param asset_access_data: The asset_access_data of this Leg.  # noqa: E501
        :type asset_access_data: AllOflegAssetAccessData
        :param all_asset_access_data: The all_asset_access_data of this Leg.  # noqa: E501
        :type all_asset_access_data: AllOflegAllAssetAccessData
        """
        self.swagger_types = {
            'id': str,
            '_from': AllOflegFrom,
            'to': AllOflegTo,
            'departure_time': datetime,
            'arrival_time': datetime,
            'traveler_reference_numbers': List[str],
            'asset_type': AllOflegAssetType,
            'leg_sequence_number': int,
            'asset': AllOflegAsset,
            'pricing': AllOflegPricing,
            'suboperator': Suboperator,
            'conditions': List[Condition],
            'state': LegState,
            'departure_delay': Duration,
            'arrival_delay': Duration,
            'distance': Distance,
            'progress_geometry': AllOflegProgressGeometry,
            'ticket': AllOflegTicket,
            'asset_access_data': AllOflegAssetAccessData,
            'all_asset_access_data': AllOflegAllAssetAccessData
        }

        self.attribute_map = {
            'id': 'id',
            '_from': 'from',
            'to': 'to',
            'departure_time': 'departureTime',
            'arrival_time': 'arrivalTime',
            'traveler_reference_numbers': 'travelerReferenceNumbers',
            'asset_type': 'assetType',
            'leg_sequence_number': 'legSequenceNumber',
            'asset': 'asset',
            'pricing': 'pricing',
            'suboperator': 'suboperator',
            'conditions': 'conditions',
            'state': 'state',
            'departure_delay': 'departureDelay',
            'arrival_delay': 'arrivalDelay',
            'distance': 'distance',
            'progress_geometry': 'progressGeometry',
            'ticket': 'ticket',
            'asset_access_data': 'assetAccessData',
            'all_asset_access_data': 'allAssetAccessData'
        }
        self._id = id
        self.__from = _from
        self._to = to
        self._departure_time = departure_time
        self._arrival_time = arrival_time
        self._traveler_reference_numbers = traveler_reference_numbers
        self._asset_type = asset_type
        self._leg_sequence_number = leg_sequence_number
        self._asset = asset
        self._pricing = pricing
        self._suboperator = suboperator
        self._conditions = conditions
        self._state = state
        self._departure_delay = departure_delay
        self._arrival_delay = arrival_delay
        self._distance = distance
        self._progress_geometry = progress_geometry
        self._ticket = ticket
        self._asset_access_data = asset_access_data
        self._all_asset_access_data = all_asset_access_data

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

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

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

        The unique identifier (TO) of this leg  # noqa: E501

        :return: The id of this Leg.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id: str):
        """Sets the id of this Leg.

        The unique identifier (TO) of this leg  # noqa: E501

        :param id: The id of this Leg.
        :type id: str
        """

        self._id = id

    @property
    def _from(self) -> AllOflegFrom:
        """Gets the _from of this Leg.

        The departure location of this leg, using this asset type  # noqa: E501

        :return: The _from of this Leg.
        :rtype: AllOflegFrom
        """
        return self.__from

    @_from.setter
    def _from(self, _from: AllOflegFrom):
        """Sets the _from of this Leg.

        The departure location of this leg, using this asset type  # noqa: E501

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

        self.__from = _from

    @property
    def to(self) -> AllOflegTo:
        """Gets the to of this Leg.

        The destination of this leg, using this asset type  # noqa: E501

        :return: The to of this Leg.
        :rtype: AllOflegTo
        """
        return self._to

    @to.setter
    def to(self, to: AllOflegTo):
        """Sets the to of this Leg.

        The destination of this leg, using this asset type  # noqa: E501

        :param to: The to of this Leg.
        :type to: AllOflegTo
        """

        self._to = to

    @property
    def departure_time(self) -> datetime:
        """Gets the departure_time of this Leg.

        The departure time of this leg  # noqa: E501

        :return: The departure_time of this Leg.
        :rtype: datetime
        """
        return self._departure_time

    @departure_time.setter
    def departure_time(self, departure_time: datetime):
        """Sets the departure_time of this Leg.

        The departure time of this leg  # noqa: E501

        :param departure_time: The departure_time of this Leg.
        :type departure_time: datetime
        """

        self._departure_time = departure_time

    @property
    def arrival_time(self) -> datetime:
        """Gets the arrival_time of this Leg.

        The intended arrival time at the to place  # noqa: E501

        :return: The arrival_time of this Leg.
        :rtype: datetime
        """
        return self._arrival_time

    @arrival_time.setter
    def arrival_time(self, arrival_time: datetime):
        """Sets the arrival_time of this Leg.

        The intended arrival time at the to place  # noqa: E501

        :param arrival_time: The arrival_time of this Leg.
        :type arrival_time: datetime
        """

        self._arrival_time = arrival_time

    @property
    def traveler_reference_numbers(self) -> List[str]:
        """Gets the traveler_reference_numbers of this Leg.

        reference to the travelers field of the request. If missing, it is refering to the first (if any). it is an array to facilitate multiple users on one leg (e.g. using a car). If multiple access informations are needed, please create a leg per used asset.  # noqa: E501

        :return: The traveler_reference_numbers of this Leg.
        :rtype: List[str]
        """
        return self._traveler_reference_numbers

    @traveler_reference_numbers.setter
    def traveler_reference_numbers(self, traveler_reference_numbers: List[str]):
        """Sets the traveler_reference_numbers of this Leg.

        reference to the travelers field of the request. If missing, it is refering to the first (if any). it is an array to facilitate multiple users on one leg (e.g. using a car). If multiple access informations are needed, please create a leg per used asset.  # noqa: E501

        :param traveler_reference_numbers: The traveler_reference_numbers of this Leg.
        :type traveler_reference_numbers: List[str]
        """

        self._traveler_reference_numbers = traveler_reference_numbers

    @property
    def asset_type(self) -> AllOflegAssetType:
        """Gets the asset_type of this Leg.

        The asset type used in this leg as determined during booking  # noqa: E501

        :return: The asset_type of this Leg.
        :rtype: AllOflegAssetType
        """
        return self._asset_type

    @asset_type.setter
    def asset_type(self, asset_type: AllOflegAssetType):
        """Sets the asset_type of this Leg.

        The asset type used in this leg as determined during booking  # noqa: E501

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

        self._asset_type = asset_type

    @property
    def leg_sequence_number(self) -> int:
        """Gets the leg_sequence_number of this Leg.

        The order of the leg in the booking. There can be multiple legs with the same sequence (different user or parallel usage (eg. parking lot and a bike)).  # noqa: E501

        :return: The leg_sequence_number of this Leg.
        :rtype: int
        """
        return self._leg_sequence_number

    @leg_sequence_number.setter
    def leg_sequence_number(self, leg_sequence_number: int):
        """Sets the leg_sequence_number of this Leg.

        The order of the leg in the booking. There can be multiple legs with the same sequence (different user or parallel usage (eg. parking lot and a bike)).  # noqa: E501

        :param leg_sequence_number: The leg_sequence_number of this Leg.
        :type leg_sequence_number: int
        """

        self._leg_sequence_number = leg_sequence_number

    @property
    def asset(self) -> AllOflegAsset:
        """Gets the asset of this Leg.

        The concrete asset used for the execution of the leg  # noqa: E501

        :return: The asset of this Leg.
        :rtype: AllOflegAsset
        """
        return self._asset

    @asset.setter
    def asset(self, asset: AllOflegAsset):
        """Sets the asset of this Leg.

        The concrete asset used for the execution of the leg  # noqa: E501

        :param asset: The asset of this Leg.
        :type asset: AllOflegAsset
        """

        self._asset = asset

    @property
    def pricing(self) -> AllOflegPricing:
        """Gets the pricing of this Leg.

        The leg-specific pricing information, all fares are additive, if the booking does not have pricing set all legs should  # noqa: E501

        :return: The pricing of this Leg.
        :rtype: AllOflegPricing
        """
        return self._pricing

    @pricing.setter
    def pricing(self, pricing: AllOflegPricing):
        """Sets the pricing of this Leg.

        The leg-specific pricing information, all fares are additive, if the booking does not have pricing set all legs should  # noqa: E501

        :param pricing: The pricing of this Leg.
        :type pricing: AllOflegPricing
        """

        self._pricing = pricing

    @property
    def suboperator(self) -> Suboperator:
        """Gets the suboperator of this Leg.


        :return: The suboperator of this Leg.
        :rtype: Suboperator
        """
        return self._suboperator

    @suboperator.setter
    def suboperator(self, suboperator: Suboperator):
        """Sets the suboperator of this Leg.


        :param suboperator: The suboperator of this Leg.
        :type suboperator: Suboperator
        """

        self._suboperator = suboperator

    @property
    def conditions(self) -> List[Condition]:
        """Gets the conditions of this Leg.

        The conditions that apply to this leg, there may be more conditions in a parent booking and planning any (if this is returned as part of those)  # noqa: E501

        :return: The conditions of this Leg.
        :rtype: List[Condition]
        """
        return self._conditions

    @conditions.setter
    def conditions(self, conditions: List[Condition]):
        """Sets the conditions of this Leg.

        The conditions that apply to this leg, there may be more conditions in a parent booking and planning any (if this is returned as part of those)  # noqa: E501

        :param conditions: The conditions of this Leg.
        :type conditions: List[Condition]
        """

        self._conditions = conditions

    @property
    def state(self) -> LegState:
        """Gets the state of this Leg.


        :return: The state of this Leg.
        :rtype: LegState
        """
        return self._state

    @state.setter
    def state(self, state: LegState):
        """Sets the state of this Leg.


        :param state: The state of this Leg.
        :type state: LegState
        """

        self._state = state

    @property
    def departure_delay(self) -> Duration:
        """Gets the departure_delay of this Leg.


        :return: The departure_delay of this Leg.
        :rtype: Duration
        """
        return self._departure_delay

    @departure_delay.setter
    def departure_delay(self, departure_delay: Duration):
        """Sets the departure_delay of this Leg.


        :param departure_delay: The departure_delay of this Leg.
        :type departure_delay: Duration
        """

        self._departure_delay = departure_delay

    @property
    def arrival_delay(self) -> Duration:
        """Gets the arrival_delay of this Leg.


        :return: The arrival_delay of this Leg.
        :rtype: Duration
        """
        return self._arrival_delay

    @arrival_delay.setter
    def arrival_delay(self, arrival_delay: Duration):
        """Sets the arrival_delay of this Leg.


        :param arrival_delay: The arrival_delay of this Leg.
        :type arrival_delay: Duration
        """

        self._arrival_delay = arrival_delay

    @property
    def distance(self) -> Distance:
        """Gets the distance of this Leg.


        :return: The distance of this Leg.
        :rtype: Distance
        """
        return self._distance

    @distance.setter
    def distance(self, distance: Distance):
        """Sets the distance of this Leg.


        :param distance: The distance of this Leg.
        :type distance: Distance
        """

        self._distance = distance

    @property
    def progress_geometry(self) -> AllOflegProgressGeometry:
        """Gets the progress_geometry of this Leg.

        A list of coordinates describing the progress so far along the leg, as GeoJSON LineString coordinates  # noqa: E501

        :return: The progress_geometry of this Leg.
        :rtype: AllOflegProgressGeometry
        """
        return self._progress_geometry

    @progress_geometry.setter
    def progress_geometry(self, progress_geometry: AllOflegProgressGeometry):
        """Sets the progress_geometry of this Leg.

        A list of coordinates describing the progress so far along the leg, as GeoJSON LineString coordinates  # noqa: E501

        :param progress_geometry: The progress_geometry of this Leg.
        :type progress_geometry: AllOflegProgressGeometry
        """

        self._progress_geometry = progress_geometry

    @property
    def ticket(self) -> AllOflegTicket:
        """Gets the ticket of this Leg.

        The MaaS user's proof of their right to travel on this leg  # noqa: E501

        :return: The ticket of this Leg.
        :rtype: AllOflegTicket
        """
        return self._ticket

    @ticket.setter
    def ticket(self, ticket: AllOflegTicket):
        """Sets the ticket of this Leg.

        The MaaS user's proof of their right to travel on this leg  # noqa: E501

        :param ticket: The ticket of this Leg.
        :type ticket: AllOflegTicket
        """

        self._ticket = ticket

    @property
    def asset_access_data(self) -> AllOflegAssetAccessData:
        """Gets the asset_access_data of this Leg.

        Data to open a specific asset (e.g. QR code, image base64)  # noqa: E501

        :return: The asset_access_data of this Leg.
        :rtype: AllOflegAssetAccessData
        """
        return self._asset_access_data

    @asset_access_data.setter
    def asset_access_data(self, asset_access_data: AllOflegAssetAccessData):
        """Sets the asset_access_data of this Leg.

        Data to open a specific asset (e.g. QR code, image base64)  # noqa: E501

        :param asset_access_data: The asset_access_data of this Leg.
        :type asset_access_data: AllOflegAssetAccessData
        """

        self._asset_access_data = asset_access_data

    @property
    def all_asset_access_data(self) -> AllOflegAllAssetAccessData:
        """Gets the all_asset_access_data of this Leg.

        Array of data to open a specific asset (e.g. QR code, image base64)  # noqa: E501

        :return: The all_asset_access_data of this Leg.
        :rtype: AllOflegAllAssetAccessData
        """
        return self._all_asset_access_data

    @all_asset_access_data.setter
    def all_asset_access_data(self, all_asset_access_data: AllOflegAllAssetAccessData):
        """Sets the all_asset_access_data of this Leg.

        Array of data to open a specific asset (e.g. QR code, image base64)  # noqa: E501

        :param all_asset_access_data: The all_asset_access_data of this Leg.
        :type all_asset_access_data: AllOflegAllAssetAccessData
        """

        self._all_asset_access_data = all_asset_access_data
