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

"""
coingeckopublicapiv3

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


class CodeAdditionsDeletions4Weeks1(object):

    """Implementation of the 'CodeAdditionsDeletions4Weeks1' model.

    coin code additions deletions 4 weeks

    Attributes:
        additions (float): The model property of type float.
        deletions (float): The model property of type float.

    """

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

    _optionals = [
        'additions',
        'deletions',
    ]

    def __init__(self,
                 additions=APIHelper.SKIP,
                 deletions=APIHelper.SKIP):
        """Constructor for the CodeAdditionsDeletions4Weeks1 class"""

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

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

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'additions={(self.additions if hasattr(self, "additions") else None)!r}, '
                f'deletions={(self.deletions if hasattr(self, "deletions") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'additions={(self.additions if hasattr(self, "additions") else None)!s}, '
                f'deletions={(self.deletions if hasattr(self, "deletions") else None)!s})')
