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

"""
coingeckopublicapiv3

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


class Links(object):

    """Implementation of the 'Links' model.

    links

    Attributes:
        homepage (List[str]): coin website url
        whitepaper (List[str]): coin whitepaper url
        blockchain_site (List[str]): coin block explorer url
        official_forum_url (List[str]): coin official forum url
        chat_url (List[str]): coin chat url
        announcement_url (List[str]): coin announcement url
        snapshot_url (str): coin snapshot url
        twitter_screen_name (str): coin twitter handle
        facebook_username (str): coin facebook username
        bitcointalk_thread_identifier (str): coin bitcointalk thread identifier
        telegram_channel_identifier (str): coin telegram channel identifier
        subreddit_url (str): coin subreddit url
        repos_url (ReposUrl): coin repository url

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "homepage": 'homepage',
        "whitepaper": 'whitepaper',
        "blockchain_site": 'blockchain_site',
        "official_forum_url": 'official_forum_url',
        "chat_url": 'chat_url',
        "announcement_url": 'announcement_url',
        "snapshot_url": 'snapshot_url',
        "twitter_screen_name": 'twitter_screen_name',
        "facebook_username": 'facebook_username',
        "bitcointalk_thread_identifier": 'bitcointalk_thread_identifier',
        "telegram_channel_identifier": 'telegram_channel_identifier',
        "subreddit_url": 'subreddit_url',
        "repos_url": 'repos_url'
    }

    _optionals = [
        'homepage',
        'whitepaper',
        'blockchain_site',
        'official_forum_url',
        'chat_url',
        'announcement_url',
        'snapshot_url',
        'twitter_screen_name',
        'facebook_username',
        'bitcointalk_thread_identifier',
        'telegram_channel_identifier',
        'subreddit_url',
        'repos_url',
    ]

    def __init__(self,
                 homepage=APIHelper.SKIP,
                 whitepaper=APIHelper.SKIP,
                 blockchain_site=APIHelper.SKIP,
                 official_forum_url=APIHelper.SKIP,
                 chat_url=APIHelper.SKIP,
                 announcement_url=APIHelper.SKIP,
                 snapshot_url=APIHelper.SKIP,
                 twitter_screen_name=APIHelper.SKIP,
                 facebook_username=APIHelper.SKIP,
                 bitcointalk_thread_identifier=APIHelper.SKIP,
                 telegram_channel_identifier=APIHelper.SKIP,
                 subreddit_url=APIHelper.SKIP,
                 repos_url=APIHelper.SKIP):
        """Constructor for the Links class"""

        # Initialize members of the class
        if homepage is not APIHelper.SKIP:
            self.homepage = homepage 
        if whitepaper is not APIHelper.SKIP:
            self.whitepaper = whitepaper 
        if blockchain_site is not APIHelper.SKIP:
            self.blockchain_site = blockchain_site 
        if official_forum_url is not APIHelper.SKIP:
            self.official_forum_url = official_forum_url 
        if chat_url is not APIHelper.SKIP:
            self.chat_url = chat_url 
        if announcement_url is not APIHelper.SKIP:
            self.announcement_url = announcement_url 
        if snapshot_url is not APIHelper.SKIP:
            self.snapshot_url = snapshot_url 
        if twitter_screen_name is not APIHelper.SKIP:
            self.twitter_screen_name = twitter_screen_name 
        if facebook_username is not APIHelper.SKIP:
            self.facebook_username = facebook_username 
        if bitcointalk_thread_identifier is not APIHelper.SKIP:
            self.bitcointalk_thread_identifier = bitcointalk_thread_identifier 
        if telegram_channel_identifier is not APIHelper.SKIP:
            self.telegram_channel_identifier = telegram_channel_identifier 
        if subreddit_url is not APIHelper.SKIP:
            self.subreddit_url = subreddit_url 
        if repos_url is not APIHelper.SKIP:
            self.repos_url = repos_url 

    @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
        homepage = dictionary.get("homepage") if dictionary.get("homepage") else APIHelper.SKIP
        whitepaper = dictionary.get("whitepaper") if dictionary.get("whitepaper") else APIHelper.SKIP
        blockchain_site = dictionary.get("blockchain_site") if dictionary.get("blockchain_site") else APIHelper.SKIP
        official_forum_url = dictionary.get("official_forum_url") if dictionary.get("official_forum_url") else APIHelper.SKIP
        chat_url = dictionary.get("chat_url") if dictionary.get("chat_url") else APIHelper.SKIP
        announcement_url = dictionary.get("announcement_url") if dictionary.get("announcement_url") else APIHelper.SKIP
        snapshot_url = dictionary.get("snapshot_url") if dictionary.get("snapshot_url") else APIHelper.SKIP
        twitter_screen_name = dictionary.get("twitter_screen_name") if dictionary.get("twitter_screen_name") else APIHelper.SKIP
        facebook_username = dictionary.get("facebook_username") if dictionary.get("facebook_username") else APIHelper.SKIP
        bitcointalk_thread_identifier = dictionary.get("bitcointalk_thread_identifier") if dictionary.get("bitcointalk_thread_identifier") else APIHelper.SKIP
        telegram_channel_identifier = dictionary.get("telegram_channel_identifier") if dictionary.get("telegram_channel_identifier") else APIHelper.SKIP
        subreddit_url = dictionary.get("subreddit_url") if dictionary.get("subreddit_url") else APIHelper.SKIP
        repos_url = ReposUrl.from_dictionary(dictionary.get('repos_url')) if 'repos_url' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(homepage,
                   whitepaper,
                   blockchain_site,
                   official_forum_url,
                   chat_url,
                   announcement_url,
                   snapshot_url,
                   twitter_screen_name,
                   facebook_username,
                   bitcointalk_thread_identifier,
                   telegram_channel_identifier,
                   subreddit_url,
                   repos_url)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'homepage={(self.homepage if hasattr(self, "homepage") else None)!r}, '
                f'whitepaper={(self.whitepaper if hasattr(self, "whitepaper") else None)!r}, '
                f'blockchain_site={(self.blockchain_site if hasattr(self, "blockchain_site") else None)!r}, '
                f'official_forum_url={(self.official_forum_url if hasattr(self, "official_forum_url") else None)!r}, '
                f'chat_url={(self.chat_url if hasattr(self, "chat_url") else None)!r}, '
                f'announcement_url={(self.announcement_url if hasattr(self, "announcement_url") else None)!r}, '
                f'snapshot_url={(self.snapshot_url if hasattr(self, "snapshot_url") else None)!r}, '
                f'twitter_screen_name={(self.twitter_screen_name if hasattr(self, "twitter_screen_name") else None)!r}, '
                f'facebook_username={(self.facebook_username if hasattr(self, "facebook_username") else None)!r}, '
                f'bitcointalk_thread_identifier={(self.bitcointalk_thread_identifier if hasattr(self, "bitcointalk_thread_identifier") else None)!r}, '
                f'telegram_channel_identifier={(self.telegram_channel_identifier if hasattr(self, "telegram_channel_identifier") else None)!r}, '
                f'subreddit_url={(self.subreddit_url if hasattr(self, "subreddit_url") else None)!r}, '
                f'repos_url={(self.repos_url if hasattr(self, "repos_url") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'homepage={(self.homepage if hasattr(self, "homepage") else None)!s}, '
                f'whitepaper={(self.whitepaper if hasattr(self, "whitepaper") else None)!s}, '
                f'blockchain_site={(self.blockchain_site if hasattr(self, "blockchain_site") else None)!s}, '
                f'official_forum_url={(self.official_forum_url if hasattr(self, "official_forum_url") else None)!s}, '
                f'chat_url={(self.chat_url if hasattr(self, "chat_url") else None)!s}, '
                f'announcement_url={(self.announcement_url if hasattr(self, "announcement_url") else None)!s}, '
                f'snapshot_url={(self.snapshot_url if hasattr(self, "snapshot_url") else None)!s}, '
                f'twitter_screen_name={(self.twitter_screen_name if hasattr(self, "twitter_screen_name") else None)!s}, '
                f'facebook_username={(self.facebook_username if hasattr(self, "facebook_username") else None)!s}, '
                f'bitcointalk_thread_identifier={(self.bitcointalk_thread_identifier if hasattr(self, "bitcointalk_thread_identifier") else None)!s}, '
                f'telegram_channel_identifier={(self.telegram_channel_identifier if hasattr(self, "telegram_channel_identifier") else None)!s}, '
                f'subreddit_url={(self.subreddit_url if hasattr(self, "subreddit_url") else None)!s}, '
                f'repos_url={(self.repos_url if hasattr(self, "repos_url") else None)!s})')
