# -*- coding: utf-8 -*-


class TransactionID(object):

    """Implementation of the 'TransactionID' model.

    Transaction ID type which contains both the unique Earthport transaction
    ID and the merchant supplied transaction ID.

    Attributes:
        ep_transaction_id (long|int): The payment ID generated by EPS.
        merchant_transaction_id (string): The unique reference of a
            transaction provided by the merchant.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "ep_transaction_id":'epTransactionID',
        "merchant_transaction_id":'merchantTransactionID'
    }

    def __init__(self,
                 ep_transaction_id=None,
                 merchant_transaction_id=None):
        """Constructor for the TransactionID class"""

        # Initialize members of the class
        self.ep_transaction_id = ep_transaction_id
        self.merchant_transaction_id = merchant_transaction_id


    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object as
            obtained from the deserialization of the server's response. The keys
            MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        ep_transaction_id = dictionary.get('epTransactionID')
        merchant_transaction_id = dictionary.get('merchantTransactionID')

        # Return an object of this model
        return cls(ep_transaction_id,
                   merchant_transaction_id)


