Queries

BaseQuery

class q2_cores.SymXchange.queries.base_query.SymXchangeBaseQuery(logger, credentials, device_info, mock_response_string=None, mock_failure=False)[source]

Bases: BaseQuery

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 (Logger) – 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

property service: str
property device_info: DeviceInformation
create_envelope(body, nsmap=None)[source]
Return type:

ElementMaker

create_device_info()[source]
Return type:

ElementMaker

create_credentials()[source]
Return type:

ElementMaker

serialize(envelope)[source]
Return type:

str

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.

AccountDemographicQuery

class q2_cores.SymXchange.queries.account_demographic_query.AccountDemographicQuery(logger, account_number, device_number, device_type, card_prefix)[source]

Bases: AccountQuery

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 (Logger) – 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.

AccountQuery

class q2_cores.SymXchange.queries.account_query.AccountQuery(logger, account_number, credentials, device_info, request, mock_failure=False)[source]

Bases: SymXchangeBaseQuery

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 (Logger) – Reference to calling request’s logger (self.logger in your extension)

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

property service: str
static create_request()[source]
Return type:

ElementMaker

build()[source]
Return type:

str

PowerOnQuery

class q2_cores.SymXchange.queries.poweron_query.PoweronQuery(logger, rg_name, rg_state, rg_usrchr_params, rg_usrnum_params, credentials, device_info, mock_response_string=None, mock_failure=False)[source]

Bases: SymXchangeBaseQuery

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 (Logger) – Reference to calling request’s logger (self.logger in your extension)

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

property service: str
build()[source]
Return type:

str

MockResponses

q2_cores.SymXchange.queries.mock_responses.mock_account_demographic_response()[source]
q2_cores.SymXchange.queries.mock_responses.mock_no_account_demographic_response()[source]