Saving current progress with change from using Query() to Path()

This commit is contained in:
Scott Idem
2024-04-26 14:51:11 -04:00
parent b37f14d25c
commit f4eda34035
67 changed files with 236 additions and 236 deletions

View File

@@ -1,5 +1,5 @@
import datetime, json
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Path, Query, Response, status
from pydantic import BaseModel, EmailStr, Field
from typing import Dict, List, Optional, Set, Union
@@ -78,7 +78,7 @@ async def post_event_session_obj_new_v4(
@router.patch('/event/session/{event_session_id}/exist_v4', response_model=Resp_Body_Base)
async def patch_event_session_obj_exist_v4(
event_session_obj: Event_Session_Base,
event_session_id: str = Query(..., min_length=11, max_length=22),
event_session_id: str = Path(min_length=11, max_length=22),
create_sub_obj: bool = False,
fail_any: bool = True, # Fail if any thing goes wrong for sub objects
@@ -204,7 +204,7 @@ async def post_event_session_obj_new_v3(
@router.patch('/event/session/{event_session_id}/exist_v3', response_model=Resp_Body_Base)
async def patch_event_session_obj_exist_v3(
event_session_obj: Event_Session_Base,
event_session_id: str = Query(..., min_length=11, max_length=22),
event_session_id: str = Path(min_length=11, max_length=22),
create_sub_obj: bool = False,
fail_any: bool = True, # Fail if any thing goes wrong for sub objects
x_account_id: Optional[str] = Header(..., ),
@@ -248,7 +248,7 @@ async def patch_event_session_obj_exist_v3(
@router.patch('/event/session/{obj_id}', response_model=Resp_Body_Base)
async def patch_event_session_obj(
obj: Event_Session_Base,
obj_id: str = Query(..., min_length=1, max_length=22),
obj_id: str = Path(min_length=11, max_length=22),
x_account_id: Optional[str] = Header(..., ),
return_obj: Optional[bool] = True,
by_alias: Optional[bool] = True,
@@ -465,7 +465,7 @@ async def get_event_session_obj_li(
# Updated 2022-09-23
@router.get('/event/session/{event_session_id}', response_model=Resp_Body_Base)
async def get_event_session_obj(
event_session_id: str = Query(..., min_length=11, max_length=22),
event_session_id: str = Path(min_length=11, max_length=22),
enabled: str = 'enabled', # For now this covers any included objects or object lists
limit: int = 500, # For now this covers any included objects or object lists
inc_address: bool = False, # Under contact
@@ -546,7 +546,7 @@ async def get_event_session_obj(
# Updated 2022-09-30
@router.get('/event/{event_id}/event/session/list', response_model=Resp_Body_Base)
async def get_event_event_session_obj_li(
event_id: str = Query(..., min_length=11, max_length=22),
event_id: str = Path(min_length=11, max_length=22),
enabled: str = 'enabled', # enabled, disabled, all
limit: int = 500, # For now this covers any included objects or object lists
# inc_address: bool = False,
@@ -690,7 +690,7 @@ async def search_event_session_obj_li(
@router.delete('/event/session/{obj_id}', response_model=Resp_Body_Base)
async def delete_event_session_obj(
obj_id: str = Query(..., min_length=1, max_length=22),
obj_id: str = Path(min_length=11, max_length=22),
x_account_id: str = Header(...),
response: Response = Response,
):