"""mindbodypublicapi.

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

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


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

    Attributes:
        program_ids (List[int]): Filters to pricing options with the specified
            program IDs.
        session_type_ids (List[int]): Filters to the pricing options with the
            specified session types IDs.
        service_ids (List[str]): Filters to the pricing options with the specified
            IDs. In this context, service and pricing option are used
            interchangeably. These are the `PurchasedItems[].Id` returned from GET
            Sales.
        class_id (int): Filters to the pricing options for the specified class ID.
        class_schedule_id (int): Filters to the pricing options for the specified
            class schedule ID.
        sell_online (bool): When `true`, filters the pricing options to display only
            those available for online purchase.  This parameter is only applicable
            in Business Mode (when a staff authentication header is included) and
            ignored in Consumer Mode (when no authentication header is passed).  <br
            />Default: `false` (for staff users)  <br />Business Mode: This parameter
            controls the filtering behavior. Staff users can set this to `true`  to
            show only pricing options that can be sold online, or `false` to show all
            available pricing options.  <br />Consumer Mode: This value is
            automatically set to `true` and cannot be overridden,  ensuring consumers
            only see pricing options available for online purchase.
        location_id (int): When specified, for each returned pricing option,
            `TaxRate` and `TaxIncluded` are calculated according to the specified
            location. Note that this does not filter results to only services
            provided at the given location, and for locations where Value-Added Tax
            (VAT) rules apply, the `TaxRate` is set to zero.
        hide_related_programs (bool): When `true`, indicates that pricing options of
            related programs are omitted from the response.<br />  Default: **false**
        staff_id (int): Sets `Price` and `OnlinePrice` to the particular pricing of a
            specific staff member, if allowed by the business.
        include_discontinued (bool): When `true`, indicates that the filtered pricing
            option list includes discontinued pricing options.<br />  Default:
            **false**
        include_sale_in_contract_only (bool): When `true`, indicates that the
            filtered pricing option list includes sale in contract only pricing
            options.<br />  Default: **false**
        limit (int): Number of results to include, defaults to 100
        offset (int): Page offset, defaults to 0.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "program_ids": "ProgramIds",
        "session_type_ids": "SessionTypeIds",
        "service_ids": "ServiceIds",
        "class_id": "ClassId",
        "class_schedule_id": "ClassScheduleId",
        "sell_online": "SellOnline",
        "location_id": "LocationId",
        "hide_related_programs": "HideRelatedPrograms",
        "staff_id": "StaffId",
        "include_discontinued": "IncludeDiscontinued",
        "include_sale_in_contract_only": "IncludeSaleInContractOnly",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "program_ids",
        "session_type_ids",
        "service_ids",
        "class_id",
        "class_schedule_id",
        "sell_online",
        "location_id",
        "hide_related_programs",
        "staff_id",
        "include_discontinued",
        "include_sale_in_contract_only",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        program_ids=APIHelper.SKIP,
        session_type_ids=APIHelper.SKIP,
        service_ids=APIHelper.SKIP,
        class_id=APIHelper.SKIP,
        class_schedule_id=APIHelper.SKIP,
        sell_online=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        hide_related_programs=APIHelper.SKIP,
        staff_id=APIHelper.SKIP,
        include_discontinued=APIHelper.SKIP,
        include_sale_in_contract_only=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetServicesRequest instance."""
        # Initialize members of the class
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_ids
        if session_type_ids is not APIHelper.SKIP:
            self.session_type_ids = session_type_ids
        if service_ids is not APIHelper.SKIP:
            self.service_ids = service_ids
        if class_id is not APIHelper.SKIP:
            self.class_id = class_id
        if class_schedule_id is not APIHelper.SKIP:
            self.class_schedule_id = class_schedule_id
        if sell_online is not APIHelper.SKIP:
            self.sell_online = sell_online
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        if hide_related_programs is not APIHelper.SKIP:
            self.hide_related_programs = hide_related_programs
        if staff_id is not APIHelper.SKIP:
            self.staff_id = staff_id
        if include_discontinued is not APIHelper.SKIP:
            self.include_discontinued = include_discontinued
        if include_sale_in_contract_only is not APIHelper.SKIP:
            self.include_sale_in_contract_only = include_sale_in_contract_only
        if limit is not APIHelper.SKIP:
            self.limit = limit
        if offset is not APIHelper.SKIP:
            self.offset = offset

    @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
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                else APIHelper.SKIP
        session_type_ids =\
            dictionary.get("SessionTypeIds")\
            if dictionary.get("SessionTypeIds")\
                else APIHelper.SKIP
        service_ids =\
            dictionary.get("ServiceIds")\
            if dictionary.get("ServiceIds")\
                else APIHelper.SKIP
        class_id =\
            dictionary.get("ClassId")\
            if dictionary.get("ClassId")\
                else APIHelper.SKIP
        class_schedule_id =\
            dictionary.get("ClassScheduleId")\
            if dictionary.get("ClassScheduleId")\
                else APIHelper.SKIP
        sell_online =\
            dictionary.get("SellOnline")\
            if "SellOnline" in dictionary.keys()\
                else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                else APIHelper.SKIP
        hide_related_programs =\
            dictionary.get("HideRelatedPrograms")\
            if "HideRelatedPrograms" in dictionary.keys()\
                else APIHelper.SKIP
        staff_id =\
            dictionary.get("StaffId")\
            if dictionary.get("StaffId")\
                else APIHelper.SKIP
        include_discontinued =\
            dictionary.get("IncludeDiscontinued")\
            if "IncludeDiscontinued" in dictionary.keys()\
                else APIHelper.SKIP
        include_sale_in_contract_only =\
            dictionary.get("IncludeSaleInContractOnly")\
            if "IncludeSaleInContractOnly" in dictionary.keys()\
                else APIHelper.SKIP
        limit =\
            dictionary.get("Limit")\
            if dictionary.get("Limit")\
                else APIHelper.SKIP
        offset =\
            dictionary.get("Offset")\
            if dictionary.get("Offset")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(program_ids,
                   session_type_ids,
                   service_ids,
                   class_id,
                   class_schedule_id,
                   sell_online,
                   location_id,
                   hide_related_programs,
                   staff_id,
                   include_discontinued,
                   include_sale_in_contract_only,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _session_type_ids=(
            self.session_type_ids
            if hasattr(self, "session_type_ids")
            else None
        )
        _service_ids=(
            self.service_ids
            if hasattr(self, "service_ids")
            else None
        )
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _class_schedule_id=(
            self.class_schedule_id
            if hasattr(self, "class_schedule_id")
            else None
        )
        _sell_online=(
            self.sell_online
            if hasattr(self, "sell_online")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _hide_related_programs=(
            self.hide_related_programs
            if hasattr(self, "hide_related_programs")
            else None
        )
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _include_discontinued=(
            self.include_discontinued
            if hasattr(self, "include_discontinued")
            else None
        )
        _include_sale_in_contract_only=(
            self.include_sale_in_contract_only
            if hasattr(self, "include_sale_in_contract_only")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"program_ids={_program_ids!r}, "
            f"session_type_ids={_session_type_ids!r}, "
            f"service_ids={_service_ids!r}, "
            f"class_id={_class_id!r}, "
            f"class_schedule_id={_class_schedule_id!r}, "
            f"sell_online={_sell_online!r}, "
            f"location_id={_location_id!r}, "
            f"hide_related_programs={_hide_related_programs!r}, "
            f"staff_id={_staff_id!r}, "
            f"include_discontinued={_include_discontinued!r}, "
            f"include_sale_in_contract_only={_include_sale_in_contract_only!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _session_type_ids=(
            self.session_type_ids
            if hasattr(self, "session_type_ids")
            else None
        )
        _service_ids=(
            self.service_ids
            if hasattr(self, "service_ids")
            else None
        )
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _class_schedule_id=(
            self.class_schedule_id
            if hasattr(self, "class_schedule_id")
            else None
        )
        _sell_online=(
            self.sell_online
            if hasattr(self, "sell_online")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _hide_related_programs=(
            self.hide_related_programs
            if hasattr(self, "hide_related_programs")
            else None
        )
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _include_discontinued=(
            self.include_discontinued
            if hasattr(self, "include_discontinued")
            else None
        )
        _include_sale_in_contract_only=(
            self.include_sale_in_contract_only
            if hasattr(self, "include_sale_in_contract_only")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"program_ids={_program_ids!s}, "
            f"session_type_ids={_session_type_ids!s}, "
            f"service_ids={_service_ids!s}, "
            f"class_id={_class_id!s}, "
            f"class_schedule_id={_class_schedule_id!s}, "
            f"sell_online={_sell_online!s}, "
            f"location_id={_location_id!s}, "
            f"hide_related_programs={_hide_related_programs!s}, "
            f"staff_id={_staff_id!s}, "
            f"include_discontinued={_include_discontinued!s}, "
            f"include_sale_in_contract_only={_include_sale_in_contract_only!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
