Skip to content

Warninglists

add_warninglist async

add_warninglist(
    auth: Annotated[
        Auth,
        Depends(
            authorize(
                AuthStrategy.HYBRID,
                [Permission.WARNINGLIST],
            )
        ),
    ],
    db: Annotated[Session, Depends(get_db)],
    body: CreateWarninglistBody,
) -> WarninglistResponse

Add a new warninglist with given details.

Input:

  • auth: Authentication details

  • db: Database session

  • body: CreateWarninglistBody, Data for creating the new warninglist

Output:

  • WarninglistResponse: Response with details of the new warninglist

delete_warninglist async

delete_warninglist(
    auth: Annotated[
        Auth,
        Depends(
            authorize(
                AuthStrategy.HYBRID, [Permission.SITE_ADMIN]
            )
        ),
    ],
    db: Annotated[Session, Depends(get_db)],
    warninglist_id: Annotated[int, Path(alias=id)],
) -> WarninglistResponse

Delete a specific warninglist.

Input:

  • auth: Authentication details

  • db: Database session

  • warninglist_id: ID of the warninglist to delete

Output:

  • WarninglistResponse: Response showing success or failure

get_all_or_selected_warninglists async

get_all_or_selected_warninglists(
    auth: Annotated[
        Auth, Depends(authorize(AuthStrategy.HYBRID))
    ],
    db: Annotated[Session, Depends(get_db)],
    value: str | None = None,
    enabled: bool | None = None,
) -> GetSelectedAllWarninglistsResponse

Receive a list of all warning lists, or when setting the path parameters value and enabled, receive a list of warninglists for which the value matches either the name, description, or type and enabled matches given parameter.

Input:

  • auth: Authentication details

  • db: Database session

  • value: str | None, Search term for filtering by value

  • enabled: bool | None, Status filter (enabled or disabled)

Output:

  • GetSelectedAllWarninglistsResponse: Response containing filtered or all warninglists

get_warninglist_details async

get_warninglist_details(
    auth: Annotated[
        Auth, Depends(authorize(AuthStrategy.HYBRID))
    ],
    db: Annotated[Session, Depends(get_db)],
    warninglist_id: Annotated[
        int, Path(alias=warninglistId)
    ],
) -> WarninglistResponse

Retrieve details of a specific warninglist by its ID.

Input:

  • auth: Authentication details

  • db: Database session

  • warninglist_id: ID of the warninglist to fetch

Output:

  • WarninglistResponse: Response with details of the searched warninglist

get_warninglist_details_depr async

get_warninglist_details_depr(
    auth: Annotated[
        Auth, Depends(authorize(AuthStrategy.HYBRID))
    ],
    db: Annotated[Session, Depends(get_db)],
    warninglist_id: Annotated[
        int, Path(alias=warninglistId)
    ],
) -> WarninglistResponse

Deprecated. Retrieve details of a specific warninglist by its ID using the old route.

Input:

  • auth: Authentication details

  • db: Database session

  • warninglist_id: ID of the warninglist to fetch

Output:

  • WarninglistResponse: Response with details of the searched warninglist

get_warninglists_by_value async

get_warninglists_by_value(
    auth: Annotated[
        Auth, Depends(authorize(AuthStrategy.HYBRID))
    ],
    db: Annotated[Session, Depends(get_db)],
    body: CheckValueWarninglistsBody,
) -> CheckValueResponse | dict

Retrieve a list of ID and name of enabled warninglists, which match has the given search term as entry.

Input:

  • auth: Authentication details

  • db: Database session

  • body: CheckValueWarninglistsBody, Data for searching warninglists by value

Output:

  • CheckValueResponse | dict: Response with searched warninglists

post_toggleEnable async

post_toggleEnable(
    auth: Annotated[
        Auth,
        Depends(
            authorize(
                AuthStrategy.HYBRID, [Permission.SITE_ADMIN]
            )
        ),
    ],
    db: Annotated[Session, Depends(get_db)],
    body: ToggleEnableWarninglistsBody,
) -> ToggleEnableWarninglistsResponse

Disable/Enable a specific warninglist by its ID or name.

Input:

  • auth: Authentication details

  • db:Database session

  • body: ToggleEnableWarninglistsBody, Data to toggle enable status of the warninglist

Output:

  • ToggleEnableWarninglistsResponse: Response showing success or failure

search_warninglists async

search_warninglists(
    auth: Annotated[
        Auth, Depends(authorize(AuthStrategy.HYBRID))
    ],
    db: Annotated[Session, Depends(get_db)],
    body: GetSelectedWarninglistsBody,
) -> GetSelectedAllWarninglistsResponse

Retrieve a list of warninglists, which match given search terms using the old route.

Input:

  • auth: Authentication details

  • db: Database session

  • body: GetSelectedWarninglistsBody, Data for filtering warninglists

Output:

  • GetSelectedAllWarninglistsResponse: Response containing filtered warninglists

update_all_warninglists async

update_all_warninglists(
    auth: Annotated[
        Auth,
        Depends(
            authorize(
                AuthStrategy.HYBRID, [Permission.SITE_ADMIN]
            )
        ),
    ],
    db: Annotated[Session, Depends(get_db)],
) -> StandardStatusResponse

Update all warninglists.

Input:

  • auth: Authentication details

  • db: Database session

Output:

  • StandardStatusResponse: Response indicating success or failure

update_all_warninglists_depr async

update_all_warninglists_depr(
    auth: Annotated[
        Auth,
        Depends(
            authorize(
                AuthStrategy.HYBRID, [Permission.SITE_ADMIN]
            )
        ),
    ],
    db: Annotated[Session, Depends(get_db)],
) -> StandardStatusResponse

Deprecated. Update all warninglists.

Input:

  • auth: Authentication details

  • db: Database session

Output:

  • StandardStatusResponse: Response indicating success or failure