1 | <?php |
||
9 | class ApiKey |
||
10 | { |
||
11 | use AdjustUrl; |
||
12 | |||
13 | /** @var \GuzzleHttp\Client */ |
||
14 | protected $client; |
||
15 | |||
16 | /** @var Headers */ |
||
17 | protected $headers; |
||
18 | |||
19 | /** @var string The environment this is being run in */ |
||
20 | protected $environment; |
||
21 | |||
22 | /** The URI of the action */ |
||
23 | const URI = 'https://api.signere.no/api/ApiToken'; |
||
24 | |||
25 | /** |
||
26 | * Instantiate the class. |
||
27 | * |
||
28 | * @param Client $client |
||
29 | * @param Headers $headers |
||
30 | * @param string $environment |
||
31 | */ |
||
32 | 5 | public function __construct(Client $client, Headers $headers, $environment = null) |
|
38 | |||
39 | /** |
||
40 | * Renews the primary API key. |
||
41 | * |
||
42 | * @param string $key |
||
43 | * @return object |
||
44 | */ |
||
45 | 1 | public function renewPrimary(string $key) |
|
62 | |||
63 | /** |
||
64 | * Renews the secondary API key. |
||
65 | * |
||
66 | * @param string $key |
||
67 | * @return object |
||
68 | */ |
||
69 | 1 | public function renewSecondary(string $key) |
|
86 | |||
87 | /** |
||
88 | * Generate a new primary key and return it. |
||
89 | * |
||
90 | * @param string $providerId |
||
91 | * @param int $otpCode |
||
92 | * @return object |
||
93 | */ |
||
94 | 1 | public function createPrimary(string $providerId, int $otpCode) |
|
116 | |||
117 | /** |
||
118 | * Sends an OTP code in an SMS to |
||
119 | * the given mobile number. |
||
120 | * |
||
121 | * @param array $body |
||
122 | * @return object |
||
123 | */ |
||
124 | 1 | public function recoverPrimary(array $body) |
|
155 | } |
||
156 |