"""mindbodypublicapi.

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

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


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

    This is the update avaialability request coming DTO

    Attributes:
        availability_ids (List[int]): Unique IDs for the availabilities or
            unavailabilities.
        public_display (PublicDisplayEnum): Choice that decides whether the
            availablity should be publicly visible, masked or hidden.
        days_of_week (List[DaysOfWeekEnum]): The days of week to update the
            availabilities or unavailabilities.<br />  Default: **All**
        program_ids (List[int]): The program Id to be set for the availabilities.
            Default: **All**
        start_date_time (datetime): The start date and time for the availabilities or
            unavailabilities.
        end_date_time (datetime): The end date and time for the availabilities or
            unavailabilities.
        location_id (int): The location Id to be updated for the provided
            availability Ids.
        unavailable_description (str): The description for unavailability.
        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.  Default: **false**

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "availability_ids": "AvailabilityIds",
        "public_display": "PublicDisplay",
        "days_of_week": "DaysOfWeek",
        "program_ids": "ProgramIds",
        "start_date_time": "StartDateTime",
        "end_date_time": "EndDateTime",
        "location_id": "LocationId",
        "unavailable_description": "UnavailableDescription",
        "test": "Test",
    }

    _optionals = [
        "availability_ids",
        "public_display",
        "days_of_week",
        "program_ids",
        "start_date_time",
        "end_date_time",
        "location_id",
        "unavailable_description",
        "test",
    ]

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

    @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
        availability_ids =\
            dictionary.get("AvailabilityIds")\
            if dictionary.get("AvailabilityIds")\
                else APIHelper.SKIP
        public_display =\
            dictionary.get("PublicDisplay")\
            if dictionary.get("PublicDisplay")\
                else APIHelper.SKIP
        days_of_week =\
            dictionary.get("DaysOfWeek")\
            if dictionary.get("DaysOfWeek")\
                else APIHelper.SKIP
        program_ids =\
            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
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                else APIHelper.SKIP
        unavailable_description =\
            dictionary.get("UnavailableDescription")\
            if dictionary.get("UnavailableDescription")\
                else APIHelper.SKIP
        test =\
            dictionary.get("Test")\
            if "Test" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(availability_ids,
                   public_display,
                   days_of_week,
                   program_ids,
                   start_date_time,
                   end_date_time,
                   location_id,
                   unavailable_description,
                   test)

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

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