"""mindbodypublicapi.

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

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


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

    A client record that is considered a duplicate based on matching of the client's
    first name, last name, AND email fields

    Attributes:
        id (str): The client’s ID, as configured by the business owner. This is the
            client’s barcode ID if the business owner assigns barcodes to clients.
            This ID is used throughout the Public API for client-related Public API
            calls. When used in a POST `UpdateClient` request, the `Id` is used to
            identify the client for the update.
        unique_id (int): The client’s system-generated ID at the business. This value
            cannot be changed by business owners and is always unique across all
            clients at the business. This ID is not widely used in the Public API,
            but can be used by your application to uniquely identify clients.
        first_name (str): The client’s first name.
        last_name (str): The client’s last name.
        email (str): The client’s email address.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "Id",
        "unique_id": "UniqueId",
        "first_name": "FirstName",
        "last_name": "LastName",
        "email": "Email",
    }

    _optionals = [
        "id",
        "unique_id",
        "first_name",
        "last_name",
        "email",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        unique_id=APIHelper.SKIP,
        first_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        email=APIHelper.SKIP):
        """Initialize a ClientDuplicate instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if unique_id is not APIHelper.SKIP:
            self.unique_id = unique_id
        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

    @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
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        unique_id =\
            dictionary.get("UniqueId")\
            if dictionary.get("UniqueId")\
                else APIHelper.SKIP
        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

        # Return an object of this model
        return cls(id,
                   unique_id,
                   first_name,
                   last_name,
                   email)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _unique_id=(
            self.unique_id
            if hasattr(self, "unique_id")
            else None
        )
        _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
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"unique_id={_unique_id!r}, "
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"email={_email!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _unique_id=(
            self.unique_id
            if hasattr(self, "unique_id")
            else None
        )
        _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
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"unique_id={_unique_id!s}, "
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"email={_email!s}, "
            f")"
        )
