"""mindbodypublicapi.

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

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


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

    Attributes:
        client_id (str): The ID of the client who needs to have a formula note added.
        appointment_id (int): The appointment ID that the formula note is related to.
        note (str): The new formula note text.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "client_id": "ClientId",
        "note": "Note",
        "appointment_id": "AppointmentId",
    }

    _optionals = [
        "appointment_id",
    ]

    def __init__(
        self,
        client_id=None,
        note=None,
        appointment_id=APIHelper.SKIP):
        """Initialize a AddFormulaNoteRequest instance."""
        # Initialize members of the class
        self.client_id = client_id
        if appointment_id is not APIHelper.SKIP:
            self.appointment_id = appointment_id
        self.note = note

    @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
        client_id =\
            dictionary.get("ClientId")\
            if dictionary.get("ClientId")\
                else None
        note =\
            dictionary.get("Note")\
            if dictionary.get("Note")\
                else None
        appointment_id =\
            dictionary.get("AppointmentId")\
            if dictionary.get("AppointmentId")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(client_id,
                   note,
                   appointment_id)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _client_id=self.client_id
        _appointment_id=(
            self.appointment_id
            if hasattr(self, "appointment_id")
            else None
        )
        _note=self.note
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!r}, "
            f"appointment_id={_appointment_id!r}, "
            f"note={_note!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _client_id=self.client_id
        _appointment_id=(
            self.appointment_id
            if hasattr(self, "appointment_id")
            else None
        )
        _note=self.note
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!s}, "
            f"appointment_id={_appointment_id!s}, "
            f"note={_note!s}, "
            f")"
        )
