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

Minor update kotlin

parent 346b6304
......@@ -30,6 +30,10 @@ All URIs are relative to *https://peertube2.cpy.re/api/v1*. Change it when insta
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AbusesApi* | [**abusesAbuseIdDelete**](docs/AbusesApi.md#abusesabuseiddelete) | **DELETE** /abuses/{abuseId} | Delete an abuse
*AbusesApi* | [**abusesAbuseIdPut**](docs/AbusesApi.md#abusesabuseidput) | **PUT** /abuses/{abuseId} | Update an abuse
*AbusesApi* | [**abusesGet**](docs/AbusesApi.md#abusesget) | **GET** /abuses | List abuses
*AbusesApi* | [**abusesPost**](docs/AbusesApi.md#abusespost) | **POST** /abuses | Report an abuse
*AccountBlocksApi* | [**blocklistAccountsAccountNameDelete**](docs/AccountBlocksApi.md#blocklistaccountsaccountnamedelete) | **DELETE** /blocklist/accounts/{accountName} | Unblock an account by its handle
*AccountBlocksApi* | [**blocklistAccountsGet**](docs/AccountBlocksApi.md#blocklistaccountsget) | **GET** /blocklist/accounts | List account blocks
*AccountBlocksApi* | [**blocklistAccountsPost**](docs/AccountBlocksApi.md#blocklistaccountspost) | **POST** /blocklist/accounts | Block an account
......@@ -103,10 +107,6 @@ Class | Method | HTTP request | Description
*VideoApi* | [**videosLicencesGet**](docs/VideoApi.md#videoslicencesget) | **GET** /videos/licences | List available video licences
*VideoApi* | [**videosPrivaciesGet**](docs/VideoApi.md#videosprivaciesget) | **GET** /videos/privacies | List available video privacies
*VideoApi* | [**videosUploadPost**](docs/VideoApi.md#videosuploadpost) | **POST** /videos/upload | Upload a video
*VideoAbusesApi* | [**videosAbuseGet**](docs/VideoAbusesApi.md#videosabuseget) | **GET** /videos/abuse | List video abuses
*VideoAbusesApi* | [**videosIdAbuseAbuseIdDelete**](docs/VideoAbusesApi.md#videosidabuseabuseiddelete) | **DELETE** /videos/{id}/abuse/{abuseId} | Delete an abuse
*VideoAbusesApi* | [**videosIdAbuseAbuseIdPut**](docs/VideoAbusesApi.md#videosidabuseabuseidput) | **PUT** /videos/{id}/abuse/{abuseId} | Update an abuse
*VideoAbusesApi* | [**videosIdAbusePost**](docs/VideoAbusesApi.md#videosidabusepost) | **POST** /videos/{id}/abuse | Report an abuse
*VideoBlocksApi* | [**videosBlacklistGet**](docs/VideoBlocksApi.md#videosblacklistget) | **GET** /videos/blacklist | List video blocks
*VideoBlocksApi* | [**videosIdBlacklistDelete**](docs/VideoBlocksApi.md#videosidblacklistdelete) | **DELETE** /videos/{id}/blacklist | Unblock a video by its id
*VideoBlocksApi* | [**videosIdBlacklistPost**](docs/VideoBlocksApi.md#videosidblacklistpost) | **POST** /videos/{id}/blacklist | Block a video
......@@ -151,12 +151,16 @@ Class | Method | HTTP request | Description
*VideosApi* | [**usersMeVideosImportsGet**](docs/VideosApi.md#usersmevideosimportsget) | **GET** /users/me/videos/imports | Get video imports of my user
*VideosApi* | [**videoPlaylistsIdVideosGet**](docs/VideosApi.md#videoplaylistsidvideosget) | **GET** /video-playlists/{id}/videos | List videos of a playlist
*VideosApi* | [**videoPlaylistsIdVideosPost**](docs/VideosApi.md#videoplaylistsidvideospost) | **POST** /video-playlists/{id}/videos | Add a video in a playlist
*VideosApi* | [**videosIdAbusePost**](docs/VideosApi.md#videosidabusepost) | **POST** /videos/{id}/abuse | Report an abuse
<a name="documentation-for-models"></a>
## Documentation for Models
- [org.peertube.client.models.AbuseStateConstant](docs/AbuseStateConstant.md)
- [org.peertube.client.models.AbuseStateSet](docs/AbuseStateSet.md)
- [org.peertube.client.models.AbusesAccount](docs/AbusesAccount.md)
- [org.peertube.client.models.AbusesComment](docs/AbusesComment.md)
- [org.peertube.client.models.AbusesVideo](docs/AbusesVideo.md)
- [org.peertube.client.models.Account](docs/Account.md)
- [org.peertube.client.models.AccountAllOf](docs/AccountAllOf.md)
- [org.peertube.client.models.AccountSummary](docs/AccountSummary.md)
......@@ -275,8 +279,6 @@ Class | Method | HTTP request | Description
- [org.peertube.client.models.UserWatchingVideo](docs/UserWatchingVideo.md)
- [org.peertube.client.models.Video](docs/Video.md)
- [org.peertube.client.models.VideoAbuse](docs/VideoAbuse.md)
- [org.peertube.client.models.VideoAbuseStateConstant](docs/VideoAbuseStateConstant.md)
- [org.peertube.client.models.VideoAbuseStateSet](docs/VideoAbuseStateSet.md)
- [org.peertube.client.models.VideoAbuseVideo](docs/VideoAbuseVideo.md)
- [org.peertube.client.models.VideoBlacklist](docs/VideoBlacklist.md)
- [org.peertube.client.models.VideoCaption](docs/VideoCaption.md)
......
# AbuseStateConstant
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | [**AbuseStateSet**](AbuseStateSet.md) | | [optional]
**label** | **kotlin.String** | | [optional]
# AbuseStateSet
## Enum
* `_1` (value: `1`)
* `_2` (value: `2`)
* `_3` (value: `3`)
# AbusesAccount
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | Account id to report | [optional]
# AbusesApi
All URIs are relative to *https://peertube2.cpy.re/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**abusesAbuseIdDelete**](AbusesApi.md#abusesAbuseIdDelete) | **DELETE** /abuses/{abuseId} | Delete an abuse
[**abusesAbuseIdPut**](AbusesApi.md#abusesAbuseIdPut) | **PUT** /abuses/{abuseId} | Update an abuse
[**abusesGet**](AbusesApi.md#abusesGet) | **GET** /abuses | List abuses
[**abusesPost**](AbusesApi.md#abusesPost) | **POST** /abuses | Report an abuse
<a name="abusesAbuseIdDelete"></a>
# **abusesAbuseIdDelete**
> abusesAbuseIdDelete(abuseId)
Delete an abuse
### Example
```kotlin
// Import classes:
//import org.peertube.client.infrastructure.*
//import org.peertube.client.models.*
val apiInstance = AbusesApi()
val abuseId : kotlin.Int = 56 // kotlin.Int | Abuse id
try {
apiInstance.abusesAbuseIdDelete(abuseId)
} catch (e: ClientException) {
println("4xx response calling AbusesApi#abusesAbuseIdDelete")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AbusesApi#abusesAbuseIdDelete")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**abuseId** | **kotlin.Int**| Abuse id |
### Return type
null (empty response body)
### Authorization
Configure OAuth2:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="abusesAbuseIdPut"></a>
# **abusesAbuseIdPut**
> abusesAbuseIdPut(abuseId, inlineObject10)
Update an abuse
### Example
```kotlin
// Import classes:
//import org.peertube.client.infrastructure.*
//import org.peertube.client.models.*
val apiInstance = AbusesApi()
val abuseId : kotlin.Int = 56 // kotlin.Int | Abuse id
val inlineObject10 : InlineObject10 = // InlineObject10 |
try {
apiInstance.abusesAbuseIdPut(abuseId, inlineObject10)
} catch (e: ClientException) {
println("4xx response calling AbusesApi#abusesAbuseIdPut")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AbusesApi#abusesAbuseIdPut")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**abuseId** | **kotlin.Int**| Abuse id |
**inlineObject10** | [**InlineObject10**](InlineObject10.md)| | [optional]
### Return type
null (empty response body)
### Authorization
Configure OAuth2:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="abusesGet"></a>
# **abusesGet**
> kotlin.Array&lt;VideoAbuse&gt; abusesGet(id, predefinedReason, search, state, searchReporter, searchReportee, searchVideo, searchVideoChannel, videoIs, filter, start, count, sort)
List abuses
### Example
```kotlin
// Import classes:
//import org.peertube.client.infrastructure.*
//import org.peertube.client.models.*
val apiInstance = AbusesApi()
val id : kotlin.Int = 56 // kotlin.Int | only list the report with this id
val predefinedReason : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | predefined reason the listed reports should contain
val search : kotlin.String = search_example // kotlin.String | plain search that will match with video titles, reporter names and more
val state : kotlin.Int = 56 // kotlin.Int | The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)
val searchReporter : kotlin.String = searchReporter_example // kotlin.String | only list reports of a specific reporter
val searchReportee : kotlin.String = searchReportee_example // kotlin.String | only list reports of a specific reportee
val searchVideo : kotlin.String = searchVideo_example // kotlin.String | only list reports of a specific video
val searchVideoChannel : kotlin.String = searchVideoChannel_example // kotlin.String | only list reports of a specific video channel
val videoIs : kotlin.String = videoIs_example // kotlin.String | only list blacklisted or deleted videos
val filter : kotlin.String = filter_example // kotlin.String | only list account, comment or video reports
val start : kotlin.Int = 56 // kotlin.Int | Offset used to paginate results
val count : kotlin.Int = 56 // kotlin.Int | Number of items to return
val sort : kotlin.String = sort_example // kotlin.String | Sort abuses by criteria
try {
val result : kotlin.Array<VideoAbuse> = apiInstance.abusesGet(id, predefinedReason, search, state, searchReporter, searchReportee, searchVideo, searchVideoChannel, videoIs, filter, start, count, sort)
println(result)
} catch (e: ClientException) {
println("4xx response calling AbusesApi#abusesGet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AbusesApi#abusesGet")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **kotlin.Int**| only list the report with this id | [optional]
**predefinedReason** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| predefined reason the listed reports should contain | [optional] [enum: violentOrAbusive, hatefulOrAbusive, spamOrMisleading, privacy, rights, serverRules, thumbnails, captions]
**search** | **kotlin.String**| plain search that will match with video titles, reporter names and more | [optional]
**state** | **kotlin.Int**| The abuse state (Pending &#x3D; &#x60;1&#x60;, Rejected &#x3D; &#x60;2&#x60;, Accepted &#x3D; &#x60;3&#x60;) | [optional] [enum: 1, 2, 3]
**searchReporter** | **kotlin.String**| only list reports of a specific reporter | [optional]
**searchReportee** | **kotlin.String**| only list reports of a specific reportee | [optional]
**searchVideo** | **kotlin.String**| only list reports of a specific video | [optional]
**searchVideoChannel** | **kotlin.String**| only list reports of a specific video channel | [optional]
**videoIs** | **kotlin.String**| only list blacklisted or deleted videos | [optional] [enum: deleted, blacklisted]
**filter** | **kotlin.String**| only list account, comment or video reports | [optional] [enum: video, comment, account]
**start** | **kotlin.Int**| Offset used to paginate results | [optional]
**count** | **kotlin.Int**| Number of items to return | [optional] [default to 15]
**sort** | **kotlin.String**| Sort abuses by criteria | [optional] [enum: -id, -createdAt, -state]
### Return type
[**kotlin.Array&lt;VideoAbuse&gt;**](VideoAbuse.md)
### Authorization
Configure OAuth2:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="abusesPost"></a>
# **abusesPost**
> abusesPost(inlineObject9)
Report an abuse
### Example
```kotlin
// Import classes:
//import org.peertube.client.infrastructure.*
//import org.peertube.client.models.*
val apiInstance = AbusesApi()
val inlineObject9 : InlineObject9 = // InlineObject9 |
try {
apiInstance.abusesPost(inlineObject9)
} catch (e: ClientException) {
println("4xx response calling AbusesApi#abusesPost")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AbusesApi#abusesPost")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**inlineObject9** | [**InlineObject9**](InlineObject9.md)| |
### Return type
null (empty response body)
### Authorization
Configure OAuth2:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
# AbusesComment
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | Comment id to report | [optional]
# AbusesVideo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | Video id to report | [optional]
**startAt** | **kotlin.Int** | Timestamp in the video that marks the beginning of the report | [optional]
**endAt** | **kotlin.Int** | Timestamp in the video that marks the ending of the report | [optional]
......@@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**state** | [**VideoAbuseStateSet**](VideoAbuseStateSet.md) | | [optional]
**state** | [**AbuseStateSet**](AbuseStateSet.md) | | [optional]
**moderationComment** | **kotlin.String** | Update the report comment visible only to the moderation team | [optional]
......
......@@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**newVideoFromSubscription** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
**newCommentOnMyVideo** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
**videoAbuseAsModerator** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
**abuseAsModerator** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
**videoAutoBlacklistAsModerator** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
**blacklistOnMyVideo** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
**myVideoPublished** | [**NotificationSettingValue**](NotificationSettingValue.md) | | [optional]
......
......@@ -6,8 +6,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**reason** | **kotlin.String** | Reason why the user reports this video |
**predefinedReasons** | [**inline**](#kotlin.Array&lt;PredefinedReasonsEnum&gt;) | Reason categories that help triage reports | [optional]
**startAt** | **kotlin.Int** | Timestamp in the video that marks the beginning of the report | [optional]
**endAt** | **kotlin.Int** | Timestamp in the video that marks the ending of the report | [optional]
**video** | [**AbusesVideo**](AbusesVideo.md) | | [optional]
**comment** | [**AbusesComment**](AbusesComment.md) | | [optional]
**account** | [**AbusesAccount**](AbusesAccount.md) | | [optional]
<a name="kotlin.Array<PredefinedReasonsEnum>"></a>
......
......@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **kotlin.Int** | | [optional]
**type** | **kotlin.Int** | Notification type, following the &#x60;UserNotificationType&#x60; enum: - &#x60;1&#x60; NEW_VIDEO_FROM_SUBSCRIPTION - &#x60;2&#x60; NEW_COMMENT_ON_MY_VIDEO - &#x60;3&#x60; NEW_VIDEO_ABUSE_FOR_MODERATORS - &#x60;4&#x60; BLACKLIST_ON_MY_VIDEO - &#x60;5&#x60; UNBLACKLIST_ON_MY_VIDEO - &#x60;6&#x60; MY_VIDEO_PUBLISHED - &#x60;7&#x60; MY_VIDEO_IMPORT_SUCCESS - &#x60;8&#x60; MY_VIDEO_IMPORT_ERROR - &#x60;9&#x60; NEW_USER_REGISTRATION - &#x60;10&#x60; NEW_FOLLOW - &#x60;11&#x60; COMMENT_MENTION - &#x60;12&#x60; VIDEO_AUTO_BLACKLIST_FOR_MODERATORS - &#x60;13&#x60; NEW_INSTANCE_FOLLOWER - &#x60;14&#x60; AUTO_INSTANCE_FOLLOWING | [optional]
**type** | **kotlin.Int** | Notification type, following the &#x60;UserNotificationType&#x60; enum: - &#x60;1&#x60; NEW_VIDEO_FROM_SUBSCRIPTION - &#x60;2&#x60; NEW_COMMENT_ON_MY_VIDEO - &#x60;3&#x60; NEW_ABUSE_FOR_MODERATORS - &#x60;4&#x60; BLACKLIST_ON_MY_VIDEO - &#x60;5&#x60; UNBLACKLIST_ON_MY_VIDEO - &#x60;6&#x60; MY_VIDEO_PUBLISHED - &#x60;7&#x60; MY_VIDEO_IMPORT_SUCCESS - &#x60;8&#x60; MY_VIDEO_IMPORT_ERROR - &#x60;9&#x60; NEW_USER_REGISTRATION - &#x60;10&#x60; NEW_FOLLOW - &#x60;11&#x60; COMMENT_MENTION - &#x60;12&#x60; VIDEO_AUTO_BLACKLIST_FOR_MODERATORS - &#x60;13&#x60; NEW_INSTANCE_FOLLOWER - &#x60;14&#x60; AUTO_INSTANCE_FOLLOWING | [optional]
**read** | **kotlin.Boolean** | | [optional]
**video** | [**VideoInfo**](VideoInfo.md) | | [optional]
**videoImport** | [**NotificationVideoImport**](NotificationVideoImport.md) | | [optional]
......
......@@ -17,9 +17,9 @@ Name | Type | Description | Notes
**videoQuota** | **kotlin.Int** | The user video quota | [optional]
**videoQuotaDaily** | **kotlin.Int** | The user daily video quota | [optional]
**videosCount** | **kotlin.Int** | | [optional]
**videoAbusesCount** | **kotlin.Int** | | [optional]
**videoAbusesAcceptedCount** | **kotlin.Int** | | [optional]
**videoAbusesCreatedCount** | **kotlin.Int** | | [optional]
**abusesCount** | **kotlin.Int** | | [optional]
**abusesAcceptedCount** | **kotlin.Int** | | [optional]
**abusesCreatedCount** | **kotlin.Int** | | [optional]
**videoCommentsCount** | **kotlin.Int** | | [optional]
**noInstanceConfigWarningModal** | **kotlin.Boolean** | | [optional]
**noWelcomeModal** | **kotlin.Boolean** | | [optional]
......
......@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**reason** | **kotlin.String** | | [optional]
**predefinedReasons** | [**inline**](#kotlin.Array&lt;PredefinedReasonsEnum&gt;) | | [optional]
**reporterAccount** | [**Account**](Account.md) | | [optional]
**state** | [**VideoAbuseStateConstant**](VideoAbuseStateConstant.md) | | [optional]
**state** | [**AbuseStateConstant**](AbuseStateConstant.md) | | [optional]
**moderationComment** | **kotlin.String** | | [optional]
**video** | [**VideoAbuseVideo**](VideoAbuseVideo.md) | | [optional]
**createdAt** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]
......
......@@ -9,7 +9,6 @@ Method | HTTP request | Description
[**usersMeVideosImportsGet**](VideosApi.md#usersMeVideosImportsGet) | **GET** /users/me/videos/imports | Get video imports of my user
[**videoPlaylistsIdVideosGet**](VideosApi.md#videoPlaylistsIdVideosGet) | **GET** /video-playlists/{id}/videos | List videos of a playlist
[**videoPlaylistsIdVideosPost**](VideosApi.md#videoPlaylistsIdVideosPost) | **POST** /video-playlists/{id}/videos | Add a video in a playlist
[**videosIdAbusePost**](VideosApi.md#videosIdAbusePost) | **POST** /videos/{id}/abuse | Report an abuse
<a name="usersMeSubscriptionsVideosGet"></a>
......@@ -275,51 +274,3 @@ Configure OAuth2:
- **Content-Type**: application/json
- **Accept**: application/json
<a name="videosIdAbusePost"></a>
# **videosIdAbusePost**
> videosIdAbusePost(id, inlineObject9)
Report an abuse
### Example
```kotlin
// Import classes:
//import org.peertube.client.infrastructure.*
//import org.peertube.client.models.*
val apiInstance = VideosApi()
val id : OneOfLessThanIntegerCommaUUIDGreaterThan = // OneOfLessThanIntegerCommaUUIDGreaterThan | The object id or uuid
val inlineObject9 : InlineObject9 = // InlineObject9 |
try {
apiInstance.videosIdAbusePost(id, inlineObject9)
} catch (e: ClientException) {
println("4xx response calling VideosApi#videosIdAbusePost")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling VideosApi#videosIdAbusePost")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**OneOfLessThanIntegerCommaUUIDGreaterThan**](.md)| The object id or uuid |
**inlineObject9** | [**InlineObject9**](InlineObject9.md)| |
### Return type
null (empty response body)
### Authorization
Configure OAuth2:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
/**
* PeerTube
* # Introduction The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) which generates a client SDK in the language of your choice - we generate some client SDKs automatically: - [Python](https://framagit.org/framasoft/peertube/clients/python) - [Go](https://framagit.org/framasoft/peertube/clients/go) - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API. # Authentication When you sign up for an account, you are given the possibility to generate sessions, and authenticate using this session token. One session token can currently be used at a time. ## Roles Accounts are given permissions based on their role. There are three roles on PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/#/admin-managing-users?id=roles) for a detail of their permissions. # Errors The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format. ``` { \"code\": \"unauthorized_request\", // example inner error code \"error\": \"Token is invalid.\" // example exposed error message } ```
*
* The version of the OpenAPI document: 2.3.0-rc.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.peertube.client.apis
import org.peertube.client.models.InlineObject10
import org.peertube.client.models.InlineObject9
import org.peertube.client.models.VideoAbuse
import org.peertube.client.infrastructure.ApiClient
import org.peertube.client.infrastructure.ClientException
import org.peertube.client.infrastructure.ClientError
import org.peertube.client.infrastructure.ServerException
import org.peertube.client.infrastructure.ServerError
import org.peertube.client.infrastructure.MultiValueMap
import org.peertube.client.infrastructure.RequestConfig
import org.peertube.client.infrastructure.RequestMethod
import org.peertube.client.infrastructure.ResponseType
import org.peertube.client.infrastructure.Success
import org.peertube.client.infrastructure.toMultiValue
class AbusesApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.peertube.client.baseUrl", "https://peertube2.cpy.re/api/v1")
}
}
/**
* Delete an abuse
*
* @param abuseId Abuse id
* @return void
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun abusesAbuseIdDelete(abuseId: kotlin.Int) : Unit {
val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
val localVariableConfig = RequestConfig(
RequestMethod.DELETE,
"/abuses/{abuseId}".replace("{"+"abuseId"+"}", "$abuseId"),
query = localVariableQuery,
headers = localVariableHeaders
)
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
/**
* Update an abuse
*
* @param abuseId Abuse id
* @param inlineObject10 (optional)
* @return void
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun abusesAbuseIdPut(abuseId: kotlin.Int, inlineObject10: InlineObject10?) : Unit {
val localVariableBody: kotlin.Any? = inlineObject10
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
val localVariableConfig = RequestConfig(
RequestMethod.PUT,
"/abuses/{abuseId}".replace("{"+"abuseId"+"}", "$abuseId"),
query = localVariableQuery,
headers = localVariableHeaders
)
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}
/**
* List abuses
*
* @param id only list the report with this id (optional)
* @param predefinedReason predefined reason the listed reports should contain (optional)
* @param search plain search that will match with video titles, reporter names and more (optional)
* @param state The abuse state (Pending &#x3D; &#x60;1&#x60;, Rejected &#x3D; &#x60;2&#x60;, Accepted &#x3D; &#x60;3&#x60;) (optional)
* @param searchReporter only list reports of a specific reporter (optional)
* @param searchReportee only list reports of a specific reportee (optional)
* @param searchVideo only list reports of a specific video (optional)
* @param searchVideoChannel only list reports of a specific video channel (optional)
* @param videoIs only list blacklisted or deleted videos (optional)
* @param filter only list account, comment or video reports (optional)
* @param start Offset used to paginate results (optional)
* @param count Number of items to return (optional, default to 15)
* @param sort Sort abuses by criteria (optional)
* @return kotlin.Array<VideoAbuse>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun abusesGet(id: kotlin.Int?, predefinedReason: kotlin.Array<kotlin.String>?, search: kotlin.String?, state: kotlin.Int?, searchReporter: kotlin.String?, searchReportee: kotlin.String?, searchVideo: kotlin.String?, searchVideoChannel: kotlin.String?, videoIs: kotlin.String?, filter: kotlin.String?, start: kotlin.Int?, count: kotlin.Int?, sort: kotlin.String?) : kotlin.Array<VideoAbuse> {
val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply {
if (id != null) {
put("id", listOf(id.toString()))
}
if (predefinedReason != null) {