AddCustomer models

DataSet models for AddCustomer.

These typed dataclass models represent the tables and columns within the DataSet parameters for the AddCustomer 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 AddCustomer

q2_customer = AddCustomer.Q2Customer(
    customer_name="...",
    is_company=True,
    create_date="...",
    auto_generated=True,
    group_id=1,
    charge_plan_start_date="...",
)

q2_phone_number = AddCustomer.Q2PhoneNumber(
    country_id=1,
    city_or_area_code="...",
    local_number="...",
    phone_type=1,
)

q2_customer_account = AddCustomer.Q2CustomerAccount(
    customer_id=1,
    access=1,
    primary_only=True,
)

q2_customer_account_access_view = AddCustomer.Q2CustomerAccountAccessView(
    customer_account_id=1,
    customer_id=1,
    current_access_flag=1,
)

q2_subsidiary_view = AddCustomer.Q2SubsidiaryView(
    subsidiary_id=1,
    customer_id=1,
    display_name="...",
)

q2_address = AddCustomer.Q2Address(
    street_address1="...",
    city="...",
    address_type=1,
    country_id=1,
    is_international=True,
)

transaction_rights = AddCustomer.TransactionRights(
    transaction_type_id=1,
    transaction_type="...",
    description="...",
    enabled=True,
    authorize=True,
    cancel=True,
    create=True,
    create_restricted=True,
    update=True,
    view=1,
    limit_per_transaction=1.0,
    limit_per_day=1.0,
    limit_per_month=1.0,
    limit_per_acct_per_day=1.0,
    count_per_acct_per_day=1,
    count_per_day=1,
    count_per_month=1,
    dual_approval_limit=1.0,
    token_required_limit=1.0,
    bit_flags=1,
)

user_rights = AddCustomer.UserRights(
    rights_short_name="...",
    rights_long_name="...",
    has_rights=True,
)

user_monetary_rights = AddCustomer.UserMonetaryRights(
    rights_short_name="...",
    rights_long_name="...",
    amount=1.0,
)

q2_customer_account_view = AddCustomer.Q2CustomerAccountView(
    customer_account_id=1,
    customer_id=1,
    host_account_id=1,
    account_number_internal="...",
    product_name="...",
    is_external_account=True,
    product_id=1,
    product_type_id=1,
    user_access=1,
    current_access_flag=1,
)
class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2Customer(customer_id=-1, customer_name='', tax_id=None, is_company=False, service_charge_plan_id=None, charge_account=None, create_date='', default_address_id=None, auto_generated=False, deleted_date=None, group_id=0, charge_plan_start_date='', cust_info=None, primary_cif=None, policy_id=None, company_policy_id=None, host_user=None, host_pwd=None, legal_entity_identifier=None, host_account_not_allowed_for_ach=None, restricted_entitlement_profile_id=None, restricted_entitlement_last_change=None, original_record=None)[source]

Bases: object

Represents a row in the Q2_Customer table.

customer_id: int = -1
customer_name: str = ''
tax_id: str | None = None
is_company: bool = False
service_charge_plan_id: int | None = None
charge_account: int | None = None
create_date: str = ''
default_address_id: int | None = None
auto_generated: bool = False
deleted_date: str | None = None
group_id: int = 0
charge_plan_start_date: str = ''
cust_info: str | None = None
primary_cif: str | None = None
policy_id: int | None = None
company_policy_id: int | None = None
host_user: str | None = None
host_pwd: str | None = None
legal_entity_identifier: str | None = None
host_account_not_allowed_for_ach: bool | None = None
restricted_entitlement_profile_id: int | None = None
restricted_entitlement_last_change: str | None = None
original_record: Q2Customer | 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:

Q2Customer

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2PhoneNumber(phone_id=-1, country_id=0, city_or_area_code='', local_number='', extension=None, phone_type=0, user_id=None, customer_id=None, original_record=None)[source]

Bases: object

Represents a row in the Q2_PhoneNumber table.

phone_id: int = -1
country_id: int = 0
city_or_area_code: str = ''
local_number: str = ''
extension: str | None = None
phone_type: int = 0
user_id: int | None = None
customer_id: int | None = None
original_record: Q2PhoneNumber | 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:

Q2PhoneNumber

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2CustomerAccount(customer_account_id=-1, customer_id=0, host_internal_cif=None, host_account_id=None, access=0, primary_only=False, original_record=None)[source]

Bases: object

Represents a row in the Q2_CustomerAccount table.

customer_account_id: int = -1
customer_id: int = 0
host_internal_cif: str | None = None
host_account_id: int | None = None
access: int = 0
primary_only: bool = False
original_record: Q2CustomerAccount | 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:

Q2CustomerAccount

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2CustomerAccountAccessView(customer_account_id=0, customer_id=0, host_internal_cif=None, host_account_id=None, product_id=None, product_type_id=None, current_access_flag=0, valid_system_access_flag=None, original_record=None)[source]

Bases: object

Represents a row in the Q2_CustomerAccountAccessView table.

customer_account_id: int = 0
customer_id: int = 0
host_internal_cif: str | None = None
host_account_id: int | None = None
product_id: int | None = None
product_type_id: int | None = None
current_access_flag: int = 0
valid_system_access_flag: int | None = None
original_record: Q2CustomerAccountAccessView | 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:

