Skip to content

Commit 5d1e5d9

Browse files
committed
Rename list() -> all() and show() -> get()
1 parent 7b0aa09 commit 5d1e5d9

File tree

22 files changed

+456
-81
lines changed

22 files changed

+456
-81
lines changed

docs/applications.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Detailed documentation and DTOs are in [Servers (admin)](servers.md).
4040

4141
Key entry points:
4242

43-
- `list(): ServersListBuilder`
44-
- `show(int $id): ServersItemBuilder`
43+
- `all(): ServersListBuilder`
44+
- `get(int $id): ServersItemBuilder`
4545
- `external(string $externalId): ServersItemBuilder`
4646
- `create(CreateServerParams): ItemResponse`
4747
- `update(int $id, ServerDetailsParams): ItemResponse`
@@ -57,7 +57,7 @@ Key entry points:
5757
Filters & sort
5858

5959
```php
60-
$servers = $p->servers->list()
60+
$servers = $p->servers->all()
6161
->filterName('prod')
6262
->filterUuid('54f52795-...')
6363
->filterExternalId('ext-123')
@@ -71,8 +71,8 @@ $servers = $p->servers->list()
7171

7272
Namespace: `Gigabait93\Applications\Users\Users`
7373

74-
- `list(): UsersListBuilder``ListResponse`
75-
- `show(int $id): UsersItemBuilder``ItemResponse`
74+
- `all(): UsersListBuilder``ListResponse`
75+
- `get(int $id): UsersItemBuilder``ItemResponse`
7676
- `external(string $externalId): UsersItemBuilder`
7777
- `create(UserCreateParams $params): ItemResponse`
7878
- `update(int $id, UserUpdateParams $params): ItemResponse`
@@ -100,7 +100,7 @@ $upd = (new \Gigabait93\Applications\Users\Params\UserUpdateParams())
100100
$update = $p->users->update(42, $upd);
101101

102102
// Filters & sort
103-
$users = $p->users->list()
103+
$users = $p->users->all()
104104
->filterEmail('john@example.com')
105105
->filterUsername('john')
106106
->sort('created_at', true)
@@ -111,8 +111,8 @@ $users = $p->users->list()
111111

112112
Namespace: `Gigabait93\Applications\Nodes\Nodes`
113113

114-
- `list(): NodesListBuilder``ListResponse`
115-
- `show(int $id): NodesItemBuilder``ItemResponse`
114+
- `all(): NodesListBuilder``ListResponse`
115+
- `get(int $id): NodesItemBuilder``ItemResponse`
116116
- `create(NodeCreateParams $params): ItemResponse`
117117
- `update(int $id, NodeUpdateParams $params): ItemResponse`
118118
- `destroy(int $id): ActionResponse`
@@ -137,7 +137,7 @@ $upd = (new \Gigabait93\Applications\Nodes\Params\NodeUpdateParams())
137137
$p->nodes->update(10, $upd);
138138

139139
// Filters & sort
140-
$nodes = $p->nodes->list()
140+
$nodes = $p->nodes->all()
141141
->filterName('eu-')
142142
->filterFqdn('node1.example.com')
143143
->sort('name')
@@ -148,8 +148,8 @@ $nodes = $p->nodes->list()
148148

149149
Namespace: `Gigabait93\Applications\Locations\Locations`
150150

151-
- `list(): LocationsListBuilder``ListResponse`
152-
- `show(int $id): LocationsItemBuilder``ItemResponse`
151+
- `all(): LocationsListBuilder``ListResponse`
152+
- `get(int $id): LocationsItemBuilder``ItemResponse`
153153
- `create(LocationParams $params): ItemResponse`
154154
- `update(int $id, LocationParams $params): ItemResponse`
155155
- `destroy(int $id): ActionResponse`
@@ -159,7 +159,7 @@ DTO
159159
- `LocationParams(short, long)`
160160

161161
```php
162-
$loc = $p->locations->list()
162+
$loc = $p->locations->all()
163163
->filterShort('EU')
164164
->sort('created_at', true)
165165
->send();
@@ -169,21 +169,21 @@ $loc = $p->locations->list()
169169

