-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOutletsManager.php
More file actions
61 lines (56 loc) · 2.35 KB
/
Copy pathOutletsManager.php
File metadata and controls
61 lines (56 loc) · 2.35 KB
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
58
59
60
61
<?php
namespace SimpleSquid\Vend\Actions;
use SimpleSquid\Vend\Resources\TwoDotZero\Outlet;
use SimpleSquid\Vend\Resources\TwoDotZero\OutletCollection;
class OutletsManager
{
use ManagesResources;
/**
* Get a single outlet.
* Returns a single outlet with the requested ID.
*
* @param string $id Valid Outlet ID.
*
* @return Outlet
* @throws \SimpleSquid\Vend\Exceptions\AuthorisationException
* @throws \SimpleSquid\Vend\Exceptions\BadRequestException
* @throws \SimpleSquid\Vend\Exceptions\NotFoundException
* @throws \SimpleSquid\Vend\Exceptions\RateLimitException
* @throws \SimpleSquid\Vend\Exceptions\RequestException
* @throws \SimpleSquid\Vend\Exceptions\TokenExpiredException
* @throws \SimpleSquid\Vend\Exceptions\UnauthorisedException
* @throws \SimpleSquid\Vend\Exceptions\UnknownException
*/
public function find(string $id): Outlet
{
return $this->single(Outlet::class, "2.0/outlets/$id");
}
/**
* List outlets.
* Returns a collection of outlets.
*
* @param int|null $page_size The maximum number of items to be returned in the response.
* @param int|null $after The lower limit for the version numbers to be included in the response.
* @param int|null $before The upper limit for the version numbers to be included in the response.
* @param bool|null $deleted Indicates whether deleted items should be included in the response.
*
* @return OutletCollection
* @throws \SimpleSquid\Vend\Exceptions\AuthorisationException
* @throws \SimpleSquid\Vend\Exceptions\BadRequestException
* @throws \SimpleSquid\Vend\Exceptions\NotFoundException
* @throws \SimpleSquid\Vend\Exceptions\RateLimitException
* @throws \SimpleSquid\Vend\Exceptions\RequestException
* @throws \SimpleSquid\Vend\Exceptions\TokenExpiredException
* @throws \SimpleSquid\Vend\Exceptions\UnauthorisedException
* @throws \SimpleSquid\Vend\Exceptions\UnknownException
*/
public function get(
int $page_size = null,
int $after = null,
int $before = null,
bool $deleted = null
): OutletCollection {
return $this->collection(OutletCollection::class, '2.0/outlets',
compact('after', 'before', 'page_size', 'deleted'));
}
}