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

"""
    pepipost.models.send_email_response

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

class SendEmailResponse(object):

    """Implementation of the 'sendEmailResponse' model.

    Response of the email

    Attributes:
        data (object): TODO: type description here.
        message (string): TODO: type description here.
        error_info (SendEmailError): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "data":'data',
        "message":'message',
        "error_info":'error_info'
    }

    def __init__(self,
                 data=None,
                 message=None,
                 error_info=None):
        """Constructor for the SendEmailResponse class"""

        # Initialize members of the class
        self.data = data
        self.message = message
        self.error_info = error_info


    @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
        data = dictionary.get('data')
        message = dictionary.get('message')
        error_info = pepipost.models.send_email_error.SendEmailError.from_dictionary(dictionary.get('error_info')) if dictionary.get('error_info') else None

        # Return an object of this model
        return cls(data,
                   message,
                   error_info)


