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

"""
coingeckopublicapiv3

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


class ReposUrl(object):

    """Implementation of the 'ReposUrl' model.

    coin repository url

    Attributes:
        github (List[str]): coin github repository url
        bitbucket (List[str]): coin bitbucket repository url

    """

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

    _optionals = [
        'github',
        'bitbucket',
    ]

    def __init__(self,
                 github=APIHelper.SKIP,
                 bitbucket=APIHelper.SKIP):
        """Constructor for the ReposUrl class"""

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

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

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

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