commonMain.org.jellyfin.sdk.api.operations.LibraryApi.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jellyfin-api-jvm Show documentation
Show all versions of jellyfin-api-jvm Show documentation
Official Kotlin/Java SDK for Jellyfin. org.jellyfin.sdk:jellyfin-api-jvm
// !! WARNING
// !! DO NOT EDIT THIS FILE
//
// This file is generated by the openapi-generator module and is not meant for manual changes.
// Please read the README.md file in the openapi-generator module for additional information.
package org.jellyfin.sdk.api.operations
import io.ktor.utils.io.ByteReadChannel
import kotlin.Any
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Unit
import kotlin.collections.Collection
import kotlin.collections.List
import kotlin.collections.buildMap
import kotlin.collections.emptyList
import kotlin.collections.emptyMap
import org.jellyfin.sdk.api.client.ApiClient
import org.jellyfin.sdk.api.client.Response
import org.jellyfin.sdk.api.client.extensions.`get`
import org.jellyfin.sdk.api.client.extensions.delete
import org.jellyfin.sdk.api.client.extensions.post
import org.jellyfin.sdk.model.UUID
import org.jellyfin.sdk.model.api.AllThemeMediaResult
import org.jellyfin.sdk.model.api.BaseItemDto
import org.jellyfin.sdk.model.api.BaseItemDtoQueryResult
import org.jellyfin.sdk.model.api.CollectionType
import org.jellyfin.sdk.model.api.ItemCounts
import org.jellyfin.sdk.model.api.ItemFields
import org.jellyfin.sdk.model.api.ItemSortBy
import org.jellyfin.sdk.model.api.LibraryOptionsResultDto
import org.jellyfin.sdk.model.api.MediaUpdateInfoDto
import org.jellyfin.sdk.model.api.SortOrder
import org.jellyfin.sdk.model.api.ThemeMediaResult
import org.jellyfin.sdk.model.api.request.GetSimilarAlbumsRequest
import org.jellyfin.sdk.model.api.request.GetSimilarArtistsRequest
import org.jellyfin.sdk.model.api.request.GetSimilarItemsRequest
import org.jellyfin.sdk.model.api.request.GetSimilarMoviesRequest
import org.jellyfin.sdk.model.api.request.GetSimilarShowsRequest
import org.jellyfin.sdk.model.api.request.GetSimilarTrailersRequest
import org.jellyfin.sdk.model.api.request.GetThemeMediaRequest
import org.jellyfin.sdk.model.api.request.GetThemeSongsRequest
import org.jellyfin.sdk.model.api.request.GetThemeVideosRequest
public class LibraryApi(
private val api: ApiClient,
) : Api {
/**
* Deletes an item from the library and filesystem.
*
* @param itemId The item id.
*/
public suspend fun deleteItem(itemId: UUID): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = emptyMap()
val data = null
val response = api.delete("/Items/{itemId}", pathParameters, queryParameters, data)
return response
}
/**
* Deletes items from the library and filesystem.
*
* @param ids The item ids.
*/
public suspend fun deleteItems(ids: Collection? = emptyList()): Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(1) {
put("ids", ids)
}
val data = null
val response = api.delete("/Items", pathParameters, queryParameters, data)
return response
}
/**
* Gets all parents of an item.
*
* @param itemId The item id.
* @param userId Optional. Filter by user id, and attach user data.
*/
public suspend fun getAncestors(itemId: UUID, userId: UUID? = null): Response> {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(1) {
put("userId", userId)
}
val data = null
val response = api.`get`>("/Items/{itemId}/Ancestors", pathParameters,
queryParameters, data)
return response
}
/**
* Gets critic review for an item.
*/
@Deprecated("This member is deprecated and may be removed in the future")
public suspend fun getCriticReviews(itemId: String): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = emptyMap()
val data = null
val response = api.`get`("/Items/{itemId}/CriticReviews", pathParameters,
queryParameters, data)
return response
}
/**
* Downloads item media.
*
* @param itemId The item id.
*/
public suspend fun getDownload(itemId: UUID): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = emptyMap()
val data = null
val response = api.`get`("/Items/{itemId}/Download", pathParameters,
queryParameters, data)
return response
}
/**
* Downloads item media.
*
* @param itemId The item id.
*/
public fun getDownloadUrl(itemId: UUID): String {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = emptyMap()
return api.createUrl("/Items/{itemId}/Download", pathParameters, queryParameters)
}
/**
* Get the original file of an item.
*
* @param itemId The item id.
*/
public suspend fun getFile(itemId: UUID): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = emptyMap()
val data = null
val response = api.`get`("/Items/{itemId}/File", pathParameters, queryParameters,
data)
return response
}
/**
* Get the original file of an item.
*
* @param itemId The item id.
*/
public fun getFileUrl(itemId: UUID): String {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = emptyMap()
return api.createUrl("/Items/{itemId}/File", pathParameters, queryParameters)
}
/**
* Get item counts.
*
* @param userId Optional. Get counts from a specific user's library.
* @param isFavorite Optional. Get counts of favorite items.
*/
public suspend fun getItemCounts(userId: UUID? = null, isFavorite: Boolean? = null):
Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(2) {
put("userId", userId)
put("isFavorite", isFavorite)
}
val data = null
val response = api.`get`("/Items/Counts", pathParameters, queryParameters, data)
return response
}
/**
* Gets the library options info.
*
* @param libraryContentType Library content type.
* @param isNewLibrary Whether this is a new library.
*/
public suspend fun getLibraryOptionsInfo(libraryContentType: CollectionType? = null,
isNewLibrary: Boolean? = false): Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(2) {
put("libraryContentType", libraryContentType)
put("isNewLibrary", isNewLibrary)
}
val data = null
val response = api.`get`("/Libraries/AvailableOptions", pathParameters,
queryParameters, data)
return response
}
/**
* Gets all user media folders.
*
* @param isHidden Optional. Filter by folders that are marked hidden, or not.
*/
public suspend fun getMediaFolders(isHidden: Boolean? = null): Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(1) {
put("isHidden", isHidden)
}
val data = null
val response = api.`get`("/Library/MediaFolders", pathParameters,
queryParameters, data)
return response
}
/**
* Gets a list of physical paths from virtual folders.
*/
public suspend fun getPhysicalPaths(): Response> {
val pathParameters = emptyMap()
val queryParameters = emptyMap()
val data = null
val response = api.`get`>("/Library/PhysicalPaths", pathParameters, queryParameters,
data)
return response
}
/**
* Gets similar items.
*
* @param itemId The item id.
* @param excludeArtistIds Exclude artist ids.
* @param userId Optional. Filter by user id, and attach user data.
* @param limit Optional. The maximum number of records to return.
* @param fields Optional. Specify additional fields of information to return in the output. This
* allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl,
* IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio,
* Revenue, SortName, Studios, Taglines, TrailerUrls.
*/
public suspend fun getSimilarAlbums(
itemId: UUID,
excludeArtistIds: Collection? = emptyList(),
userId: UUID? = null,
limit: Int? = null,
fields: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("excludeArtistIds", excludeArtistIds)
put("userId", userId)
put("limit", limit)
put("fields", fields)
}
val data = null
val response = api.`get`("/Albums/{itemId}/Similar", pathParameters,
queryParameters, data)
return response
}
/**
* Gets similar items.
*
* @param request The request parameters
*/
public suspend fun getSimilarAlbums(request: GetSimilarAlbumsRequest):
Response = getSimilarAlbums(
itemId = request.itemId,
excludeArtistIds = request.excludeArtistIds,
userId = request.userId,
limit = request.limit,
fields = request.fields,
)
/**
* Gets similar items.
*
* @param itemId The item id.
* @param excludeArtistIds Exclude artist ids.
* @param userId Optional. Filter by user id, and attach user data.
* @param limit Optional. The maximum number of records to return.
* @param fields Optional. Specify additional fields of information to return in the output. This
* allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl,
* IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio,
* Revenue, SortName, Studios, Taglines, TrailerUrls.
*/
public suspend fun getSimilarArtists(
itemId: UUID,
excludeArtistIds: Collection? = emptyList(),
userId: UUID? = null,
limit: Int? = null,
fields: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("excludeArtistIds", excludeArtistIds)
put("userId", userId)
put("limit", limit)
put("fields", fields)
}
val data = null
val response = api.`get`("/Artists/{itemId}/Similar", pathParameters,
queryParameters, data)
return response
}
/**
* Gets similar items.
*
* @param request The request parameters
*/
public suspend fun getSimilarArtists(request: GetSimilarArtistsRequest):
Response = getSimilarArtists(
itemId = request.itemId,
excludeArtistIds = request.excludeArtistIds,
userId = request.userId,
limit = request.limit,
fields = request.fields,
)
/**
* Gets similar items.
*
* @param itemId The item id.
* @param excludeArtistIds Exclude artist ids.
* @param userId Optional. Filter by user id, and attach user data.
* @param limit Optional. The maximum number of records to return.
* @param fields Optional. Specify additional fields of information to return in the output. This
* allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl,
* IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio,
* Revenue, SortName, Studios, Taglines, TrailerUrls.
*/
public suspend fun getSimilarItems(
itemId: UUID,
excludeArtistIds: Collection? = emptyList(),
userId: UUID? = null,
limit: Int? = null,
fields: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("excludeArtistIds", excludeArtistIds)
put("userId", userId)
put("limit", limit)
put("fields", fields)
}
val data = null
val response = api.`get`("/Items/{itemId}/Similar", pathParameters,
queryParameters, data)
return response
}
/**
* Gets similar items.
*
* @param request The request parameters
*/
public suspend fun getSimilarItems(request: GetSimilarItemsRequest):
Response = getSimilarItems(
itemId = request.itemId,
excludeArtistIds = request.excludeArtistIds,
userId = request.userId,
limit = request.limit,
fields = request.fields,
)
/**
* Gets similar items.
*
* @param itemId The item id.
* @param excludeArtistIds Exclude artist ids.
* @param userId Optional. Filter by user id, and attach user data.
* @param limit Optional. The maximum number of records to return.
* @param fields Optional. Specify additional fields of information to return in the output. This
* allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl,
* IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio,
* Revenue, SortName, Studios, Taglines, TrailerUrls.
*/
public suspend fun getSimilarMovies(
itemId: UUID,
excludeArtistIds: Collection? = emptyList(),
userId: UUID? = null,
limit: Int? = null,
fields: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("excludeArtistIds", excludeArtistIds)
put("userId", userId)
put("limit", limit)
put("fields", fields)
}
val data = null
val response = api.`get`("/Movies/{itemId}/Similar", pathParameters,
queryParameters, data)
return response
}
/**
* Gets similar items.
*
* @param request The request parameters
*/
public suspend fun getSimilarMovies(request: GetSimilarMoviesRequest):
Response = getSimilarMovies(
itemId = request.itemId,
excludeArtistIds = request.excludeArtistIds,
userId = request.userId,
limit = request.limit,
fields = request.fields,
)
/**
* Gets similar items.
*
* @param itemId The item id.
* @param excludeArtistIds Exclude artist ids.
* @param userId Optional. Filter by user id, and attach user data.
* @param limit Optional. The maximum number of records to return.
* @param fields Optional. Specify additional fields of information to return in the output. This
* allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl,
* IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio,
* Revenue, SortName, Studios, Taglines, TrailerUrls.
*/
public suspend fun getSimilarShows(
itemId: UUID,
excludeArtistIds: Collection? = emptyList(),
userId: UUID? = null,
limit: Int? = null,
fields: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("excludeArtistIds", excludeArtistIds)
put("userId", userId)
put("limit", limit)
put("fields", fields)
}
val data = null
val response = api.`get`("/Shows/{itemId}/Similar", pathParameters,
queryParameters, data)
return response
}
/**
* Gets similar items.
*
* @param request The request parameters
*/
public suspend fun getSimilarShows(request: GetSimilarShowsRequest):
Response = getSimilarShows(
itemId = request.itemId,
excludeArtistIds = request.excludeArtistIds,
userId = request.userId,
limit = request.limit,
fields = request.fields,
)
/**
* Gets similar items.
*
* @param itemId The item id.
* @param excludeArtistIds Exclude artist ids.
* @param userId Optional. Filter by user id, and attach user data.
* @param limit Optional. The maximum number of records to return.
* @param fields Optional. Specify additional fields of information to return in the output. This
* allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl,
* IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio,
* Revenue, SortName, Studios, Taglines, TrailerUrls.
*/
public suspend fun getSimilarTrailers(
itemId: UUID,
excludeArtistIds: Collection? = emptyList(),
userId: UUID? = null,
limit: Int? = null,
fields: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("excludeArtistIds", excludeArtistIds)
put("userId", userId)
put("limit", limit)
put("fields", fields)
}
val data = null
val response = api.`get`("/Trailers/{itemId}/Similar", pathParameters,
queryParameters, data)
return response
}
/**
* Gets similar items.
*
* @param request The request parameters
*/
public suspend fun getSimilarTrailers(request: GetSimilarTrailersRequest):
Response = getSimilarTrailers(
itemId = request.itemId,
excludeArtistIds = request.excludeArtistIds,
userId = request.userId,
limit = request.limit,
fields = request.fields,
)
/**
* Get theme songs and videos for an item.
*
* @param itemId The item id.
* @param userId Optional. Filter by user id, and attach user data.
* @param inheritFromParent Optional. Determines whether or not parent items should be searched for
* theme media.
* @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album,
* AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount,
* PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
* @param sortOrder Optional. Sort Order - Ascending, Descending.
*/
public suspend fun getThemeMedia(
itemId: UUID,
userId: UUID? = null,
inheritFromParent: Boolean? = false,
sortBy: Collection? = emptyList(),
sortOrder: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("userId", userId)
put("inheritFromParent", inheritFromParent)
put("sortBy", sortBy)
put("sortOrder", sortOrder)
}
val data = null
val response = api.`get`("/Items/{itemId}/ThemeMedia", pathParameters,
queryParameters, data)
return response
}
/**
* Get theme songs and videos for an item.
*
* @param request The request parameters
*/
public suspend fun getThemeMedia(request: GetThemeMediaRequest): Response =
getThemeMedia(
itemId = request.itemId,
userId = request.userId,
inheritFromParent = request.inheritFromParent,
sortBy = request.sortBy,
sortOrder = request.sortOrder,
)
/**
* Get theme songs for an item.
*
* @param itemId The item id.
* @param userId Optional. Filter by user id, and attach user data.
* @param inheritFromParent Optional. Determines whether or not parent items should be searched for
* theme media.
* @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album,
* AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount,
* PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
* @param sortOrder Optional. Sort Order - Ascending, Descending.
*/
public suspend fun getThemeSongs(
itemId: UUID,
userId: UUID? = null,
inheritFromParent: Boolean? = false,
sortBy: Collection? = emptyList(),
sortOrder: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("userId", userId)
put("inheritFromParent", inheritFromParent)
put("sortBy", sortBy)
put("sortOrder", sortOrder)
}
val data = null
val response = api.`get`("/Items/{itemId}/ThemeSongs", pathParameters,
queryParameters, data)
return response
}
/**
* Get theme songs for an item.
*
* @param request The request parameters
*/
public suspend fun getThemeSongs(request: GetThemeSongsRequest): Response =
getThemeSongs(
itemId = request.itemId,
userId = request.userId,
inheritFromParent = request.inheritFromParent,
sortBy = request.sortBy,
sortOrder = request.sortOrder,
)
/**
* Get theme videos for an item.
*
* @param itemId The item id.
* @param userId Optional. Filter by user id, and attach user data.
* @param inheritFromParent Optional. Determines whether or not parent items should be searched for
* theme media.
* @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album,
* AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount,
* PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
* @param sortOrder Optional. Sort Order - Ascending, Descending.
*/
public suspend fun getThemeVideos(
itemId: UUID,
userId: UUID? = null,
inheritFromParent: Boolean? = false,
sortBy: Collection? = emptyList(),
sortOrder: Collection? = emptyList(),
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(4) {
put("userId", userId)
put("inheritFromParent", inheritFromParent)
put("sortBy", sortBy)
put("sortOrder", sortOrder)
}
val data = null
val response = api.`get`("/Items/{itemId}/ThemeVideos", pathParameters,
queryParameters, data)
return response
}
/**
* Get theme videos for an item.
*
* @param request The request parameters
*/
public suspend fun getThemeVideos(request: GetThemeVideosRequest): Response =
getThemeVideos(
itemId = request.itemId,
userId = request.userId,
inheritFromParent = request.inheritFromParent,
sortBy = request.sortBy,
sortOrder = request.sortOrder,
)
/**
* Reports that new movies have been added by an external source.
*
* @param tmdbId The tmdbId.
* @param imdbId The imdbId.
*/
public suspend fun postAddedMovies(tmdbId: String? = null, imdbId: String? = null):
Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(2) {
put("tmdbId", tmdbId)
put("imdbId", imdbId)
}
val data = null
val response = api.post("/Library/Movies/Added", pathParameters, queryParameters, data)
return response
}
/**
* Reports that new episodes of a series have been added by an external source.
*
* @param tvdbId The tvdbId.
*/
public suspend fun postAddedSeries(tvdbId: String? = null): Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(1) {
put("tvdbId", tvdbId)
}
val data = null
val response = api.post("/Library/Series/Added", pathParameters, queryParameters, data)
return response
}
/**
* Reports that new movies have been added by an external source.
*/
public suspend fun postUpdatedMedia(`data`: MediaUpdateInfoDto): Response {
val pathParameters = emptyMap()
val queryParameters = emptyMap()
val response = api.post("/Library/Media/Updated", pathParameters, queryParameters, data)
return response
}
/**
* Reports that new movies have been added by an external source.
*
* @param tmdbId The tmdbId.
* @param imdbId The imdbId.
*/
public suspend fun postUpdatedMovies(tmdbId: String? = null, imdbId: String? = null):
Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(2) {
put("tmdbId", tmdbId)
put("imdbId", imdbId)
}
val data = null
val response = api.post("/Library/Movies/Updated", pathParameters, queryParameters, data)
return response
}
/**
* Reports that new episodes of a series have been added by an external source.
*
* @param tvdbId The tvdbId.
*/
public suspend fun postUpdatedSeries(tvdbId: String? = null): Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(1) {
put("tvdbId", tvdbId)
}
val data = null
val response = api.post("/Library/Series/Updated", pathParameters, queryParameters, data)
return response
}
/**
* Starts a library scan.
*/
public suspend fun refreshLibrary(): Response {
val pathParameters = emptyMap()
val queryParameters = emptyMap()
val data = null
val response = api.post("/Library/Refresh", pathParameters, queryParameters, data)
return response
}
}