Commit fa61f962 authored by Rigel Kent's avatar Rigel Kent
Browse files

Minor update kotlin

parent 0d890b39
4.2.3
\ No newline at end of file
4.3.0
\ No newline at end of file
......@@ -4,37 +4,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**uuid** | **kotlin.String** | | [optional]
**createdAt** | **kotlin.String** | | [optional]
**publishedAt** | **kotlin.String** | | [optional]
**updatedAt** | **kotlin.String** | | [optional]
**originallyPublishedAt** | **kotlin.String** | | [optional]
**category** | [**VideoConstantNumber**](VideoConstantNumber.md) | | [optional]
**licence** | [**VideoConstantNumber**](VideoConstantNumber.md) | | [optional]
**language** | [**VideoConstantString**](VideoConstantString.md) | | [optional]
**privacy** | [**VideoPrivacyConstant**](VideoPrivacyConstant.md) | | [optional]
**description** | **kotlin.String** | | [optional]
**duration** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**isLocal** | **kotlin.Boolean** | | [optional]
**name** | **kotlin.String** | | [optional]
**thumbnailPath** | **kotlin.String** | | [optional]
**previewPath** | **kotlin.String** | | [optional]
**embedPath** | **kotlin.String** | | [optional]
**views** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**likes** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**dislikes** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**nsfw** | **kotlin.Boolean** | | [optional]
**waitTranscoding** | **kotlin.Boolean** | | [optional]
**state** | [**VideoStateConstant**](VideoStateConstant.md) | | [optional]
**scheduledUpdate** | [**VideoScheduledUpdate**](VideoScheduledUpdate.md) | | [optional]
**blacklisted** | **kotlin.Boolean** | | [optional]
**blacklistedReason** | **kotlin.String** | | [optional]
**account** | [**Account**](Account.md) | | [optional]
**channel** | [**VideoChannel**](VideoChannel.md) | | [optional]
**userHistory** | [**VideoUserHistory**](VideoUserHistory.md) | | [optional]
**descriptionPath** | **kotlin.String** | | [optional]
**support** | **kotlin.String** | | [optional]
**channel** | [**VideoChannel**](VideoChannel.md) | | [optional]
**account** | [**Account**](Account.md) | | [optional]
**tags** | **kotlin.Array<kotlin.String>** | | [optional]
**files** | [**kotlin.Array<VideoFile>**](VideoFile.md) | | [optional]
**commentsEnabled** | **kotlin.Boolean** | | [optional]
......
......@@ -26,7 +26,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class AccountsApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class AccountsApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Get all accounts
......@@ -73,11 +79,11 @@ class AccountsApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") :
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -114,11 +120,11 @@ class AccountsApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") :
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -155,11 +161,11 @@ class AccountsApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") :
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......
......@@ -27,7 +27,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class ConfigApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class ConfigApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Get the instance about page content
......@@ -60,11 +66,11 @@ class ConfigApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -99,11 +105,11 @@ class ConfigApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -139,11 +145,11 @@ class ConfigApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -178,11 +184,11 @@ class ConfigApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -218,11 +224,11 @@ class ConfigApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......
......@@ -25,7 +25,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class JobApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class JobApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Get list of jobs
......@@ -73,11 +79,11 @@ class JobApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiCl
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......
......@@ -31,7 +31,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class MyUserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Update current user avatar
......@@ -45,9 +51,9 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun usersMeAvatarPickPost(avatarfile: java.io.File?) : Avatar {
val localVariableBody: kotlin.Any? = mapOf("avatarfile" to "$avatarfile")
val localVariableBody: kotlin.Any? = mapOf("avatarfile" to avatarfile)
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "")
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "multipart/form-data")
val localVariableConfig = RequestConfig(
RequestMethod.POST,
"/users/me/avatar/pick",
......@@ -65,11 +71,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -105,11 +111,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -145,11 +151,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -189,11 +195,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -242,11 +248,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -281,11 +287,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -321,11 +327,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -362,11 +368,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -416,11 +422,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -456,11 +462,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -510,11 +516,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -564,11 +570,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -605,11 +611,11 @@ class MyUserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......
......@@ -25,7 +25,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class SearchApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class SearchApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Get the videos corresponding to a given query
......@@ -74,11 +80,11 @@ class SearchApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : Ap
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......
......@@ -25,7 +25,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class ServerFollowingApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class ServerFollowingApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Get followers of the server
......@@ -72,11 +78,11 @@ class ServerFollowingApi(basePath: kotlin.String = "https://peertube.cpy.re/api/
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -126,11 +132,11 @@ class ServerFollowingApi(basePath: kotlin.String = "https://peertube.cpy.re/api/
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -166,11 +172,11 @@ class ServerFollowingApi(basePath: kotlin.String = "https://peertube.cpy.re/api/
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -206,11 +212,11 @@ class ServerFollowingApi(basePath: kotlin.String = "https://peertube.cpy.re/api/
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......
......@@ -30,7 +30,13 @@ import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class UserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiClient(basePath) {
class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube.cpy.re/api/v1")
}
}
/**
* Get ratings of an account by its name
......@@ -82,11 +88,11 @@ class UserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiC
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -136,11 +142,11 @@ class UserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiC
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
......@@ -176,11 +182,11 @@ class UserApi(basePath: kotlin.String = "https://peertube.cpy.re/api/v1") : ApiC