"""mindbodypublicapi.

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

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


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

    Add Staff Availability/Unavailability Schedule

    Attributes:
        staff_id (int): The ID of the staff member that availability or
            unavailability will be added.
        is_availability (bool): When `true`, indicates that availability will be
            added, <br />  When `false`, indicates that unavailability will be added.
        description (str): The description of the unavailability, ex. Lunch,
            Vacation. Required if IsAvailability passed as `false`.  Omit if
            IsAvailability passed as `true`.
        program_ids (List[int]): A list of program IDs. Must be a valid active
            schedulable Program ID. Required if IsAvailability passed as `true`.
            Omit if IsAvailability passed as `false`.
        location_id (int): The ID of the location where the availability is added.
            Required if IsAvailability passed as `true`.  Omit if IsAvailability
            passed as `false`.
        days_of_week (List[str]): The days of the week. Must contain at least one of
            the following Sunday, Monday, Tuesday etc.
        start_time (str): The start time of the schedule. Must be in HH:MM:SS format.
        end_time (str): The end time of the schedule. Must be in HH:MM:SS format.
        start_date (str): The start date of the schedule. Must be in YYYY-MM-DD
            format.
        end_date (str): The end date of the schedule. Must be in YYYY-MM-DD format.
        status (str): The status of availability or unavailability. Possible values
            are:  * Masked  * Hidden  * Public    Default: Public

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "staff_id": "StaffId",
        "is_availability": "IsAvailability",
        "days_of_week": "DaysOfWeek",
        "start_time": "StartTime",
        "end_time": "EndTime",
        "start_date": "StartDate",
        "end_date": "EndDate",
        "description": "Description",
        "program_ids": "ProgramIds",
        "location_id": "LocationId",
        "status": "Status",
    }

    _optionals = [
        "description",
        "program_ids",
        "location_id",
        "status",
    ]

    def __init__(
        self,
        staff_id=None,
        is_availability=None,
        days_of_week=None,
        start_time=None,
        end_time=None,
        start_date=None,
        end_date=None,
        description=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        status=APIHelper.SKIP):
        """Initialize a AddStaffAvailabilityRequest instance."""
        # Initialize members of the class
        self.staff_id = staff_id
        self.is_availability = is_availability
        if description is not APIHelper.SKIP:
            self.description = description
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_ids
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        self.days_of_week = days_of_week
        self.start_time = start_time
        self.end_time = end_time
        self.start_date = start_date
        self.end_date = end_date
        if status is not APIHelper.SKIP:
            self.status = status

    @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
        is_availability =\
            dictionary.get("IsAvailability")\
            if "IsAvailability" in dictionary.keys()\
                else None
        days_of_week =\
            dictionary.get("DaysOfWeek")\
            if dictionary.get("DaysOfWeek")\
                else None
        start_time =\
            dictionary.get("StartTime")\
            if dictionary.get("StartTime")\
                else None
        end_time =\
            dictionary.get("EndTime")\
            if dictionary.get("EndTime")\
                else None
        start_date =\
            dictionary.get("StartDate")\
            if dictionary.get("StartDate")\
                else None
        end_date =\
            dictionary.get("EndDate")\
            if dictionary.get("EndDate")\
                else None
        description =\
            dictionary.get("Description")\
            if dictionary.get("Description")\
                else APIHelper.SKIP
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                else APIHelper.SKIP
        status =\
            dictionary.get("Status")\
            if dictionary.get("Status")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(staff_id,
                   is_availability,
                   days_of_week,
                   start_time,
                   end_time,
                   start_date,
                   end_date,
                   description,
                   program_ids,
                   location_id,
                   status)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _staff_id=self.staff_id
        _is_availability=self.is_availability
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _days_of_week=self.days_of_week
        _start_time=self.start_time
        _end_time=self.end_time
        _start_date=self.start_date
        _end_date=self.end_date
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!r}, "
            f"is_availability={_is_availability!r}, "
            f"description={_description!r}, "
            f"program_ids={_program_ids!r}, "
            f"location_id={_location_id!r}, "
            f"days_of_week={_days_of_week!r}, "
            f"start_time={_start_time!r}, "
            f"end_time={_end_time!r}, "
            f"start_date={_start_date!r}, "
            f"end_date={_end_date!r}, "
            f"status={_status!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _staff_id=self.staff_id
        _is_availability=self.is_availability
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _days_of_week=self.days_of_week
        _start_time=self.start_time
        _end_time=self.end_time
        _start_date=self.start_date
        _end_date=self.end_date
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"staff_id={_staff_id!s}, "
            f"is_availability={_is_availability!s}, "
            f"description={_description!s}, "
            f"program_ids={_program_ids!s}, "
            f"location_id={_location_id!s}, "
            f"days_of_week={_days_of_week!s}, "
            f"start_time={_start_time!s}, "
            f"end_time={_end_time!s}, "
            f"start_date={_start_date!s}, "
            f"end_date={_end_date!s}, "
            f"status={_status!s}, "
            f")"
        )
