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

"""
instagramapi

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


class TagPaginationInfo(object):

    """Implementation of the 'TagPaginationInfo' model.

    Attributes:
        deprecation_warning (str): The deprication warning, if information is
            available
        min_tag_id (str): The min ID of a tag for the next page
        next_max_id (str): Depricated. Use min_tag_id instead
        next_max_tag_id (str): The max ID of a tag for the next page
        next_min_id (str): Depricated. Use max_tag_id instead
        next_url (str): URL to retrieve next page of entries

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "deprecation_warning": 'deprecation_warning',
        "min_tag_id": 'min_tag_id',
        "next_max_id": 'next_max_id',
        "next_max_tag_id": 'next_max_tag_id',
        "next_min_id": 'next_min_id',
        "next_url": 'next_url'
    }

    _optionals = [
        'deprecation_warning',
        'min_tag_id',
        'next_max_id',
        'next_max_tag_id',
        'next_min_id',
        'next_url',
    ]

    def __init__(self,
                 deprecation_warning=APIHelper.SKIP,
                 min_tag_id=APIHelper.SKIP,
                 next_max_id=APIHelper.SKIP,
                 next_max_tag_id=APIHelper.SKIP,
                 next_min_id=APIHelper.SKIP,
                 next_url=APIHelper.SKIP):
        """Constructor for the TagPaginationInfo class"""

        # Initialize members of the class
        if deprecation_warning is not APIHelper.SKIP:
            self.deprecation_warning = deprecation_warning 
        if min_tag_id is not APIHelper.SKIP:
            self.min_tag_id = min_tag_id 
        if next_max_id is not APIHelper.SKIP:
            self.next_max_id = next_max_id 
        if next_max_tag_id is not APIHelper.SKIP:
            self.next_max_tag_id = next_max_tag_id 
        if next_min_id is not APIHelper.SKIP:
            self.next_min_id = next_min_id 
        if next_url is not APIHelper.SKIP:
            self.next_url = next_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
        deprecation_warning = dictionary.get("deprecation_warning") if dictionary.get("deprecation_warning") else APIHelper.SKIP
        min_tag_id = dictionary.get("min_tag_id") if dictionary.get("min_tag_id") else APIHelper.SKIP
        next_max_id = dictionary.get("next_max_id") if dictionary.get("next_max_id") else APIHelper.SKIP
        next_max_tag_id = dictionary.get("next_max_tag_id") if dictionary.get("next_max_tag_id") else APIHelper.SKIP
        next_min_id = dictionary.get("next_min_id") if dictionary.get("next_min_id") else APIHelper.SKIP
        next_url = dictionary.get("next_url") if dictionary.get("next_url") else APIHelper.SKIP
        # Return an object of this model
        return cls(deprecation_warning,
                   min_tag_id,
                   next_max_id,
                   next_max_tag_id,
                   next_min_id,
                   next_url)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'deprecation_warning={(self.deprecation_warning if hasattr(self, "deprecation_warning") else None)!r}, '
                f'min_tag_id={(self.min_tag_id if hasattr(self, "min_tag_id") else None)!r}, '
                f'next_max_id={(self.next_max_id if hasattr(self, "next_max_id") else None)!r}, '
                f'next_max_tag_id={(self.next_max_tag_id if hasattr(self, "next_max_tag_id") else None)!r}, '
                f'next_min_id={(self.next_min_id if hasattr(self, "next_min_id") else None)!r}, '
                f'next_url={(self.next_url if hasattr(self, "next_url") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'deprecation_warning={(self.deprecation_warning if hasattr(self, "deprecation_warning") else None)!s}, '
                f'min_tag_id={(self.min_tag_id if hasattr(self, "min_tag_id") else None)!s}, '
                f'next_max_id={(self.next_max_id if hasattr(self, "next_max_id") else None)!s}, '
                f'next_max_tag_id={(self.next_max_tag_id if hasattr(self, "next_max_tag_id") else None)!s}, '
                f'next_min_id={(self.next_min_id if hasattr(self, "next_min_id") else None)!s}, '
                f'next_url={(self.next_url if hasattr(self, "next_url") else None)!s})')
