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

"""
    easybimehlanding

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

import easybimehlanding.models.target_site

class Exception(object):

    """Implementation of the 'Exception' model.

    با توجه به API ممکن از تغییر کند

    Attributes:
        date_time (string): TODO: type description here.
        message (string): TODO: type description here.
        help_link (string): TODO: type description here.
        source (string): TODO: type description here.
        stack_trace (string): TODO: type description here.
        target_site (TargetSite): TODO: type description here.
        error_line (string): TODO: type description here.
        exception_type (string): TODO: type description here.
        exception_url (string): TODO: type description here.
        inner_exception (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "date_time":'dateTime',
        "message":'message',
        "source":'source',
        "stack_trace":'stackTrace',
        "target_site":'targetSite',
        "exception_type":'exceptionType',
        "help_link":'helpLink',
        "error_line":'errorLine',
        "exception_url":'exceptionUrl',
        "inner_exception":'innerException'
    }

    def __init__(self,
                 date_time=None,
                 message=None,
                 source=None,
                 stack_trace=None,
                 target_site=None,
                 exception_type=None,
                 help_link=None,
                 error_line=None,
                 exception_url=None,
                 inner_exception=None):
        """Constructor for the Exception class"""

        # Initialize members of the class
        self.date_time = date_time
        self.message = message
        self.help_link = help_link
        self.source = source
        self.stack_trace = stack_trace
        self.target_site = target_site
        self.error_line = error_line
        self.exception_type = exception_type
        self.exception_url = exception_url
        self.inner_exception = inner_exception


    @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
        date_time = dictionary.get('dateTime')
        message = dictionary.get('message')
        source = dictionary.get('source')
        stack_trace = dictionary.get('stackTrace')
        target_site = easybimehlanding.models.target_site.TargetSite.from_dictionary(dictionary.get('targetSite')) if dictionary.get('targetSite') else None
        exception_type = dictionary.get('exceptionType')
        help_link = dictionary.get('helpLink')
        error_line = dictionary.get('errorLine')
        exception_url = dictionary.get('exceptionUrl')
        inner_exception = dictionary.get('innerException')

        # Return an object of this model
        return cls(date_time,
                   message,
                   source,
                   stack_trace,
                   target_site,
                   exception_type,
                   help_link,
                   error_line,
                   exception_url,
                   inner_exception)


