# 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 Ptsv2paymentsTravelInformation(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 = {
        'duration': 'str',
        'agency': 'Ptsv2paymentsTravelInformationAgency',
        'auto_rental': 'Ptsv2paymentsTravelInformationAutoRental',
        'lodging': 'Ptsv2paymentsTravelInformationLodging',
        'transit': 'Ptsv2paymentsTravelInformationTransit'
    }

    attribute_map = {
        'duration': 'duration',
        'agency': 'agency',
        'auto_rental': 'autoRental',
        'lodging': 'lodging',
        'transit': 'transit'
    }

    def __init__(self, duration=None, agency=None, auto_rental=None, lodging=None, transit=None):
        """
        Ptsv2paymentsTravelInformation - a model defined in Swagger
        """

        self._duration = None
        self._agency = None
        self._auto_rental = None
        self._lodging = None
        self._transit = None

        if duration is not None:
          self.duration = duration
        if agency is not None:
          self.agency = agency
        if auto_rental is not None:
          self.auto_rental = auto_rental
        if lodging is not None:
          self.lodging = lodging
        if transit is not None:
          self.transit = transit

    @property
    def duration(self):
        """
        Gets the duration of this Ptsv2paymentsTravelInformation.
        Duration of the auto rental or lodging rental.  #### Auto rental This field is supported for Visa, MasterCard, and American Express. **Important** If this field is not included when the `processingInformation.industryDataType` is auto rental, the transaction is declined. 

        :return: The duration of this Ptsv2paymentsTravelInformation.
        :rtype: str
        """
        return self._duration

    @duration.setter
    def duration(self, duration):
        """
        Sets the duration of this Ptsv2paymentsTravelInformation.
        Duration of the auto rental or lodging rental.  #### Auto rental This field is supported for Visa, MasterCard, and American Express. **Important** If this field is not included when the `processingInformation.industryDataType` is auto rental, the transaction is declined. 

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

        self._duration = duration

    @property
    def agency(self):
        """
        Gets the agency of this Ptsv2paymentsTravelInformation.

        :return: The agency of this Ptsv2paymentsTravelInformation.
        :rtype: Ptsv2paymentsTravelInformationAgency
        """
        return self._agency

    @agency.setter
    def agency(self, agency):
        """
        Sets the agency of this Ptsv2paymentsTravelInformation.

        :param agency: The agency of this Ptsv2paymentsTravelInformation.
        :type: Ptsv2paymentsTravelInformationAgency
        """

        self._agency = agency

    @property
    def auto_rental(self):
        """
        Gets the auto_rental of this Ptsv2paymentsTravelInformation.

        :return: The auto_rental of this Ptsv2paymentsTravelInformation.
        :rtype: Ptsv2paymentsTravelInformationAutoRental
        """
        return self._auto_rental

    @auto_rental.setter
    def auto_rental(self, auto_rental):
        """
        Sets the auto_rental of this Ptsv2paymentsTravelInformation.

        :param auto_rental: The auto_rental of this Ptsv2paymentsTravelInformation.
        :type: Ptsv2paymentsTravelInformationAutoRental
        """

        self._auto_rental = auto_rental

    @property
    def lodging(self):
        """
        Gets the lodging of this Ptsv2paymentsTravelInformation.

        :return: The lodging of this Ptsv2paymentsTravelInformation.
        :rtype: Ptsv2paymentsTravelInformationLodging
        """
        return self._lodging

    @lodging.setter
    def lodging(self, lodging):
        """
        Sets the lodging of this Ptsv2paymentsTravelInformation.

        :param lodging: The lodging of this Ptsv2paymentsTravelInformation.
        :type: Ptsv2paymentsTravelInformationLodging
        """

        self._lodging = lodging

    @property
    def transit(self):
        """
        Gets the transit of this Ptsv2paymentsTravelInformation.

        :return: The transit of this Ptsv2paymentsTravelInformation.
        :rtype: Ptsv2paymentsTravelInformationTransit
        """
        return self._transit

    @transit.setter
    def transit(self, transit):
        """
        Sets the transit of this Ptsv2paymentsTravelInformation.

        :param transit: The transit of this Ptsv2paymentsTravelInformation.
        :type: Ptsv2paymentsTravelInformationTransit
        """

        self._transit = transit

    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, Ptsv2paymentsTravelInformation):
            return False

        return self.__dict__ == other.__dict__

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