From 5a4103eed3474c1b7df9780212330087a693e8b1 Mon Sep 17 00:00:00 2001 From: Christian Pleintinger Date: Tue, 3 Sep 2024 12:20:06 +0200 Subject: [PATCH 1/2] PPM-1714 Signed-off-by: Christian Pleintinger --- composer.json | 2 +- src/Service/DocumentService.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/Service/DocumentService.php diff --git a/composer.json b/composer.json index 84ac743..5a4adac 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "internetx/php-domainrobot-sdk", - "version": "0.9.19", + "version": "0.9.21", "description": "A php package for easy integration of the domainrobot API powered by InterNetX GmbH.", "type": "library", "license": "MIT", diff --git a/src/Service/DocumentService.php b/src/Service/DocumentService.php new file mode 100644 index 0000000..ed71b7d --- /dev/null +++ b/src/Service/DocumentService.php @@ -0,0 +1,32 @@ +infoAsync($id); + $domainrobotResult = $domainrobotPromise->wait(); + + return $domainrobotResult; + } + + /** + * Sends a contact info request. + * + * @param int $id + * @return DomainrobotPromise + */ + public function infoAsync($id) + { + return $this->sendRequest( + $this->domainrobotConfig->getUrl() . "/document/$id", + 'GET' + ); + } +} From d921e9cf3888257f518e98fc0f6e14c6b9d72b00 Mon Sep 17 00:00:00 2001 From: Christian Pleintinger Date: Tue, 3 Sep 2024 12:25:00 +0200 Subject: [PATCH 2/2] PPM-1714 Signed-off-by: Christian Pleintinger --- src/Domainrobot.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Domainrobot.php b/src/Domainrobot.php index b684353..62af60d 100644 --- a/src/Domainrobot.php +++ b/src/Domainrobot.php @@ -4,11 +4,12 @@ use Domainrobot\Lib\DomainrobotConfig; use Domainrobot\Service\CertificateService; +use Domainrobot\Service\ContactService; +use Domainrobot\Service\DocumentService; use Domainrobot\Service\DomainStudioService; use Domainrobot\Service\DomainService; use Domainrobot\Service\DomainBulkService; use Domainrobot\Service\SslContactService; -use Domainrobot\Service\ContactService; use Domainrobot\Service\DomainCancelationService; use Domainrobot\Service\TransferOutService; use Domainrobot\Service\TrustedApplicationService; @@ -24,6 +25,7 @@ use Domainrobot\Service\LoginService; use Domainrobot\Service\DomainPremiumService; use Domainrobot\Service\RedirectService; + class Domainrobot { // private static $instance = null; @@ -50,6 +52,13 @@ class Domainrobot */ public $contact; + /** + * Interface for all document related requests + * + * @var DomainService + */ + public $document; + /** * Interface for all domain related requests * @@ -196,6 +205,7 @@ public function __construct($domainrobotConfig = []) $this->setDomainrobotConfig(new DomainrobotConfig($domainrobotConfig)); $this->certificate = new CertificateService($this->domainrobotConfig); $this->contact = new ContactService($this->domainrobotConfig); + $this->document = new DocumentService($this->domainrobotConfig); $this->domain = new DomainService($this->domainrobotConfig); $this->domainBulk = new DomainBulkService($this->domainrobotConfig); $this->domainCancelation = new DomainCancelationService($this->domainrobotConfig);