Q2CustomerAccountAccessView

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2SubsidiaryView(subsidiary_id=0, customer_id=0, display_name='', ach_name=None, ach_tax_id=None, wire_name=None, wire_address1=None, wire_address2=None, wire_city=None, wire_state=None, wire_postal_code=None, wire_country_id=None, wire_is_international=None, wire_province=None, wire_address_id=None, original_record=None)[source]

Bases: object

Represents a row in the Q2_SubsidiaryView table.

subsidiary_id: int = 0
customer_id: int = 0
display_name: str = ''
ach_name: str | None = None
ach_tax_id: str | None = None
wire_name: str | None = None
wire_address1: str | None = None
wire_address2: str | None = None
wire_city: str | None = None
wire_state: str | None = None
wire_postal_code: str | None = None
wire_country_id: int | None = None
wire_is_international: bool | None = None
wire_province: str | None = None
wire_address_id: int | None = None
original_record: Q2SubsidiaryView | 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:

Q2SubsidiaryView

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2Address(address_id=-1, street_address1='', street_address2=None, city='', state=None, postal_code=None, customer_id=None, address_type=0, user_id=None, country_id=0, is_international=False, province=None, original_record=None)[source]

Bases: object

Represents a row in the Q2_Address table.

address_id: int = -1
street_address1: str = ''
street_address2: str | None = None
city: str = ''
state: str | None = None
postal_code: str | None = None
customer_id: int | None = None
address_type: int = 0
user_id: int | None = None
country_id: int = 0
is_international: bool = False
province: str | None = None
original_record: Q2Address | 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:

Q2Address

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.TransactionRights(transaction_type_id=0, transaction_type='', description='', enabled=False, authorize=False, cancel=False, create=False, create_restricted=False, update=False, view=0, limit_per_transaction=0.0, limit_per_day=0.0, limit_per_month=0.0, limit_per_acct_per_day=0.0, count_per_acct_per_day=0, count_per_day=0, count_per_month=0, dual_approval_limit=0.0, token_required_limit=0.0, bit_flags=0, original_record=None)[source]

Bases: object

Represents a row in the TransactionRights table.

transaction_type_id: int = 0
transaction_type: str = ''
description: str = ''
enabled: bool = False
authorize: bool = False
cancel: bool = False
create: bool = False
create_restricted: bool = False
update: bool = False
view: int = 0
limit_per_transaction: float = 0.0
limit_per_day: float = 0.0
limit_per_month: float = 0.0
limit_per_acct_per_day: float = 0.0
count_per_acct_per_day: int = 0
count_per_day: int = 0
count_per_month: int = 0
dual_approval_limit: float = 0.0
token_required_limit: float = 0.0
bit_flags: int = 0
original_record: TransactionRights | 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:

TransactionRights

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.UserRights(rights_short_name='', rights_long_name='', has_rights=False, original_record=None)[source]

Bases: object

Represents a row in the UserRights table.

rights_short_name: str = ''
rights_long_name: str = ''
has_rights: bool = False
original_record: UserRights | 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:

UserRights

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.UserMonetaryRights(rights_short_name='', rights_long_name='', amount=0.0, original_record=None)[source]

Bases: object

Represents a row in the UserMonetaryRights table.

rights_short_name: str = ''
rights_long_name: str = ''
amount: float = 0.0
original_record: UserMonetaryRights | 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:

UserMonetaryRights

class q2_sdk.hq.hq_api.backoffice.AddCustomer_models.Q2CustomerAccountView(customer_account_id=0, customer_id=0, is_cif_rel=None, host_account_id=0, account_number_internal='', product_name='', is_user_enabled=None, is_external_account=False, product_id=0, product_type_id=0, user_access=0, current_access_flag=0, valid_customer_access_flag=None, valid_system_access_flag=None, original_record=None)[source]

Bases: object

Represents a row in the Q2_CustomerAccountView table.

customer_account_id: int = 0
customer_id: int = 0
is_cif_rel: bool | None = None
host_account_id: int = 0
account_number_internal: str = ''
product_name: str = ''
is_user_enabled: bool | None = None
is_external_account: bool = False
product_id: int = 0
product_type_id: int = 0
user_access: int = 0
current_access_flag: int = 0
valid_customer_access_flag: int | None = None
valid_system_access_flag: int | None = None
original_record: Q2CustomerAccountView | 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:

Q2CustomerAccountView

q2_sdk.hq.hq_api.backoffice.AddCustomer_models.build_dal_customer_edit_dataset(q2_customer=None, q2_phone_number=None, q2_customer_account=None, q2_customer_account_access_view=None, q2_subsidiary_view=None, q2_address=None)[source]

Build the dal_customer_edit DataSet parameter for AddCustomer.

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 ‘dal_customer_edit’ parameter

q2_sdk.hq.hq_api.backoffice.AddCustomer_models.build_customer_rights_dataset(transaction_rights=None, user_rights=None, user_monetary_rights=None, q2_customer_account_view=None)[source]

Build the customer_rights DataSet parameter for AddCustomer.

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 ‘customer_rights’ parameter