|
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 messaging(): AccountMessagingEndpoint |
|
35
|
|
|
{ |
|
36
|
|
|
return new AccountMessagingEndpoint($this); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
public function security(): AccountSecurityEndpoint |
|
40
|
|
|
{ |
|
41
|
|
|
return new AccountSecurityEndpoint($this); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
public function requests(): AccountRequestsEndpoint |
|
45
|
|
|
{ |
|
46
|
|
|
return new AccountRequestsEndpoint($this); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function envelopeTemplate(): AccountEnvelopeTemplateEndpoint |
|
50
|
|
|
{ |
|
51
|
|
|
return new AccountEnvelopeTemplateEndpoint($this); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public function apiKeys(): AccountApiKeysEndpoint |
|
55
|
|
|
{ |
|
56
|
|
|
return new AccountApiKeysEndpoint($this); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function users(): AccountUsersEndpoint |
|
60
|
|
|
{ |
|
61
|
|
|
return new AccountUsersEndpoint($this); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function certificates(): AccountCertificatesEndpoint |
|
65
|
|
|
{ |
|
66
|
|
|
return new AccountCertificatesEndpoint($this); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function brandings(): AccountBrandingsEndpoint |
|
70
|
|
|
{ |
|
71
|
|
|
return new AccountBrandingsEndpoint($this); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function get(): Account |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->makeResource($this->getRequest()); |
|
|
|
|
|
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @param mixed[] $query |
|
81
|
|
|
* @return ListResource<AccountSmsLog> |
|
82
|
|
|
*/ |
|
83
|
|
|
public function smsLog(array $query = []): ListResource |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->createListResource($this->getRequest('/sms-log', ['query' => $query]), AccountSmsLog::class); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @param mixed[] $query |
|
90
|
|
|
*/ |
|
91
|
|
|
public function statistics(array $query = []): AccountStatistics |
|
92
|
|
|
{ |
|
93
|
|
|
return $this->createResource( |
|
94
|
|
|
$this->getRequest('/statistics', ['query' => $query]), |
|
95
|
|
|
AccountStatistics::class |
|
96
|
|
|
); |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function billing(): AccountBilling |
|
100
|
|
|
{ |
|
101
|
|
|
return $this->createResource($this->getRequest('/billing'), AccountBilling::class); |
|
102
|
|
|
} |
|
103
|
|
|
} |
|
104
|
|
|
|