"""mindbodypublicapi.

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

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


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

    Attributes:
        visit_id (int): The ID of the visit to be updated.
        makeup (bool): When `true`, indicates that the visit is eligible to be made
            up.
        signed_in (bool): When `true`, indicates that the client has signed in for
            the visit.
        client_service_id (int): The ID of the service to assign to the visit.
        execute (str): The execute code used to update this visit. Possible values
            are:  * Cancel  * Latecancel  * Unlatecancel
        test (bool): When `true`, indicates that test mode is enabled. When test mode
            is enabled, input information is validated, but not committed.<br />
            Default: **false**
        send_email (bool): When `true`, indicates that the client should be sent an
            email for cancellations. Note that email is not sent unless the client
            has an email address and automatic emails have been set up correctly.<br
            />  Default: **false**

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "visit_id": "VisitId",
        "makeup": "Makeup",
        "signed_in": "SignedIn",
        "client_service_id": "ClientServiceId",
        "execute": "Execute",
        "test": "Test",
        "send_email": "SendEmail",
    }

    _optionals = [
        "makeup",
        "signed_in",
        "client_service_id",
        "execute",
        "test",
        "send_email",
    ]

    def __init__(
        self,
        visit_id=None,
        makeup=APIHelper.SKIP,
        signed_in=APIHelper.SKIP,
        client_service_id=APIHelper.SKIP,
        execute=APIHelper.SKIP,
        test=APIHelper.SKIP,
        send_email=APIHelper.SKIP):
        """Initialize a UpdateClientVisitRequest instance."""
        # Initialize members of the class
        self.visit_id = visit_id
        if makeup is not APIHelper.SKIP:
            self.makeup = makeup
        if signed_in is not APIHelper.SKIP:
            self.signed_in = signed_in
        if client_service_id is not APIHelper.SKIP:
            self.client_service_id = client_service_id
        if execute is not APIHelper.SKIP:
            self.execute = execute
        if test is not APIHelper.SKIP:
            self.test = test
        if send_email is not APIHelper.SKIP:
            self.send_email = send_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
        visit_id =\
            dictionary.get("VisitId")\
            if dictionary.get("VisitId")\
                else None
        makeup =\
            dictionary.get("Makeup")\
            if "Makeup" in dictionary.keys()\
                else APIHelper.SKIP
        signed_in =\
            dictionary.get("SignedIn")\
            if "SignedIn" in dictionary.keys()\
                else APIHelper.SKIP
        client_service_id =\
            dictionary.get("ClientServiceId")\
            if dictionary.get("ClientServiceId")\
                else APIHelper.SKIP
        execute =\
            dictionary.get("Execute")\
            if dictionary.get("Execute")\
                else APIHelper.SKIP
        test =\
            dictionary.get("Test")\
            if "Test" in dictionary.keys()\
                else APIHelper.SKIP
        send_email =\
            dictionary.get("SendEmail")\
            if "SendEmail" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(visit_id,
                   makeup,
                   signed_in,
                   client_service_id,
                   execute,
                   test,
                   send_email)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _visit_id=self.visit_id
        _makeup=(
            self.makeup
            if hasattr(self, "makeup")
            else None
        )
        _signed_in=(
            self.signed_in
            if hasattr(self, "signed_in")
            else None
        )
        _client_service_id=(
            self.client_service_id
            if hasattr(self, "client_service_id")
            else None
        )
        _execute=(
            self.execute
            if hasattr(self, "execute")
            else None
        )
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _send_email=(
            self.send_email
            if hasattr(self, "send_email")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"visit_id={_visit_id!r}, "
            f"makeup={_makeup!r}, "
            f"signed_in={_signed_in!r}, "
            f"client_service_id={_client_service_id!r}, "
            f"execute={_execute!r}, "
            f"test={_test!r}, "
            f"send_email={_send_email!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _visit_id=self.visit_id
        _makeup=(
            self.makeup
            if hasattr(self, "makeup")
            else None
        )
        _signed_in=(
            self.signed_in
            if hasattr(self, "signed_in")
            else None
        )
        _client_service_id=(
            self.client_service_id
            if hasattr(self, "client_service_id")
            else None
        )
        _execute=(
            self.execute
            if hasattr(self, "execute")
            else None
        )
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _send_email=(
            self.send_email
            if hasattr(self, "send_email")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"visit_id={_visit_id!s}, "
            f"makeup={_makeup!s}, "
            f"signed_in={_signed_in!s}, "
            f"client_service_id={_client_service_id!s}, "
            f"execute={_execute!s}, "
            f"test={_test!s}, "
            f"send_email={_send_email!s}, "
            f")"
        )
