"""mindbodypublicapi.

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

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


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

    Get class visit request.

    Attributes:
        class_id (int): The class ID.
        last_modified_date (datetime): When included in the request, only records
            modified on or after the `LastModifiedDate` specified are included in the
            response.
        use_site_settings_staff_name (bool): When `true`, the staff DisplayName will
            be populated based on site-level settings.  When `false` or omitted, the
            staff DisplayName will contain only the FirstName.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "class_id": "ClassID",
        "last_modified_date": "LastModifiedDate",
        "use_site_settings_staff_name": "UseSiteSettingsStaffName",
    }

    _optionals = [
        "last_modified_date",
        "use_site_settings_staff_name",
    ]

    def __init__(
        self,
        class_id=None,
        last_modified_date=APIHelper.SKIP,
        use_site_settings_staff_name=APIHelper.SKIP):
        """Initialize a GetClassVisitsRequest instance."""
        # Initialize members of the class
        self.class_id = class_id
        if last_modified_date is not APIHelper.SKIP:
            self.last_modified_date =\
                 APIHelper.apply_datetime_converter(
                last_modified_date, APIHelper.RFC3339DateTime)\
                 if last_modified_date else None
        if use_site_settings_staff_name is not APIHelper.SKIP:
            self.use_site_settings_staff_name = use_site_settings_staff_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
        class_id =\
            dictionary.get("ClassID")\
            if dictionary.get("ClassID")\
                else None
        last_modified_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("LastModifiedDate")).datetime\
            if dictionary.get("LastModifiedDate") else APIHelper.SKIP
        use_site_settings_staff_name =\
            dictionary.get("UseSiteSettingsStaffName")\
            if "UseSiteSettingsStaffName" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(class_id,
                   last_modified_date,
                   use_site_settings_staff_name)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_id=self.class_id
        _last_modified_date=(
            self.last_modified_date
            if hasattr(self, "last_modified_date")
            else None
        )
        _use_site_settings_staff_name=(
            self.use_site_settings_staff_name
            if hasattr(self, "use_site_settings_staff_name")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!r}, "
            f"last_modified_date={_last_modified_date!r}, "
            f"use_site_settings_staff_name={_use_site_settings_staff_name!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _class_id=self.class_id
        _last_modified_date=(
            self.last_modified_date
            if hasattr(self, "last_modified_date")
            else None
        )
        _use_site_settings_staff_name=(
            self.use_site_settings_staff_name
            if hasattr(self, "use_site_settings_staff_name")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!s}, "
            f"last_modified_date={_last_modified_date!s}, "
            f"use_site_settings_staff_name={_use_site_settings_staff_name!s}, "
            f")"
        )
