Product

enum q2_sdk.hq.db.product.ThirdPartyDataElementProperty(value)[source]

Bases: Enum

Valid values are as follows:

SSO_NEW_WINDOW = <ThirdPartyDataElementProperty.SSO_NEW_WINDOW: 'UiConfig.ssoNewWindow'>
SSO_ACCOUNT_SPECIFIC = <ThirdPartyDataElementProperty.SSO_ACCOUNT_SPECIFIC: 'UiConfig.ssoAccountSpecific'>
class q2_sdk.hq.db.product.ProductRow[source]

Bases: RepresentationRowBase

ProductID: IntElement = 'ProductID'
HostProductCode: StringElement = 'HostProductCode'
HostProductTypeCode: StringElement = 'HostProductTypeCode'
ProductName: StringElement = 'ProductName'
ProductTypeName: StringElement = 'ProductTypeName'
TranCodeGroupID: IntElement = 'TranCodeGroupID'
ProductTypeID: IntElement = 'ProductTypeID'
VoiceFile: StringElement = 'VoiceFile'
ProductNickName: StringElement = 'ProductNickName'
HydraProductCode: StringElement = 'HydraProductCode'
VendorID: IntElement = 'VendorID'
AllowOpen: BoolElement = 'AllowOpen'
AllowClose: BoolElement = 'AllowClose'
class q2_sdk.hq.db.product.Product(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 if False or TableRow objects from DB calls if True (Defaults to settings file)

GET_BY_NAME_KEY = 'ProductName'
NAME = 'Product'
REPRESENTATION_ROW_CLASS

alias of ProductRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get(serialize_for_cli=False)[source]
Return type:

List[ProductRow]

async get_list_by_name(product_name, product_type_name=None, host_product_code=None)[source]
Return type:

List[ProductRow]

async create(product_name, host_product_code, tran_code_group_name, product_type_name, hydra_product_code, product_nick_name=None, voice_file=None, vendor_name=None, product_type_id=None, allow_open=False, allow_close=False)[source]

product_type_id may be passed in to disambiguate duplicate product_type_name entries

async update(product_id, name=<DEFAULT_DB_PARAM>, host_product_code=<DEFAULT_DB_PARAM>, tran_code_group_name=<DEFAULT_DB_PARAM>, hydra_product_code=<DEFAULT_DB_PARAM>, product_type_id=<DEFAULT_DB_PARAM>, product_nick_name=<DEFAULT_DB_PARAM>, voice_file=<DEFAULT_DB_PARAM>, vendor_name=<DEFAULT_DB_PARAM>, allow_open=<DEFAULT_DB_PARAM>, allow_close=<DEFAULT_DB_PARAM>)[source]

update all values of an existing product for the given product_id.

async delete(product_id)[source]

Note: this only works in the dev environment