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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.company

class PropertyManagerdetailsresponse(object):

    """Implementation of the 'PropertyManagerdetailsresponse' model.

    TODO: type model description here.

    Attributes:
        message (string): text info message
        error_message (list of string): List of error messages
        is_error (bool): Is error (default = false)
        code (string): Code of message
        data (list of Company): List of models

    """

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

    def __init__(self,
                 message=None,
                 error_message=None,
                 is_error=None,
                 code=None,
                 data=None):
        """Constructor for the PropertyManagerdetailsresponse class"""

        # Initialize members of the class
        self.message = message
        self.error_message = error_message
        self.is_error = is_error
        self.code = code
        self.data = data


    @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
        message = dictionary.get('message')
        error_message = dictionary.get('errorMessage')
        is_error = dictionary.get('is_error')
        code = dictionary.get('code')
        data = None
        if dictionary.get('data') != None:
            data = list()
            for structure in dictionary.get('data'):
                data.append(apimaticcalculatorlatest.models.company.Company.from_dictionary(structure))

        # Return an object of this model
        return cls(message,
                   error_message,
                   is_error,
                   code,
                   data)


