# shellcheck shell=dash disable=SC3043,SC2154
# https://docs.github.com/en/rest/releases/assets#update-a-release-asset
___x_cmd_gh_repo_release_attachment_edit() {
    param:scope     ___x_cmd_github
    param:dsl    '
options:
    #1          "Release Attachment ID"                                     <>:Number
    --repo|-r   "<owner_path>/<repo_path>"                                  <>:RepoName

    --name      "The file name of the attachment"                           <>=""
    --label     "An alternate short description of the attachment"          <>=""
    --json|-j   "output json data"
'
    param:run
    ___x_cmd_gh_param_init_owner_repo
    local gen_gh_json=""
    gen_gh_json="$(param:option2json -repo)"
    gh:debug "$gen_gh_json"

    ___x_cmd_gh_curl patch "/repos/${owner_repo}/releases/assets/${1##*/}" "gen_gh_json" | ___x_cmd_gh_release_attachment_____ui_handler Edit
}
