You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
802 B
31 lines
802 B
<?php
|
|
|
|
namespace Darksparrow\DeegraphInteractions\QueryBuilder\LinkQuery;
|
|
|
|
use Darksparrow\DeegraphInteractions\Core\DeegraphServer;
|
|
use Darksparrow\DeegraphInteractions\QueryBuilder\DirectoryQuery\DirectoryQueryResponse;
|
|
|
|
class LinkQuery
|
|
{
|
|
protected string $QueryString;
|
|
|
|
public function __construct(string $queryString)
|
|
{
|
|
$this->QueryString = $queryString;
|
|
}
|
|
public function __toString()
|
|
{
|
|
return $this->QueryString;
|
|
}
|
|
|
|
public function RunQuery(DeegraphServer $server): LinkQueryResponse
|
|
{
|
|
$response = $server->RunRawRequest(
|
|
endpoint: "/api/v1/@query",
|
|
method: "POST",
|
|
body: $this->QueryString
|
|
);
|
|
$temp = json_decode($response, true);
|
|
return new LinkQueryResponse($temp);
|
|
}
|
|
}
|