def __init__(self, status=True, payload=None): ret = {} if status is False: ret['status'] = 'error' else: ret['status'] = 'success' ret['payload'] = payload JsonResponse.__init__(self, data=ret, safe=False)
def __init__(self, sequencing_job_id, status, completion_status, error_message=None, output_files=None, attributes=None, callback=None): JsonResponse.__init__( self, { 'sequencingJobId': sequencing_job_id, 'status': status, 'completionStatus': completion_status, 'errorMessage': error_message, 'outputFiles': output_files, 'attributes': attributes, 'callback': callback })
def __init__(self, data, **kwargs): kwargs.setdefault('encoder', JSONEncoder) BaseJsonResponse.__init__(self, data, **kwargs)
def __init__(self, err, msg, status_code = 400): Exception.__init__(self, '{}: {}'.format(err, msg)) JsonResponse.__init__(self, {'err':err, 'msg':msg}) self.err = err self.status_code = status_code
def __init__(self, json, status_code=StatusType.SUCCESS, **kwargs): response = {"data": json} JsonResponse.__init__(self, response, status=status_code.value, **kwargs)
def __init__(self, authentication_token): JsonResponse.__init__( self, {'authenticationToken': str(authentication_token)})
def __init__(self, error): JsonResponse.__init__(self, {'status': 1, 'error': error})
def __init__(self): JsonResponse.__init__(self, {'status': 0})