JinjaQuery

class q2_sdk.models.cores.queries.jinja_query.JinjaQuery(logger, templates_path, request_template, mock_response_template, context=None, mock_failure=False, collapse_whitespace=False)[source]

Same behavior as BaseQuery, though build and mock are handled by passed in Jinja template

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

  • templates_path (Path) – Path to the templates

  • request_template (str) – Filename for the template for the request

  • mock_response_template (str) – Filename for the mock response

  • context (dict | None) – Context to use during rendering

  • mock_failure – Inherited from base

  • collapse_whitespace – Removes new lines and whitespace around it

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.

Return type:

str