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

"""
coingeckopublicapiv3

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


class CommunityData1(object):

    """Implementation of the 'CommunityData1' model.

    coin community data

    Attributes:
        facebook_likes (float): coin facebook likes
        reddit_average_posts_48_h (float): coin reddit average posts 48h
        reddit_average_comments_48_h (float): coin reddit average comments 48h
        reddit_subscribers (float): coin reddit subscribers
        reddit_accounts_active_48_h (float): coin reddit accounts active 48h

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "facebook_likes": 'facebook_likes',
        "reddit_average_posts_48_h": 'reddit_average_posts_48h',
        "reddit_average_comments_48_h": 'reddit_average_comments_48h',
        "reddit_subscribers": 'reddit_subscribers',
        "reddit_accounts_active_48_h": 'reddit_accounts_active_48h'
    }

    _optionals = [
        'facebook_likes',
        'reddit_average_posts_48_h',
        'reddit_average_comments_48_h',
        'reddit_subscribers',
        'reddit_accounts_active_48_h',
    ]

    def __init__(self,
                 facebook_likes=APIHelper.SKIP,
                 reddit_average_posts_48_h=APIHelper.SKIP,
                 reddit_average_comments_48_h=APIHelper.SKIP,
                 reddit_subscribers=APIHelper.SKIP,
                 reddit_accounts_active_48_h=APIHelper.SKIP):
        """Constructor for the CommunityData1 class"""

        # Initialize members of the class
        if facebook_likes is not APIHelper.SKIP:
            self.facebook_likes = facebook_likes 
        if reddit_average_posts_48_h is not APIHelper.SKIP:
            self.reddit_average_posts_48_h = reddit_average_posts_48_h 
        if reddit_average_comments_48_h is not APIHelper.SKIP:
            self.reddit_average_comments_48_h = reddit_average_comments_48_h 
        if reddit_subscribers is not APIHelper.SKIP:
            self.reddit_subscribers = reddit_subscribers 
        if reddit_accounts_active_48_h is not APIHelper.SKIP:
            self.reddit_accounts_active_48_h = reddit_accounts_active_48_h 

    @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
        facebook_likes = dictionary.get("facebook_likes") if dictionary.get("facebook_likes") else APIHelper.SKIP
        reddit_average_posts_48_h = dictionary.get("reddit_average_posts_48h") if dictionary.get("reddit_average_posts_48h") else APIHelper.SKIP
        reddit_average_comments_48_h = dictionary.get("reddit_average_comments_48h") if dictionary.get("reddit_average_comments_48h") else APIHelper.SKIP
        reddit_subscribers = dictionary.get("reddit_subscribers") if dictionary.get("reddit_subscribers") else APIHelper.SKIP
        reddit_accounts_active_48_h = dictionary.get("reddit_accounts_active_48h") if dictionary.get("reddit_accounts_active_48h") else APIHelper.SKIP
        # Return an object of this model
        return cls(facebook_likes,
                   reddit_average_posts_48_h,
                   reddit_average_comments_48_h,
                   reddit_subscribers,
                   reddit_accounts_active_48_h)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'facebook_likes={(self.facebook_likes if hasattr(self, "facebook_likes") else None)!r}, '
                f'reddit_average_posts_48_h={(self.reddit_average_posts_48_h if hasattr(self, "reddit_average_posts_48_h") else None)!r}, '
                f'reddit_average_comments_48_h={(self.reddit_average_comments_48_h if hasattr(self, "reddit_average_comments_48_h") else None)!r}, '
                f'reddit_subscribers={(self.reddit_subscribers if hasattr(self, "reddit_subscribers") else None)!r}, '
                f'reddit_accounts_active_48_h={(self.reddit_accounts_active_48_h if hasattr(self, "reddit_accounts_active_48_h") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'facebook_likes={(self.facebook_likes if hasattr(self, "facebook_likes") else None)!s}, '
                f'reddit_average_posts_48_h={(self.reddit_average_posts_48_h if hasattr(self, "reddit_average_posts_48_h") else None)!s}, '
                f'reddit_average_comments_48_h={(self.reddit_average_comments_48_h if hasattr(self, "reddit_average_comments_48_h") else None)!s}, '
                f'reddit_subscribers={(self.reddit_subscribers if hasattr(self, "reddit_subscribers") else None)!s}, '
                f'reddit_accounts_active_48_h={(self.reddit_accounts_active_48_h if hasattr(self, "reddit_accounts_active_48_h") else None)!s})')
