-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an API client generated by openapi-generator-cli Only changes made to this are: - Adding dependencies to our version catalog - Changing package structure to fit with the SDK paradigm This state is temporary.
- Loading branch information
Showing
140 changed files
with
9,282 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
catalog/src/androidTest/kotlin/com/tidal/catalog/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
561 changes: 561 additions & 0 deletions
561
catalog/src/main/kotlin/com/tidal/sdk/catalog/apis/AlbumJSONAPIApi.kt
Large diffs are not rendered by default.
Oops, something went wrong.
555 changes: 555 additions & 0 deletions
555
catalog/src/main/kotlin/com/tidal/sdk/catalog/apis/ArtistJSONAPIApi.kt
Large diffs are not rendered by default.
Oops, something went wrong.
210 changes: 210 additions & 0 deletions
210
catalog/src/main/kotlin/com/tidal/sdk/catalog/apis/ProviderJSONAPIApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
/** | ||
* | ||
* Please note: | ||
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* Do not edit this file manually. | ||
* | ||
*/ | ||
|
||
@file:Suppress( | ||
"ArrayInDataClass", | ||
"EnumEntryName", | ||
"RemoveRedundantQualifierName", | ||
"UnusedImport" | ||
) | ||
|
||
package com.tidal.sdk.catalog.apis | ||
|
||
import com.tidal.sdk.catalog.infrastructure.ApiClient | ||
import com.tidal.sdk.catalog.infrastructure.ApiResponse | ||
import com.tidal.sdk.catalog.infrastructure.ClientError | ||
import com.tidal.sdk.catalog.infrastructure.ClientException | ||
import com.tidal.sdk.catalog.infrastructure.MultiValueMap | ||
import com.tidal.sdk.catalog.infrastructure.RequestConfig | ||
import com.tidal.sdk.catalog.infrastructure.RequestMethod | ||
import com.tidal.sdk.catalog.infrastructure.ResponseType | ||
import com.tidal.sdk.catalog.infrastructure.ServerError | ||
import com.tidal.sdk.catalog.infrastructure.ServerException | ||
import com.tidal.sdk.catalog.infrastructure.Success | ||
import com.tidal.sdk.catalog.infrastructure.toMultiValue | ||
import com.tidal.sdk.catalog.models.ProviderDataDocument | ||
import com.tidal.sdk.catalog.models.ProvidersDataDocument | ||
import okhttp3.HttpUrl | ||
import okhttp3.OkHttpClient | ||
import java.io.IOException | ||
|
||
class ProviderJSONAPIApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) { | ||
companion object { | ||
@JvmStatic | ||
val defaultBasePath: String by lazy { | ||
System.getProperties().getProperty(ApiClient.baseUrlKey, "https://openapi.stage.tidal.com/v2") | ||
} | ||
} | ||
|
||
/** | ||
* Get single provider | ||
* Retrieve provider details by TIDAL provider id. | ||
* @param id TIDAL provider id | ||
* @param include Allows the client to customize which related resources should be returned (optional) | ||
* @return ProviderDataDocument | ||
* @throws IllegalStateException If the request is not correctly configured | ||
* @throws IOException Rethrows the OkHttp execute method exception | ||
* @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(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) | ||
fun getProvider(id: kotlin.String, include: kotlin.collections.List<kotlin.String>? = null) : ProviderDataDocument { | ||
val localVarResponse = getProviderWithHttpInfo(id = id, include = include) | ||
|
||
return when (localVarResponse.responseType) { | ||
ResponseType.Success -> (localVarResponse as Success<*>).data as ProviderDataDocument | ||
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.body}", localVarError.statusCode, localVarResponse) | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Get single provider | ||
* Retrieve provider details by TIDAL provider id. | ||
* @param id TIDAL provider id | ||
* @param include Allows the client to customize which related resources should be returned (optional) | ||
* @return ApiResponse<ProviderDataDocument?> | ||
* @throws IllegalStateException If the request is not correctly configured | ||
* @throws IOException Rethrows the OkHttp execute method exception | ||
*/ | ||
@Suppress("UNCHECKED_CAST") | ||
@Throws(IllegalStateException::class, IOException::class) | ||
fun getProviderWithHttpInfo(id: kotlin.String, include: kotlin.collections.List<kotlin.String>?) : ApiResponse<ProviderDataDocument?> { | ||
val localVariableConfig = getProviderRequestConfig(id = id, include = include) | ||
|
||
return request<Unit, ProviderDataDocument>( | ||
localVariableConfig | ||
) | ||
} | ||
|
||
/** | ||
* To obtain the request config of the operation getProvider | ||
* | ||
* @param id TIDAL provider id | ||
* @param include Allows the client to customize which related resources should be returned (optional) | ||
* @return RequestConfig | ||
*/ | ||
fun getProviderRequestConfig(id: kotlin.String, include: kotlin.collections.List<kotlin.String>?) : RequestConfig<Unit> { | ||
val localVariableBody = null | ||
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>() | ||
.apply { | ||
if (include != null) { | ||
put("include", toMultiValue(include.toList(), "multi")) | ||
} | ||
} | ||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() | ||
localVariableHeaders["Content-Type"] = "application/vnd.api+json" | ||
localVariableHeaders["Accept"] = "application/vnd.api+json" | ||
|
||
return RequestConfig( | ||
method = RequestMethod.GET, | ||
path = "/providers/{id}".replace("{"+"id"+"}", encodeURIComponent(id.toString())), | ||
query = localVariableQuery, | ||
headers = localVariableHeaders, | ||
requiresAuthentication = true, | ||
body = localVariableBody | ||
) | ||
} | ||
|
||
/** | ||
* Get multiple providers | ||
* Retrieve multiple provider details. | ||
* @param include Allows the client to customize which related resources should be returned (optional) | ||
* @param filterId Allows to filter the collection of resources based on id attribute value (optional) | ||
* @return ProvidersDataDocument | ||
* @throws IllegalStateException If the request is not correctly configured | ||
* @throws IOException Rethrows the OkHttp execute method exception | ||
* @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(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) | ||
fun getProviders(include: kotlin.collections.List<kotlin.String>? = null, filterId: kotlin.collections.List<kotlin.String>? = null) : ProvidersDataDocument { | ||
val localVarResponse = getProvidersWithHttpInfo(include = include, filterId = filterId) | ||
|
||
return when (localVarResponse.responseType) { | ||
ResponseType.Success -> (localVarResponse as Success<*>).data as ProvidersDataDocument | ||
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.body}", localVarError.statusCode, localVarResponse) | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Get multiple providers | ||
* Retrieve multiple provider details. | ||
* @param include Allows the client to customize which related resources should be returned (optional) | ||
* @param filterId Allows to filter the collection of resources based on id attribute value (optional) | ||
* @return ApiResponse<ProvidersDataDocument?> | ||
* @throws IllegalStateException If the request is not correctly configured | ||
* @throws IOException Rethrows the OkHttp execute method exception | ||
*/ | ||
@Suppress("UNCHECKED_CAST") | ||
@Throws(IllegalStateException::class, IOException::class) | ||
fun getProvidersWithHttpInfo(include: kotlin.collections.List<kotlin.String>?, filterId: kotlin.collections.List<kotlin.String>?) : ApiResponse<ProvidersDataDocument?> { | ||
val localVariableConfig = getProvidersRequestConfig(include = include, filterId = filterId) | ||
|
||
return request<Unit, ProvidersDataDocument>( | ||
localVariableConfig | ||
) | ||
} | ||
|
||
/** | ||
* To obtain the request config of the operation getProviders | ||
* | ||
* @param include Allows the client to customize which related resources should be returned (optional) | ||
* @param filterId Allows to filter the collection of resources based on id attribute value (optional) | ||
* @return RequestConfig | ||
*/ | ||
fun getProvidersRequestConfig(include: kotlin.collections.List<kotlin.String>?, filterId: kotlin.collections.List<kotlin.String>?) : RequestConfig<Unit> { | ||
val localVariableBody = null | ||
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>() | ||
.apply { | ||
if (include != null) { | ||
put("include", toMultiValue(include.toList(), "multi")) | ||
} | ||
if (filterId != null) { | ||
put("filter[id]", toMultiValue(filterId.toList(), "multi")) | ||
} | ||
} | ||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() | ||
localVariableHeaders["Content-Type"] = "application/vnd.api+json" | ||
localVariableHeaders["Accept"] = "application/vnd.api+json" | ||
|
||
return RequestConfig( | ||
method = RequestMethod.GET, | ||
path = "/providers", | ||
query = localVariableQuery, | ||
headers = localVariableHeaders, | ||
requiresAuthentication = true, | ||
body = localVariableBody | ||
) | ||
} | ||
|
||
|
||
private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String = | ||
HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0] | ||
} |
Oops, something went wrong.