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

"""
uexcorpapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from uexcorpapi.api_helper import APIHelper
from uexcorpapi.models.data_5 import Data5


class Ok31(object):

    """Implementation of the 'OK31' model.

    Attributes:
        data (List[Data5]): The model property of type List[Data5].
        http_code (str): The model property of type str.
        message (str): The model property of type str.
        status (str): The model property of type str.
        additional_properties (Dict[str, Any]): The additional properties for
            the model.

    """

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

    def __init__(self,
                 data=None,
                 http_code=None,
                 message=None,
                 status=None,
                 additional_properties=None):
        """Constructor for the Ok31 class"""

        # Initialize members of the class
        self.data = data 
        self.http_code = http_code 
        self.message = message 
        self.status = status 

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        data = None
        if dictionary.get('data') is not None:
            data = [Data5.from_dictionary(x) for x in dictionary.get('data')]
        http_code = dictionary.get("http_code") if dictionary.get("http_code") else None
        message = dictionary.get("message") if dictionary.get("message") else None
        status = dictionary.get("status") if dictionary.get("status") else None
        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items() if k not in cls._names.values()},
            unboxing_function=lambda value: value)
        # Return an object of this model
        return cls(data,
                   http_code,
                   message,
                   status,
                   additional_properties)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'data={self.data!r}, '
                f'http_code={self.http_code!r}, '
                f'message={self.message!r}, '
                f'status={self.status!r}, '
                f'additional_properties={self.additional_properties!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'data={self.data!s}, '
                f'http_code={self.http_code!s}, '
                f'message={self.message!s}, '
                f'status={self.status!s}, '
                f'additional_properties={self.additional_properties!s})')
