All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.org.jellyfin.sdk.api.operations.ItemRefreshApi.kt Maven / Gradle / Ivy

There is a newer version: 1.6.3
Show newest version
// !!        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.String
import kotlin.Unit
import kotlin.collections.buildMap
import org.jellyfin.sdk.api.client.ApiClient
import org.jellyfin.sdk.api.client.Response
import org.jellyfin.sdk.api.client.extensions.post
import org.jellyfin.sdk.model.UUID
import org.jellyfin.sdk.model.api.MetadataRefreshMode
import org.jellyfin.sdk.model.api.request.RefreshItemRequest

public class ItemRefreshApi(
	private val api: ApiClient,
) : Api {
	/**
	 * Refreshes metadata for an item.
	 *
	 * @param itemId Item id.
	 * @param metadataRefreshMode (Optional) Specifies the metadata refresh mode.
	 * @param imageRefreshMode (Optional) Specifies the image refresh mode.
	 * @param replaceAllMetadata (Optional) Determines if metadata should be replaced. Only applicable
	 * if mode is FullRefresh.
	 * @param replaceAllImages (Optional) Determines if images should be replaced. Only applicable if
	 * mode is FullRefresh.
	 */
	public suspend fun refreshItem(
		itemId: UUID,
		metadataRefreshMode: MetadataRefreshMode? = MetadataRefreshMode.NONE,
		imageRefreshMode: MetadataRefreshMode? = MetadataRefreshMode.NONE,
		replaceAllMetadata: Boolean? = false,
		replaceAllImages: Boolean? = false,
	): Response {
		val pathParameters = buildMap(1) {
			put("itemId", itemId)
		}
		val queryParameters = buildMap(4) {
			put("metadataRefreshMode", metadataRefreshMode)
			put("imageRefreshMode", imageRefreshMode)
			put("replaceAllMetadata", replaceAllMetadata)
			put("replaceAllImages", replaceAllImages)
		}
		val data = null
		val response = api.post("/Items/{itemId}/Refresh", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Refreshes metadata for an item.
	 *
	 * @param request The request parameters
	 */
	public suspend fun refreshItem(request: RefreshItemRequest): Response = refreshItem(
		itemId = request.itemId,
		metadataRefreshMode = request.metadataRefreshMode,
		imageRefreshMode = request.imageRefreshMode,
		replaceAllMetadata = request.replaceAllMetadata,
		replaceAllImages = request.replaceAllImages,
	)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy