"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper
from mindbodypublicapi.models.autopay_schedule import (
    AutopaySchedule,
)
from mindbodypublicapi.models.contract_item import (
    ContractItem,
)
from mindbodypublicapi.models.membership_type_restriction import (
    MembershipTypeRestriction,
)


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

    Attributes:
        id (int): The contract’s ID at the subscriber’s business.
        name (str): The name of the contract.
        description (str): A description of the contract.
        assigns_membership_id (int): The ID of the membership that was assigned to
            the client when the client signed up for a contract.
        assigns_membership_name (str): The name of the membership that was assigned
            to the client when the client signed up for this contract.
        sold_online (bool): When `true`, indicates that this membership is intended
            to be shown to clients in client experiences.<br />  When `false`, this
            contract should only be shown to staff members.
        contract_items (List[ContractItem]): Contains information about the items in
            the contract.
        intro_offer (str): Defines whether this contract is treated as an
            introductory offer. If this is an introductory offer, then clients are
            always charged a set number of times rather than month to month, using
            their AutoPays. Possible values are:  * None  * NewConsumer  *
            NewAndReturningConsumer
        autopay_schedule (AutopaySchedule): The model property of type
            AutopaySchedule.
        number_of_autopays (int): The number of times that the AutoPay is to be run.
            This value is null if `FrequencyType` is `MonthToMonth`.
        autopay_trigger_type (str): Defines whether the AutoPay, if applicable to
            this contract, runs on a set schedule or when the pricing option runs out
            or expires. Possible values are:  * OnSetSchedule  *
            PricingOptionRunsOutOrExpires
        action_upon_completion_of_autopays (str): The renewal action to be taken when
            this AutoPay is completed. Possible values are:  * ContractExpires  *
            ContractAutomaticallyRenews
        clients_charged_on (str): The value that indicates when clients are charged.
            Possible values are:  * OnSaleDate  * FirstOfTheMonth  *
            FifteenthOfTheMonth  * LastDayOfTheMonth  * FirstOrFifteenthOfTheMonth  *
            FirstOrSixteenthOfTheMonth  * FifteenthOrEndOfTheMonth  * SpecificDate
        clients_charged_on_specific_date (datetime): If `ClientsChargedOn` is defined
            as a specific date, this property holds the value of that date.
            Otherwise, this property is null.
        discount_amount (float): The calculated discount applied to the items in this
            contract.
        deposit_amount (float): The amount of the deposit required for this contract.
        first_autopay_free (bool): When `true`, indicates that the first payment for
            the AutoPay is free.
        last_autopay_free (bool): When `true`, indicates that the last payment for
            the AutoPay is free.
        client_terminate_online (bool): When `true`, indicates that the client can
            terminate this contract on the Internet.
        membership_type_restrictions (List[MembershipTypeRestriction]): Contains
            information about the memberships that can purchase this contract. If
            null, then no membership restrictions exist, and anyone can purchase the
            contract.
        location_purchase_restriction_ids (List[int]): The IDs of the locations where
            this contract may be sold. If there are no restrictions, this value is
            null.
        location_purchase_restriction_names (List[str]): Location names where the
            contract may be purchased. If this value is null, there are no
            restrictions.
        agreement_terms (str): Business-defined terms and conditions for the contract.
        requires_electronic_confirmation (bool): When `true`, clients who purchase
            the contract are prompted to agree to the terms of the contract the next
            time that they log in.
        autopay_enabled (bool): When `true`, this contract establishes an AutoPay on
            the client’s account.
        first_payment_amount_subtotal (float): The subtotal of the amount that the
            client is to be charged when signing up for the contract.
        first_payment_amount_tax (float): The amount of tax that the client is to be
            charged when signing up for the contract.
        first_payment_amount_total (float): The total amount that the client is to be
            charged when signing up for the contract.
        recurring_payment_amount_subtotal (float): The subtotal amount that the
            client is to be charged on an ongoing basis.
        recurring_payment_amount_tax (float): The amount of tax the client is to be
            charged on an ongoing basis.
        recurring_payment_amount_total (float): The total amount that the client is
            to be charged on an ongoing basis.
        total_contract_amount_subtotal (float): The subtotal amount that the client
            is to be charged over the lifespan of the contract.
        total_contract_amount_tax (float): The total amount of tax the client is to
            be charged over the lifespan of the contract.
        total_contract_amount_total (float): The total amount the client is to be
            charged over the lifespan of the contract.
        promo_payment_amount_subtotal (float): Subtotal promotional period
        promo_payment_amount_tax (float): Taxes of promotional period
        promo_payment_amount_total (float): Total of promotional period
        number_of_promo_autopays (int): Number of times that the AutoPay runs under
            the promotional period

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "Id",
        "name": "Name",
        "description": "Description",
        "assigns_membership_id": "AssignsMembershipId",
        "assigns_membership_name": "AssignsMembershipName",
        "sold_online": "SoldOnline",
        "contract_items": "ContractItems",
        "intro_offer": "IntroOffer",
        "autopay_schedule": "AutopaySchedule",
        "number_of_autopays": "NumberOfAutopays",
        "autopay_trigger_type": "AutopayTriggerType",
        "action_upon_completion_of_autopays": "ActionUponCompletionOfAutopays",
        "clients_charged_on": "ClientsChargedOn",
        "clients_charged_on_specific_date": "ClientsChargedOnSpecificDate",
        "discount_amount": "DiscountAmount",
        "deposit_amount": "DepositAmount",
        "first_autopay_free": "FirstAutopayFree",
        "last_autopay_free": "LastAutopayFree",
        "client_terminate_online": "ClientTerminateOnline",
        "membership_type_restrictions": "MembershipTypeRestrictions",
        "location_purchase_restriction_ids": "LocationPurchaseRestrictionIds",
        "location_purchase_restriction_names": "LocationPurchaseRestrictionNames",
        "agreement_terms": "AgreementTerms",
        "requires_electronic_confirmation": "RequiresElectronicConfirmation",
        "autopay_enabled": "AutopayEnabled",
        "first_payment_amount_subtotal": "FirstPaymentAmountSubtotal",
        "first_payment_amount_tax": "FirstPaymentAmountTax",
        "first_payment_amount_total": "FirstPaymentAmountTotal",
        "recurring_payment_amount_subtotal": "RecurringPaymentAmountSubtotal",
        "recurring_payment_amount_tax": "RecurringPaymentAmountTax",
        "recurring_payment_amount_total": "RecurringPaymentAmountTotal",
        "total_contract_amount_subtotal": "TotalContractAmountSubtotal",
        "total_contract_amount_tax": "TotalContractAmountTax",
        "total_contract_amount_total": "TotalContractAmountTotal",
        "promo_payment_amount_subtotal": "PromoPaymentAmountSubtotal",
        "promo_payment_amount_tax": "PromoPaymentAmountTax",
        "promo_payment_amount_total": "PromoPaymentAmountTotal",
        "number_of_promo_autopays": "NumberOfPromoAutopays",
    }

    _optionals = [
        "id",
        "name",
        "description",
        "assigns_membership_id",
        "assigns_membership_name",
        "sold_online",
        "contract_items",
        "intro_offer",
        "autopay_schedule",
        "number_of_autopays",
        "autopay_trigger_type",
        "action_upon_completion_of_autopays",
        "clients_charged_on",
        "clients_charged_on_specific_date",
        "discount_amount",
        "deposit_amount",
        "first_autopay_free",
        "last_autopay_free",
        "client_terminate_online",
        "membership_type_restrictions",
        "location_purchase_restriction_ids",
        "location_purchase_restriction_names",
        "agreement_terms",
        "requires_electronic_confirmation",
        "autopay_enabled",
        "first_payment_amount_subtotal",
        "first_payment_amount_tax",
        "first_payment_amount_total",
        "recurring_payment_amount_subtotal",
        "recurring_payment_amount_tax",
        "recurring_payment_amount_total",
        "total_contract_amount_subtotal",
        "total_contract_amount_tax",
        "total_contract_amount_total",
        "promo_payment_amount_subtotal",
        "promo_payment_amount_tax",
        "promo_payment_amount_total",
        "number_of_promo_autopays",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        name=APIHelper.SKIP,
        description=APIHelper.SKIP,
        assigns_membership_id=APIHelper.SKIP,
        assigns_membership_name=APIHelper.SKIP,
        sold_online=APIHelper.SKIP,
        contract_items=APIHelper.SKIP,
        intro_offer=APIHelper.SKIP,
        autopay_schedule=APIHelper.SKIP,
        number_of_autopays=APIHelper.SKIP,
        autopay_trigger_type=APIHelper.SKIP,
        action_upon_completion_of_autopays=APIHelper.SKIP,
        clients_charged_on=APIHelper.SKIP,
        clients_charged_on_specific_date=APIHelper.SKIP,
        discount_amount=APIHelper.SKIP,
        deposit_amount=APIHelper.SKIP,
        first_autopay_free=APIHelper.SKIP,
        last_autopay_free=APIHelper.SKIP,
        client_terminate_online=APIHelper.SKIP,
        membership_type_restrictions=APIHelper.SKIP,
        location_purchase_restriction_ids=APIHelper.SKIP,
        location_purchase_restriction_names=APIHelper.SKIP,
        agreement_terms=APIHelper.SKIP,
        requires_electronic_confirmation=APIHelper.SKIP,
        autopay_enabled=APIHelper.SKIP,
        first_payment_amount_subtotal=APIHelper.SKIP,
        first_payment_amount_tax=APIHelper.SKIP,
        first_payment_amount_total=APIHelper.SKIP,
        recurring_payment_amount_subtotal=APIHelper.SKIP,
        recurring_payment_amount_tax=APIHelper.SKIP,
        recurring_payment_amount_total=APIHelper.SKIP,
        total_contract_amount_subtotal=APIHelper.SKIP,
        total_contract_amount_tax=APIHelper.SKIP,
        total_contract_amount_total=APIHelper.SKIP,
        promo_payment_amount_subtotal=APIHelper.SKIP,
        promo_payment_amount_tax=APIHelper.SKIP,
        promo_payment_amount_total=APIHelper.SKIP,
        number_of_promo_autopays=APIHelper.SKIP):
        """Initialize a Contract instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if name is not APIHelper.SKIP:
            self.name = name
        if description is not APIHelper.SKIP:
            self.description = description
        if assigns_membership_id is not APIHelper.SKIP:
            self.assigns_membership_id = assigns_membership_id
        if assigns_membership_name is not APIHelper.SKIP:
            self.assigns_membership_name = assigns_membership_name
        if sold_online is not APIHelper.SKIP:
            self.sold_online = sold_online
        if contract_items is not APIHelper.SKIP:
            self.contract_items = contract_items
        if intro_offer is not APIHelper.SKIP:
            self.intro_offer = intro_offer
        if autopay_schedule is not APIHelper.SKIP:
            self.autopay_schedule = autopay_schedule
        if number_of_autopays is not APIHelper.SKIP:
            self.number_of_autopays = number_of_autopays
        if autopay_trigger_type is not APIHelper.SKIP:
            self.autopay_trigger_type = autopay_trigger_type
        if action_upon_completion_of_autopays is not APIHelper.SKIP:
            self.action_upon_completion_of_autopays =\
                 action_upon_completion_of_autopays
        if clients_charged_on is not APIHelper.SKIP:
            self.clients_charged_on = clients_charged_on
        if clients_charged_on_specific_date is not APIHelper.SKIP:
            self.clients_charged_on_specific_date =\
                 APIHelper.apply_datetime_converter(
                clients_charged_on_specific_date, APIHelper.RFC3339DateTime)\
                 if clients_charged_on_specific_date else None
        if discount_amount is not APIHelper.SKIP:
            self.discount_amount = discount_amount
        if deposit_amount is not APIHelper.SKIP:
            self.deposit_amount = deposit_amount
        if first_autopay_free is not APIHelper.SKIP:
            self.first_autopay_free = first_autopay_free
        if last_autopay_free is not APIHelper.SKIP:
            self.last_autopay_free = last_autopay_free
        if client_terminate_online is not APIHelper.SKIP:
            self.client_terminate_online = client_terminate_online
        if membership_type_restrictions is not APIHelper.SKIP:
            self.membership_type_restrictions = membership_type_restrictions
        if location_purchase_restriction_ids is not APIHelper.SKIP:
            self.location_purchase_restriction_ids =\
                 location_purchase_restriction_ids
        if location_purchase_restriction_names is not APIHelper.SKIP:
            self.location_purchase_restriction_names =\
                 location_purchase_restriction_names
        if agreement_terms is not APIHelper.SKIP:
            self.agreement_terms = agreement_terms
        if requires_electronic_confirmation is not APIHelper.SKIP:
            self.requires_electronic_confirmation = requires_electronic_confirmation
        if autopay_enabled is not APIHelper.SKIP:
            self.autopay_enabled = autopay_enabled
        if first_payment_amount_subtotal is not APIHelper.SKIP:
            self.first_payment_amount_subtotal = first_payment_amount_subtotal
        if first_payment_amount_tax is not APIHelper.SKIP:
            self.first_payment_amount_tax = first_payment_amount_tax
        if first_payment_amount_total is not APIHelper.SKIP:
            self.first_payment_amount_total = first_payment_amount_total
        if recurring_payment_amount_subtotal is not APIHelper.SKIP:
            self.recurring_payment_amount_subtotal =\
                 recurring_payment_amount_subtotal
        if recurring_payment_amount_tax is not APIHelper.SKIP:
            self.recurring_payment_amount_tax = recurring_payment_amount_tax
        if recurring_payment_amount_total is not APIHelper.SKIP:
            self.recurring_payment_amount_total = recurring_payment_amount_total
        if total_contract_amount_subtotal is not APIHelper.SKIP:
            self.total_contract_amount_subtotal = total_contract_amount_subtotal
        if total_contract_amount_tax is not APIHelper.SKIP:
            self.total_contract_amount_tax = total_contract_amount_tax
        if total_contract_amount_total is not APIHelper.SKIP:
            self.total_contract_amount_total = total_contract_amount_total
        if promo_payment_amount_subtotal is not APIHelper.SKIP:
            self.promo_payment_amount_subtotal = promo_payment_amount_subtotal
        if promo_payment_amount_tax is not APIHelper.SKIP:
            self.promo_payment_amount_tax = promo_payment_amount_tax
        if promo_payment_amount_total is not APIHelper.SKIP:
            self.promo_payment_amount_total = promo_payment_amount_total
        if number_of_promo_autopays is not APIHelper.SKIP:
            self.number_of_promo_autopays = number_of_promo_autopays

    @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
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        name =\
            dictionary.get("Name")\
            if dictionary.get("Name")\
                else APIHelper.SKIP
        description =\
            dictionary.get("Description")\
            if dictionary.get("Description")\
                else APIHelper.SKIP
        assigns_membership_id =\
            dictionary.get("AssignsMembershipId")\
            if dictionary.get("AssignsMembershipId")\
                else APIHelper.SKIP
        assigns_membership_name =\
            dictionary.get("AssignsMembershipName")\
            if dictionary.get("AssignsMembershipName")\
                else APIHelper.SKIP
        sold_online =\
            dictionary.get("SoldOnline")\
            if "SoldOnline" in dictionary.keys()\
                else APIHelper.SKIP
        contract_items = None
        if dictionary.get("ContractItems") is not None:
            contract_items = [
                ContractItem.from_dictionary(x)
                    for x in dictionary.get("ContractItems")
            ]
        else:
            contract_items = APIHelper.SKIP
        intro_offer =\
            dictionary.get("IntroOffer")\
            if dictionary.get("IntroOffer")\
                else APIHelper.SKIP
        autopay_schedule =\
            AutopaySchedule.from_dictionary(
                dictionary.get("AutopaySchedule"))\
                if "AutopaySchedule" in dictionary.keys()\
                else APIHelper.SKIP
        number_of_autopays =\
            dictionary.get("NumberOfAutopays")\
            if dictionary.get("NumberOfAutopays")\
                else APIHelper.SKIP
        autopay_trigger_type =\
            dictionary.get("AutopayTriggerType")\
            if dictionary.get("AutopayTriggerType")\
                else APIHelper.SKIP
        action_upon_completion_of_autopays =\
            dictionary.get("ActionUponCompletionOfAutopays")\
            if dictionary.get("ActionUponCompletionOfAutopays")\
                else APIHelper.SKIP
        clients_charged_on =\
            dictionary.get("ClientsChargedOn")\
            if dictionary.get("ClientsChargedOn")\
                else APIHelper.SKIP
        clients_charged_on_specific_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("ClientsChargedOnSpecificDate")).datetime\
            if dictionary.get("ClientsChargedOnSpecificDate") else APIHelper.SKIP
        discount_amount =\
            dictionary.get("DiscountAmount")\
            if dictionary.get("DiscountAmount")\
                else APIHelper.SKIP
        deposit_amount =\
            dictionary.get("DepositAmount")\
            if dictionary.get("DepositAmount")\
                else APIHelper.SKIP
        first_autopay_free =\
            dictionary.get("FirstAutopayFree")\
            if "FirstAutopayFree" in dictionary.keys()\
                else APIHelper.SKIP
        last_autopay_free =\
            dictionary.get("LastAutopayFree")\
            if "LastAutopayFree" in dictionary.keys()\
                else APIHelper.SKIP
        client_terminate_online =\
            dictionary.get("ClientTerminateOnline")\
            if "ClientTerminateOnline" in dictionary.keys()\
                else APIHelper.SKIP
        membership_type_restrictions = None
        if dictionary.get("MembershipTypeRestrictions") is not None:
            membership_type_restrictions = [
                MembershipTypeRestriction.from_dictionary(x)
                    for x in dictionary.get("MembershipTypeRestrictions")
            ]
        else:
            membership_type_restrictions = APIHelper.SKIP
        location_purchase_restriction_ids =\
            dictionary.get("LocationPurchaseRestrictionIds")\
            if dictionary.get("LocationPurchaseRestrictionIds")\
                else APIHelper.SKIP
        location_purchase_restriction_names =\
            dictionary.get("LocationPurchaseRestrictionNames")\
            if dictionary.get("LocationPurchaseRestrictionNames")\
                else APIHelper.SKIP
        agreement_terms =\
            dictionary.get("AgreementTerms")\
            if dictionary.get("AgreementTerms")\
                else APIHelper.SKIP
        requires_electronic_confirmation =\
            dictionary.get("RequiresElectronicConfirmation")\
            if "RequiresElectronicConfirmation" in dictionary.keys()\
                else APIHelper.SKIP
        autopay_enabled =\
            dictionary.get("AutopayEnabled")\
            if "AutopayEnabled" in dictionary.keys()\
                else APIHelper.SKIP
        first_payment_amount_subtotal =\
            dictionary.get("FirstPaymentAmountSubtotal")\
            if dictionary.get("FirstPaymentAmountSubtotal")\
                else APIHelper.SKIP
        first_payment_amount_tax =\
            dictionary.get("FirstPaymentAmountTax")\
            if dictionary.get("FirstPaymentAmountTax")\
                else APIHelper.SKIP
        first_payment_amount_total =\
            dictionary.get("FirstPaymentAmountTotal")\
            if dictionary.get("FirstPaymentAmountTotal")\
                else APIHelper.SKIP
        recurring_payment_amount_subtotal =\
            dictionary.get("RecurringPaymentAmountSubtotal")\
            if dictionary.get("RecurringPaymentAmountSubtotal")\
                else APIHelper.SKIP
        recurring_payment_amount_tax =\
            dictionary.get("RecurringPaymentAmountTax")\
            if dictionary.get("RecurringPaymentAmountTax")\
                else APIHelper.SKIP
        recurring_payment_amount_total =\
            dictionary.get("RecurringPaymentAmountTotal")\
            if dictionary.get("RecurringPaymentAmountTotal")\
                else APIHelper.SKIP
        total_contract_amount_subtotal =\
            dictionary.get("TotalContractAmountSubtotal")\
            if dictionary.get("TotalContractAmountSubtotal")\
                else APIHelper.SKIP
        total_contract_amount_tax =\
            dictionary.get("TotalContractAmountTax")\
            if dictionary.get("TotalContractAmountTax")\
                else APIHelper.SKIP
        total_contract_amount_total =\
            dictionary.get("TotalContractAmountTotal")\
            if dictionary.get("TotalContractAmountTotal")\
                else APIHelper.SKIP
        promo_payment_amount_subtotal =\
            dictionary.get("PromoPaymentAmountSubtotal")\
            if dictionary.get("PromoPaymentAmountSubtotal")\
                else APIHelper.SKIP
        promo_payment_amount_tax =\
            dictionary.get("PromoPaymentAmountTax")\
            if dictionary.get("PromoPaymentAmountTax")\
                else APIHelper.SKIP
        promo_payment_amount_total =\
            dictionary.get("PromoPaymentAmountTotal")\
            if dictionary.get("PromoPaymentAmountTotal")\
                else APIHelper.SKIP
        number_of_promo_autopays =\
            dictionary.get("NumberOfPromoAutopays")\
            if dictionary.get("NumberOfPromoAutopays")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(id,
                   name,
                   description,
                   assigns_membership_id,
                   assigns_membership_name,
                   sold_online,
                   contract_items,
                   intro_offer,
                   autopay_schedule,
                   number_of_autopays,
                   autopay_trigger_type,
                   action_upon_completion_of_autopays,
                   clients_charged_on,
                   clients_charged_on_specific_date,
                   discount_amount,
                   deposit_amount,
                   first_autopay_free,
                   last_autopay_free,
                   client_terminate_online,
                   membership_type_restrictions,
                   location_purchase_restriction_ids,
                   location_purchase_restriction_names,
                   agreement_terms,
                   requires_electronic_confirmation,
                   autopay_enabled,
                   first_payment_amount_subtotal,
                   first_payment_amount_tax,
                   first_payment_amount_total,
                   recurring_payment_amount_subtotal,
                   recurring_payment_amount_tax,
                   recurring_payment_amount_total,
                   total_contract_amount_subtotal,
                   total_contract_amount_tax,
                   total_contract_amount_total,
                   promo_payment_amount_subtotal,
                   promo_payment_amount_tax,
                   promo_payment_amount_total,
                   number_of_promo_autopays)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _assigns_membership_id=(
            self.assigns_membership_id
            if hasattr(self, "assigns_membership_id")
            else None
        )
        _assigns_membership_name=(
            self.assigns_membership_name
            if hasattr(self, "assigns_membership_name")
            else None
        )
        _sold_online=(
            self.sold_online
            if hasattr(self, "sold_online")
            else None
        )
        _contract_items=(
            self.contract_items
            if hasattr(self, "contract_items")
            else None
        )
        _intro_offer=(
            self.intro_offer
            if hasattr(self, "intro_offer")
            else None
        )
        _autopay_schedule=(
            self.autopay_schedule
            if hasattr(self, "autopay_schedule")
            else None
        )
        _number_of_autopays=(
            self.number_of_autopays
            if hasattr(self, "number_of_autopays")
            else None
        )
        _autopay_trigger_type=(
            self.autopay_trigger_type
            if hasattr(self, "autopay_trigger_type")
            else None
        )
        _action_upon_completion_of_autopays=(
            self.action_upon_completion_of_autopays
            if hasattr(self, "action_upon_completion_of_autopays")
            else None
        )
        _clients_charged_on=(
            self.clients_charged_on
            if hasattr(self, "clients_charged_on")
            else None
        )
        _clients_charged_on_specific_date=(
            self.clients_charged_on_specific_date
            if hasattr(self, "clients_charged_on_specific_date")
            else None
        )
        _discount_amount=(
            self.discount_amount
            if hasattr(self, "discount_amount")
            else None
        )
        _deposit_amount=(
            self.deposit_amount
            if hasattr(self, "deposit_amount")
            else None
        )
        _first_autopay_free=(
            self.first_autopay_free
            if hasattr(self, "first_autopay_free")
            else None
        )
        _last_autopay_free=(
            self.last_autopay_free
            if hasattr(self, "last_autopay_free")
            else None
        )
        _client_terminate_online=(
            self.client_terminate_online
            if hasattr(self, "client_terminate_online")
            else None
        )
        _membership_type_restrictions=(
            self.membership_type_restrictions
            if hasattr(self, "membership_type_restrictions")
            else None
        )
        _location_purchase_restriction_ids=(
            self.location_purchase_restriction_ids
            if hasattr(self, "location_purchase_restriction_ids")
            else None
        )
        _location_purchase_restriction_names=(
            self.location_purchase_restriction_names
            if hasattr(self, "location_purchase_restriction_names")
            else None
        )
        _agreement_terms=(
            self.agreement_terms
            if hasattr(self, "agreement_terms")
            else None
        )
        _requires_electronic_confirmation=(
            self.requires_electronic_confirmation
            if hasattr(self, "requires_electronic_confirmation")
            else None
        )
        _autopay_enabled=(
            self.autopay_enabled
            if hasattr(self, "autopay_enabled")
            else None
        )
        _first_payment_amount_subtotal=(
            self.first_payment_amount_subtotal
            if hasattr(self, "first_payment_amount_subtotal")
            else None
        )
        _first_payment_amount_tax=(
            self.first_payment_amount_tax
            if hasattr(self, "first_payment_amount_tax")
            else None
        )
        _first_payment_amount_total=(
            self.first_payment_amount_total
            if hasattr(self, "first_payment_amount_total")
            else None
        )
        _recurring_payment_amount_subtotal=(
            self.recurring_payment_amount_subtotal
            if hasattr(self, "recurring_payment_amount_subtotal")
            else None
        )
        _recurring_payment_amount_tax=(
            self.recurring_payment_amount_tax
            if hasattr(self, "recurring_payment_amount_tax")
            else None
        )
        _recurring_payment_amount_total=(
            self.recurring_payment_amount_total
            if hasattr(self, "recurring_payment_amount_total")
            else None
        )
        _total_contract_amount_subtotal=(
            self.total_contract_amount_subtotal
            if hasattr(self, "total_contract_amount_subtotal")
            else None
        )
        _total_contract_amount_tax=(
            self.total_contract_amount_tax
            if hasattr(self, "total_contract_amount_tax")
            else None
        )
        _total_contract_amount_total=(
            self.total_contract_amount_total
            if hasattr(self, "total_contract_amount_total")
            else None
        )
        _promo_payment_amount_subtotal=(
            self.promo_payment_amount_subtotal
            if hasattr(self, "promo_payment_amount_subtotal")
            else None
        )
        _promo_payment_amount_tax=(
            self.promo_payment_amount_tax
            if hasattr(self, "promo_payment_amount_tax")
            else None
        )
        _promo_payment_amount_total=(
            self.promo_payment_amount_total
            if hasattr(self, "promo_payment_amount_total")
            else None
        )
        _number_of_promo_autopays=(
            self.number_of_promo_autopays
            if hasattr(self, "number_of_promo_autopays")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"name={_name!r}, "
            f"description={_description!r}, "
            f"assigns_membership_id={_assigns_membership_id!r}, "
            f"assigns_membership_name={_assigns_membership_name!r}, "
            f"sold_online={_sold_online!r}, "
            f"contract_items={_contract_items!r}, "
            f"intro_offer={_intro_offer!r}, "
            f"autopay_schedule={_autopay_schedule!r}, "
            f"number_of_autopays={_number_of_autopays!r}, "
            f"autopay_trigger_type={_autopay_trigger_type!r}, "
            f"action_upon_completion_of_autopays={_action_upon_completion_of_autopays!r}, "
            f"clients_charged_on={_clients_charged_on!r}, "
            f"clients_charged_on_specific_date={_clients_charged_on_specific_date!r}, "
            f"discount_amount={_discount_amount!r}, "
            f"deposit_amount={_deposit_amount!r}, "
            f"first_autopay_free={_first_autopay_free!r}, "
            f"last_autopay_free={_last_autopay_free!r}, "
            f"client_terminate_online={_client_terminate_online!r}, "
            f"membership_type_restrictions={_membership_type_restrictions!r}, "
            f"location_purchase_restriction_ids={_location_purchase_restriction_ids!r}, "
            f"location_purchase_restriction_names={_location_purchase_restriction_names!r}, "
            f"agreement_terms={_agreement_terms!r}, "
            f"requires_electronic_confirmation={_requires_electronic_confirmation!r}, "
            f"autopay_enabled={_autopay_enabled!r}, "
            f"first_payment_amount_subtotal={_first_payment_amount_subtotal!r}, "
            f"first_payment_amount_tax={_first_payment_amount_tax!r}, "
            f"first_payment_amount_total={_first_payment_amount_total!r}, "
            f"recurring_payment_amount_subtotal={_recurring_payment_amount_subtotal!r}, "
            f"recurring_payment_amount_tax={_recurring_payment_amount_tax!r}, "
            f"recurring_payment_amount_total={_recurring_payment_amount_total!r}, "
            f"total_contract_amount_subtotal={_total_contract_amount_subtotal!r}, "
            f"total_contract_amount_tax={_total_contract_amount_tax!r}, "
            f"total_contract_amount_total={_total_contract_amount_total!r}, "
            f"promo_payment_amount_subtotal={_promo_payment_amount_subtotal!r}, "
            f"promo_payment_amount_tax={_promo_payment_amount_tax!r}, "
            f"promo_payment_amount_total={_promo_payment_amount_total!r}, "
            f"number_of_promo_autopays={_number_of_promo_autopays!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _description=(
            self.description
            if hasattr(self, "description")
            else None
        )
        _assigns_membership_id=(
            self.assigns_membership_id
            if hasattr(self, "assigns_membership_id")
            else None
        )
        _assigns_membership_name=(
            self.assigns_membership_name
            if hasattr(self, "assigns_membership_name")
            else None
        )
        _sold_online=(
            self.sold_online
            if hasattr(self, "sold_online")
            else None
        )
        _contract_items=(
            self.contract_items
            if hasattr(self, "contract_items")
            else None
        )
        _intro_offer=(
            self.intro_offer
            if hasattr(self, "intro_offer")
            else None
        )
        _autopay_schedule=(
            self.autopay_schedule
            if hasattr(self, "autopay_schedule")
            else None
        )
        _number_of_autopays=(
            self.number_of_autopays
            if hasattr(self, "number_of_autopays")
            else None
        )
        _autopay_trigger_type=(
            self.autopay_trigger_type
            if hasattr(self, "autopay_trigger_type")
            else None
        )
        _action_upon_completion_of_autopays=(
            self.action_upon_completion_of_autopays
            if hasattr(self, "action_upon_completion_of_autopays")
            else None
        )
        _clients_charged_on=(
            self.clients_charged_on
            if hasattr(self, "clients_charged_on")
            else None
        )
        _clients_charged_on_specific_date=(
            self.clients_charged_on_specific_date
            if hasattr(self, "clients_charged_on_specific_date")
            else None
        )
        _discount_amount=(
            self.discount_amount
            if hasattr(self, "discount_amount")
            else None
        )
        _deposit_amount=(
            self.deposit_amount
            if hasattr(self, "deposit_amount")
            else None
        )
        _first_autopay_free=(
            self.first_autopay_free
            if hasattr(self, "first_autopay_free")
            else None
        )
        _last_autopay_free=(
            self.last_autopay_free
            if hasattr(self, "last_autopay_free")
            else None
        )
        _client_terminate_online=(
            self.client_terminate_online
            if hasattr(self, "client_terminate_online")
            else None
        )
        _membership_type_restrictions=(
            self.membership_type_restrictions
            if hasattr(self, "membership_type_restrictions")
            else None
        )
        _location_purchase_restriction_ids=(
            self.location_purchase_restriction_ids
            if hasattr(self, "location_purchase_restriction_ids")
            else None
        )
        _location_purchase_restriction_names=(
            self.location_purchase_restriction_names
            if hasattr(self, "location_purchase_restriction_names")
            else None
        )
        _agreement_terms=(
            self.agreement_terms
            if hasattr(self, "agreement_terms")
            else None
        )
        _requires_electronic_confirmation=(
            self.requires_electronic_confirmation
            if hasattr(self, "requires_electronic_confirmation")
            else None
        )
        _autopay_enabled=(
            self.autopay_enabled
            if hasattr(self, "autopay_enabled")
            else None
        )
        _first_payment_amount_subtotal=(
            self.first_payment_amount_subtotal
            if hasattr(self, "first_payment_amount_subtotal")
            else None
        )
        _first_payment_amount_tax=(
            self.first_payment_amount_tax
            if hasattr(self, "first_payment_amount_tax")
            else None
        )
        _first_payment_amount_total=(
            self.first_payment_amount_total
            if hasattr(self, "first_payment_amount_total")
            else None
        )
        _recurring_payment_amount_subtotal=(
            self.recurring_payment_amount_subtotal
            if hasattr(self, "recurring_payment_amount_subtotal")
            else None
        )
        _recurring_payment_amount_tax=(
            self.recurring_payment_amount_tax
            if hasattr(self, "recurring_payment_amount_tax")
            else None
        )
        _recurring_payment_amount_total=(
            self.recurring_payment_amount_total
            if hasattr(self, "recurring_payment_amount_total")
            else None
        )
        _total_contract_amount_subtotal=(
            self.total_contract_amount_subtotal
            if hasattr(self, "total_contract_amount_subtotal")
            else None
        )
        _total_contract_amount_tax=(
            self.total_contract_amount_tax
            if hasattr(self, "total_contract_amount_tax")
            else None
        )
        _total_contract_amount_total=(
            self.total_contract_amount_total
            if hasattr(self, "total_contract_amount_total")
            else None
        )
        _promo_payment_amount_subtotal=(
            self.promo_payment_amount_subtotal
            if hasattr(self, "promo_payment_amount_subtotal")
            else None
        )
        _promo_payment_amount_tax=(
            self.promo_payment_amount_tax
            if hasattr(self, "promo_payment_amount_tax")
            else None
        )
        _promo_payment_amount_total=(
            self.promo_payment_amount_total
            if hasattr(self, "promo_payment_amount_total")
            else None
        )
        _number_of_promo_autopays=(
            self.number_of_promo_autopays
            if hasattr(self, "number_of_promo_autopays")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"name={_name!s}, "
            f"description={_description!s}, "
            f"assigns_membership_id={_assigns_membership_id!s}, "
            f"assigns_membership_name={_assigns_membership_name!s}, "
            f"sold_online={_sold_online!s}, "
            f"contract_items={_contract_items!s}, "
            f"intro_offer={_intro_offer!s}, "
            f"autopay_schedule={_autopay_schedule!s}, "
            f"number_of_autopays={_number_of_autopays!s}, "
            f"autopay_trigger_type={_autopay_trigger_type!s}, "
            f"action_upon_completion_of_autopays={_action_upon_completion_of_autopays!s}, "
            f"clients_charged_on={_clients_charged_on!s}, "
            f"clients_charged_on_specific_date={_clients_charged_on_specific_date!s}, "
            f"discount_amount={_discount_amount!s}, "
            f"deposit_amount={_deposit_amount!s}, "
            f"first_autopay_free={_first_autopay_free!s}, "
            f"last_autopay_free={_last_autopay_free!s}, "
            f"client_terminate_online={_client_terminate_online!s}, "
            f"membership_type_restrictions={_membership_type_restrictions!s}, "
            f"location_purchase_restriction_ids={_location_purchase_restriction_ids!s}, "
            f"location_purchase_restriction_names={_location_purchase_restriction_names!s}, "
            f"agreement_terms={_agreement_terms!s}, "
            f"requires_electronic_confirmation={_requires_electronic_confirmation!s}, "
            f"autopay_enabled={_autopay_enabled!s}, "
            f"first_payment_amount_subtotal={_first_payment_amount_subtotal!s}, "
            f"first_payment_amount_tax={_first_payment_amount_tax!s}, "
            f"first_payment_amount_total={_first_payment_amount_total!s}, "
            f"recurring_payment_amount_subtotal={_recurring_payment_amount_subtotal!s}, "
            f"recurring_payment_amount_tax={_recurring_payment_amount_tax!s}, "
            f"recurring_payment_amount_total={_recurring_payment_amount_total!s}, "
            f"total_contract_amount_subtotal={_total_contract_amount_subtotal!s}, "
            f"total_contract_amount_tax={_total_contract_amount_tax!s}, "
            f"total_contract_amount_total={_total_contract_amount_total!s}, "
            f"promo_payment_amount_subtotal={_promo_payment_amount_subtotal!s}, "
            f"promo_payment_amount_tax={_promo_payment_amount_tax!s}, "
            f"promo_payment_amount_total={_promo_payment_amount_total!s}, "
            f"number_of_promo_autopays={_number_of_promo_autopays!s}, "
            f")"
        )
