Queries

DemographicInfoQuery

class q2_cores.XP2.queries.demographic_info_query.DemographicInfoQuery(logger, customer_id, class_name=None, namespace=None)[source]

Bases: MessageMaker

Builds the xml payload for the demographic call for the XP2 core.

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

build()[source]
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.

InitialSearchQuery

class q2_cores.XP2.queries.initial_search_query.InitialSearchQuery(logger, member_number, class_name=None, namespace=None)[source]

Bases: MessageMaker

Builds the xml payload for MembershipDetails demographic call for the XP2 core.

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

build()[source]
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.

class q2_cores.XP2.queries.initial_search_query.InitialSearchSSNQuery(logger, ssn, class_name=None, namespace=None)[source]

Bases: MessageMaker

Builds the xml payload for IndividualLookup demographic call for the XP2 core.

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

build()[source]
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.

MessageMaker

class q2_cores.XP2.queries.message_maker.MessageMaker(logger, class_name=None, namespace=None)[source]

Bases: BaseQuery

Builds the message wrapper that is used by all XP2 passthru calls

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

make_message(method_name, message_nodes)[source]

Wraps message nodes in the message structure to be sent to the core :type method_name: str :param method_name: The name of the method being called on XP2 :type message_nodes: list :param message_nodes: A list of xml nodes :rtype: str :return: The proper message to the core

MockResponse

q2_cores.XP2.queries.mock_responses.mock_encoded_response(base64_response)[source]
q2_cores.XP2.queries.mock_responses.encode_response(response)[source]
q2_cores.XP2.queries.mock_responses.mock_initial_search_response()[source]
q2_cores.XP2.queries.mock_responses.mock_initial_search_ssn_response()[source]
q2_cores.XP2.queries.mock_responses.mock_bad_initial_search_ssn()[source]
q2_cores.XP2.queries.mock_responses.mock_demographic_response()[source]
q2_cores.XP2.queries.mock_responses.mock_demographic_no_address()[source]
q2_cores.XP2.queries.mock_responses.mock_demographic_response_testing_phones()[source]
q2_cores.XP2.queries.mock_responses.mock_demographic_response_testing_no_phones()[source]