Commit 8d16fbbe authored by Rigel Kent's avatar Rigel Kent
Browse files

Minor update kotlin

parent f3a19f3d
......@@ -58,6 +58,7 @@ Class | Method | HTTP request | Description
*MyUserApi* | [**usersMeVideosGet**](docs/MyUserApi.md#usersmevideosget) | **GET** /users/me/videos | Get videos of my user
*MyUserApi* | [**usersMeVideosImportsGet**](docs/MyUserApi.md#usersmevideosimportsget) | **GET** /users/me/videos/imports | Get video imports of my user
*MyUserApi* | [**usersMeVideosVideoIdRatingGet**](docs/MyUserApi.md#usersmevideosvideoidratingget) | **GET** /users/me/videos/{videoId}/rating | Get rate of my user for a video
*SearchApi* | [**searchVideoChannelsGet**](docs/SearchApi.md#searchvideochannelsget) | **GET** /search/video-channels | Search channels
*SearchApi* | [**searchVideosGet**](docs/SearchApi.md#searchvideosget) | **GET** /search/videos | Search videos
*UsersApi* | [**usersGet**](docs/UsersApi.md#usersget) | **GET** /users | List users
*UsersApi* | [**usersIdDelete**](docs/UsersApi.md#usersiddelete) | **DELETE** /users/{id} | Delete a user
......
......@@ -4,12 +4,66 @@ All URIs are relative to *https://peertube.cpy.re/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**searchVideoChannelsGet**](SearchApi.md#searchVideoChannelsGet) | **GET** /search/video-channels | Search channels
[**searchVideosGet**](SearchApi.md#searchVideosGet) | **GET** /search/videos | Search videos
<a name="searchVideoChannelsGet"></a>
# **searchVideoChannelsGet**
> kotlin.Array&lt;VideoChannel&gt; searchVideoChannelsGet(search, start, count, searchTarget, sort)
Search channels
### Example
```kotlin
// Import classes:
//import org.peertube.client.infrastructure.*
//import org.peertube.client.models.*
val apiInstance = SearchApi()
val search : kotlin.String = search_example // kotlin.String | String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it.
val start : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Offset
val count : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Number of items (max: 100)
val searchTarget : kotlin.String = searchTarget_example // kotlin.String | If the administrator enabled search index support, you can override the default search target. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not know the objects you fetched. If you want to load video/channel information: * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API
val sort : kotlin.String = sort_example // kotlin.String | Sort column (-createdAt for example)
try {
val result : kotlin.Array<VideoChannel> = apiInstance.searchVideoChannelsGet(search, start, count, searchTarget, sort)
println(result)
} catch (e: ClientException) {
println("4xx response calling SearchApi#searchVideoChannelsGet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling SearchApi#searchVideoChannelsGet")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**search** | **kotlin.String**| String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it. |
**start** | **java.math.BigDecimal**| Offset | [optional]
**count** | **java.math.BigDecimal**| Number of items (max: 100) | [optional]
**searchTarget** | **kotlin.String**| If the administrator enabled search index support, you can override the default search target. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not know the objects you fetched. If you want to load video/channel information: * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API | [optional] [enum: local, search-index]
**sort** | **kotlin.String**| Sort column (-createdAt for example) | [optional]
### Return type
[**kotlin.Array&lt;VideoChannel&gt;**](VideoChannel.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="searchVideosGet"></a>
# **searchVideosGet**
> VideoListResponse searchVideosGet(search, categoryOneOf, tagsOneOf, tagsAllOf, licenceOneOf, languageOneOf, nsfw, filter, skipCount, start, count, sort)
> VideoListResponse searchVideosGet(search, startDate, endDate, originallyPublishedStartDate, originallyPublishedEndDate, durationMin, durationMax, categoryOneOf, tagsOneOf, tagsAllOf, licenceOneOf, languageOneOf, nsfw, filter, skipCount, start, count, searchTarget, sort)
Search videos
......@@ -20,7 +74,13 @@ Search videos
//import org.peertube.client.models.*
val apiInstance = SearchApi()
val search : kotlin.String = search_example // kotlin.String | String to search
val search : kotlin.String = search_example // kotlin.String | String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it.
val startDate : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Get videos that are published after this date
val endDate : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Get videos that are published before this date
val originallyPublishedStartDate : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Get videos that are originally published after this date
val originallyPublishedEndDate : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | Get videos that are originally published before this date
val durationMin : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Get videos that have this minimum duration
val durationMax : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Get videos that have this maximum duration
val categoryOneOf : OneOfLessThanNumberCommaArrayGreaterThan = // OneOfLessThanNumberCommaArrayGreaterThan | category id of the video (see /videos/categories)
val tagsOneOf : OneOfLessThanStringCommaArrayGreaterThan = // OneOfLessThanStringCommaArrayGreaterThan | tag(s) of the video
val tagsAllOf : OneOfLessThanStringCommaArrayGreaterThan = // OneOfLessThanStringCommaArrayGreaterThan | tag(s) of the video, where all should be present in the video
......@@ -31,9 +91,10 @@ val filter : kotlin.String = filter_example // kotlin.String | Special filters (
val skipCount : kotlin.String = skipCount_example // kotlin.String | if you don't need the `total` in the response
val start : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Offset
val count : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Number of items (max: 100)
val searchTarget : kotlin.String = searchTarget_example // kotlin.String | If the administrator enabled search index support, you can override the default search target. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not know the objects you fetched. If you want to load video/channel information: * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API
val sort : kotlin.String = sort_example // kotlin.String | Sort videos by criteria
try {
val result : VideoListResponse = apiInstance.searchVideosGet(search, categoryOneOf, tagsOneOf, tagsAllOf, licenceOneOf, languageOneOf, nsfw, filter, skipCount, start, count, sort)
val result : VideoListResponse = apiInstance.searchVideosGet(search, startDate, endDate, originallyPublishedStartDate, originallyPublishedEndDate, durationMin, durationMax, categoryOneOf, tagsOneOf, tagsAllOf, licenceOneOf, languageOneOf, nsfw, filter, skipCount, start, count, searchTarget, sort)
println(result)
} catch (e: ClientException) {
println("4xx response calling SearchApi#searchVideosGet")
......@@ -48,7 +109,13 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**search** | **kotlin.String**| String to search |
**search** | **kotlin.String**| String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it. |
**startDate** | **java.time.OffsetDateTime**| Get videos that are published after this date |
**endDate** | **java.time.OffsetDateTime**| Get videos that are published before this date |
**originallyPublishedStartDate** | **java.time.OffsetDateTime**| Get videos that are originally published after this date |
**originallyPublishedEndDate** | **java.time.OffsetDateTime**| Get videos that are originally published before this date |
**durationMin** | **java.math.BigDecimal**| Get videos that have this minimum duration |
**durationMax** | **java.math.BigDecimal**| Get videos that have this maximum duration |
**categoryOneOf** | [**OneOfLessThanNumberCommaArrayGreaterThan**](.md)| category id of the video (see /videos/categories) | [optional]
**tagsOneOf** | [**OneOfLessThanStringCommaArrayGreaterThan**](.md)| tag(s) of the video | [optional]
**tagsAllOf** | [**OneOfLessThanStringCommaArrayGreaterThan**](.md)| tag(s) of the video, where all should be present in the video | [optional]
......@@ -59,6 +126,7 @@ Name | Type | Description | Notes
**skipCount** | **kotlin.String**| if you don&#39;t need the &#x60;total&#x60; in the response | [optional] [enum: true, false]
**start** | **java.math.BigDecimal**| Offset | [optional]
**count** | **java.math.BigDecimal**| Number of items (max: 100) | [optional]
**searchTarget** | **kotlin.String**| If the administrator enabled search index support, you can override the default search target. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not know the objects you fetched. If you want to load video/channel information: * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API | [optional] [enum: local, search-index]
**sort** | **kotlin.String**| Sort videos by criteria | [optional] [enum: -name, -duration, -createdAt, -publishedAt, -views, -likes, -match]
### Return type
......
......@@ -13,6 +13,7 @@ package org.peertube.client.apis
import org.peertube.client.models.OneOfLessThanNumberCommaArrayGreaterThan
import org.peertube.client.models.OneOfLessThanStringCommaArrayGreaterThan
import org.peertube.client.models.VideoChannel
import org.peertube.client.models.VideoListResponse
import org.peertube.client.infrastructure.ApiClient
......@@ -35,10 +36,76 @@ class SearchApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Search channels
*
* @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete channel information and interact with it.
* @param start Offset (optional)
* @param count Number of items (max: 100) (optional)
* @param searchTarget If the administrator enabled search index support, you can override the default search target. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not know the objects you fetched. If you want to load video/channel information: * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API (optional)
* @param sort Sort column (-createdAt for example) (optional)
* @return kotlin.Array<VideoChannel>
* @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 searchVideoChannelsGet(search: kotlin.String, start: java.math.BigDecimal?, count: java.math.BigDecimal?, searchTarget: kotlin.String?, sort: kotlin.String?) : kotlin.Array<VideoChannel> {
val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply {
if (start != null) {
put("start", listOf(start.toString()))
}
if (count != null) {
put("count", listOf(count.toString()))
}
if (searchTarget != null) {
put("searchTarget", listOf(searchTarget.toString()))
}
if (sort != null) {
put("sort", listOf(sort.toString()))
}
put("search", listOf(search.toString()))
}
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
val localVariableConfig = RequestConfig(
RequestMethod.GET,
"/search/video-channels",
query = localVariableQuery,
headers = localVariableHeaders
)
val localVarResponse = request<kotlin.Array<VideoChannel>>(
localVariableConfig,
localVariableBody
)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<VideoChannel>
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)
}
}
}
/**
* Search videos
*
* @param search String to search
* @param search String to search. If the user can make a remote URI search, and the string is an URI then the PeerTube instance will fetch the remote object and add it to its database. Then, you can use the REST API to fetch the complete video information and interact with it.
* @param startDate Get videos that are published after this date
* @param endDate Get videos that are published before this date
* @param originallyPublishedStartDate Get videos that are originally published after this date
* @param originallyPublishedEndDate Get videos that are originally published before this date
* @param durationMin Get videos that have this minimum duration
* @param durationMax Get videos that have this maximum duration
* @param categoryOneOf category id of the video (see /videos/categories) (optional)
* @param tagsOneOf tag(s) of the video (optional)
* @param tagsAllOf tag(s) of the video, where all should be present in the video (optional)
......@@ -49,6 +116,7 @@ class SearchApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
* @param skipCount if you don&#39;t need the &#x60;total&#x60; in the response (optional)
* @param start Offset (optional)
* @param count Number of items (max: 100) (optional)
* @param searchTarget If the administrator enabled search index support, you can override the default search target. **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. It means the instance may not know the objects you fetched. If you want to load video/channel information: * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. After that, you can use the classic REST API endpoints to fetch the complete object or interact with it * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch the data from the origin instance API (optional)
* @param sort Sort videos by criteria (optional)
* @return VideoListResponse
* @throws UnsupportedOperationException If the API returns an informational or redirection response
......@@ -57,7 +125,7 @@ class SearchApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun searchVideosGet(search: kotlin.String, categoryOneOf: OneOfLessThanNumberCommaArrayGreaterThan?, tagsOneOf: OneOfLessThanStringCommaArrayGreaterThan?, tagsAllOf: OneOfLessThanStringCommaArrayGreaterThan?, licenceOneOf: OneOfLessThanNumberCommaArrayGreaterThan?, languageOneOf: OneOfLessThanStringCommaArrayGreaterThan?, nsfw: kotlin.String?, filter: kotlin.String?, skipCount: kotlin.String?, start: java.math.BigDecimal?, count: java.math.BigDecimal?, sort: kotlin.String?) : VideoListResponse {
fun searchVideosGet(search: kotlin.String, startDate: java.time.OffsetDateTime, endDate: java.time.OffsetDateTime, originallyPublishedStartDate: java.time.OffsetDateTime, originallyPublishedEndDate: java.time.OffsetDateTime, durationMin: java.math.BigDecimal, durationMax: java.math.BigDecimal, categoryOneOf: OneOfLessThanNumberCommaArrayGreaterThan?, tagsOneOf: OneOfLessThanStringCommaArrayGreaterThan?, tagsAllOf: OneOfLessThanStringCommaArrayGreaterThan?, licenceOneOf: OneOfLessThanNumberCommaArrayGreaterThan?, languageOneOf: OneOfLessThanStringCommaArrayGreaterThan?, nsfw: kotlin.String?, filter: kotlin.String?, skipCount: kotlin.String?, start: java.math.BigDecimal?, count: java.math.BigDecimal?, searchTarget: kotlin.String?, sort: kotlin.String?) : VideoListResponse {
val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply {
......@@ -91,10 +159,19 @@ class SearchApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
if (count != null) {
put("count", listOf(count.toString()))
}
if (searchTarget != null) {
put("searchTarget", listOf(searchTarget.toString()))
}
if (sort != null) {
put("sort", listOf(sort.toString()))
}
put("search", listOf(search.toString()))
put("startDate", listOf(parseDateToQueryString(startDate)))
put("endDate", listOf(parseDateToQueryString(endDate)))
put("originallyPublishedStartDate", listOf(parseDateToQueryString(originallyPublishedStartDate)))
put("originallyPublishedEndDate", listOf(parseDateToQueryString(originallyPublishedEndDate)))
put("durationMin", listOf(durationMin.toString()))
put("durationMax", listOf(durationMax.toString()))
}
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
val localVariableConfig = RequestConfig(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment