CreateAuditRecord module

Create an audit record, setting CustomerId/UserId/UserLogonId/HostAccountId/TransactionId to a value <= 0 will result null values in db, ErrorReturnCode > 0 will be null

Sample response (may differ slightly in your environment)

<Q2API HqVersion="4.5.0.6109G" HqAssemblyVersion="4.5.0.0" ServerDateTime="2024-03-05T14:57:10.4567718-07:00" AuditId="2047298">
    <Result>
            <ErrorCode ErrorType="Success">0</ErrorCode>
            <ErrorDescription />
            <HydraErrorReturnCode>0</HydraErrorReturnCode>
    </Result>
    <Data>
            <CreateAuditRecord>
                    <Result>
                            <AuditID>2047298</AuditID>
                    </Result>
            </CreateAuditRecord>
    </Data>
</Q2API>
class q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.ParamsObj(logger, workstation, ui_source, session_id, audit_action_short_name, customer_id, user_id, user_logon_id, host_account_id, transaction_id, client_address, audit_details, error_return_code, exception_message, hq_credentials=None)[source]

Bases: Q2ApiParamsObj

Parameters definition for CreateAuditRecord

Parameters:
  • logger (TypeAliasType) – Reference to calling request’s logger (self.logger in your extension)

  • workstation (str)

  • ui_source (str) – ShortName of Q2_UiSource row. Should almost always be OnlineBanking

  • session_id (str)

  • audit_action_short_name (str)

  • customer_id (int)

  • user_id (int) – Q2_User.UserID

  • user_logon_id (int)

  • host_account_id (int) – Q2_HostAccount.HostAccountID

  • transaction_id (int)

  • client_address (str)

  • audit_details (str)

  • error_return_code (int)

  • exception_message (str)

  • hq_credentials (Optional[HqCredentials]) – Defaults to settings.HQ_CREDENTIALS

class q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.Result(AuditID)[source]

Bases: object

Result(AuditID: lxml.objectify.IntElement)

AuditID: IntElement
class q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.CreateAuditRecord(Result)[source]

Bases: object

CreateAuditRecord(Result: Union[q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.Result, List[q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.Result]])

Result: Union[Result, List[Result]]
class q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.Data(CreateAuditRecord)[source]

Bases: object

Data(CreateAuditRecord: Union[q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.CreateAuditRecord, List[q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.CreateAuditRecord]])

CreateAuditRecord: Union[CreateAuditRecord, List[CreateAuditRecord]]
class q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.ResultNode[source]

Bases: object

class q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.HqResponse(raw_response)[source]

Bases: HqResponse

Parameters:

response – Body of HQ response

async q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.execute(params_obj, use_json=False, **kwargs)[source]

This is the default way to submit the request to HQ. In theory, both json and soap payloads are equally accepted by HQ, though several variables may affect that (HQ version, Q2SDK implementation bugs, etc). This should not affect anything about the way your code deals with the data. In fact, the only difference to consuming extensions is the logging. Basically, call this with default parameters unless you find a compelling reason not to.

Parameters:
  • params_obj (ParamsObj) – Object containing everything necessary to call this HQ endpoint

  • use_json – If True, will call HQ’s .ashx (json) endpoint instead of .asmx (soap)

Return type:

HqResponse

async q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.get_soap(params_obj, **kwargs)[source]

Deprecated. Please use execute instead

Return type:

HqResponse

async q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.get_json(params_obj, **kwargs)[source]

Deprecated. Please use execute instead

Return type:

HqResponse

q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.build_json(params_obj)[source]
q2_sdk.hq.hq_api.q2_api.CreateAuditRecord.build_soap(params_obj)[source]