Work on event launcher and related
This commit is contained in:
@@ -126,6 +126,42 @@ async def event_file_lookup(
|
||||
# ### END ### API Event File ### get_event_file_lookup() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Event File ### get_event_file_obj() ###
|
||||
# Updated 2021-10-21
|
||||
@router.get('/{event_file_id}', response_model=Resp_Body_Base)
|
||||
async def get_event_file_obj(
|
||||
event_file_id: str = Query(..., min_length=11, max_length=22),
|
||||
inc_hosted_file: bool = False,
|
||||
enabled: str = 'enabled', # enabled, disabled, all; For now this covers any included objects or object lists
|
||||
hidden: str = 'not_hidden', # hidden, not_hidden, all
|
||||
x_account_id: str = Header(...),
|
||||
by_alias: bool = True,
|
||||
exclude_unset: bool = True,
|
||||
response: Response = Response,
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if event_file_id := redis_lookup_id_random(record_id_random=event_file_id, table_name='event_file'): pass
|
||||
else: return mk_resp(data=None, status_code=404, response=response)
|
||||
|
||||
if event_file_obj := load_event_file_obj(
|
||||
event_file_id = event_file_id,
|
||||
enabled = enabled,
|
||||
# hidden = hidden,
|
||||
inc_hosted_file = inc_hosted_file,
|
||||
model_as_dict = False,
|
||||
):
|
||||
event_file_dict = event_file_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
pass
|
||||
else:
|
||||
return mk_resp(data=False, status_code=400, response=response) # Bad Request
|
||||
|
||||
return mk_resp(data=event_file_dict, response=response)
|
||||
#return mk_resp(data=event_file_obj)
|
||||
# ### END ### API Event File ### get_event_file_obj() ###
|
||||
|
||||
|
||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
||||
async def delete_event_file_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
|
||||
Reference in New Issue
Block a user