Exemple #1
0
def search_records_using(searchtype):
    soapheaders = get_soapheaders()
    if soapheaders:
        soapheaders['searchPreferences'] = SearchPreferences(
            bodyFieldsOnly=False, returnSearchColumns=True, pageSize=20)
        return get_service().search(searchRecord=searchtype,
                                    _soapheaders=soapheaders)
Exemple #2
0
def get_async_job_status(job_id):
    soapheaders = get_soapheaders()
    if not job_id:
        return None
    if not soapheaders:
        return None
    response = get_service().checkAsyncStatus(jobId=job_id,
                                              _soapheaders=soapheaders)
    return response
Exemple #3
0
def async_update_multiple(array_of_records):
    soapheaders = get_soapheaders()
    if not array_of_records:
        return None
    if not soapheaders:
        return None
    if len(array_of_records) == 0:
        return None
    response = get_service().asyncUpdateList(array_of_records,
                                             _soapheaders=soapheaders)
    return response
Exemple #4
0
def get_multiple(array_of_record_references):
    soapheaders = get_soapheaders()
    if not array_of_record_references:
        return None
    if len(array_of_record_references) == 0:
        return None
    if not soapheaders:
        return None
    response = get_service().getList(array_of_record_references,
                                     _soapheaders=soapheaders)
    return response
Exemple #5
0
def get_or_create_customer(customer_data):
    soapheaders = get_soapheaders()
    if not soapheaders:
        return None
    """
    Lookup customer, add a customer if lookup fails.
    """
    internal_id = lookup_customer_id_by_name_and_email(customer_data)
    if not internal_id:
        customer_data['entityId'] = str(uuid.uuid4())
        customer = Customer(**customer_data)
        response = get_service().add(customer, _soapheaders=soapheaders)
        r = response.body.writeResponse
        if r.status.isSuccess:
            internal_id = r.baseRef.internalId

    return get_customer(internal_id)
Exemple #6
0
def delete(record):
    return _call(record, get_service().delete)
Exemple #7
0
def update(record):
    return _call(record, get_service().update)
Exemple #8
0
def add(record):
    return _call(record, get_service().add)
Exemple #9
0
def get(record):
    return _call(record, get_service().get)