commonMain.org.jellyfin.sdk.api.operations.UserLibraryApi.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 kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
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.BaseItemDto
import org.jellyfin.sdk.model.api.BaseItemDtoQueryResult
import org.jellyfin.sdk.model.api.BaseItemKind
import org.jellyfin.sdk.model.api.ImageType
import org.jellyfin.sdk.model.api.ItemFields
import org.jellyfin.sdk.model.api.UserItemDataDto
import org.jellyfin.sdk.model.api.request.GetLatestMediaRequest
public class UserLibraryApi(
private val api: ApiClient,
) : Api {
/**
* Deletes a user's saved personal rating for an item.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun deleteUserItemRating(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.delete("/UserItems/{itemId}/Rating", pathParameters,
queryParameters, data)
return response
}
/**
* Gets intros to play before the main media item plays.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun getIntros(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}/Intros", pathParameters,
queryParameters, data)
return response
}
/**
* Gets an item from a user's library.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun getItem(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}", pathParameters, queryParameters, data)
return response
}
/**
* Gets latest media.
*
* @param userId User id.
* @param parentId Specify this to localize the search to a specific item or folder. Omit to use
* the root.
* @param fields Optional. Specify additional fields of information to return in the output.
* @param includeItemTypes Optional. If specified, results will be filtered based on item type.
* This allows multiple, comma delimited.
* @param isPlayed Filter by items that are played, or not.
* @param enableImages Optional. include image information in output.
* @param imageTypeLimit Optional. the max number of images to return, per image type.
* @param enableImageTypes Optional. The image types to include in the output.
* @param enableUserData Optional. include user data.
* @param limit Return item limit.
* @param groupItems Whether or not to group items into a parent container.
*/
public suspend fun getLatestMedia(
userId: UUID? = null,
parentId: UUID? = null,
fields: Collection? = emptyList(),
includeItemTypes: Collection? = emptyList(),
isPlayed: Boolean? = null,
enableImages: Boolean? = null,
imageTypeLimit: Int? = null,
enableImageTypes: Collection? = emptyList(),
enableUserData: Boolean? = null,
limit: Int? = 20,
groupItems: Boolean? = true,
): Response> {
val pathParameters = emptyMap()
val queryParameters = buildMap(11) {
put("userId", userId)
put("parentId", parentId)
put("fields", fields)
put("includeItemTypes", includeItemTypes)
put("isPlayed", isPlayed)
put("enableImages", enableImages)
put("imageTypeLimit", imageTypeLimit)
put("enableImageTypes", enableImageTypes)
put("enableUserData", enableUserData)
put("limit", limit)
put("groupItems", groupItems)
}
val data = null
val response = api.`get`>("/Items/Latest", pathParameters, queryParameters,
data)
return response
}
/**
* Gets latest media.
*
* @param request The request parameters
*/
public suspend fun getLatestMedia(request: GetLatestMediaRequest = GetLatestMediaRequest()):
Response> = getLatestMedia(
userId = request.userId,
parentId = request.parentId,
fields = request.fields,
includeItemTypes = request.includeItemTypes,
isPlayed = request.isPlayed,
enableImages = request.enableImages,
imageTypeLimit = request.imageTypeLimit,
enableImageTypes = request.enableImageTypes,
enableUserData = request.enableUserData,
limit = request.limit,
groupItems = request.groupItems,
)
/**
* Gets local trailers for an item.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun getLocalTrailers(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}/LocalTrailers", pathParameters,
queryParameters, data)
return response
}
/**
* Gets the root folder from a user's library.
*
* @param userId User id.
*/
public suspend fun getRootFolder(userId: UUID? = null): Response {
val pathParameters = emptyMap()
val queryParameters = buildMap(1) {
put("userId", userId)
}
val data = null
val response = api.`get`("/Items/Root", pathParameters, queryParameters, data)
return response
}
/**
* Gets special features for an item.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun getSpecialFeatures(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}/SpecialFeatures", pathParameters,
queryParameters, data)
return response
}
/**
* Marks an item as a favorite.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun markFavoriteItem(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.post("/UserFavoriteItems/{itemId}", pathParameters,
queryParameters, data)
return response
}
/**
* Unmarks item as a favorite.
*
* @param itemId Item id.
* @param userId User id.
*/
public suspend fun unmarkFavoriteItem(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.delete("/UserFavoriteItems/{itemId}", pathParameters,
queryParameters, data)
return response
}
/**
* Updates a user's rating for an item.
*
* @param itemId Item id.
* @param userId User id.
* @param likes Whether this
* M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean})
* is likes.
*/
public suspend fun updateUserItemRating(
itemId: UUID,
userId: UUID? = null,
likes: Boolean? = null,
): Response {
val pathParameters = buildMap(1) {
put("itemId", itemId)
}
val queryParameters = buildMap(2) {
put("userId", userId)
put("likes", likes)
}
val data = null
val response = api.post("/UserItems/{itemId}/Rating", pathParameters,
queryParameters, data)
return response
}
}