170170
Namespace: `Gigabait93\Applications\Nests\Nests`
171171

172-
- `list(): NestsListBuilder``ListResponse`
173-
- `show(int $id): NestsItemBuilder``ItemResponse`
172+
- `all(): NestsListBuilder``ListResponse`
173+
- `get(int $id): NestsItemBuilder``ItemResponse`
174174

175175
## Eggs (admin)
176176

177177
Namespace: `Gigabait93\Applications\Eggs\Eggs`
178178

179-
- `list(int $nestId): EggsListBuilder``ListResponse`
180-
- `show(int $nestId, int $eggId): EggsItemBuilder``ItemResponse`
179+
- `all(int $nestId): EggsListBuilder``ListResponse`
180+
- `get(int $nestId, int $eggId): EggsItemBuilder``ItemResponse`
181181

182182
## Allocations (admin)
183183

184184
Namespace: `Gigabait93\Applications\Allocations\Allocations`
185185

186-
- `list(int $nodeId): ListBuilder` (returns `ListResponse`)
186+
- `all(int $nodeId): ListBuilder` (returns `ListResponse`)
187187
- `create(int $nodeId, AllocationCreateParams $params): ActionResponse`
188188
- `destroy(int $nodeId, int $allocationId): ActionResponse`
189189

docs/client.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $p->server->command($uuid, 'say hello');
4747

4848
Namespace: `Gigabait93\Client\Files\Files`
4949

50-
- `list(string $uuidShort, string $path = '/'): ListBuilder`
50+
- `all(string $uuidShort, string $path = '/'): ListBuilder`
5151
- `read(string $uuidShort, string $filePath): ItemResponse`
5252
- `download(string $uuidShort, string $filePath): ItemResponse`
5353
- `rename(string $uuidShort, string $old, string $new, string $path = '/'): ActionResponse`
@@ -69,13 +69,13 @@ UploadBuilder (namespace `Gigabait93\Client\Files\Builders`):
6969
- `addContents(string $name, string $contents, ?string $mime = null): self`
7070
- `addMany(array $items): self`
7171
- `send(?string $signedUrl = null): ActionResponse`
72-
- `sendAndVerify(?string $signedUrl = null): ActionResponse` — verifies with Files::list()
72+
- `sendAndVerify(?string $signedUrl = null): ActionResponse` — verifies with Files::all()
7373

7474
### Database
7575

7676
Namespace: `Gigabait93\Client\Database\Database`
7777

78-
- `list(string $uuidShort): ListBuilder`
78+
- `all(string $uuidShort): ListBuilder`
7979
- `create(string $uuidShort, string $database, string $remote = '%'): ItemResponse`
8080
- `resetPassword(string $uuidShort, string $database): ActionResponse`
8181
- `destroy(string $uuidShort, string $database): ActionResponse`
@@ -84,8 +84,8 @@ Namespace: `Gigabait93\Client\Database\Database`
8484

8585
Namespace: `Gigabait93\Client\Backups\Backups`
8686

87-
- `list(string $uuidShort): ListBuilder`
88-
- `show(string $uuidShort, string $backup): ItemResponse`
87+
- `all(string $uuidShort): ListBuilder`
88+
- `get(string $uuidShort, string $backup): ItemResponse`
8989
- `download(string $uuidShort, string $backup): ItemResponse`
9090
- `create(string $uuidShort, string $name, string $ignored = ''): ItemResponse`
9191
- `destroy(string $uuidShort, string $backup): ActionResponse`
@@ -96,8 +96,8 @@ Namespace: `Gigabait93\Client\Backups\Backups`
9696

9797
Namespace: `Gigabait93\Client\Schedules\Schedules`
9898

99-
- `list(string $uuidShort): ListBuilder`
100-
- `show(string $uuidShort, string $scheduleId): ItemResponse`
99+
- `all(string $uuidShort): ListBuilder`
100+
- `get(string $uuidShort, string $scheduleId): ItemResponse`
101101
- `create(string $uuidShort, ...): ItemResponse`
102102
- `update(string $uuidShort, int $scheduleId, ...): ItemResponse`
103103
- `execute(string $uuidShort, int $scheduleId): ActionResponse`
@@ -110,7 +110,7 @@ Namespace: `Gigabait93\Client\Schedules\Schedules`
110110

