"""mindbodypublicapi.

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

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


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

    To Update pricing option data

    Attributes:
        product_id (float): The id of the pricing option (legacy Id in mongo db)
        name (str): Pricing option name.
        price (float): Price of this Pricing option.
        online_price (float): Online price of this Pricing option.
        count (int): Number of sessions for this pricing option
        sell_online (bool): Whether this pricing option sell online or not
        revenue_category (str): Revenue Category of this pricing option
        discontinued (bool): Whether this pricing option active or inactive
        membership_id (int): The ID of the membership required to purchase the
            pricing option  Default is -1 and will not update Membership if it is not
            passed in body
        is_third_party_discount_pricing (bool): Is this pricing option sold at
            discounted rates by third-parties  Once set to true it cannot be changed
        priority (str): The priority of the pricing option  Priority can be set to
            Low(-1), Medium (0), High(1)
        sell_at_location_ids (List[int]): The location IDs where this pricing option
            is sold   (default is null and will not update SellAtLocation if it is
            not passed in body)
        use_at_location_ids (List[int]): The location IDs where this pricing option
            is used  (default is null and will not update UseAtLocation if it is not
            passed in body)
        expiration_unit (str): The Expiration unit, either Days or Months
        expiration_length (int): The number of days or months that the pricing option
            is active for.
        expiration_type (str): The date the pricing option begins its activation,
            either the SaleDate or DateOfClientFirstVisit
        restricted_membership_ids (List[int]): This pricing option can be used under
            these memberships only  If null/empty then not restricted to any
            membership

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "product_id": "ProductId",
        "name": "Name",
        "price": "Price",
        "online_price": "OnlinePrice",
        "count": "Count",
        "sell_online": "SellOnline",
        "revenue_category": "RevenueCategory",
        "discontinued": "Discontinued",
        "membership_id": "MembershipId",
        "is_third_party_discount_pricing": "IsThirdPartyDiscountPricing",
        "priority": "Priority",
        "sell_at_location_ids": "SellAtLocationIds",
        "use_at_location_ids": "UseAtLocationIds",
        "expiration_unit": "ExpirationUnit",
        "expiration_length": "ExpirationLength",
        "expiration_type": "ExpirationType",
        "restricted_membership_ids": "RestrictedMembershipIds",
    }

    _optionals = [
        "name",
        "price",
        "online_price",
        "count",
        "sell_online",
        "revenue_category",
        "discontinued",
        "membership_id",
        "is_third_party_discount_pricing",
        "priority",
        "sell_at_location_ids",
        "use_at_location_ids",
        "expiration_unit",
        "expiration_length",
        "expiration_type",
        "restricted_membership_ids",
    ]

    def __init__(
        self,
        product_id=None,
        name=APIHelper.SKIP,
        price=APIHelper.SKIP,
        online_price=APIHelper.SKIP,
        count=APIHelper.SKIP,
        sell_online=APIHelper.SKIP,
        revenue_category=APIHelper.SKIP,
        discontinued=APIHelper.SKIP,
        membership_id=APIHelper.SKIP,
        is_third_party_discount_pricing=APIHelper.SKIP,
        priority=APIHelper.SKIP,
        sell_at_location_ids=APIHelper.SKIP,
        use_at_location_ids=APIHelper.SKIP,
        expiration_unit=APIHelper.SKIP,
        expiration_length=APIHelper.SKIP,
        expiration_type=APIHelper.SKIP,
        restricted_membership_ids=APIHelper.SKIP):
        """Initialize a UpdatePricingOptionRequest instance."""
        # Initialize members of the class
        self.product_id = product_id
        if name is not APIHelper.SKIP:
            self.name = name
        if price is not APIHelper.SKIP:
            self.price = price
        if online_price is not APIHelper.SKIP:
            self.online_price = online_price
        if count is not APIHelper.SKIP:
            self.count = count
        if sell_online is not APIHelper.SKIP:
            self.sell_online = sell_online
        if revenue_category is not APIHelper.SKIP:
            self.revenue_category = revenue_category
        if discontinued is not APIHelper.SKIP:
            self.discontinued = discontinued
        if membership_id is not APIHelper.SKIP:
            self.membership_id = membership_id
        if is_third_party_discount_pricing is not APIHelper.SKIP:
            self.is_third_party_discount_pricing = is_third_party_discount_pricing
        if priority is not APIHelper.SKIP:
            self.priority = priority
        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 expiration_unit is not APIHelper.SKIP:
            self.expiration_unit = expiration_unit
        if expiration_length is not APIHelper.SKIP:
            self.expiration_length = expiration_length
        if expiration_type is not APIHelper.SKIP:
            self.expiration_type = expiration_type
        if restricted_membership_ids is not APIHelper.SKIP:
            self.restricted_membership_ids = restricted_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
        product_id =\
            dictionary.get("ProductId")\
            if dictionary.get("ProductId")\
                else None
        name =\
            dictionary.get("Name")\
            if dictionary.get("Name")\
                else APIHelper.SKIP
        price =\
            dictionary.get("Price")\
            if dictionary.get("Price")\
                else APIHelper.SKIP
        online_price =\
            dictionary.get("OnlinePrice")\
            if dictionary.get("OnlinePrice")\
                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
        revenue_category =\
            dictionary.get("RevenueCategory")\
            if dictionary.get("RevenueCategory")\
                else APIHelper.SKIP
        discontinued =\
            dictionary.get("Discontinued")\
            if "Discontinued" in dictionary.keys()\
                else APIHelper.SKIP
        membership_id =\
            dictionary.get("MembershipId")\
            if dictionary.get("MembershipId")\
                else APIHelper.SKIP
        is_third_party_discount_pricing =\
            dictionary.get("IsThirdPartyDiscountPricing")\
            if "IsThirdPartyDiscountPricing" in dictionary.keys()\
                else APIHelper.SKIP
        priority =\
            dictionary.get("Priority")\
            if dictionary.get("Priority")\
                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
        expiration_unit =\
            dictionary.get("ExpirationUnit")\
            if dictionary.get("ExpirationUnit")\
                else APIHelper.SKIP
        expiration_length =\
            dictionary.get("ExpirationLength")\
            if dictionary.get("ExpirationLength")\
                else APIHelper.SKIP
        expiration_type =\
            dictionary.get("ExpirationType")\
            if dictionary.get("ExpirationType")\
                else APIHelper.SKIP
        restricted_membership_ids =\
            dictionary.get("RestrictedMembershipIds")\
            if dictionary.get("RestrictedMembershipIds")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(product_id,
                   name,
                   price,
                   online_price,
                   count,
                   sell_online,
                   revenue_category,
                   discontinued,
                   membership_id,
                   is_third_party_discount_pricing,
                   priority,
                   sell_at_location_ids,
                   use_at_location_ids,
                   expiration_unit,
                   expiration_length,
                   expiration_type,
                   restricted_membership_ids)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _product_id=self.product_id
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _price=(
            self.price
            if hasattr(self, "price")
            else None
        )
        _online_price=(
            self.online_price
            if hasattr(self, "online_price")
            else None
        )
        _count=(
            self.count
            if hasattr(self, "count")
            else None
        )
        _sell_online=(
            self.sell_online
            if hasattr(self, "sell_online")
            else None
        )
        _revenue_category=(
            self.revenue_category
            if hasattr(self, "revenue_category")
            else None
        )
        _discontinued=(
            self.discontinued
            if hasattr(self, "discontinued")
            else None
        )
        _membership_id=(
            self.membership_id
            if hasattr(self, "membership_id")
            else None
        )
        _is_third_party_discount_pricing=(
            self.is_third_party_discount_pricing
            if hasattr(self, "is_third_party_discount_pricing")
            else None
        )
        _priority=(
            self.priority
            if hasattr(self, "priority")
            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
        )
        _expiration_unit=(
            self.expiration_unit
            if hasattr(self, "expiration_unit")
            else None
        )
        _expiration_length=(
            self.expiration_length
            if hasattr(self, "expiration_length")
            else None
        )
        _expiration_type=(
            self.expiration_type
            if hasattr(self, "expiration_type")
            else None
        )
        _restricted_membership_ids=(
            self.restricted_membership_ids
            if hasattr(self, "restricted_membership_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"product_id={_product_id!r}, "
            f"name={_name!r}, "
            f"price={_price!r}, "
            f"online_price={_online_price!r}, "
            f"count={_count!r}, "
            f"sell_online={_sell_online!r}, "
            f"revenue_category={_revenue_category!r}, "
            f"discontinued={_discontinued!r}, "
            f"membership_id={_membership_id!r}, "
            f"is_third_party_discount_pricing={_is_third_party_discount_pricing!r}, "
            f"priority={_priority!r}, "
            f"sell_at_location_ids={_sell_at_location_ids!r}, "
            f"use_at_location_ids={_use_at_location_ids!r}, "
            f"expiration_unit={_expiration_unit!r}, "
            f"expiration_length={_expiration_length!r}, "
            f"expiration_type={_expiration_type!r}, "
            f"restricted_membership_ids={_restricted_membership_ids!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _product_id=self.product_id
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _price=(
            self.price
            if hasattr(self, "price")
            else None
        )
        _online_price=(
            self.online_price
            if hasattr(self, "online_price")
            else None
        )
        _count=(
            self.count
            if hasattr(self, "count")
            else None
        )
        _sell_online=(
            self.sell_online
            if hasattr(self, "sell_online")
            else None
        )
        _revenue_category=(
            self.revenue_category
            if hasattr(self, "revenue_category")
            else None
        )
        _discontinued=(
            self.discontinued
            if hasattr(self, "discontinued")
            else None
        )
        _membership_id=(
            self.membership_id
            if hasattr(self, "membership_id")
            else None
        )
        _is_third_party_discount_pricing=(
            self.is_third_party_discount_pricing
            if hasattr(self, "is_third_party_discount_pricing")
            else None
        )
        _priority=(
            self.priority
            if hasattr(self, "priority")
            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
        )
        _expiration_unit=(
            self.expiration_unit
            if hasattr(self, "expiration_unit")
            else None
        )
        _expiration_length=(
            self.expiration_length
            if hasattr(self, "expiration_length")
            else None
        )
        _expiration_type=(
            self.expiration_type
            if hasattr(self, "expiration_type")
            else None
        )
        _restricted_membership_ids=(
            self.restricted_membership_ids
            if hasattr(self, "restricted_membership_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"product_id={_product_id!s}, "
            f"name={_name!s}, "
            f"price={_price!s}, "
            f"online_price={_online_price!s}, "
            f"count={_count!s}, "
            f"sell_online={_sell_online!s}, "
            f"revenue_category={_revenue_category!s}, "
            f"discontinued={_discontinued!s}, "
            f"membership_id={_membership_id!s}, "
            f"is_third_party_discount_pricing={_is_third_party_discount_pricing!s}, "
            f"priority={_priority!s}, "
            f"sell_at_location_ids={_sell_at_location_ids!s}, "
            f"use_at_location_ids={_use_at_location_ids!s}, "
            f"expiration_unit={_expiration_unit!s}, "
            f"expiration_length={_expiration_length!s}, "
            f"expiration_type={_expiration_type!s}, "
            f"restricted_membership_ids={_restricted_membership_ids!s}, "
            f")"
        )
