"""mindbodypublicapi.

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

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


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

    SessionType contains information about the session types in a business.

    Attributes:
        mtype (TypeEnum): Contains the class description session type. Possible
            values are:  * All  * Class  * Enrollment  * Appointment  * Resource  *
            Media  * Arrival
        default_time_length (int): The default amount of time that a session of this
            type typically lasts.
        staff_time_length (int): The amount of time that a session of this type will
            last for a specific Staff (when applicable.)
        id (int): This session type’s unique ID.
        name (str): The name of this session type.
        online_description (str): The online description associated with the
            appointment.
        num_deducted (int): The number of sessions that this session type deducts
            from the pricing option used to pay for this type of session.
        program_id (int): This session type’s service category ID.
        category (str): This session type’s category.
        category_id (int): This session type’s category ID.
        subcategory (str): This session type’s subcategory.
        subcategory_id (int): This session type’s subcategory ID.
        available_for_add_on (bool): This session type’s Add On Flag.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mtype": "Type",
        "default_time_length": "DefaultTimeLength",
        "staff_time_length": "StaffTimeLength",
        "id": "Id",
        "name": "Name",
        "online_description": "OnlineDescription",
        "num_deducted": "NumDeducted",
        "program_id": "ProgramId",
        "category": "Category",
        "category_id": "CategoryId",
        "subcategory": "Subcategory",
        "subcategory_id": "SubcategoryId",
        "available_for_add_on": "AvailableForAddOn",
    }

    _optionals = [
        "mtype",
        "default_time_length",
        "staff_time_length",
        "id",
        "name",
        "online_description",
        "num_deducted",
        "program_id",
        "category",
        "category_id",
        "subcategory",
        "subcategory_id",
        "available_for_add_on",
    ]

    def __init__(
        self,
        mtype=APIHelper.SKIP,
        default_time_length=APIHelper.SKIP,
        staff_time_length=APIHelper.SKIP,
        id=APIHelper.SKIP,
        name=APIHelper.SKIP,
        online_description=APIHelper.SKIP,
        num_deducted=APIHelper.SKIP,
        program_id=APIHelper.SKIP,
        category=APIHelper.SKIP,
        category_id=APIHelper.SKIP,
        subcategory=APIHelper.SKIP,
        subcategory_id=APIHelper.SKIP,
        available_for_add_on=APIHelper.SKIP):
        """Initialize a SessionType instance."""
        # Initialize members of the class
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if default_time_length is not APIHelper.SKIP:
            self.default_time_length = default_time_length
        if staff_time_length is not APIHelper.SKIP:
            self.staff_time_length = staff_time_length
        if id is not APIHelper.SKIP:
            self.id = id
        if name is not APIHelper.SKIP:
            self.name = name
        if online_description is not APIHelper.SKIP:
            self.online_description = online_description
        if num_deducted is not APIHelper.SKIP:
            self.num_deducted = num_deducted
        if program_id is not APIHelper.SKIP:
            self.program_id = program_id
        if category is not APIHelper.SKIP:
            self.category = category
        if category_id is not APIHelper.SKIP:
            self.category_id = category_id
        if subcategory is not APIHelper.SKIP:
            self.subcategory = subcategory
        if subcategory_id is not APIHelper.SKIP:
            self.subcategory_id = subcategory_id
        if available_for_add_on is not APIHelper.SKIP:
            self.available_for_add_on = available_for_add_on

    @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
        mtype =\
            dictionary.get("Type")\
            if dictionary.get("Type")\
                else APIHelper.SKIP
        default_time_length =\
            dictionary.get("DefaultTimeLength")\
            if dictionary.get("DefaultTimeLength")\
                else APIHelper.SKIP
        staff_time_length =\
            dictionary.get("StaffTimeLength")\
            if dictionary.get("StaffTimeLength")\
                else APIHelper.SKIP
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        name =\
            dictionary.get("Name")\
            if dictionary.get("Name")\
                else APIHelper.SKIP
        online_description =\
            dictionary.get("OnlineDescription")\
            if dictionary.get("OnlineDescription")\
                else APIHelper.SKIP
        num_deducted =\
            dictionary.get("NumDeducted")\
            if dictionary.get("NumDeducted")\
                else APIHelper.SKIP
        program_id =\
            dictionary.get("ProgramId")\
            if dictionary.get("ProgramId")\
                else APIHelper.SKIP
        category =\
            dictionary.get("Category")\
            if dictionary.get("Category")\
                else APIHelper.SKIP
        category_id =\
            dictionary.get("CategoryId")\
            if dictionary.get("CategoryId")\
                else APIHelper.SKIP
        subcategory =\
            dictionary.get("Subcategory")\
            if dictionary.get("Subcategory")\
                else APIHelper.SKIP
        subcategory_id =\
            dictionary.get("SubcategoryId")\
            if dictionary.get("SubcategoryId")\
                else APIHelper.SKIP
        available_for_add_on =\
            dictionary.get("AvailableForAddOn")\
            if "AvailableForAddOn" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(mtype,
                   default_time_length,
                   staff_time_length,
                   id,
                   name,
                   online_description,
                   num_deducted,
                   program_id,
                   category,
                   category_id,
                   subcategory,
                   subcategory_id,
                   available_for_add_on)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _default_time_length=(
            self.default_time_length
            if hasattr(self, "default_time_length")
            else None
        )
        _staff_time_length=(
            self.staff_time_length
            if hasattr(self, "staff_time_length")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _online_description=(
            self.online_description
            if hasattr(self, "online_description")
            else None
        )
        _num_deducted=(
            self.num_deducted
            if hasattr(self, "num_deducted")
            else None
        )
        _program_id=(
            self.program_id
            if hasattr(self, "program_id")
            else None
        )
        _category=(
            self.category
            if hasattr(self, "category")
            else None
        )
        _category_id=(
            self.category_id
            if hasattr(self, "category_id")
            else None
        )
        _subcategory=(
            self.subcategory
            if hasattr(self, "subcategory")
            else None
        )
        _subcategory_id=(
            self.subcategory_id
            if hasattr(self, "subcategory_id")
            else None
        )
        _available_for_add_on=(
            self.available_for_add_on
            if hasattr(self, "available_for_add_on")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"mtype={_mtype!r}, "
            f"default_time_length={_default_time_length!r}, "
            f"staff_time_length={_staff_time_length!r}, "
            f"id={_id!r}, "
            f"name={_name!r}, "
            f"online_description={_online_description!r}, "
            f"num_deducted={_num_deducted!r}, "
            f"program_id={_program_id!r}, "
            f"category={_category!r}, "
            f"category_id={_category_id!r}, "
            f"subcategory={_subcategory!r}, "
            f"subcategory_id={_subcategory_id!r}, "
            f"available_for_add_on={_available_for_add_on!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _default_time_length=(
            self.default_time_length
            if hasattr(self, "default_time_length")
            else None
        )
        _staff_time_length=(
            self.staff_time_length
            if hasattr(self, "staff_time_length")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _online_description=(
            self.online_description
            if hasattr(self, "online_description")
            else None
        )
        _num_deducted=(
            self.num_deducted
            if hasattr(self, "num_deducted")
            else None
        )
        _program_id=(
            self.program_id
            if hasattr(self, "program_id")
            else None
        )
        _category=(
            self.category
            if hasattr(self, "category")
            else None
        )
        _category_id=(
            self.category_id
            if hasattr(self, "category_id")
            else None
        )
        _subcategory=(
            self.subcategory
            if hasattr(self, "subcategory")
            else None
        )
        _subcategory_id=(
            self.subcategory_id
            if hasattr(self, "subcategory_id")
            else None
        )
        _available_for_add_on=(
            self.available_for_add_on
            if hasattr(self, "available_for_add_on")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"mtype={_mtype!s}, "
            f"default_time_length={_default_time_length!s}, "
            f"staff_time_length={_staff_time_length!s}, "
            f"id={_id!s}, "
            f"name={_name!s}, "
            f"online_description={_online_description!s}, "
            f"num_deducted={_num_deducted!s}, "
            f"program_id={_program_id!s}, "
            f"category={_category!s}, "
            f"category_id={_category_id!s}, "
            f"subcategory={_subcategory!s}, "
            f"subcategory_id={_subcategory_id!s}, "
            f"available_for_add_on={_available_for_add_on!s}, "
            f")"
        )
