BaseQuery

class q2_sdk.models.cores.queries.base_query.BaseQuery(logger, mock_failure=False)[source]

All queries will inherit from this common base class.

Object which builds the query to be send to the Core. If server is running debug mode, will return mocked response instead of calling the core.

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

  • mock_failure – If server is running in debug mode, will be used while mocking the response

mock_response()[source]

When run in DEBUG mode, the SDK will intercept calls before they go to HQ’s AdapterPassThru endpoint.

In these cases, the response will be whatever is returned from this function.

async execute(hq_credentials=None, debug=True, zone_context=None)[source]

Call Core with self.raw_query and save the response in self.core_response. If in debug mode, return mocked response instead of actually calling the core.

Parameters:
  • hq_credentials (Optional[HqCredentials]) – If provided, uses an existing HQ Session

  • debug (bool) – Return a mocked response