Host Account
- class q2_sdk.hq.db.host_account.HostAccountRow(element, row_class=None, rename_fields=None)[source]
Bases:
TableRow
- class q2_sdk.hq.db.host_account.HostAccountCustomerRow(element, row_class=None, rename_fields=None)[source]
Bases:
TableRow
- class q2_sdk.hq.db.host_account.HostAccountCustomerWithProductRow(element, row_class=None, rename_fields=None)[source]
Bases:
TableRow
- class q2_sdk.hq.db.host_account.UpdateAccountRightsParameters(hostAccountId, userId, can_view, can_deposit, can_withdraw)[source]
Bases:
object
UpdateAccountRightsParameters(hostAccountId: int, userId: int, can_view: bool, can_deposit: bool, can_withdraw: bool)
- class q2_sdk.hq.db.host_account.ProductChangeParameters(host_account_id, old_product_id, new_product_id)[source]
Bases:
object
ProductChangeParameters(host_account_id: int, old_product_id: int, new_product_id: int)
- enum q2_sdk.hq.db.host_account.ProductChangeStatus(value)[source]
Bases:
Enum
Valid values are as follows:
- Ok = <ProductChangeStatus.Ok: 'OK'>
- AllRecordsSkipped = <ProductChangeStatus.AllRecordsSkipped: 'AllRecordsSkipped'>
- PartialUpdate = <ProductChangeStatus.PartialUpdate: 'PartialUpdate'>
- class q2_sdk.hq.db.host_account.ProductChangeResults(result, successful_accounts, skipped_accounts)[source]
Bases:
object
ProductChangeResults(result: q2_sdk.hq.db.host_account.ProductChangeStatus, successful_accounts: list, skipped_accounts: list)
-
result:
ProductChangeStatus
-
result:
- class q2_sdk.hq.db.host_account.HostAccount(logger, hq_credentials=None, ret_table_obj=None)[source]
Bases:
DbObject
Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.
- Parameters:
logger – Reference to calling request’s logger (self.logger in your extension)
hq_credentials (
Optional
[HqCredentials
]) – HQ Connectivity Information (Defaults to settings file)ret_table_obj (
Optional
[bool
]) – Flag to return list of LXML elements ifFalse
or TableRow objects from DB calls ifTrue
(Defaults to settings file)
- REPRESENTATION_ROW_CLASS
alias of
HostAccountRow
- async create(account_internal, account_external, product_id, cif, account_description, is_external=False)[source]
Note: this only works in the dev environment
- Return type:
- async update_account_rights(parameters)[source]
Update the account rights for an account linked to a user. This only works for accounts explicitly linked to the user, and will not work for accounts linked by a cif.
- async get_customer_host_accounts(customer_ids)[source]
Retrieves multiple accounts associated to the customers in the list. For DB performance reason, the customer id list should be limited to 20
- async get_accounts_by_product(group_id, product_id=None)[source]
Searches a group of customers for accounts with a specific product id
- Parameters:
- Return type:
- async change_account_product(account_changes)[source]
Changes the product of a list of accounts :type account_changes:
list
[ProductChangeParameters
] :param account_changes: list of ProductChangeParameters objects. :rtype:ProductChangeResults
:return: ProductChangeResults object