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

commonMain.org.jellyfin.sdk.api.operations.LyricsApi.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.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.buildMap
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.LyricDto
import org.jellyfin.sdk.model.api.RemoteLyricInfoDto

public class LyricsApi(
	private val api: ApiClient,
) : Api {
	/**
	 * Deletes an external lyric file.
	 *
	 * @param itemId The item id.
	 */
	public suspend fun deleteLyrics(itemId: UUID): Response {
		val pathParameters = buildMap(1) {
			put("itemId", itemId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.delete("/Audio/{itemId}/Lyrics", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Downloads a remote lyric.
	 *
	 * @param itemId The item id.
	 * @param lyricId The lyric id.
	 */
	public suspend fun downloadRemoteLyrics(itemId: UUID, lyricId: String): Response {
		val pathParameters = buildMap(2) {
			put("itemId", itemId)
			put("lyricId", lyricId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.post("/Audio/{itemId}/RemoteSearch/Lyrics/{lyricId}", pathParameters,
				queryParameters, data)
		return response
	}

	/**
	 * Gets an item's lyrics.
	 *
	 * @param itemId Item id.
	 */
	public suspend fun getLyrics(itemId: UUID): Response {
		val pathParameters = buildMap(1) {
			put("itemId", itemId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`("/Audio/{itemId}/Lyrics", pathParameters, queryParameters,
				data)
		return response
	}

	/**
	 * Gets the remote lyrics.
	 *
	 * @param lyricId The remote provider item id.
	 */
	public suspend fun getRemoteLyrics(lyricId: String): Response {
		val pathParameters = buildMap(1) {
			put("lyricId", lyricId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`("/Providers/Lyrics/{lyricId}", pathParameters, queryParameters,
				data)
		return response
	}

	/**
	 * Search remote lyrics.
	 *
	 * @param itemId The item id.
	 */
	public suspend fun searchRemoteLyrics(itemId: UUID): Response> {
		val pathParameters = buildMap(1) {
			put("itemId", itemId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`>("/Audio/{itemId}/RemoteSearch/Lyrics",
				pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Upload an external lyric file.
	 *
	 * @param itemId The item the lyric belongs to.
	 * @param fileName Name of the file being uploaded.
	 */
	public suspend fun uploadLyrics(
		itemId: UUID,
		fileName: String,
		`data`: String,
	): Response {
		val pathParameters = buildMap(1) {
			put("itemId", itemId)
		}
		val queryParameters = buildMap(1) {
			put("fileName", fileName)
		}
		val response = api.post("/Audio/{itemId}/Lyrics", pathParameters, queryParameters, data)
		return response
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy