<?php

declare(strict_types=1);

namespace apexl\Io\modules\logger\dto\handlerConfigParams;

use apexl\Io\modules\logger\dto\handlerConfigParams;

class googleChatHandlerConfigParams extends handlerConfigParams
{
    /**
     * Google Chat incoming webhook URL, as issued by the space's "Manage webhooks"
     * screen. Without one the handler does nothing.
     *
     * Keep it out of the config file and read it from the environment: the URL carries
     * its own `key` and `token`, so anyone holding it can post to the space.
     */
    public ?string $webhook_url = null;

    /**
     * Card subtitle, shown under the level and message. Defaults to the stream name,
     * which is usually what you want — it says which logger produced the record.
     */
    public ?string $subtitle = null;

    /**
     * Groups this stream's records into a single thread in the space rather than
     * scattering them through it. Any stable string works; the stream name is a
     * reasonable choice. Null posts each record as a new top-level message.
     */
    public ?string $thread_key = null;

    /**
     * Include the record's context and extra. On by default, as for Slack: a log line
     * reaching a chat space is one someone is expected to act on, and the context is
     * usually the half that says what to act on.
     */
    public bool $include_context = true;

    /**
     * Record fields to leave out, in dot notation — 'extra.request_uri', or
     * 'context.exception' where even the flattened exception line is more than the
     * space needs.
     *
     * @var string[]
     */
    public array $exclude_fields = [];
}
