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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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


class Meta(object):

    """Implementation of the 'Meta' model.

    Attributes:
        analyzer_version (str): The version of the Analyzer used to analyze
            this track.
        platform (str): The platform used to read the track's audio data.
        detailed_status (str): A detailed status code for this track. If
            analysis data is missing, this code may explain why.
        status_code (int): The return code of the analyzer process. 0 if
            successful, 1 if any errors occurred.
        timestamp (int): The Unix timestamp (in seconds) at which this track
            was analyzed.
        analysis_time (float): The amount of time taken to analyze this track.
        input_process (str): The method used to read the track's audio data.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "analyzer_version": 'analyzer_version',
        "platform": 'platform',
        "detailed_status": 'detailed_status',
        "status_code": 'status_code',
        "timestamp": 'timestamp',
        "analysis_time": 'analysis_time',
        "input_process": 'input_process'
    }

    _optionals = [
        'analyzer_version',
        'platform',
        'detailed_status',
        'status_code',
        'timestamp',
        'analysis_time',
        'input_process',
    ]

    def __init__(self,
                 analyzer_version=APIHelper.SKIP,
                 platform=APIHelper.SKIP,
                 detailed_status=APIHelper.SKIP,
                 status_code=APIHelper.SKIP,
                 timestamp=APIHelper.SKIP,
                 analysis_time=APIHelper.SKIP,
                 input_process=APIHelper.SKIP):
        """Constructor for the Meta class"""

        # Initialize members of the class
        if analyzer_version is not APIHelper.SKIP:
            self.analyzer_version = analyzer_version 
        if platform is not APIHelper.SKIP:
            self.platform = platform 
        if detailed_status is not APIHelper.SKIP:
            self.detailed_status = detailed_status 
        if status_code is not APIHelper.SKIP:
            self.status_code = status_code 
        if timestamp is not APIHelper.SKIP:
            self.timestamp = timestamp 
        if analysis_time is not APIHelper.SKIP:
            self.analysis_time = analysis_time 
        if input_process is not APIHelper.SKIP:
            self.input_process = input_process 

    @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
        analyzer_version = dictionary.get("analyzer_version") if dictionary.get("analyzer_version") else APIHelper.SKIP
        platform = dictionary.get("platform") if dictionary.get("platform") else APIHelper.SKIP
        detailed_status = dictionary.get("detailed_status") if dictionary.get("detailed_status") else APIHelper.SKIP
        status_code = dictionary.get("status_code") if dictionary.get("status_code") else APIHelper.SKIP
        timestamp = dictionary.get("timestamp") if dictionary.get("timestamp") else APIHelper.SKIP
        analysis_time = dictionary.get("analysis_time") if dictionary.get("analysis_time") else APIHelper.SKIP
        input_process = dictionary.get("input_process") if dictionary.get("input_process") else APIHelper.SKIP
        # Return an object of this model
        return cls(analyzer_version,
                   platform,
                   detailed_status,
                   status_code,
                   timestamp,
                   analysis_time,
                   input_process)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'analyzer_version={(self.analyzer_version if hasattr(self, "analyzer_version") else None)!r}, '
                f'platform={(self.platform if hasattr(self, "platform") else None)!r}, '
                f'detailed_status={(self.detailed_status if hasattr(self, "detailed_status") else None)!r}, '
                f'status_code={(self.status_code if hasattr(self, "status_code") else None)!r}, '
                f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!r}, '
                f'analysis_time={(self.analysis_time if hasattr(self, "analysis_time") else None)!r}, '
                f'input_process={(self.input_process if hasattr(self, "input_process") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'analyzer_version={(self.analyzer_version if hasattr(self, "analyzer_version") else None)!s}, '
                f'platform={(self.platform if hasattr(self, "platform") else None)!s}, '
                f'detailed_status={(self.detailed_status if hasattr(self, "detailed_status") else None)!s}, '
                f'status_code={(self.status_code if hasattr(self, "status_code") else None)!s}, '
                f'timestamp={(self.timestamp if hasattr(self, "timestamp") else None)!s}, '
                f'analysis_time={(self.analysis_time if hasattr(self, "analysis_time") else None)!s}, '
                f'input_process={(self.input_process if hasattr(self, "input_process") else None)!s})')