111111
Namespace: `Gigabait93\Client\Network\Network`
112112

113-
- `list(string $uuidShort): ListBuilder`
113+
- `all(string $uuidShort): ListBuilder`
114114
- `assignAllocation(string $uuidShort): ActionResponse`
115115
- `setNote(string $uuidShort, string $allocationId, string $note): ActionResponse`
116116
- `setPrimary(string $uuidShort, string $allocationId): ActionResponse`
@@ -135,7 +135,7 @@ Namespace: `Gigabait93\Client\Settings\Settings`
135135

136136
Namespace: `Gigabait93\Client\Subusers\Subusers`
137137

138-
- `list(string $uuidShort): ListBuilder`
138+
- `all(string $uuidShort): ListBuilder`
139139
- `create(string $uuidShort, string $email, array $permissions): ItemResponse`
140140
- `update(string $uuidShort, string $subuserUuid, array $permissions): ItemResponse`
141141
- `destroy(string $uuidShort, string $subuserUuid): ActionResponse`
@@ -145,7 +145,7 @@ Namespace: `Gigabait93\Client\Subusers\Subusers`
145145
List files and download one:
146146

147147
```php
148-
$files = $p->files->list($uuid, '/')->send();
148+
$files = $p->files->all($uuid, '/')->send();
149149
foreach ($files->data as $it) {
150150
$name = $it['attributes']['name'] ?? '';
151151
if ($name === 'server.properties') {

docs/responses.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Represents `/{id}` endpoints and holds `id` as `readonly`.
8181
## Notes
8282

8383
- All Client and Application modules follow the same patterns:
84-
- `list()` returns a `ListBuilder`
85-
- `show(...)` returns an `ItemBuilder`
84+
- `all()` returns a `ListBuilder`
85+
- `get(...)` returns an `ItemBuilder`
8686
- write operations return `ItemResponse` or `ActionResponse`
8787
- Use `->ok` to check success and `->explain()` to get human-friendly error context.

docs/servers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ use Gigabait93\Pterodactyl;
1717
$p = Pterodactyl::make('https://panel.example.com', 'ptlc_xxx'); // Client Admin token
1818
```
1919

20-
## List and show
20+
## List and get
2121

22-
- `Servers::list(): ServersListBuilder` — call `->send()` to get `ServersListResponse` (ListResponse subtype)
23-
- `Servers::show(int $id): ServersItemBuilder` — resolves an item context (admin)
22+
- `Servers::all(): ServersListBuilder` — call `->send()` to get `ServersListResponse` (ListResponse subtype)
23+
- `Servers::get(int $id): ServersItemBuilder` — resolves an item context (admin)
2424
- `Servers::external(string $externalId): ServersItemBuilder` — by external id
2525

2626
Example
2727

2828
```php
29-
$list = $p->servers->list()->perPage(50)->send();
29+
$list = $p->servers->all()->perPage(50)->send();
3030
$firstId = $list->ok ? (int)($list->data[0]['attributes']['id'] ?? 0) : 0;
31-
$server = $p->servers->show($firstId); // ServersItemBuilder
31+
$server = $p->servers->get($firstId); // ServersItemBuilder
3232
```
3333

3434
### Filters & Sort (list)
3535

