Skip to content

Commit f929cc3

Browse files
committed
2 parents 8460632 + 4ae8efa commit f929cc3

File tree

291 files changed

+3164
-3150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+3164
-3150
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [0.3.7] - 2020-03-19
4+
5+
* Rename all DomainRobot string to Domainrobot
6+
7+
## [0.3.6] - 2020-03-19
8+
9+
* Rename namespace from IXDomainRobot to Domainrobot
10+
11+
## [0.3.5] - 2020-03-11
12+
13+
* Add automatic sdk version resolution
14+
315
## [0.3.4] - 2020-03-02
416

517
* Fix DomainStudio->search() missing body

README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ A php package for easy integration of the **Domainrobot API** powered by [InterN
1919

2020
## Preamble
2121

22-
This Maven package is not available via known repositories. It must be manually installed into a local Maven repository.
22+
This composer package can be used within every composer project, including projects based on frameworks like [Laravel](https://laravel.com), [CodeIgniter](https://codeigniter.com/), [Symfony](https://symfony.com/) and many more.
23+
24+
**Note:** Feel free to contribute by creating pull requests or file an issue for bugs, questions and feature requests.
2325

2426
## Install and Use
2527

@@ -32,7 +34,7 @@ composer require internetx/php-domainrobot-sdk
3234
### Basic Use
3335

3436
```php
35-
use IXDomainRobot\DomainRobot;
37+
use Domainrobot\Domainrobot;
3638
```
3739

3840
## Usage
@@ -43,11 +45,11 @@ Before you can interact with the API you need to specify your authentication cre
4345
* Demo System: <https://api.demo.autodns.com/v1>
4446

4547
```php
46-
use IXDomainRobot\DomainRobot;
48+
use Domainrobot\Domainrobot;
4749

48-
$domainRobot = new DomainRobot([
50+
$domainrobot = new Domainrobot([
4951
"url" => "https://api.autodns.com/v1",
50-
"auth" => new DomainRobotAuth([
52+
"auth" => new DomainrobotAuth([
5153
"user" => "user",
5254
"password" => "password",
5355
"context" => 4
@@ -61,11 +63,11 @@ This library is mainly meant to be used with synchronous request but also provid
6163

6264
The basic difference is that the asynchronous requests will provide you with less guidance than the synchronous requests.
6365

64-
A synchronous requests will return an Object as described in the official swagger documentation, whereas an asynchronous request will give you a DomainRobotResult Object which will only return the response as a plain array. You will then have to handle the data on your own.
66+
A synchronous requests will return an Object as described in the official swagger documentation, whereas an asynchronous request will give you a DomainrobotResult Object which will only return the response as a plain array. You will then have to handle the data on your own.
6567

6668
Both methods provide certain advantages in certain situations.
6769

68-
Be aware that synchronous request will give you access to the return status code and the plain array result through *DomainRobot::getLastDomainRobotResult()*
70+
Be aware that synchronous request will give you access to the return status code and the plain array result through *Domainrobot::getLastDomainrobotResult()*
6971

7072
Please refer to the examples below for more details.
7173

@@ -74,18 +76,18 @@ Please refer to the examples below for more details.
7476
```php
7577
// Sends a synchronous request
7678
try {
77-
$certData = $domainRobot->certificate->prepareOrder($body);
78-
}catch(DomainRobotException $exception){
79+
$certData = $domainrobot->certificate->prepareOrder($body);
80+
}catch(DomainrobotException $exception){
7981
return response()->json($exception->getError(), $exception->getStatusCode());
8082
}
8183

8284
// Access response values through the provided CertificateData object
8385
$certData->getName();
8486

85-
// Access plain result and statuscode through DomainRobot::getLastDomainRobotResult
87+
// Access plain result and statuscode through Domainrobot::getLastDomainrobotResult
8688
return response()->json(
87-
DomainRobot::getLastDomainRobotResult()->getResult(),
88-
DomainRobot::getLastDomainRobotResult()->getStatusCode()
89+
Domainrobot::getLastDomainrobotResult()->getResult(),
90+
Domainrobot::getLastDomainrobotResult()->getStatusCode()
8991
);
9092
```
9193

@@ -94,14 +96,14 @@ return response()->json(
9496
```php
9597
// Sends an asynchronous request
9698
try {
97-
$promise = $domainRobot->certificate->prepareOrderAsync($body);
98-
// Wait for the promise. This will return a DomainRobotResult object
99+
$promise = $domainrobot->certificate->prepareOrderAsync($body);
100+
// Wait for the promise. This will return a DomainrobotResult object
99101
$result = $promise->wait();
100-
}catch(DomainRobotException $exception){
102+
}catch(DomainrobotException $exception){
101103
return response()->json($exception->getError(), $exception->getStatusCode());
102104
}
103105

104-
// Access response values through the provided DomainRobotResult object
106+
// Access response values through the provided DomainrobotResult object
105107
$statusCode = $result->getStatusCode();
106108
$data = $result->getData()
107109
```
@@ -116,7 +118,7 @@ Modles are instantiated by using the provided Models in this package.
116118
See an example below:
117119

118120
```php
119-
use IXDomainRobot\Model\Certificate;
121+
use Domainrobot\Model\Certificate;
120122

121123
$certificateModel = new Certificate();
122124
```
@@ -133,7 +135,7 @@ Properties can be set while creating a new model or a after a model has been cre
133135
The following examples are valid:
134136

135137
```php
136-
use IXDomainRobot\Model\Certificate;
138+
use Domainrobot\Model\Certificate;
137139

138140
$timePeriod = new TimePeriod([
139141
"unit" => "MONTH",
@@ -146,8 +148,8 @@ $certificateModel = new Certificate([
146148
```
147149

148150
```php
149-
use IXDomainRobot\Model\Certificate;
150-
use IXDomainRobot\Model\TimePeriod;
151+
use Domainrobot\Model\Certificate;
152+
use Domainrobot\Model\TimePeriod;
151153

152154
$certificateModel = new Certificate();
153155
$timePeriod = new TimePeriod([
@@ -265,14 +267,14 @@ function list(Query $body = null);
265267

266268
### Exception handling
267269

268-
If there is any error response from the API, the services will throw a DomainRobotException, which contains information about the error.
270+
If there is any error response from the API, the services will throw a DomainrobotException, which contains information about the error.
269271

270272
Example:
271273

272274
```php
273275
try {
274-
$promise = $domainRobot->certificate->createRealtime($certificate);
275-
}catch(DomainRobotException $exception){
276+
$promise = $domainrobot->certificate->createRealtime($certificate);
277+
}catch(DomainrobotException $exception){
276278
return response()->json($exception->getError(), $exception->getStatusCode());
277279
}
278280
```
@@ -313,7 +315,7 @@ Array
313315
### Use
314316

315317
```php
316-
use IXDomainRobot\Lib\DomainRobotHeaders;
318+
use Domainrobot\Lib\DomainrobotHeaders;
317319
```
318320

319321
### Available Headers
@@ -347,11 +349,11 @@ Custom Headers (see available headers in [Available Headers](#available-headers)
347349
See example below.
348350

349351
```php
350-
use IXDomainRobot\Lib\DomainRobotHeaders;
352+
use Domainrobot\Lib\DomainrobotHeaders;
351353

352-
$certificateData = $domainRobot->certificate
354+
$certificateData = $domainrobot->certificate
353355
->addHeaders(
354-
[DomainRobotHeaders::DOMAINROBOT_HEADER_2FA_TOKEN => "token"]
356+
[DomainrobotHeaders::DOMAINROBOT_HEADER_2FA_TOKEN => "token"]
355357
)->prepareOrder($body);
356358
```
357359

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "internetx/php-domainrobot-sdk",
3-
"version": "0.3.5",
3+
"version": "0.3.7",
44
"description": "A php package for easy integration of the domainrobot API powered by InterNetX GmbH.",
55
"type": "library",
66
"license": "MIT",
77
"autoload": {
88
"psr-4": {
9-
"IXDomainRobot\\": "src/",
10-
"IXDomainRobot\\Model\\": "src/Model"
9+
"Domainrobot\\": "src/",
10+
"Domainrobot\\Model\\": "src/Model"
1111
}
1212
},
1313
"require": {
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<?php
22

3-
namespace IXDomainRobot;
4-
5-
use IXDomainRobot\Lib\DomainRobotConfig;
6-
use IXDomainRobot\Service\CertificateService;
7-
use IXDomainRobot\Service\DomainStudioService;
8-
use IXDomainRobot\Service\DomainService;
9-
use IXDomainRobot\Service\SslContactService;
10-
use IXDomainRobot\Service\ContactService;
11-
use IXDomainRobot\Service\DomainCancelationService;
12-
use IXDomainRobot\Service\TransferOutService;
13-
use IXDomainRobot\Service\TrustedApplicationService;
14-
use IXDomainRobot\Service\ZoneService;
15-
use IXDomainRobot\Service\PollMessageService;
16-
17-
class DomainRobot
3+
namespace Domainrobot;
4+
5+
use Domainrobot\Lib\DomainrobotConfig;
6+
use Domainrobot\Service\CertificateService;
7+
use Domainrobot\Service\DomainStudioService;
8+
use Domainrobot\Service\DomainService;
9+
use Domainrobot\Service\SslContactService;
10+
use Domainrobot\Service\ContactService;
11+
use Domainrobot\Service\DomainCancelationService;
12+
use Domainrobot\Service\TransferOutService;
13+
use Domainrobot\Service\TrustedApplicationService;
14+
use Domainrobot\Service\ZoneService;
15+
use Domainrobot\Service\PollMessageService;
16+
17+
class Domainrobot
1818
{
1919

2020
/**
2121
*
22-
* @var DomainRobotConfig
22+
* @var DomainrobotConfig
2323
*/
24-
private $domainRobotConfig;
24+
private $domainrobotConfig;
2525

26-
private static $lastDomainRobotResult;
26+
private static $lastDomainrobotResult;
2727

2828
/**
2929
* Interface for all Certificate related requests
@@ -101,38 +101,38 @@ class DomainRobot
101101
/**
102102
* [
103103
* "url" => string, //optional
104-
* "auth" => DomainRobotAuth //optional
104+
* "auth" => DomainrobotAuth //optional
105105
* ]
106106
*
107-
* @param array $domainRobotConfig
107+
* @param array $domainrobotConfig
108108
*/
109-
public function __construct($domainRobotConfig = [])
109+
public function __construct($domainrobotConfig = [])
110110
{
111-
$this->setDomainRobotConfig(new DomainRobotConfig($domainRobotConfig));
112-
$this->certificate = new CertificateService($this->domainRobotConfig);
113-
$this->domainStudio = new DomainStudioService($this->domainRobotConfig);
114-
$this->domain = new DomainService($this->domainRobotConfig);
115-
$this->sslContact = new SslContactService($this->domainRobotConfig);
116-
$this->contact = new ContactService($this->domainRobotConfig);
117-
$this->domainCancelation = new DomainCancelationService($this->domainRobotConfig);
118-
$this->poll = new PollMessageService($this->domainRobotConfig);
119-
$this->transferOut = new TransferOutService($this->domainRobotConfig);
120-
$this->trustedApp = new TrustedApplicationService($this->domainRobotConfig);
121-
$this->zone = new ZoneService($this->domainRobotConfig);
111+
$this->setDomainrobotConfig(new DomainrobotConfig($domainrobotConfig));
112+
$this->certificate = new CertificateService($this->domainrobotConfig);
113+
$this->domainStudio = new DomainStudioService($this->domainrobotConfig);
114+
$this->domain = new DomainService($this->domainrobotConfig);
115+
$this->sslContact = new SslContactService($this->domainrobotConfig);
116+
$this->contact = new ContactService($this->domainrobotConfig);
117+
$this->domainCancelation = new DomainCancelationService($this->domainrobotConfig);
118+
$this->poll = new PollMessageService($this->domainrobotConfig);
119+
$this->transferOut = new TransferOutService($this->domainrobotConfig);
120+
$this->trustedApp = new TrustedApplicationService($this->domainrobotConfig);
121+
$this->zone = new ZoneService($this->domainrobotConfig);
122122
}
123123

124-
public function setDomainRobotConfig(DomainRobotConfig $domainRobotConfig)
124+
public function setDomainrobotConfig(DomainrobotConfig $domainrobotConfig)
125125
{
126-
$this->domainRobotConfig = $domainRobotConfig;
126+
$this->domainrobotConfig = $domainrobotConfig;
127127
}
128128

129-
public static function setLastDomainRobotResult($lastDomainRobotResult)
129+
public static function setLastDomainrobotResult($lastDomainrobotResult)
130130
{
131-
self::$lastDomainRobotResult = $lastDomainRobotResult;
131+
self::$lastDomainrobotResult = $lastDomainrobotResult;
132132
}
133133

134-
public static function getLastDomainRobotResult()
134+
public static function getLastDomainrobotResult()
135135
{
136-
return self::$lastDomainRobotResult;
136+
return self::$lastDomainrobotResult;
137137
}
138138
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace IXDomainRobot;
3+
namespace Domainrobot;
44

5-
class DomainRobotConstants{
5+
class DomainrobotConstants{
66

77
const AUTODNS_URL = "https://api.autodns.com/v1";
88

src/Lib/ArrayHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace IXDomainRobot\Lib;
3+
namespace Domainrobot\Lib;
44

55
class ArrayHelper
66
{
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace IXDomainRobot\Lib;
3+
namespace Domainrobot\Lib;
44

5-
use IXDomainRobot\Lib\ArrayHelper;
6-
use IXDomainRobot\DomainRobotConstants;
5+
use Domainrobot\Lib\ArrayHelper;
6+
use Domainrobot\DomainrobotConstants;
77

88

9-
class DomainRobotAuth
9+
class DomainrobotAuth
1010
{
1111
/**
1212
* AutoDNS User
@@ -31,7 +31,7 @@ public function __construct($config = [])
3131
{
3232
$this->setUser(ArrayHelper::getValueFromArray($config, 'user', ''));
3333
$this->setPassword(ArrayHelper::getValueFromArray($config, 'password', ''));
34-
$this->setContext(ArrayHelper::getValueFromArray($config, 'context', DomainRobotConstants::AUTODNS_CONTEXT));
34+
$this->setContext(ArrayHelper::getValueFromArray($config, 'context', DomainrobotConstants::AUTODNS_CONTEXT));
3535
}
3636

3737
private function setUser($user)

0 commit comments

Comments
 (0)