1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace DigitalCz\DigiSign\Endpoint; |
6
|
|
|
|
7
|
|
|
use DigitalCz\DigiSign\DigiSign; |
8
|
|
|
use DigitalCz\DigiSign\Resource\Account; |
9
|
|
|
use DigitalCz\DigiSign\Resource\AccountBilling; |
10
|
|
|
use DigitalCz\DigiSign\Resource\AccountSmsLog; |
11
|
|
|
use DigitalCz\DigiSign\Resource\AccountStatistics; |
12
|
|
|
use DigitalCz\DigiSign\Resource\ListResource; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @extends ResourceEndpoint<Account> |
16
|
|
|
*/ |
17
|
|
|
final class AccountEndpoint extends ResourceEndpoint |
18
|
|
|
{ |
19
|
|
|
public function __construct(DigiSign $parent) |
20
|
|
|
{ |
21
|
|
|
parent::__construct($parent, '/api/account', Account::class); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function me(): AccountMeEndpoint |
25
|
|
|
{ |
26
|
|
|
return new AccountMeEndpoint($this); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public function settings(): AccountSettingsEndpoint |
30
|
|
|
{ |
31
|
|
|
return new AccountSettingsEndpoint($this); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function security(): AccountSecurityEndpoint |
35
|
|
|
{ |
36
|
|
|
return new AccountSecurityEndpoint($this); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function requests(): AccountRequestsEndpoint |
40
|
|
|
{ |
41
|
|
|
return new AccountRequestsEndpoint($this); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function envelopeTemplate(): AccountEnvelopeTemplateEndpoint |
45
|
|
|
{ |
46
|
|
|
return new AccountEnvelopeTemplateEndpoint($this); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function apiKeys(): AccountApiKeysEndpoint |
50
|
|
|
{ |
51
|
|
|
return new AccountApiKeysEndpoint($this); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function users(): AccountUsersEndpoint |
55
|
|
|
{ |
56
|
|
|
return new AccountUsersEndpoint($this); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function certificates(): AccountCertificatesEndpoint |
60
|
|
|
{ |
61
|
|
|
return new AccountCertificatesEndpoint($this); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function brandings(): AccountBrandingsEndpoint |
65
|
|
|
{ |
66
|
|
|
return new AccountBrandingsEndpoint($this); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function get(): Account |
70
|
|
|
{ |
71
|
|
|
return $this->makeResource($this->getRequest()); |
|
|
|
|
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param mixed[] $query |
76
|
|
|
* @return ListResource<AccountSmsLog> |
77
|
|
|
*/ |
78
|
|
|
public function smsLog(array $query = []): ListResource |
79
|
|
|
{ |
80
|
|
|
return $this->createListResource($this->getRequest('/sms-log', ['query' => $query]), AccountSmsLog::class); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @param mixed[] $query |
85
|
|
|
*/ |
86
|
|
|
public function statistics(array $query = []): AccountStatistics |
87
|
|
|
{ |
88
|
|
|
return $this->createResource( |
89
|
|
|
$this->getRequest('/statistics', ['query' => $query]), |
90
|
|
|
AccountStatistics::class |
91
|
|
|
); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function billing(): AccountBilling |
95
|
|
|
{ |
96
|
|
|
return $this->createResource($this->getRequest('/billing'), AccountBilling::class); |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|