Skip to content

Commit e251534

Browse files
nocontributescarf005
authored andcommitted
chore: update samples
1 parent 46decb7 commit e251534

File tree

1,180 files changed

+95663
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,180 files changed

+95663
-0
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
/**
2+
*
3+
* Please note:
4+
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
5+
* Do not edit this file manually.
6+
*
7+
*/
8+
9+
@file:Suppress(
10+
"ArrayInDataClass",
11+
"EnumEntryName",
12+
"RemoveRedundantQualifierName",
13+
"UnusedImport"
14+
)
15+
16+
package org.openapitools.client.apis
17+
18+
import java.io.IOException
19+
import okhttp3.Call
20+
import okhttp3.HttpUrl
21+
22+
23+
import com.squareup.moshi.Json
24+
25+
import org.openapitools.client.infrastructure.ApiClient
26+
import org.openapitools.client.infrastructure.ApiResponse
27+
import org.openapitools.client.infrastructure.ClientException
28+
import org.openapitools.client.infrastructure.ClientError
29+
import org.openapitools.client.infrastructure.ServerException
30+
import org.openapitools.client.infrastructure.ServerError
31+
import org.openapitools.client.infrastructure.MultiValueMap
32+
import org.openapitools.client.infrastructure.PartConfig
33+
import org.openapitools.client.infrastructure.RequestConfig
34+
import org.openapitools.client.infrastructure.RequestMethod
35+
import org.openapitools.client.infrastructure.ResponseType
36+
import org.openapitools.client.infrastructure.Success
37+
import org.openapitools.client.infrastructure.toMultiValue
38+
39+
open class AuthApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
40+
companion object {
41+
@JvmStatic
42+
val defaultBasePath: String by lazy {
43+
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://localhost:3000")
44+
}
45+
}
46+
47+
/**
48+
* POST /auth/http/basic
49+
* To test HTTP basic authentication
50+
* To test HTTP basic authentication
51+
* @return kotlin.String
52+
* @throws IllegalStateException If the request is not correctly configured
53+
* @throws IOException Rethrows the OkHttp execute method exception
54+
* @throws UnsupportedOperationException If the API returns an informational or redirection response
55+
* @throws ClientException If the API returns a client error response
56+
* @throws ServerException If the API returns a server error response
57+
*/
58+
@Suppress("UNCHECKED_CAST")
59+
@Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class)
60+
fun testAuthHttpBasic() : kotlin.String {
61+
val localVarResponse = testAuthHttpBasicWithHttpInfo()
62+
63+
return when (localVarResponse.responseType) {
64+
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
65+
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
66+
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
67+
ResponseType.ClientError -> {
68+
val localVarError = localVarResponse as ClientError<*>
69+
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
70+
}
71+
ResponseType.ServerError -> {
72+
val localVarError = localVarResponse as ServerError<*>
73+
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()} ${localVarError.body}", localVarError.statusCode, localVarResponse)
74+
}
75+
}
76+
}
77+
78+
/**
79+
* POST /auth/http/basic
80+
* To test HTTP basic authentication
81+
* To test HTTP basic authentication
82+
* @return ApiResponse<kotlin.String?>
83+
* @throws IllegalStateException If the request is not correctly configured
84+
* @throws IOException Rethrows the OkHttp execute method exception
85+
*/
86+
@Suppress("UNCHECKED_CAST")
87+
@Throws(IllegalStateException::class, IOException::class)
88+
fun testAuthHttpBasicWithHttpInfo() : ApiResponse<kotlin.String?> {
89+
val localVariableConfig = testAuthHttpBasicRequestConfig()
90+
91+
return request<Unit, kotlin.String>(
92+
localVariableConfig
93+
)
94+
}
95+
96+
/**
97+
* To obtain the request config of the operation testAuthHttpBasic
98+
*
99+
* @return RequestConfig
100+
*/
101+
fun testAuthHttpBasicRequestConfig() : RequestConfig<Unit> {
102+
val localVariableBody = null
103+
val localVariableQuery: MultiValueMap = mutableMapOf()
104+
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
105+
localVariableHeaders["Accept"] = "text/plain"
106+
107+
return RequestConfig(
108+
method = RequestMethod.POST,
109+
path = "/auth/http/basic",
110+
query = localVariableQuery,
111+
headers = localVariableHeaders,
112+
requiresAuthentication = true,
113+
body = localVariableBody
114+
)
115+
}
116+
117+
/**
118+
* POST /auth/http/bearer
119+
* To test HTTP bearer authentication
120+
* To test HTTP bearer authentication
121+
* @return kotlin.String
122+
* @throws IllegalStateException If the request is not correctly configured
123+
* @throws IOException Rethrows the OkHttp execute method exception
124+
* @throws UnsupportedOperationException If the API returns an informational or redirection response
125+
* @throws ClientException If the API returns a client error response
126+
* @throws ServerException If the API returns a server error response
127+
*/
128+
@Suppress("UNCHECKED_CAST")
129+
@Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class)
130+
fun testAuthHttpBearer() : kotlin.String {
131+
val localVarResponse = testAuthHttpBearerWithHttpInfo()
132+
133+
return when (localVarResponse.responseType) {
134+
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
135+
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
136+
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
137+
ResponseType.ClientError -> {
138+
val localVarError = localVarResponse as ClientError<*>
139+
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
140+
}
141+
ResponseType.ServerError -> {
142+
val localVarError = localVarResponse as ServerError<*>
143+
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()} ${localVarError.body}", localVarError.statusCode, localVarResponse)
144+
}
145+
}
146+
}
147+
148+
/**
149+
* POST /auth/http/bearer
150+
* To test HTTP bearer authentication
151+
* To test HTTP bearer authentication
152+
* @return ApiResponse<kotlin.String?>
153+
* @throws IllegalStateException If the request is not correctly configured
154+
* @throws IOException Rethrows the OkHttp execute method exception
155+
*/
156+
@Suppress("UNCHECKED_CAST")
157+
@Throws(IllegalStateException::class, IOException::class)
158+
fun testAuthHttpBearerWithHttpInfo() : ApiResponse<kotlin.String?> {
159+
val localVariableConfig = testAuthHttpBearerRequestConfig()
160+
161+
return request<Unit, kotlin.String>(
162+
localVariableConfig
163+
)
164+
}
165+
166+
/**
167+
* To obtain the request config of the operation testAuthHttpBearer
168+
*
169+
* @return RequestConfig
170+
*/
171+
fun testAuthHttpBearerRequestConfig() : RequestConfig<Unit> {
172+
val localVariableBody = null
173+
val localVariableQuery: MultiValueMap = mutableMapOf()
174+
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
175+
localVariableHeaders["Accept"] = "text/plain"
176+
177+
return RequestConfig(
178+
method = RequestMethod.POST,
179+
path = "/auth/http/bearer",
180+
query = localVariableQuery,
181+
headers = localVariableHeaders,
182+
requiresAuthentication = true,
183+
body = localVariableBody
184+
)
185+
}
186+
187+
188+
private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String =
189+
HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0]
190+
}

0 commit comments

Comments
 (0)