<?php

namespace Shm\ShmChat;

class ListQueryInput
{
    public function __construct(
        public int $limit = 50,
        public int $offset = 0,
        public bool $onlyHash = false,
    ) {
    }

    /**
     * @param array<string, mixed> $args
     */
    public static function fromRpcArgs(array $args): self
    {
        return new self(
            limit: (int) ($args['limit'] ?? 50),
            offset: (int) ($args['offset'] ?? 0),
            onlyHash: (bool) ($args['onlyHash'] ?? false),
        );
    }
}
