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

"""
    pepipost.models.mfrom

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io )
"""


class From(object):

    """Implementation of the 'From' model.

    TODO: type model description here.

    Attributes:
        from_email (string): TODO: type description here.
        from_name (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "from_email":'fromEmail',
        "from_name":'fromName'
    }

    def __init__(self,
                 from_email=None,
                 from_name=None):
        """Constructor for the From class"""

        # Initialize members of the class
        self.from_email = from_email
        self.from_name = from_name


    @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
        from_email = dictionary.get('fromEmail')
        from_name = dictionary.get('fromName')

        # Return an object of this model
        return cls(from_email,
                   from_name)


