"""
DecideSuspectGt
"""
from q2_sdk.core.q2_logging.logger import Q2LoggerType
from q2_sdk.hq.models.hq_request.backoffice import BackOfficeRequest
from q2_sdk.hq.models.hq_response import HqResponse
from q2_sdk.hq.models.hq_params.backoffice import BackOfficeAuthenticatedParamsObj
from q2_sdk.hq.models.hq_credentials import BackOfficeHqCredentials
[docs]
class ParamsObj(BackOfficeAuthenticatedParamsObj):
"""Parameters definition for DecideSuspectGt"""
def __init__(
self,
logger: Q2LoggerType,
hq_credentials: BackOfficeHqCredentials,
transaction_id: int,
gt_case_decision_reason_id: int,
note: str,
authorize_transaction: bool,
):
"""
:param logger: Reference to calling request's logger (self.logger in your extension)
:param transaction_id: The transaction ID of the suspect transaction
:param gt_case_decision_reason_id: The id of the case decision reason (See DB Object)
:param note: Note on the decision
:param authorize_transaction: Boolean for authorizing the transaction
:param hq_credentials: BackOfficeHqCredentials instance
"""
super().__init__(logger, hq_credentials)
self.request_params = {
"transactionId": transaction_id,
"gtCaseDecisionReasonId": gt_case_decision_reason_id,
"note": note,
"authorizeTransaction": authorize_transaction,
}
[docs]
async def execute(params_obj: ParamsObj, **kwargs) -> HqResponse:
"""
:param params_obj: Object containing everything necessary to call this HQ endpoint
"""
request = BackOfficeRequest("DecideSuspectGt", **kwargs)
return await request.execute(params_obj, **kwargs)