"""mindbodypublicapi.

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

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


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

    Attributes:
        staff_id (int): A list of staff IDs that you want to retrieve payroll
            information for. If you do not supply a `StaffId`, all active staff
            members return, ordered by staff ID.
        start_date_time (datetime): The beginning of the date range for the payroll
            information to be returned. The maximum allowed date range is 14 days.  *
            If you do not supply a `StartDateTime`, data returns for the seven days
            prior to the `EndDateTime` that you supply.  * If you do not supply
            either a `StartDateTime` or an `EndDateTime`, the data returns for seven
            days prior to today’s date.
        end_date_time (datetime): The end of the date range for the payroll
            information to be returned. The maximum allowed date range is 14 days.<br
            />  Default: **Today’s date**  * If you do not supply an `EndDateTime`,
            the data returns for the period from the `StartDateTime` that you supply
            to today’s date.  * If you do not supply an `EndDateTime` or a
            `StartDateTime`, data returns for the seven days prior to today’s date.
        location_id (int): A LocationId that you want to retrieve payroll information
            for. If you do not supply a `LocationId`, data from all locations is
            returned.
        limit (int): Number of results to include, defaults to 100
        offset (int): Page offset, defaults to 0.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "staff_id": "StaffId",
        "start_date_time": "StartDateTime",
        "end_date_time": "EndDateTime",
        "location_id": "LocationId",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "staff_id",
        "start_date_time",
        "end_date_time",
        "location_id",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        staff_id=APIHelper.SKIP,
        start_date_time=APIHelper.SKIP,
        end_date_time=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetTipsRequest instance."""
        # Initialize members of the class
        if staff_id is not APIHelper.SKIP:
            self.staff_id = staff_id
        if start_date_time is not APIHelper.SKIP:
            self.start_date_time =\
                 APIHelper.apply_datetime_converter(
                start_date_time, APIHelper.RFC3339DateTime)\
                 if start_date_time else None
        if end_date_time is not APIHelper.SKIP:
            self.end_date_time =\
                 APIHelper.apply_datetime_converter(
                end_date_time, APIHelper.RFC3339DateTime)\
                 if end_date_time else None
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        if limit is not APIHelper.SKIP:
            self.limit = limit
        if offset is not APIHelper.SKIP:
            self.offset = offset

    @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
        staff_id =\
            dictionary.get("StaffId")\
            if dictionary.get("StaffId")\
                else APIHelper.SKIP
        start_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartDateTime")).datetime\
            if dictionary.get("StartDateTime") else APIHelper.SKIP
        end_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EndDateTime")).datetime\
            if dictionary.get("EndDateTime") else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                else APIHelper.SKIP
        limit =\
            dictionary.get("Limit")\
            if dictionary.get("Limit")\
                else APIHelper.SKIP
        offset =\
            dictionary.get("Offset")\
            if dictionary.get("Offset")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(staff_id,
                   start_date_time,
                   end_date_time,
                   location_id,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _start_date_time=(
            self.start_date_time
            if hasattr(self, "start_date_time")
            else None
        )
        _end_date_time=(
            self.end_date_time
            if hasattr(self, "end_date_time")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!r}, "
            f"start_date_time={_start_date_time!r}, "
            f"end_date_time={_end_date_time!r}, "
            f"location_id={_location_id!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _start_date_time=(
            self.start_date_time
            if hasattr(self, "start_date_time")
            else None
        )
        _end_date_time=(
            self.end_date_time
            if hasattr(self, "end_date_time")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!s}, "
            f"start_date_time={_start_date_time!s}, "
            f"end_date_time={_end_date_time!s}, "
            f"location_id={_location_id!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
