forked from wearerequired/harvest-api-php-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClientInterface.php
57 lines (51 loc) · 2.14 KB
/
ClientInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace Required\Harvest;
use Http\Client\Common\HttpMethodsClientInterface;
use Required\Harvest\Api\ApiInterface;
/**
* The PHP client for consuming the Harvest REST API.
*
* @method \Required\Harvest\Api\ClientsInterface clients()
* @method \Required\Harvest\Api\ContactsInterface contacts()
* @method \Required\Harvest\Api\CurrentUserInterface currentUser()
* @method \Required\Harvest\Api\CurrentCompanyInterface currentCompany()
* @method \Required\Harvest\Api\EstimateItemCategoriesInterface estimateItemCategories()
* @method \Required\Harvest\Api\EstimatesInterface estimates()
* @method \Required\Harvest\Api\ExpenseCategoriesInterface expenseCategories()
* @method \Required\Harvest\Api\ExpensesInterface expenses()
* @method \Required\Harvest\Api\InvoiceItemCategoriesInterface invoiceItemCategories()
* @method \Required\Harvest\Api\InvoicesInterface invoices()
* @method \Required\Harvest\Api\ProjectsInterface projects()
* @method \Required\Harvest\Api\RolesInterface roles()
* @method \Required\Harvest\Api\TaskAssignmentsInterface taskAssignments()
* @method \Required\Harvest\Api\TasksInterface tasks()
* @method \Required\Harvest\Api\TimeEntriesInterface timeEntries()
* @method \Required\Harvest\Api\UserAssignmentsInterface userAssignments()
* @method \Required\Harvest\Api\UsersInterface users()
*/
interface ClientInterface {
/**
* Authenticates a user for all next requests.
*
* @link https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/
*
* @param string $accountId The Harvest account ID.
* @param string $accessToken The personal access token.
*/
public function authenticate( string $accountId, string $accessToken ): void;
/**
* Retrieves the API interface for an endpoint name.
*
* @throws \Required\Harvest\Exception\InvalidArgumentException
*
* @param string $name The endpoint name.
* @return \Required\Harvest\Api\ApiInterface The API interface.
*/
public function api( $name ): ApiInterface;
/**
* Retrieves the HTTP client.
*
* @return \Http\Client\Common\HttpMethodsClientInterface
*/
public function getHttpClient(): HttpMethodsClientInterface;
}