-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_documentation.json
More file actions
1 lines (1 loc) · 15.3 KB
/
api_documentation.json
File metadata and controls
1 lines (1 loc) · 15.3 KB
1
{"openapi":"3.1.0","info":{"title":"Inventory API","summary":"Inventory API for UAchado App","description":"This API manages the inventory's items in UAchado system. It helps with the logic inside the system.","version":"1.0.0"},"paths":{"/inventory/v1":{"get":{"tags":["Items"],"summary":"Base","description":"Root endpoint of the inventory API. Mostly used for testing API connectivity.\n\nReturns:\n _type_: A dictionary containing the response message.","operationId":"base_inventory_v1_get","responses":{"200":{"description":"Root endpoint of the inventory API.","content":{"application/json":{"schema":{"type":"object","title":"Response Base Inventory V1 Get"}}}}}}},"/inventory/v1/items":{"get":{"tags":["Items"],"summary":"Get All Items","description":"Get the list of existing items.\n\nArgs:\n request (Request): The request object containing information about the request.\n params (Params, optional): Optional additional parameters for pagination. Defaults to Depends().\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nReturns:\n Page[schemas.Item]: The page containing the list of items.","operationId":"get_all_items_inventory_v1_items_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Size"}}],"responses":{"200":{"description":"Get the list of existing items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Item_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/items/id/{item_id}":{"get":{"tags":["Items"],"summary":"Get Item By Id","description":"Get a specific item by its ID.\n\nArgs:\n item_id (str): The ID attribute of a specify unique item.\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nRaises:\n HTTPException (HTTP_400_BAD_REQUEST): Error raised if item_id is not numeric.\n HTTPException (HTTP_204_NO_CONTENT): Error raised if there's no stored item with the item_id.\n\nReturns:\n schemas.Item: The stored item.","operationId":"get_item_by_id_inventory_v1_items_id__item_id__get","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Get a specific item by its ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Items"],"summary":"Delete Item","description":"Delete a specific item by its ID.\n\nArgs:\n request (Request): The request object containing information about the request.\n item_id (str): The ID of the item to be deleted.\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nRaises:\n HTTPException (HTTP_400_BAD_REQUEST): Error raised if item_id is not numeric.\n HTTPException (HTTP_204_NO_CONTENT): Error raised if there's no stored item with the item_id.\n\nReturns:\n _type_: A dictionary containing a success message.","operationId":"delete_item_inventory_v1_items_id__item_id__delete","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Delete a specific item by its ID.","content":{"application/json":{"schema":{"type":"object","title":"Response Delete Item Inventory V1 Items Id Item Id Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/items/tags":{"get":{"tags":["Items"],"summary":"Get All Tags","description":"Get the list of all tags the system currently supports.\n\nReturns:\n List[str]: the list of strings representing all the available tags.","operationId":"get_all_tags_inventory_v1_items_tags_get","responses":{"200":{"description":"Get the list of all tags.","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Get All Tags Inventory V1 Items Tags Get"}}}}}}},"/inventory/v1/items/stored":{"post":{"tags":["Items"],"summary":"Get Stored Items","description":"Get currently 'stored' items using optional filter.\n\nArgs:\n filter (schemas.InputFilter): The filter criteria used to search for items.\n params (Params, optional): Optional additional parameters for pagination. Defaults to Depends().\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nReturns:\n Page[schemas.Item]: A paginated list of current items containing the 'stored' state.","operationId":"get_stored_items_inventory_v1_items_stored_post","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Size"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InputFilter"}}}},"responses":{"200":{"description":"Get currently 'stored' items using optional filter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Item_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/items/point/{dropoff_point_id}":{"put":{"tags":["Items"],"summary":"Get Dropoff Point Items","description":"Get items on a drop-off point by filter.\n\nArgs:\n request (Request): The request object containing information about the request.\n dropoff_point_id (str): The ID of the drop-off point to get items from.\n filter (schemas.InputFilter): The filter criteria used to search for items.\n params (Params, optional): Additional parameters for pagination Defaults to Depends().\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nRaises:\n HTTPException (HTTP_400_BAD_REQUEST): Error raised if dropoff_point_id is not numeric.\n\nReturns:\n Page[schemas.Item]: A paginated list of items from the drop-off point.","operationId":"get_dropoff_point_items_inventory_v1_items_point__dropoff_point_id__put","parameters":[{"name":"dropoff_point_id","in":"path","required":true,"schema":{"type":"string","title":"Dropoff Point Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Size"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InputFilter"}}}},"responses":{"200":{"description":"Get items on a drop-off point by filter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Item_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/items/retrieve/{item_id}":{"put":{"tags":["Items"],"summary":"Retrieve Item","description":"Marking a specific item as 'retrieved' by its ID.\n\nArgs:\n request (Request): The request object containing information about the request.\n item_id (str): The ID of the item to be marked as 'retrieved'.\n email (schemas.Email): The email of the user who retrieved the item.\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nRaises:\n HTTPException (HTTP_400_BAD_REQUEST): Error raised if item_id is not numeric.\n HTTPException (HTTP_204_NO_CONTENT): Error raised if there's no stored item with the item_id.\n\nReturns:\n schemas.Item: The item with the updated state 'retrieved'.","operationId":"retrieve_item_inventory_v1_items_retrieve__item_id__put","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Email"}}}},"responses":{"200":{"description":"Marking a specific item as 'retrieved' by its ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/items/create":{"post":{"tags":["Items"],"summary":"Create Item","description":"Create a new found item. Insert it in the database.\n\nArgs:\n request (Request): The request object containing information about the request.\n description (str, optional): The description of the item. Defaults to Form(...).\n tag (str, optional): The tag associated with the item. Defaults to Form(...).\n image (Optional[UploadFile], optional): The image file associated with the item (optional). The image will be stored in the associated AWS S3 Bucket. Defaults to File(...).\n dropoff_point_id (int, optional): The ID of the drop-off point associated with the item. Defaults to Form(...).\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nReturns:\n schemas.Item: The created item.","operationId":"create_item_inventory_v1_items_create_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_item_inventory_v1_items_create_post"}}},"required":true},"responses":{"201":{"description":"Create a new found item.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/items/report":{"post":{"tags":["Items"],"summary":"Report Item","description":"Report a new lost item.\n\nArgs:\n description (str, optional): The description of the item. Defaults to Form(...).\n tag (str, optional): The tag associated with the item. Defaults to Form(...).\n image (Optional[UploadFile], optional): The image file associated with the item (optional). The image will be stored in the associated AWS S3 Bucket. Defaults to File(...).\n report_email (str, optional): The email of the person reporting the item. Defaults to Form(...).\n db (Session, optional): Optional database session object. If not included the system will connect to the default one. Defaults to Depends(get_db).\n\nReturns:\n schemas.Item: The reported item.","operationId":"report_item_inventory_v1_items_report_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_report_item_inventory_v1_items_report_post"}}},"required":true},"responses":{"201":{"description":"Report a new lost item.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inventory/v1/image/{image_uuid}":{"get":{"tags":["Items"],"summary":"Get Image From S3","description":"Retrieve the image presigned URL from S3 Bucket B.\n\nArgs:\n image_uuid (str): A string representing the unique identifier for the image.\n\nReturns:\n StreamingResponse: Object containing the image data.","operationId":"get_image_from_s3_inventory_v1_image__image_uuid__get","parameters":[{"name":"image_uuid","in":"path","required":true,"schema":{"type":"string","title":"Image Uuid"}}],"responses":{"200":{"description":"A StreamingResponse object containing the image data.","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_create_item_inventory_v1_items_create_post":{"properties":{"description":{"type":"string","title":"Description"},"tag":{"type":"string","title":"Tag"},"image":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Image"},"dropoff_point_id":{"type":"integer","title":"Dropoff Point Id"}},"type":"object","required":["description","tag","image","dropoff_point_id"],"title":"Body_create_item_inventory_v1_items_create_post"},"Body_report_item_inventory_v1_items_report_post":{"properties":{"description":{"type":"string","title":"Description"},"tag":{"type":"string","title":"Tag"},"image":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Image"},"report_email":{"type":"string","title":"Report Email"}},"type":"object","required":["description","tag","image","report_email"],"title":"Body_report_item_inventory_v1_items_report_post"},"Email":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"Email","description":"Represents an email address."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InputFilter":{"properties":{"filter":{"type":"object","title":"Filter"}},"type":"object","required":["filter"],"title":"InputFilter","description":"Class to represent an input filter.\n\n:param filter: A dictionary representing the filter to be applied."},"Item":{"properties":{"description":{"type":"string","title":"Description"},"tag":{"type":"string","title":"Tag"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"state":{"type":"string","title":"State"},"dropoff_point_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dropoff Point Id"},"insertion_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Insertion Date"},"report_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Email"},"retrieved_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retrieved Email"},"retrieved_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retrieved Date"},"id":{"type":"integer","title":"Id"}},"type":"object","required":["description","tag","image","state","dropoff_point_id","insertion_date","report_email","retrieved_email","retrieved_date","id"],"title":"Item","description":"Class representing an item.\n\nAttributes:\n id (int): The id of the item."},"Page_Item_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Item"},"type":"array","title":"Items"},"total":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Total"},"page":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Page"},"size":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Size"},"pages":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Pages"}},"type":"object","required":["items","total","page","size"],"title":"Page[Item]"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}