# coding: utf-8

"""
    CyberSource Merged Spec

    All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html

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


from pprint import pformat
from six import iteritems
import re


class Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation(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 = {
        'ticket_number': 'str',
        'passenger_name': 'str',
        'connected_ticket_number': 'str',
        'credit_reason_indicator': 'str',
        'service': 'list[Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformationService]'
    }

    attribute_map = {
        'ticket_number': 'ticketNumber',
        'passenger_name': 'passengerName',
        'connected_ticket_number': 'connectedTicketNumber',
        'credit_reason_indicator': 'creditReasonIndicator',
        'service': 'service'
    }

    def __init__(self, ticket_number=None, passenger_name=None, connected_ticket_number=None, credit_reason_indicator=None, service=None):
        """
        Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation - a model defined in Swagger
        """

        self._ticket_number = None
        self._passenger_name = None
        self._connected_ticket_number = None
        self._credit_reason_indicator = None
        self._service = None

        if ticket_number is not None:
          self.ticket_number = ticket_number
        if passenger_name is not None:
          self.passenger_name = passenger_name
        if connected_ticket_number is not None:
          self.connected_ticket_number = connected_ticket_number
        if credit_reason_indicator is not None:
          self.credit_reason_indicator = credit_reason_indicator
        if service is not None:
          self.service = service

    @property
    def ticket_number(self):
        """
        Gets the ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Ticket number, which consists of the carrier code, form, and serial number, without the check digit. **Important** This field is required in the U.S. in order for you to qualify for either the custom payment service (CPS) or the electronic interchange reimbursement fee (EIRF) program. Format: English characters only. Optional field for ancillary services. 

        :return: The ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :rtype: str
        """
        return self._ticket_number

    @ticket_number.setter
    def ticket_number(self, ticket_number):
        """
        Sets the ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Ticket number, which consists of the carrier code, form, and serial number, without the check digit. **Important** This field is required in the U.S. in order for you to qualify for either the custom payment service (CPS) or the electronic interchange reimbursement fee (EIRF) program. Format: English characters only. Optional field for ancillary services. 

        :param ticket_number: The ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :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`")

        self._ticket_number = ticket_number

    @property
    def passenger_name(self):
        """
        Gets the passenger_name of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Name of the passenger. If the passenger’s name is not available, this value is the cardholder’s name. If neither the passenger’s name nor the cardholder’s name is available, this value is a description of the ancillary purchase. **Important** This field is required in the U.S. in order for you to qualify for either the custom payment service (CPS) or the electronic interchange reimbursement fee (EIRF) program. Format: English characters only. Optional field for ancillary service. 

        :return: The passenger_name of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :rtype: str
        """
        return self._passenger_name

    @passenger_name.setter
    def passenger_name(self, passenger_name):
        """
        Sets the passenger_name of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Name of the passenger. If the passenger’s name is not available, this value is the cardholder’s name. If neither the passenger’s name nor the cardholder’s name is available, this value is a description of the ancillary purchase. **Important** This field is required in the U.S. in order for you to qualify for either the custom payment service (CPS) or the electronic interchange reimbursement fee (EIRF) program. Format: English characters only. Optional field for ancillary service. 

        :param passenger_name: The passenger_name of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :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`")

        self._passenger_name = passenger_name

    @property
    def connected_ticket_number(self):
        """
        Gets the connected_ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Number for the airline ticket to which the ancillary purchase is connected.  If this purchase has a connection or relationship to another purchase such as a baggage fee for a passenger transport ticket, this field must contain the ticket number for the other purchase.  For a stand-alone purchase, the value for this field must be the same as the value for the `travelInformation.transit.airline.ancillaryInformation.ticketNumber` field. **Important** This field is required in the U.S. in order for you to qualify for either the custom payment service (CPS) or the electronic interchange reimbursement fee (EIRF) program. Format: English characters only. Optional request field for ancillary services. 

        :return: The connected_ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :rtype: str
        """
        return self._connected_ticket_number

    @connected_ticket_number.setter
    def connected_ticket_number(self, connected_ticket_number):
        """
        Sets the connected_ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Number for the airline ticket to which the ancillary purchase is connected.  If this purchase has a connection or relationship to another purchase such as a baggage fee for a passenger transport ticket, this field must contain the ticket number for the other purchase.  For a stand-alone purchase, the value for this field must be the same as the value for the `travelInformation.transit.airline.ancillaryInformation.ticketNumber` field. **Important** This field is required in the U.S. in order for you to qualify for either the custom payment service (CPS) or the electronic interchange reimbursement fee (EIRF) program. Format: English characters only. Optional request field for ancillary services. 

        :param connected_ticket_number: The connected_ticket_number of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :type: str
        """
        if connected_ticket_number is not None and len(connected_ticket_number) > 15:
            raise ValueError("Invalid value for `connected_ticket_number`, length must be less than or equal to `15`")

        self._connected_ticket_number = connected_ticket_number

    @property
    def credit_reason_indicator(self):
        """
        Gets the credit_reason_indicator of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Reason for the credit. Possible values: - `A`: Cancellation of the ancillary passenger transport purchase. - `B`: Cancellation of the airline ticket and the passenger transport ancillary purchase. - `C`: Cancellation of the airline ticket. - `O`: Other. - `P`: Partial refund of the airline ticket. Format: English characters only. Optional field for ancillary services. 

        :return: The credit_reason_indicator of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :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 Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        Reason for the credit. Possible values: - `A`: Cancellation of the ancillary passenger transport purchase. - `B`: Cancellation of the airline ticket and the passenger transport ancillary purchase. - `C`: Cancellation of the airline ticket. - `O`: Other. - `P`: Partial refund of the airline ticket. Format: English characters only. Optional field for ancillary services. 

        :param credit_reason_indicator: The credit_reason_indicator of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :type: str
        """
        if credit_reason_indicator is not None and len(credit_reason_indicator) > 15:
            raise ValueError("Invalid value for `credit_reason_indicator`, length must be less than or equal to `15`")

        self._credit_reason_indicator = credit_reason_indicator

    @property
    def service(self):
        """
        Gets the service of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.

        :return: The service of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :rtype: list[Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformationService]
        """
        return self._service

    @service.setter
    def service(self, service):
        """
        Sets the service of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.

        :param service: The service of this Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation.
        :type: list[Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformationService]
        """

        self._service = service

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

        for attr, _ in 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:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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, Ptsv2paymentsTravelInformationTransitAirlineAncillaryInformation):
            return False

        return self.__dict__ == other.__dict__

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