"""mindbodypublicapi.

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

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


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

    Attributes:
        price (float): The cost of the pricing option when sold at a physical
            location.
        online_price (float): The cost of the pricing option when sold online.
        tax_included (float): The amount of tax included in the price, if inclusive
            pricing is enabled.
        program_id (int): The ID of the program that this pricing option applies to.
        tax_rate (float): The tax rate applied to the pricing option. This field is
            populated only when you include a `LocationID` in the request.
        product_id (int): The unique ID of this pricing option. This is the
            `PurchasedItems[].Id` returned from GET Sales.
        id (str): The barcode ID of the pricing option. This is the
            `PurchasedItems[].BarcodeId` returned from GET Sales.
        name (str): The name of the pricing option.
        count (int): The initial count of usages available for the pricing option.
        sell_online (bool): When true, filters to the pricing options that can be
            sold online.  Default: *false*
        sale_in_contract_only (bool): When `true`, indicates that the pricing option
            is allowed to be purchased in a contract or package.  When `false`,
            indicates that the pricing option is not allowed to be purchased in a
            contract or package.
        mtype (str): The type of the pricing option, either Drop-in, Series, or
            Unlimited.
        expiration_type (str): The date the pricing option begins its activation,
            either the date of sale or the date the client first used it for a visit.
        expiration_unit (str): The unit, either days or months, of
            `ExpirationLength`, indicating how long the pricing option is active for.
        expiration_length (int): The number of days or months that the pricing option
            is active for.
        revenue_category (str): The revenue category of the pricing option.
        membership_id (int): The ID that this pricing option grants membership to.
        sell_at_location_ids (List[int]): The location IDs where this pricing option
            is sold.
        use_at_location_ids (List[int]): The location IDs where this pricing option
            may be used.
        priority (str): The priority of the pricing option, either High, Medium, or
            Low.
        is_intro_offer (bool): Indicates if this pricing option is an introductory
            offer.
        intro_offer_type (str): When `IsIntroOffer` is true, this indicates if this
            introductory offer may be purchased by new clients or new and existing
            clients.
        is_third_party_discount_pricing (bool): Indicates whether this pricing option
            is sold at discounted rates by third-party services, such as ClassPass.
        program (str): The name of the service category the pricing option belongs to.
        discontinued (bool): If the pricing option has been marked discontinued.
        restrict_to_membership_ids (List[int]): Restricted to members of these
            membership ids.
        apply_member_discounts_of_membership_ids (List[int]): Discounts applied of
            these membership ids.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "price": "Price",
        "online_price": "OnlinePrice",
        "tax_included": "TaxIncluded",
        "program_id": "ProgramId",
        "tax_rate": "TaxRate",
        "product_id": "ProductId",
        "id": "Id",
        "name": "Name",
        "count": "Count",
        "sell_online": "SellOnline",
        "sale_in_contract_only": "SaleInContractOnly",
        "mtype": "Type",
        "expiration_type": "ExpirationType",
        "expiration_unit": "ExpirationUnit",
        "expiration_length": "ExpirationLength",
        "revenue_category": "RevenueCategory",
        "membership_id": "MembershipId",
        "sell_at_location_ids": "SellAtLocationIds",
        "use_at_location_ids": "UseAtLocationIds",
        "priority": "Priority",
        "is_intro_offer": "IsIntroOffer",
        "intro_offer_type": "IntroOfferType",
        "is_third_party_discount_pricing": "IsThirdPartyDiscountPricing",
        "program": "Program",
        "discontinued": "Discontinued",
        "restrict_to_membership_ids": "RestrictToMembershipIds",
        "apply_member_discounts_of_membership_ids":
            "ApplyMemberDiscountsOfMembershipIds",
    }

    _optionals = [
        "price",
        "online_price",
        "tax_included",
        "program_id",
        "tax_rate",
        "product_id",
        "id",
        "name",
        "count",
        "sell_online",
        "sale_in_contract_only",
        "mtype",
        "expiration_type",
        "expiration_unit",
        "expiration_length",
        "revenue_category",
        "membership_id",
        "sell_at_location_ids",
        "use_at_location_ids",
        "priority",
        "is_intro_offer",
        "intro_offer_type",
        "is_third_party_discount_pricing",
        "program",
        "discontinued",
        "restrict_to_membership_ids",
        "apply_member_discounts_of_membership_ids",
    ]

    def __init__(
        self,
        price=APIHelper.SKIP,
        online_price=APIHelper.SKIP,
        tax_included=APIHelper.SKIP,
        program_id=APIHelper.SKIP,
        tax_rate=APIHelper.SKIP,
        product_id=APIHelper.SKIP,
        id=APIHelper.SKIP,
        name=APIHelper.SKIP,
        count=APIHelper.SKIP,
        sell_online=APIHelper.SKIP,
        sale_in_contract_only=APIHelper.SKIP,
        mtype=APIHelper.SKIP,
        expiration_type=APIHelper.SKIP,
        expiration_unit=APIHelper.SKIP,
        expiration_length=APIHelper.SKIP,
        revenue_category=APIHelper.SKIP,
        membership_id=APIHelper.SKIP,
        sell_at_location_ids=APIHelper.SKIP,
        use_at_location_ids=APIHelper.SKIP,
        priority=APIHelper.SKIP,
        is_intro_offer=APIHelper.SKIP,
        intro_offer_type=APIHelper.SKIP,
        is_third_party_discount_pricing=APIHelper.SKIP,
        program=APIHelper.SKIP,
        discontinued=APIHelper.SKIP,
        restrict_to_membership_ids=APIHelper.SKIP,
        apply_member_discounts_of_membership_ids=APIHelper.SKIP):
        """Initialize a Service instance."""
        # Initialize members of the class
        if price is not APIHelper.SKIP:
            self.price = price
        if online_price is not APIHelper.SKIP:
            self.online_price = online_price
        if tax_included is not APIHelper.SKIP:
            self.tax_included = tax_included
        if program_id is not APIHelper.SKIP:
            self.program_id = program_id
        if tax_rate is not APIHelper.SKIP:
            self.tax_rate = tax_rate
        if product_id is not APIHelper.SKIP:
            self.product_id = product_id
        if id is not APIHelper.SKIP:
            self.id = id
        if name is not APIHelper.SKIP:
            self.name = name
        if count is not APIHelper.SKIP:
            self.count = count
        if sell_online is not APIHelper.SKIP:
            self.sell_online = sell_online
        if sale_in_contract_only is not APIHelper.SKIP:
            self.sale_in_contract_only = sale_in_contract_only
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if expiration_type is not APIHelper.SKIP:
            self.expiration_type = expiration_type
        if expiration_unit is not APIHelper.SKIP:
            self.expiration_unit = expiration_unit
        if expiration_length is not APIHelper.SKIP:
            self.expiration_length = expiration_length
        if revenue_category is not APIHelper.SKIP:
            self.revenue_category = revenue_category
        if membership_id is not APIHelper.SKIP:
            self.membership_id = membership_id
        if sell_at_location_ids is not APIHelper.SKIP:
            self.sell_at_location_ids = sell_at_location_ids
        if use_at_location_ids is not APIHelper.SKIP:
            self.use_at_location_ids = use_at_location_ids
        if priority is not APIHelper.SKIP:
            self.priority = priority
        if is_intro_offer is not APIHelper.SKIP:
            self.is_intro_offer = is_intro_offer
        if intro_offer_type is not APIHelper.SKIP:
            self.intro_offer_type = intro_offer_type
        if is_third_party_discount_pricing is not APIHelper.SKIP:
            self.is_third_party_discount_pricing = is_third_party_discount_pricing
        if program is not APIHelper.SKIP:
            self.program = program
        if discontinued is not APIHelper.SKIP:
            self.discontinued = discontinued
        if restrict_to_membership_ids is not APIHelper.SKIP:
            self.restrict_to_membership_ids = restrict_to_membership_ids
        if apply_member_discounts_of_membership_ids is not APIHelper.SKIP:
            self.apply_member_discounts_of_membership_ids =\
                 apply_member_discounts_of_membership_ids

    @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
        price =\
            dictionary.get("Price")\
            if dictionary.get("Price")\
                else APIHelper.SKIP
        online_price =\
            dictionary.get("OnlinePrice")\
            if dictionary.get("OnlinePrice")\
                else APIHelper.SKIP
        tax_included =\
            dictionary.get("TaxIncluded")\
            if dictionary.get("TaxIncluded")\
                else APIHelper.SKIP
        program_id =\
            dictionary.get("ProgramId")\
            if dictionary.get("ProgramId")\
                else APIHelper.SKIP
        tax_rate =\
            dictionary.get("TaxRate")\
            if dictionary.get("TaxRate")\
                else APIHelper.SKIP
        product_id =\
            dictionary.get("ProductId")\
            if dictionary.get("ProductId")\
                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
        count =\
            dictionary.get("Count")\
            if dictionary.get("Count")\
                else APIHelper.SKIP
        sell_online =\
            dictionary.get("SellOnline")\
            if "SellOnline" in dictionary.keys()\
                else APIHelper.SKIP
        sale_in_contract_only =\
            dictionary.get("SaleInContractOnly")\
            if "SaleInContractOnly" in dictionary.keys()\
                else APIHelper.SKIP
        mtype =\
            dictionary.get("Type")\
            if dictionary.get("Type")\
                else APIHelper.SKIP
        expiration_type =\
            dictionary.get("ExpirationType")\
            if dictionary.get("ExpirationType")\
                else APIHelper.SKIP
        expiration_unit =\
            dictionary.get("ExpirationUnit")\
            if dictionary.get("ExpirationUnit")\
                else APIHelper.SKIP
        expiration_length =\
            dictionary.get("ExpirationLength")\
            if dictionary.get("ExpirationLength")\
                else APIHelper.SKIP
        revenue_category =\
            dictionary.get("RevenueCategory")\
            if dictionary.get("RevenueCategory")\
                else APIHelper.SKIP
        membership_id =\
            dictionary.get("MembershipId")\
            if dictionary.get("MembershipId")\
                else APIHelper.SKIP
        sell_at_location_ids =\
            dictionary.get("SellAtLocationIds")\
            if dictionary.get("SellAtLocationIds")\
                else APIHelper.SKIP
        use_at_location_ids =\
            dictionary.get("UseAtLocationIds")\
            if dictionary.get("UseAtLocationIds")\
                else APIHelper.SKIP
        priority =\
            dictionary.get("Priority")\
            if dictionary.get("Priority")\
                else APIHelper.SKIP
        is_intro_offer =\
            dictionary.get("IsIntroOffer")\
            if "IsIntroOffer" in dictionary.keys()\
                else APIHelper.SKIP
        intro_offer_type =\
            dictionary.get("IntroOfferType")\
            if dictionary.get("IntroOfferType")\
                else APIHelper.SKIP
        is_third_party_discount_pricing =\
            dictionary.get("IsThirdPartyDiscountPricing")\
            if "IsThirdPartyDiscountPricing" in dictionary.keys()\
                else APIHelper.SKIP
        program =\
            dictionary.get("Program")\
            if dictionary.get("Program")\
                else APIHelper.SKIP
        discontinued =\
            dictionary.get("Discontinued")\
            if "Discontinued" in dictionary.keys()\
                else APIHelper.SKIP
        restrict_to_membership_ids =\
            dictionary.get("RestrictToMembershipIds")\
            if dictionary.get("RestrictToMembershipIds")\
                else APIHelper.SKIP
        apply_member_discounts_of_membership_ids =\
            dictionary.get("ApplyMemberDiscountsOfMembershipIds")\
            if dictionary.get("ApplyMemberDiscountsOfMembershipIds")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(price,
                   online_price,
                   tax_included,
                   program_id,
                   tax_rate,
                   product_id,
                   id,
                   name,
                   count,
                   sell_online,
                   sale_in_contract_only,
                   mtype,
                   expiration_type,
                   expiration_unit,
                   expiration_length,
                   revenue_category,
                   membership_id,
                   sell_at_location_ids,
                   use_at_location_ids,
                   priority,
                   is_intro_offer,
                   intro_offer_type,
                   is_third_party_discount_pricing,
                   program,
                   discontinued,
                   restrict_to_membership_ids,
                   apply_member_discounts_of_membership_ids)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _price=(
            self.price
            if hasattr(self, "price")
            else None
        )
        _online_price=(
            self.online_price
            if hasattr(self, "online_price")
            else None
        )
        _tax_included=(
            self.tax_included
            if hasattr(self, "tax_included")
            else None
        )
        _program_id=(
            self.program_id
            if hasattr(self, "program_id")
            else None
        )
        _tax_rate=(
            self.tax_rate
            if hasattr(self, "tax_rate")
            else None
        )
        _product_id=(
            self.product_id
            if hasattr(self, "product_id")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _count=(
            self.count
            if hasattr(self, "count")
            else None
        )
        _sell_online=(
            self.sell_online
            if hasattr(self, "sell_online")
            else None
        )
        _sale_in_contract_only=(
            self.sale_in_contract_only
            if hasattr(self, "sale_in_contract_only")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _expiration_type=(
            self.expiration_type
            if hasattr(self, "expiration_type")
            else None
        )
        _expiration_unit=(
            self.expiration_unit
            if hasattr(self, "expiration_unit")
            else None
        )
        _expiration_length=(
            self.expiration_length
            if hasattr(self, "expiration_length")
            else None
        )
        _revenue_category=(
            self.revenue_category
            if hasattr(self, "revenue_category")
            else None
        )
        _membership_id=(
            self.membership_id
            if hasattr(self, "membership_id")
            else None
        )
        _sell_at_location_ids=(
            self.sell_at_location_ids
            if hasattr(self, "sell_at_location_ids")
            else None
        )
        _use_at_location_ids=(
            self.use_at_location_ids
            if hasattr(self, "use_at_location_ids")
            else None
        )
        _priority=(
            self.priority
            if hasattr(self, "priority")
            else None
        )
        _is_intro_offer=(
            self.is_intro_offer
            if hasattr(self, "is_intro_offer")
            else None
        )
        _intro_offer_type=(
            self.intro_offer_type
            if hasattr(self, "intro_offer_type")
            else None
        )
        _is_third_party_discount_pricing=(
            self.is_third_party_discount_pricing
            if hasattr(self, "is_third_party_discount_pricing")
            else None
        )
        _program=(
            self.program
            if hasattr(self, "program")
            else None
        )
        _discontinued=(
            self.discontinued
            if hasattr(self, "discontinued")
            else None
        )
        _restrict_to_membership_ids=(
            self.restrict_to_membership_ids
            if hasattr(self, "restrict_to_membership_ids")
            else None
        )
        _apply_member_discounts_of_membership_ids=(
            self.apply_member_discounts_of_membership_ids
            if hasattr(self, "apply_member_discounts_of_membership_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"price={_price!r}, "
            f"online_price={_online_price!r}, "
            f"tax_included={_tax_included!r}, "
            f"program_id={_program_id!r}, "
            f"tax_rate={_tax_rate!r}, "
            f"product_id={_product_id!r}, "
            f"id={_id!r}, "
            f"name={_name!r}, "
            f"count={_count!r}, "
            f"sell_online={_sell_online!r}, "
            f"sale_in_contract_only={_sale_in_contract_only!r}, "
            f"mtype={_mtype!r}, "
            f"expiration_type={_expiration_type!r}, "
            f"expiration_unit={_expiration_unit!r}, "
            f"expiration_length={_expiration_length!r}, "
            f"revenue_category={_revenue_category!r}, "
            f"membership_id={_membership_id!r}, "
            f"sell_at_location_ids={_sell_at_location_ids!r}, "
            f"use_at_location_ids={_use_at_location_ids!r}, "
            f"priority={_priority!r}, "
            f"is_intro_offer={_is_intro_offer!r}, "
            f"intro_offer_type={_intro_offer_type!r}, "
            f"is_third_party_discount_pricing={_is_third_party_discount_pricing!r}, "
            f"program={_program!r}, "
            f"discontinued={_discontinued!r}, "
            f"restrict_to_membership_ids={_restrict_to_membership_ids!r}, "
            f"apply_member_discounts_of_membership_ids={_apply_member_discounts_of_membership_ids!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _price=(
            self.price
            if hasattr(self, "price")
            else None
        )
        _online_price=(
            self.online_price
            if hasattr(self, "online_price")
            else None
        )
        _tax_included=(
            self.tax_included
            if hasattr(self, "tax_included")
            else None
        )
        _program_id=(
            self.program_id
            if hasattr(self, "program_id")
            else None
        )
        _tax_rate=(
            self.tax_rate
            if hasattr(self, "tax_rate")
            else None
        )
        _product_id=(
            self.product_id
            if hasattr(self, "product_id")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _count=(
            self.count
            if hasattr(self, "count")
            else None
        )
        _sell_online=(
            self.sell_online
            if hasattr(self, "sell_online")
            else None
        )
        _sale_in_contract_only=(
            self.sale_in_contract_only
            if hasattr(self, "sale_in_contract_only")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _expiration_type=(
            self.expiration_type
            if hasattr(self, "expiration_type")
            else None
        )
        _expiration_unit=(
            self.expiration_unit
            if hasattr(self, "expiration_unit")
            else None
        )
        _expiration_length=(
            self.expiration_length
            if hasattr(self, "expiration_length")
            else None
        )
        _revenue_category=(
            self.revenue_category
            if hasattr(self, "revenue_category")
            else None
        )
        _membership_id=(
            self.membership_id
            if hasattr(self, "membership_id")
            else None
        )
        _sell_at_location_ids=(
            self.sell_at_location_ids
            if hasattr(self, "sell_at_location_ids")
            else None
        )
        _use_at_location_ids=(
            self.use_at_location_ids
            if hasattr(self, "use_at_location_ids")
            else None
        )
        _priority=(
            self.priority
            if hasattr(self, "priority")
            else None
        )
        _is_intro_offer=(
            self.is_intro_offer
            if hasattr(self, "is_intro_offer")
            else None
        )
        _intro_offer_type=(
            self.intro_offer_type
            if hasattr(self, "intro_offer_type")
            else None
        )
        _is_third_party_discount_pricing=(
            self.is_third_party_discount_pricing
            if hasattr(self, "is_third_party_discount_pricing")
            else None
        )
        _program=(
            self.program
            if hasattr(self, "program")
            else None
        )
        _discontinued=(
            self.discontinued
            if hasattr(self, "discontinued")
            else None
        )
        _restrict_to_membership_ids=(
            self.restrict_to_membership_ids
            if hasattr(self, "restrict_to_membership_ids")
            else None
        )
        _apply_member_discounts_of_membership_ids=(
            self.apply_member_discounts_of_membership_ids
            if hasattr(self, "apply_member_discounts_of_membership_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"price={_price!s}, "
            f"online_price={_online_price!s}, "
            f"tax_included={_tax_included!s}, "
            f"program_id={_program_id!s}, "
            f"tax_rate={_tax_rate!s}, "
            f"product_id={_product_id!s}, "
            f"id={_id!s}, "
            f"name={_name!s}, "
            f"count={_count!s}, "
            f"sell_online={_sell_online!s}, "
            f"sale_in_contract_only={_sale_in_contract_only!s}, "
            f"mtype={_mtype!s}, "
            f"expiration_type={_expiration_type!s}, "
            f"expiration_unit={_expiration_unit!s}, "
            f"expiration_length={_expiration_length!s}, "
            f"revenue_category={_revenue_category!s}, "
            f"membership_id={_membership_id!s}, "
            f"sell_at_location_ids={_sell_at_location_ids!s}, "
            f"use_at_location_ids={_use_at_location_ids!s}, "
            f"priority={_priority!s}, "
            f"is_intro_offer={_is_intro_offer!s}, "
            f"intro_offer_type={_intro_offer_type!s}, "
            f"is_third_party_discount_pricing={_is_third_party_discount_pricing!s}, "
            f"program={_program!s}, "
            f"discontinued={_discontinued!s}, "
            f"restrict_to_membership_ids={_restrict_to_membership_ids!s}, "
            f"apply_member_discounts_of_membership_ids={_apply_member_discounts_of_membership_ids!s}, "
            f")"
        )
