diff --git a/src/Sonarr.Api.V5/openapi.json b/src/Sonarr.Api.V5/openapi.json index 9e26eb9c9..aabfd1aef 100644 --- a/src/Sonarr.Api.V5/openapi.json +++ b/src/Sonarr.Api.V5/openapi.json @@ -209,6 +209,375 @@ } } }, + "/api/v5/queue/{id}": { + "delete": { + "tags": [ + "Queue" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "removeFromClient", + "in": "query", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "blocklist", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "skipRedownload", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "changeCategory", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v5/queue/bulk": { + "delete": { + "tags": [ + "Queue" + ], + "parameters": [ + { + "name": "removeFromClient", + "in": "query", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "blocklist", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "skipRedownload", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "changeCategory", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueBulkResource" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/QueueBulkResource" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/QueueBulkResource" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v5/queue": { + "get": { + "tags": [ + "Queue" + ], + "parameters": [ + { + "name": "page", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 10 + } + }, + { + "name": "sortKey", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "sortDirection", + "in": "query", + "schema": { + "$ref": "#/components/schemas/SortDirection" + } + }, + { + "name": "includeUnknownSeriesItems", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeSeries", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeEpisodes", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "seriesIds", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "protocol", + "in": "query", + "schema": { + "$ref": "#/components/schemas/DownloadProtocol" + } + }, + { + "name": "languages", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "quality", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "status", + "in": "query", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueStatus" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueResourcePagingResource" + } + } + } + } + } + } + }, + "/api/v5/queue/grab/{id}": { + "post": { + "tags": [ + "QueueAction" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v5/queue/grab/bulk": { + "post": { + "tags": [ + "QueueAction" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueBulkResource" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v5/queue/details": { + "get": { + "tags": [ + "QueueDetails" + ], + "parameters": [ + { + "name": "seriesId", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "episodeIds", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "includeSeries", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeEpisodes", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueResource" + } + } + } + } + } + } + } + }, + "/api/v5/queue/status": { + "get": { + "tags": [ + "QueueStatus" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueStatusResource" + } + } + } + } + } + } + }, "/api/v5/series": { "get": { "tags": [ @@ -711,6 +1080,365 @@ }, "additionalProperties": false }, + "CustomFormatResource": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string", + "nullable": true + }, + "includeCustomFormatWhenRenaming": { + "type": "boolean", + "nullable": true + }, + "specifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomFormatSpecificationSchema" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "CustomFormatSpecificationSchema": { + "required": [ + "fields", + "implementation", + "implementationName", + "infoLink", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string", + "nullable": true + }, + "implementation": { + "type": "string", + "nullable": true + }, + "implementationName": { + "type": "string", + "nullable": true + }, + "infoLink": { + "type": "string", + "nullable": true + }, + "negate": { + "type": "boolean" + }, + "required": { + "type": "boolean" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + }, + "nullable": true + }, + "presets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomFormatSpecificationSchema" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "DownloadProtocol": { + "enum": [ + "unknown", + "usenet", + "torrent" + ], + "type": "string" + }, + "EpisodeFileResource": { + "required": [ + "customFormats", + "languages", + "quality" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "seriesId": { + "type": "integer", + "format": "int32" + }, + "seasonNumber": { + "type": "integer", + "format": "int32" + }, + "relativePath": { + "type": "string", + "nullable": true + }, + "path": { + "type": "string", + "nullable": true + }, + "size": { + "type": "integer", + "format": "int64" + }, + "dateAdded": { + "type": "string", + "format": "date-time" + }, + "sceneName": { + "type": "string", + "nullable": true + }, + "releaseGroup": { + "type": "string", + "nullable": true + }, + "languages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Language" + }, + "nullable": true + }, + "quality": { + "$ref": "#/components/schemas/QualityModel" + }, + "customFormats": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomFormatResource" + }, + "nullable": true + }, + "customFormatScore": { + "type": "integer", + "format": "int32" + }, + "indexerFlags": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "releaseType": { + "$ref": "#/components/schemas/ReleaseType" + }, + "mediaInfo": { + "$ref": "#/components/schemas/MediaInfoResource" + }, + "qualityCutoffNotMet": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "EpisodeResource": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "seriesId": { + "type": "integer", + "format": "int32" + }, + "tvdbId": { + "type": "integer", + "format": "int32" + }, + "episodeFileId": { + "type": "integer", + "format": "int32" + }, + "seasonNumber": { + "type": "integer", + "format": "int32" + }, + "episodeNumber": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "string", + "nullable": true + }, + "airDate": { + "type": "string", + "nullable": true + }, + "airDateUtc": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "lastSearchTime": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "runtime": { + "type": "integer", + "format": "int32" + }, + "finaleType": { + "type": "string", + "nullable": true + }, + "overview": { + "type": "string", + "nullable": true + }, + "episodeFile": { + "$ref": "#/components/schemas/EpisodeFileResource" + }, + "hasFile": { + "type": "boolean" + }, + "monitored": { + "type": "boolean" + }, + "absoluteEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "sceneAbsoluteEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "sceneEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "sceneSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "unverifiedSceneNumbering": { + "type": "boolean" + }, + "endTime": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "grabDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "series": { + "$ref": "#/components/schemas/SeriesResource" + }, + "images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaCover" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Field": { + "type": "object", + "properties": { + "order": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string", + "nullable": true + }, + "label": { + "type": "string", + "nullable": true + }, + "unit": { + "type": "string", + "nullable": true + }, + "helpText": { + "type": "string", + "nullable": true + }, + "helpTextWarning": { + "type": "string", + "nullable": true + }, + "helpLink": { + "type": "string", + "nullable": true + }, + "value": { + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "advanced": { + "type": "boolean" + }, + "selectOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SelectOption" + }, + "nullable": true + }, + "selectOptionsProviderAction": { + "type": "string", + "nullable": true + }, + "section": { + "type": "string", + "nullable": true + }, + "hidden": { + "type": "string", + "nullable": true + }, + "privacy": { + "$ref": "#/components/schemas/PrivacyLevel" + }, + "placeholder": { + "type": "string", + "nullable": true + }, + "isFloat": { + "type": "boolean" + } + }, + "additionalProperties": false + }, "Language": { "type": "object", "properties": { @@ -825,6 +1553,76 @@ ], "type": "string" }, + "MediaInfoResource": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "audioBitrate": { + "type": "integer", + "format": "int64" + }, + "audioChannels": { + "type": "number", + "format": "double" + }, + "audioCodec": { + "type": "string", + "nullable": true + }, + "audioLanguages": { + "type": "string", + "nullable": true + }, + "audioStreamCount": { + "type": "integer", + "format": "int32" + }, + "videoBitDepth": { + "type": "integer", + "format": "int32" + }, + "videoBitrate": { + "type": "integer", + "format": "int64" + }, + "videoCodec": { + "type": "string", + "nullable": true + }, + "videoFps": { + "type": "number", + "format": "double" + }, + "videoDynamicRange": { + "type": "string", + "nullable": true + }, + "videoDynamicRangeType": { + "type": "string", + "nullable": true + }, + "resolution": { + "type": "string", + "nullable": true + }, + "runTime": { + "type": "string", + "nullable": true + }, + "scanType": { + "type": "string", + "nullable": true + }, + "subtitles": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, "MonitorTypes": { "enum": [ "unknown", @@ -861,6 +1659,297 @@ }, "additionalProperties": false }, + "PrivacyLevel": { + "enum": [ + "normal", + "password", + "apiKey", + "userName" + ], + "type": "string" + }, + "Quality": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string", + "nullable": true + }, + "source": { + "$ref": "#/components/schemas/QualitySource" + }, + "resolution": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "QualityModel": { + "type": "object", + "properties": { + "quality": { + "$ref": "#/components/schemas/Quality" + }, + "revision": { + "$ref": "#/components/schemas/Revision" + } + }, + "additionalProperties": false + }, + "QualitySource": { + "enum": [ + "unknown", + "television", + "televisionRaw", + "web", + "webRip", + "dvd", + "bluray", + "blurayRaw" + ], + "type": "string" + }, + "QueueBulkResource": { + "required": [ + "ids" + ], + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueResource": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "seriesId": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "episodeIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + }, + "seasonNumbers": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + }, + "series": { + "$ref": "#/components/schemas/SeriesResource" + }, + "episodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EpisodeResource" + }, + "nullable": true + }, + "languages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Language" + }, + "nullable": true + }, + "quality": { + "$ref": "#/components/schemas/QualityModel" + }, + "customFormats": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomFormatResource" + }, + "nullable": true + }, + "customFormatScore": { + "type": "integer", + "format": "int32" + }, + "size": { + "type": "number", + "format": "double" + }, + "title": { + "type": "string", + "nullable": true + }, + "sizeLeft": { + "type": "number", + "format": "double" + }, + "timeLeft": { + "type": "string", + "format": "date-span", + "nullable": true + }, + "estimatedCompletionTime": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "added": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/QueueStatus" + }, + "trackedDownloadStatus": { + "$ref": "#/components/schemas/TrackedDownloadStatus" + }, + "trackedDownloadState": { + "$ref": "#/components/schemas/TrackedDownloadState" + }, + "statusMessages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TrackedDownloadStatusMessage" + }, + "nullable": true + }, + "errorMessage": { + "type": "string", + "nullable": true + }, + "downloadId": { + "type": "string", + "nullable": true + }, + "protocol": { + "$ref": "#/components/schemas/DownloadProtocol" + }, + "downloadClient": { + "type": "string", + "nullable": true + }, + "downloadClientHasPostImportCategory": { + "type": "boolean" + }, + "indexer": { + "type": "string", + "nullable": true + }, + "outputPath": { + "type": "string", + "nullable": true + }, + "episodesWithFilesCount": { + "type": "integer", + "format": "int32" + }, + "isFullSeason": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "QueueResourcePagingResource": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "sortKey": { + "type": "string", + "nullable": true + }, + "sortDirection": { + "$ref": "#/components/schemas/SortDirection" + }, + "totalRecords": { + "type": "integer", + "format": "int32" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueResource" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueStatus": { + "enum": [ + "unknown", + "queued", + "paused", + "downloading", + "completed", + "failed", + "warning", + "delay", + "downloadClientUnavailable", + "fallback" + ], + "type": "string" + }, + "QueueStatusResource": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "totalCount": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "unknownCount": { + "type": "integer", + "format": "int32" + }, + "errors": { + "type": "boolean" + }, + "warnings": { + "type": "boolean" + }, + "unknownErrors": { + "type": "boolean" + }, + "unknownWarnings": { + "type": "boolean" + } + }, + "additionalProperties": false + }, "Ratings": { "type": "object", "properties": { @@ -875,6 +1964,32 @@ }, "additionalProperties": false }, + "ReleaseType": { + "enum": [ + "unknown", + "singleEpisode", + "multiEpisode", + "seasonPack" + ], + "type": "string" + }, + "Revision": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int32" + }, + "real": { + "type": "integer", + "format": "int32" + }, + "isRepack": { + "type": "boolean" + } + }, + "additionalProperties": false + }, "SeasonResource": { "type": "object", "properties": { @@ -942,6 +2057,28 @@ }, "additionalProperties": false }, + "SelectOption": { + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string", + "nullable": true + }, + "order": { + "type": "integer", + "format": "int32" + }, + "hint": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, "SeriesResource": { "type": "object", "properties": { @@ -1216,6 +2353,44 @@ ], "type": "string" }, + "TrackedDownloadState": { + "enum": [ + "downloading", + "importBlocked", + "importPending", + "importing", + "imported", + "failedPending", + "failed", + "ignored" + ], + "type": "string" + }, + "TrackedDownloadStatus": { + "enum": [ + "ok", + "warning", + "error" + ], + "type": "string" + }, + "TrackedDownloadStatusMessage": { + "type": "object", + "properties": { + "title": { + "type": "string", + "nullable": true + }, + "messages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, "UpdateChanges": { "type": "object", "properties": {