"""mindbodypublicapi.

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

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


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

    An individual Client Formula Note.

    Attributes:
        id (int): The formula note ID.
        client_id (str): The unique Id of the client for the formula note. This is
            the unique ID for the client in the site where the formula note
            originated. This is different than the ClientId specified in the request,
            which is the id for the client assigned by the business.
        appointment_id (int): The appointment ID that the formula note is related to.
        entry_date (datetime): The date formula note was created.
        note (str): The new formula note text.
        site_id (int): The site Id.
        site_name (str): The site name.
        staff_first_name (str): The first name of the staff for the optional
            associated appointment. If no appointment ID is provided, this will be
            null.
        staff_last_name (str): The last name of the staff for the optional associated
            appointment. If no appointment ID is provided, this will be null.
        staff_display_name (str): The display name of the staff for the optional
            associated appointment. If no appointment ID is provided, or no display
            name is specified for the staff member, this will be null.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "Id",
        "client_id": "ClientId",
        "appointment_id": "AppointmentId",
        "entry_date": "EntryDate",
        "note": "Note",
        "site_id": "SiteId",
        "site_name": "SiteName",
        "staff_first_name": "StaffFirstName",
        "staff_last_name": "StaffLastName",
        "staff_display_name": "StaffDisplayName",
    }

    _optionals = [
        "id",
        "client_id",
        "appointment_id",
        "entry_date",
        "note",
        "site_id",
        "site_name",
        "staff_first_name",
        "staff_last_name",
        "staff_display_name",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        client_id=APIHelper.SKIP,
        appointment_id=APIHelper.SKIP,
        entry_date=APIHelper.SKIP,
        note=APIHelper.SKIP,
        site_id=APIHelper.SKIP,
        site_name=APIHelper.SKIP,
        staff_first_name=APIHelper.SKIP,
        staff_last_name=APIHelper.SKIP,
        staff_display_name=APIHelper.SKIP):
        """Initialize a FormulaNoteResponse instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if client_id is not APIHelper.SKIP:
            self.client_id = client_id
        if appointment_id is not APIHelper.SKIP:
            self.appointment_id = appointment_id
        if entry_date is not APIHelper.SKIP:
            self.entry_date =\
                 APIHelper.apply_datetime_converter(
                entry_date, APIHelper.RFC3339DateTime)\
                 if entry_date else None
        if note is not APIHelper.SKIP:
            self.note = note
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id
        if site_name is not APIHelper.SKIP:
            self.site_name = site_name
        if staff_first_name is not APIHelper.SKIP:
            self.staff_first_name = staff_first_name
        if staff_last_name is not APIHelper.SKIP:
            self.staff_last_name = staff_last_name
        if staff_display_name is not APIHelper.SKIP:
            self.staff_display_name = staff_display_name

    @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
        client_id =\
            dictionary.get("ClientId")\
            if dictionary.get("ClientId")\
                else APIHelper.SKIP
        appointment_id =\
            dictionary.get("AppointmentId")\
            if dictionary.get("AppointmentId")\
                else APIHelper.SKIP
        entry_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EntryDate")).datetime\
            if dictionary.get("EntryDate") else APIHelper.SKIP
        note =\
            dictionary.get("Note")\
            if dictionary.get("Note")\
                else APIHelper.SKIP
        site_id =\
            dictionary.get("SiteId")\
            if dictionary.get("SiteId")\
                else APIHelper.SKIP
        site_name =\
            dictionary.get("SiteName")\
            if dictionary.get("SiteName")\
                else APIHelper.SKIP
        staff_first_name =\
            dictionary.get("StaffFirstName")\
            if dictionary.get("StaffFirstName")\
                else APIHelper.SKIP
        staff_last_name =\
            dictionary.get("StaffLastName")\
            if dictionary.get("StaffLastName")\
                else APIHelper.SKIP
        staff_display_name =\
            dictionary.get("StaffDisplayName")\
            if dictionary.get("StaffDisplayName")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(id,
                   client_id,
                   appointment_id,
                   entry_date,
                   note,
                   site_id,
                   site_name,
                   staff_first_name,
                   staff_last_name,
                   staff_display_name)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _appointment_id=(
            self.appointment_id
            if hasattr(self, "appointment_id")
            else None
        )
        _entry_date=(
            self.entry_date
            if hasattr(self, "entry_date")
            else None
        )
        _note=(
            self.note
            if hasattr(self, "note")
            else None
        )
        _site_id=(
            self.site_id
            if hasattr(self, "site_id")
            else None
        )
        _site_name=(
            self.site_name
            if hasattr(self, "site_name")
            else None
        )
        _staff_first_name=(
            self.staff_first_name
            if hasattr(self, "staff_first_name")
            else None
        )
        _staff_last_name=(
            self.staff_last_name
            if hasattr(self, "staff_last_name")
            else None
        )
        _staff_display_name=(
            self.staff_display_name
            if hasattr(self, "staff_display_name")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"client_id={_client_id!r}, "
            f"appointment_id={_appointment_id!r}, "
            f"entry_date={_entry_date!r}, "
            f"note={_note!r}, "
            f"site_id={_site_id!r}, "
            f"site_name={_site_name!r}, "
            f"staff_first_name={_staff_first_name!r}, "
            f"staff_last_name={_staff_last_name!r}, "
            f"staff_display_name={_staff_display_name!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _appointment_id=(
            self.appointment_id
            if hasattr(self, "appointment_id")
            else None
        )
        _entry_date=(
            self.entry_date
            if hasattr(self, "entry_date")
            else None
        )
        _note=(
            self.note
            if hasattr(self, "note")
            else None
        )
        _site_id=(
            self.site_id
            if hasattr(self, "site_id")
            else None
        )
        _site_name=(
            self.site_name
            if hasattr(self, "site_name")
            else None
        )
        _staff_first_name=(
            self.staff_first_name
            if hasattr(self, "staff_first_name")
            else None
        )
        _staff_last_name=(
            self.staff_last_name
            if hasattr(self, "staff_last_name")
            else None
        )
        _staff_display_name=(
            self.staff_display_name
            if hasattr(self, "staff_display_name")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"client_id={_client_id!s}, "
            f"appointment_id={_appointment_id!s}, "
            f"entry_date={_entry_date!s}, "
            f"note={_note!s}, "
            f"site_id={_site_id!s}, "
            f"site_name={_site_name!s}, "
            f"staff_first_name={_staff_first_name!s}, "
            f"staff_last_name={_staff_last_name!s}, "
            f"staff_display_name={_staff_display_name!s}, "
            f")"
        )
