"""mindbodypublicapi.

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

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


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

    Attributes:
        staff_id (int): The ID of the staff member session type is getting assigned
            to. The staff member must be assignable to appointments or already be
            assigned to the session type in the request.
        session_type_id (int): The ID of the session type that is getting assigned to
            the staff member. The session type must be an appointment.
        active (bool): Indicates if assignment is active. Passing `false` is
            equivalent to deleting the assignment.
        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
        pay_rate_type (str): The pay rate type. Can be one of the following (case
            insensitive):     Percent     Flat     No Pay     If PayRateType is not
            provided in the request and the request is creating a completely new
            assignment (not editing an existing active or inactive assignment), then
            the staff member default pay rate and pay rate amount are used to create
            the assignment. Otherwise, the existing assignment values are used for
            any optional request parameters not included in the request.
        pay_rate_amount (float): The pay rate amount for the specific staff member.
            It is parsed according to the PayRateType.

    """

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

    _optionals = [
        "time_length",
        "prep_time",
        "finish_time",
        "pay_rate_type",
        "pay_rate_amount",
    ]

    def __init__(
        self,
        staff_id=None,
        session_type_id=None,
        active=None,
        time_length=APIHelper.SKIP,
        prep_time=APIHelper.SKIP,
        finish_time=APIHelper.SKIP,
        pay_rate_type=APIHelper.SKIP,
        pay_rate_amount=APIHelper.SKIP):
        """Initialize a AssignStaffSessionTypeRequest instance."""
        # Initialize members of the class
        self.staff_id = staff_id
        self.session_type_id = session_type_id
        self.active = active
        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 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

    @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 None
        session_type_id =\
            dictionary.get("SessionTypeId")\
            if dictionary.get("SessionTypeId")\
                else None
        active =\
            dictionary.get("Active")\
            if "Active" in dictionary.keys()\
                else None
        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
        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

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

    def __repr__(self):
        """Return a unambiguous string representation."""
        _staff_id=self.staff_id
        _session_type_id=self.session_type_id
        _active=self.active
        _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
        )
        _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
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!r}, "
            f"session_type_id={_session_type_id!r}, "
            f"active={_active!r}, "
            f"time_length={_time_length!r}, "
            f"prep_time={_prep_time!r}, "
            f"finish_time={_finish_time!r}, "
            f"pay_rate_type={_pay_rate_type!r}, "
            f"pay_rate_amount={_pay_rate_amount!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _staff_id=self.staff_id
        _session_type_id=self.session_type_id
        _active=self.active
        _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
        )
        _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
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!s}, "
            f"session_type_id={_session_type_id!s}, "
            f"active={_active!s}, "
            f"time_length={_time_length!s}, "
            f"prep_time={_prep_time!s}, "
            f"finish_time={_finish_time!s}, "
            f"pay_rate_type={_pay_rate_type!s}, "
            f"pay_rate_amount={_pay_rate_amount!s}, "
            f")"
        )
