Skip to content

Commit dae2da9

Browse files
committed
Adding info for imports in README
1 parent f682965 commit dae2da9

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ use Storyblok\ManagementApi\ManagementApiClient;
4343
$client = new ManagementApiClient($storyblokPersonalAccessToken);
4444
```
4545

46+
For using the `ManagementApiClient` class you have to import:
47+
48+
```php
49+
use Storyblok\ManagementApi\ManagementApiClient;
50+
```
51+
4652
### Setting the space region
4753

4854
The second optional parameter is for setting the region.
@@ -114,6 +120,18 @@ Let's start analyzing the specialized classes, like for example the `SpaceApi`.
114120

115121
## Handling Spaces
116122

123+
For using the `SpaceApi` class you have to import:
124+
125+
```php
126+
use Storyblok\ManagementApi\Endpoints\SpaceApi;
127+
```
128+
129+
For using the `Space` class you have to import:
130+
131+
```php
132+
use Storyblok\ManagementApi\Data\Space;
133+
```
134+
117135
### Retrieve all the spaces
118136

119137
Fetch a list of all spaces associated with your account in the current region (the region is initialized in the `ManagementApiClient`):
@@ -190,6 +208,18 @@ try {
190208

191209
## Handling Stories
192210

211+
For using the `StoryApi` class you have to import:
212+
213+
```php
214+
use Storyblok\ManagementApi\Endpoints\StoryApi;
215+
```
216+
217+
For using the `Story` class you have to import:
218+
219+
```php
220+
use Storyblok\ManagementApi\Data\Story;
221+
```
222+
193223
### Getting the StoryApi instance
194224

195225
To handle Stories, get stories, get a single story, create a story, update a story, or delete a story, you can start getting the instance of StoryApi that allows you to access the methods for handling stories.
@@ -393,6 +423,19 @@ $createdStories = iterator_to_array($storyBulkApi->createStories($stories));
393423

394424
## Handling users
395425

426+
For using the `UserApi` class you have to import:
427+
428+
```php
429+
use Storyblok\ManagementApi\Endpoints\UserApi;
430+
```
431+
432+
For using the `User` class you have to import:
433+
434+
```php
435+
use Storyblok\ManagementApi\Data\User;
436+
```
437+
438+
396439
### Getting the current user
397440

398441
To get the current user, owner of the Personal access token used you can use the `UserApi` class for calling endpoints and the `User` for accessing to returned data object properties.
@@ -426,6 +469,18 @@ Typically, all the data object provides you some helper methods like:
426469

427470
## Handling assets
428471

472+
For using the `AssetApi` class you have to import:
473+
474+
```php
475+
use Storyblok\ManagementApi\Endpoints\AssetApi;
476+
```
477+
478+
For using the `Asset` class you have to import:
479+
480+
```php
481+
use Storyblok\ManagementApi\Data\Asset;
482+
```
483+
429484
### Getting the AssetApi instance
430485

431486
To handle assets, get assets, get a single asset, upload an asset, update an asset, or delete an asset, you can start getting the instance of AssetApi that allows you to access the methods for handling assets.
@@ -513,6 +568,18 @@ echo "DELETED ASSET, ID : " . $deletedAsset->id() . PHP_EOL;
513568

514569
## Handling tags
515570

571+
For using the `TagApi` class you have to import:
572+
573+
```php
574+
use Storyblok\ManagementApi\Endpoints\TagApi;
575+
```
576+
577+
For using the `Tag` class you have to import:
578+
579+
```php
580+
use Storyblok\ManagementApi\Data\Tag;
581+
```
582+
516583
### Getting the `TagApi` instance
517584

518585
To handle tags, get tags,create an asset, update an asset, or delete an asset, you can start getting the instance of `TagApi` that allows you to access the methods for handling tags.
@@ -683,6 +750,18 @@ echo PHP_EOL;
683750

684751
If you need to handle workflows (retrieving workflows or create new custom workflow - in the case you have a proper plan - ) you can use the `WorkflowApi` class.
685752

753+
For using the `WorkflowApi` class you have to import:
754+
755+
```php
756+
use Storyblok\ManagementApi\Endpoints\WorkflowApi;
757+
```
758+
759+
For using the `Workflow` class you have to import:
760+
761+
```php
762+
use Storyblok\ManagementApi\Data\Workflow;
763+
```
764+
686765
### Retrieving workflows
687766

688767
```php

0 commit comments

Comments
 (0)