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

"""
    pepipost.models.send_email_error

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


class SendEmailError(object):

    """Implementation of the 'sendEmailError' model.

    TODO: type model description here.

    Attributes:
        error_message (string): TODO: type description here.
        error_code (int): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "error_message":'error_message',
        "error_code":'error_code'
    }

    def __init__(self,
                 error_message=None,
                 error_code=None):
        """Constructor for the SendEmailError class"""

        # Initialize members of the class
        self.error_message = error_message
        self.error_code = error_code


    @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
        error_message = dictionary.get('error_message')
        error_code = dictionary.get('error_code')

        # Return an object of this model
        return cls(error_message,
                   error_code)


