CorePro

Core

Bindings for Q2’s core. Docs: https://docs.corepro.io/api/overview

class q2_cores.CorePro.core.Core(logger, core_user, hq_credentials=None, **kwargs)[source]

Bases: BaseCore

All cores will inherit from this common base class. This contains a self.configured_user property, which is an instance of q2_sdk.models.cores.models.core_user.CoreUser.

CONFIG_FILE_NAME = 'CorePro_Core'
REQUIRED_CONFIGURATIONS = {'API_KEY': EnvVar(value='Q2SDK_COREPRO_API_KEY'), 'API_SECRET': EnvVar(value='Q2SDK_COREPRO_API_SECRET'), 'BASE_URL_OVERRIDE': EnvVar(value='Q2SDK_COREPRO_OVERRIDE_URL'), 'USE_BRIDGE': False}
async build_base_query(url_path, verb, body=None, mock_response=None)[source]

Generic call builder for CorePro as per the docs: https://docs.corepro.io/api/overview

Parameters:

url_path (str) – URL according to CorePro docs (/customer/get/id for instance)

Verb:

GET, POST, PUT, etc.

Body:

(Optional) JSON payload

Return type:

CoreProBaseMapper

async build_get_customer()[source]
Return type:

GetCustomerMapper

async build_demographic_info()[source]

Alias for CorePro’s get_customer

Return type:

GetCustomerMapper

async build_get_customer_by_email()[source]
Return type:

GetCustomerMapper

async build_update_demographic_info(demographic_info)[source]

Returns a UpdateDemographicInfoMapper ready to execute

Return type:

CoreProBaseMapper