"""mindbodypublicapi.

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

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


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

    Attributes:
        staff_id (int): Staff member assigned to the session type
        session_type_id (int): The session type the staff member is assigned to
        pay_rate_type (str): The pay rate type name  Can be: "Flat", "Percent", or
            "No Pay"
        pay_rate_amount (float): The pay rate amount. It is interpreted based on the
            value of PayRateTypeId
        time_length (int): The staff specific amount of time that a session of this
            type typically lasts.
        prep_time (int): Prep time in minutes
        finish_time (int): Finish time in minutes
        active (bool): Whether this association is active

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "staff_id": "StaffId",
        "session_type_id": "SessionTypeId",
        "pay_rate_type": "PayRateType",
        "pay_rate_amount": "PayRateAmount",
        "time_length": "TimeLength",
        "prep_time": "PrepTime",
        "finish_time": "FinishTime",
        "active": "Active",
    }

    _optionals = [
        "staff_id",
        "session_type_id",
        "pay_rate_type",
        "pay_rate_amount",
        "time_length",
        "prep_time",
        "finish_time",
        "active",
    ]

    def __init__(
        self,
        staff_id=APIHelper.SKIP,
        session_type_id=APIHelper.SKIP,
        pay_rate_type=APIHelper.SKIP,
        pay_rate_amount=APIHelper.SKIP,
        time_length=APIHelper.SKIP,
        prep_time=APIHelper.SKIP,
        finish_time=APIHelper.SKIP,
        active=APIHelper.SKIP):
        """Initialize a AssignStaffSessionTypeResponse instance."""
        # Initialize members of the class
        if staff_id is not APIHelper.SKIP:
            self.staff_id = staff_id
        if session_type_id is not APIHelper.SKIP:
            self.session_type_id = session_type_id
        if pay_rate_type is not APIHelper.SKIP:
            self.pay_rate_type = pay_rate_type
        if pay_rate_amount is not APIHelper.SKIP:
            self.pay_rate_amount = pay_rate_amount
        if time_length is not APIHelper.SKIP:
            self.time_length = time_length
        if prep_time is not APIHelper.SKIP:
            self.prep_time = prep_time
        if finish_time is not APIHelper.SKIP:
            self.finish_time = finish_time
        if active is not APIHelper.SKIP:
            self.active = active

    @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
        session_type_id =\
            dictionary.get("SessionTypeId")\
            if dictionary.get("SessionTypeId")\
                else APIHelper.SKIP
        pay_rate_type =\
            dictionary.get("PayRateType")\
            if dictionary.get("PayRateType")\
                else APIHelper.SKIP
        pay_rate_amount =\
            dictionary.get("PayRateAmount")\
            if dictionary.get("PayRateAmount")\
                else APIHelper.SKIP
        time_length =\
            dictionary.get("TimeLength")\
            if dictionary.get("TimeLength")\
                else APIHelper.SKIP
        prep_time =\
            dictionary.get("PrepTime")\
            if dictionary.get("PrepTime")\
                else APIHelper.SKIP
        finish_time =\
            dictionary.get("FinishTime")\
            if dictionary.get("FinishTime")\
                else APIHelper.SKIP
        active =\
            dictionary.get("Active")\
            if "Active" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(staff_id,
                   session_type_id,
                   pay_rate_type,
                   pay_rate_amount,
                   time_length,
                   prep_time,
                   finish_time,
                   active)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _session_type_id=(
            self.session_type_id
            if hasattr(self, "session_type_id")
            else None
        )
        _pay_rate_type=(
            self.pay_rate_type
            if hasattr(self, "pay_rate_type")
            else None
        )
        _pay_rate_amount=(
            self.pay_rate_amount
            if hasattr(self, "pay_rate_amount")
            else None
        )
        _time_length=(
            self.time_length
            if hasattr(self, "time_length")
            else None
        )
        _prep_time=(
            self.prep_time
            if hasattr(self, "prep_time")
            else None
        )
        _finish_time=(
            self.finish_time
            if hasattr(self, "finish_time")
            else None
        )
        _active=(
            self.active
            if hasattr(self, "active")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!r}, "
            f"session_type_id={_session_type_id!r}, "
            f"pay_rate_type={_pay_rate_type!r}, "
            f"pay_rate_amount={_pay_rate_amount!r}, "
            f"time_length={_time_length!r}, "
            f"prep_time={_prep_time!r}, "
            f"finish_time={_finish_time!r}, "
            f"active={_active!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _session_type_id=(
            self.session_type_id
            if hasattr(self, "session_type_id")
            else None
        )
        _pay_rate_type=(
            self.pay_rate_type
            if hasattr(self, "pay_rate_type")
            else None
        )
        _pay_rate_amount=(
            self.pay_rate_amount
            if hasattr(self, "pay_rate_amount")
            else None
        )
        _time_length=(
            self.time_length
            if hasattr(self, "time_length")
            else None
        )
        _prep_time=(
            self.prep_time
            if hasattr(self, "prep_time")
            else None
        )
        _finish_time=(
            self.finish_time
            if hasattr(self, "finish_time")
            else None
        )
        _active=(
            self.active
            if hasattr(self, "active")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!s}, "
            f"session_type_id={_session_type_id!s}, "
            f"pay_rate_type={_pay_rate_type!s}, "
            f"pay_rate_amount={_pay_rate_amount!s}, "
            f"time_length={_time_length!s}, "
            f"prep_time={_prep_time!s}, "
            f"finish_time={_finish_time!s}, "
            f"active={_active!s}, "
            f")"
        )
