diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index be87c6771fde..23c862b2f758 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -29,7 +29,6 @@ jobs: # needs Android configured #- samples/client/petstore/kotlin-json-request-string - samples/client/petstore/kotlin-jvm-okhttp4-coroutines - - samples/client/petstore/kotlin-jvm-volley - samples/client/petstore/kotlin-moshi-codegen - samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin-multiplatform-kotlinx-datetime @@ -47,10 +46,8 @@ jobs: - samples/client/petstore/kotlin-array-integer-enum - samples/client/petstore/kotlin-default-values-jvm-okhttp4 - samples/client/petstore/kotlin-default-values-jvm-retrofit2 - - samples/client/petstore/kotlin-default-values-jvm-volley - samples/client/petstore/kotlin-default-values-multiplatform - samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4 - - samples/client/petstore/kotlin-array-simple-string-jvm-volley - samples/client/petstore/kotlin-array-simple-string-multiplatform - samples/client/petstore/kotlin-bigdecimal-default-multiplatform - samples/client/petstore/kotlin-bigdecimal-default-okhttp4 diff --git a/bin/configs/kotlin-array-simple-string-jvm-volley.yaml b/bin/configs/kotlin-array-simple-string-jvm-volley.yaml deleted file mode 100644 index 88f6304907cb..000000000000 --- a/bin/configs/kotlin-array-simple-string-jvm-volley.yaml +++ /dev/null @@ -1,9 +0,0 @@ -generatorName: kotlin -outputDir: samples/client/petstore/kotlin-array-simple-string-jvm-volley -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client -additionalProperties: - artifactId: kotlin-array-simple-string-jvm-volley - library: jvm-volley - serializationLibrary: gson - generateRoomModels: false diff --git a/bin/configs/kotlin-default-values-jvm-volley.yaml b/bin/configs/kotlin-default-values-jvm-volley.yaml deleted file mode 100644 index d885b30356d2..000000000000 --- a/bin/configs/kotlin-default-values-jvm-volley.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: kotlin -outputDir: samples/client/petstore/kotlin-default-values-jvm-volley -inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client -additionalProperties: - artifactId: kotlin-default-values-jvm-volley - library: jvm-volley - sortParamsByRequiredFlag: false - serializationLibrary: gson - generateRoomModels: true diff --git a/bin/configs/kotlin-jvm-volley.yaml b/bin/configs/kotlin-jvm-volley.yaml deleted file mode 100644 index cdb8ac51a9b4..000000000000 --- a/bin/configs/kotlin-jvm-volley.yaml +++ /dev/null @@ -1,9 +0,0 @@ -generatorName: kotlin -outputDir: samples/client/petstore/kotlin-jvm-volley -library: jvm-volley -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/kotlin-client -additionalProperties: - artifactId: kotlin-petstore-jvm-volley - generateRoomModels: "true" - serializationLibrary: "gson" diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index ae2675a51de7..fe2da8f0b41c 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |idea|Add IntelliJ Idea plugin and mark Kotlin main and test folders as source folders.| |false| -|library|Library template (sub-template) to use|
**jvm-ktor**
Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
**jvm-okhttp4**
[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
**jvm-spring-webclient**
Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.
**jvm-spring-restclient**
Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
**jvm-volley**
Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
**jvm-vertx**
Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.
|jvm-okhttp4| +|library|Library template (sub-template) to use|
**jvm-ktor**
Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
**jvm-okhttp4**
[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
**jvm-spring-webclient**
Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.
**jvm-spring-restclient**
Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
**jvm-volley**
Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)
**jvm-vertx**
Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.
|jvm-okhttp4| |mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index a4fa43f2b031..96e402a21be0 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -248,7 +248,7 @@ public KotlinClientCodegen() { supportedLibraries.put(JVM_SPRING_RESTCLIENT, "Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson."); supportedLibraries.put(JVM_RETROFIT2, "Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2."); supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1."); - supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9"); + supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)"); supportedLibraries.put(JVM_VERTX, "Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson."); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use"); diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator-ignore b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES deleted file mode 100644 index fa7d703fae23..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES +++ /dev/null @@ -1,20 +0,0 @@ -README.md -build.gradle -docs/DefaultApi.md -gradle.properties -gradle/wrapper/gradle-wrapper.jar -gradle/wrapper/gradle-wrapper.properties -gradlew -gradlew.bat -settings.gradle -src/main/AndroidManifest.xml -src/main/java/org/openapitools/client/apis/DefaultApi.kt -src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt -src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt -src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt -src/main/java/org/openapitools/client/request/GsonRequest.kt -src/main/java/org/openapitools/client/request/IRequestFactory.kt -src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/VERSION deleted file mode 100644 index 2fb556b60635..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.18.0-SNAPSHOT diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/README.md b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/README.md deleted file mode 100644 index dcc7645b9238..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/README.md +++ /dev/null @@ -1,190 +0,0 @@ -# org.openapitools.client - Kotlin client library for Demo - - -A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley - -- Currently sends GsonRequests -- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen -- Defaults the source location to src/main/java as per standard Android builds - - -## Design - -Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and -a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of -kotlin co-routines. The code gen library reflects these factors. - -- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. -- Facilitate dependency injection, with default implementations available. -- Generate a requestFactory that can be overridden -- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. -- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. -- Lazy header factories allow for refreshing tokens etc -- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. -- Header factories allow the merging of generated headers from open api spec with dynamically added headers - -- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton -- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. - -- Reuse model class and other jvm common infrastructure - -- Optional generation of room database models, and transform methods to these from open api models -- Room and api models can be extended with additional extension properties. - -## Future improvements -- Option to generate image requests on certain conditionals e.g content-type gif etc -- Support for kotlin serialization. -- Multi part form parameters and support for file inputs - -## Usage -Hilt Dependency injection example - with default values for parameters overridden. -``` - @Provides - internal fun provideSomeApi( - context: Context, - restService: IRestService, - configurationService: IConfigurationService, - sessionService: ISessionService - ): SomeApi { - return SomeApi( - context = context, - requestQueue = restService.getRequestQueue(), - requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), - postProcessors = listOf(retryPolicySetter)), - basePath = configurationService.getBaseUrl() - ) - } -``` -Here is the constructor so you can see the defaults -```class SomeApi ( -val context: Context, -val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - val requestFactory: IRequestFactory = RequestFactory(), - val basePath: String = "https://yourbasepath.from_input_parameter.com/api", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { -``` - -### Overriding defaults -The above constructor for each api allows the following to be customized -- A custom context, so either a singleton request queue or different scope can be created - see -https://developer.android.com/training/volley/requestqueue#singleton -- An overridable request queue - which in turn can have a custom http url stack passed to it -- An overridable request factory constructor call, or a request factory that can be overridden by a custom template, with -custom header factory, request post processors and custom gson adapters injected. - -#### Overriding request generation -Request generation can be overridden by -- Overriding the entire request factory template -- Supplying custom header factories - methods that take any possible parameters but return a map of headers -- Supplying custom request post processors - methods that take and return the request object - -Header factory examples can be found in the auth section, as these are implemented as header factories. eg -``` -val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> -{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} -} -``` -In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other -generated code will supply the username and password. In this case it results in a map of just one key/value pair, but -it could be multiple. The important part is it's returning a map - and that the surrounding code -will can bind the inputs to it at some point. - -Here is a different example that supplies tracing header values -``` -/** - * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. - */ -private fun createTraceHeaderFactory(): () -> Map = { - mapOf( - HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), - HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), - HttpHeaderType.b3_sampled.rawValue to "1" - ) -} -``` -Finally a post processor example -``` - /** - * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. - */ - private val retryPolicySetter = { request: Request<*> -> - Unit.apply { - request.setRetryPolicy( - DefaultRetryPolicy( - RestService.DEFAULT_TIMEOUT_MS, - 0, - DefaultRetryPolicy.DEFAULT_BACKOFF_MULT - ) - ) - } - } -``` - -### Serialization -#### Gson and Polymorphic types -The GsonRequest object can be passed custom type adapters -``` -class GsonRequest( - method: Int, - url: String, - private val body: Any?, - private val headers: Map?, - private val params: MutableMap?, - private val contentTypeForBody: String?, - private val encodingForParams: String?, - private val gsonAdapters: Map?, - private val type: Type, - private val listener: Response.Listener, - errorListener: Response.ErrorListener -) : Request(method, url, errorListener) { - - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - -``` -## Requires - -* Kotlin 1.4.30 -* Gradle 6.8.3 - -## Build - -First, create the gradle wrapper script: - -``` -gradle wrapper -``` - -Then, run: - -``` -./gradlew check assemble -``` - -This runs all tests and packages the library. - - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**idsGet**](docs/DefaultApi.md#idsget) | **GET** /{ids} | - - - -## Documentation for Models - - - - -## Documentation for Authorization - -Endpoints do not require authorization. - diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle deleted file mode 100644 index 8474c5683e56..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle +++ /dev/null @@ -1,87 +0,0 @@ - -buildscript { - - ext.kotlin_version = '1.5.20' - ext.swagger_annotations_version = "1.6.2" - ext.gson_version = "2.8.6" - ext.volley_version = "1.2.0" - ext.junit_version = "4.13.2" - ext.robolectric_version = "4.5.1" - ext.concurrent_unit_version = "0.4.6" - - repositories { - mavenLocal() - google() - maven { - url 'https://dl.google.com/dl/android/maven2' - } - mavenCentral() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:7.4.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion 30 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 - } - compileOptions { - coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - lintOptions { - abortOnError false - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.all { output -> - if (outputFile != null && outputFileName.endsWith('.aar')) { - outputFileName = "${archivesBaseName}-${version}.aar" - } - } - } - - testOptions { - unitTests.returnDefaultValues = true - } -} - -dependencies { - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "com.google.code.gson:gson:$gson_version" - implementation "com.android.volley:volley:${volley_version}" - testImplementation "junit:junit:$junit_version" - testImplementation "org.robolectric:robolectric:${robolectric_version}" - testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" -} - -afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDirectory - task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") - task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } -} - diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/docs/DefaultApi.md b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/docs/DefaultApi.md deleted file mode 100644 index ca2435532ad3..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/docs/DefaultApi.md +++ /dev/null @@ -1,45 +0,0 @@ -# DefaultApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**idsGet**](DefaultApi.md#idsGet) | **GET** /{ids} | - - - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(DefaultApi::class.java) -val ids : kotlin.collections.List = // kotlin.collections.List | - -webService.idsGet(ids) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle.properties b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle.properties deleted file mode 100644 index a9707aaf9931..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle.properties +++ /dev/null @@ -1,6 +0,0 @@ -# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). -# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. -# -# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties -# -android.useAndroidX=true diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 2c3521197d7c..000000000000 Binary files a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 4b01038305d2..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew deleted file mode 100644 index 51eb8bb47109..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while -APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path -[ -h "$app_path" ] -do -ls=$( ls -ld "$app_path" ) -link=${ls#*' -> '} -case $link in #( -/*) app_path=$link ;; #( -*) app_path=$APP_HOME$link ;; -esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { -echo "$*" -} >&2 - -die () { -echo -echo "$*" -echo -exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( -CYGWIN* ) cygwin=true ;; #( -Darwin* ) darwin=true ;; #( -MSYS* | MINGW* ) msys=true ;; #( -NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then -if [ -x "$JAVA_HOME/jre/sh/java" ] ; then -# IBM's JDK on AIX uses strange locations for the executables -JAVACMD=$JAVA_HOME/jre/sh/java -else -JAVACMD=$JAVA_HOME/bin/java -fi -if [ ! -x "$JAVACMD" ] ; then -die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -else -JAVACMD=java -if ! command -v java >/dev/null 2>&1 -then -die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then -case $MAX_FD in #( -max*) -# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -MAX_FD=$( ulimit -H -n ) || -warn "Could not query maximum file descriptor limit" -esac -case $MAX_FD in #( -'' | soft) :;; #( -*) -# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -ulimit -n "$MAX_FD" || -warn "Could not set maximum file descriptor limit to $MAX_FD" -esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then -APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) -CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - -JAVACMD=$( cygpath --unix "$JAVACMD" ) - -# Now convert the arguments - kludge to limit ourselves to /bin/sh -for arg do -if -case $arg in #( --*) false ;; # don't mess with options #( -/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath -[ -e "$t" ] ;; #( -*) false ;; -esac -then -arg=$( cygpath --path --ignore --mixed "$arg" ) -fi -# Roll the args list around exactly as many times as the number of -# args, so each arg winds up back in the position where it started, but -# possibly modified. -# -# NB: a `for` loop captures its iteration list before it begins, so -# changing the positional parameters here affects neither the number of -# iterations, nor the values presented in `arg`. -shift # remove old arg -set -- "$@" "$arg" # push replacement arg -done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ -"-Dorg.gradle.appname=$APP_BASE_NAME" \ --classpath "$CLASSPATH" \ -org.gradle.wrapper.GradleWrapperMain \ -"$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then -die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( -printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | -xargs -n1 | -sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | -tr '\n' ' ' -)" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat deleted file mode 100644 index 9d21a21834d5..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle deleted file mode 100644 index eb08621c1eef..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'kotlin-array-simple-string-jvm-volley' diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/AndroidManifest.xml b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/AndroidManifest.xml deleted file mode 100644 index 90fc37cd8912..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt deleted file mode 100644 index d359f7b6121f..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt +++ /dev/null @@ -1,97 +0,0 @@ -package org.openapitools.client.apis - -import android.content.Context -import com.android.volley.DefaultRetryPolicy -import com.android.volley.Request -import com.android.volley.RequestQueue -import com.android.volley.Response -import com.android.volley.toolbox.BaseHttpStack -import com.android.volley.toolbox.Volley -import java.util.* -import kotlin.coroutines.resume -import kotlin.coroutines.resumeWithException -import kotlin.coroutines.suspendCoroutine -import com.google.gson.reflect.TypeToken - -import org.openapitools.client.request.IRequestFactory -import org.openapitools.client.request.RequestFactory -import org.openapitools.client.infrastructure.CollectionFormats.* - - -/* -* If you wish to use a custom http stack with your client you -* can pass that to the request queue like: -* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) -*/ -open class DefaultApi ( - private val context: Context, - private val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - private val requestFactory: IRequestFactory = RequestFactory(), - private val basePath: String = "http://localhost", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { - - /** - * GET /{ids} - * - * - * @param ids - * @return void - */ - suspend fun idsGet(ids: kotlin.collections.List): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/{ids}".replace("{" + "ids" + "}", ids.joinToString(",")) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b081929d..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 7f404da69ea0..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef6697183a..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66ca1..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9cc0..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt deleted file mode 100644 index e33e8f02bbd0..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.client.request - -import com.android.volley.NetworkResponse -import com.android.volley.ParseError -import com.android.volley.Request -import com.android.volley.Response -import com.android.volley.toolbox.HttpHeaderParser -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import com.google.gson.JsonSyntaxException -import java.io.UnsupportedEncodingException -import java.nio.charset.Charset -import java.net.HttpURLConnection -import java.lang.reflect.Type -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime - -import org.openapitools.client.infrastructure.OffsetDateTimeAdapter -import org.openapitools.client.infrastructure.LocalDateTimeAdapter -import org.openapitools.client.infrastructure.LocalDateAdapter -import org.openapitools.client.infrastructure.ByteArrayAdapter - -class GsonRequest( - method: Int, - url: String, - private val body: Any?, - private val headers: Map?, - private val params: MutableMap?, - private val contentTypeForBody: String?, - private val encodingForParams: String?, - private val gsonAdapters: Map?, - private val type: Type, - private val listener: Response.Listener, - errorListener: Response.ErrorListener -) : Request(method, url, errorListener) { - - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - .apply { - gsonAdapters?.forEach { - this.registerTypeAdapter(it.key, it.value) - } - } - - val gson: Gson by lazy { - gsonBuilder.create() - } - - private var response: NetworkResponse? = null - - override fun deliverResponse(response: T?) { - listener.onResponse(response) - } - - override fun getParams(): MutableMap? = params ?: super.getParams() - - override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() - - override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() - - override fun getHeaders(): MutableMap { - val combined = HashMap() - combined.putAll(super.getHeaders()) - if (headers != null) { - combined.putAll(headers) - } - return combined - } - - override fun getBody(): ByteArray? { - if (body != null) { - return gson.toJson(body).toByteArray(Charsets.UTF_8) - } - return super.getBody() - } - - override fun parseNetworkResponse(response: NetworkResponse?): Response { - return try { - this.response = copyTo(response) - val json = String( - response?.data ?: ByteArray(0), - Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) - ) - Response.success( - gson.fromJson(json, type), - HttpHeaderParser.parseCacheHeaders(response) - ) - } catch (e: UnsupportedEncodingException) { - Response.error(ParseError(e)) - } catch (e: JsonSyntaxException) { - Response.error(ParseError(e)) - } - } - - private fun copyTo(response: NetworkResponse?): NetworkResponse { - return if (response != null) { - NetworkResponse( - response.statusCode, - response.data, - response.notModified, - response.networkTimeMs, - response.allHeaders - ) - } else { - // Return an empty response. - NetworkResponse( - HttpURLConnection.HTTP_BAD_METHOD, - ByteArray(0), - false, - 0, - emptyList() - ) - } - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt deleted file mode 100644 index 32f2350312cd..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt +++ /dev/null @@ -1,64 +0,0 @@ -package org.openapitools.client.request - -import com.android.volley.Request -import com.android.volley.Response -import java.io.UnsupportedEncodingException -import java.lang.reflect.Type -import java.net.URLEncoder -import java.text.ParseException -import java.text.SimpleDateFormat -import java.util.* -import java.time.format.DateTimeFormatter -import java.time.OffsetDateTime -import java.time.LocalDate - - -interface IRequestFactory { - - companion object { - /** - * ISO 8601 date time format. - * @see https://en.wikipedia.org/wiki/ISO_8601 - */ - fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) - fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) - - fun escapeString(str: String): String { - return try { - URLEncoder.encode(str, "UTF-8") - } catch (e: UnsupportedEncodingException) { - str - } - } - - fun parameterToString(param: Any?) = - when (param) { - null -> "" - is OffsetDateTime -> formatDateTime(param) - is Collection<*> -> { - val b = StringBuilder() - for (o in param) { - if (b.isNotEmpty()) { - b.append(",") - } - b.append(o.toString()) - } - b.toString() - } - else -> param.toString() - } - } - - - fun build( - method: Int, - url : String, - body: Any?, - headers: Map?, - queryParams: Map?, - formParams: Map?, - contentTypeForBody: String?, - type: Type, - responseListener: Response.Listener, - errorListener: Response.ErrorListener): Request -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt deleted file mode 100644 index 02d5979e3721..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt +++ /dev/null @@ -1,62 +0,0 @@ -// Knowing the details of an operation it will produce a call to a Volley Request constructor -package org.openapitools.client.request - - -import com.android.volley.Request -import com.android.volley.Response -import org.openapitools.client.request.IRequestFactory.Companion.escapeString -import java.lang.reflect.Type -import java.util.Locale -import java.util.UUID - -class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { - - /** - * {@inheritDoc} - */ - @Suppress("UNCHECKED_CAST") - override fun build( - method: Int, - url: String, - body: Any?, - headers: Map?, - queryParams: Map?, - formParams: Map?, - contentTypeForBody: String?, - type: Type, - responseListener: Response.Listener, - errorListener: Response.ErrorListener - ): Request { - val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) - // Factory built and aftermarket - // Merge the after market headers on top of the base ones in case we are overriding per call auth - val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } - - // If we decide to support auth parameters in the url, then you will reference them by supplying a url string - // with known variable name references in the string. We will then apply - val updatedUrl = if (!queryParams.isNullOrEmpty()) { - queryParams.asSequence().fold("$url?") {acc, param -> - "$acc${escapeString(param.key)}=${escapeString(param.value)}&" - }.trimEnd('&') - } else { - url - } - - val request = GsonRequest( - method, - updatedUrl, - body, - allHeaders, - formParams?.toMutableMap(), - contentTypeForBody, - null, - gsonAdapters, - type, - responseListener, - errorListener) - - postProcessors.forEach{ it.invoke(request)} - - return request - } -} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/test/kotlin/org/openapitools/client/apis/DefaultApiTest.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/test/kotlin/org/openapitools/client/apis/DefaultApiTest.kt deleted file mode 100644 index 7236f484264b..000000000000 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/test/kotlin/org/openapitools/client/apis/DefaultApiTest.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * 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 org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.DefaultApi - -class DefaultApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of DefaultApi - //val apiInstance = DefaultApi() - - // to test idsGet - should("test idsGet") { - // uncomment below to test idsGet - //val ids : kotlin.collections.List = // kotlin.collections.List | - //apiInstance.idsGet(ids) - } - - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator-ignore b/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES deleted file mode 100644 index a0ca34edb5c8..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES +++ /dev/null @@ -1,24 +0,0 @@ -README.md -build.gradle -docs/Apa.md -docs/DefaultApi.md -gradle.properties -gradle/wrapper/gradle-wrapper.jar -gradle/wrapper/gradle-wrapper.properties -gradlew -gradlew.bat -settings.gradle -src/main/AndroidManifest.xml -src/main/java/org/openapitools/client/apis/DefaultApi.kt -src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt -src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt -src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt -src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt -src/main/java/org/openapitools/client/models/Apa.kt -src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt -src/main/java/org/openapitools/client/request/GsonRequest.kt -src/main/java/org/openapitools/client/request/IRequestFactory.kt -src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/VERSION deleted file mode 100644 index 2fb556b60635..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.18.0-SNAPSHOT diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/README.md b/samples/client/petstore/kotlin-default-values-jvm-volley/README.md deleted file mode 100644 index 463409139a42..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/README.md +++ /dev/null @@ -1,191 +0,0 @@ -# org.openapitools.client - Kotlin client library for Demo - - -A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley - -- Currently sends GsonRequests -- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen -- Defaults the source location to src/main/java as per standard Android builds - - -## Design - -Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and -a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of -kotlin co-routines. The code gen library reflects these factors. - -- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. -- Facilitate dependency injection, with default implementations available. -- Generate a requestFactory that can be overridden -- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. -- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. -- Lazy header factories allow for refreshing tokens etc -- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. -- Header factories allow the merging of generated headers from open api spec with dynamically added headers - -- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton -- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. - -- Reuse model class and other jvm common infrastructure - -- Optional generation of room database models, and transform methods to these from open api models -- Room and api models can be extended with additional extension properties. - -## Future improvements -- Option to generate image requests on certain conditionals e.g content-type gif etc -- Support for kotlin serialization. -- Multi part form parameters and support for file inputs - -## Usage -Hilt Dependency injection example - with default values for parameters overridden. -``` - @Provides - internal fun provideSomeApi( - context: Context, - restService: IRestService, - configurationService: IConfigurationService, - sessionService: ISessionService - ): SomeApi { - return SomeApi( - context = context, - requestQueue = restService.getRequestQueue(), - requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), - postProcessors = listOf(retryPolicySetter)), - basePath = configurationService.getBaseUrl() - ) - } -``` -Here is the constructor so you can see the defaults -```class SomeApi ( -val context: Context, -val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - val requestFactory: IRequestFactory = RequestFactory(), - val basePath: String = "https://yourbasepath.from_input_parameter.com/api", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { -``` - -### Overriding defaults -The above constructor for each api allows the following to be customized -- A custom context, so either a singleton request queue or different scope can be created - see -https://developer.android.com/training/volley/requestqueue#singleton -- An overridable request queue - which in turn can have a custom http url stack passed to it -- An overridable request factory constructor call, or a request factory that can be overridden by a custom template, with -custom header factory, request post processors and custom gson adapters injected. - -#### Overriding request generation -Request generation can be overridden by -- Overriding the entire request factory template -- Supplying custom header factories - methods that take any possible parameters but return a map of headers -- Supplying custom request post processors - methods that take and return the request object - -Header factory examples can be found in the auth section, as these are implemented as header factories. eg -``` -val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> -{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} -} -``` -In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other -generated code will supply the username and password. In this case it results in a map of just one key/value pair, but -it could be multiple. The important part is it's returning a map - and that the surrounding code -will can bind the inputs to it at some point. - -Here is a different example that supplies tracing header values -``` -/** - * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. - */ -private fun createTraceHeaderFactory(): () -> Map = { - mapOf( - HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), - HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), - HttpHeaderType.b3_sampled.rawValue to "1" - ) -} -``` -Finally a post processor example -``` - /** - * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. - */ - private val retryPolicySetter = { request: Request<*> -> - Unit.apply { - request.setRetryPolicy( - DefaultRetryPolicy( - RestService.DEFAULT_TIMEOUT_MS, - 0, - DefaultRetryPolicy.DEFAULT_BACKOFF_MULT - ) - ) - } - } -``` - -### Serialization -#### Gson and Polymorphic types -The GsonRequest object can be passed custom type adapters -``` -class GsonRequest( - method: Int, - url: String, - private val body: Any?, - private val headers: Map?, - private val params: MutableMap?, - private val contentTypeForBody: String?, - private val encodingForParams: String?, - private val gsonAdapters: Map?, - private val type: Type, - private val listener: Response.Listener, - errorListener: Response.ErrorListener -) : Request(method, url, errorListener) { - - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - -``` -## Requires - -* Kotlin 1.4.30 -* Gradle 6.8.3 - -## Build - -First, create the gradle wrapper script: - -``` -gradle wrapper -``` - -Then, run: - -``` -./gradlew check assemble -``` - -This runs all tests and packages the library. - - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** /test | Tests default values - - - -## Documentation for Models - - - [org.openapitools.client.models.Apa](docs/Apa.md) - - - -## Documentation for Authorization - -Endpoints do not require authorization. - diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle b/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle deleted file mode 100644 index ccbdf66f37ef..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle +++ /dev/null @@ -1,89 +0,0 @@ - -buildscript { - - ext.kotlin_version = '1.5.20' - ext.swagger_annotations_version = "1.6.2" - ext.gson_version = "2.8.6" - ext.volley_version = "1.2.0" - ext.junit_version = "4.13.2" - ext.robolectric_version = "4.5.1" - ext.concurrent_unit_version = "0.4.6" - - repositories { - mavenLocal() - google() - maven { - url 'https://dl.google.com/dl/android/maven2' - } - mavenCentral() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:7.4.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion 30 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 - } - compileOptions { - coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - lintOptions { - abortOnError false - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.all { output -> - if (outputFile != null && outputFileName.endsWith('.aar')) { - outputFileName = "${archivesBaseName}-${version}.aar" - } - } - } - - testOptions { - unitTests.returnDefaultValues = true - } -} - -dependencies { - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "com.google.code.gson:gson:$gson_version" - implementation "com.android.volley:volley:${volley_version}" - testImplementation "junit:junit:$junit_version" - testImplementation "org.robolectric:robolectric:${robolectric_version}" - testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" - annotationProcessor "androidx.room:room-runtime:2.3.0" - implementation "androidx.room:room-runtime:2.3.0" -} - -afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDirectory - task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") - task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } -} - diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md b/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md deleted file mode 100644 index c83f71851c20..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Apa - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **i0** | **kotlin.Int** | | | -| **n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | -| **i1** | **kotlin.Int** | | [optional] | -| **n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | - - - diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-jvm-volley/docs/DefaultApi.md deleted file mode 100644 index a7e3b0bc679a..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/docs/DefaultApi.md +++ /dev/null @@ -1,103 +0,0 @@ -# DefaultApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test**](DefaultApi.md#test) | **POST** /test | Tests default values - - - -Tests default values - -Tests default values of different parameters - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(DefaultApi::class.java) -val pi0 : kotlin.Int = 56 // kotlin.Int | -val pi1 : kotlin.Int = 56 // kotlin.Int | -val pn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val pn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val qi0 : kotlin.Int = 56 // kotlin.Int | -val qi1 : kotlin.Int = 56 // kotlin.Int | -val qi2 : kotlin.Int = 56 // kotlin.Int | -val qi3 : kotlin.Int = 56 // kotlin.Int | -val qn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val qn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val qn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val qn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val hi0 : kotlin.Int = 56 // kotlin.Int | -val hi1 : kotlin.Int = 56 // kotlin.Int | -val hi2 : kotlin.Int = 56 // kotlin.Int | -val hi3 : kotlin.Int = 56 // kotlin.Int | -val hn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val hn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val hn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val hn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val fi0 : kotlin.Int = 56 // kotlin.Int | -val fi1 : kotlin.Int = 56 // kotlin.Int | -val fi2 : kotlin.Int = 56 // kotlin.Int | -val fi3 : kotlin.Int = 56 // kotlin.Int | -val fn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val fn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val fn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val fn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | -val fn4 : kotlin.collections.List = // kotlin.collections.List | - -webService.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pi0** | **kotlin.Int**| | [default to 10] - **pi1** | **kotlin.Int**| | - **pn0** | **java.math.BigDecimal**| | [default to 10.0] - **pn1** | **java.math.BigDecimal**| | - **qi0** | **kotlin.Int**| | [optional] [default to 10] - **qi1** | **kotlin.Int**| | [default to 71] - **qi2** | **kotlin.Int**| | [optional] - **qi3** | **kotlin.Int**| | - **qn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **qn1** | **java.math.BigDecimal**| | [default to 71.0] - **qn2** | **java.math.BigDecimal**| | [optional] - **qn3** | **java.math.BigDecimal**| | - **hi0** | **kotlin.Int**| | [optional] [default to 10] - **hi1** | **kotlin.Int**| | [default to 71] - **hi2** | **kotlin.Int**| | [optional] - **hi3** | **kotlin.Int**| | - **hn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **hn1** | **java.math.BigDecimal**| | [default to 71.0] - **hn2** | **java.math.BigDecimal**| | [optional] - **hn3** | **java.math.BigDecimal**| | - **fi0** | **kotlin.Int**| | [optional] [default to 10] - **fi1** | **kotlin.Int**| | [default to 71] - **fi2** | **kotlin.Int**| | [optional] - **fi3** | **kotlin.Int**| | - **fn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **fn1** | **java.math.BigDecimal**| | [default to 71.0] - **fn2** | **java.math.BigDecimal**| | [optional] - **fn3** | **java.math.BigDecimal**| | - **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: Not defined - diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle.properties b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle.properties deleted file mode 100644 index 3b3d9b0770bc..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). -# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. -# -# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties -# -android.useAndroidX=true -android.enableJetifier=true diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 2c3521197d7c..000000000000 Binary files a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 4b01038305d2..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew deleted file mode 100644 index 51eb8bb47109..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while -APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path -[ -h "$app_path" ] -do -ls=$( ls -ld "$app_path" ) -link=${ls#*' -> '} -case $link in #( -/*) app_path=$link ;; #( -*) app_path=$APP_HOME$link ;; -esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { -echo "$*" -} >&2 - -die () { -echo -echo "$*" -echo -exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( -CYGWIN* ) cygwin=true ;; #( -Darwin* ) darwin=true ;; #( -MSYS* | MINGW* ) msys=true ;; #( -NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then -if [ -x "$JAVA_HOME/jre/sh/java" ] ; then -# IBM's JDK on AIX uses strange locations for the executables -JAVACMD=$JAVA_HOME/jre/sh/java -else -JAVACMD=$JAVA_HOME/bin/java -fi -if [ ! -x "$JAVACMD" ] ; then -die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -else -JAVACMD=java -if ! command -v java >/dev/null 2>&1 -then -die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then -case $MAX_FD in #( -max*) -# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -MAX_FD=$( ulimit -H -n ) || -warn "Could not query maximum file descriptor limit" -esac -case $MAX_FD in #( -'' | soft) :;; #( -*) -# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -ulimit -n "$MAX_FD" || -warn "Could not set maximum file descriptor limit to $MAX_FD" -esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then -APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) -CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - -JAVACMD=$( cygpath --unix "$JAVACMD" ) - -# Now convert the arguments - kludge to limit ourselves to /bin/sh -for arg do -if -case $arg in #( --*) false ;; # don't mess with options #( -/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath -[ -e "$t" ] ;; #( -*) false ;; -esac -then -arg=$( cygpath --path --ignore --mixed "$arg" ) -fi -# Roll the args list around exactly as many times as the number of -# args, so each arg winds up back in the position where it started, but -# possibly modified. -# -# NB: a `for` loop captures its iteration list before it begins, so -# changing the positional parameters here affects neither the number of -# iterations, nor the values presented in `arg`. -shift # remove old arg -set -- "$@" "$arg" # push replacement arg -done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ -"-Dorg.gradle.appname=$APP_BASE_NAME" \ --classpath "$CLASSPATH" \ -org.gradle.wrapper.GradleWrapperMain \ -"$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then -die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( -printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | -xargs -n1 | -sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | -tr '\n' ' ' -)" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat deleted file mode 100644 index 9d21a21834d5..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle deleted file mode 100644 index 5f9a81975fcb..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'kotlin-default-values-jvm-volley' diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/AndroidManifest.xml b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/AndroidManifest.xml deleted file mode 100644 index 90fc37cd8912..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt deleted file mode 100644 index 5c9720975a57..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt +++ /dev/null @@ -1,153 +0,0 @@ -package org.openapitools.client.apis - -import android.content.Context -import com.android.volley.DefaultRetryPolicy -import com.android.volley.Request -import com.android.volley.RequestQueue -import com.android.volley.Response -import com.android.volley.toolbox.BaseHttpStack -import com.android.volley.toolbox.Volley -import java.util.* -import kotlin.coroutines.resume -import kotlin.coroutines.resumeWithException -import kotlin.coroutines.suspendCoroutine -import com.google.gson.reflect.TypeToken - -import org.openapitools.client.request.IRequestFactory -import org.openapitools.client.request.RequestFactory -import org.openapitools.client.infrastructure.CollectionFormats.* - - -/* -* If you wish to use a custom http stack with your client you -* can pass that to the request queue like: -* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) -*/ -open class DefaultApi ( - private val context: Context, - private val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - private val requestFactory: IRequestFactory = RequestFactory(), - private val basePath: String = "http://localhost", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { - - /** - * POST /test - * Tests default values - * Tests default values of different parameters - * @param pi0 (default to 10) - * @param pi1 - * @param pn0 (default to 10.0) - * @param pn1 - * @param qi0 (optional, default to 10) - * @param qi1 (default to 71) - * @param qi2 (optional) - * @param qi3 - * @param qn0 (optional, default to 10.0) - * @param qn1 (default to 71.0) - * @param qn2 (optional) - * @param qn3 - * @param hi0 (optional, default to 10) - * @param hi1 (default to 71) - * @param hi2 (optional) - * @param hi3 - * @param hn0 (optional, default to 10.0) - * @param hn1 (default to 71.0) - * @param hn2 (optional) - * @param hn3 - * @param fi0 (optional, default to 10) - * @param fi1 (default to 71) - * @param fi2 (optional) - * @param fi3 - * @param fn0 (optional, default to 10.0) - * @param fn1 (default to 71.0) - * @param fn2 (optional) - * @param fn3 - * @param fn4 - * @return void - */ - suspend fun test(pi0: kotlin.Int = 10, pi1: kotlin.Int, pn0: java.math.BigDecimal = java.math.BigDecimal("10.0"), pn1: java.math.BigDecimal, qi0: kotlin.Int? = 10, qi1: kotlin.Int = 71, qi2: kotlin.Int? = null, qi3: kotlin.Int, qn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), qn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), qn2: java.math.BigDecimal? = null, qn3: java.math.BigDecimal, hi0: kotlin.Int? = 10, hi1: kotlin.Int = 71, hi2: kotlin.Int? = null, hi3: kotlin.Int, hn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), hn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), hn2: java.math.BigDecimal? = null, hn3: java.math.BigDecimal, fi0: kotlin.Int? = 10, fi1: kotlin.Int = 71, fi2: kotlin.Int? = null, fi3: kotlin.Int, fn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), fn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), fn2: java.math.BigDecimal? = null, fn3: java.math.BigDecimal, fn4: kotlin.collections.List): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf("multipart/form-data") - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/test".replace("{" + "pi0" + "}", IRequestFactory.escapeString(pi0.toString())).replace("{" + "pi1" + "}", IRequestFactory.escapeString(pi1.toString())).replace("{" + "pn0" + "}", IRequestFactory.escapeString(pn0.toString())).replace("{" + "pn1" + "}", IRequestFactory.escapeString(pn1.toString())) - - val formParams = mapOf( - "fi0" to IRequestFactory.parameterToString(fi0), - "fi1" to IRequestFactory.parameterToString(fi1), - "fi2" to IRequestFactory.parameterToString(fi2), - "fi3" to IRequestFactory.parameterToString(fi3), - "fn0" to IRequestFactory.parameterToString(fn0), - "fn1" to IRequestFactory.parameterToString(fn1), - "fn2" to IRequestFactory.parameterToString(fn2), - "fn3" to IRequestFactory.parameterToString(fn3), - "fn4" to IRequestFactory.parameterToString(fn4) - ) - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf( - "qi0" to IRequestFactory.parameterToString(qi0), - "qi1" to IRequestFactory.parameterToString(qi1), - "qi2" to IRequestFactory.parameterToString(qi2), - "qi3" to IRequestFactory.parameterToString(qi3), - "qn0" to IRequestFactory.parameterToString(qn0), - "qn1" to IRequestFactory.parameterToString(qn1), - "qn2" to IRequestFactory.parameterToString(qn2), - "qn3" to IRequestFactory.parameterToString(qn3) - ) - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf( - "hi0" to IRequestFactory.parameterToString(hi0), - "hi1" to IRequestFactory.parameterToString(hi1), - "hi2" to IRequestFactory.parameterToString(hi2), - "hi3" to IRequestFactory.parameterToString(hi3), - "hn0" to IRequestFactory.parameterToString(hn0), - "hn1" to IRequestFactory.parameterToString(hn1), - "hn2" to IRequestFactory.parameterToString(hn2), - "hn3" to IRequestFactory.parameterToString(hn3) - ) - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b081929d..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 7f404da69ea0..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt deleted file mode 100644 index fd6593e3b028..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * 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 org.openapitools.client.infrastructure - -import org.openapitools.client.models.room.* - -// TODO ITransformForStorage -interface ITransformForStorage { - fun toRoomModel(): T -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef6697183a..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66ca1..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9cc0..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt deleted file mode 100644 index 6e7e8e340b62..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.ApaRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * - * - * @param i0 - * @param n0 - * @param i1 - * @param n1 - */ - - -data class Apa ( - - @SerializedName("i0") - val i0: kotlin.Int, - - @SerializedName("n0") - val n0: java.math.BigDecimal, - - @SerializedName("i1") - val i1: kotlin.Int? = null, - - @SerializedName("n1") - val n1: java.math.BigDecimal? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): ApaRoomModel = - ApaRoomModel(roomTableId = 0, - i0 = this.i0, -n0 = this.n0, -i1 = this.i1, -n1 = this.n1, - ) - - -} - diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt deleted file mode 100644 index 6af93efc587d..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "Apa") -/** -* Room model for -* @param i0 -* @param n0 -* @param i1 -* @param n1 -*/ -data class ApaRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var i0: kotlin.Int, - var n0: java.math.BigDecimal, - var i1: kotlin.Int? = null, - var n1: java.math.BigDecimal? = null, - - ) { - - companion object { } - - fun toApiModel(): Apa = Apa( - i0 = this.i0, - n0 = this.n0, - i1 = this.i1, - n1 = this.n1, - ) -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt deleted file mode 100644 index e33e8f02bbd0..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.client.request - -import com.android.volley.NetworkResponse -import com.android.volley.ParseError -import com.android.volley.Request -import com.android.volley.Response -import com.android.volley.toolbox.HttpHeaderParser -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import com.google.gson.JsonSyntaxException -import java.io.UnsupportedEncodingException -import java.nio.charset.Charset -import java.net.HttpURLConnection -import java.lang.reflect.Type -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime - -import org.openapitools.client.infrastructure.OffsetDateTimeAdapter -import org.openapitools.client.infrastructure.LocalDateTimeAdapter -import org.openapitools.client.infrastructure.LocalDateAdapter -import org.openapitools.client.infrastructure.ByteArrayAdapter - -class GsonRequest( - method: Int, - url: String, - private val body: Any?, - private val headers: Map?, - private val params: MutableMap?, - private val contentTypeForBody: String?, - private val encodingForParams: String?, - private val gsonAdapters: Map?, - private val type: Type, - private val listener: Response.Listener, - errorListener: Response.ErrorListener -) : Request(method, url, errorListener) { - - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - .apply { - gsonAdapters?.forEach { - this.registerTypeAdapter(it.key, it.value) - } - } - - val gson: Gson by lazy { - gsonBuilder.create() - } - - private var response: NetworkResponse? = null - - override fun deliverResponse(response: T?) { - listener.onResponse(response) - } - - override fun getParams(): MutableMap? = params ?: super.getParams() - - override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() - - override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() - - override fun getHeaders(): MutableMap { - val combined = HashMap() - combined.putAll(super.getHeaders()) - if (headers != null) { - combined.putAll(headers) - } - return combined - } - - override fun getBody(): ByteArray? { - if (body != null) { - return gson.toJson(body).toByteArray(Charsets.UTF_8) - } - return super.getBody() - } - - override fun parseNetworkResponse(response: NetworkResponse?): Response { - return try { - this.response = copyTo(response) - val json = String( - response?.data ?: ByteArray(0), - Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) - ) - Response.success( - gson.fromJson(json, type), - HttpHeaderParser.parseCacheHeaders(response) - ) - } catch (e: UnsupportedEncodingException) { - Response.error(ParseError(e)) - } catch (e: JsonSyntaxException) { - Response.error(ParseError(e)) - } - } - - private fun copyTo(response: NetworkResponse?): NetworkResponse { - return if (response != null) { - NetworkResponse( - response.statusCode, - response.data, - response.notModified, - response.networkTimeMs, - response.allHeaders - ) - } else { - // Return an empty response. - NetworkResponse( - HttpURLConnection.HTTP_BAD_METHOD, - ByteArray(0), - false, - 0, - emptyList() - ) - } - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt deleted file mode 100644 index 32f2350312cd..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt +++ /dev/null @@ -1,64 +0,0 @@ -package org.openapitools.client.request - -import com.android.volley.Request -import com.android.volley.Response -import java.io.UnsupportedEncodingException -import java.lang.reflect.Type -import java.net.URLEncoder -import java.text.ParseException -import java.text.SimpleDateFormat -import java.util.* -import java.time.format.DateTimeFormatter -import java.time.OffsetDateTime -import java.time.LocalDate - - -interface IRequestFactory { - - companion object { - /** - * ISO 8601 date time format. - * @see https://en.wikipedia.org/wiki/ISO_8601 - */ - fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) - fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) - - fun escapeString(str: String): String { - return try { - URLEncoder.encode(str, "UTF-8") - } catch (e: UnsupportedEncodingException) { - str - } - } - - fun parameterToString(param: Any?) = - when (param) { - null -> "" - is OffsetDateTime -> formatDateTime(param) - is Collection<*> -> { - val b = StringBuilder() - for (o in param) { - if (b.isNotEmpty()) { - b.append(",") - } - b.append(o.toString()) - } - b.toString() - } - else -> param.toString() - } - } - - - fun build( - method: Int, - url : String, - body: Any?, - headers: Map?, - queryParams: Map?, - formParams: Map?, - contentTypeForBody: String?, - type: Type, - responseListener: Response.Listener, - errorListener: Response.ErrorListener): Request -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt deleted file mode 100644 index 02d5979e3721..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt +++ /dev/null @@ -1,62 +0,0 @@ -// Knowing the details of an operation it will produce a call to a Volley Request constructor -package org.openapitools.client.request - - -import com.android.volley.Request -import com.android.volley.Response -import org.openapitools.client.request.IRequestFactory.Companion.escapeString -import java.lang.reflect.Type -import java.util.Locale -import java.util.UUID - -class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { - - /** - * {@inheritDoc} - */ - @Suppress("UNCHECKED_CAST") - override fun build( - method: Int, - url: String, - body: Any?, - headers: Map?, - queryParams: Map?, - formParams: Map?, - contentTypeForBody: String?, - type: Type, - responseListener: Response.Listener, - errorListener: Response.ErrorListener - ): Request { - val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) - // Factory built and aftermarket - // Merge the after market headers on top of the base ones in case we are overriding per call auth - val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } - - // If we decide to support auth parameters in the url, then you will reference them by supplying a url string - // with known variable name references in the string. We will then apply - val updatedUrl = if (!queryParams.isNullOrEmpty()) { - queryParams.asSequence().fold("$url?") {acc, param -> - "$acc${escapeString(param.key)}=${escapeString(param.value)}&" - }.trimEnd('&') - } else { - url - } - - val request = GsonRequest( - method, - updatedUrl, - body, - allHeaders, - formParams?.toMutableMap(), - contentTypeForBody, - null, - gsonAdapters, - type, - responseListener, - errorListener) - - postProcessors.forEach{ it.invoke(request)} - - return request - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/test/kotlin/org/openapitools/client/apis/DefaultApiTest.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/test/kotlin/org/openapitools/client/apis/DefaultApiTest.kt deleted file mode 100644 index cd6bb559d1fa..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/test/kotlin/org/openapitools/client/apis/DefaultApiTest.kt +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * 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 org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.DefaultApi - -class DefaultApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of DefaultApi - //val apiInstance = DefaultApi() - - // to test test - should("test test") { - // uncomment below to test test - //val pi0 : kotlin.Int = 56 // kotlin.Int | - //val pi1 : kotlin.Int = 56 // kotlin.Int | - //val pn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val pn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val qi0 : kotlin.Int = 56 // kotlin.Int | - //val qi1 : kotlin.Int = 56 // kotlin.Int | - //val qi2 : kotlin.Int = 56 // kotlin.Int | - //val qi3 : kotlin.Int = 56 // kotlin.Int | - //val qn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val qn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val qn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val qn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val hi0 : kotlin.Int = 56 // kotlin.Int | - //val hi1 : kotlin.Int = 56 // kotlin.Int | - //val hi2 : kotlin.Int = 56 // kotlin.Int | - //val hi3 : kotlin.Int = 56 // kotlin.Int | - //val hn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val hn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val hn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val hn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val fi0 : kotlin.Int = 56 // kotlin.Int | - //val fi1 : kotlin.Int = 56 // kotlin.Int | - //val fi2 : kotlin.Int = 56 // kotlin.Int | - //val fi3 : kotlin.Int = 56 // kotlin.Int | - //val fn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val fn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val fn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val fn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | - //val fn4 : kotlin.collections.List = // kotlin.collections.List | - //apiInstance.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) - } - - } -} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/test/kotlin/org/openapitools/client/models/ApaTest.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/test/kotlin/org/openapitools/client/models/ApaTest.kt deleted file mode 100644 index e52f39c0b245..000000000000 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/test/kotlin/org/openapitools/client/models/ApaTest.kt +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Apa - -class ApaTest : ShouldSpec() { - init { - // uncomment below to create an instance of Apa - //val modelInstance = Apa() - - // to test the property `i0` - should("test i0") { - // uncomment below to test the property - //modelInstance.i0 shouldBe ("TODO") - } - - // to test the property `n0` - should("test n0") { - // uncomment below to test the property - //modelInstance.n0 shouldBe ("TODO") - } - - // to test the property `i1` - should("test i1") { - // uncomment below to test the property - //modelInstance.i1 shouldBe ("TODO") - } - - // to test the property `n1` - should("test n1") { - // uncomment below to test the property - //modelInstance.n1 shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES deleted file mode 100644 index 1de427bbcb2f..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES +++ /dev/null @@ -1,43 +0,0 @@ -README.md -build.gradle -docs/ApiResponse.md -docs/Category.md -docs/Order.md -docs/Pet.md -docs/PetApi.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -gradle.properties -gradle/wrapper/gradle-wrapper.jar -gradle/wrapper/gradle-wrapper.properties -gradlew -gradlew.bat -settings.gradle -src/main/AndroidManifest.xml -src/main/java/org/openapitools/client/apis/PetApi.kt -src/main/java/org/openapitools/client/apis/StoreApi.kt -src/main/java/org/openapitools/client/apis/UserApi.kt -src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt -src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt -src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt -src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt -src/main/java/org/openapitools/client/models/Category.kt -src/main/java/org/openapitools/client/models/ModelApiResponse.kt -src/main/java/org/openapitools/client/models/Order.kt -src/main/java/org/openapitools/client/models/Pet.kt -src/main/java/org/openapitools/client/models/Tag.kt -src/main/java/org/openapitools/client/models/User.kt -src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt -src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt -src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt -src/main/java/org/openapitools/client/models/room/PetRoomModel.kt -src/main/java/org/openapitools/client/models/room/TagRoomModel.kt -src/main/java/org/openapitools/client/models/room/UserRoomModel.kt -src/main/java/org/openapitools/client/request/GsonRequest.kt -src/main/java/org/openapitools/client/request/IRequestFactory.kt -src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION deleted file mode 100644 index 2fb556b60635..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.18.0-SNAPSHOT diff --git a/samples/client/petstore/kotlin-jvm-volley/README.md b/samples/client/petstore/kotlin-jvm-volley/README.md deleted file mode 100644 index 253aa14af25b..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/README.md +++ /dev/null @@ -1,232 +0,0 @@ -# org.openapitools.client - Kotlin client library for OpenAPI Petstore - - -A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley - -- Currently sends GsonRequests -- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen -- Defaults the source location to src/main/java as per standard Android builds - - -## Design - -Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and -a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of -kotlin co-routines. The code gen library reflects these factors. - -- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. -- Facilitate dependency injection, with default implementations available. -- Generate a requestFactory that can be overridden -- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. -- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. -- Lazy header factories allow for refreshing tokens etc -- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. -- Header factories allow the merging of generated headers from open api spec with dynamically added headers - -- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton -- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. - -- Reuse model class and other jvm common infrastructure - -- Optional generation of room database models, and transform methods to these from open api models -- Room and api models can be extended with additional extension properties. - -## Future improvements -- Option to generate image requests on certain conditionals e.g content-type gif etc -- Support for kotlin serialization. -- Multi part form parameters and support for file inputs - -## Usage -Hilt Dependency injection example - with default values for parameters overridden. -``` - @Provides - internal fun provideSomeApi( - context: Context, - restService: IRestService, - configurationService: IConfigurationService, - sessionService: ISessionService - ): SomeApi { - return SomeApi( - context = context, - requestQueue = restService.getRequestQueue(), - requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), - postProcessors = listOf(retryPolicySetter)), - basePath = configurationService.getBaseUrl() - ) - } -``` -Here is the constructor so you can see the defaults -```class SomeApi ( -val context: Context, -val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - val requestFactory: IRequestFactory = RequestFactory(), - val basePath: String = "https://yourbasepath.from_input_parameter.com/api", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { -``` - -### Overriding defaults -The above constructor for each api allows the following to be customized -- A custom context, so either a singleton request queue or different scope can be created - see -https://developer.android.com/training/volley/requestqueue#singleton -- An overridable request queue - which in turn can have a custom http url stack passed to it -- An overridable request factory constructor call, or a request factory that can be overridden by a custom template, with -custom header factory, request post processors and custom gson adapters injected. - -#### Overriding request generation -Request generation can be overridden by -- Overriding the entire request factory template -- Supplying custom header factories - methods that take any possible parameters but return a map of headers -- Supplying custom request post processors - methods that take and return the request object - -Header factory examples can be found in the auth section, as these are implemented as header factories. eg -``` -val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> -{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} -} -``` -In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other -generated code will supply the username and password. In this case it results in a map of just one key/value pair, but -it could be multiple. The important part is it's returning a map - and that the surrounding code -will can bind the inputs to it at some point. - -Here is a different example that supplies tracing header values -``` -/** - * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. - */ -private fun createTraceHeaderFactory(): () -> Map = { - mapOf( - HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), - HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), - HttpHeaderType.b3_sampled.rawValue to "1" - ) -} -``` -Finally a post processor example -``` - /** - * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. - */ - private val retryPolicySetter = { request: Request<*> -> - Unit.apply { - request.setRetryPolicy( - DefaultRetryPolicy( - RestService.DEFAULT_TIMEOUT_MS, - 0, - DefaultRetryPolicy.DEFAULT_BACKOFF_MULT - ) - ) - } - } -``` - -### Serialization -#### Gson and Polymorphic types -The GsonRequest object can be passed custom type adapters -``` -class GsonRequest( - method: Int, - url: String, - private val body: Any?, - private val headers: Map?, - private val params: MutableMap?, - private val contentTypeForBody: String?, - private val encodingForParams: String?, - private val gsonAdapters: Map?, - private val type: Type, - private val listener: Response.Listener, - errorListener: Response.ErrorListener -) : Request(method, url, errorListener) { - - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - -``` -## Requires - -* Kotlin 1.4.30 -* Gradle 6.8.3 - -## Build - -First, create the gradle wrapper script: - -``` -gradle wrapper -``` - -Then, run: - -``` -./gradlew check assemble -``` - -This runs all tests and packages the library. - - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - -## Documentation for Models - - - [org.openapitools.client.models.Category](docs/Category.md) - - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - - [org.openapitools.client.models.Order](docs/Order.md) - - [org.openapitools.client.models.Pet](docs/Pet.md) - - [org.openapitools.client.models.Tag](docs/Tag.md) - - [org.openapitools.client.models.User](docs/User.md) - - - -## Documentation for Authorization - - -Authentication schemes defined for the API: - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - write:pets: modify pets in your account - - read:pets: read your pets - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - diff --git a/samples/client/petstore/kotlin-jvm-volley/build.gradle b/samples/client/petstore/kotlin-jvm-volley/build.gradle deleted file mode 100644 index ccbdf66f37ef..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/build.gradle +++ /dev/null @@ -1,89 +0,0 @@ - -buildscript { - - ext.kotlin_version = '1.5.20' - ext.swagger_annotations_version = "1.6.2" - ext.gson_version = "2.8.6" - ext.volley_version = "1.2.0" - ext.junit_version = "4.13.2" - ext.robolectric_version = "4.5.1" - ext.concurrent_unit_version = "0.4.6" - - repositories { - mavenLocal() - google() - maven { - url 'https://dl.google.com/dl/android/maven2' - } - mavenCentral() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:7.4.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion 30 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 - } - compileOptions { - coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - lintOptions { - abortOnError false - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.all { output -> - if (outputFile != null && outputFileName.endsWith('.aar')) { - outputFileName = "${archivesBaseName}-${version}.aar" - } - } - } - - testOptions { - unitTests.returnDefaultValues = true - } -} - -dependencies { - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "com.google.code.gson:gson:$gson_version" - implementation "com.android.volley:volley:${volley_version}" - testImplementation "junit:junit:$junit_version" - testImplementation "org.robolectric:robolectric:${robolectric_version}" - testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" - annotationProcessor "androidx.room:room-runtime:2.3.0" - implementation "androidx.room:room-runtime:2.3.0" -} - -afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDirectory - task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") - task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md deleted file mode 100644 index 059525a99512..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ModelApiResponse - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **code** | **kotlin.Int** | | [optional] | -| **type** | **kotlin.String** | | [optional] | -| **message** | **kotlin.String** | | [optional] | - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Category.md b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md deleted file mode 100644 index baba5657eb21..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **name** | **kotlin.String** | | [optional] | - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Order.md b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md deleted file mode 100644 index 7b7a399f7f75..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Order.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Order - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **petId** | **kotlin.Long** | | [optional] | -| **quantity** | **kotlin.Int** | | [optional] | -| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | -| **status** | [**inline**](#Status) | Order Status | [optional] | -| **complete** | **kotlin.Boolean** | | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | placed, approved, delivered | - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md deleted file mode 100644 index 287312efaf94..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Pet - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **name** | **kotlin.String** | | | -| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | -| **id** | **kotlin.Long** | | [optional] | -| **category** | [**Category**](Category.md) | | [optional] | -| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | -| **status** | [**inline**](#Status) | pet status in the store | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | available, pending, sold | - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md deleted file mode 100644 index 529441d7dfd9..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md +++ /dev/null @@ -1,320 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -Add a new pet to the store - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val body : Pet = // Pet | Pet object that needs to be added to the store - -webService.addPet(body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -Deletes a pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete -val apiKey : kotlin.String = apiKey_example // kotlin.String | - -webService.deletePet(petId, apiKey) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter - -val result : kotlin.collections.List = webService.findPetsByStatus(status) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] - -### Return type - -[**kotlin.collections.List<Pet>**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by - -val result : kotlin.collections.List = webService.findPetsByTags(tags) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | - -### Return type - -[**kotlin.collections.List<Pet>**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Find pet by ID - -Returns a single pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return - -val result : Pet = webService.getPetById(petId) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Update an existing pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val body : Pet = // Pet | Pet object that needs to be added to the store - -webService.updatePet(body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -Updates a pet in the store with form data - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated -val name : kotlin.String = name_example // kotlin.String | Updated name of the pet -val status : kotlin.String = status_example // kotlin.String | Updated status of the pet - -webService.updatePetWithForm(petId, name, status) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -uploads an image - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update -val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server -val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload - -val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md deleted file mode 100644 index 63d7e597b3c6..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md +++ /dev/null @@ -1,158 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) -val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted - -webService.deleteOrder(orderId) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) - -val result : kotlin.collections.Map = webService.getInventory() -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**kotlin.collections.Map<kotlin.String, kotlin.Int>** - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) -val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched - -val result : Order = webService.getOrderById(orderId) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Place an order for a pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) -val body : Order = // Order | order placed for purchasing the pet - -val result : Order = webService.placeOrder(body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md deleted file mode 100644 index dc8fa3cb555d..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **name** | **kotlin.String** | | [optional] | - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/User.md b/samples/client/petstore/kotlin-jvm-volley/docs/User.md deleted file mode 100644 index a9f35788637e..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **username** | **kotlin.String** | | [optional] | -| **firstName** | **kotlin.String** | | [optional] | -| **lastName** | **kotlin.String** | | [optional] | -| **email** | **kotlin.String** | | [optional] | -| **password** | **kotlin.String** | | [optional] | -| **phone** | **kotlin.String** | | [optional] | -| **userStatus** | **kotlin.Int** | User Status | [optional] | - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md deleted file mode 100644 index b26ede410044..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md +++ /dev/null @@ -1,310 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -Create user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val body : User = // User | Created user object - -webService.createUser(body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Creates list of users with given input array - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val body : kotlin.collections.List = // kotlin.collections.List | List of user object - -webService.createUsersWithArrayInput(body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Creates list of users with given input array - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val body : kotlin.collections.List = // kotlin.collections.List | List of user object - -webService.createUsersWithListInput(body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Delete user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted - -webService.deleteUser(username) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Get user by user name - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. - -val result : User = webService.getUserByName(username) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Logs user into the system - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | The user name for login -val password : kotlin.String = password_example // kotlin.String | The password for login in clear text - -val result : kotlin.String = webService.loginUser(username, password) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | - -### Return type - -**kotlin.String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Logs out current logged in user session - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) - -webService.logoutUser() -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Updated user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | name that need to be deleted -val body : User = // User | Updated user object - -webService.updateUser(username, body) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle.properties b/samples/client/petstore/kotlin-jvm-volley/gradle.properties deleted file mode 100644 index 3b3d9b0770bc..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). -# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. -# -# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties -# -android.useAndroidX=true -android.enableJetifier=true diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 2c3521197d7c..000000000000 Binary files a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 4b01038305d2..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew b/samples/client/petstore/kotlin-jvm-volley/gradlew deleted file mode 100755 index 51eb8bb47109..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/gradlew +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while -APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path -[ -h "$app_path" ] -do -ls=$( ls -ld "$app_path" ) -link=${ls#*' -> '} -case $link in #( -/*) app_path=$link ;; #( -*) app_path=$APP_HOME$link ;; -esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { -echo "$*" -} >&2 - -die () { -echo -echo "$*" -echo -exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( -CYGWIN* ) cygwin=true ;; #( -Darwin* ) darwin=true ;; #( -MSYS* | MINGW* ) msys=true ;; #( -NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then -if [ -x "$JAVA_HOME/jre/sh/java" ] ; then -# IBM's JDK on AIX uses strange locations for the executables -JAVACMD=$JAVA_HOME/jre/sh/java -else -JAVACMD=$JAVA_HOME/bin/java -fi -if [ ! -x "$JAVACMD" ] ; then -die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -else -JAVACMD=java -if ! command -v java >/dev/null 2>&1 -then -die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then -case $MAX_FD in #( -max*) -# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -MAX_FD=$( ulimit -H -n ) || -warn "Could not query maximum file descriptor limit" -esac -case $MAX_FD in #( -'' | soft) :;; #( -*) -# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. -# shellcheck disable=SC2039,SC3045 -ulimit -n "$MAX_FD" || -warn "Could not set maximum file descriptor limit to $MAX_FD" -esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then -APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) -CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - -JAVACMD=$( cygpath --unix "$JAVACMD" ) - -# Now convert the arguments - kludge to limit ourselves to /bin/sh -for arg do -if -case $arg in #( --*) false ;; # don't mess with options #( -/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath -[ -e "$t" ] ;; #( -*) false ;; -esac -then -arg=$( cygpath --path --ignore --mixed "$arg" ) -fi -# Roll the args list around exactly as many times as the number of -# args, so each arg winds up back in the position where it started, but -# possibly modified. -# -# NB: a `for` loop captures its iteration list before it begins, so -# changing the positional parameters here affects neither the number of -# iterations, nor the values presented in `arg`. -shift # remove old arg -set -- "$@" "$arg" # push replacement arg -done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ -"-Dorg.gradle.appname=$APP_BASE_NAME" \ --classpath "$CLASSPATH" \ -org.gradle.wrapper.GradleWrapperMain \ -"$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then -die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( -printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | -xargs -n1 | -sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | -tr '\n' ' ' -)" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat deleted file mode 100644 index 9d21a21834d5..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/client/petstore/kotlin-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-jvm-volley/settings.gradle deleted file mode 100644 index 32bad6657a2b..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'kotlin-petstore-jvm-volley' diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml b/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml deleted file mode 100644 index 90fc37cd8912..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index b23c35d28441..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,551 +0,0 @@ -package org.openapitools.client.apis - -import android.content.Context -import com.android.volley.DefaultRetryPolicy -import com.android.volley.Request -import com.android.volley.RequestQueue -import com.android.volley.Response -import com.android.volley.toolbox.BaseHttpStack -import com.android.volley.toolbox.Volley -import java.util.* -import kotlin.coroutines.resume -import kotlin.coroutines.resumeWithException -import kotlin.coroutines.suspendCoroutine -import com.google.gson.reflect.TypeToken - -import org.openapitools.client.request.IRequestFactory -import org.openapitools.client.request.RequestFactory -import org.openapitools.client.infrastructure.CollectionFormats.* - -import org.openapitools.client.models.ModelApiResponse -import org.openapitools.client.models.Pet - -/* -* If you wish to use a custom http stack with your client you -* can pass that to the request queue like: -* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) -*/ -open class PetApi ( - private val context: Context, - private val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - private val requestFactory: IRequestFactory = RequestFactory(), - private val basePath: String = "http://petstore.swagger.io/v2", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { - - /** - * POST /pet - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - */ - suspend fun addPet(body: Pet): Unit { - val body: Any? = body - - val contentTypes : Array = arrayOf("application/json","application/xml") - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * DELETE /pet/{petId} - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - */ - suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf( - "api_key" to IRequestFactory.parameterToString(apiKey) - ) - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.DELETE, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /pet/findByStatus - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - */ - suspend fun findPetsByStatus(status: CSVParams): kotlin.collections.List? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet/findByStatus" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf( - "status" to IRequestFactory.parameterToString(status) - ) - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener> { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken>() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request> = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /pet/findByTags - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - */ - @Deprecated("This api was deprecated") - suspend fun findPetsByTags(tags: CSVParams): kotlin.collections.List? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet/findByTags" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf( - "tags" to IRequestFactory.parameterToString(tags) - ) - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener> { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken>() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request> = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /pet/{petId} - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - */ - suspend fun getPetById(petId: kotlin.Long): Pet? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * PUT /pet - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - */ - suspend fun updatePet(body: Pet): Unit { - val body: Any? = body - - val contentTypes : Array = arrayOf("application/json","application/xml") - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.PUT, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * POST /pet/{petId} - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - */ - suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf("application/x-www-form-urlencoded") - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())) - - val formParams = mapOf( - "name" to IRequestFactory.parameterToString(name), - "status" to IRequestFactory.parameterToString(status) - ) - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * POST /pet/{petId}/uploadImage - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ModelApiResponse - */ - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): ModelApiResponse? { - val body: Any? = null - - val contentTypes : Array = arrayOf("multipart/form-data") - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/pet/{petId}/uploadImage".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())) - - val formParams = mapOf( - "additionalMetadata" to IRequestFactory.parameterToString(additionalMetadata), - "file" to IRequestFactory.parameterToString(file) - ) - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 96063e8f27ae..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,283 +0,0 @@ -package org.openapitools.client.apis - -import android.content.Context -import com.android.volley.DefaultRetryPolicy -import com.android.volley.Request -import com.android.volley.RequestQueue -import com.android.volley.Response -import com.android.volley.toolbox.BaseHttpStack -import com.android.volley.toolbox.Volley -import java.util.* -import kotlin.coroutines.resume -import kotlin.coroutines.resumeWithException -import kotlin.coroutines.suspendCoroutine -import com.google.gson.reflect.TypeToken - -import org.openapitools.client.request.IRequestFactory -import org.openapitools.client.request.RequestFactory -import org.openapitools.client.infrastructure.CollectionFormats.* - -import org.openapitools.client.models.Order - -/* -* If you wish to use a custom http stack with your client you -* can pass that to the request queue like: -* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) -*/ -open class StoreApi ( - private val context: Context, - private val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - private val requestFactory: IRequestFactory = RequestFactory(), - private val basePath: String = "http://petstore.swagger.io/v2", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { - - /** - * DELETE /store/order/{orderId} - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - suspend fun deleteOrder(orderId: kotlin.String): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/store/order/{orderId}".replace("{" + "orderId" + "}", IRequestFactory.escapeString(orderId.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.DELETE, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /store/inventory - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - */ - suspend fun getInventory(): kotlin.collections.Map? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/store/inventory" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener> { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken>() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request> = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /store/order/{orderId} - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - suspend fun getOrderById(orderId: kotlin.Long): Order? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/store/order/{orderId}".replace("{" + "orderId" + "}", IRequestFactory.escapeString(orderId.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * POST /store/order - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - suspend fun placeOrder(body: Order): Order? { - val body: Any? = body - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/store/order" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index b39c74450534..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,536 +0,0 @@ -package org.openapitools.client.apis - -import android.content.Context -import com.android.volley.DefaultRetryPolicy -import com.android.volley.Request -import com.android.volley.RequestQueue -import com.android.volley.Response -import com.android.volley.toolbox.BaseHttpStack -import com.android.volley.toolbox.Volley -import java.util.* -import kotlin.coroutines.resume -import kotlin.coroutines.resumeWithException -import kotlin.coroutines.suspendCoroutine -import com.google.gson.reflect.TypeToken - -import org.openapitools.client.request.IRequestFactory -import org.openapitools.client.request.RequestFactory -import org.openapitools.client.infrastructure.CollectionFormats.* - -import org.openapitools.client.models.User - -/* -* If you wish to use a custom http stack with your client you -* can pass that to the request queue like: -* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) -*/ -open class UserApi ( - private val context: Context, - private val requestQueue: Lazy = lazy(initializer = { - Volley.newRequestQueue(context.applicationContext) - }), - private val requestFactory: IRequestFactory = RequestFactory(), - private val basePath: String = "http://petstore.swagger.io/v2", - private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { - - /** - * POST /user - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - */ - suspend fun createUser(body: User): Unit { - val body: Any? = body - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * POST /user/createWithArray - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - suspend fun createUsersWithArrayInput(body: kotlin.collections.List): Unit { - val body: Any? = body - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/createWithArray" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * POST /user/createWithList - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - suspend fun createUsersWithListInput(body: kotlin.collections.List): Unit { - val body: Any? = body - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/createWithList" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.POST, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * DELETE /user/{username} - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - suspend fun deleteUser(username: kotlin.String): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.DELETE, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /user/{username} - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - suspend fun getUserByName(username: kotlin.String): User? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /user/login - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - */ - suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String? { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/login" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf( - "username" to IRequestFactory.parameterToString(username), - "password" to IRequestFactory.parameterToString(password) - ) - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * GET /user/logout - * Logs out current logged in user session - * - * @return void - */ - suspend fun logoutUser(): Unit { - val body: Any? = null - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/logout" - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.GET, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } - /** - * PUT /user/{username} - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - */ - suspend fun updateUser(username: kotlin.String, body: User): Unit { - val body: Any? = body - - val contentTypes : Array = arrayOf() - val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } - - // Do some work or avoid some work based on what we know about the model, - // before we delegate to a pluggable request factory template - // The request factory template contains only pure code and no templates - // to make it easy to override with your own. - - // create path and map variables - val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())) - - val formParams = mapOf() - - - // TODO: Cater for allowing empty values - // TODO, if its apikey auth, then add the header names here and the hardcoded auth key - // Only support hard coded apikey in query param auth for when we do this first path - val queryParams = mapOf() - .filter { it.value.isNotEmpty() } - - val headerParams: Map = mapOf() - - return suspendCoroutine { continuation -> - val responseListener = Response.Listener { response -> - continuation.resume(response) - } - - val errorListener = Response.ErrorListener { error -> - continuation.resumeWithException(error) - } - - val responseType = object : TypeToken() {}.type - - // Call the correct request builder based on whether we have a return type or a body. - // All other switching on types must be done in code inside the builder - val request: Request = requestFactory.build( - Request.Method.PUT, - "$basePath$path", - body, - headerParams, - queryParams, - formParams, - contentType, - responseType, - responseListener, - errorListener) - - postProcessors.forEach { it.invoke(request) } - - requestQueue.value.add(request) - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b081929d..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 7f404da69ea0..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt deleted file mode 100644 index fd6593e3b028..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * 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 org.openapitools.client.infrastructure - -import org.openapitools.client.models.room.* - -// TODO ITransformForStorage -interface ITransformForStorage { - fun toRoomModel(): T -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef6697183a..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66ca1..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9cc0..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index d2569559c1aa..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,57 +0,0 @@ -/** - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.ApiResponseRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * Describes the result of uploading an image resource - * - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - - @SerializedName("code") - val code: kotlin.Int? = null, - - @SerializedName("type") - val type: kotlin.String? = null, - - @SerializedName("message") - val message: kotlin.String? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): ApiResponseRoomModel = - ApiResponseRoomModel(roomTableId = 0, - code = this.code, -type = this.type, -message = this.message, - ) - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt deleted file mode 100644 index 46188c0bc687..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.CategoryRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * A category for a pet - * - * @param id - * @param name - */ - - -data class Category ( - - @SerializedName("id") - val id: kotlin.Long? = null, - - @SerializedName("name") - val name: kotlin.String? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): CategoryRoomModel = - CategoryRoomModel(roomTableId = 0, - id = this.id, -name = this.name, - ) - - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt deleted file mode 100644 index 8f0f3e89cf46..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.ModelApiResponseRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * Describes the result of uploading an image resource - * - * @param code - * @param type - * @param message - */ - - -data class ModelApiResponse ( - - @SerializedName("code") - val code: kotlin.Int? = null, - - @SerializedName("type") - val type: kotlin.String? = null, - - @SerializedName("message") - val message: kotlin.String? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): ModelApiResponseRoomModel = - ModelApiResponseRoomModel(roomTableId = 0, - code = this.code, -type = this.type, -message = this.message, - ) - - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt deleted file mode 100644 index 4a6dfd6cc85c..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.OrderRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * An order for a pets from the pet store - * - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - - -data class Order ( - - @SerializedName("id") - val id: kotlin.Long? = null, - - @SerializedName("petId") - val petId: kotlin.Long? = null, - - @SerializedName("quantity") - val quantity: kotlin.Int? = null, - - @SerializedName("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - - /* Order Status */ - @SerializedName("status") - val status: Order.Status? = null, - - @SerializedName("complete") - val complete: kotlin.Boolean? = false - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): OrderRoomModel = - OrderRoomModel(roomTableId = 0, - id = this.id, -petId = this.petId, -quantity = this.quantity, -shipDate = this.shipDate, -status = this.status, -complete = this.complete, - ) - - /** - * Order Status - * - * Values: placed,approved,delivered - */ - enum class Status(val value: kotlin.String) { - @SerializedName(value = "placed") placed("placed"), - @SerializedName(value = "approved") approved("approved"), - @SerializedName(value = "delivered") delivered("delivered"); - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 07c67fa9ea87..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.PetRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * A pet for sale in the pet store - * - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - - -data class Pet ( - - @SerializedName("name") - val name: kotlin.String, - - @SerializedName("photoUrls") - val photoUrls: kotlin.collections.List, - - @SerializedName("id") - val id: kotlin.Long? = null, - - @SerializedName("category") - val category: Category? = null, - - @SerializedName("tags") - val tags: kotlin.collections.List? = null, - - /* pet status in the store */ - @SerializedName("status") - val status: Pet.Status? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): PetRoomModel = - PetRoomModel(roomTableId = 0, - name = this.name, -photoUrls = this.photoUrls, -id = this.id, -category = this.category, - -status = this.status, - ) - - /** - * pet status in the store - * - * Values: available,pending,sold - */ - enum class Status(val value: kotlin.String) { - @SerializedName(value = "available") available("available"), - @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold"); - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 0afafa73777f..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.TagRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * A tag for a pet - * - * @param id - * @param name - */ - - -data class Tag ( - - @SerializedName("id") - val id: kotlin.Long? = null, - - @SerializedName("name") - val name: kotlin.String? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): TagRoomModel = - TagRoomModel(roomTableId = 0, - id = this.id, -name = this.name, - ) - - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt deleted file mode 100644 index 2cec836e1f24..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import org.openapitools.client.models.room.UserRoomModel -import org.openapitools.client.infrastructure.ITransformForStorage - -/** - * A User who is purchasing from the pet store - * - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - - -data class User ( - - @SerializedName("id") - val id: kotlin.Long? = null, - - @SerializedName("username") - val username: kotlin.String? = null, - - @SerializedName("firstName") - val firstName: kotlin.String? = null, - - @SerializedName("lastName") - val lastName: kotlin.String? = null, - - @SerializedName("email") - val email: kotlin.String? = null, - - @SerializedName("password") - val password: kotlin.String? = null, - - @SerializedName("phone") - val phone: kotlin.String? = null, - - /* User Status */ - @SerializedName("userStatus") - val userStatus: kotlin.Int? = null - -): ITransformForStorage { - companion object { } - override fun toRoomModel(): UserRoomModel = - UserRoomModel(roomTableId = 0, - id = this.id, -username = this.username, -firstName = this.firstName, -lastName = this.lastName, -email = this.email, -password = this.password, -phone = this.phone, -userStatus = this.userStatus, - ) - - -} - diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt deleted file mode 100644 index aa00942c3977..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt +++ /dev/null @@ -1,52 +0,0 @@ -/** - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "ApiResponse") -/** -* Room model for Describes the result of uploading an image resource -* @param code -* @param type -* @param message -*/ -data class ApiResponseRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var code: kotlin.Int? = null, - var type: kotlin.String? = null, - var message: kotlin.String? = null, - - ) { - - companion object { } - - fun toApiModel(): ApiResponse = ApiResponse( - code = this.code, - type = this.type, - message = this.message, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt deleted file mode 100644 index dd20e53b0772..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "Category") -/** -* Room model for A category for a pet -* @param id -* @param name -*/ -data class CategoryRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var id: kotlin.Long? = null, - var name: kotlin.String? = null, - - ) { - - companion object { } - - fun toApiModel(): Category = Category( - id = this.id, - name = this.name, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt deleted file mode 100644 index 904313c4859b..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "ModelApiResponse") -/** -* Room model for Describes the result of uploading an image resource -* @param code -* @param type -* @param message -*/ -data class ModelApiResponseRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var code: kotlin.Int? = null, - var type: kotlin.String? = null, - var message: kotlin.String? = null, - - ) { - - companion object { } - - fun toApiModel(): ModelApiResponse = ModelApiResponse( - code = this.code, - type = this.type, - message = this.message, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt deleted file mode 100644 index 4291614f2499..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "Order") -/** -* Room model for An order for a pets from the pet store -* @param id -* @param petId -* @param quantity -* @param shipDate -* @param status Order Status -* @param complete -*/ -data class OrderRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var id: kotlin.Long? = null, - var petId: kotlin.Long? = null, - var quantity: kotlin.Int? = null, - var shipDate: java.time.OffsetDateTime? = null, - var complete: kotlin.Boolean? = null, - - var status: Order.Status? = null, - ) { - - companion object { } - - fun toApiModel(): Order = Order( - id = this.id, - petId = this.petId, - quantity = this.quantity, - shipDate = this.shipDate, - status = this.status, - complete = this.complete, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt deleted file mode 100644 index 2bfb6cf64a8d..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "Pet") -/** -* Room model for A pet for sale in the pet store -* @param name -* @param photoUrls -* @param id -* @param category -* @param tags -* @param status pet status in the store -*/ -data class PetRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - var photoUrls: kotlin.collections.List, - - var name: kotlin.String, - var id: kotlin.Long? = null, - var category: Category? = null, - - var status: Pet.Status? = null, - ) { - - @Ignore - var tags: kotlin.collections.List? = null - - companion object { } - - fun toApiModel(): Pet = Pet( - name = this.name, - photoUrls = this.photoUrls, - id = this.id, - category = this.category, - tags = this.tags, - status = this.status, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt deleted file mode 100644 index 228a464d2baa..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "Tag") -/** -* Room model for A tag for a pet -* @param id -* @param name -*/ -data class TagRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var id: kotlin.Long? = null, - var name: kotlin.String? = null, - - ) { - - companion object { } - - fun toApiModel(): Tag = Tag( - id = this.id, - name = this.name, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt deleted file mode 100644 index 20fb81c2e837..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * 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 org.openapitools.client.models.room - -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.PrimaryKey -import org.openapitools.client.models.* - - -@Entity(tableName = "User") -/** -* Room model for A User who is purchasing from the pet store -* @param id -* @param username -* @param firstName -* @param lastName -* @param email -* @param password -* @param phone -* @param userStatus User Status -*/ -data class UserRoomModel ( - @PrimaryKey(autoGenerate = true) var roomTableId: Int, - - var id: kotlin.Long? = null, - var username: kotlin.String? = null, - var firstName: kotlin.String? = null, - var lastName: kotlin.String? = null, - var email: kotlin.String? = null, - var password: kotlin.String? = null, - var phone: kotlin.String? = null, - var userStatus: kotlin.Int? = null, - - ) { - - companion object { } - - fun toApiModel(): User = User( - id = this.id, - username = this.username, - firstName = this.firstName, - lastName = this.lastName, - email = this.email, - password = this.password, - phone = this.phone, - userStatus = this.userStatus, - ) -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt deleted file mode 100644 index e33e8f02bbd0..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.client.request - -import com.android.volley.NetworkResponse -import com.android.volley.ParseError -import com.android.volley.Request -import com.android.volley.Response -import com.android.volley.toolbox.HttpHeaderParser -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import com.google.gson.JsonSyntaxException -import java.io.UnsupportedEncodingException -import java.nio.charset.Charset -import java.net.HttpURLConnection -import java.lang.reflect.Type -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime - -import org.openapitools.client.infrastructure.OffsetDateTimeAdapter -import org.openapitools.client.infrastructure.LocalDateTimeAdapter -import org.openapitools.client.infrastructure.LocalDateAdapter -import org.openapitools.client.infrastructure.ByteArrayAdapter - -class GsonRequest( - method: Int, - url: String, - private val body: Any?, - private val headers: Map?, - private val params: MutableMap?, - private val contentTypeForBody: String?, - private val encodingForParams: String?, - private val gsonAdapters: Map?, - private val type: Type, - private val listener: Response.Listener, - errorListener: Response.ErrorListener -) : Request(method, url, errorListener) { - - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - .apply { - gsonAdapters?.forEach { - this.registerTypeAdapter(it.key, it.value) - } - } - - val gson: Gson by lazy { - gsonBuilder.create() - } - - private var response: NetworkResponse? = null - - override fun deliverResponse(response: T?) { - listener.onResponse(response) - } - - override fun getParams(): MutableMap? = params ?: super.getParams() - - override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() - - override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() - - override fun getHeaders(): MutableMap { - val combined = HashMap() - combined.putAll(super.getHeaders()) - if (headers != null) { - combined.putAll(headers) - } - return combined - } - - override fun getBody(): ByteArray? { - if (body != null) { - return gson.toJson(body).toByteArray(Charsets.UTF_8) - } - return super.getBody() - } - - override fun parseNetworkResponse(response: NetworkResponse?): Response { - return try { - this.response = copyTo(response) - val json = String( - response?.data ?: ByteArray(0), - Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) - ) - Response.success( - gson.fromJson(json, type), - HttpHeaderParser.parseCacheHeaders(response) - ) - } catch (e: UnsupportedEncodingException) { - Response.error(ParseError(e)) - } catch (e: JsonSyntaxException) { - Response.error(ParseError(e)) - } - } - - private fun copyTo(response: NetworkResponse?): NetworkResponse { - return if (response != null) { - NetworkResponse( - response.statusCode, - response.data, - response.notModified, - response.networkTimeMs, - response.allHeaders - ) - } else { - // Return an empty response. - NetworkResponse( - HttpURLConnection.HTTP_BAD_METHOD, - ByteArray(0), - false, - 0, - emptyList() - ) - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt deleted file mode 100644 index 32f2350312cd..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt +++ /dev/null @@ -1,64 +0,0 @@ -package org.openapitools.client.request - -import com.android.volley.Request -import com.android.volley.Response -import java.io.UnsupportedEncodingException -import java.lang.reflect.Type -import java.net.URLEncoder -import java.text.ParseException -import java.text.SimpleDateFormat -import java.util.* -import java.time.format.DateTimeFormatter -import java.time.OffsetDateTime -import java.time.LocalDate - - -interface IRequestFactory { - - companion object { - /** - * ISO 8601 date time format. - * @see https://en.wikipedia.org/wiki/ISO_8601 - */ - fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) - fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) - - fun escapeString(str: String): String { - return try { - URLEncoder.encode(str, "UTF-8") - } catch (e: UnsupportedEncodingException) { - str - } - } - - fun parameterToString(param: Any?) = - when (param) { - null -> "" - is OffsetDateTime -> formatDateTime(param) - is Collection<*> -> { - val b = StringBuilder() - for (o in param) { - if (b.isNotEmpty()) { - b.append(",") - } - b.append(o.toString()) - } - b.toString() - } - else -> param.toString() - } - } - - - fun build( - method: Int, - url : String, - body: Any?, - headers: Map?, - queryParams: Map?, - formParams: Map?, - contentTypeForBody: String?, - type: Type, - responseListener: Response.Listener, - errorListener: Response.ErrorListener): Request -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt deleted file mode 100644 index 87d83e3a44a0..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt +++ /dev/null @@ -1,87 +0,0 @@ -// Knowing the details of an operation it will produce a call to a Volley Request constructor -package org.openapitools.client.request - - -import com.android.volley.Request -import com.android.volley.Response -import android.util.Base64 -import org.openapitools.client.request.IRequestFactory.Companion.escapeString -import java.lang.reflect.Type -import java.util.Locale -import java.util.UUID - -class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { - - companion object Authentication { - // Where a header factory requires parameters a client will need to bind these - // TODO Generate appropriate header factories based on settings - // TODO: Oauth not implemented yet - comment out below as OAuth does not exist - // Api Key auth supports query header and cookie. - // Query is supported in the path generation only with a hardcoded value. - // TODO: Not sure about cookie auth form - // If implementing api key in query parameter use the ^isKeyInHeader property - - val apiKeyAuthHeaderFactoryBuilder = { - paramName: String, apiKeyPrefix: String?, apiKey: String? -> { - mapOf(paramName to - if (apiKeyPrefix != null) { - "$apiKeyPrefix $apiKey" - } else { - apiKey!! - } - ) - } - } - - } - - - /** - * {@inheritDoc} - */ - @Suppress("UNCHECKED_CAST") - override fun build( - method: Int, - url: String, - body: Any?, - headers: Map?, - queryParams: Map?, - formParams: Map?, - contentTypeForBody: String?, - type: Type, - responseListener: Response.Listener, - errorListener: Response.ErrorListener - ): Request { - val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) - // Factory built and aftermarket - // Merge the after market headers on top of the base ones in case we are overriding per call auth - val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } - - // If we decide to support auth parameters in the url, then you will reference them by supplying a url string - // with known variable name references in the string. We will then apply - val updatedUrl = if (!queryParams.isNullOrEmpty()) { - queryParams.asSequence().fold("$url?") {acc, param -> - "$acc${escapeString(param.key)}=${escapeString(param.value)}&" - }.trimEnd('&') - } else { - url - } - - val request = GsonRequest( - method, - updatedUrl, - body, - allHeaders, - formParams?.toMutableMap(), - contentTypeForBody, - null, - gsonAdapters, - type, - responseListener, - errorListener) - - postProcessors.forEach{ it.invoke(request)} - - return request - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt deleted file mode 100644 index 23369fd5528f..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * 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 org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.PetApi -import org.openapitools.client.models.ModelApiResponse -import org.openapitools.client.models.Pet - -class PetApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of PetApi - //val apiInstance = PetApi() - - // to test addPet - should("test addPet") { - // uncomment below to test addPet - //val body : Pet = // Pet | Pet object that needs to be added to the store - //apiInstance.addPet(body) - } - - // to test deletePet - should("test deletePet") { - // uncomment below to test deletePet - //val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete - //val apiKey : kotlin.String = apiKey_example // kotlin.String | - //apiInstance.deletePet(petId, apiKey) - } - - // to test findPetsByStatus - should("test findPetsByStatus") { - // uncomment below to test findPetsByStatus - //val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter - //val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) - //result shouldBe ("TODO") - } - - // to test findPetsByTags - should("test findPetsByTags") { - // uncomment below to test findPetsByTags - //val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by - //val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) - //result shouldBe ("TODO") - } - - // to test getPetById - should("test getPetById") { - // uncomment below to test getPetById - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return - //val result : Pet = apiInstance.getPetById(petId) - //result shouldBe ("TODO") - } - - // to test updatePet - should("test updatePet") { - // uncomment below to test updatePet - //val body : Pet = // Pet | Pet object that needs to be added to the store - //apiInstance.updatePet(body) - } - - // to test updatePetWithForm - should("test updatePetWithForm") { - // uncomment below to test updatePetWithForm - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated - //val name : kotlin.String = name_example // kotlin.String | Updated name of the pet - //val status : kotlin.String = status_example // kotlin.String | Updated status of the pet - //apiInstance.updatePetWithForm(petId, name, status) - } - - // to test uploadFile - should("test uploadFile") { - // uncomment below to test uploadFile - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update - //val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server - //val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload - //val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) - //result shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt deleted file mode 100644 index f16f81478b87..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** - * - * 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 org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.StoreApi -import org.openapitools.client.models.Order - -class StoreApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of StoreApi - //val apiInstance = StoreApi() - - // to test deleteOrder - should("test deleteOrder") { - // uncomment below to test deleteOrder - //val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted - //apiInstance.deleteOrder(orderId) - } - - // to test getInventory - should("test getInventory") { - // uncomment below to test getInventory - //val result : kotlin.collections.Map = apiInstance.getInventory() - //result shouldBe ("TODO") - } - - // to test getOrderById - should("test getOrderById") { - // uncomment below to test getOrderById - //val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched - //val result : Order = apiInstance.getOrderById(orderId) - //result shouldBe ("TODO") - } - - // to test placeOrder - should("test placeOrder") { - // uncomment below to test placeOrder - //val body : Order = // Order | order placed for purchasing the pet - //val result : Order = apiInstance.placeOrder(body) - //result shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt deleted file mode 100644 index 3d84df02f5e6..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt +++ /dev/null @@ -1,89 +0,0 @@ -/** - * - * 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 org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.UserApi -import org.openapitools.client.models.User - -class UserApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of UserApi - //val apiInstance = UserApi() - - // to test createUser - should("test createUser") { - // uncomment below to test createUser - //val body : User = // User | Created user object - //apiInstance.createUser(body) - } - - // to test createUsersWithArrayInput - should("test createUsersWithArrayInput") { - // uncomment below to test createUsersWithArrayInput - //val body : kotlin.collections.List = // kotlin.collections.List | List of user object - //apiInstance.createUsersWithArrayInput(body) - } - - // to test createUsersWithListInput - should("test createUsersWithListInput") { - // uncomment below to test createUsersWithListInput - //val body : kotlin.collections.List = // kotlin.collections.List | List of user object - //apiInstance.createUsersWithListInput(body) - } - - // to test deleteUser - should("test deleteUser") { - // uncomment below to test deleteUser - //val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted - //apiInstance.deleteUser(username) - } - - // to test getUserByName - should("test getUserByName") { - // uncomment below to test getUserByName - //val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. - //val result : User = apiInstance.getUserByName(username) - //result shouldBe ("TODO") - } - - // to test loginUser - should("test loginUser") { - // uncomment below to test loginUser - //val username : kotlin.String = username_example // kotlin.String | The user name for login - //val password : kotlin.String = password_example // kotlin.String | The password for login in clear text - //val result : kotlin.String = apiInstance.loginUser(username, password) - //result shouldBe ("TODO") - } - - // to test logoutUser - should("test logoutUser") { - // uncomment below to test logoutUser - //apiInstance.logoutUser() - } - - // to test updateUser - should("test updateUser") { - // uncomment below to test updateUser - //val username : kotlin.String = username_example // kotlin.String | name that need to be deleted - //val body : User = // User | Updated user object - //apiInstance.updateUser(username, body) - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt deleted file mode 100644 index 61fe0207cf0a..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.ModelApiResponse - -class ModelApiResponseTest : ShouldSpec() { - init { - // uncomment below to create an instance of ModelApiResponse - //val modelInstance = ModelApiResponse() - - // to test the property `code` - should("test code") { - // uncomment below to test the property - //modelInstance.code shouldBe ("TODO") - } - - // to test the property `type` - should("test type") { - // uncomment below to test the property - //modelInstance.type shouldBe ("TODO") - } - - // to test the property `message` - should("test message") { - // uncomment below to test the property - //modelInstance.message shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt deleted file mode 100644 index 4cfde8e19c63..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Category - -class CategoryTest : ShouldSpec() { - init { - // uncomment below to create an instance of Category - //val modelInstance = Category() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/OrderTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/OrderTest.kt deleted file mode 100644 index 1f2eb1dfa888..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/OrderTest.kt +++ /dev/null @@ -1,65 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Order - -class OrderTest : ShouldSpec() { - init { - // uncomment below to create an instance of Order - //val modelInstance = Order() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `petId` - should("test petId") { - // uncomment below to test the property - //modelInstance.petId shouldBe ("TODO") - } - - // to test the property `quantity` - should("test quantity") { - // uncomment below to test the property - //modelInstance.quantity shouldBe ("TODO") - } - - // to test the property `shipDate` - should("test shipDate") { - // uncomment below to test the property - //modelInstance.shipDate shouldBe ("TODO") - } - - // to test the property `status` - Order Status - should("test status") { - // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") - } - - // to test the property `complete` - should("test complete") { - // uncomment below to test the property - //modelInstance.complete shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/PetTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/PetTest.kt deleted file mode 100644 index ef7128c4d0b9..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/PetTest.kt +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Pet -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -class PetTest : ShouldSpec() { - init { - // uncomment below to create an instance of Pet - //val modelInstance = Pet() - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - // to test the property `photoUrls` - should("test photoUrls") { - // uncomment below to test the property - //modelInstance.photoUrls shouldBe ("TODO") - } - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `category` - should("test category") { - // uncomment below to test the property - //modelInstance.category shouldBe ("TODO") - } - - // to test the property `tags` - should("test tags") { - // uncomment below to test the property - //modelInstance.tags shouldBe ("TODO") - } - - // to test the property `status` - pet status in the store - should("test status") { - // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/TagTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/TagTest.kt deleted file mode 100644 index 65e729bb4985..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/TagTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Tag - -class TagTest : ShouldSpec() { - init { - // uncomment below to create an instance of Tag - //val modelInstance = Tag() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - } -} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/UserTest.kt b/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/UserTest.kt deleted file mode 100644 index 02677c5a58ff..000000000000 --- a/samples/client/petstore/kotlin-jvm-volley/src/test/kotlin/org/openapitools/client/models/UserTest.kt +++ /dev/null @@ -1,77 +0,0 @@ -/** - * - * 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 org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.User - -class UserTest : ShouldSpec() { - init { - // uncomment below to create an instance of User - //val modelInstance = User() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `username` - should("test username") { - // uncomment below to test the property - //modelInstance.username shouldBe ("TODO") - } - - // to test the property `firstName` - should("test firstName") { - // uncomment below to test the property - //modelInstance.firstName shouldBe ("TODO") - } - - // to test the property `lastName` - should("test lastName") { - // uncomment below to test the property - //modelInstance.lastName shouldBe ("TODO") - } - - // to test the property `email` - should("test email") { - // uncomment below to test the property - //modelInstance.email shouldBe ("TODO") - } - - // to test the property `password` - should("test password") { - // uncomment below to test the property - //modelInstance.password shouldBe ("TODO") - } - - // to test the property `phone` - should("test phone") { - // uncomment below to test the property - //modelInstance.phone shouldBe ("TODO") - } - - // to test the property `userStatus` - User Status - should("test userStatus") { - // uncomment below to test the property - //modelInstance.userStatus shouldBe ("TODO") - } - - } -}