Prototyped several interfaces, added basic topics stuff and exception.

This commit is contained in:
conky
2022-10-13 20:18:48 +03:00
parent 4bfc4ccdaf
commit f3d397404f
10 changed files with 122 additions and 14 deletions

View File

@@ -8,13 +8,39 @@ interface ClientInterface {
* Login using credentials.
*
* @param string $login
*
* User login.
* @param string $password
* User password.
*
* @throws InvalidAuthCredentials
*
* @return void
* @throws \Toloka\PhpApi\Exception\Auth\InvalidAuthCredentials
* @throws \Toloka\PhpApi\Exception\Auth\TooManyLoginAttempts
* @throws \Psr\Http\Client\ClientExceptionInterface
*/
public function login(string $login, string $password): void;
/**
* Check if user logged in.
*
* @return bool
*/
public function isLoggedIn(): bool;
/**
* Perform user's logout.
*
* @throws \Psr\Http\Client\ClientExceptionInterface
*/
public function logout(): void;
/**
* Get topic by ID.
*
* @param int $id
* Integer serial number of topic.
*
* @return TopicInterface
* Object with populated topic data.
*/
public function getTopic(int $id): TopicInterface;
}