<?php

declare(strict_types=1);

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

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

class slackHandlerConfigParams extends handlerConfigParams
{
    /**
     * Slack incoming webhook URL. Without one the handler does nothing.
     *
     * Keep it out of the config file and read it from the environment: a webhook URL
     * is a bearer credential, and anyone holding it can post to the channel.
     */
    public ?string $webhook_url = null;

    /** Overrides the channel the webhook was created against. */
    public ?string $channel = null;

    public ?string $username = null;

    public ?string $icon_emoji = null;

    /** Renders each record as an attachment, which is what gives it the level colour. */
    public bool $use_attachment = true;

    /** Collapses the attachment's fields onto one line. */
    public bool $short_attachment = false;

    /**
     * Include the record's context and extra. On by default, unlike Monolog: a log
     * line reaching Slack 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 the trace is too long to be worth posting.
     *
     * @var string[]
     */
    public array $exclude_fields = [];
}
