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

"""
coingeckopublicapiv3

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


class Links1(object):

    """Implementation of the 'Links1' model.

    NFT collection links

    Attributes:
        homepage (str): The model property of type str.
        twitter (str): The model property of type str.
        discord (str): The model property of type str.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "homepage": 'homepage',
        "twitter": 'twitter',
        "discord": 'discord'
    }

    _optionals = [
        'homepage',
        'twitter',
        'discord',
    ]

    def __init__(self,
                 homepage=APIHelper.SKIP,
                 twitter=APIHelper.SKIP,
                 discord=APIHelper.SKIP):
        """Constructor for the Links1 class"""

        # Initialize members of the class
        if homepage is not APIHelper.SKIP:
            self.homepage = homepage 
        if twitter is not APIHelper.SKIP:
            self.twitter = twitter 
        if discord is not APIHelper.SKIP:
            self.discord = discord 

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

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

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