Skip to content

Commit bd755ef

Browse files
authored
Merge pull request #183 from ToshY/generator/update-api-models-180
Generator/update api models from #180
2 parents 8e7cee1 + 2003060 commit bd755ef

33 files changed

+1014
-630
lines changed

docs/base-api.md

Lines changed: 558 additions & 316 deletions
Large diffs are not rendered by default.

docs/edge-scripting-api.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ $bunnyHttpClient->request(
7070
);
7171
```
7272

73-
!!! note
73+
??? note
7474

7575
- The key `type` has the following possible values:
7676
- `0` = DNS (DNS scripts)
@@ -109,7 +109,7 @@ $bunnyHttpClient->request(
109109
);
110110
```
111111

112-
!!! note
112+
??? note
113113

114114
- The key `ScriptType` has the following possible values:
115115
- `1` = Standalone (Standalone scripts are ideal for a wide range of applications, such as building RESTful APIs, delivering UI applications, and processing data at the edge.)
@@ -118,7 +118,7 @@ $bunnyHttpClient->request(
118118
- The key `Id` (under `RepositorySettings`) and `DeployConfiguration` are not required when creating a new GitHub repository.
119119
- The key `IntegrationId` is required when creating and deploying through GitHub. It can be retrieved from the [Get GitHub Integration](base-api.md#get-github-integration) endpoint.
120120

121-
!!! info
121+
??? info
122122

123123
The Edge Scripting API can also be used for creating DNS scripts.
124124

@@ -133,7 +133,7 @@ $bunnyHttpClient->request(
133133
);
134134
```
135135

136-
!!! example
136+
??? example
137137

138138
Examples for `DeployConfiguration` payloads.
139139

@@ -159,7 +159,7 @@ $bunnyHttpClient->request(
159159
],
160160
```
161161

162-
!!! question
162+
??? question
163163

164164
If you want to create a workflow file yourself, check out the [BunnyWay Github action deploy script](https://github.com/BunnyWay/actions/tree/main/deploy-script).
165165

@@ -203,7 +203,7 @@ $bunnyHttpClient->request(
203203
);
204204
```
205205

206-
!!! note
206+
??? note
207207

208208
- The key `ScriptType` has the following possible values:
209209
- `0` = DNS (DNS scripts)
@@ -225,7 +225,7 @@ $bunnyHttpClient->request(
225225

226226
### Variable
227227

228-
!!! info
228+
??? info
229229

230230
There is no "List Variables" endpoint to retrieve all variables for a specific script. Instead, you can retrieve
231231
this information from the [Get Edge Script](#get-edge-script) endpoint.
@@ -415,7 +415,7 @@ $bunnyHttpClient->request(
415415
);
416416
```
417417

418-
!!! note
418+
??? note
419419

420420
- The key `uuid` denotes an 8 character alphanumeric string (and **not** an ["UUID"](https://datatracker.ietf.org/doc/html/rfc9562)),
421421
which can be retrieved from the [Get Releases](#get-releases) or [Get Active Release](#get-active-release) endpoints. It can also

docs/edge-storage-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ $bunnyHttpClient->request(
7676
);
7777
```
7878

79-
!!! note
79+
??? note
8080
- Make sure your `RootPath` and `Paths` contain **leading** and **trailing** slashes.
8181
- If you omit the slashes in `RootPath` this will result in a `400` status code.
8282
- If you omit the slashes in `Paths` this will result in a `200` status code with an empty ZIP file.
8383

84-
!!! warning
84+
??? warning
8585

8686
- This endpoint (with method `POST`) is currently not documented in the API specifications.
8787
- This request may fail or timeout if the requested directory has too many files or is too big.
@@ -133,7 +133,7 @@ $bunnyHttpClient->request(
133133
);
134134
```
135135

136-
!!! warning
136+
??? warning
137137

138138
- While a hash value in hexidecimal string representation is case insensitive, the value for the `Checksum` header must be in **uppercase** characters to ensure a successful upload.
139139
- If an incorrect `Checksum` is provided, the response will still be `201` but the file will not be uploaded.

docs/image-processing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ BunnyImageProcessor::generate(
3838
);
3939
```
4040

41-
!!! note
41+
???+ note
4242

4343
- The `quality` argument determines the compression level of the resulting image with 0 being the lowest level of
4444
compression and 100 being the highest. Higher compression means smaller files, but might visually degrade the image

docs/logging-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ $bunnyHttpClient->request(
5454
);
5555
```
5656

57-
!!! note
57+
??? note
5858

5959
- The key `status` consists of comma separated status codes.
6060

61-
!!! warning
61+
??? warning
6262

6363
- Sending the `date` key with an incorrect format (should be `m-d-y`) results in `403` status code.
6464

docs/shield-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ $bunnyHttpClient->request(
9191
);
9292
```
9393

94-
!!! note
94+
??? note
9595

9696
- The key `shieldZoneId` is not needed or required when creating a shield zone.
9797

@@ -362,7 +362,7 @@ $bunnyHttpClient->request(
362362
);
363363
```
364364

365-
!!! warning
365+
??? warning
366366

367367
- If this endpoint is requested for a shield zone on a free tier, it returns a `202` status code with the error message: `We do not support Custom WAF Rule creation on our Free Tier of Bunny Shield, please upgrade to Advanced.`
368368

docs/stream-api.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $bunnyHttpClient->request(
3838
);
3939
```
4040

41-
!!! note
41+
??? note
4242

4343
- If the query parameter `includeThumbnails` is set to `true`, the response item(s) will include a non-empty array key `previewImageUrls` containing the URLs for the corresponding image thumbnails.
4444

@@ -84,7 +84,7 @@ $bunnyHttpClient->request(
8484
);
8585
```
8686

87-
!!! note
87+
??? note
8888

8989
- If the query parameter `includeThumbnails` is set to `true`, the response item(s) will include a non-empty array key `previewImageUrls` containing the URLs for the corresponding image thumbnails.
9090

@@ -187,7 +187,7 @@ $bunnyHttpClient->request(
187187
);
188188
```
189189

190-
!!! note
190+
??? note
191191

192192
- The `title` does not need to match the video filename and/or extension you're intending to upload.
193193
- A `collectionId` is not required.
@@ -236,7 +236,7 @@ $bunnyHttpClient->request(
236236
);
237237
```
238238

239-
!!! warning
239+
??? warning
240240

241241
- This endpoint currently returns a `500` status code with the following response:
242242
```
@@ -313,15 +313,15 @@ $bunnyHttpClient->request(
313313
);
314314
```
315315

316-
!!! note
316+
??? note
317317

318318
- The argument `outputCodecId` has the following possible values:
319319
- `0` = x264
320320
- `1` = vp9 (premium)
321321
- `2` = hevc (premium)
322322
- `3` = av1 (premium)
323323

324-
!!! warning
324+
??? warning
325325

326326
This endpoint will return a `400` status code if premium encoding is not enabled (even if the `outputCodecId` value `0` is given).
327327

@@ -339,7 +339,7 @@ $bunnyHttpClient->request(
339339
);
340340
```
341341

342-
!!! note
342+
??? note
343343

344344
- This method allows repackaging of videos for libraries that have [Enterprise DRM](https://docs.bunny.net/docs/stream-drm#mediacage-enterprise-drm) enabled.
345345

@@ -397,7 +397,7 @@ $bunnyHttpClient->request(
397397
);
398398
```
399399

400-
!!! note
400+
??? note
401401

402402
- The `thumbnailTime` denotes the video time in milliseconds to extract the main video thumbnail.
403403

@@ -418,7 +418,7 @@ $bunnyHttpClient->request(
418418
);
419419
```
420420

421-
!!! note
421+
??? note
422422

423423
- The `sourceLanguage` / `srclang` should be an [**ISO 639-1** / **ISO 639-3** language abbreviation](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
424424
- The `captionsFile` requires the file contents to be sent as a base64 encoded string.
@@ -435,16 +435,16 @@ $bunnyHttpClient->request(
435435
);
436436
```
437437

438-
!!! note
438+
??? note
439439

440440
- The `sourceLanguage` should be an [**ISO 639-1** / **ISO 639-3** language abbreviation](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
441441

442-
!!! warning
442+
??? warning
443443

444444
- If a caption was created with a specific ISO standard for the `sourceLanguage`, then you have to delete it with the same standard. Example: a caption created with `sourceLanguage` **ISO 639-1** can only be deleted by sending a request with `sourceLanguage` **ISO 639-1**.
445445
- This endpoint will always return a `200` status code, even if the subtitle with specificied `sourceLanguage` does not exist.
446446

447-
!!! tip
447+
??? tip
448448

449449
- If you (regularly) update captions make sure to purge the captions directory associated with the video. If it's not purged you might notice
450450
outdated subtitles displayed on the video. You can get the URL for the captions directory by using the [Get Video Play Data](#get-video-play-data) endpoint.
@@ -473,7 +473,7 @@ $bunnyHttpClient->request(
473473
);
474474
```
475475

476-
!!! note
476+
??? note
477477

478478
- The `targetLanguages` / `sourceLanguage` require a [two-letter (set 1) language abbreviation](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) for transcribing the video.
479479
- Once a video has transcribed you need to set `force` to `true` in order to force a new transcription to be added.
@@ -490,7 +490,7 @@ $bunnyHttpClient->request(
490490
);
491491
```
492492

493-
!!! warning
493+
??? warning
494494

495495
- This endpoint returns a `500` status code if the video has not been fully processed yet.
496496

@@ -512,15 +512,15 @@ $bunnyHttpClient->request(
512512
);
513513
```
514514

515-
!!! note
515+
??? note
516516

517517
- The key `resolutionsToDelete` consists of comma separated resolutions.
518518

519-
!!! tip
519+
??? tip
520520

521521
Use the [Video Resolutions Info](#video-resolutions-info) endpoint to retrieve the resolutions for the video.
522522

523-
!!! warning
523+
??? warning
524524

525525
This endpoint will return a `400` status code if all available resolutions for the video are passed to `resolutionsToDelete`, as there must be at least one resolution available after cleanup.
526526

@@ -540,7 +540,7 @@ $bunnyHttpClient->request(
540540
);
541541
```
542542

543-
!!! note
543+
??? note
544544

545545
- The `url` is a required query parameter.
546546

docs/token-authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ $bunnyTokenAuthentication->sign(
9393
);
9494
```
9595

96-
!!! note
96+
???+ note
9797

9898
- The argument `expirationTime` denotes the time in seconds the resource is available after signing.
9999
- The argument `speedLimit` denotes the download speed limit (in kB/s) for the resource.
@@ -109,7 +109,7 @@ $bunnyTokenAuthentication->sign(
109109
the DNS from that country and in turn, we start returning `127.0.0.1` queries towards the hostnames in use instead
110110
of the standard CDN routing. The traffic essentially doesn't even touch our servers in such a case."*
111111

112-
!!! warning
112+
???+ warning
113113

114114
- The example using `speedLimit` for token authentication is currently not working as expected, as it returns a `403` status
115115
code. A support ticket has been created at bunny.net regarding this issue.

docs/validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ $bunnyHttpClient = new BunnyHttpClient(
8282
$response = $bunnyHttpClient->request($payload);
8383
```
8484

85-
!!! question
85+
???+ question
8686
While the `BunnyValidator` can be useful for development and testing purposes as it will prematurely validate the payload request data before sending the actual API request, the API itself will also validate the submitted request data.

generator/Enum/EndpointEdgeCases.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
use ToshY\BunnyNet\Model\Api\Base\User\GetDpaDetails;
4545
use ToshY\BunnyNet\Model\Api\Base\User\GetDpaDetailsHtml;
4646
use ToshY\BunnyNet\Model\Api\Base\User\GetHomeFeed;
47+
use ToshY\BunnyNet\Model\Api\Base\User\GetMarketingDetails;
4748
use ToshY\BunnyNet\Model\Api\Base\User\GetUserDetails;
4849
use ToshY\BunnyNet\Model\Api\Base\User\GetWhatsNewItems;
4950
use ToshY\BunnyNet\Model\Api\Base\User\ListCloseAccountReasons;
@@ -180,6 +181,9 @@ final class EndpointEdgeCases
180181
'/user/dpa/pdfhtml' => [
181182
'get' => GetDpaDetailsHtml::class,
182183
],
184+
'/user/mkd' => [
185+
'get' => GetMarketingDetails::class,
186+
],
183187
'/user/setNotificationsOpened' => [
184188
'post' => SetNotificationsOpened::class,
185189
],
@@ -253,6 +257,7 @@ final class EndpointEdgeCases
253257
VerifyTwoFactorAuthenticationCode::class => ModelValidationStrategy::STRICT_BODY,
254258
GetGitHubIntegration::class => ModelValidationStrategy::NONE,
255259
GlobalSearch::class => ModelValidationStrategy::STRICT_QUERY,
260+
GetMarketingDetails::class => ModelValidationStrategy::NONE,
256261
];
257262

258263
public const EDGE_STORAGE_VALIDATION_REPLACEMENTS = [

0 commit comments

Comments
 (0)