1 | <?php |
||
14 | class Inktale |
||
15 | { |
||
16 | /** @var InktaleApiClient */ |
||
17 | private $api; |
||
18 | |||
19 | /** |
||
20 | * @param InktaleApiClient|null $apiClient |
||
21 | */ |
||
22 | public function __construct(InktaleApiClient $apiClient = null) |
||
26 | |||
27 | /** |
||
28 | * Set api key to be used for next requests |
||
29 | * |
||
30 | * @param string|null $apiKey |
||
31 | */ |
||
32 | public function setApiKey($apiKey) |
||
36 | |||
37 | /** |
||
38 | * Create a new store and retrieve the api key. This request does not require an api key to be set |
||
39 | * |
||
40 | * @param string $email |
||
41 | * @param string $name |
||
42 | * |
||
43 | * @return StoreItem |
||
44 | * @throws InktaleApiException |
||
45 | */ |
||
46 | public function createStore($email, $name) |
||
55 | |||
56 | /** |
||
57 | * Fetch list of available products that artwork can be created on |
||
58 | * |
||
59 | * @return ProductItem[] |
||
60 | * @throws InktaleApiException |
||
61 | */ |
||
62 | public function getProducts() |
||
73 | |||
74 | /** |
||
75 | * Create a new artwork on given products. |
||
76 | * Response is an artwork id. |
||
77 | * WARNING! Artwork creation is asynchronous! |
||
78 | * |
||
79 | * @param ArtworkCreationParams $params |
||
80 | * @return string Newly created artwork id |
||
81 | * @throws InktaleApiException |
||
82 | */ |
||
83 | public function createArtwork(ArtworkCreationParams $params) |
||
107 | |||
108 | /** |
||
109 | * Get an artwork with files and products |
||
110 | * |
||
111 | * @param string $artworkId |
||
112 | * @return ArtworkItem |
||
113 | * @throws InktaleApiException |
||
114 | */ |
||
115 | public function getArtwork($artworkId) |
||
121 | |||
122 | /** |
||
123 | * Get a list of artworks |
||
124 | * |
||
125 | * @param int $page Page number (starting from 1) |
||
126 | * @param int $perPage Items per page, up to 100 |
||
127 | * @param bool $publishedOnly |
||
128 | * @return ArtworkListItem |
||
129 | */ |
||
130 | public function getArtworks($page, $perPage, $publishedOnly = false) |
||
140 | |||
141 | /** |
||
142 | * Current API client instance |
||
143 | * |
||
144 | * @return InktaleApiClient |
||
145 | */ |
||
146 | public function getApiClient() |
||
150 | } |