-
Notifications
You must be signed in to change notification settings - Fork 12
/
DomainRestoreList.php
57 lines (51 loc) · 1.61 KB
/
DomainRestoreList.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace Example;
use Domainrobot\Domainrobot;
use Domainrobot\Lib\DomainrobotAuth;
use Domainrobot\Lib\DomainrobotException;
use Domainrobot\Lib\DomainrobotHeaders;
use Domainrobot\Model\Domain;
use Domainrobot\Model\Query;
use Domainrobot\Model\QueryFilter;
use Domainrobot\Model\QueryView;
class SDKController
{
/**
* Inquire a list of domains of a subuser
* returns an array of Domainrobot\Model\Domain
*
* @return Domain[]
*/
public function domainRestoreList()
{
$domainrobot = new Domainrobot([
"url" => "https://api.demo.autodns.com/v1",
"auth" => new DomainrobotAuth([
"user" => "username",
"password" => "password",
"context" => 4
])
]);
try {
$query = new Query([
'filters' => [ new QueryFilter([
'key' => 'name',
'value' => 'example%',
'operator' => 'LIKE'
])],
'view' => new QueryView([
'children' => 1,
'limit' => 10
])
]);
$domainList = $domainrobot->domain->restoreList($query);
} catch (DomainrobotException $exception) {
return $exception;
}
// if you want to get the raw result of the request
Domainrobot::getLastDomainrobotResult()->getResult();
// if you need the http status code of the last request/response
Domainrobot::getLastDomainrobotResult()->getStatusCode();
return $domainList;
}
}