UpdateServiceChargePlanV2 models

DataSet models for UpdateServiceChargePlanV2.

These typed dataclass models represent the tables and columns within the DataSet parameters for the UpdateServiceChargePlanV2 HQ operation.

IMPORTANT: Update operations require a GET first to populate the original_record field. HQ uses the unchanged row for optimistic concurrency checking.

Usage:

from q2_sdk.hq.hq_api.backoffice import UpdateServiceChargePlanV2

q2_service_charge_plan_edit_v2 = UpdateServiceChargePlanV2.Q2ServiceChargePlanEditV2(
    plan_name="...",
    description="...",
    months_free=1,
    base_fee=1.0,
    max_usage_fee=1.0,
    max_txn_fee=1.0,
    sum_usage_and_txn_fees=True,
    no_max_usage_fee=True,
    no_max_txn_fee=True,
)

q2_service_charge_plan_fee_edit_v2 = UpdateServiceChargePlanV2.Q2ServiceChargePlanFeeEditV2(
    service_charge_plan_id=1,
    base_fee=1.0,
    number_free=1,
    additional_use_dollars=1.0,
    only_if_used=True,
    max_fee=1.0,
    fee_type_id=1,
    short_name="...",
    description="...",
    additional_use_percent_of_txn=1.0,
    is_usage_fee=True,
)
class q2_sdk.hq.hq_api.backoffice.UpdateServiceChargePlanV2_models.Q2ServiceChargePlanEditV2(service_charge_plan_id=-1, plan_name='', description='', months_free=0, base_fee=0.0, max_usage_fee=0.0, max_txn_fee=0.0, sum_usage_and_txn_fees=False, no_max_usage_fee=False, no_max_txn_fee=False, original_record=None)[source]

Bases: object

Represents a row in the Q2_ServiceChargePlanEditV2 table.

service_charge_plan_id: int = -1
plan_name: str = ''
description: str = ''
months_free: int = 0
base_fee: float = 0.0
max_usage_fee: float = 0.0
max_txn_fee: float = 0.0
sum_usage_and_txn_fees: bool = False
no_max_usage_fee: bool = False
no_max_txn_fee: bool = False
original_record: Q2ServiceChargePlanEditV2 | None = None
static get_columns()[source]

Returns [[HqColumnName, pythonAttrName], …] mapping.

Return type:

list[list[str]]

to_row_values()[source]

Returns column values in get_columns() order.

Return type:

list[Any]

classmethod from_hq_response(row_elem)[source]

Parse an lxml row element into this model with original_record set.

Return type:

Q2ServiceChargePlanEditV2

class q2_sdk.hq.hq_api.backoffice.UpdateServiceChargePlanV2_models.Q2ServiceChargePlanFeeEditV2(service_charge_plan_id=0, base_fee=0.0, number_free=0, additional_use_dollars=0.0, only_if_used=False, max_fee=0.0, fee_type_id=0, short_name='', description='', additional_use_percent_of_txn=0.0, is_usage_fee=False, original_record=None)[source]

Bases: object

Represents a row in the Q2_ServiceChargePlanFeeEditV2 table.

service_charge_plan_id: int = 0
base_fee: float = 0.0
number_free: int = 0
additional_use_dollars: float = 0.0
only_if_used: bool = False
max_fee: float = 0.0
fee_type_id: int = 0
short_name: str = ''
description: str = ''
additional_use_percent_of_txn: float = 0.0
is_usage_fee: bool = False
original_record: Q2ServiceChargePlanFeeEditV2 | None = None
static get_columns()[source]

Returns [[HqColumnName, pythonAttrName], …] mapping.

Return type:

list[list[str]]

to_row_values()[source]

Returns column values in get_columns() order.

Return type:

list[Any]

classmethod from_hq_response(row_elem)[source]

Parse an lxml row element into this model with original_record set.

Return type:

Q2ServiceChargePlanFeeEditV2

q2_sdk.hq.hq_api.backoffice.UpdateServiceChargePlanV2_models.build_service_charge_plan_edit_dataset(q2_service_charge_plan_edit_v2=None, q2_service_charge_plan_fee_edit_v2=None)[source]

Build the service_charge_plan_edit DataSet parameter for UpdateServiceChargePlanV2.

For update operations, each model instance should have its original_record set to the pre-modification state (from a prior GET call).

For add operations, set auto-increment ID fields to negative values.

Return type:

DataSetBuilder

Returns:

DataSetBuilder ready to pass as the ‘service_charge_plan_edit’ parameter