# shellcheck shell=bash disable=SC2034,SC2154
# https://gitea.com/api/swagger#/repository/repoEditRelease
___x_cmd_fjo_repo_release_edit() {
    param:scope  ___x_cmd_fjo
    param:dsl    '
options:
    #1                      "Release ID"                                                            <>:number
    --repo|-r               "<owner_path>/<repo_path>"                                              <>:RepoName
    --tag_name              "The name of the tag."                                                  <>=""
    --target_commitish      "Is release version"                                                    <>=""
    --name                  "The name of the release."                                              <>=""
    --body                  "Text describing the contents of the tag."                              <>=""
    --draft                 "true makes the release a draft, and false publishes the release."
    --prerelease            "true to identify the release as a prerelease, false to identify the release as a full release."

    --json|-j               "output json data"
'
    param:run
    ___x_cmd_fjo_param_init_owner_repo
    local gen_fjo_json
    gen_fjo_json="$(param:option2json -repo 'draft=^^draft' 'prerelease=^^prerelease')"

    ___x_cmd_fjo_curl patch "/repos/${owner_repo}/releases/${1}" "gen_fjo_json" | ___x_cmd_fjo_release____ui_handler Edit
}
