osm_easy_api.api.endpoints.notes
class
Notes_Container:
outer: osm_easy_api.api.api.Api
def
get_bbox( self, left: str, bottom: str, right: str, top: str, limit: int = 100, closed_days: int = 7) -> list[osm_easy_api.data_classes.note.Note]:
Get notes in bbox.
Arguments:
- left (str): Left bbox
- bottom (str): Bottom bbox
- right (str): Right bbox
- top (str): Top bbox
- limit (int, optional): Max number of notes (1 < limit < 10000). Defaults to 100.
- closed_days (int, optional): Number of days a note needs to be closed to no longer be returned (0 - only open, -1 - all). Defaults to 7.
Custom exceptions:
- 400 -> ValueError: Any of args limit is exceeded.
Returns:
list[Note]: List of notes.
Creates new note.
Arguments:
- latitude (str): Latitude
- longitude (str): Longitude
- text (str): Note description
Returns:
Note: Object of newly created note.
Add a new comment to note
Arguments:
- id (int): Note id
- text (str): Comment text
Custom exceptions:
- 409 ->
osm_easy_api.api.exceptions.NoteAlreadyClosed
: Note is closed.
Returns:
Note: Note object of commented note
Close a note as fixed.
Arguments:
- id (int): Note id.
- text (str | None, optional): Text to add as comment when closing the note. Defaults to None.
Custom exceptions:
- 409 ->
osm_easy_api.api.exceptions.NoteAlreadyClosed
: Note is closed.
Returns:
Note: Note object of closed note.
Close a note as fixed.
Arguments:
- id (int): Note id.
- text (str | None, optional): Text to add as comment when reopening the note. Defaults to None.
Custom exceptions:
- 409 ->
osm_easy_api.api.exceptions.NoteAlreadyOpen
: Note is open.
Returns:
Note: Note object of opened note.
def
hide(self, id: int, text: str | None = None) -> None:
Hide a note.
Arguments:
- id (int): Note id.
- text (str | None, optional): Text to add as comment when hiding the note. Defaults to None.
def
search( self, text: str, limit: int = 100, closed_days: int = 7, user_id: int | None = None, from_date: str | None = None, to_date: str | None = None, sort: str = 'updated_at', order: str = 'newest') -> list[osm_easy_api.data_classes.note.Note]:
Search for notes with initial text and comments.
Arguments:
- text (str): Text to search for in initial text and comments.
- limit (int, optional): Limit of returned notes. Defaults to 100.
- closed_days (int, optional): Days a note needs to be closed to no longer be returned. Defaults to 7.
- user_id (int | None, optional): Search for notes created by user. Defaults to None.
- from_date (str | None, optional): Beginning of a date range (ISO 8601). Defaults to None.
- to_date (str | None, optional): End of a date range (ISO 8601). Defaults to None.
- sort (str, optional): Which value should be used to sort notes ("updated_at" or "created_at"). Defaults to "updated_at".
- order (str, optional): Order of returned notes ("newset" or "oldest"). Defaults to "newest".
Custom exceptions:
- 400 ->
osm_easy_api.api.exceptions.LimitsExceeded
: Limits exceeded.
Returns:
list[Note]: List of notes objects.