- Added SearchRequest compatibilty and began working on QueryBuilder processing
This commit is contained in:
1 parent
ce4d6cdf7c
commit
4e120cea6c
20 files changed
+510
-141
No files matched your search
+22
-2
@@ -22,6 +22,8 @@ class Rest implements AdapterInterface
|
||||
|
||||
protected array $options = [];
|
||||
|
||||
protected array $parameters = [];
|
||||
|
||||
public readonly string $url;
|
||||
|
||||
public function setup(array $configuration): void
|
||||
@@ -29,15 +31,18 @@ class Rest implements AdapterInterface
|
||||
$this->url = rtrim($configuration['url'], '/');
|
||||
|
||||
$this->authorizationMethod = AuthenticationEnum::from($configuration['auth'] ?: AuthenticationEnum::Basic->value);
|
||||
$this->authorization = ( new CurlAuthorization() )->fromAuthenticationEnum($this->authorizationMethod, $configuration);
|
||||
$this->authorization = new CurlAuthorization($configuration);
|
||||
|
||||
$this->headers = $configuration['headers'] ?? [];
|
||||
$this->options = $configuration['options'] ?? [];
|
||||
$this->parameters = $configuration['parameters'] ?? [];
|
||||
}
|
||||
|
||||
public function connect(): object
|
||||
{
|
||||
return new CurlClient($this->headers, $this->options, $this->authorization);
|
||||
$this->authorization = $this->authorization->fromAuthenticationEnum($this->authorizationMethod);
|
||||
|
||||
return new CurlClient([], $this->options, $this->authorization);
|
||||
}
|
||||
|
||||
public function buildDataSourceName(): string
|
||||
@@ -73,4 +78,19 @@ class Rest implements AdapterInterface
|
||||
{
|
||||
return RequestBuilder::class;
|
||||
}
|
||||
|
||||
public function getCurlOptions() : array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
public function getHeaders() : array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
public function getParameters() : array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user