# shellcheck shell=bash disable=SC2154,2034
___x_cmd_shodan_notifier_edit(){
    local X_help_cmd='x help -m shodan notifier edit';   help:arg-null:parse
    shodan:arg:format:raw:json2app:all
    local id=;
    local param=
    while [ "$#" -gt 0 ]; do
        case "$1" in
            --id)       id="$2"; shift 2 ;;
            --*)        param="$param -d '${1#--}=${2}'"; shift 2 ;;
            *)          N=shodan M="x shodan notifier edit --id <id> --email <email address>" log:ret:64 ;;
        esac
    done

    [ -n "$id" ]        || N=shodan M="Provide a notifier id"       log:ret:64
    [ -n "$email" ]     || N=shodan M="Provide a email address"     log:ret:64

    shodan:info "update the parameters of a notifier [id=$id] with [param=$param]"

    set - "${param}"
    ___x_cmd_shodan_notifier_edit___"$format" "$@"
}

___x_cmd_shodan_notifier_edit___app(){
    local data;     data="$( ___x_cmd_shodan_notifier_edit___raw "$@" )"    || shodan:data:ret
    ___x_cmd_pipevar data       x j2y
}

___x_cmd_shodan_notifier_edit___json(){
    local data;     data="$( ___x_cmd_shodan_notifier_edit___raw "$@" )"    || shodan:data:ret
    ___x_cmd_pipevar data
}

___x_cmd_shodan_notifier_edit___raw(){
    ___x_cmd_shodan_ourl put "/notifier/${id}" "$@"
}
