"""mindbodypublicapi.

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

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


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

    Attributes:
        client_id (str): The client ID of the client whose Contact Log is being
            deleted.
        contact_log_id (int): The Contact Log ID.
        test (bool): When `true`, indicates that this is a test request and no data
            is inserted into the subscriber’s database.  When `false`, the database
            is updated.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "client_id": "ClientId",
        "contact_log_id": "ContactLogId",
        "test": "Test",
    }

    _optionals = [
        "test",
    ]

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

    @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
        contact_log_id =\
            dictionary.get("ContactLogId")\
            if dictionary.get("ContactLogId")\
                else None
        test =\
            dictionary.get("Test")\
            if "Test" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(client_id,
                   contact_log_id,
                   test)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _client_id=self.client_id
        _contact_log_id=self.contact_log_id
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!r}, "
            f"contact_log_id={_contact_log_id!r}, "
            f"test={_test!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _client_id=self.client_id
        _contact_log_id=self.contact_log_id
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!s}, "
            f"contact_log_id={_contact_log_id!s}, "
            f"test={_test!s}, "
            f")"
        )
