"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


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

    Attributes:
        first_name (str): The client first name to match on when searching for
            duplicates.
        last_name (str): The client last name to match on when searching for
            duplicates.
        email (str): The client email to match on when searching for duplicates.
        limit (int): Number of results to include, defaults to 100
        offset (int): Page offset, defaults to 0.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "first_name": "FirstName",
        "last_name": "LastName",
        "email": "Email",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "first_name",
        "last_name",
        "email",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        first_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        email=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetClientDuplicatesRequest instance."""
        # Initialize members of the class
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name
        if last_name is not APIHelper.SKIP:
            self.last_name = last_name
        if email is not APIHelper.SKIP:
            self.email = email
        if limit is not APIHelper.SKIP:
            self.limit = limit
        if offset is not APIHelper.SKIP:
            self.offset = offset

    @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
        first_name =\
            dictionary.get("FirstName")\
            if dictionary.get("FirstName")\
                else APIHelper.SKIP
        last_name =\
            dictionary.get("LastName")\
            if dictionary.get("LastName")\
                else APIHelper.SKIP
        email =\
            dictionary.get("Email")\
            if dictionary.get("Email")\
                else APIHelper.SKIP
        limit =\
            dictionary.get("Limit")\
            if dictionary.get("Limit")\
                else APIHelper.SKIP
        offset =\
            dictionary.get("Offset")\
            if dictionary.get("Offset")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(first_name,
                   last_name,
                   email,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"email={_email!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"email={_email!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
