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

"""
    greenbyteapi

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

import greenbyteapi.models.data_signal

class HighresdataResponse(object):

    """Implementation of the 'Highresdata Response' model.

    An object containing a single data point for a specific device and data
    signal.

    Attributes:
        device_id (int): The id of a device.
        data_signal (DataSignal): A data signal.
        data (dict<object, float>): One or more key value pairs with timestamp
            as key and the data measurement as value. The timestamps are in
            UTC.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "device_id":'deviceId',
        "data_signal":'dataSignal',
        "data":'data'
    }

    def __init__(self,
                 device_id=None,
                 data_signal=None,
                 data=None):
        """Constructor for the HighresdataResponse class"""

        # Initialize members of the class
        self.device_id = device_id
        self.data_signal = data_signal
        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
        device_id = dictionary.get('deviceId')
        data_signal = greenbyteapi.models.data_signal.DataSignal.from_dictionary(dictionary.get('dataSignal')) if dictionary.get('dataSignal') else None
        data = dictionary.get('data')

        # Return an object of this model
        return cls(device_id,
                   data_signal,
                   data)


