Skip to content

Commit cfbcfa5

Browse files
committed
- Implementation of SSLApprover, SSLCertificate and SSLProduct
1 parent 093990f commit cfbcfa5

19 files changed

Lines changed: 423 additions & 4 deletions

lib/BekoDesign/versioAPI/Client.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use BekoDesign\versioAPI\Models\Domain;
99
use BekoDesign\versioAPI\Models\Reseller;
1010
use BekoDesign\versioAPI\Models\ResellerPlan;
11+
use BekoDesign\versioAPI\Models\SSLApprover;
12+
use BekoDesign\versioAPI\Models\SSLCertificate;
13+
use BekoDesign\versioAPI\Models\SSLProduct;
1114
use BekoDesign\versioAPI\Models\TLD;
1215
use BekoDesign\versioAPI\Models\Webhosting;
1316
use BekoDesign\versioAPI\Models\WebhostingPlan;
@@ -112,6 +115,27 @@ public function resellerPlans() : ResellerPlan {
112115
return new ResellerPlan($this);
113116
}
114117

118+
/**
119+
* @return SSLApprover
120+
*/
121+
public function sslApprovers() : SSLApprover {
122+
return new SSLApprover($this);
123+
}
124+
125+
/**
126+
* @return SSLCertificate
127+
*/
128+
public function sslCertificates() : SSLCertificate {
129+
return new SSLCertificate($this);
130+
}
131+
132+
/**
133+
* @return SSLProduct
134+
*/
135+
public function sslProducts() : SSLProduct {
136+
return new SSLProduct($this);
137+
}
138+
115139
/**
116140
* @return TLD
117141
*/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
use Http\Promise\Promise;
7+
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
9+
10+
interface ICancelable
11+
{
12+
public function cancel($id, $data = [], $urlPostfix = '') : ResponseInterface;
13+
14+
public function cancelAsync($id, $data = [], $urlPostfix = '') : Promise;
15+
16+
public function cancelRequest($id, $data = [], $urlPostfix = '') : RequestInterface;
17+
18+
}

lib/BekoDesign/versioAPI/Contracts/IListable.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ public function list($data = [], $urlPostfix = '') : ResponseInterface;
1414
public function listAsync($data = [], $urlPostfix = '') : Promise;
1515

1616
public function listRequest($data = [], $urlPostfix = '') : RequestInterface;
17+
18+
public function getListUrl($data = [], $urlPostfix = '') : string;
1719
}

lib/BekoDesign/versioAPI/Contracts/IRenewable.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ public function renew($key, $data = [], $urlPostfix = '') : ResponseInterface;
1414
public function renewAsync($key, $data = [], $urlPostfix = '') : Promise;
1515

1616
public function renewRequest($key, $data = [], $urlPostfix = '') : RequestInterface;
17+
18+
public function getRenewUrl($key, $data = [], $urlPostfix = '') : string;
1719
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
interface ISSLApprover
7+
{
8+
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
interface ISSLCertificate
7+
{
8+
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
interface ISSLProduct
7+
{
8+
9+
}

lib/BekoDesign/versioAPI/Contracts/IUpdateable.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ public function update($id, $data = [], $urlPostfix = '') : ResponseInterface;
1414
public function updateAsync($id, $data = [], $urlPostfix = '') : Promise;
1515

1616
public function updateRequest($id, $data = [], $urlPostfix = '') : RequestInterface;
17+
18+
public function getUpdateUrl($key, $data = [], $urlPostfix = '') : string;
19+
1720
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Models;
4+
5+
use BekoDesign\versioAPI\Contracts\IListable;
6+
use BekoDesign\versioAPI\Contracts\ISSLApprover;
7+
use BekoDesign\versioAPI\Traits\Listable;
8+
9+
class SSLApprover implements ISSLApprover, IListable
10+
{
11+
use Listable;
12+
13+
protected $endpoint = 'sslapprovers';
14+
15+
/**
16+
* Category constructor.
17+
* @param $client
18+
*/
19+
public function __construct($client)
20+
{
21+
$this->client = $client;
22+
}
23+
24+
/**
25+
* @param array $data
26+
* @param string $urlPostfix
27+
* @return string
28+
*/
29+
public function getListUrl($data = [], $urlPostfix = '') : string {
30+
return $this->endpoint . '/' . $data['domain'] . $urlPostfix;
31+
}
32+
33+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Models;
4+
5+
use BekoDesign\versioAPI\Contracts\ICancelable;
6+
use BekoDesign\versioAPI\Contracts\ICreatable;
7+
use BekoDesign\versioAPI\Contracts\IGetable;
8+
use BekoDesign\versioAPI\Contracts\IListable;
9+
use BekoDesign\versioAPI\Contracts\IRenewable;
10+
use BekoDesign\versioAPI\Contracts\ISSLCertificate;
11+
use BekoDesign\versioAPI\Contracts\IUpdateable;
12+
use BekoDesign\versioAPI\Traits\Cancelable;
13+
use BekoDesign\versioAPI\Traits\Creatable;
14+
use BekoDesign\versioAPI\Traits\Getable;
15+
use BekoDesign\versioAPI\Traits\Listable;
16+
use BekoDesign\versioAPI\Traits\Renewable;
17+
use BekoDesign\versioAPI\Traits\Updateable;
18+
19+
class SSLCertificate implements ISSLCertificate, IListable, ICreatable, IGetable, IRenewable, ICancelable, IUpdateable
20+
{
21+
use Listable, Creatable, Getable, Renewable, Cancelable, Updateable;
22+
23+
protected $endpoint = 'sslcertificates';
24+
25+
/**
26+
* Category constructor.
27+
* @param $client
28+
*/
29+
public function __construct($client)
30+
{
31+
$this->client = $client;
32+
}
33+
34+
public function getRenewUrl($key, $data = [], $urlPostfix = '') : string {
35+
return $this->endpoint . '/' . $key . '/reissue' . $urlPostfix;
36+
}
37+
38+
public function getUpdateUrl($key, $data = [], $urlPostfix = '') : string {
39+
return $this->endpoint . '/' . $key . '/changeapprover' . $urlPostfix;
40+
}
41+
42+
43+
}

0 commit comments

Comments
 (0)