"""mindbodypublicapi.

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

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


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

    Attributes:
        test (bool): When `true`, the request ensures that its parameters are valid
            without affecting real data.  When `false`, the request performs as
            intended and may affect live client data.  (optional) Defaults to false.
        location_id (int): Location of availability.  <br />Not used when
            IsUnavailable is `true`.
        staff_i_ds (List[int]): A list of requested staff IDs.<br />  (optional)
            Defaults to staff ID of user credentials. Use 0 for all.
        program_i_ds (List[int]): A list of program IDs.<br />  (optional) Defaults
            to all.  <br />Not used when IsUnavailable is true.
        start_date_time (datetime): The start date and time of the new availabilities
            or unavailabilities.
        end_date_time (datetime): The end date and time of the new availabilities or
            unavailabilities.
        days_of_week (List[DaysOfWeekEnum]): The days of the week to set.<br />
            (optional) Defaults to all.
        unavailable_description (str): Description of unavalability.  <br />Only used
            when IsUnavailable is true.
        is_unavailable (bool): When `true`, indicates that unavailability is getting
            added. When `false`, indicates that availability is getting added.
            Default: **false**
        public_display (PublicDisplay1Enum): Sets the public display of the
            availability.<br /><ul><li>Show</li><li>Mask</li><li>Hide</li></ul>
            (optional) Defaults to Show.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "test": "Test",
        "location_id": "LocationID",
        "staff_i_ds": "StaffIDs",
        "program_i_ds": "ProgramIDs",
        "start_date_time": "StartDateTime",
        "end_date_time": "EndDateTime",
        "days_of_week": "DaysOfWeek",
        "unavailable_description": "UnavailableDescription",
        "is_unavailable": "IsUnavailable",
        "public_display": "PublicDisplay",
    }

    _optionals = [
        "test",
        "location_id",
        "staff_i_ds",
        "program_i_ds",
        "start_date_time",
        "end_date_time",
        "days_of_week",
        "unavailable_description",
        "is_unavailable",
        "public_display",
    ]

    def __init__(
        self,
        test=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        staff_i_ds=APIHelper.SKIP,
        program_i_ds=APIHelper.SKIP,
        start_date_time=APIHelper.SKIP,
        end_date_time=APIHelper.SKIP,
        days_of_week=APIHelper.SKIP,
        unavailable_description=APIHelper.SKIP,
        is_unavailable=APIHelper.SKIP,
        public_display=APIHelper.SKIP):
        """Initialize a AddAvailabilitiesRequest instance."""
        # Initialize members of the class
        if test is not APIHelper.SKIP:
            self.test = test
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        if staff_i_ds is not APIHelper.SKIP:
            self.staff_i_ds = staff_i_ds
        if program_i_ds is not APIHelper.SKIP:
            self.program_i_ds = program_i_ds
        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 days_of_week is not APIHelper.SKIP:
            self.days_of_week = days_of_week
        if unavailable_description is not APIHelper.SKIP:
            self.unavailable_description = unavailable_description
        if is_unavailable is not APIHelper.SKIP:
            self.is_unavailable = is_unavailable
        if public_display is not APIHelper.SKIP:
            self.public_display = public_display

    @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
        test =\
            dictionary.get("Test")\
            if "Test" in dictionary.keys()\
                else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationID")\
            if dictionary.get("LocationID")\
                else APIHelper.SKIP
        staff_i_ds =\
            dictionary.get("StaffIDs")\
            if dictionary.get("StaffIDs")\
                else APIHelper.SKIP
        program_i_ds =\
            dictionary.get("ProgramIDs")\
            if dictionary.get("ProgramIDs")\
                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
        days_of_week =\
            dictionary.get("DaysOfWeek")\
            if dictionary.get("DaysOfWeek")\
                else APIHelper.SKIP
        unavailable_description =\
            dictionary.get("UnavailableDescription")\
            if dictionary.get("UnavailableDescription")\
                else APIHelper.SKIP
        is_unavailable =\
            dictionary.get("IsUnavailable")\
            if "IsUnavailable" in dictionary.keys()\
                else APIHelper.SKIP
        public_display =\
            dictionary.get("PublicDisplay")\
            if dictionary.get("PublicDisplay")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(test,
                   location_id,
                   staff_i_ds,
                   program_i_ds,
                   start_date_time,
                   end_date_time,
                   days_of_week,
                   unavailable_description,
                   is_unavailable,
                   public_display)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _staff_i_ds=(
            self.staff_i_ds
            if hasattr(self, "staff_i_ds")
            else None
        )
        _program_i_ds=(
            self.program_i_ds
            if hasattr(self, "program_i_ds")
            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
        )
        _days_of_week=(
            self.days_of_week
            if hasattr(self, "days_of_week")
            else None
        )
        _unavailable_description=(
            self.unavailable_description
            if hasattr(self, "unavailable_description")
            else None
        )
        _is_unavailable=(
            self.is_unavailable
            if hasattr(self, "is_unavailable")
            else None
        )
        _public_display=(
            self.public_display
            if hasattr(self, "public_display")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"test={_test!r}, "
            f"location_id={_location_id!r}, "
            f"staff_i_ds={_staff_i_ds!r}, "
            f"program_i_ds={_program_i_ds!r}, "
            f"start_date_time={_start_date_time!r}, "
            f"end_date_time={_end_date_time!r}, "
            f"days_of_week={_days_of_week!r}, "
            f"unavailable_description={_unavailable_description!r}, "
            f"is_unavailable={_is_unavailable!r}, "
            f"public_display={_public_display!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _staff_i_ds=(
            self.staff_i_ds
            if hasattr(self, "staff_i_ds")
            else None
        )
        _program_i_ds=(
            self.program_i_ds
            if hasattr(self, "program_i_ds")
            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
        )
        _days_of_week=(
            self.days_of_week
            if hasattr(self, "days_of_week")
            else None
        )
        _unavailable_description=(
            self.unavailable_description
            if hasattr(self, "unavailable_description")
            else None
        )
        _is_unavailable=(
            self.is_unavailable
            if hasattr(self, "is_unavailable")
            else None
        )
        _public_display=(
            self.public_display
            if hasattr(self, "public_display")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"test={_test!s}, "
            f"location_id={_location_id!s}, "
            f"staff_i_ds={_staff_i_ds!s}, "
            f"program_i_ds={_program_i_ds!s}, "
            f"start_date_time={_start_date_time!s}, "
            f"end_date_time={_end_date_time!s}, "
            f"days_of_week={_days_of_week!s}, "
            f"unavailable_description={_unavailable_description!s}, "
            f"is_unavailable={_is_unavailable!s}, "
            f"public_display={_public_display!s}, "
            f")"
        )
