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

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

There is a newer version: 1.5.5
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.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.AuthenticateUserByName
import org.jellyfin.sdk.model.api.AuthenticationResult
import org.jellyfin.sdk.model.api.CreateUserByName
import org.jellyfin.sdk.model.api.ForgotPasswordDto
import org.jellyfin.sdk.model.api.ForgotPasswordPinDto
import org.jellyfin.sdk.model.api.ForgotPasswordResult
import org.jellyfin.sdk.model.api.PinRedeemResult
import org.jellyfin.sdk.model.api.QuickConnectDto
import org.jellyfin.sdk.model.api.UpdateUserPassword
import org.jellyfin.sdk.model.api.UserConfiguration
import org.jellyfin.sdk.model.api.UserDto
import org.jellyfin.sdk.model.api.UserPolicy

public class UserApi(
	private val api: ApiClient,
) : Api {
	/**
	 * Authenticates a user by name.
	 */
	public suspend fun authenticateUserByName(`data`: AuthenticateUserByName):
			Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val response = api.post("/Users/AuthenticateByName", pathParameters,
				queryParameters, data)
		return response
	}

	/**
	 * Authenticates a user with quick connect.
	 */
	public suspend fun authenticateWithQuickConnect(`data`: QuickConnectDto):
			Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val response = api.post("/Users/AuthenticateWithQuickConnect",
				pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Creates a user.
	 */
	public suspend fun createUserByName(`data`: CreateUserByName): Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val response = api.post("/Users/New", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Deletes a user.
	 *
	 * @param userId The user id.
	 */
	public suspend fun deleteUser(userId: UUID): Response {
		val pathParameters = buildMap(1) {
			put("userId", userId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.delete("/Users/{userId}", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Initiates the forgot password process for a local user.
	 */
	public suspend fun forgotPassword(`data`: ForgotPasswordDto): Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val response = api.post("/Users/ForgotPassword", pathParameters,
				queryParameters, data)
		return response
	}

	/**
	 * Redeems a forgot password pin.
	 */
	public suspend fun forgotPasswordPin(`data`: ForgotPasswordPinDto): Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val response = api.post("/Users/ForgotPassword/Pin", pathParameters,
				queryParameters, data)
		return response
	}

	/**
	 * Gets the user based on auth token.
	 */
	public suspend fun getCurrentUser(): Response {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`("/Users/Me", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Gets a list of publicly visible users for display on a login screen.
	 */
	public suspend fun getPublicUsers(): Response> {
		val pathParameters = emptyMap()
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`>("/Users/Public", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Gets a user by Id.
	 *
	 * @param userId The user id.
	 */
	public suspend fun getUserById(userId: UUID): Response {
		val pathParameters = buildMap(1) {
			put("userId", userId)
		}
		val queryParameters = emptyMap()
		val data = null
		val response = api.`get`("/Users/{userId}", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Gets a list of users.
	 *
	 * @param isHidden Optional filter by IsHidden=true or false.
	 * @param isDisabled Optional filter by IsDisabled=true or false.
	 */
	public suspend fun getUsers(isHidden: Boolean? = null, isDisabled: Boolean? = null):
			Response> {
		val pathParameters = emptyMap()
		val queryParameters = buildMap(2) {
			put("isHidden", isHidden)
			put("isDisabled", isDisabled)
		}
		val data = null
		val response = api.`get`>("/Users", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Updates a user.
	 *
	 * @param userId The user id.
	 */
	public suspend fun updateUser(userId: UUID? = null, `data`: UserDto): Response {
		val pathParameters = emptyMap()
		val queryParameters = buildMap(1) {
			put("userId", userId)
		}
		val response = api.post("/Users", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Updates a user configuration.
	 *
	 * @param userId The user id.
	 */
	public suspend fun updateUserConfiguration(userId: UUID? = null, `data`: UserConfiguration):
			Response {
		val pathParameters = emptyMap()
		val queryParameters = buildMap(1) {
			put("userId", userId)
		}
		val response = api.post("/Users/Configuration", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Updates a user's password.
	 *
	 * @param userId The user id.
	 */
	public suspend fun updateUserPassword(userId: UUID? = null, `data`: UpdateUserPassword):
			Response {
		val pathParameters = emptyMap()
		val queryParameters = buildMap(1) {
			put("userId", userId)
		}
		val response = api.post("/Users/Password", pathParameters, queryParameters, data)
		return response
	}

	/**
	 * Updates a user policy.
	 *
	 * @param userId The user id.
	 */
	public suspend fun updateUserPolicy(userId: UUID, `data`: UserPolicy): Response {
		val pathParameters = buildMap(1) {
			put("userId", userId)
		}
		val queryParameters = emptyMap()
		val response = api.post("/Users/{userId}/Policy", pathParameters, queryParameters, data)
		return response
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy