Prototyped several interfaces, added basic topics stuff and exception.
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user