feat: adding anime theme entry video endpoints (#74)

This commit is contained in:
paranarimasu
2023-03-06 14:33:11 -06:00
committed by Maniload
parent 97013a056c
commit 2bfe359412
7 changed files with 255 additions and 0 deletions
+12
View File
@@ -99,6 +99,7 @@ export default {
{ text: 'Anime Synonym', link: '/wiki/animesynonym/' },
{ text: 'Anime Theme', link: '/wiki/animetheme/' },
{ text: 'Anime Theme Entry', link: '/wiki/animethemeentry/' },
{ text: 'Anime Theme Entry Video', link: '/wiki/animethemeentryvideo/' },
{ text: 'Artist', link: '/wiki/artist/' },
{ text: 'Artist Image', link: '/wiki/artistimage/' },
{ text: 'Artist Member', link: '/wiki/artistmember/' },
@@ -377,6 +378,17 @@ export default {
{ text: 'Update', link: '/wiki/animethemeentry/update/' }
]
},
{
text: 'Anime Theme Entry Video',
collapsible: true,
items: [
{ text: 'Resource', link: '/wiki/animethemeentryvideo/' },
{ text: 'Destroy', link: '/wiki/animethemeentryvideo/destroy/' },
{ text: 'Index', link: '/wiki/animethemeentryvideo/index/' },
{ text: 'Show', link: '/wiki/animethemeentryvideo/show/' },
{ text: 'Store', link: '/wiki/animethemeentryvideo/store/' }
]
},
{
text: 'Artist',
collapsible: true,
@@ -0,0 +1,39 @@
---
title: Anime Theme Entry Video Destroy
---
# Anime Theme Entry Video Destroy Endpoint
The anime theme entry video destroy endpoint deletes an anime theme entry video and returns the deleted anime theme entry video resource.
For example, the `/animethemeentryvideo/3814/Bakemonogatari-OP1.webm` endpoint will delete the association between the Bakemonogatari OP1 anime theme entry and the Bakemonogatari-OP1.webm video.
## URL
```sh
DELETE /animethemeentryvideo/{animethemeentry:id}/{video:slug}
```
## Authentication
**Required Permission**: delete anime theme entry, delete video
**Roles with Permission**: Wiki Editor, Admin
## Parameters
None
## Response
```json
{
message: "Video 'Bakemonogatari-OP1.webm' has been detached from Entry 'Bakemonogatari OP1'.",
}
```
## Example
```bash
curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/animethemeentryvideo/bakemonogatari/monogatari
```
+39
View File
@@ -0,0 +1,39 @@
---
title: Anime Theme Entry Video
---
# Anime Theme Entry Video
---
An anime theme entry video API resource represents the association between an anime theme entry and a video.
## Fields
| Name | Type | Nullable | Description |
| :--------: | :-----: | :------: | :------------------------------------------- |
| created_at | Date | No | The date that the resource was created |
| updated_at | Date | No | The date that the resource was last modified |
## Allowed Include Paths
* animethemeentry
* video
## Endpoints
**[Anime Theme Entry Video Destroy](/wiki/animethemeentryvideo/destroy/)**
The anime theme entry video destroy endpoint deletes an anime theme entry video and returns the deleted anime theme entry video resource.
**[Anime Theme Entry Video Index](/wiki/animethemeentryvideo/index/)**
The anime theme entry video index endpoint displays a listing of anime theme entry video resources.
**[Anime Theme Entry Video Show](/wiki/animethemeentryvideo/show/)**
The anime theme entry video show endpoint returns an anime theme entry video resource.
**[Anime Theme Entry Video Store](/wiki/animethemeentryvideo/store/)**
The anime theme entry video store endpoint creates a new anime theme entry video and returns the new anime theme entry video resource.
@@ -0,0 +1,76 @@
---
title: Anime Theme Entry Video Index
---
# Anime Theme Entry Video Index Endpoint
The anime theme entry video index endpoint returns a listing of anime theme entry video resources.
## URL
```sh
GET /animethemeentryvideo/
```
## Authentication
None
## Parameters
| Name | Required | Description |
| :----------: | :------: | :---------------------------------------------------------------------------------------------- |
| fields | No | Sparse fieldsets for resource types |
| filter | No | Filters for anime theme entry video resources & constraining the inclusion of related resources |
| include | No | Inclusion of related resources |
| page[number] | No | The page of anime theme entry video resources to display |
| page[size] | No | The number of anime theme entry video resources to display for the current page |
| sort | No | The list of fields to sort the resources |
## Allowed Sort Fields
| Name | Description |
| :--------: | :------------------------------------------------ |
| created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date |
## Filters
| Name | Description |
| :--------: | :--------------------------------------------------------- |
| created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date |
| has | Filter resources on relations within allowed include paths |
## Response
```json
{
animethemeentryvideos: [
{
created_at: "created_at",
updated_at: "updated_at"
},
...
],
links: {
first: "first",
last: "last",
prev: "prev",
next: "next"
},
meta: {
current_page: current_page,
from: from,
path: "path",
per_page: per_page,
to: to
}
}
```
## Example
```bash
curl https://api.animethemes.moe/animethemeentryvideo/
```
@@ -0,0 +1,40 @@
---
title: Anime Theme Entry Video Show
---
# Anime Theme Entry Video Show Endpoint
The anime theme entry video show endpoint returns an anime theme entry video resource.
For example, the `/animethemeentryvideo/3814/Bakemonogatari-OP1.webm` endpoint will return the anime theme entry video resource for the association between the Bakemonogatari OP1 anime theme entry and the Bakemonogatari-OP1.webm video.
## URL
```sh
GET /animethemeentryvideo/{animethemeentry:id}/{video:slug}
```
## Authentication
None
## Parameters
None
## Response
```json
{
animethemeentryvideo: {
created_at: "created_at",
updated_at: "updated_at"
}
}
```
## Example
```bash
curl https://api.animethemes.moe/animethemeentryvideo/3814/Bakemonogatari-OP1.webm
```
@@ -0,0 +1,45 @@
---
title: Anime Theme Entry Video Store
---
# Anime Theme Entry Video Store Endpoint
The anime theme entry video store endpoint creates a new anime theme entry video and returns the new anime theme entry video resource.
For example, the `/animethemeentryvideo?entry_id=3814&video_id=2712` endpoint will create a new association between the Bakemonogatari OP1 anime theme entry and the Bakemonogatari-OP1.webm video.
## URL
```sh
POST /animethemeentryvideo
```
## Authentication
**Required Permission**: create anime theme entry, create video
**Roles with Permission**: Wiki Editor, Admin
## Parameters
| Name | Required | Rules |
| :------: | :------: | :----------------------- |
| entry_id | Yes | integer, Entry ID exists |
| video_id | Yes | integer, Video ID exists |
## Response
```json
{
animethemeentryvideo: {
created_at: "created_at",
updated_at: "updated_at"
}
}
```
## Example
```bash
curl -X POST -H "Authorization: Bearer {token}" https://api.animethemes.moe/animethemeentryvideo/
```
+4
View File
@@ -42,6 +42,10 @@ An anime theme API resource represents an OP or ED sequence for an anime.
An anime theme entry API resource represents a version of an anime theme.
**[Anime Theme Entry Video](/wiki/animethemeentryvideo/)**
An anime theme entry video API resource represents the association between an anime theme entry and a video.
**[Artist](/wiki/artist/)**
An artist API resource represents a musical performer of anime sequences.