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

"""
shelldatareportingapis

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


class DefaultErrorFaultDetail(object):

    """Implementation of the 'DefaultErrorFaultDetail' model.

    Details about the error

    Attributes:
        errorcode (str): Error code

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "errorcode": 'errorcode'
    }

    _optionals = [
        'errorcode',
    ]

    def __init__(self,
                 errorcode=APIHelper.SKIP):
        """Constructor for the DefaultErrorFaultDetail class"""

        # Initialize members of the class
        if errorcode is not APIHelper.SKIP:
            self.errorcode = errorcode 

    @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
        errorcode = dictionary.get("errorcode") if dictionary.get("errorcode") else APIHelper.SKIP
        # Return an object of this model
        return cls(errorcode)
