From 2bfe3594127bbe5782878b010c2d4d2d1c99e543 Mon Sep 17 00:00:00 2001 From: paranarimasu <33796518+paranarimasu@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:33:11 -0600 Subject: [PATCH] feat: adding anime theme entry video endpoints (#74) --- docs/.vitepress/config.js | 12 +++ .../animethemeentryvideo/destroy/index.md | 39 ++++++++++ docs/wiki/animethemeentryvideo/index.md | 39 ++++++++++ docs/wiki/animethemeentryvideo/index/index.md | 76 +++++++++++++++++++ docs/wiki/animethemeentryvideo/show/index.md | 40 ++++++++++ docs/wiki/animethemeentryvideo/store/index.md | 45 +++++++++++ docs/wiki/index.md | 4 + 7 files changed, 255 insertions(+) create mode 100644 docs/wiki/animethemeentryvideo/destroy/index.md create mode 100644 docs/wiki/animethemeentryvideo/index.md create mode 100644 docs/wiki/animethemeentryvideo/index/index.md create mode 100644 docs/wiki/animethemeentryvideo/show/index.md create mode 100644 docs/wiki/animethemeentryvideo/store/index.md diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index ed97dcf..a766688 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -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, diff --git a/docs/wiki/animethemeentryvideo/destroy/index.md b/docs/wiki/animethemeentryvideo/destroy/index.md new file mode 100644 index 0000000..da77971 --- /dev/null +++ b/docs/wiki/animethemeentryvideo/destroy/index.md @@ -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 +``` diff --git a/docs/wiki/animethemeentryvideo/index.md b/docs/wiki/animethemeentryvideo/index.md new file mode 100644 index 0000000..4e0fcdf --- /dev/null +++ b/docs/wiki/animethemeentryvideo/index.md @@ -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. \ No newline at end of file diff --git a/docs/wiki/animethemeentryvideo/index/index.md b/docs/wiki/animethemeentryvideo/index/index.md new file mode 100644 index 0000000..0a15380 --- /dev/null +++ b/docs/wiki/animethemeentryvideo/index/index.md @@ -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/ +``` diff --git a/docs/wiki/animethemeentryvideo/show/index.md b/docs/wiki/animethemeentryvideo/show/index.md new file mode 100644 index 0000000..e8fa960 --- /dev/null +++ b/docs/wiki/animethemeentryvideo/show/index.md @@ -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 +``` diff --git a/docs/wiki/animethemeentryvideo/store/index.md b/docs/wiki/animethemeentryvideo/store/index.md new file mode 100644 index 0000000..7012af2 --- /dev/null +++ b/docs/wiki/animethemeentryvideo/store/index.md @@ -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/ +``` diff --git a/docs/wiki/index.md b/docs/wiki/index.md index d743ab4..b82a2a0 100644 --- a/docs/wiki/index.md +++ b/docs/wiki/index.md @@ -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.