forked from loafle/openapi-generator-original
Declare Kotlin API classes as open (#11129)
This commit is contained in:
parent
6f6d4f8c02
commit
acadba4bfb
@ -16,7 +16,7 @@ import kotlinx.serialization.descriptors.*
|
|||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(
|
{{#nonPublicApi}}internal {{/nonPublicApi}}open class {{classname}}(
|
||||||
baseUrl: String = ApiClient.BASE_URL,
|
baseUrl: String = ApiClient.BASE_URL,
|
||||||
httpClientEngine: HttpClientEngine? = null,
|
httpClientEngine: HttpClientEngine? = null,
|
||||||
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
||||||
@ -33,7 +33,7 @@ import kotlinx.serialization.encoding.*
|
|||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> {
|
open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}})
|
val localVariableAuthNames = listOf<String>({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}})
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
class PetApi(
|
open class PetApi(
|
||||||
baseUrl: String = ApiClient.BASE_URL,
|
baseUrl: String = ApiClient.BASE_URL,
|
||||||
httpClientEngine: HttpClientEngine? = null,
|
httpClientEngine: HttpClientEngine? = null,
|
||||||
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
||||||
@ -47,7 +47,7 @@ class PetApi(
|
|||||||
* @param body Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun addPet(body: Pet): HttpResponse<Unit> {
|
open suspend fun addPet(body: Pet): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ class PetApi(
|
|||||||
* @param apiKey (optional)
|
* @param apiKey (optional)
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse<Unit> {
|
open suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ class PetApi(
|
|||||||
* @return kotlin.collections.List<Pet>
|
* @return kotlin.collections.List<Pet>
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): HttpResponse<kotlin.collections.List<Pet>> {
|
open suspend fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): HttpResponse<kotlin.collections.List<Pet>> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ class PetApi(
|
|||||||
* @return kotlin.collections.List<Pet>
|
* @return kotlin.collections.List<Pet>
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): HttpResponse<kotlin.collections.List<Pet>> {
|
open suspend fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): HttpResponse<kotlin.collections.List<Pet>> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ class PetApi(
|
|||||||
* @return Pet
|
* @return Pet
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun getPetById(petId: kotlin.Long): HttpResponse<Pet> {
|
open suspend fun getPetById(petId: kotlin.Long): HttpResponse<Pet> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("api_key")
|
val localVariableAuthNames = listOf<String>("api_key")
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ class PetApi(
|
|||||||
* @param body Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun updatePet(body: Pet): HttpResponse<Unit> {
|
open suspend fun updatePet(body: Pet): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ class PetApi(
|
|||||||
* @param status Updated status of the pet (optional)
|
* @param status Updated status of the pet (optional)
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse<Unit> {
|
open suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ class PetApi(
|
|||||||
* @return ModelApiResponse
|
* @return ModelApiResponse
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse<ModelApiResponse> {
|
open suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse<ModelApiResponse> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("petstore_auth")
|
val localVariableAuthNames = listOf<String>("petstore_auth")
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
class StoreApi(
|
open class StoreApi(
|
||||||
baseUrl: String = ApiClient.BASE_URL,
|
baseUrl: String = ApiClient.BASE_URL,
|
||||||
httpClientEngine: HttpClientEngine? = null,
|
httpClientEngine: HttpClientEngine? = null,
|
||||||
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
||||||
@ -46,7 +46,7 @@ class StoreApi(
|
|||||||
* @param orderId ID of the order that needs to be deleted
|
* @param orderId ID of the order that needs to be deleted
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun deleteOrder(orderId: kotlin.String): HttpResponse<Unit> {
|
open suspend fun deleteOrder(orderId: kotlin.String): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class StoreApi(
|
|||||||
* @return kotlin.collections.Map<kotlin.String, kotlin.Int>
|
* @return kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun getInventory(): HttpResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>> {
|
open suspend fun getInventory(): HttpResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>("api_key")
|
val localVariableAuthNames = listOf<String>("api_key")
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ class StoreApi(
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun getOrderById(orderId: kotlin.Long): HttpResponse<Order> {
|
open suspend fun getOrderById(orderId: kotlin.Long): HttpResponse<Order> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ class StoreApi(
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun placeOrder(body: Order): HttpResponse<Order> {
|
open suspend fun placeOrder(body: Order): HttpResponse<Order> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
class UserApi(
|
open class UserApi(
|
||||||
baseUrl: String = ApiClient.BASE_URL,
|
baseUrl: String = ApiClient.BASE_URL,
|
||||||
httpClientEngine: HttpClientEngine? = null,
|
httpClientEngine: HttpClientEngine? = null,
|
||||||
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
|
||||||
@ -46,7 +46,7 @@ class UserApi(
|
|||||||
* @param body Created user object
|
* @param body Created user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun createUser(body: User): HttpResponse<Unit> {
|
open suspend fun createUser(body: User): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class UserApi(
|
|||||||
* @param body List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun createUsersWithArrayInput(body: kotlin.collections.List<User>): HttpResponse<Unit> {
|
open suspend fun createUsersWithArrayInput(body: kotlin.collections.List<User>): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ class UserApi(
|
|||||||
* @param body List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun createUsersWithListInput(body: kotlin.collections.List<User>): HttpResponse<Unit> {
|
open suspend fun createUsersWithListInput(body: kotlin.collections.List<User>): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ class UserApi(
|
|||||||
* @param username The name that needs to be deleted
|
* @param username The name that needs to be deleted
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun deleteUser(username: kotlin.String): HttpResponse<Unit> {
|
open suspend fun deleteUser(username: kotlin.String): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ class UserApi(
|
|||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun getUserByName(username: kotlin.String): HttpResponse<User> {
|
open suspend fun getUserByName(username: kotlin.String): HttpResponse<User> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ class UserApi(
|
|||||||
* @return kotlin.String
|
* @return kotlin.String
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse<kotlin.String> {
|
open suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse<kotlin.String> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ class UserApi(
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun logoutUser(): HttpResponse<Unit> {
|
open suspend fun logoutUser(): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ class UserApi(
|
|||||||
* @param body Updated user object
|
* @param body Updated user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
suspend fun updateUser(username: kotlin.String, body: User): HttpResponse<Unit> {
|
open suspend fun updateUser(username: kotlin.String, body: User): HttpResponse<Unit> {
|
||||||
|
|
||||||
val localVariableAuthNames = listOf<String>()
|
val localVariableAuthNames = listOf<String>()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user