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

commonMain.org.jellyfin.sdk.api.operations.QuickConnectApi.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.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.post
import org.jellyfin.sdk.model.UUID
import org.jellyfin.sdk.model.api.QuickConnectResult

public class QuickConnectApi(
	private val api: ApiClient,
) : Api {
	/**
	 * Authorizes a pending quick connect request.
	 *
	 * @param code Quick connect code to authorize.
	 * @param userId The user the authorize. Access to the requested user is required.
	 */
	public suspend fun authorizeQuickConnect(code: String, userId: UUID? = null): Response {
		val pathParameters = emptyMap()
		val queryParameters = buildMap(2) {
			put("code", code)
			put("userId", userId)
		}
		val data = null
		val response = api.post("/QuickConnect/Authorize", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Gets the current quick connect state.
	 */
	public suspend fun getQuickConnectEnabled(): Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`("/QuickConnect/Enabled", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Attempts to retrieve authentication information.
	 *
	 * @param secret Secret previously returned from the Initiate endpoint.
	 */
	public suspend fun getQuickConnectState(secret: String): Response {
		val pathParameters = emptyMap()
		val queryParameters = buildMap(1) {
			put("secret", secret)
		}
		val data = null
		val response = api.`get`("/QuickConnect/Connect", pathParameters,
				queryParameters, data)
		return response
	}

	/**
	 * Initiate a new quick connect request.
	 */
	public suspend fun initiateQuickConnect(): Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val data = null
		val response = api.post("/QuickConnect/Initiate", pathParameters,
				queryParameters, data)
		return response
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy