Browse Source

function to get Actor

Cerys Lewis 5 months ago
parent
commit
af9cdb7cdf
  1. 23
      src/Core/DeegraphServer.php

23
src/Core/DeegraphServer.php

@ -4,19 +4,19 @@ namespace Darksparrow\DeegraphInteractions\Core;
use Darksparrow\DeegraphInteractions\DataStructures\QueryResponseWrapper; use Darksparrow\DeegraphInteractions\DataStructures\QueryResponseWrapper;
use Darksparrow\DeegraphInteractions\DataStructures\ServerInfo; use Darksparrow\DeegraphInteractions\DataStructures\ServerInfo;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\GrantQuery;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\InsertQuery; use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\InsertQuery;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\PutQuery; use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\PutQuery;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\SelectQuery; use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilders\SelectQuery;
class DeegraphServer final class DeegraphServer
{ {
private string $Token; protected string $Token;
private string $Actor; protected string $Actor;
protected string $ServerDomain;
private string $ServerDomain; protected int $Port;
private int $Port; protected bool $AllowSelfSignedCerts;
private bool $AllowSelfSignedCerts;
public function __construct( public function __construct(
string $token, string $token,
@ -33,6 +33,11 @@ class DeegraphServer
$this->AllowSelfSignedCerts = $allowSelfSignedCerts; $this->AllowSelfSignedCerts = $allowSelfSignedCerts;
} }
public function GetActor(): string
{
return $this->Actor;
}
/** /**
* Runs an API request against the Deegraph Server, and returns back information about the Deegraph Server. * Runs an API request against the Deegraph Server, and returns back information about the Deegraph Server.
* @return ServerInfo * @return ServerInfo
@ -85,7 +90,9 @@ class DeegraphServer
* @param InsertQuery|PutQuery|SelectQuery $query Takes in a Query Builder object. * @param InsertQuery|PutQuery|SelectQuery $query Takes in a Query Builder object.
* @return QueryResponseWrapper * @return QueryResponseWrapper
*/ */
public function RunQuery(InsertQuery|PutQuery|SelectQuery $query): QueryResponseWrapper public function RunQuery(
GrantQuery|InsertQuery|PutQuery|SelectQuery $query
): QueryResponseWrapper
{ {
$response = $this->RunRawRequest( $response = $this->RunRawRequest(
endpoint: "/api/v1/@query", endpoint: "/api/v1/@query",

Loading…
Cancel
Save