# shellcheck shell=bash
# https://gitee.com/api/v5/swagger#/getV5NotificationsThreads
___x_cmd_gt_notification_ll() {

      param:scope     ___x_cmd_gt
    param:dsl       '
options:
    --unread            "only get unread messages"                                                           <>:Boolean="true"
    --participating     "shows notifications in which the user is directly participating or mentioned"       <>:Boolean="false"
    --type              "Filter notifications of specified types"                                            <>=all             = all event referer
    --since             "show results that were last updated after the given time"                           <>:ISOTime=""
    --before            "show notifications updated before the given time"                                   <>:ISOTime=""
    --ids               "Specify a set of notification IDs separated by"                                     <>=""

    --per_page          "Results per page"                                                                   <>:Numbers="30"
    --page              "Page number of the results to fetch."                                               <>:Numbers="1"

    --json|-j           "output origin json data"
    --csv               "output csv data"
    --yml               "output yml data"
'
    param:run

    if ___x_cmd_gx_output_is_format; then
        ___x_cmd_gt_notification_ll___raw | ___x_cmd_gx_output_format
    else
        ___x_cmd_gt_notification_ll___raw |\
            ___x_cmd jo .list |\
            ___x_cmd jo 2c .id .repository.full_name .unread .content |\
            ___x_cmd csv header --add ID  Repo  Unread Title | \
            if [ -n "$csv" ]; then  ___x_cmd_cmds cat
            else                    ___x_cmd csv static_tab
            fi
    fi
}


___x_cmd_gt_notification_ll___raw(){
    ___x_cmd_gt_get_multi "/notifications/threads"  unread participating type since before ids
}