"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.first import (
    First,
)
from visaacceptancemergedspec.models.last import (
    Last,
)
from visaacceptancemergedspec.models.next import (
    Next,
)
from visaacceptancemergedspec.models.prev import (
    Prev,
)
from visaacceptancemergedspec.models.self_65 import (
    Self65,
)


class Links66(object):
    """Implementation of the 'Links66' model.

    Attributes:
        mself (Self65): The model property of type Self65.
        first (First): The model property of type First.
        prev (Prev): The model property of type Prev.
        next (Next): The model property of type Next.
        last (Last): The model property of type Last.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mself": "self",
        "first": "first",
        "prev": "prev",
        "next": "next",
        "last": "last",
    }

    _optionals = [
        "mself",
        "first",
        "prev",
        "next",
        "last",
    ]

    def __init__(
        self,
        mself=APIHelper.SKIP,
        first=APIHelper.SKIP,
        prev=APIHelper.SKIP,
        next=APIHelper.SKIP,
        last=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Links66 instance."""
        # Initialize members of the class
        if mself is not APIHelper.SKIP:
            self.mself = mself
        if first is not APIHelper.SKIP:
            self.first = first
        if prev is not APIHelper.SKIP:
            self.prev = prev
        if next is not APIHelper.SKIP:
            self.next = next
        if last is not APIHelper.SKIP:
            self.last = last

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create 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
        mself =\
            Self65.from_dictionary(
                dictionary.get("self"))\
                if "self" in dictionary.keys()\
                else APIHelper.SKIP
        first =\
            First.from_dictionary(
                dictionary.get("first"))\
                if "first" in dictionary.keys()\
                else APIHelper.SKIP
        prev =\
            Prev.from_dictionary(
                dictionary.get("prev"))\
                if "prev" in dictionary.keys()\
                else APIHelper.SKIP
        next =\
            Next.from_dictionary(
                dictionary.get("next"))\
                if "next" in dictionary.keys()\
                else APIHelper.SKIP
        last =\
            Last.from_dictionary(
                dictionary.get("last"))\
                if "last" in dictionary.keys()\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(mself,
                   first,
                   prev,
                   next,
                   last,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _mself=(
            self.mself
            if hasattr(self, "mself")
            else None
        )
        _first=(
            self.first
            if hasattr(self, "first")
            else None
        )
        _prev=(
            self.prev
            if hasattr(self, "prev")
            else None
        )
        _next=(
            self.next
            if hasattr(self, "next")
            else None
        )
        _last=(
            self.last
            if hasattr(self, "last")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"mself={_mself!r}, "
            f"first={_first!r}, "
            f"prev={_prev!r}, "
            f"next={_next!r}, "
            f"last={_last!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _mself=(
            self.mself
            if hasattr(self, "mself")
            else None
        )
        _first=(
            self.first
            if hasattr(self, "first")
            else None
        )
        _prev=(
            self.prev
            if hasattr(self, "prev")
            else None
        )
        _next=(
            self.next
            if hasattr(self, "next")
            else None
        )
        _last=(
            self.last
            if hasattr(self, "last")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"mself={_mself!s}, "
            f"first={_first!s}, "
            f"prev={_prev!s}, "
            f"next={_next!s}, "
            f"last={_last!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
