Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546<?php
declare(strict_types=1);
namespace Wotnak\Atproto\Lexicon;
use Wotnak\Atproto\Lexicon\Schema\ParamsSchema;use Wotnak\Atproto\Lexicon\Schema\SchemaInterface;
/** * Runtime representation of a query or procedure Lexicon definition. * * @api */final readonly class CompiledXrpcMethod {
/** * @param list<string> $errors */ public function __construct( public string $id, public string $type, public ?ParamsSchema $parameters, public ?SchemaInterface $input, public ?string $inputEncoding, public ?SchemaInterface $output, public ?string $outputEncoding, public array $errors = [], ) {}
/** * Returns the HTTP method required by the XRPC operation. */ public function httpMethod(): string { return $this->type === 'query' ? 'GET' : 'POST'; }
/** * Returns whether the method declares the named XRPC error. */ public function declaresError(string $name): bool { return \in_array($name, $this->errors, TRUE); }
}