Source code for q2_sdk.hq.hq_api.wedge_online_banking.CreateAuditRecord

# This is an autogenerated file from the command "q2 generate_hq_api" and will be overwritten if run again

"""

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

"""

from typing import List, Optional


from q2_sdk.core.q2_logging.logger import Q2LoggerType
from q2_sdk.hq.models.hq_response import HqResponse
from q2_sdk.hq.models.hq_credentials import HqCredentials

from q2_sdk.hq.models.hq_params.wedge_online_banking import WedgeOnlineBankingParamsObj
from q2_sdk.hq.models.hq_request.wedge_online_banking import WedgeOnlineBankingRequest


[docs] class ParamsObj(WedgeOnlineBankingParamsObj): """Parameters definition for CreateAuditRecord""" def __init__( self, logger: Q2LoggerType, hq_credentials: HqCredentials, workstation: str, customer_id: int, user_id: int, user_logon_id: int, host_account_id: int, transaction_id: int, error_return_code: int, admin_user_logon_id: int, ui_source: Optional[str] = None, session_id: Optional[str] = None, audit_action_short_name: Optional[str] = None, client_address: Optional[str] = None, audit_details: Optional[str] = None, exception_message: Optional[str] = None, ): """ :param logger: Reference to calling request's logger (self.logger in your extension) :param hq_credentials: HqCredentials instance with an hq_url and auth_token :param workstation: :param customer_id: :param user_id: Q2_User.UserID :param user_logon_id: :param host_account_id: Q2_HostAccount.HostAccountID :param transaction_id: :param error_return_code: :param admin_user_logon_id: :param ui_source: ShortName of Q2_UiSource row. Should almost always be OnlineBanking :param session_id: :param audit_action_short_name: :param client_address: :param audit_details: :param exception_message: """ super().__init__(logger, hq_credentials) self.request_params.update({ "Workstation": workstation, "UiSource": ui_source, "SessionId": session_id, "AuditActionShortName": audit_action_short_name, "CustomerId": customer_id, "UserId": user_id, "UserLogonId": user_logon_id, "HostAccountId": host_account_id, "TransactionId": transaction_id, "ClientAddress": client_address, "AuditDetails": audit_details, "ErrorReturnCode": error_return_code, "ExceptionMessage": exception_message, "AdminUserLogonId": admin_user_logon_id, })
[docs] async def execute(params_obj: ParamsObj, use_json=False, **kwargs) -> HqResponse: """ 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. :param params_obj: Object containing everything necessary to call this HQ endpoint :param use_json: If True, will call HQ's .ashx (json) endpoint instead of .asmx (soap) """ request = WedgeOnlineBankingRequest( "CreateAuditRecord", use_json=use_json, **kwargs ) return await request.execute(params_obj, **kwargs)
[docs] async def get_soap(params_obj: ParamsObj, **kwargs) -> HqResponse: """Deprecated. Please use execute instead""" params_obj.logger.warning( "CreateAuditRecord.get_soap is deprecated. Please use CreateAuditRecord.execute instead." ) return await execute(params_obj, **kwargs)
[docs] async def get_json(params_obj: ParamsObj, **kwargs) -> HqResponse: """Deprecated. Please use execute instead""" params_obj.logger.warning( "CreateAuditRecord.get_json is deprecated. Please use CreateAuditRecord.execute instead." ) return await execute(params_obj, use_json=True, **kwargs)
[docs] def build_json(params_obj: ParamsObj): return WedgeOnlineBankingRequest.build_json(params_obj)
[docs] def build_soap(params_obj: ParamsObj): return WedgeOnlineBankingRequest("CreateAuditRecord", use_json=False).build_soap( params_obj )