3636
```php
3737
// Filter servers and order
38-
$list = $p->servers->list()
38+
$list = $p->servers->all()
3939
->filterName('prod')
4040
->filterExternalId('crm-42')
4141
->sort('name') // asc
@@ -138,7 +138,7 @@ Client shortcuts (uuidShort auto-resolved and cached):
138138
- Startup (client): `startupVars()`, `startupVarsUpdate(array $data)`
139139
- Settings (client): `settingsRename(name)`, `settingsSetDockerImage(image)`
140140

141-
The builder resolves `uuidShort` on first use via admin `show()` data and caches it.
141+
The builder resolves `uuidShort` on first use via admin `get()` data and caches it.
142142

143143
## Responses and errors
144144

@@ -169,7 +169,7 @@ $resp = $p->servers->create($params);
169169
Suspend then rename via client Settings:
170170

171171
```php
172-
$server = $p->servers->show(123);
172+
$server = $p->servers->get(123);
173173
$server->suspend();
174174
$server->settingsRename('Maintenance');
175175
```

src/Applications/Allocations/Allocations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(Pterodactyl $ptero)
1717
parent::__construct($ptero, 'api/application/nodes');
1818
}
1919

20-
public function list(int $nodeId): ListBuilder
20+
public function all(int $nodeId): ListBuilder
2121
{
2222
return new ListBuilder($this, '/' . $nodeId . '/allocations', ListResponse::class);
2323
}

src/Applications/Eggs/Eggs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public function __construct(Pterodactyl $ptero)
1717
parent::__construct($ptero, 'api/application/nests');
1818
}
1919

20-
public function list(int $nestId): EggsListBuilder
20+
public function all(int $nestId): EggsListBuilder
2121
{
2222
return new EggsListBuilder($this, '/' . $nestId . '/eggs', EggsListResponse::class);
2323
}
2424

25-
public function show(int $nestId, int $eggId): EggsItemBuilder
25+
public function get(int $nestId, int $eggId): EggsItemBuilder
2626
{
2727
return new EggsItemBuilder($this, $nestId, $eggId);
2828
}

src/Applications/Locations/Locations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ public function __construct(Pterodactyl $ptero)
2020
parent::__construct($ptero, 'api/application/locations');
2121
}
2222

23-
public function list(): LocationsListBuilder
23+
public function all(): LocationsListBuilder
2424
{
2525
return new LocationsListBuilder($this, '', LocationsListResponse::class);
2626
}
2727

28-
public function show(int $id): LocationsItemBuilder
28+
public function get(int $id): LocationsItemBuilder
2929
{
3030
return new LocationsItemBuilder($this, $id);
3131
}

src/Applications/Nests/Nests.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,37 @@
1010
use Gigabait93\Pterodactyl;
1111
use Gigabait93\Support\SubClient;
1212

13+
/**
14+
* Application API for panel nests.
15+
*/
1316
class Nests extends SubClient
1417
{
18+
/**
19+
* @param Pterodactyl $ptero Pterodactyl client instance
20+
*/
1521
public function __construct(Pterodactyl $ptero)
1622
{
1723
parent::__construct($ptero, 'api/application/nests');
1824
}
1925

20-
public function list(): NestsListBuilder
26+
/**
27+
* List all nests.
28+
*
29+
* @return NestsListBuilder
30+
*/
31+
public function all(): NestsListBuilder
2132
{
2233
return new NestsListBuilder($this, '', NestsListResponse::class);
2334
}
2435

25-
public function show(int $id): NestsItemBuilder
36+
/**
37+
* Get a nest by its identifier.
38+
*
39+
* @param int $id Nest identifier
40+
* @return NestsItemBuilder
41+
*/
42+
public function get(int $id): NestsItemBuilder
2643
{
2744
return new NestsItemBuilder($this, $id);
2845
}
29-
3046
}

src/Applications/Nodes/Builders/NodesItemBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class NodesItemBuilder extends \Gigabait93\Support\Builders\ItemBuilder
1919

2020
public function allocations(): ListBuilder
2121
{
22-
return $this->client->ptero()->allocations->list($this->getId());
22+
return $this->client->ptero()->allocations->all($this->getId());
2323
}
2424

2525
public function createAllocation(array $params): ActionResponse

src/Applications/Nodes/Nodes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public function __construct(Pterodactyl $ptero)
2121
parent::__construct($ptero, 'api/application/nodes');
2222
}
2323

24-
public function list(): NodesListBuilder
24+
public function all(): NodesListBuilder
2525
{
2626
return new NodesListBuilder($this, '', NodesListResponse::class);
2727
}
2828

29-
public function show(int $id): NodesItemBuilder
29+
public function get(int $id): NodesItemBuilder
3030
{
3131
return new NodesItemBuilder($this, $id);
3232
}

0 commit comments

Comments
 (0)