Working on all module routes, methods, and models

This commit is contained in:
Scott Idem
2021-06-22 18:00:34 -04:00
parent b6ca0eb3f2
commit c1d23d15f4
20 changed files with 653 additions and 281 deletions

View File

@@ -559,10 +559,10 @@ async def lookup_username(
# ### BEGIN ### API User ### get_user_obj_new() ###
# ### BEGIN ### API User ### get_user_obj_v5() ###
# Working well as of 2021-06-11. Using as a template for other routes.
@router.get('/{user_id}/json', response_model=Resp_Body_Base)
async def get_user_obj_new(
@router.get('/{user_id}/v5', response_model=Resp_Body_Base)
async def get_user_obj_v5(
user_id: str = Query(..., min_length=1, max_length=22),
limit: int = 500, # For now this covers any included objects or object lists
enabled: str = 'enabled', # For now this covers any included objects or object lists
@@ -573,8 +573,9 @@ async def get_user_obj_new(
# inc_hosted_file_list: bool = False, # Priority l3
inc_journal_list: bool = False, # Priority l2
# inc_journal_entry_list: bool = False, # Priority l3
inc_membership: bool = False, # Priority l2
inc_membership_member: bool = False, # Priority l2
# inc_membership_list: bool = False, # ???
inc_order_line_list: bool = False, # Priority l1
inc_order_list: bool = False, # Priority l1
inc_order_cart_list: bool = False, # Priority l1
inc_organization: bool = False, # Priority l1
@@ -582,7 +583,7 @@ async def get_user_obj_new(
inc_person: bool = False, # Priority l1
# inc_person_list: bool = False,
inc_post_list: bool = False, # Priority l2
# inc_post_comment_list: bool = False, # Priority l3
inc_post_comment_list: bool = False, # Priority l3
inc_user_role_list: bool = False, # Priority l1
x_account_id: str = Header(...),
by_alias: Optional[bool] = True,
@@ -607,8 +608,9 @@ async def get_user_obj_new(
# inc_hosted_file_list = inc_hosted_file_list,
inc_journal_list = inc_journal_list,
# inc_journal_entry_list = inc_journal_entry_list,
inc_membership = inc_membership,
inc_membership_member = inc_membership_member,
# inc_membership_list = inc_membership_list, # ???
inc_order_line_list = inc_order_line_list,
inc_order_list = inc_order_list,
inc_order_cart_list = inc_order_cart_list,
inc_organization = inc_organization,
@@ -627,8 +629,7 @@ async def get_user_obj_new(
return mk_resp(data=False, status_code=400) # Bad Request
return mk_resp(data=response_data)
# ### END ### API User ### get_user_obj_new() ###
# ### END ### API User ### get_user_obj_v5() ###
@router.get('/{user_id}', response_model=Resp_Body_Base)