# coding: utf-8

"""
    CardPay REST API

    Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.  # noqa: E501

    OpenAPI spec version: 3.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from cardpay.model.flight import Flight  # noqa: F401,E501


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

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        "computerized_res_system": "str",
        "credit_reason_indicator": "str",
        "departure_date": "str",
        "flight": "list[Flight]",
        "is_restricted": "bool",
        "origination_code": "str",
        "passenger_name": "str",
        "ticket_change_indicator": "str",
        "ticket_number": "str",
        "travel_agency_code": "str",
        "travel_agency_name": "str",
    }

    attribute_map = {
        "computerized_res_system": "computerized_res_system",
        "credit_reason_indicator": "credit_reason_indicator",
        "departure_date": "departure_date",
        "flight": "flight",
        "is_restricted": "is_restricted",
        "origination_code": "origination_code",
        "passenger_name": "passenger_name",
        "ticket_change_indicator": "ticket_change_indicator",
        "ticket_number": "ticket_number",
        "travel_agency_code": "travel_agency_code",
        "travel_agency_name": "travel_agency_name",
    }

    def __init__(
        self,
        computerized_res_system=None,
        credit_reason_indicator=None,
        departure_date=None,
        flight=None,
        is_restricted=None,
        origination_code=None,
        passenger_name=None,
        ticket_change_indicator=None,
        ticket_number=None,
        travel_agency_code=None,
        travel_agency_name=None,
    ):  # noqa: E501
        """Flights - a model defined in Swagger"""  # noqa: E501

        self._computerized_res_system = None
        self._credit_reason_indicator = None
        self._departure_date = None
        self._flight = None
        self._is_restricted = None
        self._origination_code = None
        self._passenger_name = None
        self._ticket_change_indicator = None
        self._ticket_number = None
        self._travel_agency_code = None
        self._travel_agency_name = None
        self.discriminator = None

        if computerized_res_system is not None:
            self.computerized_res_system = computerized_res_system
        if credit_reason_indicator is not None:
            self.credit_reason_indicator = credit_reason_indicator
        if departure_date is not None:
            self.departure_date = departure_date
        if flight is not None:
            self.flight = flight
        if is_restricted is not None:
            self.is_restricted = is_restricted
        if origination_code is not None:
            self.origination_code = origination_code
        if passenger_name is not None:
            self.passenger_name = passenger_name
        if ticket_change_indicator is not None:
            self.ticket_change_indicator = ticket_change_indicator
        if ticket_number is not None:
            self.ticket_number = ticket_number
        if travel_agency_code is not None:
            self.travel_agency_code = travel_agency_code
        if travel_agency_name is not None:
            self.travel_agency_name = travel_agency_name

    @property
    def computerized_res_system(self):
        """Gets the computerized_res_system of this Flights.  # noqa: E501

        Computerized reservation system code  # noqa: E501

        :return: The computerized_res_system of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._computerized_res_system

    @computerized_res_system.setter
    def computerized_res_system(self, computerized_res_system):
        """Sets the computerized_res_system of this Flights.

        Computerized reservation system code  # noqa: E501

        :param computerized_res_system: The computerized_res_system of this Flights.  # noqa: E501
        :type: str
        """
        if computerized_res_system is not None and len(computerized_res_system) > 4:
            raise ValueError(
                "Invalid value for `computerized_res_system`, length must be less than or equal to `4`"
            )  # noqa: E501
        if computerized_res_system is not None and len(computerized_res_system) < 0:
            raise ValueError(
                "Invalid value for `computerized_res_system`, length must be greater than or equal to `0`"
            )  # noqa: E501

        self._computerized_res_system = computerized_res_system

    @property
    def credit_reason_indicator(self):
        """Gets the credit_reason_indicator of this Flights.  # noqa: E501

        Credit reason indicator  # noqa: E501

        :return: The credit_reason_indicator of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._credit_reason_indicator

    @credit_reason_indicator.setter
    def credit_reason_indicator(self, credit_reason_indicator):
        """Sets the credit_reason_indicator of this Flights.

        Credit reason indicator  # noqa: E501

        :param credit_reason_indicator: The credit_reason_indicator of this Flights.  # noqa: E501
        :type: str
        """
        if credit_reason_indicator is not None and len(credit_reason_indicator) > 1:
            raise ValueError(
                "Invalid value for `credit_reason_indicator`, length must be less than or equal to `1`"
            )  # noqa: E501
        if credit_reason_indicator is not None and len(credit_reason_indicator) < 1:
            raise ValueError(
                "Invalid value for `credit_reason_indicator`, length must be greater than or equal to `1`"
            )  # noqa: E501

        self._credit_reason_indicator = credit_reason_indicator

    @property
    def departure_date(self):
        """Gets the departure_date of this Flights.  # noqa: E501

        Date of departure in format 'DD.MM.YYYY'  # noqa: E501

        :return: The departure_date of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._departure_date

    @departure_date.setter
    def departure_date(self, departure_date):
        """Sets the departure_date of this Flights.

        Date of departure in format 'DD.MM.YYYY'  # noqa: E501

        :param departure_date: The departure_date of this Flights.  # noqa: E501
        :type: str
        """

        self._departure_date = departure_date

    @property
    def flight(self):
        """Gets the flight of this Flights.  # noqa: E501

        Information about particular flight legs, shouldn't have more than 4 flight subsections in one flights section.  # noqa: E501

        :return: The flight of this Flights.  # noqa: E501
        :rtype: list[Flight]
        """
        return self._flight

    @flight.setter
    def flight(self, flight):
        """Sets the flight of this Flights.

        Information about particular flight legs, shouldn't have more than 4 flight subsections in one flights section.  # noqa: E501

        :param flight: The flight of this Flights.  # noqa: E501
        :type: list[Flight]
        """

        self._flight = flight

    @property
    def is_restricted(self):
        """Gets the is_restricted of this Flights.  # noqa: E501

        Restricted ticket indicator  # noqa: E501

        :return: The is_restricted of this Flights.  # noqa: E501
        :rtype: bool
        """
        return self._is_restricted

    @is_restricted.setter
    def is_restricted(self, is_restricted):
        """Sets the is_restricted of this Flights.

        Restricted ticket indicator  # noqa: E501

        :param is_restricted: The is_restricted of this Flights.  # noqa: E501
        :type: bool
        """

        self._is_restricted = is_restricted

    @property
    def origination_code(self):
        """Gets the origination_code of this Flights.  # noqa: E501

        Code of airport of departure, IATA code  # noqa: E501

        :return: The origination_code of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._origination_code

    @origination_code.setter
    def origination_code(self, origination_code):
        """Sets the origination_code of this Flights.

        Code of airport of departure, IATA code  # noqa: E501

        :param origination_code: The origination_code of this Flights.  # noqa: E501
        :type: str
        """
        if origination_code is not None and len(origination_code) > 3:
            raise ValueError(
                "Invalid value for `origination_code`, length must be less than or equal to `3`"
            )  # noqa: E501
        if origination_code is not None and len(origination_code) < 3:
            raise ValueError(
                "Invalid value for `origination_code`, length must be greater than or equal to `3`"
            )  # noqa: E501

        self._origination_code = origination_code

    @property
    def passenger_name(self):
        """Gets the passenger_name of this Flights.  # noqa: E501

        First and last name of a passenger  # noqa: E501

        :return: The passenger_name of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._passenger_name

    @passenger_name.setter
    def passenger_name(self, passenger_name):
        """Sets the passenger_name of this Flights.

        First and last name of a passenger  # noqa: E501

        :param passenger_name: The passenger_name of this Flights.  # noqa: E501
        :type: str
        """
        if passenger_name is not None and len(passenger_name) > 20:
            raise ValueError(
                "Invalid value for `passenger_name`, length must be less than or equal to `20`"
            )  # noqa: E501
        if passenger_name is not None and len(passenger_name) < 0:
            raise ValueError(
                "Invalid value for `passenger_name`, length must be greater than or equal to `0`"
            )  # noqa: E501

        self._passenger_name = passenger_name

    @property
    def ticket_change_indicator(self):
        """Gets the ticket_change_indicator of this Flights.  # noqa: E501

        Ticket change indicator  # noqa: E501

        :return: The ticket_change_indicator of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._ticket_change_indicator

    @ticket_change_indicator.setter
    def ticket_change_indicator(self, ticket_change_indicator):
        """Sets the ticket_change_indicator of this Flights.

        Ticket change indicator  # noqa: E501

        :param ticket_change_indicator: The ticket_change_indicator of this Flights.  # noqa: E501
        :type: str
        """
        if ticket_change_indicator is not None and len(ticket_change_indicator) > 1:
            raise ValueError(
                "Invalid value for `ticket_change_indicator`, length must be less than or equal to `1`"
            )  # noqa: E501
        if ticket_change_indicator is not None and len(ticket_change_indicator) < 1:
            raise ValueError(
                "Invalid value for `ticket_change_indicator`, length must be greater than or equal to `1`"
            )  # noqa: E501

        self._ticket_change_indicator = ticket_change_indicator

    @property
    def ticket_number(self):
        """Gets the ticket_number of this Flights.  # noqa: E501

        Ticket number  # noqa: E501

        :return: The ticket_number of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._ticket_number

    @ticket_number.setter
    def ticket_number(self, ticket_number):
        """Sets the ticket_number of this Flights.

        Ticket number  # noqa: E501

        :param ticket_number: The ticket_number of this Flights.  # noqa: E501
        :type: str
        """
        if ticket_number is not None and len(ticket_number) > 15:
            raise ValueError(
                "Invalid value for `ticket_number`, length must be less than or equal to `15`"
            )  # noqa: E501
        if ticket_number is not None and len(ticket_number) < 0:
            raise ValueError(
                "Invalid value for `ticket_number`, length must be greater than or equal to `0`"
            )  # noqa: E501

        self._ticket_number = ticket_number

    @property
    def travel_agency_code(self):
        """Gets the travel_agency_code of this Flights.  # noqa: E501

        Code of travel agency  # noqa: E501

        :return: The travel_agency_code of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._travel_agency_code

    @travel_agency_code.setter
    def travel_agency_code(self, travel_agency_code):
        """Sets the travel_agency_code of this Flights.

        Code of travel agency  # noqa: E501

        :param travel_agency_code: The travel_agency_code of this Flights.  # noqa: E501
        :type: str
        """
        if travel_agency_code is not None and len(travel_agency_code) > 8:
            raise ValueError(
                "Invalid value for `travel_agency_code`, length must be less than or equal to `8`"
            )  # noqa: E501
        if travel_agency_code is not None and len(travel_agency_code) < 0:
            raise ValueError(
                "Invalid value for `travel_agency_code`, length must be greater than or equal to `0`"
            )  # noqa: E501

        self._travel_agency_code = travel_agency_code

    @property
    def travel_agency_name(self):
        """Gets the travel_agency_name of this Flights.  # noqa: E501

        Name of travel agency using only latin alphabet  # noqa: E501

        :return: The travel_agency_name of this Flights.  # noqa: E501
        :rtype: str
        """
        return self._travel_agency_name

    @travel_agency_name.setter
    def travel_agency_name(self, travel_agency_name):
        """Sets the travel_agency_name of this Flights.

        Name of travel agency using only latin alphabet  # noqa: E501

        :param travel_agency_name: The travel_agency_name of this Flights.  # noqa: E501
        :type: str
        """
        if travel_agency_name is not None and len(travel_agency_name) > 25:
            raise ValueError(
                "Invalid value for `travel_agency_name`, length must be less than or equal to `25`"
            )  # noqa: E501
        if travel_agency_name is not None and len(travel_agency_name) < 0:
            raise ValueError(
                "Invalid value for `travel_agency_name`, length must be greater than or equal to `0`"
            )  # noqa: E501

        self._travel_agency_name = travel_agency_name

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(
                    map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)
                )
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(
                    map(
                        lambda item: (item[0], item[1].to_dict())
                        if hasattr(item[1], "to_dict")
                        else item,
                        value.items(),
                    )
                )
            else:
                if value is not None:
                    result[attr] = value
        if issubclass(Flights, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, Flights):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
