#compdef openqa-cli
# Generated by tools/generate-cli-completions — do not edit manually.
# Regenerate with: make generate-completions

_openqa_cli_completions() {
    local curcontext="$curcontext"
    local -a subcommands main_options
    local -a api_options
    local -a archive_options
    local -a monitor_options
    local -a schedule_options
    subcommands=("api" "archive" "monitor" "schedule")
    main_options=(
        "--apibase=:API base, defaults to /api/v1"
        "--apikey=:API key. Use is discouraged due to risk of leaking credentials. Prefer config file or env variables."
        "--apisecret=:API secret. Use is discouraged due to risk of leaking credentials. Prefer config file or env variables."
        "--host=:Target host, defaults to http\://localhost"
        "--help:Get more information on a specific command"
        "--osd:Set target host to http\://openqa.suse.de"
        "--o3:Set target host to https\://openqa.opensuse.org"
        "--odn:Set target host to https\://openqa.debian.net"
        "--links:Print pagination links to STDERR"
        "--name=:Name of this client, used by openQA to identify different clients via User-Agent header, defaults to \"openqa-cli\""
        "--pretty:Pretty print JSON content"
        "--quiet:Do not print error messages to STDERR"
        "--verbose:Print HTTP response headers"
    )
    api_options=(
        "--header=:One or more additional HTTP headers (<name\:value>)"
        "--data-file=:Load content to send with request from file"
        "--data=:Content to send with request"
        "--form:Turn JSON object into form parameters"
        "--json:Request content is JSON"
        "--verbose:Print HTTP response headers"
        "--param-file=:Load content of params from files instead of from command line arguments. Multiple params may be specified by adding the option multiple times"
        "--retries=:Retry up to the specified value on some errors. Retries can also be set by the environment variable 'OPENQA_CLI_RETRIES', defaults to no retry. Set 'OPENQA_CLI_RETRY_SLEEP_TIME_S' to configure the sleep time between retries."
        "--method=:HTTP method to use, defaults to GET"
    )
    archive_options=(
        "--asset-size-limit=:Asset size limit in bytes"
        "--with-thumbnails:Download thumbnails as well"
    )
    monitor_options=(
        "--poll-interval=:Specifies the poll interval used with --monitor"
        "--follow:Use the newest clone of each monitored job"
    )
    schedule_options=(
        "--param-file=:Load content of params from files instead of from command line arguments. Multiple params may be specified by adding the option multiple times"
        "--monitor:Wait until all jobs are done/cancelled and return non-zero exit code if at least on job has not passed/softfailed"
        "--follow:Use the newest clone of each monitored job"
        "--poll-interval=:Specifies the poll interval used with --monitor"
    )
    if (( CURRENT == 2 )); then
        _describe 'subcommand' subcommands
    else
        case "$words[2]" in
            api)
                local -a _all
                _all=("${main_options[@]}" "${api_options[@]}")
                _describe 'option' _all
                ;;
            archive)
                local -a _all
                _all=("${main_options[@]}" "${archive_options[@]}")
                _describe 'option' _all
                ;;
            monitor)
                local -a _all
                _all=("${main_options[@]}" "${monitor_options[@]}")
                _describe 'option' _all
                ;;
            schedule)
                local -a _all
                _all=("${main_options[@]}" "${schedule_options[@]}")
                _describe 'option' _all
                ;;
            *)
                _values 'subcommand' api archive monitor schedule
                ;;
        esac
    fi
}
